igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java
@@ -64,19 +64,16 @@ item.setUpperLimit(0.0); } if (item.getDeNum() > 0) { if (null != item.getDeNum() && item.getDeNum() > 0) { result.setDeSum(result.getDeSum() + item.getDeNum()); } if (item.getAddNum() > 0) { if (null != item.getAddNum() && item.getAddNum() > 0) { result.setAddSum(result.getAddSum() + item.getAddNum()); } if (item.getAddPrice() > 0) { if (null != item.getAddPrice() && item.getAddPrice() > 0) { result.setAddPriceSum(result.getAddPriceSum() + item.getAddPrice()); } if (item.getDePrice() > 0) { if (null != item.getDePrice() && item.getDePrice() > 0) { result.setDePriceSum(result.getDePriceSum() + item.getDePrice()); } igds-core/src/main/java/com/ld/igds/check/dto/CheckItemData.java
@@ -1,6 +1,5 @@ package com.ld.igds.check.dto; import com.ld.igds.models.CheckItem; import lombok.Data; import lombok.EqualsAndHashCode; @@ -22,4 +21,8 @@ */ private static final long serialVersionUID = -570067528303737321L; //运算符号值,只做页面显示用 private String operaSymbolValue; } igds-core/src/main/java/com/ld/igds/check/service/impl/CoreCheckStandardServiceImpl.java
@@ -9,7 +9,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.ArrayList; import java.util.List; @@ -39,7 +38,13 @@ @Override public List<CheckItemData> getCheckItemById(String checkId, String companyId) { return checkStandardMapper.getCheckItemById(checkId, companyId); List<CheckItemData> result = checkStandardMapper.getCheckItemById(checkId, companyId); for (CheckItemData data : result) { if (data.getUpperLimit() > 0.0 && StringUtils.isNotEmpty(data.getOperaSymbol())) { data.setOperaSymbolValue(data.getOperaSymbol() + " " + data.getUpperLimit()); } } return result; } @Override @@ -65,7 +70,7 @@ item.setCheckId(checkId); if (data.getUpperLimit() > 0.0 && StringUtils.isNotEmpty(data.getOperaSymbol())) { item.setOperaSymbol(data.getOperaSymbol() + " " + data.getUpperLimit()); item.setOperaSymbolValue(data.getOperaSymbol() + " " + data.getUpperLimit()); } result.add(item); } igds-core/src/main/resources/mapper/CheckStandardMapper.xml
@@ -15,17 +15,20 @@ STANDARD_NAME_, UNIT_, UPPER_LIMIT_, OPERA_SYMBOL_, RULE_NUM_, RULE_ADD_, RULE_ADD_END_, RULE_REDUCE_, STANDARD_VALUE_, VALUE_, STANDARD_PRICE_, RULE_PRICE_, RULE_REDUCE_PRICE_, REMARKS_, OPERA_SYMBOL_ ADD_NUM_, DE_NUM_, ADD_PRICE_, DE_PRICE_, RESULT_, REMARKS_ )values ( #{data.companyId}, #{data.checkId}, @@ -33,17 +36,20 @@ #{data.standardName}, #{data.unit}, #{data.upperLimit}, #{data.operaSymbol}, #{data.ruleNum}, #{data.ruleAdd}, #{data.ruleAddEnd}, #{data.ruleReduce}, #{data.standardValue}, #{data.value}, #{data.standardPrice}, #{data.rulePrice}, #{data.ruleReducePrice}, #{data.remarks}, #{data.operaSymbol} #{data.addNum}, #{data.deNum}, #{data.addPrice}, #{data.dePrice}, #{data.result}, #{data.remarks} ) </insert> @@ -53,7 +59,6 @@ <set> <if test="data.standardName != null and data.standardName != '' ">STANDARD_NAME_ = #{data.standardName},</if> <if test="data.upperLimit != null and data.upperLimit != '' ">UPPER_LIMIT_ = #{data.upperLimit},</if> <!-- <if test="data.lowerLimit != null and data.lowerLimit != '' ">LOWER_LIMIT_ = #{data.lowerLimit},</if>--> <if test="data.unit != null and data.unit != '' ">UNIT_ = #{data.unit},</if> <if test="data.value != null and data.value != '' ">VALUE_ = #{data.value},</if> <if test="data.remarks != null and data.remarks != '' ">REMARKS_ = #{data.remarks},</if> igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
@@ -649,22 +649,22 @@ return inoutManager.inoutBack(data); } /** * 化验页面数据提交 * * @param data * @return */ @RequestMapping("/update-check") public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) { try { return inoutManager.updateCheck(data); } catch (Exception e) { log.error("后台异常:{}", e); return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null); } } // /** // * 化验页面数据提交 // * // * @param data // * @return // */ // @RequestMapping("/update-check") // public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) { // try { // return inoutManager.updateCheck(data); // } catch (Exception e) { // log.error("后台异常:{}", e); // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), // "后台异常:" + e.getMessage(), null); // } // } /** * 根据卡号和类型,直接完成当前流程 @@ -861,7 +861,7 @@ * @param data * @return */ @RequestMapping("/update-check1") @RequestMapping("/update-check") public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) { return inoutManager.updateCheckData(data); igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -283,84 +283,84 @@ return inoutService.inoutProgressQuery(param); } @Transactional(rollbackFor = Exception.class) public PageResponse<InoutData> updateCheck(InoutData data) throws Exception { if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "当前流程已经结束,不支持修改", data); } CheckUpdateResult checkResult = this.updateCheckItems(data); String tag = checkResult.getMsg(); if (null != tag) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "后台执行异常:" + tag, data); } // 获取业务数据信息 InoutParam param = new InoutParam(); param.setCompanyId(data.getCompanyId()); param.setId(data.getId()); InoutData progressData = inoutService.inoutProgressQuery(param); if (null == progressData) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "没有获取到出入库业务数据信息,更新失败", data); } if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "当前流程已经结束,不支持修改"); } progressData.setCheckStatus(data.getCheckStatus()); // 更新下一个状态和基本信息 if (InoutConstant.PROGRESS_CHECK.equals(progressData.getProgress())) { progressData = updateBasicInfo(progressData, null); // 若化验结果不合格,判断配置后续流程 if (InoutConstant.STATUS_UNPASS.equals(progressData .getCheckStatus())) { progressData = checkNoPass(progressData); } } progressData.setCheckUser(ContextUtil.getLoginUserCName()); if (StringUtils.isNotEmpty(data.getDepotId())) { progressData.setDepotId(data.getDepotId()); } if (StringUtils.isNotEmpty(data.getFoodVariety())) { progressData.setFoodVariety(data.getFoodVariety()); } if (StringUtils.isNotEmpty(data.getFoodLevel())) { progressData.setFoodLevel(data.getFoodLevel()); } if (StringUtils.isNotEmpty(data.getFoodLocation())) { progressData.setFoodLocation(data.getFoodLocation()); } if (StringUtils.isNotEmpty(data.getFoodYear())) { progressData.setFoodYear(data.getFoodYear()); } if (null != data.getPrice()) { progressData.setPrice(data.getPrice()); } if (StringUtils.isNotEmpty(data.getRemarks())) { progressData.setRemarks(data.getRemarks()); } if (StringUtils.isNotEmpty(data.getNoticeId())) { progressData.setNoticeId(data.getNoticeId()); } String msg = inoutService.updateData(progressData); if (null != msg) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); } if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) { inoutComplete(progressData); } return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功"); } // @Transactional(rollbackFor = Exception.class) // public PageResponse<InoutData> updateCheck(InoutData data) throws Exception { // // if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) { // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), // "当前流程已经结束,不支持修改", data); // } // // CheckUpdateResult checkResult = this.updateCheckItems(data); // String tag = checkResult.getMsg(); // // if (null != tag) { // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), // "后台执行异常:" + tag, data); // } // // // 获取业务数据信息 // InoutParam param = new InoutParam(); // param.setCompanyId(data.getCompanyId()); // param.setId(data.getId()); // InoutData progressData = inoutService.inoutProgressQuery(param); // if (null == progressData) { // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), // "没有获取到出入库业务数据信息,更新失败", data); // } // if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) { // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), // "当前流程已经结束,不支持修改"); // } // progressData.setCheckStatus(data.getCheckStatus()); // // // 更新下一个状态和基本信息 // if (InoutConstant.PROGRESS_CHECK.equals(progressData.getProgress())) { // progressData = updateBasicInfo(progressData, null); // // 若化验结果不合格,判断配置后续流程 // if (InoutConstant.STATUS_UNPASS.equals(progressData // .getCheckStatus())) { // progressData = checkNoPass(progressData); // } // } // progressData.setCheckUser(ContextUtil.getLoginUserCName()); // // if (StringUtils.isNotEmpty(data.getDepotId())) { // progressData.setDepotId(data.getDepotId()); // } // if (StringUtils.isNotEmpty(data.getFoodVariety())) { // progressData.setFoodVariety(data.getFoodVariety()); // } // if (StringUtils.isNotEmpty(data.getFoodLevel())) { // progressData.setFoodLevel(data.getFoodLevel()); // } // if (StringUtils.isNotEmpty(data.getFoodLocation())) { // progressData.setFoodLocation(data.getFoodLocation()); // } // if (StringUtils.isNotEmpty(data.getFoodYear())) { // progressData.setFoodYear(data.getFoodYear()); // } // if (null != data.getPrice()) { // progressData.setPrice(data.getPrice()); // } // if (StringUtils.isNotEmpty(data.getRemarks())) { // progressData.setRemarks(data.getRemarks()); // } // if (StringUtils.isNotEmpty(data.getNoticeId())) { // progressData.setNoticeId(data.getNoticeId()); // } // // String msg = inoutService.updateData(progressData); // // if (null != msg) { // return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); // } // if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) { // // inoutComplete(progressData); // } // return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功"); // } /** * 化验结果不通过时校验配置信息 @@ -1214,8 +1214,25 @@ return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "当前流程已经结束,不支持修改"); } curData.setCheckStatus(data.getCheckStatus()); //更新化验项信息 CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems()); if (null == checkResult || null != checkResult.getMsg()) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "后台执行异常:" + checkResult.getMsg(), data); } //设置化验信息 if (checkResult.getDeSum() > 0) { data.setDeCheck(checkResult.getDeSum()); } if (checkResult.getAddSum() > 0) { data.setAddCheck(checkResult.getAddSum()); } if (null == data.getCheckTime()) { data.setCheckTime(new Date()); } curData.setCheckStatus(data.getCheckStatus()); //更新下一流程状态 if (InoutConstant.PROGRESS_CHECK.equals(curData.getProgress())) { curData = updateBasicInfo(curData, null); @@ -1235,11 +1252,9 @@ } String msg = inoutService.updateCheckData(data); if (null != msg) { return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); } //TODO 更新化验项信息 return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功"); } catch (Exception e) { igds-inout/src/main/resources/mapper/InoutCheckMapper.xml
@@ -69,6 +69,8 @@ REGISTER_USER_ as registerUser, DEPOT_ID_ as depotId, FOOD_VARIETY_ as foodVariety, FOOD_LEVEL_ as foodLevel, PRICE_ as price, PLATE_NUM_ as plateNum, SAMPLE_USER_ as sampleUser, SAMPLE_TIME_ as sampleTime, igds-web/src/main/resources/static/admin/inout/in-check.js
@@ -110,23 +110,23 @@ if (symbol && limit) { if (">=" == symbol) { if (newValue < limit) { data.remarks = "不合格"; data.result = "不合格"; } else { data.remarks = "合格"; data.result = "合格"; } } if ("<=" == symbol) { if (newValue > limit) { data.remarks = "不合格"; data.result = "不合格"; } else { data.remarks = "合格"; data.result = "合格"; } } if ("==" == symbol) { if (newValue != limit) { data.remarks = "不合格"; data.result = "不合格"; } else { data.remarks = "合格"; data.result = "合格"; } } } @@ -335,7 +335,7 @@ }); // 获取化验项信息 flushCheckItem(null); flushCheckItem(curCheckData.foodVariety); } /** @@ -425,7 +425,7 @@ width: '10%', edit: 'text' }, { field: 'operaSymbol', field: 'operaSymbolValue', title: '标准值', align: 'center', width: '10%' @@ -502,7 +502,7 @@ var index = layer.load(); $.ajax({ type: "POST", url: "../../basic/inout/update-check1", url: "../../basic/inout/update-check", dataType: "json", contentType: "application/json;charset=UTF-8", data: JSON.stringify(curCheckData),