Commit 89d4a5f2663b3330f4143208e1d2cb8c70b5b9ec

Authored by 房远帅
1 parent 0176bd10

采购:内外贸客户资信到期提醒及冻结

@@ -13,6 +13,7 @@ import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; @@ -13,6 +13,7 @@ import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
13 import com.lframework.starter.common.exceptions.impl.DefaultClientException; 13 import com.lframework.starter.common.exceptions.impl.DefaultClientException;
14 import com.lframework.starter.common.utils.Assert; 14 import com.lframework.starter.common.utils.Assert;
15 import com.lframework.starter.common.utils.ObjectUtil; 15 import com.lframework.starter.common.utils.ObjectUtil;
  16 +import com.lframework.starter.mq.core.service.MqProducerService;
16 import com.lframework.starter.web.core.annotations.oplog.OpLog; 17 import com.lframework.starter.web.core.annotations.oplog.OpLog;
17 import com.lframework.starter.web.core.components.redis.RedisHandler; 18 import com.lframework.starter.web.core.components.redis.RedisHandler;
18 import com.lframework.starter.web.core.components.resp.PageResult; 19 import com.lframework.starter.web.core.components.resp.PageResult;
@@ -20,6 +21,7 @@ import com.lframework.starter.web.core.components.security.SecurityUtil; @@ -20,6 +21,7 @@ import com.lframework.starter.web.core.components.security.SecurityUtil;
20 import com.lframework.starter.web.core.impl.BaseMpServiceImpl; 21 import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
21 import com.lframework.starter.web.core.utils.*; 22 import com.lframework.starter.web.core.utils.*;
22 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; 23 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  24 +import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
23 import com.lframework.starter.web.inner.entity.SysUser; 25 import com.lframework.starter.web.inner.entity.SysUser;
24 import com.lframework.starter.web.inner.service.system.SysUserService; 26 import com.lframework.starter.web.inner.service.system.SysUserService;
25 import com.lframework.xingyun.sc.procurement.dto.DomesticReviewerDto; 27 import com.lframework.xingyun.sc.procurement.dto.DomesticReviewerDto;
@@ -30,12 +32,16 @@ import com.lframework.xingyun.sc.procurement.vo.credit.CreateProcurementDomestic @@ -30,12 +32,16 @@ import com.lframework.xingyun.sc.procurement.vo.credit.CreateProcurementDomestic
30 import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo; 32 import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo;
31 import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementDomesticCustomerCreditVo; 33 import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementDomesticCustomerCreditVo;
32 34
  35 +import java.time.LocalDate;
33 import java.util.ArrayList; 36 import java.util.ArrayList;
  37 +import java.util.HashSet;
34 import java.util.List; 38 import java.util.List;
  39 +import java.util.Set;
35 import java.util.stream.Collectors; 40 import java.util.stream.Collectors;
36 import javax.annotation.Resource; 41 import javax.annotation.Resource;
37 import org.apache.commons.lang3.StringUtils; 42 import org.apache.commons.lang3.StringUtils;
38 import org.springframework.beans.factory.annotation.Autowired; 43 import org.springframework.beans.factory.annotation.Autowired;
  44 +import org.springframework.scheduling.annotation.Scheduled;
