jiazx0107@163.com
2023-06-08 08cea428e888b6fdd2a3c3783e87e4f828385783
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
@@ -1,15 +1,14 @@
package com.ld.igds.inout.manager;
import com.ld.igds.constant.Constant;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.service.InoutService;
import com.ld.igds.io.dto.WeightDto;
import com.ld.igds.m.service.InoutCommonService;
import com.ld.igds.models.DicTrigger;
import com.ld.igds.models.InoutConf;
import com.ld.igds.models.InoutSysConf;
import com.ld.igds.sys.service.DicTriggerService;
import com.ld.igds.util.ContextUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -76,7 +75,7 @@
     * @return 车牌设备配置,没有则返回NULL
     */
    public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type, String inoutProgress, int inOrder) {
        if (null == listInoutConf) return null;
        if (null == listInoutConf) return new InoutConf(sort);
        if (StringUtils.isEmpty(sort)) sort = "1";
        InoutConf result = null;
@@ -89,9 +88,32 @@
            }
        }
        if (null == result) return null;
        if (null == result) return new InoutConf(sort);
        return result;
    }
    public List<InoutConf> getInoutConf(List<InoutConf> listInoutConf, String type) {
        List<InoutConf> result = new ArrayList<>();
        if (null == listInoutConf) return result;
        for (InoutConf conf : listInoutConf) {
            if (type.equals(conf.getType())) {
                result.add(conf);
            }
        }
        return result;
    }
    public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type) {
        if (null == listInoutConf) return new InoutConf(sort);
        if (StringUtils.isEmpty(sort)) sort = "1";
        for (InoutConf conf : listInoutConf) {
            if (sort.equals(conf.getSort()) && type.equals(conf.getType())) {
                return conf;
            }
        }
        return new InoutConf(sort);
    }
@@ -116,34 +138,13 @@
    public String getWeightEditTag(String companyId, String deptId) {
        // 从缓存中获取出入库系统配置信息
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(companyId, deptId);
        String weightEditTag = null;
        String weightEditTag = Constant.YN_N;
        if (inoutSysConf != null) {
            weightEditTag = inoutSysConf.getWeightEditTag();
        }
        if (null == weightEditTag) weightEditTag = Constant.YN_N;
        return weightEditTag;
    }
    public List<WeightDto> getInoutWeightAll(List<InoutConf> listInoutConf, String type) {
        List<WeightDto> result = new ArrayList<>();
        if (null == listInoutConf) return result;
        for (InoutConf conf : listInoutConf) {
            if (type.equals(conf.getType())) {
                result.add(new WeightDto(conf));
            }
        }
        return result;
    }
    public WeightDto getInoutCurWeight(List<WeightDto> listWeight, String sort) {
        if (null == listWeight || listWeight.isEmpty()) return new WeightDto();
        if (listWeight.size() == 1) return listWeight.get(0);
        for (WeightDto weight : listWeight) {
            if (weight.getSort().equals(sort)) return weight;
        }
        return new WeightDto();
    }
@@ -152,10 +153,10 @@
     *
     * @param deptId
     */
    public void initInoutScreen(String deptId) {
        if (StringUtils.isEmpty(deptId))
            deptId = ContextUtil.subDeptId(null);
        inoutService.initInoutScreen(deptId);
    public void initInoutScreen(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) return;
        if (StringUtils.isEmpty(deptId)) return;
        inoutService.notifyToScreen(companyId, deptId, null);
    }
    public List<InoutData> getListInoutCache(String deptId) {