From 35dc22f8f1ff5d6d07a78ff1178286ec3f8129ef Mon Sep 17 00:00:00 2001 From: "feng.li" Date: Thu, 20 Jul 2023 16:46:50 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8D=95=E8=AF=8D=E6=8B=BC=E5=86=99vedio->?= =?UTF-8?q?video?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/HyInspectionMapper.xml | 110 +++++++++--------- .../mapper/HyInterviewInspectionLogMapper.xml | 92 +++++++-------- .../cool/store/vo/interview/InterviewVO.java | 2 +- .../service/impl/InterviewServiceImpl.java | 2 +- 4 files changed, 103 insertions(+), 103 deletions(-) diff --git a/coolstore-partner-dao/src/main/resources/mapper/HyInspectionMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/HyInspectionMapper.xml index 7629e1fad..2934a272f 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/HyInspectionMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/HyInspectionMapper.xml @@ -3,20 +3,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -51,11 +51,11 @@ description, inspection_time, creator, updator, remark, deleted, create_time, update_time) - values (#{id}, #{interviewPlanId}, #{operatorUserId,jdbcType=VARCHAR}, - #{type,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{files,jdbcType=VARCHAR}, - #{description,jdbcType=VARCHAR}, #{inspectionTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, - #{updator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + values (#{id}, #{interviewPlanId}, #{operatorUserId}, + #{type}, #{status}, #{files}, + #{description}, #{inspectionTime}, #{creator}, + #{updator}, #{remark}, #{deleted}, + #{createTime}, #{updateTime}) insert into hy_inspection @@ -111,40 +111,40 @@ #{interviewPlanId}, - #{operatorUserId,jdbcType=VARCHAR}, + #{operatorUserId}, - #{type,jdbcType=TINYINT}, + #{type}, - #{status,jdbcType=TINYINT}, + #{status}, - #{files,jdbcType=VARCHAR}, + #{files}, - #{description,jdbcType=VARCHAR}, + #{description}, - #{inspectionTime,jdbcType=TIMESTAMP}, + #{inspectionTime}, - #{creator,jdbcType=VARCHAR}, + #{creator}, - #{updator,jdbcType=VARCHAR}, + #{updator}, - #{remark,jdbcType=VARCHAR}, + #{remark}, - #{deleted,jdbcType=BIT}, + #{deleted}, - #{createTime,jdbcType=TIMESTAMP}, + #{createTime}, - #{updateTime,jdbcType=TIMESTAMP}, + #{updateTime}, @@ -155,40 +155,40 @@ interview_plan_id = #{interviewPlanId}, - operator_user_id = #{operatorUserId,jdbcType=VARCHAR}, + operator_user_id = #{operatorUserId}, - type = #{type,jdbcType=TINYINT}, + type = #{type}, - status = #{status,jdbcType=TINYINT}, + status = #{status}, - files = #{files,jdbcType=VARCHAR}, + files = #{files}, - description = #{description,jdbcType=VARCHAR}, + description = #{description}, - inspection_time = #{inspectionTime,jdbcType=TIMESTAMP}, + inspection_time = #{inspectionTime}, - creator = #{creator,jdbcType=VARCHAR}, + creator = #{creator}, - updator = #{updator,jdbcType=VARCHAR}, + updator = #{updator}, - remark = #{remark,jdbcType=VARCHAR}, + remark = #{remark}, - deleted = #{deleted,jdbcType=BIT}, + deleted = #{deleted}, - create_time = #{createTime,jdbcType=TIMESTAMP}, + create_time = #{createTime}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime}, where id = #{id} @@ -196,18 +196,18 @@ update hy_inspection set interview_plan_id = #{interviewPlanId}, - operator_user_id = #{operatorUserId,jdbcType=VARCHAR}, - type = #{type,jdbcType=TINYINT}, - status = #{status,jdbcType=TINYINT}, - files = #{files,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - inspection_time = #{inspectionTime,jdbcType=TIMESTAMP}, - creator = #{creator,jdbcType=VARCHAR}, - updator = #{updator,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - deleted = #{deleted,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} + operator_user_id = #{operatorUserId}, + type = #{type}, + status = #{status}, + files = #{files}, + description = #{description}, + inspection_time = #{inspectionTime}, + creator = #{creator}, + updator = #{updator}, + remark = #{remark}, + deleted = #{deleted}, + create_time = #{createTime}, + update_time = #{updateTime} where id = #{id} \ No newline at end of file diff --git a/coolstore-partner-dao/src/main/resources/mapper/HyInterviewInspectionLogMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/HyInterviewInspectionLogMapper.xml index 25a174b64..ce24de897 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/HyInterviewInspectionLogMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/HyInterviewInspectionLogMapper.xml @@ -3,16 +3,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -23,21 +23,21 @@ select from hy_interview_inspection_log - where id = #{id,jdbcType=BIGINT} + where id = #{id} delete from hy_interview_inspection_log - where id = #{id,jdbcType=BIGINT} + where id = #{id} insert into hy_interview_inspection_log (id, operator_user_id, inspection_id, operation_type, description, files, operation_time, remark, create_time, update_time) - values (#{id,jdbcType=BIGINT}, #{operatorUserId,jdbcType=VARCHAR}, #{inspectionId,jdbcType=BIGINT}, - #{operationType,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR}, #{files,jdbcType=VARCHAR}, - #{operationTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) + values (#{id}, #{operatorUserId}, #{inspectionId}, + #{operationType}, #{description}, #{files}, + #{operationTime}, #{remark}, #{createTime}, + #{updateTime}) insert into hy_interview_inspection_log @@ -75,34 +75,34 @@ - #{id,jdbcType=BIGINT}, + #{id}, - #{operatorUserId,jdbcType=VARCHAR}, + #{operatorUserId}, - #{inspectionId,jdbcType=BIGINT}, + #{inspectionId}, - #{operationType,jdbcType=TINYINT}, + #{operationType}, - #{description,jdbcType=VARCHAR}, + #{description}, - #{files,jdbcType=VARCHAR}, + #{files}, - #{operationTime,jdbcType=TIMESTAMP}, + #{operationTime}, - #{remark,jdbcType=VARCHAR}, + #{remark}, - #{createTime,jdbcType=TIMESTAMP}, + #{createTime}, - #{updateTime,jdbcType=TIMESTAMP}, + #{updateTime}, @@ -110,46 +110,46 @@ update hy_interview_inspection_log - operator_user_id = #{operatorUserId,jdbcType=VARCHAR}, + operator_user_id = #{operatorUserId}, - inspection_id = #{inspectionId,jdbcType=BIGINT}, + inspection_id = #{inspectionId}, - operation_type = #{operationType,jdbcType=TINYINT}, + operation_type = #{operationType}, - description = #{description,jdbcType=VARCHAR}, + description = #{description}, - files = #{files,jdbcType=VARCHAR}, + files = #{files}, - operation_time = #{operationTime,jdbcType=TIMESTAMP}, + operation_time = #{operationTime}, - remark = #{remark,jdbcType=VARCHAR}, + remark = #{remark}, - create_time = #{createTime,jdbcType=TIMESTAMP}, + create_time = #{createTime}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime}, - where id = #{id,jdbcType=BIGINT} + where id = #{id} update hy_interview_inspection_log - set operator_user_id = #{operatorUserId,jdbcType=VARCHAR}, - inspection_id = #{inspectionId,jdbcType=BIGINT}, - operation_type = #{operationType,jdbcType=TINYINT}, - description = #{description,jdbcType=VARCHAR}, - files = #{files,jdbcType=VARCHAR}, - operation_time = #{operationTime,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} + set operator_user_id = #{operatorUserId}, + inspection_id = #{inspectionId}, + operation_type = #{operationType}, + description = #{description}, + files = #{files}, + operation_time = #{operationTime}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime} + where id = #{id} \ No newline at end of file diff --git a/coolstore-partner-model/src/main/java/com/cool/store/vo/interview/InterviewVO.java b/coolstore-partner-model/src/main/java/com/cool/store/vo/interview/InterviewVO.java index 50e4ec652..6d70c7dff 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/vo/interview/InterviewVO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/vo/interview/InterviewVO.java @@ -98,7 +98,7 @@ public class InterviewVO { private Integer status; @ApiModelProperty(value = "面试过程信息视频URL数组", required = true) - private List vedioList; + private List videoList; @ApiModelProperty(value = "面试过程信息未解析String", required = false) private String processInfo; diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java index 75b5f0fbc..7cbf0374c 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java @@ -123,7 +123,7 @@ public class InterviewServiceImpl implements InterviewService { //将 processInfo 解析为 List if (!StringUtils.isEmpty(vo.getProcessInfo())) { List split = Arrays.asList(vo.getProcessInfo().split(",")); - vo.setVedioList(split); + vo.setVideoList(split); vo.setProcessInfo(""); } //查询面试官和记录人信息(面试官必须有) From f3e46c281ebc46262891aa8f7915c41aa0c9e18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E7=AB=B9=E7=BA=A2?= Date: Thu, 20 Jul 2023 16:51:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=84=8F=E5=90=91?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cool/store/service/impl/ZoneServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/ZoneServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/ZoneServiceImpl.java index 80f2d5763..16f6ff6fd 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/ZoneServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/ZoneServiceImpl.java @@ -48,6 +48,8 @@ public class ZoneServiceImpl implements ZoneService { EnterpriseUserDAO enterpriseUserDAO; @Resource RegionDAO regionDAO; + @Resource + HyOpenAreaInfoDAO hyOpenAreaInfoDAO; @@ -67,8 +69,9 @@ public class ZoneServiceImpl implements ZoneService { //添加战区映射的意向区域 hyIntendDevMappingDAO.deleteByOpenAreaIds(intentAreaSettingRequest.getOpenAreaIdList(),hyIntendDevZoneInfoDO.getType()); List openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList(); + List openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList); List list = new ArrayList<>(); - openAreaIdList.stream().forEach(x->{ + openAreaIdFilterList.stream().forEach(x->{ HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO(); hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType()); hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x)); @@ -95,8 +98,9 @@ public class ZoneServiceImpl implements ZoneService { hyIntendDevMappingDAO.deleteByMappingIds(Arrays.asList(intentAreaSettingRequest.getId()) ,intentAreaSettingRequest.getType()); List openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList(); + List openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList); List list = new ArrayList<>(); - openAreaIdList.stream().forEach(x->{ + openAreaIdFilterList.stream().forEach(x->{ HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO(); hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType()); hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x)); @@ -206,7 +210,8 @@ public class ZoneServiceImpl implements ZoneService { //查询已经绑定战区的 意向区域 List list = hyIntendDevMappingDAO.selectByOpenAreaMappingIdList(intentAreaSettingRequest.getOpenAreaIdList(),intentAreaSettingRequest.getType(),intentAreaSettingRequest.getId()); List openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList()); - List hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList); + List openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList); + List hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdFilterList); Map areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName)); List result = new ArrayList<>(); list.forEach(x->{ From 4e97ea41e8b0296bd8ff736f73651660e16706df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E6=89=AC?= Date: Thu, 20 Jul 2023 19:18:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=92=8C=E9=A3=9E?= =?UTF-8?q?=E4=B9=A6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cool/store/constants/CommonConstants.java | 7 +++- .../cool/store/enums/FeiShuNoticeMsgEnum.java | 40 +++++++++++++++++++ .../com/cool/store/request/IntentSmsReq.java | 13 ++++++ .../store/service/impl/FlowServiceImpl.java | 11 +++++ .../impl/HyPartnerIntentInfoServiceImpl.java | 19 ++++++--- .../impl/HyPartnerLineInfoServiceImpl.java | 30 ++++++++++++-- .../store/service/impl/NoticeService.java | 40 +++++++++++++++++++ 7 files changed, 151 insertions(+), 9 deletions(-) create mode 100644 coolstore-partner-common/src/main/java/com/cool/store/enums/FeiShuNoticeMsgEnum.java create mode 100644 coolstore-partner-model/src/main/java/com/cool/store/request/IntentSmsReq.java create mode 100644 coolstore-partner-service/src/main/java/com/cool/store/service/impl/NoticeService.java diff --git a/coolstore-partner-common/src/main/java/com/cool/store/constants/CommonConstants.java b/coolstore-partner-common/src/main/java/com/cool/store/constants/CommonConstants.java index c5329cd09..421cc5890 100644 --- a/coolstore-partner-common/src/main/java/com/cool/store/constants/CommonConstants.java +++ b/coolstore-partner-common/src/main/java/com/cool/store/constants/CommonConstants.java @@ -120,5 +120,10 @@ public class CommonConstants { public static final String ALLOCATION = "allocation"; public static final String TRANSFER = "transfer"; - + + // 短信模版-意向申请审批通过 + public static final String SMS_TEMPLATE_CODE_INTENT = "SMS_461990823"; + // 短信模版-资质审核通过 + public static final String SMS_TEMPLATE_CODE_VERIFY = "SMS_461980876"; + } diff --git a/coolstore-partner-common/src/main/java/com/cool/store/enums/FeiShuNoticeMsgEnum.java b/coolstore-partner-common/src/main/java/com/cool/store/enums/FeiShuNoticeMsgEnum.java new file mode 100644 index 000000000..246f0bb10 --- /dev/null +++ b/coolstore-partner-common/src/main/java/com/cool/store/enums/FeiShuNoticeMsgEnum.java @@ -0,0 +1,40 @@ +package com.cool.store.enums; + +/** + * @Author: young.yu + * @Date: 2023-07-19 16:49 + * @Description: + */ +public enum FeiShuNoticeMsgEnum { + + //分配招商经理 + ALLOCATION_INVESTMENT_MANAGER("分配招商经理", "有新的线索 于 {0} 分配给您,线索信息{1}手机号{2},请及时跟进"), + //转让招商经理 + TRANS_INVESTMENT_MANAGER("转让招商经理", "有新的线索 于 {0} 转让给您,线索信息{1}手机号{2},请及时跟进"), + //意向申请通知 + INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人{0}手机号{1}于 {2} 提交加盟意向申请,请及时处理"); + + private String title; + private String content; + + FeiShuNoticeMsgEnum(String title, String content) { + this.title = title; + this.content = content; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/IntentSmsReq.java b/coolstore-partner-model/src/main/java/com/cool/store/request/IntentSmsReq.java new file mode 100644 index 000000000..986a74d4f --- /dev/null +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/IntentSmsReq.java @@ -0,0 +1,13 @@ +package com.cool.store.request; + +import lombok.Data; + +/** + * @Author: young.yu + * @Date: 2023-06-21 11:17 + * @Description: + */ +@Data +public class IntentSmsReq { + private String deadLine; +} diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java index c33a407f0..7dadc4a57 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java @@ -5,10 +5,12 @@ import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.cool.store.constants.CommonConstants; import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.LoginUserInfo; import com.cool.store.dao.EnterpriseUserDAO; import com.cool.store.dao.HyInterviewDAO; +import com.cool.store.dao.HyPartnerBaseInfoDAO; import com.cool.store.dto.log.CreateQualifyVerifyDTO; import com.cool.store.dto.log.LogBasicDTO; import com.cool.store.dto.mdm.AccessTokenDTO; @@ -30,6 +32,7 @@ import com.cool.store.request.data.flow.SkrRelshipProve; import com.cool.store.service.FlowService; import com.cool.store.service.HyPartnerLineInfoService; import com.cool.store.service.LogService; +import com.cool.store.service.SmsService; import com.cool.store.utils.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -94,6 +97,11 @@ public class FlowServiceImpl implements FlowService { @Autowired private HyPartnerLineInfoService hyPartnerLineInfoService; + @Autowired + private SmsService smsService; + + @Autowired + private HyPartnerBaseInfoDAO hyPartnerBaseInfoDAO; @Override @Transactional public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException { @@ -260,6 +268,9 @@ public class FlowServiceImpl implements FlowService { //3. 生成通过函并修改数据库相关信息 //TODO 问题:如果因为 pdf 生成失败或者其他原因导致异常,但是由于 MDM 只是做回调,不对回调是否成功负责,会导致流程信息缺失 genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId); + //发送加盟商资质审核通过短信 + HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(partnerLineId); + smsService.sendSms(null, CommonConstants.SMS_TEMPLATE_CODE_VERIFY, hyPartnerBaseInfoDO.getMobile()); //记录日志 LogBasicDTO log = LogBasicDTO.builder().operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)) .build(); diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerIntentInfoServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerIntentInfoServiceImpl.java index 8fa325653..c4cdc5d76 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerIntentInfoServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerIntentInfoServiceImpl.java @@ -8,15 +8,11 @@ import com.cool.store.constants.RedisConstant; import com.cool.store.context.LoginUserInfo; import com.cool.store.context.PartnerUserHolder; import com.cool.store.dao.*; -import com.cool.store.dto.log.AddTagsDTO; import com.cool.store.dto.log.LineLogInfo; import com.cool.store.dto.log.UserInfoUpdateDTO; import com.cool.store.dto.log.WantInfoUpdateDTO; import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO; -import com.cool.store.entity.HyOpenAreaInfoDO; -import com.cool.store.entity.HyPartnerIntentInfoDO; -import com.cool.store.entity.HyPartnerLineInfoDO; -import com.cool.store.entity.HyPartnerUserInfoDO; +import com.cool.store.entity.*; import com.cool.store.enums.*; import com.cool.store.exception.ServiceException; import com.cool.store.request.BaseUserInfoRequest; @@ -78,6 +74,9 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic @Autowired private LogService logService; + @Autowired + private NoticeService noticeService; + @Override public PageInfo getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) { PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO(); @@ -181,6 +180,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic @Override public Integer submitPartnerIntentInfo(PartnerIntentInfoRequest request) { + boolean isUpdateIntentInfo = true; log.info("HyPartnerClerkServiceImpl#submitPartnerIntentInfo request:{}", JSONObject.toJSONString(request)); if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){ throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED); @@ -196,6 +196,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic OperateTypeEnum operateTypeEnum = OperateTypeEnum.INTENT_INFO_UPDATE; HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId()); if(intentInfoDO == null){ + isUpdateIntentInfo = false; intentInfoDO = new HyPartnerIntentInfoDO(); fillIntentInfo(intentInfoDO, request); hyPartnerIntentInfoDAO.insertSelective(intentInfoDO); @@ -220,11 +221,19 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic if (LineStatusEnum.PUBLIC_SEAS.getCode().equals(hyPartnerLineInfoDO.getLineStatus())){ Boolean flag = hyPartnerLineInfoService.assignFollowUser(request.getPartnerId(), request.getWantShopArea(), request.getAcceptAdjustType()); hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode()); + List userIdList = new ArrayList<>(); if (flag){ String investmentManager = hyPartnerLineInfoService.getAssignFollowUser(request.getPartnerId(), "intent"); hyPartnerLineInfoDO.setInvestmentManager(investmentManager); + userIdList.add(investmentManager); } hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO); + if(!isUpdateIntentInfo){ + noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(),DateUtil.formatDateTime(new Date())); + } + if(flag){//分配招商经理成功才发送分配招商经理的飞书工作通知 + noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); + } } } //记录日志 diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerLineInfoServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerLineInfoServiceImpl.java index a733b4238..1b41ade56 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerLineInfoServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerLineInfoServiceImpl.java @@ -2,6 +2,7 @@ package com.cool.store.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.cool.store.constants.CommonConstants; import com.cool.store.constants.RedisConstant; @@ -26,12 +27,11 @@ import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.sql.Array; import java.text.MessageFormat; import java.util.*; import java.util.stream.Collectors; @@ -78,6 +78,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService { @Resource HyPhoneLocationService hyPhoneLocationService; + @Autowired + private NoticeService noticeService; + + @Autowired + private SmsService smsService; @Override public StageCountVO selectStagePendingCount(String userId) { @@ -161,6 +166,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService { && WorkflowStatusEnum.INTERVIEW_2.getCode().equals(hyPartnerLineInfoDO.getWorkflowStatus())){ workFlowService.transferInvestmentManager(WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),request); } + //发送飞书工作通知 + HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(request.getLineId()); + noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile()); //添加日志 LineLogInfo lineLogInfo = new LineLogInfo(hyPartnerLineInfoDO.getPartnerId(), hyPartnerLineInfoDO.getId(), user.getUserId(), @@ -215,9 +223,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService { List otherLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() == null).collect(Collectors.toList()); List otherLineIdList = otherLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList()); hyPartnerLineInfoDAO.updateInvestmentManager(user.getUserId(), otherLineIdList); - //添加日志 partnerLineInfoList.forEach(x->{ + //给招商经理发送飞书工作通知 + List userIdList = new ArrayList<>(); + userIdList.add(user.getUserId()); + HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(x.getId()); + + noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile()); + LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), user.getUserId(), user.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER, WorkflowStageEnum.getWorkflowStageByCode(x.getWorkflowStage()), @@ -362,6 +376,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService { hy.setCertifyFile(JSONObject.toJSONString(closeFollowRequest.getCertifyFile())); } hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hy); + IntentSmsReq intentSmsReq = new IntentSmsReq(); + intentSmsReq.setDeadLine(DateUtil.formatDateTime(hyPartnerLineInfoDO.getDeadline())); + smsService.sendSms(JSON.toJSONString(intentSmsReq),CommonConstants.SMS_TEMPLATE_CODE_INTENT, hy.getMobile()); } //拒绝 @@ -711,6 +728,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService { hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO); } } + //发送飞书工作通知 + if(flag){ + List userIdList = new ArrayList<>(); + userIdList.add(investmentManager); + HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId); + noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); + } return hyPartnerLineInfoDO; } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/NoticeService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/NoticeService.java new file mode 100644 index 000000000..6ff5c289c --- /dev/null +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/NoticeService.java @@ -0,0 +1,40 @@ +package com.cool.store.service.impl; + +import com.cool.store.dto.message.SendCardMessageDTO; +import com.cool.store.enums.FeiShuNoticeMsgEnum; +import com.cool.store.enums.MessageTypeEnum; +import com.cool.store.http.ISVHttpRequest; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.text.MessageFormat; +import java.util.List; + +/** + * @Author: young.yu + * @Date: 2023-07-19 17:06 + * @Description: + */ +@Slf4j +@Service +public class NoticeService { + @Value("${feishu.notice.link.url:null}") + private String linkUrl; + @Autowired + private ISVHttpRequest isvHttpRequest; + public void sendFeiShuNotice(FeiShuNoticeMsgEnum feiShuNoticeMsgEnum, List userIds,Object... objects) { + try{ + SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO(); + sendCardMessageDTO.setUserIds(userIds); + sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER); + sendCardMessageDTO.setMessageUrl(linkUrl); + sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle()); + sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects)); + isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO); + }catch (Exception e){ + log.info("发送飞书通知失败"); + } + } +} From 40142c99dc3aaa30c41e81d61aac73c0b640229d Mon Sep 17 00:00:00 2001 From: "feng.li" Date: Fri, 21 Jul 2023 13:56:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?800=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=9D=A2=E8=AF=95=E7=A8=BD=E6=A0=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AFcreate=5Ftime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cool/store/service/impl/FlowServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java index ebf01250a..8ad1686e4 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java @@ -264,6 +264,7 @@ public class FlowServiceImpl implements FlowService { //4. 向面试稽核表中新增一条信息 HyInspectionDO hyInspectionDO = new HyInspectionDO(); hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId)); + hyInspectionDO.setCreateTime(DateUtil.formatDateTime(passDate)); inspectionMapper.insertSelective(hyInspectionDO); //记录日志 LogBasicDTO log = LogBasicDTO.builder().operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)) From 5b2b60cf32b166dac692a80c0029e20f8e9dd50f Mon Sep 17 00:00:00 2001 From: "feng.li" Date: Fri, 21 Jul 2023 16:41:19 +0800 Subject: [PATCH 5/5] =?UTF-8?q?800=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=9D=A2=E8=AF=95=E7=A8=BD=E6=A0=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AFtype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cool/store/service/impl/FlowServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java index 60496dfff..bf62ccd95 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java @@ -17,6 +17,7 @@ import com.cool.store.dto.mdm.AccessTokenDTO; import com.cool.store.dto.response.MDMResultDTO; import com.cool.store.entity.*; import com.cool.store.enums.ErrorCodeEnum; +import com.cool.store.enums.InspectionTyeEnum; import com.cool.store.enums.OperateTypeEnum; import com.cool.store.enums.WorkflowStatusEnum; import com.cool.store.exception.ApiException; @@ -273,6 +274,7 @@ public class FlowServiceImpl implements FlowService { HyInspectionDO hyInspectionDO = new HyInspectionDO(); hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId)); hyInspectionDO.setCreateTime(DateUtil.formatDateTime(passDate)); + hyInspectionDO.setType(InspectionTyeEnum.INTERVIEW_INSPECTION.getCode()); inspectionMapper.insertSelective(hyInspectionDO); //发送加盟商资质审核通过短信 HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(partnerLineId);