Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -40,6 +40,9 @@ public enum MessageEnum {
|
||||
MESSAGE_22("您收到一位员工由您带教,请查收", "##### 员工姓名:【${userName}】,员工手机号码:【${mobile}】,登记时间:【${registerTime}】"),
|
||||
MESSAGE_23("您有一个门店待发布加盟费/保证金账单,请查收", "##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerName}\n##### 加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_24("您有一个门店待预约三方验收时间,请查收", "#####门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_25("您有一个门店待进行三方验收,请查收","#####门店名称:${storeName}\n#####加盟商姓名:${partnerUsername}\n#####加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_26("您有一个门店需要上传开业运营方案,请查收","#####门店名称:${storeName}\n#####加盟商姓名:${partnerUsername}\n#####加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_27("您有一个门店需要上传首批订货清单,请查收","#####门店名称:${storeName}\n#####加盟商姓名:${partnerUsername}\n#####加盟商手机号码:${partnerMobile}\n"),
|
||||
;
|
||||
|
||||
private String title;
|
||||
@@ -108,11 +111,12 @@ public enum MessageEnum {
|
||||
case MESSAGE_19:
|
||||
case MESSAGE_20:
|
||||
case MESSAGE_23:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=franchiseeDetails×tamp="+System.currentTimeMillis()+"&lineId="+ paramMap.get("lineId"), StandardCharsets.UTF_8.name());
|
||||
//跳转我的加盟商的加盟商详情都可以使用这个
|
||||
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId=" + corpId + "&appUrl=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=franchiseeDetails×tamp=" + System.currentTimeMillis() + "&lineId=" + paramMap.get("lineId"), StandardCharsets.UTF_8.name());
|
||||
case MESSAGE_17:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=license×tamp="+System.currentTimeMillis()+"&shopId="+ paramMap.get("shopId"), StandardCharsets.UTF_8.name());
|
||||
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId=" + corpId + "&appUrl=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=license×tamp=" + System.currentTimeMillis() + "&shopId=" + paramMap.get("shopId"), StandardCharsets.UTF_8.name());
|
||||
case MESSAGE_21:
|
||||
return domainUrl + "/dd-noticemsg?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=employeeTraining×tamp="+System.currentTimeMillis()+"&userDetailId="+ paramMap.get("userDetailId"), StandardCharsets.UTF_8.name());
|
||||
@@ -122,6 +126,15 @@ public enum MessageEnum {
|
||||
case MESSAGE_24:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=employeeTraining×tamp="+System.currentTimeMillis(), StandardCharsets.UTF_8.name());
|
||||
case MESSAGE_25:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=employeeTraining×tamp="+System.currentTimeMillis(), StandardCharsets.UTF_8.name());
|
||||
case MESSAGE_26:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=employeeTraining×tamp="+System.currentTimeMillis()+"&shopId="+ paramMap.get("shopId"), StandardCharsets.UTF_8.name());
|
||||
case MESSAGE_27:
|
||||
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
|
||||
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=employeeTraining×tamp="+System.currentTimeMillis()+"&shopId="+ paramMap.get("shopId"), StandardCharsets.UTF_8.name());
|
||||
|
||||
default:
|
||||
return "";
|
||||
|
||||
@@ -94,7 +94,14 @@ public class CoolDateUtils {
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
public static final String DateFormat(Date date,String format){
|
||||
if (StringUtils.isBlank(format)){
|
||||
return null;
|
||||
}
|
||||
DateFormat dateFormat = new SimpleDateFormat(format);
|
||||
String str = dateFormat.format(date);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.entity.AssessmentDataDO;
|
||||
import com.cool.store.mapper.AssessmentDataMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
@@ -65,8 +66,11 @@ public class AssessmentDataDAO {
|
||||
return assessmentDataMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<AssessmentDataDO> selectListByShopId(Long shopId) {
|
||||
return assessmentDataMapper.selectListByShopId(shopId);
|
||||
public List<AssessmentDataDO> selectListByShopId(Long shopId,Long templateIdMin, Long templateIdMax) {
|
||||
if (shopId == null || templateIdMin == 0L || templateIdMax == 0L) {
|
||||
return null;
|
||||
}
|
||||
return assessmentDataMapper.selectListByShopId(shopId,templateIdMin,templateIdMax);
|
||||
}
|
||||
|
||||
public void batchInsertDO(List<AssessmentDataDO> assessmentDataDOList) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface AssessmentDataMapper extends Mapper<AssessmentDataDO> {
|
||||
* @Date: 2024/5/8
|
||||
* @description:三方验收
|
||||
*/
|
||||
List<AssessmentDataDO> selectListByShopId(@Param("shopId") Long shopId);
|
||||
List<AssessmentDataDO> selectListByShopId(@Param("shopId") Long shopId,@Param("templateIdMin") Long templateIdMin,@Param("templateIdMax") Long templateIdMax);
|
||||
|
||||
Integer batchInsert(@Param("assessmentDataList") List<AssessmentDataDO> assessmentDataList);
|
||||
|
||||
|
||||
@@ -80,6 +80,6 @@
|
||||
<select id="selectListByShopId" resultType="com.cool.store.entity.AssessmentDataDO">
|
||||
select *
|
||||
from xfsg_assessment_data
|
||||
where shop_id = #{shopId} and template_id >=75 and template_id <= 108
|
||||
where shop_id = #{shopId} and template_id >=#{templateIdMin} and template_id <= #{templateIdMax}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -65,7 +65,7 @@
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
|
||||
and shop_sub_stage in (60,40,120,130,140,150)
|
||||
and shop_sub_stage in (60,40,120,140,150)
|
||||
</select>
|
||||
|
||||
<update id="updateShopStageInfo">
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,10 @@ public class CommonService {
|
||||
return (AuditResultService) applicationContext.getBean(auditEnum.getClazz());
|
||||
}
|
||||
|
||||
public void sendMessageAsync(List<String> userIds, MessageEnum message, Map<String, String> requestMap){
|
||||
CompletableFuture.runAsync(() -> sendMessage(userIds, message, requestMap));
|
||||
}
|
||||
|
||||
public void sendMessage(List<String> userIds, MessageEnum message, Map<String, String> requestMap){
|
||||
if(CollectionUtils.isEmpty(userIds)){
|
||||
return;
|
||||
@@ -120,6 +125,10 @@ public class CommonService {
|
||||
sendSms(Arrays.asList(poneNumber), templateCode, templateParamMap);
|
||||
}
|
||||
|
||||
public void sendSmsAsync(String poneNumber, SMSMsgEnum templateCode, Map<String, String> templateParamMap){
|
||||
CompletableFuture.runAsync(() -> sendSms(Arrays.asList(poneNumber), templateCode, templateParamMap));
|
||||
}
|
||||
|
||||
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, Map<String, String> templateParamMap){
|
||||
List<String> signNameList = new ArrayList<>();
|
||||
signNameList.add("酷店掌");
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.cool.store.response.ThreeSignResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.AssessmentTemplateVO;
|
||||
import com.cool.store.vo.Fitment.DecorationStageVO;
|
||||
import com.cool.store.vo.Fitment.DecorationModelVO;
|
||||
import com.cool.store.vo.Fitment.DesignInfoVo;
|
||||
@@ -94,7 +95,8 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
private ShopInfoMapper shopInfoMapper;
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
@Resource
|
||||
private AssessmentTemplateService assessmentTemplateService;
|
||||
@Override
|
||||
public DesignInfoVo DesignInfo(Long shopId) {
|
||||
DecorationDTO decoration = getDecorationDTO(shopId);
|
||||
@@ -358,8 +360,10 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitThreeCheck(ThreeAcceptanceCheckRequest request) {
|
||||
log.info("submitThreeCheck, request:{} ", JSONObject.toJSONString(request));
|
||||
|
||||
List<AssessmentDataDO> assessmentDataDOList = assessmentDataDAO.selectListByShopId(request.getShopId());
|
||||
List<AssessmentTemplateVO> assessmentTemplateVOS = assessmentTemplateService.listByType(AssessmentTemplateType.TRIPARTITE_ACCEPTANCE.getCode());
|
||||
Long max = assessmentTemplateVOS.stream().mapToLong(AssessmentTemplateVO::getId).max().orElse(0L);
|
||||
Long min = assessmentTemplateVOS.stream().mapToLong(AssessmentTemplateVO::getId).min().orElse(0L);
|
||||
List<AssessmentDataDO> assessmentDataDOList = assessmentDataDAO.selectListByShopId(request.getShopId(), min,max);
|
||||
List<AssessmentDataDO> assessmentDataDOS = new ArrayList<>();
|
||||
for (AssessmentDataDTO assessmentDataDTO : request.getAssessmentDataDTOS()) {
|
||||
AssessmentDataDO assessmentDataDO = new AssessmentDataDO();
|
||||
@@ -382,8 +386,10 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
@Override
|
||||
public ThreeAcceptanceCheckRequest getThreeChecks(Long shopId) {
|
||||
//todo sql 确定范围
|
||||
List<AssessmentDataDO> assessmentDataDOS = assessmentDataDAO.selectListByShopId(shopId);
|
||||
List<AssessmentTemplateVO> assessmentTemplateVOS = assessmentTemplateService.listByType(AssessmentTemplateType.TRIPARTITE_ACCEPTANCE.getCode());
|
||||
Long max = assessmentTemplateVOS.stream().mapToLong(AssessmentTemplateVO::getId).max().orElse(0L);
|
||||
Long min = assessmentTemplateVOS.stream().mapToLong(AssessmentTemplateVO::getId).min().orElse(0L);
|
||||
List<AssessmentDataDO> assessmentDataDOS = assessmentDataDAO.selectListByShopId(shopId,min,max);
|
||||
if (CollectionUtils.isEmpty(assessmentDataDOS)) {
|
||||
log.error("该用户门店三方验收检查项为空");
|
||||
return null;
|
||||
|
||||
@@ -448,6 +448,13 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
auditStatusService.insert(lineInfo.getId(),interviewInfo.getId(),auditId,AuditStageEnum.TWO.getCode());
|
||||
//发送短信
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SECOND_INTERVIEW_SUCCESS, null);
|
||||
Map<String, String> requestMap = new HashMap<>();
|
||||
//todo 建店还未开始时
|
||||
requestMap.put("storeName","XXX");
|
||||
requestMap.put("partnerName",lineInfo.getUsername());
|
||||
requestMap.put("partnerMobile",lineInfo.getMobile());
|
||||
requestMap.put("lineId",String.valueOf(lineInfo.getId()));
|
||||
commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()),MessageEnum.MESSAGE_23,requestMap);
|
||||
}
|
||||
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.cool.store.dto.decoration.ProjectDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.MessageEnum;
|
||||
import com.cool.store.enums.point.ShopStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
@@ -46,6 +47,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PreparationServiceImpl.class);
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
@Resource
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Resource
|
||||
private OpenAcceptanceInfoDAO openAcceptanceInfoDAO;
|
||||
@@ -178,7 +181,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
|
||||
Boolean buildStoreCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
|
||||
Boolean contractCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage()).getShopSubStageStatus());
|
||||
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
//都完成了 初始化后续流程数据
|
||||
if (buildStoreCompletionFlag && contractCompletionFlag) {
|
||||
//初始化后续流程数据 设计阶段 装修阶段 开业运营方案 首批订货清单
|
||||
@@ -197,9 +201,23 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
ShopStageInfoDO data3 = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_14.getShopSubStage());
|
||||
data3.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus());
|
||||
list.add(data3);
|
||||
//发送督导钉钉
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("storeName",shopInfo.getShopName());
|
||||
messageMap.put("shopId",shopId.toString());
|
||||
messageMap.put("partnerUsername",lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile",lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(shopInfo.getSupervisorUserId()), MessageEnum.MESSAGE_26, messageMap);
|
||||
ShopStageInfoDO data4 = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
|
||||
data4.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus());
|
||||
list.add(data4);
|
||||
//发送督导钉钉
|
||||
Map<String, String> messageMap1 = new HashMap<>();
|
||||
messageMap1.put("storeName",shopInfo.getShopName());
|
||||
messageMap1.put("shopId",shopId.toString());
|
||||
messageMap1.put("partnerUsername",lineInfo.getUsername());
|
||||
messageMap1.put("partnerMobile",lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(shopInfo.getSupervisorUserId()), MessageEnum.MESSAGE_27, messageMap1);
|
||||
shopStageInfoDAO.batchUpdate(list);
|
||||
}
|
||||
}
|
||||
@@ -209,7 +227,7 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
public void whetherToOpenForAcceptance(Long shopId) {
|
||||
Integer allCompletionCount = shopStageInfoDAO.getAllCompletionCount(shopId);
|
||||
//如果等于6 表示前面阶段都已经完成 初始化开业验收数据
|
||||
if (allCompletionCount.equals(CommonConstants.SIX)) {
|
||||
if (allCompletionCount.equals(CommonConstants.FIVE)) {
|
||||
OpenAcceptanceInfoDO openAcceptanceInfoDO = new OpenAcceptanceInfoDO();
|
||||
openAcceptanceInfoDO.setShopId(shopId);
|
||||
openAcceptanceInfoDO.setAcceptanceStatus(CommonConstants.ZERO);
|
||||
@@ -246,10 +264,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
decorationService.getConstructionInfo(shopId);
|
||||
flushFlag = Boolean.TRUE;
|
||||
}
|
||||
return flushFlag;
|
||||
return flushFlag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -203,12 +204,8 @@ public class XxlJobHandler {
|
||||
if (Objects.nonNull(approach)) {
|
||||
Date date = CoolDateUtils.parseDate(approach.getActualBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
if (Objects.nonNull(date)) {
|
||||
Instant instant = date.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.FOUR); // 5天
|
||||
LocalDate now = LocalDate.now();
|
||||
if (datePlusFiveDays.equals(now)) {
|
||||
Result result = getResult(date,CommonConstants.FOUR);
|
||||
if (result.datePlusDays.equals(result.localDate)) {
|
||||
//三方验收带预约
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120);
|
||||
}
|
||||
@@ -241,7 +238,6 @@ public class XxlJobHandler {
|
||||
int pageNum = 1;
|
||||
int pageSize = 50;
|
||||
while (hasNext) {
|
||||
//TODO
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
//获取为带预约状态的
|
||||
List<ShopStageInfoDO> shopIdListByStageStatus = shopStageInfoDAO.
|
||||
@@ -252,27 +248,33 @@ public class XxlJobHandler {
|
||||
}
|
||||
List<Long> shopIds = shopIdListByStageStatus.stream().filter(o -> o.getShopId() != null).map(o -> o.getShopId()).collect(Collectors.toList());
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
int flag = CommonConstants.ZERO;
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
|
||||
//进场时间
|
||||
Date approach = acceptanceInfoDO.getActualEntryTime();
|
||||
if (Objects.nonNull(approach)) {
|
||||
Instant instant = approach.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.FOUR); // 5天
|
||||
if (datePlusFiveDays.equals(localDate)) {
|
||||
//三方验收带预约
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
|
||||
EnterpriseUserDO userByRoleEnumAndRegionId = userAuthMappingService
|
||||
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("storeName", shopInfo.getShopName());
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile", lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(userByRoleEnumAndRegionId.getUserId()), MessageEnum.MESSAGE_24, messageMap);
|
||||
while (flag < CommonConstants.TWO) {
|
||||
try {
|
||||
Date approach = acceptanceInfoDO.getActualEntryTime();
|
||||
if (Objects.nonNull(approach)) {
|
||||
Result result = getResult(approach,CommonConstants.FOUR);
|
||||
if (result.datePlusDays.equals(result.localDate)) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
|
||||
EnterpriseUserDO userByRoleEnumAndRegionId = userAuthMappingService
|
||||
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("storeName", shopInfo.getShopName());
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile", lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(userByRoleEnumAndRegionId.getUserId()), MessageEnum.MESSAGE_24, messageMap);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
log.error("------定时任务三方验收待预约钉钉通知失败,shopId:{}", acceptanceInfoDO.getShopId());
|
||||
flag++;
|
||||
}
|
||||
}
|
||||
flag = CommonConstants.ZERO;
|
||||
}
|
||||
hasNext = shopIdListByStageStatus.size() >= pageSize;
|
||||
pageNum++;
|
||||
@@ -280,10 +282,29 @@ public class XxlJobHandler {
|
||||
|
||||
}
|
||||
|
||||
private static @NotNull Result getResult(Date date,Integer days) {
|
||||
Instant instant = date.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(days); // 5天
|
||||
Result result = new Result(localDate, datePlusFiveDays);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static class Result {
|
||||
public final LocalDate localDate;
|
||||
public final LocalDate datePlusDays;
|
||||
|
||||
public Result(LocalDate localDate, LocalDate datePlusDays) {
|
||||
this.localDate = localDate;
|
||||
this.datePlusDays = datePlusDays;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/7
|
||||
* @description:三方验收预约短信通知+7day
|
||||
* @description:三方验收预约短信通知,进场时间+7天的18:00,发送短信到加盟商,
|
||||
*/
|
||||
@XxlJob("threeAcceptanceMessage")
|
||||
public void threeAcceptanceMessage() {
|
||||
@@ -305,31 +326,67 @@ public class XxlJobHandler {
|
||||
Map<Long, ShopStageInfoDO> lineIdMap = ShopStageInfoList.stream().filter(o -> o.getLineId() != null)
|
||||
.collect(Collectors.toMap(ShopStageInfoDO::getLineId, Function.identity()));
|
||||
List<AcceptanceInfoDO> acceptanceList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
int flag = CommonConstants.ZERO;
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceList) {
|
||||
while (flag < CommonConstants.TWO) {
|
||||
try {
|
||||
Date approach = acceptanceInfoDO.getActualEntryTime();
|
||||
if (Objects.nonNull(approach)) {
|
||||
Result result = getResult(approach,CommonConstants.SIX);//7 day
|
||||
if (result.datePlusDays.equals(result.localDate)) {
|
||||
//三方验收带预约
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
|
||||
EnterpriseUserDO supervisor = userAuthMappingService
|
||||
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
|
||||
//获取撤场计划完成时间
|
||||
List<ConstructionScheduleDTO> construction = decorationService.getConstruction(acceptanceInfoDO.getShopId());
|
||||
Map<String, ConstructionScheduleDTO> map = construction.stream()
|
||||
.filter(o -> StringUtils.isNoneBlank(o.getName()))
|
||||
.collect(Collectors.toMap(ConstructionScheduleDTO::getName, dto -> dto));
|
||||
ConstructionScheduleDTO withdrawal = map.get(CommonConstants.WITHDRAWAL);
|
||||
//获取施工阶段计划完成时间
|
||||
ConstructionScheduleDTO constructionInfo = decorationService.getConstructionInfo(acceptanceInfoDO.getShopId());
|
||||
//获取计划验收时间
|
||||
String palnAcceptanceTime = CoolDateUtils.DateFormat(acceptanceInfoDO.getPlanAcceptanceTime(), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
//区域监理name
|
||||
String supervisorName = enterpriseUserDAO.getUserName(supervisor.getUserId());
|
||||
//区域监理手机号
|
||||
String mobile = supervisor.getMobile();
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
if (Objects.nonNull(withdrawal) && withdrawal.getPlanEndDate() != null) {
|
||||
messageMap.put("demolitionPlanTime", withdrawal.getPlanEndDate());
|
||||
} else {
|
||||
|
||||
for (AcceptanceInfoDO acceptance : acceptanceList) {
|
||||
Date approach = acceptance.getActualEntryTime();
|
||||
if (Objects.nonNull(approach)) {
|
||||
Instant instant = approach.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.SIX); // 7天
|
||||
if (datePlusFiveDays.equals(localDate)) {
|
||||
ShopStageInfoDO stageInfoDO = lineIdMap.get(acceptance.getShopId());
|
||||
if (Objects.nonNull(stageInfoDO)) {
|
||||
Long lineId = stageInfoDO.getLineId();
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.THREE_ACCEPTANCE_WAIT, null);
|
||||
if (Objects.nonNull(constructionInfo)) {
|
||||
messageMap.put("demolitionPlanTime", constructionInfo.getPlanEndDate());
|
||||
}
|
||||
}
|
||||
messageMap.put("palnAcceptanceTime", palnAcceptanceTime);
|
||||
messageMap.put("supervisionName", supervisorName);
|
||||
messageMap.put("supervisionMobile", mobile);
|
||||
//加盟商手机号
|
||||
ShopStageInfoDO stageInfoDO = lineIdMap.get(acceptanceInfoDO.getShopId());
|
||||
Long lineId = stageInfoDO.getLineId();
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.THREE_ACCEPTANCE_WAIT, messageMap);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
log.error("定时任务三方验收预约短信通知失败 shopId:{}", acceptanceInfoDO.getShopId());
|
||||
flag++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
flag = CommonConstants.ZERO;
|
||||
}
|
||||
hasNext = ShopStageInfoList.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
XxlJobHelper.handleSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/7
|
||||
@@ -337,7 +394,7 @@ public class XxlJobHandler {
|
||||
*/
|
||||
@XxlJob("waitThreeAcceptanceMessage")
|
||||
public void waitThreeAcceptanceMessage() {
|
||||
log.info("------定时任务三方待验收通知-----");
|
||||
log.info("------定时任务三方待验收钉钉通知-----");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = 50;
|
||||
@@ -347,7 +404,7 @@ public class XxlJobHandler {
|
||||
List<ShopStageInfoDO> ShopStageInfoList = shopStageInfoDAO.
|
||||
getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
|
||||
if (CollectionUtils.isEmpty(ShopStageInfoList)) {
|
||||
log.info("------定时任务结束三方验收预约短信通知------");
|
||||
log.info("------定时任务结束三方待验收钉钉通知------");
|
||||
return;
|
||||
}
|
||||
List<Long> shopIds = ShopStageInfoList.stream().filter(o -> o.getShopId() != null)
|
||||
@@ -355,21 +412,26 @@ public class XxlJobHandler {
|
||||
Map<Long, ShopStageInfoDO> lineIdMap = ShopStageInfoList.stream().filter(o -> o.getLineId() != null)
|
||||
.collect(Collectors.toMap(ShopStageInfoDO::getLineId, Function.identity()));
|
||||
List<AcceptanceInfoDO> acceptanceList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
|
||||
List<ShopInfoDO> shopListByIds = shopInfoDAO.getShopListByIds(shopIds);
|
||||
Map<Long, ShopInfoDO> shopIdMap = shopListByIds.stream().filter(o -> o.getId() != null)
|
||||
.collect(Collectors.toMap(ShopInfoDO::getId, Function.identity()));
|
||||
for (AcceptanceInfoDO acceptance : acceptanceList) {
|
||||
//进场时间
|
||||
Date approach = acceptance.getActualEntryTime();
|
||||
Long shopId = acceptance.getShopId();
|
||||
if (Objects.nonNull(approach)) {
|
||||
Instant instant = approach.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.SIX); // 7天
|
||||
if (datePlusFiveDays.equals(localDate)) {
|
||||
ShopStageInfoDO stageInfoDO = lineIdMap.get(acceptance.getShopId());
|
||||
if (Objects.nonNull(stageInfoDO)) {
|
||||
Long lineId = stageInfoDO.getLineId();
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.THREE_ACCEPTANCE_WAIT, null);
|
||||
}
|
||||
Result result = getResult(approach,CommonConstants.SIX);//7天
|
||||
if (result.datePlusDays.equals(result.localDate)) {
|
||||
ShopStageInfoDO stageInfoDO = lineIdMap.get(shopId);
|
||||
ShopInfoDO shopInfoDO = shopIdMap.get(shopId);
|
||||
Long lineId = stageInfoDO.getLineId();
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("storeName",shopInfoDO.getShopName());
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile", lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_25, messageMap);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user