39 import org.springframework.stereotype.Service; 45 import org.springframework.stereotype.Service;
40 import org.springframework.transaction.annotation.Transactional; 46 import org.springframework.transaction.annotation.Transactional;
41 47
@@ -44,6 +50,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -44,6 +50,7 @@ public class ProcurementDomesticCustomerCreditServiceImpl
44 extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit> 50 extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit>
45 implements ProcurementDomesticCustomerCreditService { 51 implements ProcurementDomesticCustomerCreditService {
46 private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN"; 52 private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN";
  53 + private static final int REVIEW_REMIND_DAYS = 15;
47 54
48 @Resource 55 @Resource
49 private SysUserService sysUserService; 56 private SysUserService sysUserService;
@@ -53,6 +60,8 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -53,6 +60,8 @@ public class ProcurementDomesticCustomerCreditServiceImpl
53 private RedisHandler redisHandler; 60 private RedisHandler redisHandler;
54 @Resource 61 @Resource
55 private FlowTaskWrapperMapper flowTaskWrapperMapper; 62 private FlowTaskWrapperMapper flowTaskWrapperMapper;
  63 + @Autowired
  64 + private MqProducerService mqProducerService;
56 65
57 @Override 66 @Override
58 public PageResult<ProcurementDomesticCustomerCredit> query(Integer pageIndex, Integer pageSize, 67 public PageResult<ProcurementDomesticCustomerCredit> query(Integer pageIndex, Integer pageSize,
@@ -340,6 +349,54 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -340,6 +349,54 @@ public class ProcurementDomesticCustomerCreditServiceImpl
340 } 349 }
341 350
342 /** 351 /**
  352 + * 每天早上八点检查内贸资信评审有效期提醒并处理到期冻结。
  353 + */
  354 + @Scheduled(cron = "0 0 8 * * ?")
  355 + public void reviewValidUntilReminder() {
  356 + LocalDate currentDate = LocalDate.now();
  357 + LocalDate remindEndDate = currentDate.plusDays(REVIEW_REMIND_DAYS);
  358 +
  359 + LambdaQueryWrapper<ProcurementDomesticCustomerCredit> reminderWrapper =
  360 + Wrappers.lambdaQuery(ProcurementDomesticCustomerCredit.class)
  361 + .eq(ProcurementDomesticCustomerCredit::getStatus, "PASS")
  362 + .eq(ProcurementDomesticCustomerCredit::getFreeze, Boolean.FALSE)
  363 + .ge(ProcurementDomesticCustomerCredit::getReviewValidUntil, currentDate)
  364 + .le(ProcurementDomesticCustomerCredit::getReviewValidUntil, remindEndDate);
  365 + List<ProcurementDomesticCustomerCredit> reminderList = list(reminderWrapper);
  366 + for (ProcurementDomesticCustomerCredit customerCredit : reminderList) {
  367 + sendReminderMessage(customerCredit);
  368 + }
  369 + }
  370 +
  371 + /**
  372 + * 每天凌晨检查内贸资信评审有效期处理到期冻结。
  373 + */
  374 + @Scheduled(cron = "0 0 0 * * ?")
  375 + public void freezeReminder() {
  376 + LocalDate currentDate = LocalDate.now();
  377 +
  378 + LambdaQueryWrapper<ProcurementDomesticCustomerCredit> freezeWrapper =
  379 + Wrappers.lambdaQuery(ProcurementDomesticCustomerCredit.class)
  380 + .eq(ProcurementDomesticCustomerCredit::getStatus, "PASS")
  381 + .eq(ProcurementDomesticCustomerCredit::getFreeze, Boolean.FALSE)
  382 + .lt(ProcurementDomesticCustomerCredit::getReviewValidUntil, currentDate);
  383 + List<ProcurementDomesticCustomerCredit> freezeList = list(freezeWrapper);
  384 + List<String> freezeIds = new ArrayList<>();
  385 + List<ProcurementDomesticCustomerCredit> needFreezeList = new ArrayList<>();
  386 + for (ProcurementDomesticCustomerCredit customerCredit : freezeList) {
  387 + freezeIds.add(customerCredit.getId());
  388 + needFreezeList.add(customerCredit);
  389 + }
  390 +
  391 + if (CollectionUtils.isNotEmpty(freezeIds)) {
  392 + updateFreeze(freezeIds, Boolean.TRUE);
  393 + for (ProcurementDomesticCustomerCredit customerCredit : needFreezeList) {
  394 + sendFreezeMessage(customerCredit);
  395 + }
  396 + }
  397 + }
  398 +
  399 + /**
343 * 校验客户简称唯一性 400 * 校验客户简称唯一性
344 * 401 *
345 * @param customerShortName 客户简称 402 * @param customerShortName 客户简称
@@ -358,4 +415,52 @@ public class ProcurementDomesticCustomerCreditServiceImpl @@ -358,4 +415,52 @@ public class ProcurementDomesticCustomerCreditServiceImpl
358 throw new DefaultClientException("客户简称已存在,请重新输入!"); 415 throw new DefaultClientException("客户简称已存在,请重新输入!");
359 } 416 }
360 } 417 }
  418 +
  419 + /**
  420 + * 发送评审有效期提醒消息。
  421 + *
  422 + * @param customerCredit 内贸资信
  423 + */
  424 + private void sendReminderMessage(ProcurementDomesticCustomerCredit customerCredit) {
  425 + if (customerCredit == null || StringUtils.isBlank(customerCredit.getCreateById())
  426 + || customerCredit.getReviewValidUntil() == null) {
  427 + return;
  428 + }
  429 +
  430 + Set<String> userIdSet = new HashSet<>();
  431 + userIdSet.add(customerCredit.getCreateById());
  432 + SysSiteMessageDto messageDto = new SysSiteMessageDto();
  433 + messageDto.setUserIdList(new ArrayList<>(userIdSet));
  434 + messageDto.setTitle("采购内贸客户资信评审到期提醒");
  435 + messageDto.setContent("您创建的客户资信单位【" + StringUtils.defaultString(customerCredit.getUnitName())
  436 + + "】评审有效期将于" + customerCredit.getReviewValidUntil()
  437 + + "到期,请及时发起变更,逾期未发起变更系统将自动冻结。");
  438 + messageDto.setBizKey(IdUtil.getId());
  439 + messageDto.setCreateUserId(null);
  440 + mqProducerService.createSysSiteMessage(messageDto);
  441 + }
  442 +
  443 + /**
  444 + * 发送自动冻结提醒消息。
  445 + *
  446 + * @param customerCredit 内贸资信
  447 + */
  448 + private void sendFreezeMessage(ProcurementDomesticCustomerCredit customerCredit) {
  449 + if (customerCredit == null || StringUtils.isBlank(customerCredit.getCreateById())
  450 + || customerCredit.getReviewValidUntil() == null) {
  451 + return;
  452 + }
  453 +
  454 + Set<String> userIdSet = new HashSet<>();
  455 + userIdSet.add(customerCredit.getCreateById());
  456 + SysSiteMessageDto messageDto = new SysSiteMessageDto();
  457 + messageDto.setUserIdList(new ArrayList<>(userIdSet));
  458 + messageDto.setTitle("采购内贸客户资信自动冻结提醒");
  459 + messageDto.setContent("您创建的客户资信单位【" + StringUtils.defaultString(customerCredit.getUnitName())
  460 + + "】评审有效期已于" + customerCredit.getReviewValidUntil()
  461 + + "到期,且未发起变更,系统已自动冻结。");
  462 + messageDto.setBizKey(IdUtil.getId());
  463 + messageDto.setCreateUserId(null);
  464 + mqProducerService.createSysSiteMessage(messageDto);
  465 + }
361 } 466 }
1 package com.lframework.xingyun.sc.procurement.impl.credit; 1 package com.lframework.xingyun.sc.procurement.impl.credit;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 4 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import com.github.pagehelper.PageInfo; 6 import com.github.pagehelper.PageInfo;
@@ -11,6 +12,7 @@ import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; @@ -11,6 +12,7 @@ import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
11 import com.lframework.starter.common.exceptions.impl.DefaultClientException; 12 import com.lframework.starter.common.exceptions.impl.DefaultClientException;
12 import com.lframework.starter.common.utils.Assert; 13 import com.lframework.starter.common.utils.Assert;
13 import com.lframework.starter.common.utils.ObjectUtil; 14 import com.lframework.starter.common.utils.ObjectUtil;
  15 +import com.lframework.starter.mq.core.service.MqProducerService;
