修改定时任务
This commit is contained in:
@@ -226,7 +226,17 @@ public class ShopStageInfoDAO {
|
||||
public List<Long> getShopContractIncompletion(){
|
||||
return shopStageInfoMapper.getShopContractIncompletion();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/13
|
||||
* @description:批量更新店铺某一阶段的状态
|
||||
*/
|
||||
public Integer batchUpdateShopStageStatus(List<Long> shopIdList,Integer shopSubStageEnum, Integer shopSubStageStatusEnum) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return shopStageInfoMapper.batchUpdateStatus(shopIdList,shopSubStageEnum,shopSubStageStatusEnum);
|
||||
}
|
||||
|
||||
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
|
||||
List<Integer> shopSubStageStatusList,String investmentUserId,Integer queryUserType){
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.github.pagehelper.Page;
|
||||
@@ -121,6 +122,7 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
*/
|
||||
List<Long> getShopContractIncompletion();
|
||||
|
||||
Integer batchUpdateStatus(@Param("shopIdList") List<Long> shopIdList,@Param("shopSubStageEnum") Integer shopSubStageEnum,@Param("shopSubStageStatusEnum") Integer shopSubStageStatusEnum) ;
|
||||
|
||||
List<ShopStageInfoDO> getSpecialShopStageInfo(@Param("shopIds") List<Long> shopIds,
|
||||
@Param("shopSubStage") Integer shopSubStage,
|
||||
|
||||
@@ -142,6 +142,21 @@
|
||||
where shop_id = #{shopStageInfoDO.shopId} AND shop_sub_stage = #{shopStageInfoDO.shopSubStage}
|
||||
|
||||
</update>
|
||||
<update id="batchUpdateStatus">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
<if test="shopSubStageEnum ! = null">
|
||||
shop_sub_stage = #{shopSubStageEnum}
|
||||
</if>
|
||||
<if test="shopSubStageStatusEnum !=null">
|
||||
shop_sub_stage_status = #{shopSubStageStatusEnum}
|
||||
</if>
|
||||
</set>
|
||||
where shop_id in
|
||||
<foreach collection="shopIdList" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
|
||||
select
|
||||
|
||||
@@ -230,6 +230,7 @@ public class XxlJobHandler {
|
||||
log.info("------定时任务结束每天更新至预约状态结束------");
|
||||
return;
|
||||
}
|
||||
List<Long> shopIds = new ArrayList<>();
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
|
||||
Long shopId = acceptanceInfoDO.getShopId();
|
||||
Date actualEntryTime = acceptanceInfoDO.getActualEntryTime();
|
||||
@@ -237,9 +238,11 @@ public class XxlJobHandler {
|
||||
//小于等于当前时间
|
||||
if (plusFDays.isEqual(LocalDate.now()) || plusFDays.isBefore(LocalDate.now())) {
|
||||
//三方验收待预约
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120);
|
||||
shopIds.add(shopId);
|
||||
|
||||
}
|
||||
}
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopIds, ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
|
||||
hasNext = acceptanceInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
@@ -260,16 +263,14 @@ public class XxlJobHandler {
|
||||
int pageSize = 50;
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
//获取为带预约状态的
|
||||
List<ShopStageInfoDO> shopIdListByStageStatus = shopStageInfoDAO.
|
||||
getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
|
||||
if (CollectionUtils.isEmpty(shopIdListByStageStatus)) {
|
||||
//获取为带预约状态的和进场时间不为空的
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO
|
||||
.selectAcceptanceInfoBySignatures(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
|
||||
|
||||
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
|
||||
log.info("------定时任务结束三方验收待预约钉钉通知------");
|
||||
return;
|
||||
}
|
||||
List<Long> shopIds = shopIdListByStageStatus.stream().filter(o -> o.getShopId() != null).map(o -> o.getShopId()).collect(Collectors.toList());
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
|
||||
int flag = CommonConstants.ZERO;
|
||||
//进场时间
|
||||
@@ -302,7 +303,7 @@ public class XxlJobHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
hasNext = shopIdListByStageStatus.size() >= pageSize;
|
||||
hasNext = acceptanceInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
|
||||
@@ -323,17 +324,14 @@ public class XxlJobHandler {
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
//获取待验收的
|
||||
List<ShopStageInfoDO> ShopStageInfoList = shopStageInfoDAO.
|
||||
getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
|
||||
if (CollectionUtils.isEmpty(ShopStageInfoList)) {
|
||||
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 = ShopStageInfoList.stream().filter(o -> o.getShopId() != null)
|
||||
.map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
List<AcceptanceInfoDO> acceptanceList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceList) {
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
|
||||
int flag = CommonConstants.ZERO;
|
||||
while (flag < CommonConstants.TWO) {
|
||||
try {
|
||||
@@ -386,7 +384,7 @@ public class XxlJobHandler {
|
||||
}
|
||||
|
||||
}
|
||||
hasNext = ShopStageInfoList.size() >= pageSize;
|
||||
hasNext = acceptanceInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
XxlJobHelper.handleSuccess();
|
||||
@@ -406,19 +404,19 @@ public class XxlJobHandler {
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
//获取待验收的
|
||||
List<ShopStageInfoDO> ShopStageInfoList = shopStageInfoDAO.
|
||||
getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121.getShopSubStageStatus());
|
||||
if (CollectionUtils.isEmpty(ShopStageInfoList)) {
|
||||
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 = ShopStageInfoList.stream().filter(o -> o.getShopId() != null)
|
||||
.map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
List<AcceptanceInfoDO> acceptanceList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
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 : acceptanceList) {
|
||||
for (AcceptanceInfoDO acceptance : acceptanceInfoDOS) {
|
||||
//进场时间
|
||||
Date approach = acceptance.getActualEntryTime();
|
||||
Long shopId = acceptance.getShopId();
|
||||
@@ -440,7 +438,7 @@ public class XxlJobHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
hasNext = ShopStageInfoList.size() >= pageSize;
|
||||
hasNext = acceptanceInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
XxlJobHelper.handleSuccess();
|
||||
|
||||
Reference in New Issue
Block a user