Commit 53a6099618b132c9dc9367b2f9be1221d17e1d6f

Authored by 房远帅
1 parent e3ec7433

采购资信:评审资料变更完善

@@ -117,6 +117,20 @@ public class ProcurementDomesticCustomerCreditController extends DefaultBaseCont @@ -117,6 +117,20 @@ public class ProcurementDomesticCustomerCreditController extends DefaultBaseCont
117 } 117 }
118 118
119 /** 119 /**
  120 + * 取消
  121 + */
  122 + @ApiOperation("取消变更评审资料")
  123 + @HasPermission({"procure-manage:domestic-trade:acancel"})
  124 + @GetMapping("/cancelReview")
  125 + public InvokeResult<Void> cancelReview(@NotBlank(message = "id不能为空!") String id,
  126 + @NotBlank(message = "status不能为空!") String status) {
  127 +
  128 + procurementDomesticCustomerCreditService.updateReviewStatus(id, status);
  129 +
  130 + return InvokeResultBuilder.success();
  131 + }
  132 +
  133 + /**
120 * 根据ID查询变更审核的数据 134 * 根据ID查询变更审核的数据
121 */ 135 */
122 @ApiOperation("根据ID查询变更审核的数据") 136 @ApiOperation("根据ID查询变更审核的数据")
@@ -309,6 +309,18 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas @@ -309,6 +309,18 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas
309 private Boolean showExamineDetail; 309 private Boolean showExamineDetail;
310 310
311 /** 311 /**
  312 + * 是否展示变更评审审核按钮(非持久化字段)
  313 + */
  314 + @TableField(exist = false)
  315 + private Boolean showChangeReviewExamine = false;
  316 +
  317 + /**
  318 + * 是否展示变更评审审核详情按钮(非持久化字段)
  319 + */
  320 + @TableField(exist = false)
  321 + private Boolean showChangeReviewExamineDetail;
  322 +
  323 + /**
312 * 创建人ID 324 * 创建人ID
313 */ 325 */
314 @TableField(fill = FieldFill.INSERT) 326 @TableField(fill = FieldFill.INSERT)
@@ -75,32 +75,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -75,32 +75,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl
75 PageHelperUtil.startPage(pageIndex, pageSize); 75 PageHelperUtil.startPage(pageIndex, pageSize);
76 List<ProcurementDomesticCustomerCredit> datas = this.query(vo); 76 List<ProcurementDomesticCustomerCredit> datas = this.query(vo);
77 if (org.apache.commons.collections.CollectionUtils.isNotEmpty(datas)) { 77 if (org.apache.commons.collections.CollectionUtils.isNotEmpty(datas)) {
78 - //流程数据  
79 - List<FlowInstanceWrapper> flowByConditionList = flowInstanceWrapperService.getFlowByBusinessIdList(  
80 - datas.stream().map(ProcurementDomesticCustomerCredit::getId).collect(Collectors.toList()));  
81 - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowByConditionList)) {  
82 - List<String> idList = flowByConditionList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());  
83 - for (ProcurementDomesticCustomerCredit customerCredit : datas) {  
84 - if (idList.contains(customerCredit.getId())) {  
85 - customerCredit.setShowExamineDetail(true);  
86 - } else {  
87 - customerCredit.setShowExamineDetail(false);  
88 - }  
89 - }  
90 - }  
91 - // 获取当前人员的待办任务数据  
92 - List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());  
93 - if (CollectionUtils.isEmpty(flowTaskList)) {  
94 - return PageResultUtil.convert(new PageInfo<>(datas));  
95 - }  
96 - List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());  
97 - for (ProcurementDomesticCustomerCredit customerCredit : datas) {  
98 - if (ids.contains(customerCredit.getId())) {  
99 - customerCredit.setShowExamine(true);  
100 - } else {  
101 - customerCredit.setShowExamine(false);  
102 - }  
103 - } 78 + fillShowExamineInfo(datas);
104 } 79 }
105 return PageResultUtil.convert(new PageInfo<>(datas)); 80 return PageResultUtil.convert(new PageInfo<>(datas));
106 } 81 }
@@ -113,24 +88,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -113,24 +88,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl
113 @Override 88 @Override
114 public ProcurementDomesticCustomerCredit findById(String id) { 89 public ProcurementDomesticCustomerCredit findById(String id) {
115 ProcurementDomesticCustomerCredit customerCredit = getBaseMapper().findById(id); 90 ProcurementDomesticCustomerCredit customerCredit = getBaseMapper().findById(id);
116 - //流程数据  
117 - List<String> ids = new ArrayList<>();  
118 - ids.add(customerCredit.getId());  
119 - List<FlowInstanceWrapper> flowByBusinessIdList = flowInstanceWrapperService.getFlowByBusinessIdList(ids);  
120 - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowByBusinessIdList)) {  
121 - List<String> collect = flowByBusinessIdList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList());  
122 - customerCredit.setShowExamineDetail(collect.contains(customerCredit.getId()));  
123 - } else {  
124 - customerCredit.setShowExamineDetail(false);  
125 - }  
126 - // 获取当前人员的待办任务数据  
127 - List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());  
128 - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowTaskList)) {  
129 - List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());  
130 - customerCredit.setShowExamine(businessIds.contains(customerCredit.getId()));  
131 - } else {  
132 - customerCredit.setShowExamine(false);  
133 - } 91 + fillShowExamineInfo(java.util.Collections.singletonList(customerCredit));
134 return customerCredit; 92 return customerCredit;
135 } 93 }
136 94
@@ -339,6 +297,17 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -339,6 +297,17 @@ public class ProcurementDomesticCustomerCreditServiceImpl
339 } 297 }
340 298
341 @Override 299 @Override
  300 + public void updateReviewStatus(String id, String status) {
  301 + if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) {
  302 + throw new DefaultClientException("资信ID、审核状态不能为空!");
  303 + }
  304 + LambdaUpdateWrapper<ProcurementDomesticCustomerCredit> updateWrapper = Wrappers.lambdaUpdate(ProcurementDomesticCustomerCredit.class)
  305 + .set(ProcurementDomesticCustomerCredit::getChangeReviewStatus, status)
  306 + .eq(ProcurementDomesticCustomerCredit::getId, id);
  307 + getBaseMapper().update(updateWrapper);
  308 + }
  309 +
  310 + @Override
