Browse Source

feat: 审批中的预算占用列表拓展查询条件

fix:修复政策状态异常
checkBack
Yen 1 year ago
parent
commit
8cf7a0a902
  1. 12
      src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java
  2. 1
      src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java
  3. 2
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java
  4. 11
      src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java
  5. 22
      src/main/resources/mapper/tbs/TbsBudget2Mapper.xml

12
src/main/java/com/qs/serve/modules/tbs/entity/so/TbsScheduleItemSearch.java

@ -65,4 +65,16 @@ public class TbsScheduleItemSearch {
private Integer pageSize; private Integer pageSize;
/**
* 用于查询预算审批中的数据
*/
private String type;
private String tarCode;
private String tarTitle;
private String supplierCode;
private String supplierName;
private String userCode;
private String userName;
} }

1
src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetLog2Mapper.java

@ -80,6 +80,7 @@ public interface TbsBudgetLog2Mapper extends BaseMapper<TbsBudgetLog> {
*/ */
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
List<TbsBudgetCheckingWithAmount> getBudgetLogCheckingList( List<TbsBudgetCheckingWithAmount> getBudgetLogCheckingList(
@Param("query")TbsScheduleItemSearch param,
@Param("selectIds") List<Long> ids @Param("selectIds") List<Long> ids
,@Param("scheduleItemBudgetIds") List<Long> scheduleItemBudgetIds ,@Param("scheduleItemBudgetIds") List<Long> scheduleItemBudgetIds
, @Param("policyNumbers")List<Integer> policyNumbers , @Param("policyNumbers")List<Integer> policyNumbers

2
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java

@ -390,7 +390,7 @@ public class TbsScheduleItemBudgetServiceImpl extends ServiceImpl<TbsScheduleIte
PageHelper.startPage(param.getPageNum(),param.getPageSize()); PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<TbsBudgetCheckingWithAmount> budgetLogs = tbsBudgetLog2Mapper.getBudgetLogCheckingList(new ArrayList<>(budgetIds),param.getScheduleItemBudgetIds(), BudgetLogOptFlag.finalPolicyOptFlag,BudgetLogOptFlag.finalCostOptFlag); List<TbsBudgetCheckingWithAmount> budgetLogs = tbsBudgetLog2Mapper.getBudgetLogCheckingList(param,new ArrayList<>(budgetIds),param.getScheduleItemBudgetIds(), BudgetLogOptFlag.finalPolicyOptFlag,BudgetLogOptFlag.finalCostOptFlag);
return budgetLogs; return budgetLogs;
} }

11
src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyController.java

@ -184,6 +184,15 @@ public class TzcPolicyController {
public R<TzcPolicy> getById(@PathVariable("id") String id){ public R<TzcPolicy> getById(@PathVariable("id") String id){
TzcPolicy tzcPolicy = tzcPolicyService.getById(id); TzcPolicy tzcPolicy = tzcPolicyService.getById(id);
if(tzcPolicy!=null){ if(tzcPolicy!=null){
if(tzcPolicy.getPolicyStatus().equals(TzcPolicyStatus.Status_1_Checking)){
//尝试进行补偿
try {
tzcPolicyOperationService.runCompensate(id);
tzcPolicy = tzcPolicyService.getById(id);
}catch (Exception e){
}
}
List<TzcPolicyItem> policyItemList = tzcPolicyItemService.listByPolicyId(tzcPolicy.getId()); List<TzcPolicyItem> policyItemList = tzcPolicyItemService.listByPolicyId(tzcPolicy.getId());
tzcPolicy.setPolicyItemList(policyItemList); tzcPolicy.setPolicyItemList(policyItemList);
} }
@ -450,7 +459,7 @@ public class TzcPolicyController {
* @param id * @param id
* @return * @return
*/ */
@PostMapping("/cancellation/{id}") @DeleteMapping("/cancellation/{id}")
public R<?> cancellation(@PathVariable Long id){ public R<?> cancellation(@PathVariable Long id){
List<TzcPolicyItem> tzcPolicyItemList = tzcPolicyItemService.listByPolicyId(id); List<TzcPolicyItem> tzcPolicyItemList = tzcPolicyItemService.listByPolicyId(id);
List<Long> itemIds = tzcPolicyItemList.stream().map(TzcPolicyItem::getId).collect(Collectors.toList()); List<Long> itemIds = tzcPolicyItemList.stream().map(TzcPolicyItem::getId).collect(Collectors.toList());

22
src/main/resources/mapper/tbs/TbsBudget2Mapper.xml

@ -144,7 +144,7 @@
tbs_cost_apply.id as tar_id, tbs_cost_apply.id as tar_id,
tbs_cost_apply.code as tar_code, tbs_cost_apply.code as tar_code,
tbs_cost_apply.charge_theme as tar_title, 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_code,
tbs_cost_apply.supplier_name, tbs_cost_apply.supplier_name,
tbs_cost_apply.user_code, tbs_cost_apply.user_code,
@ -168,6 +168,15 @@
<foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="query.type != null and query.type == 'policy'"> and 1=0 </if>
<if test="query.tarCode != null and query.tarCode != ''"> and tbs_cost_apply.code like concat('%',#{query.tarCode},'%') </if>
<if test="query.tarTitle != null and query.tarTitle != ''"> and tbs_cost_apply.charge_theme like concat('%',#{query.tarTitle},'%') </if>
<if test="query.supplierCode != null and query.supplierCode != ''"> and tbs_cost_apply.supplier_code like concat('%',#{query.supplierCode},'%') </if>
<if test="query.supplierName != null and query.supplierName != ''"> and tbs_cost_apply.supplier_name like concat('%',#{query.supplierName},'%') </if>
<if test="query.userCode != null and query.userCode != ''"> and tbs_cost_apply.user_code like concat('%',#{query.userCode},'%') </if>
<if test="query.userName != null and query.userName != ''"> and tbs_cost_apply.user_name like concat('%',#{query.userName},'%') </if>
group by tbs_budget_log.cost_apply_id group by tbs_budget_log.cost_apply_id
union union
@ -177,7 +186,7 @@
tzc_policy.id as tar_id, tzc_policy.id as tar_id,
tzc_policy.policy_code as tar_code, tzc_policy.policy_code as tar_code,
tzc_policy.title as tar_title, 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_code,
tzc_policy.supplier_name, tzc_policy.supplier_name,
tzc_policy.user_code, tzc_policy.user_code,
@ -201,6 +210,15 @@
<foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="query.type != null and query.type == 'costApply'"> and 1=0 </if>
<if test="query.tarCode != null and query.tarCode != ''"> and tzc_policy.policy_code like concat('%',#{query.tarCode},'%') </if>
<if test="query.tarTitle != null and query.tarTitle != ''"> and tzc_policy.title like concat('%',#{query.tarTitle},'%') </if>
<if test="query.supplierCode != null and query.supplierCode != ''"> and tzc_policy.supplier_code like concat('%',#{query.supplierCode},'%') </if>
<if test="query.supplierName != null and query.supplierName != ''"> and tzc_policy.supplier_name like concat('%',#{query.supplierName},'%') </if>
<if test="query.userCode != null and query.userCode != ''"> and tzc_policy.user_code like concat('%',#{query.userCode},'%') </if>
<if test="query.userName != null and query.userName != ''"> and tzc_policy.user_name like concat('%',#{query.userName},'%') </if>
group by tbs_budget_log.policy_id group by tbs_budget_log.policy_id
</select> </select>

Loading…
Cancel
Save