| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.MobileServiceImpl; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.MesPakinParam; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.jsqlparser.parser.JJTCCJSqlParserState; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/6 |
| | |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinLogService waitPakinLogService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Value("${mes.url}") |
| | | private String mesUrl; |
| | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | try { |
| | | // ReturnT<String> result = null; |
| | | // if (wrkMast.getWrkSts() == 5 && wrkMast.getIoType() == 1) { |
| | | // result = postMesData(wrkMast,inpath,1); |
| | | // } else if (wrkMast.getWrkSts() == 15 && wrkMast.getIoType() == 101){ |
| | | // result = postMesData(wrkMast,outPath,2); |
| | | // } |
| | | // if(null != result && !result.isSuccess()){ |
| | | // return result; |
| | | // } |
| | | /*...........................赣州新增..............以下.............赣州新增...........................*/ |
| | | ReturnT<String> result = null; |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkMast.getWrkSts() == 5 && wrkMast.getIoType() == 1) { |
| | | if(wrkDetl != null){ |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetl.getZpallet()); |
| | | combParam.setPackName(wrkDetl.getMatnr()); |
| | | combParam.setLocno(wrkMast.getLocNo()); |
| | | combParam.setPackSts(1); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | // result = postMesData(inpath,combParam); |
| | | // 保存入库通知档历史档 |
| | | if (!waitPakinLogService.save(wrkMast.getBarcode())) { |
| | | exceptionHandle("保存入库通知档历史档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除入库通知档 |
| | | if (!waitPakinService.delete(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()))) { |
| | | exceptionHandle("删除入库通知档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } else if (wrkMast.getWrkSts() == 15 && wrkMast.getIoType() == 101){ |
| | | if(wrkDetl != null){ |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetl.getZpallet()); |
| | | combParam.setPackName(wrkDetl.getMatnr()); |
| | | combParam.setLocno(wrkMast.getLocNo()); |
| | | combParam.setPackSts(0); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | // result = postMesData(outPath,combParam); |
| | | } |
| | | } |
| | | if(null != result && !result.isSuccess()){ |
| | | return result; |
| | | } |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | |
| | | |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | private ReturnT<String> postMesData(WrkMast wrkMast, String mesPath,int a){ |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if(wrkDetl != null){ |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetl.getZpallet()); |
| | | combParam.setPackName(wrkDetl.getMatnr()); |
| | | combParam.setLocno(wrkMast.getLocNo()); |
| | | combParam.setPackSts(1); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | /*...........................赣州新增..............以下.............赣州新增...........................*/ |
| | | |
| | | private ReturnT<String> postMesData(String mesPath,Object combParam){ |
| | | if(combParam != null){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | } |