| | |
| | | import com.zy.asrs.entity.result.OpenOrderCompeteResult; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Override |
| | | @Transactional |
| | | public void packageUp(String barcode) { |
| | | Mat analyse = MatUtils.analyseMat(barcode); |
| | | Pack pack = packService.selectByBarcode(barcode); |
| | | if (null != pack) { |
| | | throw new CoolException(barcode + "重复提交"); |
| | | } |
| | | Date now = new Date(); |
| | | // todo:luxiaotao 解析条码规则,获取物料代码 |
| | | pack = new Pack( |
| | | barcode, // 条码[非空] |
| | | null, // 商品编号 |
| | | null, // 批号 |
| | | analyse.getMatnr(), // 商品编号 |
| | | analyse.getBarcode(), // 批号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | |
| | | if (!packService.insert(pack)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | Mat mat = new Mat(); |
| | | mat.setTagId(tagService.getTop().getId()); |
| | | mat.setMatnr(barcode); |
| | | mat.setMaktx(barcode); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setMemo("打包上线"); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | |
| | | Mat mat = matService.selectByMatnr(analyse.getMatnr()); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | // todo |
| | | mat.setTagId(tagService.getTop().getId()); |
| | | mat.setMatnr(analyse.getMatnr()); |
| | | mat.setMaktx(barcode); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setMemo("打包上线"); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } else { |
| | | log.info("打包上线添加新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } |
| | | } |
| | | |