自动化立体仓库 - WMS系统
pang.jiabao
3 天以前 17080b28dc3fb0df12a5a4da76e10dd9203e5725
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java
@@ -12,18 +12,15 @@
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.MatnrDto;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.asrs.entity.result.Pakin;
import com.zy.asrs.mapper.NodeMapper;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.utils.SaasUtils;
import com.zy.asrs.utils.VersionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.beans.Transient;
import java.util.Date;
import java.util.List;
@@ -70,12 +67,12 @@
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type));
        return selectOne(new EntityWrapper<Node>().isNull("host_id").eq("uuid", uuid).eq("type", type));
    }
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type).eq("parent_id", parentId));
        return selectOne(new EntityWrapper<Node>().isNull("host_id").eq("uuid", uuid).eq("type", type).eq("parent_id", parentId));
    }
    @Override
@@ -115,7 +112,7 @@
                manLocDetl.setCreateTime(now);
                manLocDetl.setModiTime(now);
                manLocDetl.setCreateBy(userId);
                SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme());
                SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),userId, manLocDetl.getBatch());
                manLocDetlService.insert(manLocDetl);
            }else {
                check.setAnfme(dto.getCount() + check.getAnfme());
@@ -149,17 +146,22 @@
                if (manLocDetl.getAnfme() - param.getCount() < 0) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足");
                } else if (manLocDetl.getAnfme() - param.getCount() == 0) {
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount());
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),userId,manLocDetl.getBatch());
                    manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                    // 清空库位条码
                    node.setBarcode("");
                    node.setUpdateBy(userId);
                    node.setUpdateTime(now);
                    nodeService.updateById(node);
                } else {
                    manLocDetl.setAnfme(manLocDetl.getAnfme() - param.getCount());
                    manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount());
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),userId,manLocDetl.getBatch());
                }
            }
        }
@@ -187,7 +189,7 @@
                source.setLocNo(targetNode.getUuid());
                source.setNodeId(targetNode.getId());
                SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme());
                SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),userId,source.getBatch());
                manLocDetlService.insert(source);
            }else {
                check.setAnfme(check.getAnfme() + source.getAnfme());