加盟商编码
This commit is contained in:
@@ -179,7 +179,7 @@ public class TestController {
|
||||
}
|
||||
@GetMapping("/updateFirstOrder")
|
||||
public ResponseResult updateFirstOrder(){
|
||||
xxlJobHandler.updateFirstOrder();
|
||||
// xxlJobHandler.updateFirstOrder();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
@GetMapping("updateEntryTime")
|
||||
|
||||
@@ -95,51 +95,6 @@ public class XxlJobHandler {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/25
|
||||
* @description:每天查询更新订货金
|
||||
*/
|
||||
@XxlJob("updateFirstOrder")
|
||||
public void updateFirstOrder() {
|
||||
log.info("----定时任务查询更新订货金----");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = 50;
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopStageInfoDO> shopIdListByStageStatus = shopStageInfoDAO.getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus());
|
||||
if (CollectionUtils.isEmpty(shopIdListByStageStatus)) {
|
||||
log.info("------定时任务结束调用鲜丰更新订货金结束------");
|
||||
return;
|
||||
}
|
||||
List<Long> shopIds = shopIdListByStageStatus.stream().filter(o -> o.getShopId() != null).map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
try {
|
||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds);
|
||||
Map<String, Long> map = openPlanShopInfoDTOS.stream().filter(OpenPlanShopInfoDTO -> StringUtils.isNoneBlank(OpenPlanShopInfoDTO.getStoreNum())).
|
||||
collect(Collectors.toMap(OpenPlanShopInfoDTO::getStoreNum, OpenPlanShopInfoDTO::getShopId));
|
||||
List<String> storeCodes = new ArrayList<>(map.keySet());
|
||||
xfsgFirstOrderListRequest request = new xfsgFirstOrderListRequest();
|
||||
request.setStoreCodeList(storeCodes);
|
||||
xfsgFirstOderListResponse firstOrderList = coolStoreStartFlowService.getFirstOrderList(request);
|
||||
if (Objects.nonNull(firstOrderList) && CollectionUtils.isNotEmpty(firstOrderList.getData())) {
|
||||
for (xfsgFirstOderDTO o : firstOrderList.getData()) {
|
||||
if (o.getBalance()) {
|
||||
shopStageInfoDAO.updateShopStageInfo(map.get(o.getStoreCode()), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
|
||||
preparationService.whetherToOpenForAcceptance(map.get(o.getStoreCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("定时任务更新订货金失败 shopIds:{},e:{}", shopIds, e.getMessage());
|
||||
}
|
||||
hasNext = shopIdListByStageStatus.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
log.info("------定时任务结束调用鲜丰更新订货金结束------");
|
||||
XxlJobHelper.handleSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/29
|
||||
|
||||
Reference in New Issue
Block a user