From a1eea341b852091d34cd25d674ca1147bdb0015b Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期一, 21 八月 2023 21:06:38 +0800 Subject: [PATCH] 小修改 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionCycleController.java | 6 ++++++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/InspectionCycleMapper.java | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionCycleController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionCycleController.java index 47c27ad..1e7c08a 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionCycleController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionCycleController.java @@ -21,6 +21,7 @@ import org.jeecg.common.util.DateUtils; import org.jeecg.modules.eam.entity.*; +import org.jeecg.modules.eam.mapper.InspectionCycleMapper; import org.jeecg.modules.eam.service.IInspectionCycleService; import org.jeecg.modules.eam.service.IInspectionProjectService; @@ -55,6 +56,9 @@ @Autowired private ISysBaseAPI sysBaseApi; + + @Autowired + private InspectionCycleMapper inspectionCycleMapper; // // // @Autowired @@ -125,6 +129,8 @@ public Result<String> addNew(@RequestBody InspectionCycle inspectionCycle) { String cycleUnit = sysBaseApi.queryDictTextByKey("cycle_unit", String.valueOf(inspectionCycle.getCycleUnit())); inspectionCycle.setName(String.valueOf(inspectionCycle.getCycle()).concat(cycleUnit)); + String num = "DJ" + DateUtils.date2Str(DateUtils.yyyyMMdd.get()) + inspectionCycleMapper.getInspectionCycleNum(); + inspectionCycle.setCode(num); inspectionCycleService.save(inspectionCycle); return Result.OK("娣诲姞鎴愬姛锛�"); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/InspectionCycleMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/InspectionCycleMapper.java index 97d045e..e2900ee 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/InspectionCycleMapper.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/InspectionCycleMapper.java @@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.eam.entity.InspectionCycle; import java.util.List; @@ -32,4 +33,8 @@ * @return */ List<Integer> getUsableVersion(); + + + @Select("<script> select dbo.F_GET_SEQ_ID('InspectionCycleNum') </script>") + public String getInspectionCycleNum(); } -- Gitblit v1.9.3