1.库存调整(往StockCheckRecord插入盘盈、盘亏数据)
2.手动入库(无通知单号)往CPICMO插入数据,FWorkShop(部门)值erp提供[11378]
1个文件已添加
5个文件已修改
189 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/param/ERPselectParam.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocNormalMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocNormalServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocNormalMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locNormal/locNormalIn.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/ERPselectParam.java
New file
@@ -0,0 +1,8 @@
package com.zy.asrs.entity.param;
import lombok.Data;
@Data
public class ERPselectParam {
    private Integer num;
}
src/main/java/com/zy/asrs/mapper/LocNormalMapper.java
@@ -28,6 +28,8 @@
    public Integer pdaLocNormalUpdate(List<LocNormal> list);
    public Integer withoutSupplierLocNormalUpdate(List<LocNormal> list);
    public List<LocNormal> pdaLocNormalQuery(@Param("matnr") String matnr, @Param("warehouse") String warehouse, @Param("billNo") String billNo);
    public void pdaLocNormalOut1(@Param("id") Integer id,@Param("matnr") String matnr, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("warehouse") String warehouse);
src/main/java/com/zy/asrs/service/impl/LocNormalServiceImpl.java
@@ -9,6 +9,7 @@
import com.zy.asrs.entity.LocNormal;
import com.zy.asrs.entity.WaitPakin;
import com.zy.asrs.entity.WaitPakinLog;
import com.zy.asrs.entity.param.ERPselectParam;
import com.zy.asrs.mapper.LocNormalMapper;
import com.zy.asrs.mapper.OutStockMapper;
import com.zy.asrs.service.LocNormalService;
@@ -93,7 +94,44 @@
                        }
                    }
                } else {
                    throw new CoolException("通知单号不可为空");
                    // throw new CoolException("通知单号不可为空"); 通知单号空的情况下,往CPICMO表插入手动入库数据
                    // 判断原先平仓是否存在有货,如果有货数量进行累加
                    LocNormal oldLocList = locNormalService.selectOne(new EntityWrapper<LocNormal>().eq("matnr", list.get(i).getMatnr()).and().eq("warehouse", list.get(i).getWarehouse()).and().eq("mnemonic", list.get(i).getMnemonic()).and().eq("state", "1"));
                    if (!Cools.isEmpty(oldLocList)) {
                        // erp更新
                        if (Cools.isEmpty(list.get(i).getSupplier())) {
                            String maxKeySql = "select max(FInterID) as num from CPICMO";
                            List<ERPselectParam> maxKeyList = erpSqlServer.select(maxKeySql, ERPselectParam.class);
                            Integer maxKey = maxKeyList.get(0).getNum();
                            String ErpSql = "insert into CPICMO(FBrNo, FSourceBillNo, FBillNo, FTranType, FStatus, FMRP, FItemID, FQty, FCommitQty, FSourceEntryID, FClosed, FUnitID, FAuxCommitQty, FCancellation, FQtyFinish, FQtyScrap, FQtyLost, FAuxQtyFinish, FAuxQtyScrap, FAuxQtyLost, FMrpClosed, FBomInterID, FQtyPass, FAuxQtyPass, FQtyBack, FAuxQtyBack, FFinishTime, FReadyTIme, FPowerCutTime, FFixTime, FWaitItemTime, FWaitToolTime, FTaskID, FWorkTypeID, FCostObjID, FStockQty, FAuxStockQty, FSuspend, FReleasedQty, FReleasedAuxQty, FUnScheduledQty, FUnScheduledAuxQty, FSubEntryID, FScheduleID, FPlanOrderInterID, FProcessPrice, FProcessFee, FGMPBatchNo, FGMPCollectRate, FGMPItemBalance, FGMPBulkQty, FCustID, FMRPLockFlag, FHandworkClose, FInHighLimit, FInHighLimitQty, FInLowLimit, FInLowLimitQty, FChangeTimes, FCheckCommitQty, FAuxCheckCommitQty, FPlanConfirmed, FPlanMode, FMTONo, FPrintCount, FFinClosed, FStockFlag, FStartFlag, FVchBillNo, FVchInterID, FCardClosed, FHRReadyTime, FSourceTranType, FSourceInterId, FInterID, FAuxQty, FAuxInHighLimitQty, FAuxInLowLimitQty, Fnumber, FWorkShop) values (0, 0, '0', 85, 0, 1052, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14036, '0', 0, 0, 14215, 0, '0', 0, 1059, 0, 0, 0, 0, {0,number,#}, {1,number,#}, {2,number,#}, {3,number,#}, ''{4}'', 11378)";
                            ErpSql = MessageFormat.format(ErpSql, maxKey + 1, list.get(i).getAnfme(), list.get(i).getAnfme(), list.get(i).getAnfme(), list.get(i).getMatnr());
                            erpSqlServer.update(ErpSql);
                        }
//                        Double updateAnfme = new Double(list.get(i).getAnfme().doubleValue());
                        // 平仓入库(更新)逻辑
                        list.get(i).setAnfme(oldLocList.getAnfme().add(list.get(i).getAnfme()));
                        updateList.add(list.get(i));
                        if (baseMapper.withoutSupplierLocNormalUpdate(updateList) > 0) {
                            // cust_wait_pakin转cust_wait_pakin_log,并更新数量
//                            custWaitPakinToLog(list.get(i), updateAnfme);
                        }
                    } else {
                        // erp更新
                        if (Cools.isEmpty(list.get(i).getSupplier())) {
                            String maxKeySql = "select max(FInterID) as num from CPICMO";
                            List<ERPselectParam> maxKeyList = erpSqlServer.select(maxKeySql, ERPselectParam.class);
                            Integer maxKey = maxKeyList.get(0).getNum();
                            String ErpSql = "insert into CPICMO(FBrNo, FSourceBillNo, FBillNo, FTranType, FStatus, FMRP, FItemID, FQty, FCommitQty, FSourceEntryID, FClosed, FUnitID, FAuxCommitQty, FCancellation, FQtyFinish, FQtyScrap, FQtyLost, FAuxQtyFinish, FAuxQtyScrap, FAuxQtyLost, FMrpClosed, FBomInterID, FQtyPass, FAuxQtyPass, FQtyBack, FAuxQtyBack, FFinishTime, FReadyTIme, FPowerCutTime, FFixTime, FWaitItemTime, FWaitToolTime, FTaskID, FWorkTypeID, FCostObjID, FStockQty, FAuxStockQty, FSuspend, FReleasedQty, FReleasedAuxQty, FUnScheduledQty, FUnScheduledAuxQty, FSubEntryID, FScheduleID, FPlanOrderInterID, FProcessPrice, FProcessFee, FGMPBatchNo, FGMPCollectRate, FGMPItemBalance, FGMPBulkQty, FCustID, FMRPLockFlag, FHandworkClose, FInHighLimit, FInHighLimitQty, FInLowLimit, FInLowLimitQty, FChangeTimes, FCheckCommitQty, FAuxCheckCommitQty, FPlanConfirmed, FPlanMode, FMTONo, FPrintCount, FFinClosed, FStockFlag, FStartFlag, FVchBillNo, FVchInterID, FCardClosed, FHRReadyTime, FSourceTranType, FSourceInterId, FInterID, FAuxQty, FAuxInHighLimitQty, FAuxInLowLimitQty, Fnumber, FWorkShop) values (0, 0, '0', 85, 0, 1052, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14036, '0', 0, 0, 14215, 0, '0', 0, 1059, 0, 0, 0, 0, {0,number,#}, {1,number,#}, {2,number,#}, {3,number,#}, ''{4}'', 11378)";
                            ErpSql = MessageFormat.format(ErpSql, maxKey + 1, list.get(i).getAnfme(), list.get(i).getAnfme(), list.get(i).getAnfme(), list.get(i).getMatnr());
                            erpSqlServer.update(ErpSql);
                        }
                        // 平仓入库逻辑
                        addList.add(list.get(i));
                        if (baseMapper.pdaLocNormalIn(addList) > 0) {
                            // cust_wait_pakin转cust_wait_pakin_log,并更新数量
//                            custWaitPakinToLog(list.get(i), list.get(i).getAnfme().doubleValue());
                        }
                    }
                }
            }
        }
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -16,11 +16,13 @@
import com.zy.common.model.OutLocDto;
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
import com.zy.common.service.erp.ErpSqlServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.MessageFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -59,6 +61,8 @@
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private WrkDetlLogService wrkDetlLogService;
    @Autowired
    private ErpSqlServer erpSqlServer;
    @Override
    @Transactional
