feat(system):查询信息根据编码和组织ID
This commit is contained in:
+13
@@ -580,6 +580,19 @@ public class ExpenseAccountApplicationService {
|
|||||||
return expenseAccountDomainService.getInfoByCode2(subjectCode,topOrganizationId);
|
return expenseAccountDomainService.getInfoByCode2(subjectCode,topOrganizationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据编码和组织ID查询费用科目信息
|
||||||
|
*/
|
||||||
|
public ExpenseAccountPO getInfoByOrgAndCode(String subjectCode, Long organizationId) {
|
||||||
|
if(!StringUtils.isNotEmpty(subjectCode)){
|
||||||
|
throw new ServiceException("费用科目编码不能为空");
|
||||||
|
}
|
||||||
|
if(organizationId == null){
|
||||||
|
throw new ServiceException("组织ID不能为空");
|
||||||
|
}
|
||||||
|
return expenseAccountDomainService.getInfoByOrgAndCode(subjectCode, organizationId);
|
||||||
|
}
|
||||||
|
|
||||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
||||||
setDataPermissionForSearch(searchExpenseAccountDO);
|
setDataPermissionForSearch(searchExpenseAccountDO);
|
||||||
return expenseAccountDomainService.selectExpenseAccount(searchExpenseAccountDO);
|
return expenseAccountDomainService.selectExpenseAccount(searchExpenseAccountDO);
|
||||||
|
|||||||
+5
@@ -58,6 +58,11 @@ public interface IExpenseAccountService extends IService<ExpenseAccount>
|
|||||||
*/
|
*/
|
||||||
ExpenseAccountPO getInfoByCode(ExpenseAccountDO expenseAccountDO);
|
ExpenseAccountPO getInfoByCode(ExpenseAccountDO expenseAccountDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据费用科目code和组织ID查询费用信息
|
||||||
|
*/
|
||||||
|
ExpenseAccountPO getInfoByOrgAndCode(ExpenseAccountDO expenseAccountDO);
|
||||||
|
|
||||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
||||||
|
|
||||||
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
||||||
|
|||||||
+5
@@ -39,6 +39,11 @@ public interface ExpenseAccountMapper extends BaseMapper<ExpenseAccount>
|
|||||||
*/
|
*/
|
||||||
ExpenseAccountPO getInfoByCode(@Param("expenseAccountDO") ExpenseAccountDO expenseAccountDO);
|
ExpenseAccountPO getInfoByCode(@Param("expenseAccountDO") ExpenseAccountDO expenseAccountDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据费用科目code和组织ID查询费用信息
|
||||||
|
*/
|
||||||
|
ExpenseAccountPO getInfoByOrgAndCode(@Param("expenseAccountDO") ExpenseAccountDO expenseAccountDO);
|
||||||
|
|
||||||
public List<QueryExpenseAccountPO> selectExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
public List<QueryExpenseAccountPO> selectExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
||||||
|
|
||||||
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
||||||
|
|||||||
+5
@@ -129,6 +129,11 @@ public class ExpenseAccountImpl extends ServiceImpl<ExpenseAccountMapper, Expens
|
|||||||
return expenseAccountMapper.getInfoByCode(expenseAccountDO);
|
return expenseAccountMapper.getInfoByCode(expenseAccountDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExpenseAccountPO getInfoByOrgAndCode(ExpenseAccountDO expenseAccountDO) {
|
||||||
|
return expenseAccountMapper.getInfoByOrgAndCode(expenseAccountDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统科目查询
|
* 系统科目查询
|
||||||
* 社会车辆:service_items_code='SHCL',upper_subject_code='shcl_clyf',society_status=1
|
* 社会车辆:service_items_code='SHCL',upper_subject_code='shcl_clyf',society_status=1
|
||||||
|
|||||||
+10
@@ -101,6 +101,16 @@ public class ExpenseAccountDomainService {
|
|||||||
expenseAccountDO.setTopOrganizationId(topOrganizationId);
|
expenseAccountDO.setTopOrganizationId(topOrganizationId);
|
||||||
return expenseAccountService.getInfoByCode(expenseAccountDO);
|
return expenseAccountService.getInfoByCode(expenseAccountDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据编码和组织ID查询费用科目信息
|
||||||
|
*/
|
||||||
|
public ExpenseAccountPO getInfoByOrgAndCode(String subjectCode, Long organizationId) {
|
||||||
|
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
|
||||||
|
expenseAccountDO.setSubjectCode(subjectCode);
|
||||||
|
expenseAccountDO.setOrganizationId(organizationId);
|
||||||
|
return expenseAccountService.getInfoByOrgAndCode(expenseAccountDO);
|
||||||
|
}
|
||||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
||||||
return expenseAccountService.selectExpenseAccount(searchExpenseAccountDO);
|
return expenseAccountService.selectExpenseAccount(searchExpenseAccountDO);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -328,5 +328,13 @@ public class ExpenseAccountApi extends BaseController{
|
|||||||
return AjaxResult.success(expenseAccountPO);
|
return AjaxResult.success(expenseAccountPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据code和组织ID获取数据")
|
||||||
|
@GetMapping(value = "/getInfoByOrgAndCode")
|
||||||
|
public AjaxResult getInfoByOrgAndCode(@RequestParam("subjectCode") String subjectCode,@RequestParam("organizationId") Long organizationId)
|
||||||
|
{
|
||||||
|
ExpenseAccountPO expenseAccountPO = expenseAccountApplicationService.getInfoByOrgAndCode(subjectCode, organizationId);
|
||||||
|
return AjaxResult.success(expenseAccountPO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -151,6 +151,22 @@
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getInfoByOrgAndCode" resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO">
|
||||||
|
SELECT
|
||||||
|
a.* ,
|
||||||
|
b.tax_rate,
|
||||||
|
b.service_items_name,
|
||||||
|
b.service_items_code
|
||||||
|
FROM
|
||||||
|
expense_account a
|
||||||
|
LEFT JOIN service_items_manage b ON a.service_items_manage_id = b.service_items_manage_id
|
||||||
|
WHERE
|
||||||
|
a.del_flag = 1
|
||||||
|
AND a.organization_id = #{expenseAccountDO.organizationId}
|
||||||
|
AND a.subject_code = #{expenseAccountDO.subjectCode}
|
||||||
|
AND a.status = 1
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<sql id="common_where_two">
|
<sql id="common_where_two">
|
||||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user