自动化立体仓库 - WMS系统
zyx
2023-11-24 c37ae85eab15d2c7566677bfb26920c31da879fe
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;
@@ -131,8 +132,8 @@
    @Override
    public ManLocDetl selectItem(String locNo, String matnr, String batch) {
        return this.baseMapper.selectItem(locNo, matnr, batch);
    public ManLocDetl selectItem(String locNo, String matnr, String batch, String csocode, String isoseq, String containerCode) {
        return this.baseMapper.selectItem(locNo, matnr, batch,csocode,isoseq,containerCode);
    }
    @Override
@@ -154,7 +155,13 @@
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user) {
        Date now = new Date();
        for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) {
            ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch());
            ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch(),locDetlAdjust.getThreeCode(),locDetlAdjust.getDeadTime(),locDetlAdjust.getSuppCode());
            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);
    }
}