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

This commit is contained in:
bianyadong
2024-05-13 16:55:18 +08:00
4 changed files with 39 additions and 28 deletions

View File

@@ -39,6 +39,9 @@ public class AcceptanceInfoDAO {
}
return acceptanceInfoMapper.updateByShopIDSelective(acceptanceInfoDO);
}
public List<AcceptanceInfoDO> selectListNotNullEntryTime(){
return acceptanceInfoMapper.selectListNotNullEntryTime();
}
public AcceptanceInfoDO selectByShopId (Long shopId){
if (Objects.isNull(shopId)){
return null;

View File

@@ -13,7 +13,12 @@ public interface AcceptanceInfoMapper extends Mapper<AcceptanceInfoDO> {
* @description:三方验收g根据阶段状态 并且验收时间不为空
*/
List<AcceptanceInfoDO> selectShopIdListBySignatures(@Param("subStage") Integer subStage,@Param("status") Integer status);
/**
* @Auther: wangshuo
* @Date: 2024/5/13
* @description:获取进场时间不为空的
*/
List<AcceptanceInfoDO> selectListNotNullEntryTime();
/**
* @Auther: wangshuo
* @Date: 2024/4/29

View File

@@ -86,7 +86,8 @@
</update>
<select id="selectShopIdListBySignatures" resultType="com.cool.store.entity.AcceptanceInfoDO">
select
a.shop_id as shopId ,a.actual_entry_time as actualEntry_time
a.shop_id as shopId ,a.actual_entry_time as actualEntry_time,a.plan_exit_time as planExitTime, a.decoration_planned_completion_time as decorationPlannedCompletionTime,
a.plan_acceptance_time as planAcceptanceTime
from xfsg_acceptance_info a
left join xfsg_shop_stage_info b on a.shop_id = b.shop_id
where b.shop_sub_stage=#{subStage} and b.shop_sub_stage_status = #{status}
@@ -116,5 +117,10 @@
</foreach>
</if>
</select>
<select id="selectListNotNullEntryTime" resultType="com.cool.store.entity.AcceptanceInfoDO">
select *
from xfsg_acceptance_info
where actual_entry_time is not null
</select>
</mapper>

View File

@@ -242,7 +242,7 @@ public class XxlJobHandler {
}
}
shopStageInfoDAO.batchUpdateShopStageStatus(shopIds, ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
shopStageInfoDAO.batchUpdateShopStageStatus(shopIds, ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
hasNext = acceptanceInfoDOS.size() >= pageSize;
pageNum++;
}
@@ -263,10 +263,9 @@ public class XxlJobHandler {
int pageSize = 50;
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
//获取为带预约状态的和进场时间不为空的
//进场时间不为空的
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO
.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
.selectListNotNullEntryTime();
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
log.info("------定时任务结束三方验收待预约钉钉通知------");
return;
@@ -277,24 +276,22 @@ public class XxlJobHandler {
while (flag < CommonConstants.TWO) {
try {
Date approach = acceptanceInfoDO.getActualEntryTime();
if (Objects.nonNull(approach)) {
LocalDate plusFDays = DateUtils.getPlusFDays(approach, CommonConstants.FOUR);
if (plusFDays.equals(LocalDate.now())) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
EnterpriseUserDO userByRoleEnumAndRegionId = userAuthMappingService
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
if (StringUtils.isBlank(userByRoleEnumAndRegionId.getUserId())) {
log.error("定时任务三方验收待预约钉钉通知,工程监理id为空,shopId:#{}", acceptanceInfoDO.getShopId());
break;
}
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);
LocalDate plusFDays = DateUtils.getPlusFDays(approach, CommonConstants.FOUR);
if (plusFDays.equals(LocalDate.now())) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(acceptanceInfoDO.getShopId());
EnterpriseUserDO userByRoleEnumAndRegionId = userAuthMappingService
.getUserByRoleEnumAndRegionId(UserRoleEnum.ENGINEER_DEP_SUPERVISOR, shopInfo.getRegionId());
if (StringUtils.isBlank(userByRoleEnumAndRegionId.getUserId())) {
log.error("定时任务三方验收待预约钉钉通知,工程监理id为空,shopId:#{}", acceptanceInfoDO.getShopId());
break;
}
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) {
@@ -309,7 +306,6 @@ public class XxlJobHandler {
}
/**
* @Auther: wangshuo
* @Date: 2024/5/7
@@ -330,7 +326,6 @@ public class XxlJobHandler {
log.info("------定时任务结束三方验收预约短信通知------");
return;
}
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
int flag = CommonConstants.ZERO;
while (flag < CommonConstants.TWO) {
@@ -356,6 +351,9 @@ public class XxlJobHandler {
Date decorationEndTime = acceptanceInfoDO.getDecorationPlannedCompletionTime();
//获取计划验收时间
String planAcceptanceTime = CoolDateUtils.DateFormat(acceptanceInfoDO.getPlanAcceptanceTime(), CoolDateUtils.DATE_FORMAT_SEC);
if (StringUtils.isBlank(planAcceptanceTime)) {
planAcceptanceTime = "";
}
//区域监理手机号
String mobile = supervisor.getMobile();
Map<String, String> messageMap = new HashMap<>();
@@ -366,6 +364,8 @@ public class XxlJobHandler {
if (Objects.nonNull(decorationEndTime)) {
String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, decorationEndTime);
messageMap.put("demolitionPlanTime", date);
} else {
messageMap.put("demolitionPlanTime", "");
}
}
messageMap.put("palnAcceptanceTime", planAcceptanceTime);
@@ -379,8 +379,6 @@ public class XxlJobHandler {
log.error("定时任务三方验收预约短信通知失败 shopId:{}", acceptanceInfoDO.getShopId());
flag++;
}
}
}
@@ -405,8 +403,7 @@ public class XxlJobHandler {
PageHelper.startPage(pageNum, pageSize);
//获取待验收的
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO
.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
.selectListNotNullEntryTime();
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
log.info("------定时任务结束三方待验收钉钉通知------");
return;