自动化立体仓库 - WMS系统
zyx
2023-11-09 98b1835a279fd8c9ed2a21fae3501f24c470c39b
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java
@@ -19,6 +19,7 @@
import com.zy.asrs.utils.SaasUtils;
import com.zy.common.model.LocDto;
import com.zy.system.entity.User;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -155,6 +156,12 @@
        Date now = new Date();
        for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) {
            ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch());
            if(Cools.isEmpty(manLocDetl)){
                addManlocDetl(locDetlAdjust,param.getLocNo());
                continue;
            }
            this.baseMapper.delete(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", param.getLocNo()).eq("matnr",locDetlAdjust.getMatnr()));
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
@@ -236,4 +243,23 @@
        }
    }
    private void addManlocDetl(LocDetlAdjustParam.LocDetlAdjust param, String locNo){
        Date now = new Date();
        ManLocDetl manLocDetl = new ManLocDetl();
        Node node = nodeService.selectOne(new EntityWrapper<Node>().eq("name", locNo));
        Mat mat = matService.selectByMatnr(param.getMatnr());
        BeanUtils.copyProperties(mat,manLocDetl);
        manLocDetl.setNodeId(node.getId());
        manLocDetl.setBatch(param.getBatch());
        manLocDetl.setAnfme(param.getCount());
        manLocDetl.setContainerCode(param.getSuppCode());
        manLocDetl.setCsocode(param.getThreeCode());
        manLocDetl.setIsoseq(param.getDeadTime());
        manLocDetl.setCreateTime(now);
        manLocDetl.setModiTime(now);
        manLocDetl.setLocNo(locNo);
        manLocDetl.setStatus(1);
        this.insert(manLocDetl);
    }
}