@@ -114,7 +118,7 @@
                matDtos.add(new MatCodeCountDto(elem.getMatNo(), elem.getCount(), elem.getMatStatus(), elem.getStr5(), elem.getStr6()));
            });
            wrkDetlService.createWorkDetail(workNo, matDtos, param.getBarcode(), userId);
        // 成品物料
            // 成品物料
        } else {
            // 保持工作档明细
            WrkDetl wrkDetl = new WrkDetl();
@@ -146,20 +150,32 @@
        sourceStaNo.setWrkNo(workNo);
        sourceStaNo.setModiUser(userId);
        sourceStaNo.setModiTime(new Date());
        if (!basDevpService.updateById(sourceStaNo)){
        if (!basDevpService.updateById(sourceStaNo)) {
            throw new CoolException("更新源站失败");
        }
        // 更新目标库位状态
        LocMast locMast = locMastService.selectById(dto.getLocNo());
        if (locMast.getLocSts().equals("O")){
        if (locMast.getLocSts().equals("O")) {
            locMast.setLocSts("S"); // S.入库预约
            locMast.setModiUser(userId);
            locMast.setModiTime(new Date());
            if (!locMastService.updateById(locMast)){
            if (!locMastService.updateById(locMast)) {
                throw new CoolException("改变库位状态失败");
            }
        } else {
            throw new CoolException(dto.getLocNo()+"目标库位已被占用");
            throw new CoolException(dto.getLocNo() + "目标库位已被占用");
        }
        // 判断无通知单号supplier的入库数据,CPICMO插入数据
        List<FullStoreParam.MatCodeStore> erpMatList = param.getList();
        for (FullStoreParam.MatCodeStore es : erpMatList) {
            if (Cools.isEmpty(es.getStr6())) {
                String maxKeySql = "select max(FInterID) as num from CPICMO";
                List<ERPselectParam> maxKeyList = erpSqlServer.select(maxKeySql, ERPselectParam.class);
                Integer maxKey = maxKeyList.get(0).getNum();
                String ErpSql = "insert into CPICMO(FBrNo, FSourceBillNo, FBillNo, FTranType, FStatus, FMRP, FItemID, FQty, FCommitQty, FSourceEntryID, FClosed, FUnitID, FAuxCommitQty, FCancellation, FQtyFinish, FQtyScrap, FQtyLost, FAuxQtyFinish, FAuxQtyScrap, FAuxQtyLost, FMrpClosed, FBomInterID, FQtyPass, FAuxQtyPass, FQtyBack, FAuxQtyBack, FFinishTime, FReadyTIme, FPowerCutTime, FFixTime, FWaitItemTime, FWaitToolTime, FTaskID, FWorkTypeID, FCostObjID, FStockQty, FAuxStockQty, FSuspend, FReleasedQty, FReleasedAuxQty, FUnScheduledQty, FUnScheduledAuxQty, FSubEntryID, FScheduleID, FPlanOrderInterID, FProcessPrice, FProcessFee, FGMPBatchNo, FGMPCollectRate, FGMPItemBalance, FGMPBulkQty, FCustID, FMRPLockFlag, FHandworkClose, FInHighLimit, FInHighLimitQty, FInLowLimit, FInLowLimitQty, FChangeTimes, FCheckCommitQty, FAuxCheckCommitQty, FPlanConfirmed, FPlanMode, FMTONo, FPrintCount, FFinClosed, FStockFlag, FStartFlag, FVchBillNo, FVchInterID, FCardClosed, FHRReadyTime, FSourceTranType, FSourceInterId, FInterID, FAuxQty, FAuxInHighLimitQty, FAuxInLowLimitQty, Fnumber, FWorkShop) values (0, 0, '0', 85, 0, 1052, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14036, '0', 0, 0, 14215, 0, '0', 0, 1059, 0, 0, 0, 0, {0,number,#}, {1,number,#}, {2,number,#}, {3,number,#}, ''{4}'' 11378)";
                ErpSql = MessageFormat.format(ErpSql, maxKey + 1, es.getCount(), es.getCount(), es.getCount(), es.getMatNo());
                erpSqlServer.update(ErpSql);
            }
        }
        return dto.getLocNo();
    }
@@ -248,16 +264,18 @@
            wrkMast.setModiUser(userId);
            wrkMast.setModiTime(new Date());
            if (!wrkMastService.insert(wrkMast)) {
                throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo());
                throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo());
            }
            // 生成工作档明细
            for (LocDetlDto detlDto : dto.getLocDetlDtos()) {
                // 出库时,数量为0的直接忽略
                if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;}
                if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) {
                    continue;
                }
                WrkDetl wrkDetl = new WrkDetl();
                wrkDetl.setWrkNo(workNo);
                wrkDetl.setIoTime(new Date());
                Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount();
                Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount();
                wrkDetl.setAnfme(anfme); // 数量
                VersionUtils.setWrkDetl(wrkDetl, detlDto.getLocDetl()); // 版本控制
                wrkDetl.setAppeTime(new Date());
