装修阶段

This commit is contained in:
苏竹红
2024-06-25 15:09:16 +08:00
parent 50ae1f4ce4
commit 06666ea419
18 changed files with 313 additions and 331 deletions

View File

@@ -123,4 +123,16 @@ public class PCDecorationController {
return ResponseResult.success(seeAcceptanceService.auditSeeAcceptance(request,user));
}
@ApiOperation("提交设计方案")
@PostMapping("/submitDecorationDesign")
public ResponseResult<Boolean> submitBookingAcceptance(@RequestBody DecorationDesignRequest request){
return ResponseResult.success(decorationService.submitDecorationDesign(request,CurrentUserHolder.getUser()));
}
@ApiOperation("装修阶段完成")
@PostMapping("/confirmComplete")
public ResponseResult<Boolean> confirmComplete(@RequestParam Long shopId){
return ResponseResult.success(decorationService.confirmComplete(shopId,CurrentUserHolder.getUser()));
}
}

View File

@@ -1,10 +1,12 @@
package com.cool.store.controller.webc;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationModelDTO;
import com.cool.store.dto.decoration.ThreeAcceptanceDTO;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.request.DecorationDesignRequest;
import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.request.ThreeAcceptanceCheckRequest;
import com.cool.store.request.ThreeAcceptanceRequest;
@@ -15,6 +17,7 @@ import com.cool.store.service.AssessmentTemplateService;
import com.cool.store.service.DecorationService;
import com.cool.store.service.SeeAcceptanceService;
import com.cool.store.vo.AssessmentTemplateVO;
import com.cool.store.vo.DecorationDesignVO;
import com.cool.store.vo.Fitment.DecorationStageVO;
import com.cool.store.vo.Fitment.DesignInfoVo;
@@ -112,4 +115,18 @@ public class MiniDecorationController {
public ResponseResult< List<ShopAuditInfoDO> > getAuditInfo(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getAuditInfo(shopId));
}
@ApiOperation("查询设计方案")
@GetMapping("/getDecorationDesign")
public ResponseResult<DecorationDesignVO> getDecorationDesign(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getDecorationDesign(shopId));
}
@ApiOperation("加盟商确定设计方案")
@GetMapping("/confirmDesign")
public ResponseResult<Boolean> confirmDesign(@RequestParam DecorationDesignRequest shopId){
return ResponseResult.success(decorationService.confirmDesign(shopId,CurrentUserHolder.getUser()));
}
}

View File

@@ -187,24 +187,9 @@ public class TestController {
xxlJobHandler.updateEntryTime();
return ResponseResult.success();
}
@GetMapping("/fitmentAcceptanceHandler")
public ResponseResult fitmentAcceptanceHandler(){
xxlJobHandler.fitmentAcceptanceHandler();
return ResponseResult.success();
}
@GetMapping("/threeAcceptanceBookingMessage")
public ResponseResult threeAcceptanceBookingMessage(){
xxlJobHandler.threeAcceptanceBookingMessage();
return ResponseResult.success();
}
@GetMapping("/threeAcceptanceMessage")
public ResponseResult threeAcceptanceMessage(){
xxlJobHandler.threeAcceptanceMessage();
return ResponseResult.success();
}
@GetMapping("/waitThreeAcceptanceMessage")
public ResponseResult waitThreeAcceptanceMessage(){
xxlJobHandler.waitThreeAcceptanceMessage();
return ResponseResult.success();
}
}

View File

