自动化立体仓库 - WMS系统
admin
2021-09-01 e84d4700e32dba450aa4d239779fc39f38ae4afa
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -17,8 +17,10 @@
import com.zy.common.model.OutLocDto;
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
import com.zy.ints.entity.IoComplete;
import com.zy.ints.entity.WaitMatchk;
import com.zy.ints.entity.WaitMatout;
import com.zy.ints.service.IoCompleteService;
import com.zy.ints.service.WaitMatchkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -63,9 +65,10 @@
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private WrkDetlLogService wrkDetlLogService;
    @Autowired
    private WaitMatchkService waitMatchkService;
    @Autowired
    private IoCompleteService ioCompleteService;
    @Override
    @Transactional
@@ -530,6 +533,32 @@
        } else if (wrkMast.getWrkSts() > 10) {
            wrkMast.setWrkSts(14L);
        }
        //查询明细
        List<WrkDetl> detls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo));
        int i=1;
        for (WrkDetl detl : detls) {
            //生成回报档
            IoComplete ioComplete = new IoComplete();
            ioComplete.setBillNo(detl.getBillNo());
            ioComplete.setMatNo(detl.getMatNo());
            ioComplete.setMatName(detl.getMatName());
            ioComplete.setSeqNo(i);
            ioComplete.setQty(detl.getQty());
            ioComplete.setZpallet(detl.getZpallet());
            ioComplete.setAppeUser(userId);
            if (wrkMast.getWrkSts()==4L){
                ioComplete.setTaskType(1);
                ioComplete.setLocNo(wrkMast.getLocNo());
            }else if (wrkMast.getWrkSts()==14L){
                ioComplete.setTaskType(2);
                ioComplete.setLocNo(wrkMast.getSourceLocNo());
            }
            ioComplete.setAppeTime(new Date());
            if (!ioCompleteService.insert(ioComplete)){
                throw new CoolException("生成回报档失败");
            }
            i++;
        }
        // 完成操作人员记录
        wrkMast.setManuType("手动完成");
        Date now = new Date();
@@ -545,10 +574,22 @@
    @Override
    @Transactional
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId) {
        //根据库位号找寻库位
        LocMast locMast = locMastService.selectById(param.getLocNo());
        //判断
        if (Cools.isEmpty(locMast)) {
            throw new CoolException("库位不存在");
        }
        //查询库位状态
        if (locMast.getLocSts().equals("O")){
            //更新库位状态
            locMast.setLocSts("F");
//            boolean b = locMastService.updateById(locMast);
            if (!locMastService.updateById(locMast)){
                throw new CoolException("更新库位状态失败");
            }
        }
        for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) {
            if (Cools.isEmpty(adjust.getMatNo())) {
                throw new CoolException(BaseRes.PARAM);
@@ -571,6 +612,7 @@
                locDetl.setModiTime(new Date());
                locDetl.setAppeUser(userId);
                locDetl.setAppeTime(new Date());
                locDetl.setZpallet(param.getZpallet());//托盘号
                if (!locDetlService.insert(locDetl)) {
                    throw new CoolException("保存库存明细失败");
                }