jiazx0107@163.com
2023-05-31 7a7ccfd74dbdff086d2aabe5117ec1dc6f804d91
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -56,7 +56,7 @@
    private InoutDeviceManager inoutDeviceManager;
    /**
     * 当前先从当日缓存中获取数据,如果缓存中没有再从数据库获取
     * 首先从缓存中获取,缓存中,从数据库中获取
     *
     * @param param
     * @return
@@ -67,22 +67,17 @@
                && StringUtils.isEmpty(param.getUserId())) {
            return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
                    "参数不完整,无法获取信息!");
        }
        if (StringUtils.isEmpty(param.getCompanyId())) {
            param.setCompanyId(ContextUtil.getCompanyId());
                    "查询参数不完整,查询失败!");
        }
        InoutData result;
        String progress = param.getProgress();
        try {
            param.setProgress(null);
            result = inoutService.inoutProgressQuery(param);
            if (null == result) {
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                        "未找到流程中的车辆!", null);
                        "系统为查询到执行中的车辆信息", null);
            }
            // 如果没有流程条件说明不需要做判断,直接返回
@@ -90,17 +85,16 @@
                return new PageResponse<>(RespCodeEnum.CODE_0000, result);
            }
            //流程类型验证
            if (!result.getType().equals(param.getType())) {
                if (InoutConstant.TYPE_IN.equals(result.getType())) {
                    return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                            "系统:当前车辆业务为【入库】", result);
                } else {
                    return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                            "系统:当前车辆业务为【出库】", result);
                }
                String msg = "流程错误:当前车辆流程为【入库】";
                if (InoutConstant.TYPE_OUT.equals(result.getType())) msg = "流程错误:当前车辆流程为【出库】";
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), msg, result);
            }
            // 当前标签标示既可以是空车称重也可以是满车
            //流程环节验证
            if (progress.equals(InoutConstant.PROGRESS_WEIGHT_TAG)) {
                if (result.getProgress().equals(
                        InoutConstant.PROGRESS_WEIGHT_EMPTY)
@@ -109,7 +103,7 @@
                    // 表示当前流程正常
                } else {
                    return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                            "非当前流程,请到"
                            "提示:非当前环节,请到"
                                    + InoutConstant.getProcessName(
                                    param.getType(),
                                    result.getProgress()), result);
@@ -117,33 +111,10 @@
            } else {
                if (!result.getProgress().equals(progress)) {
                    return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                            "非当前流程,请到"
                            "提示:非当前环节,请到"
                                    + InoutConstant.getProcessName(
                                    param.getType(),
                                    result.getProgress()), result);
                }
            }
            // 根据当前数据判断是否推送
            inoutService.notifyWeb(result);
            //为当前数据添加化验项目和水分和杂质的化验结果,用于出入库增扣重计算
            if (InoutConstant.TYPE_IN.equals(result.getType())) {
                List<CheckItemData> checkItemDataList = inoutService.getCheckCache(result.getCompanyId(), result.getCheckId());
                result.setCheckItems(checkItemDataList);
                if (null != checkItemDataList && checkItemDataList.size() > 0) {
                    for (CheckItemData checkItem : checkItemDataList) {
                        if (StringUtils.isEmpty(checkItem.getValue())) {
                            continue;
                        }
//                  if (InoutConstant.CHECK_ITEM_C01.equals(checkItem.getStandardId())) {
//                     result.setWet(Double.valueOf(checkItem.getValue()));
//                  }
//                  if (InoutConstant.CHECK_ITEM_C02.equals(checkItem.getStandardId())) {
//                     result.setImpurity(Double.valueOf(checkItem.getValue()));
//                  }
                    }
                }
            }
@@ -1106,6 +1077,7 @@
    /**
     * 根据条件获取扦样数据
     *
     * @param param
     * @return
     */