Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init

This commit is contained in:
bianyadong
2024-05-11 16:13:35 +08:00
26 changed files with 555 additions and 113 deletions

View File

@@ -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&timestamp="+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&timestamp=" + 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&timestamp="+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&timestamp=" + 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&timestamp="+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&timestamp="+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&timestamp="+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&timestamp="+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&timestamp="+System.currentTimeMillis()+"&shopId="+ paramMap.get("shopId"), StandardCharsets.UTF_8.name());
default:
return "";

View File

@@ -101,6 +101,8 @@ public enum ShopSubStageEnum {
case SHOP_STAGE_13:
case SHOP_STAGE_14:
case SHOP_STAGE_15:
case SHOP_STAGE_16:
case SHOP_STAGE_17:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
default:
return null;

View File

@@ -96,10 +96,10 @@ public enum ShopSubStageStatusEnum {
SHOP_SUB_STAGE_STATUS_160(ShopSubStageEnum.SHOP_STAGE_16, 1600, "验收中", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_161(ShopSubStageEnum.SHOP_STAGE_16, 1610, "已完成", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_161(ShopSubStageEnum.SHOP_STAGE_16, 1610, "已完成", Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_170(ShopSubStageEnum.SHOP_STAGE_17, 1700, "试运营中", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_171(ShopSubStageEnum.SHOP_STAGE_17, 1710, "已完成", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_171(ShopSubStageEnum.SHOP_STAGE_17, 1710, "已完成", Boolean.TRUE),
;

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -244,4 +244,17 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.getSubStageList(shopIds,shopSubStage);
}
/**
* 获取线索未开业的数量
* @param lineId
* @return
*/
public Integer getNotOpenShopCountByLineId(Long lineId){
if(Objects.isNull(lineId)){
return CommonConstants.ZERO;
}
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_16;
return shopStageInfoMapper.getShopCountByLineIdAndStageStatus(lineId, shopSubStageEnum.getShopStageEnum().getShopStage(), shopSubStageEnum.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
}
}

View File

@@ -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);

View File

@@ -127,4 +127,11 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
@Param("investmentUserId") String investmentUserId,
@Param("queryUserType") Integer queryUserType);
List<ShopStageInfoDO> getSubStageList(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
/**
* 获取线索处在某个阶段的某个状态的店铺数量
* @param lineId
* @return
*/
Integer getShopCountByLineIdAndStageStatus(@Param("lineId")Long lineId, @Param("shopStage") Integer shopStage, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus);
}

View File

@@ -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 &lt;= 108
where shop_id = #{shopId} and template_id >=#{templateIdMin} and template_id &lt;= #{templateIdMax}
</select>
</mapper>

View File

@@ -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">
@@ -261,4 +261,8 @@
from xfsg_shop_stage_info
where shop_sub_stage_status = #{shopSubStageStatus}
</select>
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage} and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
</select>
</mapper>

View File

@@ -3,6 +3,7 @@ package com.cool.store.dto.decoration;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -10,7 +11,7 @@ import java.util.List;
* @Date 2024/4/28 15:17
* @Version 1.0
*/
@Data
public class BudgetDTO {
@ApiModelProperty("预算主键")
private Long id;
@@ -19,15 +20,87 @@ public class BudgetDTO {
@ApiModelProperty("计价类型")
private String type;
@ApiModelProperty("合计")
private String vzHj;
private BigDecimal vzHj;
@ApiModelProperty("取费合计")
private String totalAmount;
private BigDecimal totalAmount;
@ApiModelProperty("成本合计")
private String totalCost;
private BigDecimal totalCost;
@ApiModelProperty("创建时间")
private String createDate;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("预算详情")
private List<BudgetDetailDTO> details;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public BigDecimal getVzHj() {
return vzHj;
}
public void setVzHj(BigDecimal vzHj) {
this.vzHj = vzHj.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getTotalCost() {
return totalCost;
}
public void setTotalCost(BigDecimal totalCost) {
this.totalCost = totalCost.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public List<BudgetDetailDTO> getDetails() {
return details;
}
public void setDetails(List<BudgetDetailDTO> details) {
this.details = details;
}
}

View File

@@ -25,19 +25,19 @@ public class BudgetDetailDTO {
@ApiModelProperty("预算工程量")
private String amount;
@ApiModelProperty("单价")
private String unitPrice;
private BigDecimal unitPrice;
@ApiModelProperty("预算合计")
private String totalPrice;
private BigDecimal totalPrice;
@ApiModelProperty("人工单价")
private String labour;
private BigDecimal labour;
@ApiModelProperty("材料单价")
private String material;
private BigDecimal material;
@ApiModelProperty("主材成本")
private String mainMaterialCostPrice;
private BigDecimal mainMaterialCostPrice;
@ApiModelProperty("辅材成本")
private String auxiliaryMaterialCostPrice;
private BigDecimal auxiliaryMaterialCostPrice;
@ApiModelProperty("人工成本")
private String labourCostPrice;
private BigDecimal labourCostPrice;
@ApiModelProperty("结算工程量")
private String remark;
@ApiModelProperty("结算合计")
@@ -49,9 +49,177 @@ public class BudgetDetailDTO {
@ApiModelProperty("损耗单价")
private BigDecimal lossPrice;
@ApiModelProperty("计划利润")
private String planProfit;
private BigDecimal planProfit;
@ApiModelProperty("利润率")
private BigDecimal profitRate;
@ApiModelProperty("唯一供应商")
private String supplierName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNodeType() {
return nodeType;
}
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getLabour() {
return labour;
}
public void setLabour(BigDecimal labour) {
this.labour = labour.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getMaterial() {
return material;
}
public void setMaterial(BigDecimal material) {
this.material = material.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getMainMaterialCostPrice() {
return mainMaterialCostPrice;
}
public void setMainMaterialCostPrice(BigDecimal mainMaterialCostPrice) {
this.mainMaterialCostPrice = mainMaterialCostPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getAuxiliaryMaterialCostPrice() {
return auxiliaryMaterialCostPrice;
}
public void setAuxiliaryMaterialCostPrice(BigDecimal auxiliaryMaterialCostPrice) {
this.auxiliaryMaterialCostPrice = auxiliaryMaterialCostPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getLabourCostPrice() {
return labourCostPrice;
}
public void setLabourCostPrice(BigDecimal labourCostPrice) {
this.labourCostPrice = labourCostPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public BigDecimal getLoss() {
return loss;
}
public void setLoss(BigDecimal loss) {
this.loss = loss.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getTotalCost() {
return totalCost;
}
public void setTotalCost(BigDecimal totalCost) {
this.totalCost = totalCost.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getCost() {
return cost;
}
public void setCost(BigDecimal cost) {
this.cost = cost.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getLossPrice() {
return lossPrice;
}
public void setLossPrice(BigDecimal lossPrice) {
this.lossPrice = lossPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getPlanProfit() {
return planProfit;
}
public void setPlanProfit(BigDecimal planProfit) {
this.planProfit = planProfit.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public BigDecimal getProfitRate() {
return profitRate;
}
public void setProfitRate(BigDecimal profitRate) {
this.profitRate = profitRate.setScale(2, BigDecimal.ROUND_HALF_UP);
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: IsSubmitOpenNewShopVO
* @Description:
* @date 2024-05-11 11:22
*/
@Data
public class IsSubmitOpenNewShopVO {
@ApiModelProperty("是否可以开新店 true:可以开店 false:不能开新店")
private Boolean isSubmitOpenNewShop;
public IsSubmitOpenNewShopVO(Boolean isSubmitOpenNewShop) {
this.isSubmitOpenNewShop = isSubmitOpenNewShop;
}
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.service;
import com.cool.store.request.AuditOpenNewShopRequest;
import com.cool.store.request.PartnerOpenNewShopPageRequest;
import com.cool.store.request.SubmitOpenNewShopRequest;
import com.cool.store.vo.IsSubmitOpenNewShopVO;
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
import com.cool.store.vo.PartnerOpenNewShopPageVO;
import com.github.pagehelper.PageInfo;
@@ -23,6 +24,11 @@ public interface OpenNewShopService {
PageInfo<PartnerOpenNewShopPageVO> getPartnerOpenNewShopPage(PartnerOpenNewShopPageRequest request);
/**
* 获取详情
* @param recordId
* @return
*/
PartnerOpenNewShopDetailVO getOpenNewShopRecordDetail(Long recordId);
/**
@@ -44,5 +50,5 @@ public interface OpenNewShopService {
* @param lineId
* @return
*/
PartnerOpenNewShopDetailVO getWaitAuditOpenNewShopRecord(Long lineId);
IsSubmitOpenNewShopVO isSubmitOpenNewShop(Long lineId);
}

View File

@@ -32,4 +32,5 @@ public interface OpeningOperationPlanService {
*/
PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request);
Boolean flush(Long shopId);
Boolean getStatus(Long shopId);
}

View File

@@ -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("酷店掌");

View File

@@ -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);
@@ -174,14 +176,13 @@ public class DecorationServiceImpl implements DecorationService {
//预算
BudgetDTO proposedBookBudget = getBudgetDTOS(decoration);
if (proposedBookBudget == null) return null;
String vzHj = proposedBookBudget.getVzHj();
BigDecimal vzHj = proposedBookBudget.getVzHj();
//支付二维码url
Long regionId = shopInfoDAO.getRegionIdByid(shopId);
String payPic = regionQrcodeConfigDao.getPayPicByRegionId(regionId);
DecorationModelDTO decorationModelDTO = new DecorationModelDTO();
decorationModelDTO.setPayUrl(payPic);
BigDecimal totalAmount = new BigDecimal(vzHj);
decorationModelDTO.setTotalAmount(totalAmount.setScale(2, RoundingMode.HALF_UP));
decorationModelDTO.setTotalAmount(vzHj);
return decorationModelDTO;
}
@@ -358,8 +359,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 +385,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;

View File

@@ -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;
}

View File

@@ -1,10 +1,7 @@
package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dao.HyPartnerUserChannelDAO;
import com.cool.store.dao.OpenNewShopRecordDAO;
import com.cool.store.dao.*;
import com.cool.store.dto.partner.PartnerOpenNewShopPageDTO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.OpenNewShopRecordDO;
@@ -19,6 +16,7 @@ import com.cool.store.request.SubmitOpenNewShopRequest;
import com.cool.store.service.LabelService;
import com.cool.store.service.OpenNewShopService;
import com.cool.store.service.ShopService;
import com.cool.store.vo.IsSubmitOpenNewShopVO;
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
import com.cool.store.vo.PartnerOpenNewShopPageVO;
import com.github.pagehelper.Page;
@@ -59,6 +57,8 @@ public class OpenNewShopServiceImpl implements OpenNewShopService {
private LabelService labelService;
@Resource
private ShopService shopService;
@Resource
private ShopStageInfoDAO shopStageInfoDAO;
@Override
@@ -136,8 +136,14 @@ public class OpenNewShopServiceImpl implements OpenNewShopService {
}
@Override
public PartnerOpenNewShopDetailVO getWaitAuditOpenNewShopRecord(Long lineId) {
public IsSubmitOpenNewShopVO isSubmitOpenNewShop(Long lineId) {
//首先获取有没有待审核的记录
OpenNewShopRecordDO openNewShopRecord = openNewShopRecordDAO.getWaitAuditOpenNewShopRecord(lineId);
return PartnerOpenNewShopDetailVO.convert(openNewShopRecord);
if(Objects.nonNull(openNewShopRecord)){
return new IsSubmitOpenNewShopVO(Boolean.FALSE);
}
//没有待审核的记录 去获取店铺是否都已经在验收中
Integer notOpenShopCount = shopStageInfoDAO.getNotOpenShopCountByLineId(lineId);
return new IsSubmitOpenNewShopVO(notOpenShopCount <= CommonConstants.ZERO);
}
}
}

View File

@@ -197,7 +197,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
public Boolean flush(Long shopId) {
ShopStageInfoDO orderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
try {
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus().
equals(orderStageInfo.getShopSubStageStatus())) {
ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
String shopCode = shopInfo.getShopCode();
@@ -218,5 +218,19 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
}
@Override
public Boolean getStatus(Long shopId) {
try{
ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
String shopCode = shopInfo.getShopCode();
Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
return firstOrder;
}catch (Exception e){
log.error("获取鲜丰订货金异常或更新状态失败");
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
}
}
}

View File

@@ -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;
}
}

View File

@@ -39,7 +39,7 @@ public class PCOpenNewShopController {
}
@ApiOperation("获取详情")
@PostMapping("/getOpenNewShopRecordDetail")
@GetMapping("/getOpenNewShopRecordDetail")
public ResponseResult<PartnerOpenNewShopDetailVO> getOpenNewShopRecordDetail(@RequestParam("recordId") Long recordId) {
return ResponseResult.success(openNewShopService.getOpenNewShopRecordDetail(recordId));
}

View File

@@ -18,6 +18,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.service.*;
import com.cool.store.vo.OpeningOperationPlanListVO;
import com.cool.store.vo.OpeningOperationPlanVO;
import com.cool.store.vo.shop.ShopStageInfoVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -52,7 +53,11 @@ public class PCOpenPreparationController {
public ResponseResult<Boolean> flush(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(openingOperationPlanService.flush(shopId));
}
@ApiOperation("获取鲜丰订货金状态")
@GetMapping("/getStatus")
public ResponseResult<Boolean> getStatus(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(openingOperationPlanService.getStatus(shopId));
}
@PostMapping("/openingOperationPlan/submit")
@ApiOperation("提交开业运营方案")
public ResponseResult submitPlan(@RequestBody OpeningOperationPlanRequest request) {

View File

@@ -5,6 +5,7 @@ import com.cool.store.dao.*;
import com.cool.store.entity.*;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopService;
import com.cool.store.service.impl.CommonService;
@@ -29,7 +30,10 @@ public class PCTestController {
private ShopService shopService;
@Resource
private LineInterviewDAO lineInterviewDAO;
static String url = "https://hzly.cloudcubic.net/ajaxHandle/synchronization/JCallBackSynchronizationHandler.ashx?action=app&controller=GetProjectDetails&projectid=";
@Resource
private HttpRestTemplateService httpRestTemplateService;
@GetMapping("/sendMessage")
public ResponseResult<Boolean> sendMessage(@RequestParam("lineId")Long lineId, @RequestParam("pointId")Long pointId, @RequestParam MessageEnum messageEnum){
@@ -71,4 +75,5 @@ public class PCTestController {
shopService.initShop(lineInfo);
return ResponseResult.success(Boolean.FALSE);
}
}

View File

@@ -1,19 +1,13 @@
package com.cool.store.controller.webc;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.request.AuditOpenNewShopRequest;
import com.cool.store.request.PartnerOpenNewShopPageRequest;
import com.cool.store.request.SubmitOpenNewShopRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.OpenNewShopService;
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
import com.cool.store.vo.PartnerOpenNewShopPageVO;
import com.github.pagehelper.PageInfo;
import com.cool.store.vo.IsSubmitOpenNewShopVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -40,10 +34,10 @@ public class MiniOpenNewShopController {
return ResponseResult.success(openNewShopService.submitOpenNewShop(request));
}
@ApiOperation("获取待审核的状态")
@GetMapping("/getWaitAuditOpenNewShopRecord")
public ResponseResult<PartnerOpenNewShopDetailVO> getWaitAuditOpenNewShopRecord() {
return ResponseResult.success(openNewShopService.getWaitAuditOpenNewShopRecord(PartnerUserHolder.getUser().getLineId()));
@ApiOperation("获取是否可提交开新店申请")
@GetMapping("/isSubmitOpenNewShop")
public ResponseResult<IsSubmitOpenNewShopVO> isSubmitOpenNewShop() {
return ResponseResult.success(openNewShopService.isSubmitOpenNewShop(PartnerUserHolder.getUser().getLineId()));
}
}

View File

@@ -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;
@@ -205,12 +206,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);
}
@@ -243,7 +240,6 @@ public class XxlJobHandler {
int pageNum = 1;
int pageSize = 50;
while (hasNext) {
//TODO
PageHelper.startPage(pageNum, pageSize);
//获取为带预约状态的
List<ShopStageInfoDO> shopIdListByStageStatus = shopStageInfoDAO.
@@ -254,27 +250,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++;
@@ -282,10 +284,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天的1800发送短信到加盟商
*/
@XxlJob("threeAcceptanceMessage")
public void threeAcceptanceMessage() {
@@ -307,31 +328,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
@@ -339,7 +396,7 @@ public class XxlJobHandler {
*/
@XxlJob("waitThreeAcceptanceMessage")
public void waitThreeAcceptanceMessage() {
log.info("------定时任务三方待验收通知-----");
log.info("------定时任务三方待验收钉钉通知-----");
boolean hasNext = true;
int pageNum = 1;
int pageSize = 50;
@@ -349,7 +406,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)
@@ -357,21 +414,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);
}
}
}