更新质检规格
This commit is contained in:
		| @@ -12,4 +12,9 @@ public interface QcSpecDao extends JpaRepository<QcSpecEntity, Integer>, JpaSpec | ||||
|  | ||||
|     Optional<QcSpecEntity> findByVarietyNoAndQcItemNo(String varietyNo, String qcItemNo); | ||||
|  | ||||
|     /** | ||||
|      * 更新质检规格 | ||||
|      */ | ||||
|     void updateQcSpecById(Integer id, String max, String mean, String min, String unit, String method, String standard, String remark); | ||||
|  | ||||
| } | ||||
| @@ -10,6 +10,9 @@ public interface QcSpecService { | ||||
|      */ | ||||
|     String insertQcSpec(QcSpecQoInsert insertQo); | ||||
|  | ||||
|     /** | ||||
|      * 更新质检规格 | ||||
|      */ | ||||
|     String updateQcSpec(QcSpecQoUpdate updateQo); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -70,8 +70,35 @@ public class QcSpecServiceImpl implements QcSpecService { | ||||
|         return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 更新质检规格 | ||||
|      */ | ||||
|     @Override | ||||
|     public String updateQcSpec(QcSpecQoUpdate updateQo) { | ||||
|         return null; | ||||
|  | ||||
|         Integer id = updateQo.getId(); | ||||
|         String max = updateQo.getMax(); | ||||
|         String mean = updateQo.getMean(); | ||||
|         String min = updateQo.getMin(); | ||||
|         String unit = updateQo.getUnit(); | ||||
|         String method = updateQo.getMethod(); | ||||
|         String standard = updateQo.getStandard(); | ||||
|         String remark = updateQo.getRemark(); | ||||
|  | ||||
|         Optional<QcSpecEntity> entityById = qcSpecDao.findById(id); | ||||
|         if (entityById.isEmpty()) { | ||||
|             return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格!", locale); | ||||
|         } | ||||
|  | ||||
|         qcSpecDao.updateQcSpecById(id, | ||||
|                 LocalStringUtils.formatEmptyValue(max), | ||||
|                 LocalStringUtils.formatEmptyValue(mean), | ||||
|                 LocalStringUtils.formatEmptyValue(min), | ||||
|                 LocalStringUtils.formatEmptyValue(unit), | ||||
|                 LocalStringUtils.formatEmptyValue(method), | ||||
|                 LocalStringUtils.formatEmptyValue(standard), | ||||
|                 LocalStringUtils.formatEmptyValue(remark)); | ||||
|  | ||||
|         return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user