|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.logpm.factory.jobhandler; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.logpm.factory.snm.entity.OrderLogEntity; |
|
|
|
|
import com.logpm.factory.snm.entity.StaorderPackagesEntity; |
|
|
|
@ -20,13 +21,17 @@ import com.logpm.oldproject.feign.IServiceNumClient;
|
|
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
|
import io.jsonwebtoken.lang.Strings; |
|
|
|
|
import io.swagger.models.auth.In; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springblade.common.constant.LogpmDataStatusEnum; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
|
|
import java.awt.datatransfer.StringSelection; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -56,8 +61,6 @@ public class FactoryXxlJob {
|
|
|
|
|
private IStationOrderService stationOrderService; |
|
|
|
|
|
|
|
|
|
private IStaorderPackagesService staorderPackagesService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IAdvanceClient iAdvanceClient; |
|
|
|
|
private IAdvanceDetailClient advanceDetailClient; |
|
|
|
|
private IDetailProductClient detailProductClient; |
|
|
|
@ -69,11 +72,16 @@ public class FactoryXxlJob {
|
|
|
|
|
*/ |
|
|
|
|
@XxlJob("factoryJobHandler") |
|
|
|
|
public ReturnT<String> factoryJobHandler(String param) throws Exception { |
|
|
|
|
|
|
|
|
|
List<StationlinenumEntity> ls = stationlinenumService.lambdaQuery().eq(StationlinenumEntity::getIsDeleted, 0).eq(StationlinenumEntity::getStatus, 1).list(); |
|
|
|
|
// 获取当前时间
|
|
|
|
|
LocalDate date ; |
|
|
|
|
List<StationlinenumEntity> ls = stationlinenumService.lambdaQuery().eq(StationlinenumEntity::getIsDeleted, 0).eq(StationlinenumEntity::getStatus, LogpmDataStatusEnum.OPEN.getValue()).list(); |
|
|
|
|
if (!ObjectUtils.isEmpty(ls)) { |
|
|
|
|
// 获取当前时间
|
|
|
|
|
LocalDate date = LocalDate.now(); |
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(param)){ |
|
|
|
|
date = LocalDate.parse(param); |
|
|
|
|
}else{ |
|
|
|
|
date = LocalDate.now(); |
|
|
|
|
} |
|
|
|
|
//查询配置站点
|
|
|
|
|
ls.forEach(stationlinenumEntity -> { |
|
|
|
|
// 根据站点id和当前时间调用service 请求对方接口获取数据插入到我们的数据库
|
|
|
|
@ -218,7 +226,7 @@ public class FactoryXxlJob {
|
|
|
|
|
advanceEntity.setSenderName(""); //发货工厂名称 可以为空
|
|
|
|
|
advanceEntity.setAdministratorsId(0);// 导入人
|
|
|
|
|
advanceEntity.setCreateTime(LocalDate.now()); //添加时间
|
|
|
|
|
advanceEntity.setCarsNum(""); //派车单--snm 可以为空
|
|
|
|
|
advanceEntity.setCarsNum(v.getTcWla001()); //派车单--snm 可以为空
|
|
|
|
|
advanceEntity.setDeleteTime(0); // 删除时间
|
|
|
|
|
advanceEntity.setWaybillNo("");//运单号 可以为空
|
|
|
|
|
advanceEntity.setWarehouseId(0); //导入人仓库id
|
|
|
|
@ -229,17 +237,14 @@ public class FactoryXxlJob {
|
|
|
|
|
advanceEntity.setDeleteAdministratorsId(0);//删除用户
|
|
|
|
|
Integer integer = iAdvanceClient.addAdvanceClient(advanceEntity); |
|
|
|
|
if (integer > 0){ |
|
|
|
|
|
|
|
|
|
//订单id
|
|
|
|
|
longIntegerMap.put(k,integer); |
|
|
|
|
// longIntegerMap.put(k,advanceEntity.getId());
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//TODO 插入到老系统的的数据库
|
|
|
|
|
|
|
|
|
|
map.forEach((k,v) ->{ |
|
|
|
|
Integer aLong = longIntegerMap.get(k);//订单ID
|
|
|
|
|
|
|
|
|
|
StationOrderEntity stationOrderEntity = collect.get(k); // 订单
|
|
|
|
|
|
|
|
|
|
//添加订单明细
|
|
|
|
|