| | |
| | | package com.zy.third.lk.task; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | 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.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.DocTypeService; |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertInDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_InDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | String sqlInDetTb = "select * from lk_InDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTB> inDets = erpSqlServer.select(sqlInDetTb, InDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_InDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | String sqlInDetTbBak = "select * from lk_InDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTBBak> inDetBaks = erpSqlServer.select(sqlInDetTbBak, InDetTBBak.class); |
| | | if (!inDets.isEmpty() || !inDetBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertOutDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_OutDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | String sqlInDetTb = "select * from lk_OutDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTB> inDets = erpSqlServer.select(sqlInDetTb, OutDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_OutDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | String sqlInDetTbBak = "select * from lk_OutDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTBBak> inDetBaks = erpSqlServer.select(sqlInDetTbBak, OutDetTBBak.class); |
| | | if (!inDets.isEmpty() || !inDetBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | |
| | | if (!Cools.isEmpty(orderDetl.getProType())) content.put("proType", "'" + orderDetl.getProType() + "'"); |
| | | if (!Cools.isEmpty(orderDetl.getMemo())) content.put("remark", "'" + orderDetl.getMemo() + "'"); |
| | | if (!Cools.isEmpty(orderDetl.getOutOrderNo())) content.put("OrderNo", "'" + orderDetl.getOutOrderNo() + "'"); |
| | | if (!Cools.isEmpty(orderDetl.getQty())) content.put("MainNum", orderDetl.getQty()); |
| | | if (!Cools.isEmpty(orderDetl.getQty())) { |
| | | if (orderDetl.getQty() > orderDetl.getAnfme() && orderDetl.getQty() > orderDetl.getWorkQty()) { |
| | | log.info("修正错误数量:{}", JSON.toJSON(orderDetl)); |
| | | content.put("MainNum", orderDetl.getWorkQty()); |
| | | } else { |
| | | content.put("MainNum", orderDetl.getQty()); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(orderDetl.getWareId())) content.put("WareId", "'" + orderDetl.getWareId() + "'"); |
| | | if (!Cools.isEmpty(orderDetl.getWareName())) content.put("WareName", "'" + orderDetl.getWareName() + "'"); |
| | | if (!Cools.isEmpty(orderDetl.getPacking())) content.put("Packing", "'" + orderDetl.getPacking() + "'"); |