czt
2023-06-12 d9e1a4fe6e51958c4571efe2ced4d4172ed385db
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -16,6 +16,7 @@
import com.ld.igds.m.service.InoutCommonService;
import com.ld.igds.models.Depot;
import com.ld.igds.models.InoutConf;
import com.ld.igds.models.InoutPrice;
import com.ld.igds.models.InoutSysConf;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
@@ -450,12 +451,18 @@
            data.setProgress(nextProgress);
        }
        if (InoutConstant.PROGRESS_CHECK.equals(data.getProgress())) {
            data.setCheckUser(ContextUtil.getLoginUserCName());
            data.setProgress(nextProgress);
            return data;
        }
        if (InoutConstant.PROGRESS_WEIGHT_EMPTY.equals(curProgress)) {
            data.setEmptyWeightTime(new Date());
            data.setEmptyWeightUser(ContextUtil.getLoginUserCName());
            data.setProgress(nextProgress);
        }
        if (InoutConstant.PROGRESS_WEIGHT_FULL.equals(curProgress)) {
            data.setFullWeightTime(new Date());
            data.setFullWeightUser(ContextUtil.getLoginUserCName());
@@ -469,14 +476,12 @@
            data.setProgress(nextProgress);
        }
        //如果下一个数据状态=流程结束,直接补充完整信息
        if (InoutConstant.PROGRESS_RECORD.equals(nextProgress)) {
            data.setCompleteTime(DateUtils.addMinutes(new Date(), 2));
            data.setCompleteUser(ContextUtil.getLoginUserCName());
            data.setProgress(nextProgress);
        }
        return data;
    }
@@ -498,6 +503,14 @@
            return data;
        }
        if (InoutConstant.PROGRESS_CHECK.equals(data.getProgress())) {
            data.setCheckUser(ContextUtil.getLoginUserCName());
            data.setProgress(getNextProgress(data.getProgress(),
                    data.getType(), sysConf));
            return data;
        }
        if (InoutConstant.PROGRESS_WEIGHT_EMPTY.equals(data.getProgress())) {
            data.setEmptyWeightTime(new Date());
            data.setEmptyWeightUser(ContextUtil.getLoginUserCName());
@@ -1217,7 +1230,7 @@
            //更新化验项信息
            CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
            if (null == checkResult || null != checkResult.getMsg()) {
            if (StringUtils.isNotEmpty(checkResult.getMsg())) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "后台执行异常:" + checkResult.getMsg(), data);
            }
@@ -1233,17 +1246,25 @@
                data.setCheckTime(new Date());
            }
            curData.setCheckStatus(data.getCheckStatus());
            //获取系统参数配置
            InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
            if (null == inoutSysConf) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "提示:当前库区未配置出入库流程信息,请联系管理员", data);
            }
            //更新下一流程状态
            if (InoutConstant.PROGRESS_CHECK.equals(curData.getProgress())) {
                curData = updateBasicInfo(curData, null);
                curData = updateBasicInfo(curData, inoutSysConf);
                // 若化验结果不合格,判断配置后续流程
                if (InoutConstant.STATUS_UNPASS.equals(curData.getCheckStatus())) {
                    curData = checkNoPass(curData);
                }
            }
            data.setCheckStatus(curData.getCheckStatus());
            //化验人、化验时间
            data.setCheckStatus(curData.getCheckStatus());
            data.setProgress(curData.getProgress());
            if (StringUtils.isEmpty(data.getCheckUser())) {
                data.setCheckUser(ContextUtil.getLoginUserCName());
            }
@@ -1262,4 +1283,25 @@
                    "后台异常:" + e.getMessage(), null);
        }
    }
    /**
     * 获取单价信息
     *
     * @param param
     * @return
     */
    public PageResponse<InoutPrice> getPrice(InoutCheckParam param) {
        try {
            List<InoutPrice> price = inoutService.getPrice(param);
            if(null == price || price.isEmpty()){
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "未获取到粮食定价配置信息");
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000, price.get(0));
        } catch (Exception e) {
            return new PageResponse<>(
                    RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null);
        }
    }
}