自动化立体仓库 - WMS系统
dubin
2025-12-19 b00eeab31bd13ba34a03301aa441b0751d6a93e4
src/main/java/com/zy/ints/controller/WaitMatchkController.java
@@ -18,7 +18,9 @@
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.MatCodeService;
import com.zy.common.web.BaseController;
import com.zy.ints.entity.IoComplete;
import com.zy.ints.entity.WaitMatchk;
import com.zy.ints.service.IoCompleteService;
import com.zy.ints.service.WaitMatchkLogService;
import com.zy.ints.service.WaitMatchkService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +42,8 @@
    private LocDetlService locDetlService;
    @Autowired
    private MatCodeService matCodeService;
    @Autowired
    private IoCompleteService ioCompleteService;
    //盘点通知档
@@ -143,11 +147,59 @@
                        if(!locDetlService.delete(wrapperDetl)){
                            throw new CoolException("删除数量为0明细出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
                        }
                        //盘点结果插入回报档
                        IoComplete ioComplete = new IoComplete();
                        ioComplete.setBillNo(entity.getBillNo());
                        ioComplete.setSeqNo(entity.getSeqNo());
                        ioComplete.setTaskType(4);  //盘亏
                        ioComplete.setLocNo(entity.getLocNo());
                        ioComplete.setMatNo(entity.getMatNo());
                        ioComplete.setMatName(locDetl.getMatName());
                        ioComplete.setZpallet(locDetl.getZpallet());
                        ioComplete.setQty(locDetl.getQty());
                        ioComplete.setUpdStatus(0);
                        ioComplete.setModiUser(getUserId());
                        ioComplete.setModiTime(now);
                        ioComplete.setAppeUser(getUserId());
                        ioComplete.setAppeTime(now);
                        if(!ioCompleteService.insert(ioComplete)){
                            throw new CoolException("插入回报档出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
                        }
                    }else{
                        if(!entity.getCheckQty().equals(locDetl.getQty())){ //库存数量与盘点数量相同不用更新
                            locDetl.setQty(entity.getCheckQty());
                            if(!locDetlService.update(locDetl,wrapperDetl)){
                                throw new CoolException("更新库存明细出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
                            }
                            //盘点结果插入回报档
                            Double qty = 0D;
                            int type = 0;
                            if(entity.getCheckQty()>locDetl.getQty()){//盘盈
                                qty = entity.getCheckQty() - locDetl.getQty();
                                type = 3;
                            } else { //盘亏
                                qty = locDetl.getQty() - entity.getCheckQty();
                                type = 4;
                            }
                            IoComplete ioComplete = new IoComplete();
                            ioComplete.setBillNo(entity.getBillNo());
                            ioComplete.setSeqNo(entity.getSeqNo());
                            ioComplete.setTaskType(type);
                            ioComplete.setLocNo(entity.getLocNo());
                            ioComplete.setMatNo(entity.getMatNo());
                            ioComplete.setMatName(locDetl.getMatName());
                            ioComplete.setZpallet(locDetl.getZpallet());
                            ioComplete.setQty(qty);
                            ioComplete.setUpdStatus(0);
                            ioComplete.setModiUser(getUserId());
                            ioComplete.setModiTime(now);
                            ioComplete.setAppeUser(getUserId());
                            ioComplete.setAppeTime(now);
                            if(!ioCompleteService.insert(ioComplete)){
                                throw new CoolException("插入回报档出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
                            }
                        }
@@ -180,6 +232,25 @@
                    if(!locDetlService.insert(one)){
                        throw new CoolException("插入库存明细出错[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]");
                    }
                    //盘点结果插入回报档
                    IoComplete ioComplete = new IoComplete();
                    ioComplete.setBillNo(entity.getBillNo());
                    ioComplete.setSeqNo(entity.getSeqNo());
                    ioComplete.setTaskType(3);  //盘盈
                    ioComplete.setLocNo(entity.getLocNo());
                    ioComplete.setMatNo(entity.getMatNo());
                    ioComplete.setMatName(one.getMatName());
                    ioComplete.setZpallet(one.getZpallet());
                    ioComplete.setQty(entity.getCheckQty());
                    ioComplete.setUpdStatus(0);
                    ioComplete.setModiUser(getUserId());
                    ioComplete.setModiTime(now);
                    ioComplete.setAppeUser(getUserId());
                    ioComplete.setAppeTime(now);
                    if(!ioCompleteService.insert(ioComplete)){
                        throw new CoolException("插入回报档出错[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]");
                    }
                }
                entity.setVerifyStatus(1);