Explorar el Código

账户管理接口-收支明细接口调整

ZhangWenQiang hace 4 años
padre
commit
5c25748087

+ 1 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/xml/HlwCompanyAccountDetailMapper.xml

@@ -871,9 +871,8 @@
 		<include refid="hlwCompanyAccountDetailColumns"/>
 		FROM hlw_company_account_detail a
 		<include refid="hlwCompanyAccountDetailJoins"/>
-		left join hlw_company_account hca on hca.id = a.company_account_id
 		<where>
-			hca.company_id = #{hlwCompanyAccount.companyId}
+			a.company_account_id = #{hlwCompanyAccount.id}
 			<if test="hlwCompanyAccount.type != null">
 				and a.type = #{hlwCompanyAccount.type}
 			</if>

+ 20 - 7
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/impl/HlwCompanyAccountDetailServiceImpl.java

@@ -283,14 +283,27 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
         HlwCompany hlwCompany = hlwCompanyService.getByCompanyCode(hlwCompanyAccount.getCompanyCode());
         if (hlwCompany != null) {
             hlwCompanyAccount.setCompanyId(hlwCompany.getId());
-            if (hlwCompanyAccount.getPageSize() == -1) {
-                list = baseMapper.detailListNoPage(hlwCompanyAccount);
-                return Result.ok(list);
+            //获取企业账户
+            QueryWrapper<HlwCompanyAccount> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("application_id", hlwCompanyAccount.getApplicationId());
+            queryWrapper.eq("company_id", hlwCompanyAccount.getCompanyId());
+            if (hlwCompanyAccount.getCpType() == 1) {
+                queryWrapper.eq("subcontractor_id", hlwCompanyAccount.getSubcontractorId());
             } else {
-                Page<HlwCompanyAccountDetail> page = new Page<HlwCompanyAccountDetail>(hlwCompanyAccount.getPageNo(), hlwCompanyAccount.getPageSize());
-                list = baseMapper.detailList(page, hlwCompanyAccount);
-                pageList = page.setRecords(list);
-                return Result.ok(pageList);
+                queryWrapper.eq("cp_id", hlwCompanyAccount.getSubcontractorId());
+            }
+            HlwCompanyAccount hlwCompanyAccountDto = hlwCompanyAccountService.getOne(queryWrapper);
+            if (hlwCompanyAccountDto != null) {
+                hlwCompanyAccount.setId(hlwCompanyAccountDto.getId());
+                if (hlwCompanyAccount.getPageSize() == -1) {
+                    list = baseMapper.detailListNoPage(hlwCompanyAccount);
+                    return Result.ok(list);
+                } else {
+                    Page<HlwCompanyAccountDetail> page = new Page<HlwCompanyAccountDetail>(hlwCompanyAccount.getPageNo(), hlwCompanyAccount.getPageSize());
+                    list = baseMapper.detailList(page, hlwCompanyAccount);
+                    pageList = page.setRecords(list);
+                    return Result.ok(pageList);
+                }
             }
         }
         return Result.error("暂无数据");