jiazx0107@163.com
2023-06-29 f46a102b5f5ab7e2c74c9d05f9d6e06c358b8c02
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -199,9 +199,12 @@
     * @param data
     * @return
     */
    private InoutData updateCheckItems(InoutData data) throws Exception {
    private InoutData updateCheckItems(InoutData data, boolean toSave) throws Exception {
        if (null == data.getCheckItems()) return data;
        //设置没有质检ID,取消执行持久化
        if (!toSave) data.setCheckId(null);
        // 更新检验项数据
        CheckUpdateResult checkUpdateResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
@@ -321,7 +324,7 @@
        param.setIntelCard(data.getIntelCard());
        param.setUserId(data.getCompleteUser());
        param.setDepotId(data.getDepotId());
        param.setCompleteTime(data.getCompleteTime());
        param.setCompleteTime(new Date());
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        String msg = inoutService.toComplete(param);
@@ -424,7 +427,7 @@
                data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -10));
            }
            data = this.updateCheckItems(data);
            data = this.updateCheckItems(data, false);
        } else {
            if (null == data.getEmptyWeightTime()) {
                data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -50));
@@ -434,8 +437,15 @@
            }
        }
        // 添加补单数据
        return inoutService.insertData(data);
        //先保存主表,后执行子表
        inoutService.insertData(data);
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            this.updateCheckItems(data, true);
        }
        return null;
    }
    /**
@@ -459,7 +469,7 @@
        // 保存检测项目
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            data = updateCheckItems(data);
            data = updateCheckItems(data, true);
        }
        return inoutService.updateData(data);
@@ -621,7 +631,7 @@
        data = updateBasicInfo(data, curProgress, nextProgress);
        // 入库称重可能调整质检单
        data = updateCheckItems(data);
        data = updateCheckItems(data, true);
        // 执行数据更新
        String msg = inoutService.updateData(data);
@@ -685,8 +695,7 @@
        }
        // 获取系统参数配置
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(
                data.getCompanyId(), data.getDeptId());
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "提示:当前系统中流程配置异常,请联系管理员", data);
@@ -694,24 +703,20 @@
        // 获取下一个流程状态
        String curProgress = data.getProgress();
        String nextProgress = getNextProgress(curProgress, data.getType(),
                inoutSysConf);
        String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
        data = updateBasicInfo(data, curProgress, nextProgress);
        // 执行数据更新
        String msg = inoutService.updateDataByHandle(data);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg,
                    data);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
        }
        // 执行附件信息
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(),
                data.getId(), curProgress);
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功",
                data);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
    }
    /**
@@ -843,6 +848,11 @@
        curData.setProgress(curData.getProgress());
        curData.setType(curData.getType());
        curData.setFoodLevel(data.getFoodLevel());
        curData.setFoodVariety(data.getFoodVariety());
        curData.setPrice(data.getPrice());
        curData.setRemarks(data.getRemarks());
        curData.setCheckItems(data.getCheckItems());
        if (StringUtils.isEmpty(data.getCheckUser())) {
            curData.setCheckUser(ContextUtil.getLoginUserCName());