@@ -135,44 +135,6 @@ public class XxlJobHandler {
XxlJobHelper.handleSuccess();
}
/**
* @Auther: wangshuo
* @Date: 2024/4/29
* @description: 每天更新装修阶段进场时间等,至预约状态
*/
@XxlJob("fitmentAcceptanceHandler")
public void fitmentAcceptanceHandler() {
log.info("----定时任务每天更新至预约状态----");
boolean hasNext = true;
int pageNum = 1;
int pageSize = 50;
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
//获取表中的三方验收状态为-100状态和进场时间不为空的
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
log.info("------定时任务结束每天更新至预约状态结束------");
return;
}
List<Long> shopIds = new ArrayList<>();
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
Long shopId = acceptanceInfoDO.getShopId();
Date actualEntryTime = acceptanceInfoDO.getActualEntryTime();
LocalDate plusFDays = DateUtils.getPlusFDays(actualEntryTime, CommonConstants.FOUR);
//小于等于当前时间
if (plusFDays.isEqual(LocalDate.now()) || plusFDays.isBefore(LocalDate.now())) {
//三方验收待预约
shopIds.add(shopId);
}
}
shopStageInfoDAO.batchUpdateShopStageStatus(shopIds, ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
hasNext = acceptanceInfoDOS.size() >= pageSize;
pageNum++;
}
log.info("------定时任务结束调用鲜丰获取进场时间结束------");
XxlJobHelper.handleSuccess();
}
/**
* @Auther: wangshuo
@@ -226,172 +188,6 @@ public class XxlJobHandler {
}
}
/**
* @Auther: wangshuo
* @Date: 2024/5/7
* @description:三方验收预约短信通知,进场时间+7天的1800发送短信到加盟商
*/
@XxlJob("threeAcceptanceMessage")
public void threeAcceptanceMessage() {
log.info("------定时任务三方验收待验收的短信通知-----");
boolean hasNext = true;
int pageNum = 1;
int pageSize = 50;
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
//获取待验收的
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO
.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
log.info("------定时任务结束三方验收待验收的短信通知------");
return;
}
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
int flag = CommonConstants.ZERO;
while (flag < CommonConstants.TWO) {
try {
Date approach = acceptanceInfoDO.getActualEntryTime();
if (Objects.nonNull(approach)) {
LocalDate plusFDays = DateUtils.getPlusFDays(approach, CommonConstants.SIX);//7 day
if (plusFDays.equals(LocalDate.now())) {
//三方验收带预约
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
//加盟商手机号
Long lineId = shopInfo.getLineId();
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
if (Objects.isNull(lineInfo) && StringUtils.isNull(lineInfo.getMobile())) {
log.error("定时任务三方验收待验收的短信通知:加盟商手机号为空,shopId:#{}", acceptanceInfoDO.getShopId());
break;
}
EnterpriseUserDO supervisor = userAuthMappingService
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
if (Objects.isNull(supervisor)) {
log.error("该区域没有工程部监理,RegionId{}", shopInfo.getRegionId());
break;
}
//获取计划撤场时间
Date planExitTime = acceptanceInfoDO.getPlanExitTime();
//获取施工阶段计划完成时间
Date decorationEndTime = acceptanceInfoDO.getDecorationPlannedCompletionTime();
//获取计划验收时间
String planAcceptanceTime = CoolDateUtils.DateFormat(acceptanceInfoDO.getPlanAcceptanceTime(), CoolDateUtils.DATE_FORMAT_SEC);
if (StringUtils.isBlank(planAcceptanceTime)) {
planAcceptanceTime = "";
}
//区域监理手机号
Boolean f = Boolean.TRUE;
String mobile = supervisor.getMobile();
String supervisionName = supervisor.getName();
Map<String, String> messageMap = new HashMap<>();
if (Objects.nonNull(planExitTime)) {
String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, planExitTime);
messageMap.put("demolitionPlanTime", date);
} else {
if (Objects.nonNull(decorationEndTime)) {
String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, decorationEndTime);
messageMap.put("demolitionPlanTime", date);
}
}
messageMap.put("palnAcceptanceTime", planAcceptanceTime);
messageMap.put("supervisionName", supervisionName);
messageMap.put("supervisionMobile", mobile);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.THREE_ACCEPTANCE_WAIT, messageMap);
}
}
break;
} catch (Exception e) {
log.error("定时任务三方验收待验收的短信通知失败 shopId:{},e:{}", acceptanceInfoDO.getShopId(), e.getMessage());
flag++;
}
}
}
hasNext = acceptanceInfoDOS.size() >= pageSize;
pageNum++;
}
XxlJobHelper.handleSuccess();
}
/**
* @Auther: wangshuo
* @Date: 2024/5/7
* @description:实际进场时间+7天发送钉钉通知到督导
*/
@XxlJob("waitThreeAcceptanceMessage")
public void waitThreeAcceptanceMessage() {
log.info("------定时任务三方待验收钉钉通知-----");
boolean hasNext = true;
int pageNum = 1;
int pageSize = 50;
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
//获取待验收的
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO
.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
log.info("------定时任务结束三方待验收钉钉通知------");
return;
}
List<Long> shopIds = acceptanceInfoDOS.stream().filter(o -> o.getShopId() != null)
.map(AcceptanceInfoDO::getShopId).collect(Collectors.toList());
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 : acceptanceInfoDOS) {
//进场时间
Date approach = acceptance.getActualEntryTime();
Long shopId = acceptance.getShopId();
if (Objects.nonNull(approach)) {
LocalDate plusFDays = DateUtils.getPlusFDays(approach, CommonConstants.SIX);//7天
if (plusFDays.equals(LocalDate.now())) {
ShopInfoDO shopInfoDO = shopIdMap.get(shopId);
if (StringUtils.isBlank(shopInfoDO.getSupervisorUserId())) {
log.error("定时任务三方待验收钉钉通知,督导id为空,shopId:{}", shopId);
}
Long lineId = shopInfoDO.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);
}
}
}
hasNext = acceptanceInfoDOS.size() >= pageSize;
pageNum++;
}
XxlJobHelper.handleSuccess();
}
@XxlJob("interviewRemind")
public void interviewRemind() {
log.info("------面试提醒------");
String startTime = LocalDateTime.now().plusHours(1).minusMinutes(CommonConstants.FIVE).format(DateTimeFormatter.ofPattern(CoolDateUtils.DATE_FORMAT_SEC));
String endTime = LocalDateTime.now().plusHours(1).plusMinutes(CommonConstants.FIVE).format(DateTimeFormatter.ofPattern(CoolDateUtils.DATE_FORMAT_SEC));
List<LineInterviewDO> interviewList = lineInterviewDAO.getInterviewRemindList(startTime, endTime);
if (CollectionUtils.isEmpty(interviewList)) {
log.info("------今日没有待更新数据------");
return;
}
List<Long> lineIds = interviewList.stream().map(LineInterviewDO::getLineId).collect(Collectors.toList());
Map<Long, String> lineMobileMap = lineInfoDAO.getLineMobileMap(lineIds);
for (LineInterviewDO interview : interviewList) {
Map<String, String> templateParamMap = new HashMap<>();
templateParamMap.put("interviewTime", DateUtil.format(interview.getStartTime(), "HH:mm"));
if (InterviewTypeEnum.INTERVIEW.getCode().equals(interview.getInterviewType())) {
commonService.sendSms(lineMobileMap.get(interview.getLineId()), SMSMsgEnum.FIRST_INTERVIEW_REMIND, templateParamMap);
}
if (InterviewTypeEnum.SECOND_INTERVIEW.getCode().equals(interview.getInterviewType())) {
commonService.sendSms(lineMobileMap.get(interview.getLineId()), SMSMsgEnum.SECOND_INTERVIEW_REMIND, templateParamMap);
}
}
XxlJobHelper.handleSuccess();
}
/**
* 店铺新店开业状态更新
*/