342 public void updateFreeze(List<String> ids, Boolean freeze) { 311 public void updateFreeze(List<String> ids, Boolean freeze) {
343 if (CollectionUtils.isEmpty(ids) || freeze == null) { 312 if (CollectionUtils.isEmpty(ids) || freeze == null) {
344 throw new DefaultClientException("资信IDs、冻结状态不能为空!"); 313 throw new DefaultClientException("资信IDs、冻结状态不能为空!");
@@ -485,6 +454,48 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -485,6 +454,48 @@ public class ProcurementDomesticCustomerCreditServiceImpl
485 } 454 }
486 455
487 /** 456 /**
  457 + * 回填主审核和变更评审的审核按钮展示信息
  458 + *
  459 + * @param datas 数据列表
  460 + */
  461 + private void fillShowExamineInfo(List<ProcurementDomesticCustomerCredit> datas) {
  462 + if (CollectionUtils.isEmpty(datas)) {
  463 + return;
  464 + }
  465 +
  466 + List<ProcurementDomesticCustomerCredit> validDatas = datas.stream()
  467 + .filter(java.util.Objects::nonNull)
  468 + .collect(Collectors.toList());
  469 + if (CollectionUtils.isEmpty(validDatas)) {
  470 + return;
  471 + }
  472 +
  473 + List<String> businessIds = validDatas.stream().map(ProcurementDomesticCustomerCredit::getId).collect(Collectors.toList());
  474 + List<FlowInstanceWrapper> flowByConditionList = flowInstanceWrapperService.getFlowByBusinessIdList(businessIds);
  475 + Set<String> flowBusinessIdSet = CollectionUtils.isNotEmpty(flowByConditionList)
  476 + ? flowByConditionList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toSet())
  477 + : new HashSet<>();
  478 +
  479 + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
  480 + Set<String> todoBusinessIdSet = CollectionUtils.isNotEmpty(flowTaskList)
  481 + ? flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toSet())
  482 + : new HashSet<>();
  483 +
  484 + for (ProcurementDomesticCustomerCredit customerCredit : validDatas) {
  485 + boolean hasFlow = flowBusinessIdSet.contains(customerCredit.getId());
  486 + boolean hasTodo = todoBusinessIdSet.contains(customerCredit.getId());
  487 +
  488 + customerCredit.setShowExamineDetail(hasFlow && StringUtils.isNotBlank(customerCredit.getStatus()));
  489 + customerCredit.setShowExamine(hasTodo && "AUDIT".equals(customerCredit.getStatus()));
  490 +
  491 + customerCredit.setShowChangeReviewExamineDetail(
  492 + hasFlow && StringUtils.isNotBlank(customerCredit.getChangeReviewStatus()));
  493 + customerCredit.setShowChangeReviewExamine(
  494 + hasTodo && "AUDIT".equals(customerCredit.getChangeReviewStatus()));
  495 + }
  496 + }
  497 +
  498 + /**
488 * 获取节点首个审批人名称 499 * 获取节点首个审批人名称
489 * 500 *
490 * @param nodeJson 流程节点JSON 501 * @param nodeJson 流程节点JSON
@@ -66,6 +66,11 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService< @@ -66,6 +66,11 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService<
66 void updateStatus(String id, String status); 66 void updateStatus(String id, String status);
67 67
68 /** 68 /**
  69 + * 更新评审资料审核状态
  70 + */
  71 + void updateReviewStatus(String id, String status);
  72 +
  73 + /**
69 * 更新冻结状态 74 * 更新冻结状态
70 */ 75 */
71 void updateFreeze(List<String> ids, Boolean freeze); 76 void updateFreeze(List<String> ids, Boolean freeze);