6 changed files with 180 additions and 83 deletions
@ -0,0 +1,56 @@
|
||||
package com.logpm.factory.jobhandler; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.factory.comfac.mapper.OrderPackageStatusPushFailLogMapper; |
||||
import com.logpm.factory.comfac.service.IFactoryCommonService; |
||||
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity; |
||||
import com.xxl.job.core.biz.model.ReturnT; |
||||
import com.xxl.job.core.handler.annotation.XxlJob; |
||||
import com.xxl.job.core.log.XxlJobLogger; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.log4j.Log4j2; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 处理包件老系统没有⏲入库 这边无法获取的包件信息 |
||||
*/ |
||||
|
||||
@Log4j2 |
||||
@AllArgsConstructor |
||||
@Component |
||||
public class OrderPackageStatusFallJob { |
||||
|
||||
private final OrderPackageStatusPushFailLogMapper orderPackageStatusPushFailLogMapper; |
||||
|
||||
private final IFactoryCommonService factoryCommonService; |
||||
@XxlJob("getOrderPackageFromOldSystem") |
||||
public ReturnT<String> getOrderPackageFromOldSystem(String param) { |
||||
// 加载日志列表
|
||||
QueryWrapper queryWrapper = new QueryWrapper(); |
||||
queryWrapper.eq("data_status", 0); |
||||
List<OrderPackageStatusPushFailLogEntity> list = orderPackageStatusPushFailLogMapper.selectList(queryWrapper); |
||||
for (OrderPackageStatusPushFailLogEntity orderPackageStatusPushFailLogEntity : list) { |
||||
|
||||
try { |
||||
// 重新获取数据
|
||||
factoryCommonService.extracted(orderPackageStatusPushFailLogEntity.getOrderPackageStatus(), |
||||
orderPackageStatusPushFailLogEntity.getUnitNo(), orderPackageStatusPushFailLogEntity.getWarehouseId(), |
||||
orderPackageStatusPushFailLogEntity.getOperationTime(), orderPackageStatusPushFailLogEntity.getTrayId() |
||||
); |
||||
|
||||
orderPackageStatusPushFailLogEntity.setDataStatus(1); |
||||
|
||||
}catch (Exception e){ |
||||
XxlJobLogger.log(e); |
||||
|
||||
orderPackageStatusPushFailLogEntity.setDataStatus(2); |
||||
} |
||||
orderPackageStatusPushFailLogMapper.updateById(orderPackageStatusPushFailLogEntity); |
||||
} |
||||
return ReturnT.SUCCESS; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue