Showing
7 changed files
with
92 additions
and
0 deletions
| @@ -1520,6 +1520,7 @@ CREATE TABLE `procurement_domestic_customer_credit` | @@ -1520,6 +1520,7 @@ CREATE TABLE `procurement_domestic_customer_credit` | ||
| 1520 | `region` varchar(200) NOT NULL COMMENT '区域', | 1520 | `region` varchar(200) NOT NULL COMMENT '区域', |
| 1521 | `review_valid_until` date NOT NULL COMMENT '评审有效期', | 1521 | `review_valid_until` date NOT NULL COMMENT '评审有效期', |
| 1522 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', | 1522 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 1523 | + `change_review_status` varchar(20) DEFAULT NULL COMMENT '变更评审资料审核状态', | ||
| 1523 | `freeze` bool DEFAULT false COMMENT '是否冻结', | 1524 | `freeze` bool DEFAULT false COMMENT '是否冻结', |
| 1524 | `create_by_id` varchar(32) DEFAULT NULL COMMENT '创建人ID', | 1525 | `create_by_id` varchar(32) DEFAULT NULL COMMENT '创建人ID', |
| 1525 | `create_by` varchar(64) DEFAULT NULL COMMENT '创建人', | 1526 | `create_by` varchar(64) DEFAULT NULL COMMENT '创建人', |
| @@ -232,6 +232,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -232,6 +232,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 232 | case "CUSTOMER_CREDIT_OUT": | 232 | case "CUSTOMER_CREDIT_OUT": |
| 233 | handleResultForeignTradeCreditData(flowStatus, businessId); | 233 | handleResultForeignTradeCreditData(flowStatus, businessId); |
| 234 | break; | 234 | break; |
| 235 | + case "IN_CHANGE_REVIEW": | ||
| 236 | + handleResultDomesticCustomerCreditChangeReviewData(flowStatus, businessId); | ||
| 237 | + break; | ||
| 235 | default: | 238 | default: |
| 236 | break; | 239 | break; |
| 237 | } | 240 | } |
| @@ -1048,4 +1051,34 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | @@ -1048,4 +1051,34 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic | ||
| 1048 | procurementForeignTradeCreditService.updateStatus(businessId, "REFUSE"); | 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,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 | @ApiOperation("取消") | 108 | @ApiOperation("取消") |
| @@ -287,6 +287,11 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas | @@ -287,6 +287,11 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas | ||
| 287 | private String status; | 287 | private String status; |
| 288 | 288 | ||
| 289 | /** | 289 | /** |
| 290 | + * 变更评审审核状态 | ||
| 291 | + */ | ||
| 292 | + private String changeReviewStatus; | ||
| 293 | + | ||
| 294 | + /** | ||
| 290 | * 是否冻结 | 295 | * 是否冻结 |
| 291 | */ | 296 | */ |
| 292 | private Boolean freeze; | 297 | private Boolean freeze; |
| @@ -52,6 +52,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl | @@ -52,6 +52,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl | ||
| 52 | extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit> | 52 | extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit> |
| 53 | implements ProcurementDomesticCustomerCreditService { | 53 | implements ProcurementDomesticCustomerCreditService { |
| 54 | private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN"; | 54 | private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN"; |
| 55 | + private static final String BPM_FLAG_CHANGE = "IN_CHANGE_REVIEW"; | ||
| 55 | private static final int REVIEW_REMIND_DAYS = 15; | 56 | private static final int REVIEW_REMIND_DAYS = 15; |
| 56 | 57 | ||
| 57 | @Resource | 58 | @Resource |
| @@ -299,6 +300,33 @@ public class ProcurementDomesticCustomerCreditServiceImpl | @@ -299,6 +300,33 @@ public class ProcurementDomesticCustomerCreditServiceImpl | ||
| 299 | OpLogUtil.setExtra(vo); | 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 | @Override | 330 | @Override |
| 303 | public void updateStatus(String id, String status) { | 331 | public void updateStatus(String id, String status) { |
| 304 | if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) { | 332 | if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) { |
| @@ -54,6 +54,13 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService< | @@ -54,6 +54,13 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService< | ||
| 54 | void update(UpdateProcurementDomesticCustomerCreditVo vo); | 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 | void updateStatus(String id, String status); | 66 | void updateStatus(String id, String status); |
xingyun-sc/src/main/resources/mappers/procurement/credit/ProcurementDomesticCustomerCreditMapper.xml
| @@ -57,6 +57,7 @@ | @@ -57,6 +57,7 @@ | ||
| 57 | <result column="region_name" property="regionName"/> | 57 | <result column="region_name" property="regionName"/> |
| 58 | <result column="review_valid_until" property="reviewValidUntil"/> | 58 | <result column="review_valid_until" property="reviewValidUntil"/> |
| 59 | <result column="status" property="status"/> | 59 | <result column="status" property="status"/> |
| 60 | + <result column="change_review_status" property="changeReviewStatus"/> | ||
| 60 | <result column="freeze" property="freeze"/> | 61 | <result column="freeze" property="freeze"/> |
| 61 | <result column="create_by_id" property="createById"/> | 62 | <result column="create_by_id" property="createById"/> |
| 62 | <result column="create_by" property="createBy"/> | 63 | <result column="create_by" property="createBy"/> |
| @@ -121,6 +122,7 @@ | @@ -121,6 +122,7 @@ | ||
| 121 | sd1.name AS region_name, | 122 | sd1.name AS region_name, |
| 122 | tb.review_valid_until, | 123 | tb.review_valid_until, |
| 123 | tb.status, | 124 | tb.status, |
| 125 | + tb.change_review_status, | ||
| 124 | tb.freeze, | 126 | tb.freeze, |
| 125 | tb.create_by_id, | 127 | tb.create_by_id, |
| 126 | tb.create_by, | 128 | tb.create_by, |
| @@ -163,6 +165,9 @@ | @@ -163,6 +165,9 @@ | ||
| 163 | <if test="vo.status != null and vo.status != ''"> | 165 | <if test="vo.status != null and vo.status != ''"> |
| 164 | AND tb.status = #{vo.status} | 166 | AND tb.status = #{vo.status} |
| 165 | </if> | 167 | </if> |
| 168 | + <if test="vo.changeReviewStatus != null and vo.changeReviewStatus != ''"> | ||
| 169 | + AND tb.change_review_status = #{vo.changeReviewStatus} | ||
| 170 | + </if> | ||
| 166 | <if test="vo.freeze != null"> | 171 | <if test="vo.freeze != null"> |
| 167 | AND tb.freeze = #{vo.freeze} | 172 | AND tb.freeze = #{vo.freeze} |
| 168 | </if> | 173 | </if> |