自动化立体仓库 - WMS系统
#
whycq
2024-12-31 c3a72cea5680c579c87463f9dab6f79fbe3d7a87
src/main/java/com/zy/common/web/WcsController.java
@@ -8,6 +8,7 @@
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.EmptyPlateOutParam;
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.MatServiceImpl;
import com.zy.asrs.utils.Utils;
import com.zy.common.CodeRes;
import com.zy.common.model.LocDto;
@@ -60,6 +61,8 @@
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private WrkDetlLogService wrkDetlLogService;
    @Autowired
    private MatServiceImpl matService;
    @PostMapping("/pakin/loc/v1")
    @ResponseBody
@@ -357,7 +360,7 @@
        log.info("收到WCS罐装出库接口请求");
        Date now = new Date();
        // 查询库存状态位F 且 库存明细包含该物料的库位
        LocMast tarLoc = locMastService.getLocFByMatnr("BC20009TY13701530");
        LocMast tarLoc = locMastService.getLocFByMatnr("CP24609KS12300118");
        if (Cools.isEmpty(tarLoc)) {
            throw new CoolException("没有可出库的库位");
        }
@@ -470,8 +473,19 @@
            if (!wrkMastService.updateById(wrkMast)) {
                throw new CoolException("更新工作档数据状态失败");
            }
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            for (WrkDetl wrkDetl : wrkDetls) {
                Mat mat = matService.selectByMatnr("CP25009TY10000248");
                WrkDetl wrkDetl1 = new WrkDetl();
                wrkDetl1.sync(wrkDetl);
                wrkDetl1.sync(mat);
                wrkDetl1.setIoTime(now);
                wrkDetlService.insert(wrkDetl1);
            }
            wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("matnr", "BC20009TY13701530").eq("wrk_no",wrkMast.getWrkNo()));
            // 更新明细档io_time (历史档关联使用)
            wrkDetlService.updateIoTime(wrkMast.getWrkNo(), now);
//            wrkDetlService.updateIoTime(wrkMast.getWrkNo(), now);
            // 修改库位状态 Q.拣料/盘点/并板再入库
            LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
            locMast.setLocSts("Q");