14 import com.lframework.starter.web.core.components.redis.RedisHandler; 16 import com.lframework.starter.web.core.components.redis.RedisHandler;
15 import com.lframework.starter.web.core.components.security.SecurityUtil; 17 import com.lframework.starter.web.core.components.security.SecurityUtil;
16 import com.lframework.starter.web.core.annotations.oplog.OpLog; 18 import com.lframework.starter.web.core.annotations.oplog.OpLog;
@@ -22,6 +24,7 @@ import com.lframework.starter.web.core.utils.OpLogUtil; @@ -22,6 +24,7 @@ import com.lframework.starter.web.core.utils.OpLogUtil;
22 import com.lframework.starter.web.core.utils.PageHelperUtil; 24 import com.lframework.starter.web.core.utils.PageHelperUtil;
23 import com.lframework.starter.web.core.utils.PageResultUtil; 25 import com.lframework.starter.web.core.utils.PageResultUtil;
24 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; 26 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  27 +import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
25 import com.lframework.starter.web.inner.entity.SysUser; 28 import com.lframework.starter.web.inner.entity.SysUser;
26 import com.lframework.starter.web.inner.service.system.SysUserService; 29 import com.lframework.starter.web.inner.service.system.SysUserService;
27 import com.lframework.xingyun.sc.procurement.dto.ForeignTradeReviewerDto; 30 import com.lframework.xingyun.sc.procurement.dto.ForeignTradeReviewerDto;
@@ -33,12 +36,17 @@ import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementForeignTr @@ -33,12 +36,17 @@ import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementForeignTr
33 import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementForeignTradeCreditVo; 36 import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementForeignTradeCreditVo;
34 import org.apache.commons.lang3.StringUtils; 37 import org.apache.commons.lang3.StringUtils;
35 import org.springframework.beans.factory.annotation.Autowired; 38 import org.springframework.beans.factory.annotation.Autowired;
  39 +import org.springframework.scheduling.annotation.Scheduled;
