From 8cf7a0a902e30148eeb88572f993d0eb35c89932 Mon Sep 17 00:00:00 2001 From: Yen Date: Tue, 4 Jun 2024 11:21:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A1=E6=89=B9=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=A2=84=E7=AE=97=E5=8D=A0=E7=94=A8=E5=88=97=E8=A1=A8=E6=8B=93?= =?UTF-8?q?=E5=B1=95=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=20fix=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=BF=E7=AD=96=E7=8A=B6=E6=80=81=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tbs/entity/so/TbsScheduleItemSearch.java | 12 ++++++++++ .../tbs/mapper/TbsBudgetLog2Mapper.java | 1 + .../TbsScheduleItemBudgetServiceImpl.java | 2 +- .../tzc/controller/TzcPolicyController.java | 11 +++++++++- .../resources/mapper/tbs/TbsBudget2Mapper.xml | 22 +++++++++++++++++-- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java b/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java index 5c5da5fb..c85128ba 100644 --- a/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java +++ b/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java @@ -65,4 +65,16 @@ public class TbsScheduleItemSearch { private Integer pageSize; + /** + * 用于查询预算审批中的数据 + */ + private String type; + private String tarCode; + private String tarTitle; + private String supplierCode; + private String supplierName; + private String userCode; + private String userName; + + } diff --git a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java index ca243a4d..85b88a2f 100644 --- a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java +++ b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java @@ -80,6 +80,7 @@ public interface TbsBudgetLog2Mapper extends BaseMapper { */ @InterceptorIgnore(tenantLine = "true") List getBudgetLogCheckingList( + @Param("query")TbsScheduleItemSearch param, @Param("selectIds") List ids ,@Param("scheduleItemBudgetIds") List scheduleItemBudgetIds , @Param("policyNumbers")List policyNumbers diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java index 74048d31..36682694 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java @@ -390,7 +390,7 @@ public class TbsScheduleItemBudgetServiceImpl extends ServiceImpl budgetLogs = tbsBudgetLog2Mapper.getBudgetLogCheckingList(new ArrayList<>(budgetIds),param.getScheduleItemBudgetIds(), BudgetLogOptFlag.finalPolicyOptFlag,BudgetLogOptFlag.finalCostOptFlag); + List budgetLogs = tbsBudgetLog2Mapper.getBudgetLogCheckingList(param,new ArrayList<>(budgetIds),param.getScheduleItemBudgetIds(), BudgetLogOptFlag.finalPolicyOptFlag,BudgetLogOptFlag.finalCostOptFlag); return budgetLogs; } diff --git a/src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java b/src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java index 2c39e326..4baea14e 100644 --- a/src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java +++ b/src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java @@ -184,6 +184,15 @@ public class TzcPolicyController { public R getById(@PathVariable("id") String id){ TzcPolicy tzcPolicy = tzcPolicyService.getById(id); if(tzcPolicy!=null){ + if(tzcPolicy.getPolicyStatus().equals(TzcPolicyStatus.Status_1_Checking)){ + //尝试进行补偿 + try { + tzcPolicyOperationService.runCompensate(id); + tzcPolicy = tzcPolicyService.getById(id); + }catch (Exception e){ + + } + } List policyItemList = tzcPolicyItemService.listByPolicyId(tzcPolicy.getId()); tzcPolicy.setPolicyItemList(policyItemList); } @@ -450,7 +459,7 @@ public class TzcPolicyController { * @param id * @return */ - @PostMapping("/cancellation/{id}") + @DeleteMapping("/cancellation/{id}") public R cancellation(@PathVariable Long id){ List tzcPolicyItemList = tzcPolicyItemService.listByPolicyId(id); List itemIds = tzcPolicyItemList.stream().map(TzcPolicyItem::getId).collect(Collectors.toList()); diff --git a/src/main/resources/mapper/tbs/TbsBudget2Mapper.xml b/src/main/resources/mapper/tbs/TbsBudget2Mapper.xml index 84d4d79c..d31136e7 100644 --- a/src/main/resources/mapper/tbs/TbsBudget2Mapper.xml +++ b/src/main/resources/mapper/tbs/TbsBudget2Mapper.xml @@ -144,7 +144,7 @@ tbs_cost_apply.id as tar_id, tbs_cost_apply.code as tar_code, tbs_cost_apply.charge_theme as tar_title, - sum(tbs_budget_log.amount) as total_amount, + -sum(tbs_budget_log.amount) as total_amount, tbs_cost_apply.supplier_code, tbs_cost_apply.supplier_name, tbs_cost_apply.user_code, @@ -168,6 +168,15 @@ #{selectId} + + and 1=0 + and tbs_cost_apply.code like concat('%',#{query.tarCode},'%') + and tbs_cost_apply.charge_theme like concat('%',#{query.tarTitle},'%') + and tbs_cost_apply.supplier_code like concat('%',#{query.supplierCode},'%') + and tbs_cost_apply.supplier_name like concat('%',#{query.supplierName},'%') + and tbs_cost_apply.user_code like concat('%',#{query.userCode},'%') + and tbs_cost_apply.user_name like concat('%',#{query.userName},'%') + group by tbs_budget_log.cost_apply_id union @@ -177,7 +186,7 @@ tzc_policy.id as tar_id, tzc_policy.policy_code as tar_code, tzc_policy.title as tar_title, - sum(tbs_budget_log.amount) as total_amount, + -sum(tbs_budget_log.amount) as total_amount, tzc_policy.supplier_code, tzc_policy.supplier_name, tzc_policy.user_code, @@ -201,6 +210,15 @@ #{selectId} + + and 1=0 + and tzc_policy.policy_code like concat('%',#{query.tarCode},'%') + and tzc_policy.title like concat('%',#{query.tarTitle},'%') + and tzc_policy.supplier_code like concat('%',#{query.supplierCode},'%') + and tzc_policy.supplier_name like concat('%',#{query.supplierName},'%') + and tzc_policy.user_code like concat('%',#{query.userCode},'%') + and tzc_policy.user_name like concat('%',#{query.userName},'%') + group by tbs_budget_log.policy_id