| | |
| | | data.setCheckTime(new Date()); |
| | | } |
| | | curData.setCheckStatus(data.getCheckStatus()); |
| | | curData.setFoodYear(data.getFoodYear()); |
| | | |
| | | |
| | | // 获取下一个流程状态 |
| | |
| | | curData.setPrice(data.getPrice()); |
| | | curData.setRemarks(data.getRemarks()); |
| | | curData.setCheckItems(data.getCheckItems()); |
| | | curData.setCheckTime(data.getCheckTime()); |
| | | |
| | | if (StringUtils.isEmpty(data.getCheckUser())) { |
| | | curData.setCheckUser(ContextUtil.getLoginUserCName()); |
| | |
| | | |
| | | |
| | | // 质检完成触发事件 |
| | | inoutEventControl.onInCheck(data,curProgress,nextProgress); |
| | | inoutEventControl.onInCheck(data, curProgress, nextProgress); |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功"); |
| | | } |
| | | |
| | | public PageResponse<InoutCheckData> submitCheckData(InoutCheckData data) throws Exception { |
| | | |
| | | |
| | | // 获取业务数据信息 |
| | | InoutParam param = new InoutParam(); |
| | | param.setCompanyId(data.getCompanyId()); |
| | | param.setId(data.getId()); |
| | | InoutData curData = inoutService.inoutProgressQuery(param); |
| | | |
| | | if (null == curData) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "没有获取到入库业务数据信息,更新失败", data); |
| | | } |
| | | |
| | | if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "当前流程已经结束,不支持修改"); |
| | | } |
| | | |
| | | // 更新化验项信息 |
| | | CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems()); |
| | | if (StringUtils.isNotEmpty(checkResult.getMsg())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "后台执行异常:" + checkResult.getMsg(), data); |
| | | } |
| | | |
| | | curData.setType(curData.getType()); |
| | | curData.setFoodLevel(data.getFoodLevel()); |
| | | curData.setFoodVariety(data.getFoodVariety()); |
| | | curData.setPrice(data.getPrice()); |
| | | curData.setDepotId(data.getDepotId()); |
| | | curData.setCheckItems(data.getCheckItems()); |
| | | |
| | | String msg = inoutService.updateCheckData(curData); |
| | | if (null != msg) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "保存成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<InoutCheckData> inoutDataByCheckId(InoutCheckParam param) { |
| | | if (StringUtils.isEmpty(param.getCheckId())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), |
| | | "查询参数不完整,查询失败!"); |
| | | } |
| | | |
| | | InoutCheckData result; |
| | | try { |
| | | param.setProgress(InoutConstant.PROGRESS_CHECK); |
| | | result = inoutService.inoutDataByCheckId(param); |
| | | if (null == result) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | "系统未查询到执行中的车辆信息", null); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, result); |
| | | |
| | | } catch (Exception e) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | public void initInoutWeight(List<InoutConf> listInoutConf, String sort) { |
| | | inoutEventControl.initInoutWeight(listInoutConf, sort); |
| | | } |
| | | |
| | | } |