36 import org.springframework.stereotype.Service; 40 import org.springframework.stereotype.Service;
37 import org.springframework.transaction.annotation.Transactional; 41 import org.springframework.transaction.annotation.Transactional;
  42 +import org.springframework.util.CollectionUtils;
38 43
39 import javax.annotation.Resource; 44 import javax.annotation.Resource;
  45 +import java.time.LocalDate;
40 import java.util.ArrayList; 46 import java.util.ArrayList;
  47 +import java.util.HashSet;
41 import java.util.List; 48 import java.util.List;
  49 +import java.util.Set;
42 import java.util.stream.Collectors; 50 import java.util.stream.Collectors;
43 51
44 @Service 52 @Service
@@ -46,6 +54,7 @@ public class ProcurementForeignTradeCreditServiceImpl @@ -46,6 +54,7 @@ public class ProcurementForeignTradeCreditServiceImpl
46 extends BaseMpServiceImpl<ProcurementForeignTradeCreditMapper, ProcurementForeignTradeCredit> 54 extends BaseMpServiceImpl<ProcurementForeignTradeCreditMapper, ProcurementForeignTradeCredit>
47 implements ProcurementForeignTradeCreditService { 55 implements ProcurementForeignTradeCreditService {
48 private static final String BPM_FLAG = "CUSTOMER_CREDIT_OUT"; 56 private static final String BPM_FLAG = "CUSTOMER_CREDIT_OUT";
  57 + private static final int REVIEW_REMIND_DAYS = 15;
49 58
50 @Resource 59 @Resource
51 private FlowInstanceWrapperService flowInstanceWrapperService; 60 private FlowInstanceWrapperService flowInstanceWrapperService;
@@ -55,6 +64,8 @@ public class ProcurementForeignTradeCreditServiceImpl @@ -55,6 +64,8 @@ public class ProcurementForeignTradeCreditServiceImpl
55 private FlowTaskWrapperMapper flowTaskWrapperMapper; 64 private FlowTaskWrapperMapper flowTaskWrapperMapper;
56 @Resource 65 @Resource
57 private SysUserService sysUserService; 66 private SysUserService sysUserService;
  67 + @Autowired
  68 + private MqProducerService mqProducerService;
58 69
59 @Override 70 @Override
60 public PageResult<ProcurementForeignTradeCredit> query(Integer pageIndex, Integer pageSize, 71 public PageResult<ProcurementForeignTradeCredit> query(Integer pageIndex, Integer pageSize,
@@ -185,6 +196,17 @@ public class ProcurementForeignTradeCreditServiceImpl @@ -185,6 +196,17 @@ public class ProcurementForeignTradeCreditServiceImpl
185 } 196 }
186 197
187 @Override 198 @Override
  199 + public void updateFreeze(List<String> ids, Boolean freeze) {
  200 + if (CollectionUtils.isEmpty(ids) || freeze == null) {
  201 + throw new DefaultClientException("资信IDs、冻结状态不能为空!");
  202 + }
  203 + LambdaUpdateWrapper<ProcurementForeignTradeCredit> updateWrapper = Wrappers.lambdaUpdate(ProcurementForeignTradeCredit.class)
  204 + .set(ProcurementForeignTradeCredit::getFreeze, freeze)
  205 + .in(ProcurementForeignTradeCredit::getId, ids);
  206 + getBaseMapper().update(updateWrapper);
  207 + }
  208 +
  209 + @Override
188 public void updateNoFlowInstance(ProcurementForeignTradeCredit customerCredit) { 210 public void updateNoFlowInstance(ProcurementForeignTradeCredit customerCredit) {
189 if (ObjectUtil.isNull(customerCredit.getId())) { 211 if (ObjectUtil.isNull(customerCredit.getId())) {
190 throw new DefaultClientException("资信ID不能为空!"); 212 throw new DefaultClientException("资信ID不能为空!");
@@ -208,6 +230,54 @@ public class ProcurementForeignTradeCreditServiceImpl @@ -208,6 +230,54 @@ public class ProcurementForeignTradeCreditServiceImpl
208 return reviewer == null ? new ForeignTradeReviewerDto() : reviewer; 230 return reviewer == null ? new ForeignTradeReviewerDto() : reviewer;
209 } 231 }
210 232
  233 + /**
  234 + * 每天早上八点检查外贸资信下次评审时间提醒
  235 + */
  236 + @Scheduled(cron = "0 0 8 * * ?")
  237 + public void nextReviewTimeReminder() {
  238 + LocalDate currentDate = LocalDate.now();
  239 + LocalDate remindEndDate = currentDate.plusDays(REVIEW_REMIND_DAYS);
  240 +
  241 + LambdaQueryWrapper<ProcurementForeignTradeCredit> reminderWrapper =
  242 + Wrappers.lambdaQuery(ProcurementForeignTradeCredit.class)
  243 + .eq(ProcurementForeignTradeCredit::getStatus, "PASS")
  244 + .eq(ProcurementForeignTradeCredit::getFreeze, Boolean.FALSE)
  245 + .ge(ProcurementForeignTradeCredit::getNextReviewTime, currentDate)
  246 + .le(ProcurementForeignTradeCredit::getNextReviewTime, remindEndDate);
  247 + List<ProcurementForeignTradeCredit> reminderList = list(reminderWrapper);
  248 + for (ProcurementForeignTradeCredit customerCredit : reminderList) {
  249 + sendReminderMessage(customerCredit);
  250 + }
  251 + }
  252 +
  253 + /**
  254 + * 每天凌晨检查外贸资信处理到期冻结。
  255 + */
  256 + @Scheduled(cron = "0 0 0 * * ?")
  257 + public void freezeReminder() {
  258 + LocalDate currentDate = LocalDate.now();
  259 +
  260 + LambdaQueryWrapper<ProcurementForeignTradeCredit> freezeWrapper =
  261 + Wrappers.lambdaQuery(ProcurementForeignTradeCredit.class)
  262 + .eq(ProcurementForeignTradeCredit::getStatus, "PASS")
  263 + .eq(ProcurementForeignTradeCredit::getFreeze, Boolean.FALSE)
  264 + .lt(ProcurementForeignTradeCredit::getNextReviewTime, currentDate);
  265 + List<ProcurementForeignTradeCredit> freezeList = list(freezeWrapper);
  266 + List<String> freezeIds = new ArrayList<>();
  267 + List<ProcurementForeignTradeCredit> needFreezeList = new ArrayList<>();
  268 + for (ProcurementForeignTradeCredit customerCredit : freezeList) {
  269 + freezeIds.add(customerCredit.getId());
  270 + needFreezeList.add(customerCredit);
  271 + }
  272 +
  273 + if (!freezeIds.isEmpty()) {
  274 + updateFreeze(freezeIds, Boolean.TRUE);
  275 + for (ProcurementForeignTradeCredit customerCredit : needFreezeList) {
  276 + sendFreezeMessage(customerCredit);
  277 + }
  278 + }
  279 + }
  280 +
211 private void fillData(ProcurementForeignTradeCredit data, CreateProcurementForeignTradeCreditVo vo, SysUser investigator) { 281 private void fillData(ProcurementForeignTradeCredit data, CreateProcurementForeignTradeCreditVo vo, SysUser investigator) {
212 data.setUnitName(vo.getUnitName()); 282 data.setUnitName(vo.getUnitName());
213 data.setCompanyNature(vo.getCompanyNature()); 283 data.setCompanyNature(vo.getCompanyNature());
@@ -304,4 +374,52 @@ public class ProcurementForeignTradeCreditServiceImpl @@ -304,4 +374,52 @@ public class ProcurementForeignTradeCreditServiceImpl
304 } 374 }
305 return investigator; 375 return investigator;
306 } 376 }
  377 +
  378 + /**
  379 + * 发送下次评审时间提醒消息。
  380 + *
  381 + * @param customerCredit 外贸资信
  382 + */
  383 + private void sendReminderMessage(ProcurementForeignTradeCredit customerCredit) {
  384 + if (customerCredit == null || StringUtils.isBlank(customerCredit.getCreateById())
  385 + || customerCredit.getNextReviewTime() == null) {
  386 + return;
  387 + }
  388 +
  389 + Set<String> userIdSet = new HashSet<>();
  390 + userIdSet.add(customerCredit.getCreateById());
  391 + SysSiteMessageDto messageDto = new SysSiteMessageDto();
  392 + messageDto.setUserIdList(new ArrayList<>(userIdSet));
  393 + messageDto.setTitle("采购外贸客户资信评审到期提醒");
  394 + messageDto.setContent("您创建的客户资信单位【" + StringUtils.defaultString(customerCredit.getUnitName())
  395 + + "】下次评审时间将于" + customerCredit.getNextReviewTime()
  396 + + "到期,请及时发起变更,逾期未发起变更系统将自动冻结。");
  397 + messageDto.setBizKey(IdUtil.getId());
  398 + messageDto.setCreateUserId(null);
  399 + mqProducerService.createSysSiteMessage(messageDto);
  400 + }
  401 +
  402 + /**
  403 + * 发送自动冻结提醒消息。
  404 + *
  405 + * @param customerCredit 外贸资信
  406 + */
  407 + private void sendFreezeMessage(ProcurementForeignTradeCredit customerCredit) {
  408 + if (customerCredit == null || StringUtils.isBlank(customerCredit.getCreateById())
  409 + || customerCredit.getNextReviewTime() == null) {
  410 + return;
  411 + }
  412 +
  413 + Set<String> userIdSet = new HashSet<>();
  414 + userIdSet.add(customerCredit.getCreateById());
  415 + SysSiteMessageDto messageDto = new SysSiteMessageDto();
  416 + messageDto.setUserIdList(new ArrayList<>(userIdSet));
  417 + messageDto.setTitle("采购外贸客户资信自动冻结提醒");
  418 + messageDto.setContent("您创建的客户资信单位【" + StringUtils.defaultString(customerCredit.getUnitName())
  419 + + "】下次评审时间已于" + customerCredit.getNextReviewTime()
  420 + + "到期,且未发起变更,系统已自动冻结。");
  421 + messageDto.setBizKey(IdUtil.getId());
  422 + messageDto.setCreateUserId(null);
  423 + mqProducerService.createSysSiteMessage(messageDto);
  424 + }
307 } 425 }
@@ -64,6 +64,14 @@ public interface ProcurementForeignTradeCreditService extends BaseMpService<Proc @@ -64,6 +64,14 @@ public interface ProcurementForeignTradeCreditService extends BaseMpService<Proc
64 void updateStatus(String id, String status); 64 void updateStatus(String id, String status);
65 65
66 /** 66 /**
  67 + * 更新冻结状态
  68 + *
  69 + * @param ids 资信ID集合
  70 + * @param freeze 冻结状态
  71 + */
  72 + void updateFreeze(List<String> ids, Boolean freeze);
  73 +
  74 + /**
67 * 修改(不走审核) 75 * 修改(不走审核)
68 * 76 *
69 * @param customerCredit 客户资信 77 * @param customerCredit 客户资信