自动化立体仓库 - WMS系统
zhang
昨天 8d90833250abee5951572659e9a192f2487cd704
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;
@@ -37,6 +34,7 @@
    private SnowflakeIdWorker snowflakeIdWorker;
    @Autowired
    private ManLocDetlService manLocDetlService;
    @Override
    public Node getTop() {
        Node top = this.selectOne(new EntityWrapper<Node>().eq("type", 0).eq("level", 0));
@@ -115,11 +113,11 @@
                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());
                manLocDetlService.insert(manLocDetl);
            }else {
            } else {
                check.setAnfme(dto.getCount() + check.getAnfme());
                manLocDetlService.update(check,new EntityWrapper<ManLocDetl>()
                manLocDetlService.update(check, new EntityWrapper<ManLocDetl>()
                        .eq("loc_no", node.getUuid())
                        .eq("matnr", dto.getMatnr()));
            }
@@ -141,25 +139,25 @@
                Node node = nodeService.selectOne(new EntityWrapper<Node>()
                        .eq("id", param.getNodeId()));
                if (node == null) {
                    return R.error("找不到该库位,请联系管理员:" + param.getNodeId() );
                    return R.error("找不到该库位,请联系管理员:" + param.getNodeId());
                }
                if (manLocDetl == null) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中不存在");
                    return R.error("物料:" + param.getMatnr() + " 在库位中不存在");
                }
                if (manLocDetl.getAnfme() - param.getCount() < 0) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足");
                    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());
                    manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                            .eq("loc_no", node.getUuid())
                            .eq("matnr", param.getMatnr()));
                } 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());
                    manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>()
                            .eq("loc_no", node.getUuid())
                            .eq("matnr", param.getMatnr()));
                    SaasUtils.insertLog(1, manLocDetl.getLocNo(), manLocDetl.getMatnr(), param.getCount());
                }
            }
        }
@@ -187,11 +185,11 @@
                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());
                manLocDetlService.insert(source);
            }else {
            } else {
                check.setAnfme(check.getAnfme() + source.getAnfme());
                manLocDetlService.update(check,new EntityWrapper<ManLocDetl>()
                manLocDetlService.update(check, new EntityWrapper<ManLocDetl>()
                        .eq("loc_no", targetNode.getUuid())
                        .eq("matnr", check.getMatnr()));
                manLocDetlService.delete(new EntityWrapper<ManLocDetl>()