From 76ba98a889465e492387ccaa4afb16f0a124f38f Mon Sep 17 00:00:00 2001 From: Yen Date: Thu, 4 Jul 2024 16:22:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=80=80=E5=9B=9E=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/so/VtbVerificationBatchQuery.java | 4 ++ .../VtbVerificationBatchController.java | 24 +++++++-- .../mapper/seeyon/CommonCheckMapper.xml | 51 ++++++++++++++++++- .../mapper/vtb/VtbVerificationBatchMapper.xml | 13 +++++ 4 files changed, 88 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java b/src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java index d2b62b72..5c00ef6c 100644 --- a/src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java +++ b/src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java @@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; +import java.util.List; /** * @author YenHex @@ -18,6 +19,7 @@ import java.time.LocalDateTime; @Data public class VtbVerificationBatchQuery { + private Integer loadChild; /** 批次编码 */ private String vtbBatchCode; @@ -51,4 +53,6 @@ public class VtbVerificationBatchQuery { /** 创建时间 */ private LocalDateTime batchEndTime; + private List userIds; + } diff --git a/src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java b/src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java index 0ebf8358..c8237601 100644 --- a/src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java +++ b/src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java @@ -14,6 +14,7 @@ import com.qs.serve.modules.seeyon.entity.bo.CtpAddNodeParam; import com.qs.serve.modules.seeyon.entity.dto.CtpAffairPageSo; import com.qs.serve.modules.seeyon.service.SeeYonRequestService; import com.qs.serve.modules.sys.entity.SysUser; +import com.qs.serve.modules.sys.service.SysPostUserService; import com.qs.serve.modules.tbs.common.TbsSeeYonConst; import com.qs.serve.modules.tbs.entity.TbsActivitySubjectYarn; import com.qs.serve.modules.tbs.entity.TbsCostApply; @@ -49,6 +50,7 @@ import java.util.Map; @RequestMapping("vtb/verificationBatch") public class VtbVerificationBatchController { + private SysPostUserService postUserService; private SeeYonRequestService seeYonService; private VtbVerificationBatchService vtbVerificationBatchService; private VtbVerificationService vtbVerificationService; @@ -81,6 +83,25 @@ public class VtbVerificationBatchController { return R.byPageHelperList(list); } + /** + * 翻页2(连表查询-left join tbs_cost_apply) + * @param query + * @return + */ + @GetMapping("/pageMy") + public R> getPageMy(VtbVerificationBatchQuery query){ + String userId = AuthContextUtils.getSysUserId(); + List userIds = new ArrayList<>(); + if(query.getLoadChild()!=null&&query.getLoadChild().equals(1)){ + userIds = postUserService.listByChildIds(userId); + query.setUserIds(userIds); + } + userIds.add(userId); + PageUtil.startPage(); + List list = vtbVerificationBatchService.list2(query); + return R.byPageHelperList(list); + } + /** * ID查询 * @param id @@ -89,9 +110,6 @@ public class VtbVerificationBatchController { @GetMapping("/getById/{id}") public R getById(@PathVariable("id") String id){ VtbVerificationBatch batch = vtbVerificationBatchService.getById(id); - if(batch.getVtbBatchStatus().equals(VtbVerificationBatch.BatchState.CHECKING)){ - //TODO 补偿回调 - } List verificationList = vtbVerificationService .list(new LambdaQueryWrapper() .eq(VtbVerification::getBatchId,batch.getId())); diff --git a/src/main/resources/mapper/seeyon/CommonCheckMapper.xml b/src/main/resources/mapper/seeyon/CommonCheckMapper.xml index f4c7bbb9..652e0fad 100644 --- a/src/main/resources/mapper/seeyon/CommonCheckMapper.xml +++ b/src/main/resources/mapper/seeyon/CommonCheckMapper.xml @@ -118,6 +118,32 @@ + + select + 'BatchCheckCost' as target_type, + vtb_verification_batch.id as target_id, + vtb_verification_batch.vtb_batch_code as target_code, + vtb_verification_batch.vtb_batch_code as title, + vtb_verification_batch.create_time as `time` + from vtb_verification_batch + where vtb_verification_batch.vtb_batch_status = 3 + and vtb_verification_batch.user_id = #{query.userId} + and vtb_verification_batch.del_flag = 0 + + and vtb_verification_batch.batch_title like concat('%',#{query.title},'%') + + + and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%') + + + and vtb_verification_batch.create_time >= #{query.startDate} + + + and vtb_verification_batch.create_time <= #{query.endDate} + + + + select 'CostBill' as target_type, @@ -222,6 +248,29 @@ and budget_change.submit_time <= #{query.endDate} + union + select + 'BatchCheckCost' as target_type, + vtb_verification_batch.id as target_id, + vtb_verification_batch.vtb_batch_code as target_code, + vtb_verification_batch.vtb_batch_code as title, + vtb_verification_batch.create_time as `time` + from vtb_verification_batch + where vtb_verification_batch.vtb_batch_status = 3 + and vtb_verification_batch.user_id = #{query.userId} + and vtb_verification_batch.del_flag = 0 + + and vtb_verification_batch.batch_title like concat('%',#{query.title},'%') + + + and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%') + + + and vtb_verification_batch.create_time >= #{query.startDate} + + + and vtb_verification_batch.create_time <= #{query.endDate} + limit #{query.startRow},#{query.pageSize} @@ -397,7 +446,7 @@ and vtb_verification_batch.batch_title like concat('%',#{query.title},'%') - and vtb_verification_batch.batch_code like concat('%',#{query.targetCode},'%') + and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%') and vtb_verification_batch.create_time >= #{query.startDate} diff --git a/src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml b/src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml index faa30744..29e857f0 100644 --- a/src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml +++ b/src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml @@ -72,6 +72,7 @@ , tbs_cost_apply.`code` as cost_code, tbs_cost_apply.`charge_theme`, + tbs_cost_apply.`charge_state`, tbs_cost_apply.`supplier_biz_region_first_name`, tbs_cost_apply.`supplier_biz_region_second_name`, tbs_cost_apply.`supplier_biz_region_third_name`, @@ -95,11 +96,23 @@ and `vtb_verification_batch`.`create_time` >= #{query.batchStartTime} and `vtb_verification_batch`.`create_time` <= #{query.batchEndTime} + + and ( `vtb_verification_batch`.`user_id` in + + #{selectId} + + or `vtb_verification_batch`.`ext_user_id` in + + #{selectId} + ) + + and `tbs_cost_apply`.`code` like concat('%', #{query.costCode},'%') and `tbs_cost_apply`.`supplier_biz_region_first_name` like concat('%', #{query.supplierBizRegionFirstName},'%') and `tbs_cost_apply`.`supplier_biz_region_second_name` like concat('%',#{query.supplierBizRegionSecondName},'%') and `tbs_cost_apply`.`supplier_biz_region_third_name` like concat('%',#{query.supplierBizRegionThirdName},'%') + order by vtb_verification_batch.id desc