Showing
7 changed files
with
92 additions
and
0 deletions
| ... | ... | @@ -1520,6 +1520,7 @@ CREATE TABLE `procurement_domestic_customer_credit` |
| 1520 | 1520 | `region` varchar(200) NOT NULL COMMENT '区域', |
| 1521 | 1521 | `review_valid_until` date NOT NULL COMMENT '评审有效期', |
| 1522 | 1522 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 1523 | + `change_review_status` varchar(20) DEFAULT NULL COMMENT '变更评审资料审核状态', | |
| 1523 | 1524 | `freeze` bool DEFAULT false COMMENT '是否冻结', |
| 1524 | 1525 | `create_by_id` varchar(32) DEFAULT NULL COMMENT '创建人ID', |
| 1525 | 1526 | `create_by` varchar(64) DEFAULT NULL COMMENT '创建人', | ... | ... |
| ... | ... | @@ -232,6 +232,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 232 | 232 | case "CUSTOMER_CREDIT_OUT": |
| 233 | 233 | handleResultForeignTradeCreditData(flowStatus, businessId); |
| 234 | 234 | break; |
| 235 | + case "IN_CHANGE_REVIEW": | |
| 236 | + handleResultDomesticCustomerCreditChangeReviewData(flowStatus, businessId); | |
| 237 | + break; | |
| 235 | 238 | default: |
| 236 | 239 | break; |
| 237 | 240 | } |
| ... | ... | @@ -1048,4 +1051,34 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 1048 | 1051 | procurementForeignTradeCreditService.updateStatus(businessId, "REFUSE"); |
| 1049 | 1052 | } |
| 1050 | 1053 | } |
| 1054 | + | |
| 1055 | + //采购-内贸资信-变更评审资料 | |
| 1056 | + private void handleResultDomesticCustomerCreditChangeReviewData(String flowStatus, String businessId) { | |
| 1057 | + Object o = redisHandler.get(businessId); | |
| 1058 | + ProcurementDomesticCustomerCredit vo = null; | |
| 1059 | + if (o != null) { | |
| 1060 | + String jsonString = o.toString(); | |
| 1061 | + // 2. 反序列化为 ProcurementDomesticCustomerCredit 对象 | |
| 1062 | + vo = JsonUtil.parseObject(jsonString, ProcurementDomesticCustomerCredit.class); | |
| 1063 | + } | |
| 1064 | + | |
| 1065 | + if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) | |
| 1066 | + || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { | |
| 1067 | + if (vo != null) { | |
| 1068 | + vo.setChangeReviewStatus("PASS"); | |
| 1069 | + procurementDomesticCustomerCreditService.updateNoFlowInstance(vo); | |
| 1070 | + //清除缓存 | |
| 1071 | + redisHandler.del(businessId); | |
| 1072 | + } | |
| 1073 | + } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) | |
| 1074 | + || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) | |
| 1075 | + || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { | |
| 1076 | + if (vo != null) { | |
| 1077 | + vo.setChangeReviewStatus("REFUSE"); | |
| 1078 | + procurementDomesticCustomerCreditService.updateNoFlowInstance(vo); | |
| 1079 | + //清除缓存 | |
| 1080 | + redisHandler.del(businessId); | |
| 1081 | + } | |
| 1082 | + } | |
| 1083 | + } | |
| 1051 | 1084 | } | ... | ... |
| ... | ... | @@ -90,6 +90,19 @@ public class ProcurementDomesticCustomerCreditController extends DefaultBaseCont |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | + * 变更评审资料 | |
| 94 | + */ | |
| 95 | + @ApiOperation("变更评审资料") | |
| 96 | + @HasPermission({""}) | |
| 97 | + @PutMapping | |
| 98 | + public InvokeResult<Void> changeReview(@Valid @RequestBody UpdateProcurementDomesticCustomerCreditVo vo) { | |
| 99 | + | |
| 100 | + procurementDomesticCustomerCreditService.changeReview(vo); | |
| 101 | + | |
| 102 | + return InvokeResultBuilder.success(); | |
| 103 | + } | |
| 104 | + | |
| 105 | + /** | |
| 93 | 106 | * 取消 |
| 94 | 107 | */ |
| 95 | 108 | @ApiOperation("取消") | ... | ... |
| ... | ... | @@ -287,6 +287,11 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas |
| 287 | 287 | private String status; |
| 288 | 288 | |
| 289 | 289 | /** |
| 290 | + * 变更评审审核状态 | |
| 291 | + */ | |
| 292 | + private String changeReviewStatus; | |
| 293 | + | |
| 294 | + /** | |
| 290 | 295 | * 是否冻结 |
| 291 | 296 | */ |
| 292 | 297 | private Boolean freeze; | ... | ... |
| ... | ... | @@ -52,6 +52,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
| 52 | 52 | extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit> |
| 53 | 53 | implements ProcurementDomesticCustomerCreditService { |
| 54 | 54 | private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN"; |
| 55 | + private static final String BPM_FLAG_CHANGE = "IN_CHANGE_REVIEW"; | |
| 55 | 56 | private static final int REVIEW_REMIND_DAYS = 15; |
| 56 | 57 | |
| 57 | 58 | @Resource |
| ... | ... | @@ -299,6 +300,33 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
| 299 | 300 | OpLogUtil.setExtra(vo); |
| 300 | 301 | } |
| 301 | 302 | |
| 303 | + @OpLog(type = OtherOpLogType.class, name = "变更评审采购内贸资信调查表,ID:{}", params = {"#vo.id"}) | |
| 304 | + @Transactional(rollbackFor = Exception.class) | |
| 305 | + @Override | |
| 306 | + public void changeReview(UpdateProcurementDomesticCustomerCreditVo vo) { | |
| 307 | + if (ObjectUtil.isNull(vo.getId())) { | |
| 308 | + throw new DefaultClientException("资信ID不能为空!"); | |
| 309 | + } | |
| 310 | + | |
| 311 | + ProcurementDomesticCustomerCredit data = this.findById(vo.getId()); | |
| 312 | + if (ObjectUtil.isNull(data)) { | |
| 313 | + throw new DefaultClientException("采购内贸资信调查表不存在!"); | |
| 314 | + } | |
| 315 | + | |
| 316 | + data.setId(vo.getId()); | |
| 317 | + data.setPurchaseDepartment(vo.getPurchaseDepartment()); | |
| 318 | + data.setRegion(vo.getRegion()); | |
| 319 | + data.setChangeReviewStatus("AUDIT"); | |
| 320 | + | |
| 321 | + String jsonString = JsonUtil.toJsonString(data); | |
| 322 | + //存入缓存 | |
| 323 | + redisHandler.set(data.getId(), jsonString); | |
| 324 | + //开启审核 | |
| 325 | + flowInstanceWrapperService.startInstance(BPM_FLAG_CHANGE, data.getId(), BPM_FLAG_CHANGE, data); | |
| 326 | + | |
| 327 | + OpLogUtil.setExtra(vo); | |
| 328 | + } | |
| 329 | + | |
| 302 | 330 | @Override |
| 303 | 331 | public void updateStatus(String id, String status) { |
| 304 | 332 | if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) { | ... | ... |
| ... | ... | @@ -54,6 +54,13 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService< |
| 54 | 54 | void update(UpdateProcurementDomesticCustomerCreditVo vo); |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | + * 变更评审资料 | |
| 58 | + * | |
| 59 | + * @param vo | |
| 60 | + */ | |
| 61 | + void changeReview(UpdateProcurementDomesticCustomerCreditVo vo); | |
| 62 | + | |
| 63 | + /** | |
| 57 | 64 | * 更新审核状态 |
| 58 | 65 | */ |
| 59 | 66 | void updateStatus(String id, String status); | ... | ... |
xingyun-sc/src/main/resources/mappers/procurement/credit/ProcurementDomesticCustomerCreditMapper.xml
| ... | ... | @@ -57,6 +57,7 @@ |
| 57 | 57 | <result column="region_name" property="regionName"/> |
| 58 | 58 | <result column="review_valid_until" property="reviewValidUntil"/> |
| 59 | 59 | <result column="status" property="status"/> |
| 60 | + <result column="change_review_status" property="changeReviewStatus"/> | |
| 60 | 61 | <result column="freeze" property="freeze"/> |
| 61 | 62 | <result column="create_by_id" property="createById"/> |
| 62 | 63 | <result column="create_by" property="createBy"/> |
| ... | ... | @@ -121,6 +122,7 @@ |
| 121 | 122 | sd1.name AS region_name, |
| 122 | 123 | tb.review_valid_until, |
| 123 | 124 | tb.status, |
| 125 | + tb.change_review_status, | |
| 124 | 126 | tb.freeze, |
| 125 | 127 | tb.create_by_id, |
| 126 | 128 | tb.create_by, |
| ... | ... | @@ -163,6 +165,9 @@ |
| 163 | 165 | <if test="vo.status != null and vo.status != ''"> |
| 164 | 166 | AND tb.status = #{vo.status} |
| 165 | 167 | </if> |
| 168 | + <if test="vo.changeReviewStatus != null and vo.changeReviewStatus != ''"> | |
| 169 | + AND tb.change_review_status = #{vo.changeReviewStatus} | |
| 170 | + </if> | |
| 166 | 171 | <if test="vo.freeze != null"> |
| 167 | 172 | AND tb.freeze = #{vo.freeze} |
| 168 | 173 | </if> | ... | ... |