@@ -271,11 +289,11 @@
            // 修改库位状态:   F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中
            locMast = locMastService.selectById(dto.getLocNo());
            if (locMast.getLocSts().equals("F")) {
                locMast.setLocSts(ioType==101?"R":"P");
                locMast.setLocSts(ioType == 101 ? "R" : "P");
                locMast.setModiUser(userId);
                locMast.setModiTime(new Date());
                if (!locMastService.updateById(locMast)) {
                    throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo());
                    throw new CoolException("预约库位状态失败,库位号:" + dto.getLocNo());
                }
            } else {
                throw new CoolException(dto.getLocNo() + "库位不是在库状态");
@@ -325,20 +343,20 @@
        sourceStaNo.setWrkNo(workNo);
        sourceStaNo.setModiUser(userId);
        sourceStaNo.setModiTime(new Date());
        if (!basDevpService.updateById(sourceStaNo)){
        if (!basDevpService.updateById(sourceStaNo)) {
            throw new CoolException("更新源站失败");
        }
        // 更新目标库位状态
        LocMast locMast = locMastService.selectById(dto.getLocNo());
        if (locMast.getLocSts().equals("O")){
        if (locMast.getLocSts().equals("O")) {
            locMast.setLocSts("S"); // S.入库预约
            locMast.setModiUser(userId);
            locMast.setModiTime(new Date());
            if (!locMastService.updateById(locMast)){
            if (!locMastService.updateById(locMast)) {
                throw new CoolException("改变库位状态失败");
            }
        } else {
            throw new CoolException(dto.getLocNo()+"目标库位已被占用");
            throw new CoolException(dto.getLocNo() + "目标库位已被占用");
        }
        return dto.getLocNo();
    }
@@ -355,7 +373,7 @@
            // 获取库位
            LocMast locMast = locMastService.selectById(locNo);
            if (Cools.isEmpty(locMast)) {
                throw new CoolException(locNo+"库位不存在");
                throw new CoolException(locNo + "库位不存在");
            }
            // 获取源站
            Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
@@ -392,7 +410,7 @@
                throw new CoolException("保存工作档失败");
            }
            // 更新库位状态 D.空板 -> R.出库预约
            if (locMast.getLocSts().equals("D")){
            if (locMast.getLocSts().equals("D")) {
                locMast.setLocSts("R");
                locMast.setModiUser(userId);
                locMast.setModiTime(new Date());
@@ -420,7 +438,7 @@
                if (null != one) locDetlDtos.add(new LocDetlDto(one, one.getAnfme()));
            }
        }
        for (LocDetlDto e: locDetlDtos) {
        for (LocDetlDto e : locDetlDtos) {
            if (Cools.isEmpty(e.getLocDetl().getZpallet())) {
                throw new CoolException("托盘码为空不允许盘点,库位号" + e.getLocDetl().getLocNo());
            }
@@ -437,11 +455,11 @@
    @Transactional
    public void locMove(String sourceLocNo, String locNo, Long userId) {
        LocMast sourceLoc = locMastService.selectById(sourceLocNo);
        if (Cools.isEmpty(sourceLoc)){
        if (Cools.isEmpty(sourceLoc)) {
            throw new CoolException("未找到库位");
        }
        LocMast loc = locMastService.selectById(locNo);
        if (Cools.isEmpty(loc)){
        if (Cools.isEmpty(loc)) {
            throw new CoolException("未找到库位");
        }
        if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) {
@@ -464,7 +482,7 @@
        wrkMast.setFullPlt("N"); // 满板:Y
        wrkMast.setPicking("N"); // 拣料
        wrkMast.setExitMk("N"); // 退出
        wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板
        wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板
        wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码
        wrkMast.setLinkMis("N");
        wrkMast.setAppeUser(userId);
@@ -496,11 +514,11 @@
            sourceLoc.setLocSts("R"); // R.出库预约
            sourceLoc.setModiUser(userId);
            sourceLoc.setModiTime(new Date());
            if (!locMastService.updateById(sourceLoc)){
            if (!locMastService.updateById(sourceLoc)) {
                throw new CoolException("更新源库位状态失败");
            }
        } else {
            throw new CoolException("源库位出库失败,状态:"+sourceLoc.getLocSts$());
            throw new CoolException("源库位出库失败,状态:" + sourceLoc.getLocSts$());
        }
        // 修改目标库位状态
        if (loc.getLocSts().equals("O")) {
@@ -511,7 +529,7 @@
                throw new CoolException("更新目标库位状态失败");
            }
        } else {
            throw new CoolException("移转失败,目标库位状态:"+loc.getLocSts$());
            throw new CoolException("移转失败,目标库位状态:" + loc.getLocSts$());
        }
    }
@@ -519,16 +537,16 @@
    @Transactional
    public void completeWrkMast(String workNo, Long userId) {
        WrkMast wrkMast = wrkMastService.selectById(workNo);
        if (Cools.isEmpty(wrkMast)){
            throw new CoolException(workNo+"工作档不存在");
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
        if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) {
            throw new CoolException("当前工作档已完成");
        }
        // 入库 + 库位转移
        if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) {
        if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) {
            wrkMast.setWrkSts(4L);
        // 出库
            // 出库
        } else if (wrkMast.getWrkSts() > 10) {
            wrkMast.setWrkSts(14L);
        }
@@ -561,7 +579,7 @@
            LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam));
            // 保存新库存明细
            if (Cools.isEmpty(one)) {
                if (adjust.getCount() == 0){
                if (adjust.getCount() == 0) {
                    continue;
                }
                MatCode matCode = matCodeService.selectById(adjust.getMatnr());
@@ -583,8 +601,14 @@
                adjDetl.setOriQty(0.0D);
                adjDetl.setAdjQty(adjust.getCount());
                adjDetlService.save(adjDetl, userId);
            // 修改原库存明细
                // 调整库存,新增,StockCheckRecord插入盘盈数据
                String ErpSql = "insert into StockCheckRecord(Fnumber, CheckQty, Fflag_rw, Fflag_finish) values (''{0}'', {1,number,#}, 0, 0)";
                ErpSql = MessageFormat.format(ErpSql, adjust.getMatnr(), adjust.getCount());
                erpSqlServer.update(ErpSql);
                // 修改原库存明细
            } else {
                // 库存原数量
                Double oldCount = one.getAnfme();
                // 如果数量修改,则更新库存明细
                if (!adjust.getCount().equals(one.getAnfme())) {
                    // 当数量被修改为 0 时,直接清除库存明细
@@ -610,6 +634,16 @@
                    adjDetl.setOriQty(one.getAnfme());
                    adjDetl.setAdjQty(adjust.getCount());
                    adjDetlService.save(adjDetl, userId);
                    // 调整库存,修改,StockCheckRecord插入盘盈、盘亏数据
                    Double erpCount = 0D;
                    if (adjust.getCount() == 0) {
                        erpCount = 0 - oldCount;
                    } else {
                        erpCount = adjust.getCount() - oldCount;
                    }
                    String ErpSql = "insert into StockCheckRecord(Fnumber, CheckQty, Fflag_rw, Fflag_finish) values (''{0}'', {1,number,#}, 0, 0)";
                    ErpSql = MessageFormat.format(ErpSql, adjust.getMatnr(), erpCount);
                    erpSqlServer.update(ErpSql);
                }
            }
        }
@@ -628,8 +662,8 @@
    @Transactional
    public void cancelWrkMast(String workNo, Long userId) {
        WrkMast wrkMast = wrkMastService.selectById(workNo);
        if (Cools.isEmpty(wrkMast)){
            throw new CoolException(workNo+"工作档不存在");
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
        String locNo = ""; // 待修改目标库位
        String locSts = ""; // 待修改目标库位状态
@@ -646,29 +680,29 @@
                // 库位转移:源库位
                LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo());
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,源库位不存在:"+ wrkMast.getSourceLocNo());
                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
                }
                locMast.setLocSts(wrkMast.getEmptyMk().equals("Y")?"D":"F");
                locMast.setLocSts(wrkMast.getEmptyMk().equals("Y") ? "D" : "F");
                locMast.setModiTime(new Date());
                locMast.setModiUser(userId);
                locMastService.updateById(locMast);
            }
        // 出库取消(修改源库位)
            // 出库取消(修改源库位)
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) {
            locNo = wrkMast.getSourceLocNo();
            // 出库 ===>> F.在库
            if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) {
                locSts = "F";
            // 空板出库 ===>> D.空桶/空栈板
                // 空板出库 ===>> D.空桶/空栈板
            } else if (wrkMast.getIoType() == 110) {
                locSts = "D";
            // 库位转移 ===>> D.空桶/空栈板
                // 库位转移 ===>> D.空桶/空栈板
            } else if (wrkMast.getIoType() == 11) {
                locSts = wrkMast.getEmptyMk().equals("Y")?"D":"F";
                locSts = wrkMast.getEmptyMk().equals("Y") ? "D" : "F";
                // 库位转移:目标库位
                LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,目标库位不存在:"+ wrkMast.getSourceLocNo());
                    throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo());
                }
                locMast.setLocSts("O");
                locMast.setModiTime(new Date());
