定时任务 订单分账逻辑

This commit is contained in:
2023-07-26 19:41:13 +08:00
parent 85908b4c70
commit c25e90e9ff
7 changed files with 69 additions and 22 deletions

View File

@@ -6,13 +6,11 @@ import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.domain.ykcCommond.PublishPileBillingTemplateCommand;
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.YKCPushCommandService;
import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.thirdparty.amap.service.AMapService;
import org.apache.commons.collections4.CollectionUtils;
@@ -42,6 +40,9 @@ public class JsowellTask {
@Autowired
private YKCPushCommandService ykcPushCommandService;
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
@Autowired
private IPileStationInfoService pileStationInfoService;
@@ -157,4 +158,24 @@ public class JsowellTask {
// 删除缓存
redisCache.deleteObject(CacheConstants.PUSH_STATION_CONNECTOR);
}
/**
* 定时任务,处理订单分账
* jsowellTask.processOrderSplitting()
*/
public void processOrderSplitting() {
// 查询运营商列表
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null);
if (CollectionUtils.isEmpty(pileMerchantInfos)) {
log.info("定时任务,处理订单分账, 未查询到运营商列表,直接返回");
return;
}
// 获取日期
// LocalDate yesterday = LocalDate.now().plusDays(-1);
LocalDate yesterday = LocalDate.of(2023, 7, 8);
// 调分账方法
pileMerchantInfos.parallelStream().forEach(merchant -> {
orderBasicInfoService.orderSplittingOperations(merchant.getId()+"", yesterday.toString());
});
}
}