| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import com.zy.ints.task.handler.IoCompleteLogHandler; |
| | | import com.zy.ints.task.handler.WaitMatinLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 回报档管理转回报历史档 |
| | | * 回报档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | |
| | | |
| | | @Autowired |
| | | private IoCompleteLogHandler ioCompleteLogHandler; |
| | | |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void execute(){ |
| | | if(!erpEnabled) return; |
| | | List<IoComplete> ioCompletes = ioCompleteService.selectIoCompleteBySts(); |
| | | for (IoComplete ioComplete : ioCompletes) { |
| | | ReturnT<String> result = ioCompleteLogHandler.start(ioComplete); |
| | | if (!result.isSuccess()) { |
| | | log.error("回报档[billNo={}],[seqNo={}]历史档处理失败", ioComplete.getBillNo(),ioComplete.getSeqNo()); |
| | | log.error("回报档[id={}]历史档处理失败", ioComplete.getId()); |
| | | } |
| | | } |
| | | } |