@@ -702,7 +736,7 @@
        // 修改库位状态
        LocMast locMast = locMastService.selectById(locNo);
        if (Cools.isEmpty(locMast)) {
            throw new CoolException("取消工作档失败,库位不存在:"+ locNo);
            throw new CoolException("取消工作档失败,库位不存在:" + locNo);
        }
        locMast.setLocSts(locSts);
        locMast.setModiTime(new Date());
@@ -717,8 +751,8 @@
    @Transactional
    public void pickWrkMast(String workNo, Long userId) {
        WrkMast wrkMast = wrkMastService.selectById(workNo);
        if (Cools.isEmpty(wrkMast)){
            throw new CoolException(workNo+"工作档不存在");
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
        // 入出库类型判断
        if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) {
@@ -830,7 +864,7 @@
        }
        locMast.setModiTime(now);
        locMast.setModiUser(useId);
        if (!locMastService.updateById(locMast)){
        if (!locMastService.updateById(locMast)) {
            throw new CoolException("修改库位状态失败");
        }
    }
src/main/resources/mapper/LocNormalMapper.xml
@@ -59,14 +59,23 @@
        END;
    </insert>
    <insert id="pdaLocNormalUpdate">
    <update id="pdaLocNormalUpdate">
        BEGIN
        <foreach collection="list" item="item" index="index">
            update asr_loc_normal set anfme = #{item.anfme,jdbcType=DECIMAL}
            where supplier = #{item.supplier,jdbcType=VARCHAR} and state = '1' and warehouse = #{item.warehouse,jdbcType=VARCHAR}
        </foreach>
        END;
    </insert>
    </update>
    <update id="withoutSupplierLocNormalUpdate">
        BEGIN
        <foreach collection="list" item="item" index="index">
            update asr_loc_normal set anfme = #{item.anfme,jdbcType=DECIMAL}
            where matnr = #{item.matnr,jdbcType=VARCHAR} and state = '1' and warehouse = #{item.warehouse,jdbcType=VARCHAR} and mnemonic = #{item.mnemonic, jdbcType=VARCHAR}
        </foreach>
        END;
    </update>
    <select id="pdaLocNormalQuery" resultMap="BaseResultMap">
        select id, matnr,maktx, warehouse,anfme from asr_loc_normal
src/main/webapp/static/js/locNormal/locNormalIn.js
@@ -89,10 +89,10 @@
                        layer.msg("请输入生产单号");
                        return;
                    }
                    if (matCodeData[i].supplier == null || matCodeData[i].supplier == '' || matCodeData[i].supplier == undefined) {
                        layer.msg("请输入通知单号");
                        return;
                    }
                    // if (matCodeData[i].supplier == null || matCodeData[i].supplier == '' || matCodeData[i].supplier == undefined) {
                    //     layer.msg("请输入通知单号");
                    //     return;
                    // }
                }
                // 判断库区是否为空
                var warehouse = $('#putSiteSelect').val();