From 86adbb1544142dcfb48333dade822f81640607a6 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期五, 01 九月 2023 13:50:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
base-server/src/main/java/com/yuanchu/mom/service/DeviceService.java | 79 +
standard-server/src/main/java/com/yuanchu/mom/pojo/Product.java | 12
base-server/src/main/java/com/yuanchu/mom/service/SelfcheckModelService.java | 44
standard-server/src/main/java/com/yuanchu/mom/mapper/TechnologyMapper.java | 8
base-server/src/main/java/com/yuanchu/mom/pojo/RecordModel.java | 68 +
base-server/src/main/java/com/yuanchu/mom/service/MbomModelService.java | 44
base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java | 9
base-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java | 33
base-server/src/main/resources/mapper/RecordModelMapper.xml | 50
base-server/src/main/java/com/yuanchu/mom/pojo/TechniqueModel.java | 63
base-server/src/main/resources/mapper/SelfcheckModelMapper.xml | 36
standard-server/src/main/java/com/yuanchu/mom/controller/ProductController.java | 12
standard-server/src/main/java/com/yuanchu/mom/controller/MaterialController.java | 91 +
standard-server/src/main/java/com/yuanchu/mom/pojo/Mbom.java | 89 +
standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialDto.java | 33
base-server/src/main/java/com/yuanchu/mom/pojo/dto/SelfcheckModelDto.java | 33
base-server/src/main/resources/mapper/DeviceMapper.xml | 57
base-server/src/main/java/com/yuanchu/mom/controller/SelfcheckModelController.java | 74 +
standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java | 13
base-server/src/main/java/com/yuanchu/mom/pojo/dto/DeviceDto.java | 46
standard-server/src/main/java/com/yuanchu/mom/mapper/MbomMapper.java | 23
standard-server/src/main/java/com/yuanchu/mom/service/impl/StandardServiceImpl.java | 132 ++
standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java | 19
base-server/src/main/java/com/yuanchu/mom/pojo/Device.java | 8
base-server/src/main/java/com/yuanchu/mom/service/RecordModelService.java | 59
standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java | 25
standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java | 8
standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java | 32
base-server/src/main/resources/mapper/TechniqueModelMapper.xml | 104 +
standard-server/src/main/java/com/yuanchu/mom/mapper/ProductMapper.java | 9
standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java | 145 ++
base-server/src/main/java/com/yuanchu/mom/pojo/dto/MbomModelDto.java | 37
base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml | 12
standard-server/src/main/java/com/yuanchu/mom/service/MbomService.java | 32
standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java | 23
standard-server/src/main/java/com/yuanchu/mom/pojo/dto/StandardDto.java | 19
base-server/src/main/java/com/yuanchu/mom/service/impl/SelfcheckModelServiceImpl.java | 61
base-server/src/main/java/com/yuanchu/mom/service/impl/MbomModelServiceImpl.java | 58
base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java | 12
base-server/src/main/java/com/yuanchu/mom/mapper/MbomModelMapper.java | 29
inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java | 6
base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechniqueModelDto.java | 24
base-server/src/main/resources/mapper/TechnicalModelMapper.xml | 14
inspect-server/src/main/resources/mapper/RawInsProductMapper.xml | 4
standard-server/src/main/java/com/yuanchu/mom/controller/MbomController.java | 25
standard-server/src/main/java/com/yuanchu/mom/pojo/Technique.java | 79 +
base-server/src/main/java/com/yuanchu/mom/service/TechniqueModelService.java | 73 +
standard-server/src/main/resources/mapper/TechnologyMapper.xml | 33
inspect-server/src/main/java/com/yuanchu/mom/pojo/RawInsProduct.java | 0
standard-server/src/main/java/com/yuanchu/mom/pojo/dto/SpecificationsDto.java | 15
standard-server/src/main/java/com/yuanchu/mom/service/ProductService.java | 22
standard-server/src/main/resources/mapper/MbomMapper.xml | 49
base-server/src/main/java/com/yuanchu/mom/mapper/SelfcheckModelMapper.java | 29
base-server/src/main/java/com/yuanchu/mom/pojo/dto/RecordModelDto.java | 30
inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java | 20
standard-server/src/main/resources/mapper/MaterialMapper.xml | 79
base-server/src/main/java/com/yuanchu/mom/mapper/RecordModelMapper.java | 32
standard-server/src/main/java/com/yuanchu/mom/service/impl/MbomServiceImpl.java | 37
standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java | 23
base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java | 13
standard-server/src/main/java/com/yuanchu/mom/pojo/Material.java | 17
standard-server/src/main/java/com/yuanchu/mom/pojo/Technology.java | 29
user-server/src/main/java/com/yuanchu/mom/service/UserService.java | 2
standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java | 123 +
standard-server/src/main/resources/mapper/TechniqueMapper.xml | 49
base-server/src/main/resources/mapper/ElementTechnologyMapper.xml | 2
base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java | 29
standard-server/src/main/java/com/yuanchu/mom/controller/StandardController.java | 37
base-server/src/main/java/com/yuanchu/mom/service/impl/RecordModelServiceImpl.java | 76 +
standard-server/src/main/resources/mapper/ProductMapper.xml | 93
base-server/src/main/java/com/yuanchu/mom/controller/RecordModelController.java | 94 +
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInsProductController.java | 0
base-server/src/main/java/com/yuanchu/mom/pojo/SelfcheckModel.java | 73 +
inspect-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java | 6
standard-server/src/main/java/com/yuanchu/mom/mapper/MaterialMapper.java | 10
base-server/src/main/java/com/yuanchu/mom/mapper/TechniqueModelMapper.java | 38
base-server/pom.xml | 5
base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java | 6
base-server/src/main/java/com/yuanchu/mom/controller/TechniqueModelController.java | 112 +
base-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java | 93 +
standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java | 20
base-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java | 96 +
/dev/null | 34
base-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueModelServiceImpl.java | 89 +
base-server/src/main/java/com/yuanchu/mom/pojo/MbomModel.java | 78 +
base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java | 31
standard-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueServiceImpl.java | 37
standard-server/src/main/java/com/yuanchu/mom/service/StandardService.java | 6
standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java | 14
base-server/src/main/resources/mapper/MbomModelMapper.xml | 34
standard-server/pom.xml | 5
standard-server/src/main/java/com/yuanchu/mom/controller/SpecificationsController.java | 37
base-server/src/main/java/com/yuanchu/mom/controller/MbomModelController.java | 74 +
93 files changed, 3,477 insertions(+), 320 deletions(-)
diff --git a/base-server/pom.xml b/base-server/pom.xml
index af534dc..5bfa438 100644
--- a/base-server/pom.xml
+++ b/base-server/pom.xml
@@ -28,11 +28,6 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>com.yuanchu.mom</groupId>
- <artifactId>standard-server</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java b/base-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
new file mode 100644
index 0000000..eea7575
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
@@ -0,0 +1,96 @@
+package com.yuanchu.mom.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yuanchu.mom.pojo.Device;
+import com.yuanchu.mom.pojo.dto.DeviceDto;
+import com.yuanchu.mom.service.DeviceService;
+import com.yuanchu.mom.service.UserService;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
+ * @since 2023-07-31
+ */
+@Api(tags = "鍩虹鏁版嵁-->璁惧缁存姢")
+@RestController
+@RequestMapping("/device")
+public class DeviceController {
+
+ @Autowired
+ private DeviceService deviceService;
+
+ @Autowired
+ private UserService userService;
+
+
+ @ApiOperation(value = "鏌ヨ璁惧缁存姢-->宸︿晶鍒楄〃璁惧缁勫睍绀�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "search_class", value = "鎼滅储妗嗗唴瀹�", dataTypeClass = String.class)
+ })
+ @GetMapping("/two_tree")
+ public Result<?> deviceTwoTree(@RequestParam(defaultValue = "1") Integer type, String search_class) {
+ List<Map<String, Object>> mapList = deviceService.deviceTwoTree(type, search_class);
+ return Result.success(mapList);
+ }
+
+ @ApiOperation(value = "鏌ヨ璁惧缁存姢-->鍙充晶鍒楄〃灞曠ず璇ヨ澶囩粍涓嬬殑鎵�鏈夎澶�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "father", value = "璁惧缁�", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "deviceStatus", value = "璁惧鐘舵��(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
+ @ApiImplicitParam(name = "message", value = "璁惧缂栧彿鎴栬�呰澶囧悕绉�", dataTypeClass = String.class)
+ })
+ @GetMapping("/selectDevice")
+ public Result<?> selectTreeDevice(Integer type, String father, Integer deviceStatus, String message) {
+ return Result.success(deviceService.selectTreeDevice(type, father, deviceStatus, message));
+ }
+
+ @ApiOperation(value = "鏂板浠櫒璁惧锛氫繚绠′汉涓嬫媺妗�")
+ @GetMapping("/list_user")
+ public Result<?> selectUserIdAndName() {
+ List<Map<String, Object>> maps = userService.listUserIdAndName();
+ return Result.success(maps);
+ }
+
+ @ApiOperation(value = "鏂板浠櫒璁惧")
+ @PostMapping("/add")
+ public Result<?> addDevice(@RequestBody DeviceDto deviceDto) {
+ return Result.success("娣诲姞"+deviceService.addDevice(deviceDto)+"鎴愬姛锛�");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "璁惧缁存姢id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/delDeviceById")
+ public Result delDeviceById(Integer id) {
+ deviceService.delDeviceById(id);
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "璁惧缁存姢id", dataTypeClass = String.class, required = true)
+ })
+ @PostMapping("/delAllDevice")
+ public Result delAllDevice(String ids) {
+ deviceService.delAllDevice(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/MbomModelController.java b/base-server/src/main/java/com/yuanchu/mom/controller/MbomModelController.java
new file mode 100644
index 0000000..42fa264
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/MbomModelController.java
@@ -0,0 +1,74 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.MbomModelDto;
+import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.MbomModelService;
+
+
+/**
+ * 鐗╂枡娓呭崟缁存姢琛�(MbomModel)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-30 09:17:26
+ */
+@Api(tags = "鍩虹鏁版嵁-->鐗╂枡娓呭崟缁存姢")
+@RestController
+@RequestMapping("/mbomModel")
+public class MbomModelController {
+
+ @Autowired
+ private MbomModelService mbomModelService;
+
+ /*鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹烘墍闇�瑕佺殑鍘熸潗鏂�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectAllMbom")
+ public Result selectAllMbom(Integer id) {
+ return Result.success(mbomModelService.selectAllMbom(id));
+ }
+
+ /*鏂板鐗╂枡娓呭崟缁存姢-->閫夋嫨宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏂板鐗╂枡娓呭崟缁存姢")
+ @PostMapping("/addMbom")
+ public Result addMbom(@Validated @RequestBody MbomModelDto mbomModelDto) {
+ Integer id = mbomModelService.addMbom(mbomModelDto);
+ return Result.success("鏂板" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鐗╂枡娓呭崟id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/delMbomById")
+ public Result delMbomById(Integer id) {
+ mbomModelService.delMbomById(id);
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "鐗╂枡娓呭崟id", dataTypeClass = String.class, required = true)
+ })
+ @PostMapping("/delAllMbom")
+ public Result delAllMbom(String ids) {
+ mbomModelService.delAllMbom(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/RecordModelController.java b/base-server/src/main/java/com/yuanchu/mom/controller/RecordModelController.java
new file mode 100644
index 0000000..4d458e6
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/RecordModelController.java
@@ -0,0 +1,94 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.RecordModelDto;
+import com.yuanchu.mom.pojo.dto.SelfcheckModelDto;
+import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.RecordModelService;
+
+
+/**
+ * 璁板綍鍐呭缁存姢琛�(RecordModel)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-29 15:40:38
+ */
+@Api(tags = "鍩虹鏁版嵁-->璁板綍鍐呭缁存姢")
+@RestController
+@RequestMapping("/recordModel")
+public class RecordModelController {
+
+ @Autowired
+ private RecordModelService recordModelService;
+
+ /*鏌ヨ璁板綍鍐呭缁存姢鍒楄〃-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏌ヨ璁板綍鍐呭缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎褰曞唴瀹�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectAllRecord")
+ public Result selectAllRecord(Integer id) {
+ return Result.success(recordModelService.selectAllRecord(id));
+ }
+
+ /*鏂板璁板綍鍐呭缁存姢-->閫夋嫨宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏂板璁板綍鍐呭缁存姢")
+ @PostMapping("/addRecord")
+ public Result addRecord(@Validated @RequestBody RecordModelDto recordModelDto) {
+ Integer id = recordModelService.addRecord(recordModelDto);
+ return Result.success("鏂板璁板綍鍐呭"+id+"鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鏍规嵁id鏌ヨ璇︽儏")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "璁板綍鍐呭id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selecRecordById")
+ public Result selecRecordById(Integer id) {
+ return Result.success(recordModelService.selecRecordById(id));
+ }
+
+ @ApiOperation(value = "缂栬緫")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "璁板綍鍐呭id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/writeRecordById")
+ public Result writeRecordById(Integer id, @Validated @RequestBody RecordModelDto recordModelDto) {
+ recordModelService.writeRecordById(id, recordModelDto);
+ return Result.success("淇敼" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "璁板綍鍐呭id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/delQueById")
+ public Result delRecordById(Integer id) {
+ recordModelService.delRecordById(id);
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "璁板綍鍐呭id", dataTypeClass = String.class, required = true)
+ })
+ @PostMapping("/delAllRecord")
+ public Result delAllRecord(String ids) {
+ recordModelService.delAllRecord(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/SelfcheckModelController.java b/base-server/src/main/java/com/yuanchu/mom/controller/SelfcheckModelController.java
new file mode 100644
index 0000000..c63155b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/SelfcheckModelController.java
@@ -0,0 +1,74 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.SelfcheckModelDto;
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.SelfcheckModelService;
+
+
+/**
+ * 鑷椤圭洰缁存姢琛�(SelfcheckModel)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-29 14:40:07
+ */
+@Api(tags = "鍩虹鏁版嵁-->鑷椤圭洰缁存姢")
+@RestController
+@RequestMapping("/selfcheckModel")
+public class SelfcheckModelController {
+
+ @Autowired
+ private SelfcheckModelService selfcheckModelService;
+
+ /*鏌ヨ鑷椤圭洰缁存姢鍒楄〃-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏌ヨ鑷椤圭洰缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎嚜妫�椤圭洰")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectAllSelf")
+ public Result selectAllSelf(Integer id) {
+ return Result.success(selfcheckModelService.selectAllSelf(id));
+ }
+
+ /*鏂板鑷椤圭洰缁存姢-->閫夋嫨宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏂板鑷椤圭洰缁存姢")
+ @PostMapping("/addSelfcheck")
+ public Result addSelfcheck(@Validated @RequestBody SelfcheckModelDto selfcheckModelDto) {
+ Integer id = selfcheckModelService.addSelfcheck(selfcheckModelDto);
+ return Result.success("鏂板鑷缓椤圭洰"+id+"鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鑷椤圭洰id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/delSelfcheckById")
+ public Result delSelfcheckById(Integer id) {
+ selfcheckModelService.delSelfcheckById(id);
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "鑷椤圭洰id", dataTypeClass = String.class, required = true)
+ })
+ @PostMapping("/delAllTech")
+ public Result delAllSelfcheck(String ids) {
+ selfcheckModelService.delAllSelfcheck(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java b/base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java
index 044cc10..7df8a17 100644
--- a/base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java
@@ -59,26 +59,23 @@
@ApiOperation(value = "鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨椤圭洰鐖剁被")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ @ApiImplicitParam(name = "techTemId", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/chooseProFath")
- public Result chooseProFath(Integer id) {
- return Result.success(technicalModelService.chooseProFath(id));
+ public Result chooseProFath(Integer techTemId) {
+ return Result.success(technicalModelService.chooseProFath(techTemId));
}
@ApiOperation(value = "鏂板鎶�鏈寚鏍囩淮鎶�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
- })
@PostMapping("/addTechMode")
- public Result addTechMode(Integer id, @Validated @RequestBody TechnicalModelDto technicalModelDto) {
- technicalModelService.addTechMode(id, technicalModelDto);
+ public Result addTechMode(@Validated @RequestBody TechnicalModelDto technicalModelDto) {
+ technicalModelService.addTechMode(technicalModelDto);
return Result.success("鏂板鎴愬姛!");
}
@ApiOperation(value = "鏍规嵁id鏌ヨ璇︽儏")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/selecTechById")
public Result selecTechById(Integer id) {
@@ -87,27 +84,27 @@
@ApiOperation(value = "缂栬緫")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class, required = true)
})
@PostMapping("/writeTechById")
- public Result writeTechById(Integer id,@Validated @RequestBody TechnicalModelDto technicalModelDto) {
- technicalModelService.writeTechById(id,technicalModelDto);
- return Result.success("淇敼"+id+"鎴愬姛!");
+ public Result writeTechById(Integer id, @Validated @RequestBody TechnicalModelDto technicalModelDto) {
+ technicalModelService.writeTechById(id, technicalModelDto);
+ return Result.success("淇敼" + id + "鎴愬姛!");
}
@ApiOperation(value = "鍒犻櫎")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class, required = true)
})
@PostMapping("/delTechById")
public Result delTechById(Integer id) {
technicalModelService.delTechById(id);
- return Result.success("鍒犻櫎"+id+"鎴愬姛!");
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
}
@ApiOperation(value = "鎵归噺鍒犻櫎")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "ids", value = "鎶�鏈寚鏍噄d", dataTypeClass = String.class,required = true)
+ @ApiImplicitParam(name = "ids", value = "鎶�鏈寚鏍噄d", dataTypeClass = String.class, required = true)
})
@PostMapping("/delAllTech")
public Result delAllTech(String ids) {
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/TechniqueModelController.java b/base-server/src/main/java/com/yuanchu/mom/controller/TechniqueModelController.java
new file mode 100644
index 0000000..d275699
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/TechniqueModelController.java
@@ -0,0 +1,112 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.TechniqueModelService;
+
+
+/**
+ * 鐢熶骇宸ヨ壓缁存姢琛�(TechniqueModel)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-29 09:26:37
+ */
+@Api(tags = "鍩虹鏁版嵁-->鐢熶骇宸ヨ壓缁存姢")
+@RestController
+@RequestMapping("/techniqueModel")
+public class TechniqueModelController {
+
+ @Autowired
+ private TechniqueModelService techniqueModelService;
+
+ /*鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鑳戒娇鐢ㄧ殑璁惧鎵�鑳藉仛鐨勯」鐩�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectAllTeque")
+ public Result selectAllTeque(Integer id) {
+ return Result.success(techniqueModelService.selectAllTeque(id));
+ }
+
+ /*鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨宸ュ簭鍜屽伐鑹�*/
+ //浣跨敤鎶�鏈寚鏍囩淮鎶ょ殑鎺ュ彛
+
+ @ApiOperation(value = "鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨椤圭洰鐖剁被,瀛愮被,甯﹀嚭鍗曚綅")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "techTemId", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/choosePro")
+ public Result choosePro(Integer techTemId) {
+ return Result.success(techniqueModelService.choosePro(techTemId));
+ }
+
+ @ApiOperation(value = "鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨璁惧")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "techTemId", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/chooseDeiv")
+ public Result chooseDeiv(Integer techTemId) {
+ return Result.success(techniqueModelService.chooseDeiv(techTemId));
+ }
+
+ @ApiOperation(value = "鏂板鐢熶骇宸ヨ壓缁存姢")
+ @PostMapping("/addQeMode")
+ public Result addQeMode(@Validated @RequestBody TechniqueModelDto techniqueModelDto) {
+ Integer id = techniqueModelService.addQeMode(techniqueModelDto);
+ return Result.success("鏂板" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鏍规嵁id鏌ヨ璇︽儏")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鐢熶骇宸ヨ壓id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selecQueById")
+ public Result selecQueById(Integer id) {
+ return Result.success(techniqueModelService.selecQueById(id));
+ }
+
+ @ApiOperation(value = "缂栬緫")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鐢熶骇宸ヨ壓id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/writeQueById")
+ public Result writeQueById(Integer id, @Validated @RequestBody TechniqueModelDto techniqueModelDto) {
+ techniqueModelService.writeQueById(id, techniqueModelDto);
+ return Result.success("淇敼" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鐢熶骇宸ヨ壓id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/delQueById")
+ public Result delQueById(Integer id) {
+ techniqueModelService.delQueById(id);
+ return Result.success("鍒犻櫎" + id + "鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "鐢熶骇宸ヨ壓id", dataTypeClass = String.class, required = true)
+ })
+ @PostMapping("/delAllQue")
+ public Result delAllQue(String ids) {
+ techniqueModelService.delAllQue(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java
new file mode 100644
index 0000000..b10515d
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java
@@ -0,0 +1,33 @@
+package com.yuanchu.mom.mapper;
+
+import com.yuanchu.mom.pojo.Device;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
+ * @since 2023-07-31
+ */
+public interface DeviceMapper extends BaseMapper<Device> {
+
+ //鏌ヨ璁惧缁存姢-->宸︿晶鍒楄〃璁惧缁勫睍绀�
+ List<Map<String, Object>> deviceTwoTree(Integer type, String search_class);
+
+ //鏌ヨ璁惧缁存姢-->鍙充晶鍒楄〃灞曠ず璇ヨ澶囩粍涓嬬殑鎵�鏈夎澶�
+ List<Map<String, Object>> selectTreeDevice(Integer type, String father, Integer deviceStatus, String message);
+
+ //鏍规嵁鍒嗙粍鏌ヨ璁惧鍚�
+ List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup);
+
+ //閫夋嫨鎵�鏈夎澶囩粍
+ List<Map<String, Object>> chooseDevGroup();
+
+ //鎵归噺鍒犻櫎
+ void delAllDevice(String ids);
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/MbomModelMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/MbomModelMapper.java
new file mode 100644
index 0000000..1935353
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/MbomModelMapper.java
@@ -0,0 +1,29 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.MbomModel;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐗╂枡娓呭崟缁存姢琛�(MbomModel)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-30 09:17:26
+ */
+public interface MbomModelMapper extends BaseMapper<MbomModel> {
+
+ //鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹烘墍闇�瑕佺殑鍘熸潗鏂�
+ List<Map<String, Object>> selectAllMbom(Integer id);
+
+ //鏍规嵁鐗╂枡娓呭崟id鎵归噺鍒犻櫎
+ void delAllMbom(String ids);
+
+ //鏍规嵁宸ヨ壓璺嚎id鍒犻櫎
+ void delMbomByTechId(Integer id);
+
+ //鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎
+ void delAllByTechId(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/RecordModelMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/RecordModelMapper.java
new file mode 100644
index 0000000..3fe5eec
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/RecordModelMapper.java
@@ -0,0 +1,32 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.RecordModel;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 璁板綍鍐呭缁存姢琛�(RecordModel)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-29 15:40:38
+ */
+public interface RecordModelMapper extends BaseMapper<RecordModel> {
+
+ //鏌ヨ璁板綍鍐呭缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎褰曞唴瀹�
+ List<Map<String, Object>> selectAllRecord(Integer id);
+
+ //鏍规嵁璁板綍鍐呭id鏌ョ湅璇︽儏
+ List<Map<String, Object>> selecRecordById(Integer id);
+
+ //鏍规嵁璁板綍鍐呭id鎵归噺鍒犻櫎
+ void delAllRecord(String ids);
+
+ //鏍规嵁宸ヨ壓璺嚎id鍒犻櫎
+ void delRecordByTechId(Integer id);
+
+ //鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎
+ void delAllByTechId(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/SelfcheckModelMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/SelfcheckModelMapper.java
new file mode 100644
index 0000000..f9f0eb7
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/SelfcheckModelMapper.java
@@ -0,0 +1,29 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.SelfcheckModel;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鑷椤圭洰缁存姢琛�(SelfcheckModel)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-29 14:40:08
+ */
+public interface SelfcheckModelMapper extends BaseMapper<SelfcheckModel> {
+
+ //鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎嚜妫�椤圭洰
+ List<Map<String, Object>> selectAllSelf(Integer id);
+
+ //鏍规嵁鑷椤圭洰id鎵归噺鍒犻櫎
+ void delAllSelfcheck(String ids);
+
+ //鏍规嵁宸ヨ壓璺嚎id鍒犻櫎
+ void delSelfByTechId(Integer id);
+
+ //鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎
+ void delAllByTechId(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/TechniqueModelMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/TechniqueModelMapper.java
new file mode 100644
index 0000000..a64a84f
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/TechniqueModelMapper.java
@@ -0,0 +1,38 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.TechniqueModel;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐢熶骇宸ヨ壓缁存姢琛�(TechniqueModel)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-29 09:26:37
+ */
+public interface TechniqueModelMapper extends BaseMapper<TechniqueModel> {
+
+ //鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鑳戒娇鐢ㄧ殑璁惧鎵�鑳藉仛鐨勯」鐩�
+ List<Map<String, Object>> selectAllTeque(Integer id);
+
+ //鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨椤圭洰鐖剁被,瀛愮被,甯﹀嚭鍗曚綅
+ List<Map<String, Object>> choosePro(Integer id);
+
+ //鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨璁惧
+ List<Map<String, Object>> chooseDeiv(Integer id);
+
+ //鏍规嵁鐢熶骇宸ヨ壓id鏌ョ湅璇︽儏
+ List<Map<String, Object>> selecQueById(Integer id);
+
+ //鏍规嵁鐢熶骇宸ヨ壓id鎵归噺鍒犻櫎
+ void delAllQue(String ids);
+
+ //鏍规嵁宸ヨ壓璺嚎id鍒犻櫎
+ void delQueByTechId(Integer id);
+
+ //鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎
+ void delAllByTechId(String ids);
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Device.java b/base-server/src/main/java/com/yuanchu/mom/pojo/Device.java
similarity index 91%
rename from standard-server/src/main/java/com/yuanchu/mom/pojo/Device.java
rename to base-server/src/main/java/com/yuanchu/mom/pojo/Device.java
index 741933a..02a6407 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/Device.java
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/Device.java
@@ -43,12 +43,13 @@
private String father;
@ApiModelProperty(value = "绫诲瀷 1:鐢熶骇璁惧锛�2锛氭娴嬭澶�", example = "1")
- private String type;
+ private Integer type;
@ApiModelProperty(value = "淇濈浜�", example = "1")
private Integer keeper;
@ApiModelProperty(value = "璁¢噺鎴鏈夋晥鏈�", example = "2023-08-09", dataType = "date")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endMeasure;
@ApiModelProperty(value = "璁惧鐘舵�� 1:杩愯锛�2:鎶ュ簾锛�3:妫�淇紱4:鏁呴殰锛�5:绌洪棽", example = "1")
@@ -62,16 +63,15 @@
private Integer rawInsProductId;
@ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
- @TableLogic(value = "1", delval = "0")
private Integer state;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/MbomModel.java b/base-server/src/main/java/com/yuanchu/mom/pojo/MbomModel.java
new file mode 100644
index 0000000..cc23d39
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/MbomModel.java
@@ -0,0 +1,78 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鐗╂枡娓呭崟缁存姢琛�(MbomModel)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-30 09:17:26
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@TableName("mbom_model")
+public class MbomModel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+ /**
+ * 鍘熸潗鏂欏悕绉�
+ **/
+ private String name;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 渚涘簲鍟�
+ **/
+ private String supplier;
+
+ /**
+ * 璐ㄩ噺杩芥函鍙�
+ **/
+ private String qualityTraceability;
+
+ /**
+ * 瑙勬牸鍨嬪彿
+ **/
+ private String specifications;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/RecordModel.java b/base-server/src/main/java/com/yuanchu/mom/pojo/RecordModel.java
new file mode 100644
index 0000000..6a87736
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/RecordModel.java
@@ -0,0 +1,68 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 璁板綍鍐呭缁存姢琛�(RecordModel)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-29 15:40:39
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@TableName("record_model")
+public class RecordModel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍐呭鍚嶇О(璁板綍)
+ **/
+ private String name;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 澶囨敞
+ **/
+ private String note;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/SelfcheckModel.java b/base-server/src/main/java/com/yuanchu/mom/pojo/SelfcheckModel.java
new file mode 100644
index 0000000..19ac60c
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/SelfcheckModel.java
@@ -0,0 +1,73 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鑷椤圭洰缁存姢琛�(SelfcheckModel)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-29 14:40:08
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@TableName("selfcheck_model")
+public class SelfcheckModel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鑷椤圭洰
+ **/
+ private String name;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 鏍囧噯鍊�
+ **/
+ private String required;
+
+ /**
+ * 鍐呮帶鍊�
+ **/
+ private String internal;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java b/base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java
index 7750fad..9825c46 100644
--- a/base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java
@@ -3,10 +3,7 @@
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
+import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
@@ -24,6 +21,7 @@
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
+@Builder
@TableName("technical_model")
public class TechnicalModel implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/TechniqueModel.java b/base-server/src/main/java/com/yuanchu/mom/pojo/TechniqueModel.java
new file mode 100644
index 0000000..97f2e37
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/TechniqueModel.java
@@ -0,0 +1,63 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鐢熶骇宸ヨ壓缁存姢琛�(TechniqueModel)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-29 09:26:37
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@TableName("technique_model")
+public class TechniqueModel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+ /**
+ * 鍏宠仈 璁惧id
+ **/
+ private Integer deviceId;
+
+ /**
+ * 鍏宠仈 椤圭洰(鎶�鏈寚鏍�)id
+ **/
+ private Integer technicalModelId;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/DeviceDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/DeviceDto.java
new file mode 100644
index 0000000..a8e886e
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/DeviceDto.java
@@ -0,0 +1,46 @@
+package com.yuanchu.mom.pojo.dto;
+
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+@Data
+//鏂板璁板綍鍐呭缁存姢鍙傛暟
+public class DeviceDto {
+
+ @JsonSerialize
+ @NotNull(message = "绫诲瀷涓嶈兘涓虹┖")
+ private Integer type;
+
+ @JsonSerialize
+ @NotNull(message = "璁惧鐘舵�佷笉鑳戒负绌�")
+ private Integer deviceStatus;
+
+ @JsonSerialize
+ @NotBlank(message = "璁惧缂栫爜涓嶈兘涓虹┖")
+ private String code;
+
+ @JsonSerialize
+ @NotBlank(message = "璁惧鍚嶇О涓嶈兘涓虹┖")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "璁惧鍒嗙粍涓嶈兘涓虹┖")
+ private String father;
+
+ @JsonSerialize
+ @NotNull(message = "淇濈浜轰笉鑳戒负绌�")
+ private Integer keeper;
+
+ @JsonSerialize
+ @NotBlank(message = "鍘傚涓嶈兘涓虹┖")
+ private String factory;
+
+ @JsonSerialize
+ @NotNull(message = "璁¢噺鎴鏈夋晥鏈熶笉鑳戒负绌�")
+ private Date endMeasure;
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/MbomModelDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/MbomModelDto.java
new file mode 100644
index 0000000..759b24b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/MbomModelDto.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.pojo.dto;
+
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+//鏂板璁板綍鍐呭缁存姢鍙傛暟
+public class MbomModelDto {
+
+ @JsonSerialize
+ @NotNull(message = "宸ヨ壓璺嚎id涓嶈兘涓虹┖")
+ private Integer techTemId;
+
+ @JsonSerialize
+ @NotBlank(message = "鍘熸潗鏂欏悕绉颁笉鑳戒负绌�")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "鍗曚綅涓嶈兘涓虹┖")
+ private String unit;
+
+ @JsonSerialize
+ @NotBlank(message = "渚涘簲鍟嗕笉鑳戒负绌�")
+ private String supplier;
+
+ @JsonSerialize
+ @NotBlank(message = "璐ㄩ噺杩芥函鍙蜂笉鑳戒负绌�")
+ private String qualityTraceability;
+
+ @JsonSerialize
+ @NotBlank(message = "瑙勬牸鍨嬪彿涓嶈兘涓虹┖")
+ private String specifications;
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/RecordModelDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/RecordModelDto.java
new file mode 100644
index 0000000..a98fbdf
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/RecordModelDto.java
@@ -0,0 +1,30 @@
+package com.yuanchu.mom.pojo.dto;
+
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+//鏂板璁板綍鍐呭缁存姢鍙傛暟
+public class RecordModelDto {
+
+ @JsonSerialize
+ @NotNull(message = "宸ヨ壓璺嚎id涓嶈兘涓虹┖")
+ private Integer techTemId;
+
+ @JsonSerialize
+ @NotBlank(message = "鍐呭鍚嶇О(璁板綍)涓嶈兘涓虹┖")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "鍗曚綅涓嶈兘涓虹┖")
+ private String unit;
+
+ @JsonSerialize
+ private String note;
+
+
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/SelfcheckModelDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/SelfcheckModelDto.java
new file mode 100644
index 0000000..a6b4649
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/SelfcheckModelDto.java
@@ -0,0 +1,33 @@
+package com.yuanchu.mom.pojo.dto;
+
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+//鏂板鑷椤圭洰缁存姢鍙傛暟
+public class SelfcheckModelDto {
+
+ @JsonSerialize
+ @NotNull(message = "宸ヨ壓璺嚎id涓嶈兘涓虹┖")
+ private Integer techTemId;
+
+ @JsonSerialize
+ @NotBlank(message = "椤圭洰涓嶈兘涓虹┖")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "鍗曚綅涓嶈兘涓虹┖")
+ private String unit;
+
+ @JsonSerialize
+ @NotBlank(message = "鏍囧噯鍊间笉鑳戒负绌�")
+ private String required;
+
+ @JsonSerialize
+ @NotBlank(message = "鍐呮帶鍊间笉鑳戒负绌�")
+ private String internal;
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java
index 743bfc8..2169e6a 100644
--- a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java
@@ -12,16 +12,8 @@
@JsonSerialize
- @NotNull(message = "绫诲瀷涓嶈兘涓虹┖")
- private Integer type;
-
- @JsonSerialize
- @NotBlank(message = "宸ュ簭涓嶈兘涓虹┖")
- private String TechFather;
-
- @JsonSerialize
- @NotBlank(message = "宸ヨ壓涓嶈兘涓虹┖")
- private String TechName;
+ @NotNull(message = "宸ヨ壓璺嚎id涓嶈兘涓虹┖")
+ private Integer techTemId;
@JsonSerialize
@NotBlank(message = "椤圭洰鐖剁被涓嶈兘涓虹┖")
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechniqueModelDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechniqueModelDto.java
new file mode 100644
index 0000000..b2fb45b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechniqueModelDto.java
@@ -0,0 +1,24 @@
+package com.yuanchu.mom.pojo.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+
+
+import javax.validation.constraints.NotNull;
+
+@Data
+//鏂板鐢熶骇宸ヨ壓缁存姢鍙傛暟
+public class TechniqueModelDto {
+
+ @JsonSerialize
+ @NotNull(message = "宸ヨ壓璺嚎id涓嶈兘涓虹┖")
+ private Integer techTemId;
+
+ @JsonSerialize
+ @NotNull(message = "鎶�鏈寚鏍噄d涓嶈兘涓虹┖")
+ private Integer technicalModelId;
+
+ @JsonSerialize
+ @NotNull(message = "璁惧id涓嶈兘涓虹┖")
+ private Integer devId;
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/DeviceService.java b/base-server/src/main/java/com/yuanchu/mom/service/DeviceService.java
new file mode 100644
index 0000000..44e6c75
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/DeviceService.java
@@ -0,0 +1,79 @@
+package com.yuanchu.mom.service;
+
+import com.yuanchu.mom.pojo.Device;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.dto.DeviceDto;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
+ * @since 2023-07-31
+ */
+public interface DeviceService extends IService<Device> {
+
+ /**
+ * 鏌ヨ璁惧缁存姢-->宸︿晶鍒楄〃璁惧缁勫睍绀�
+ * @param type
+ * @param search_class
+ * @return
+ */
+ List<Map<String, Object>> deviceTwoTree(Integer type, String search_class);
+
+ /**
+ * 鏌ヨ璁惧缁存姢-->鍙充晶鍒楄〃灞曠ず璇ヨ澶囩粍涓嬬殑鎵�鏈夎澶�
+ * @param father
+ * @return
+ */
+ List<Map<String, Object>> selectTreeDevice(Integer type, String father, Integer deviceStatus, String message);
+
+ /**
+ * 鏌ヨ鎵�鏈夎澶�
+ * @return
+ */
+ List<Device> selectDevice();
+
+ /**
+ * 鏍规嵁璁惧id鏌ヨ璁惧鍚嶇О
+ * @param id
+ */
+ String getDeviceNameById(Integer id);
+
+ /**
+ * 鏂板浠櫒璁惧
+ * @param deviceDto
+ * @return
+ */
+ Integer addDevice(DeviceDto deviceDto);
+
+ /**
+ * 鏍规嵁璁惧鍒嗙粍鏌ヨ璁惧
+ * @param deviceGroup
+ * @return
+ */
+ List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup);
+
+ /**
+ * 鏌ヨ鎵�鏈夎澶囩紪鍙峰拰璁惧鍚嶇О
+ * @return
+ */
+ List<Map<String, Object>> selectDeviceIdAndName();
+
+ /**
+ * 鍒犻櫎
+ * @param id
+ */
+ void delDeviceById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ */
+ void delAllDevice(String ids);
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/MbomModelService.java b/base-server/src/main/java/com/yuanchu/mom/service/MbomModelService.java
new file mode 100644
index 0000000..7141bc9
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/MbomModelService.java
@@ -0,0 +1,44 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.MbomModel;
+import com.yuanchu.mom.pojo.dto.MbomModelDto;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐗╂枡娓呭崟缁存姢琛�(MbomModel)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-30 09:17:26
+ */
+public interface MbomModelService extends IService<MbomModel> {
+
+ /**
+ * 鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹烘墍闇�瑕佺殑鍘熸潗鏂�
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> selectAllMbom(Integer id);
+
+ /**
+ * 鏂板鐗╂枡娓呭崟缁存姢琛�
+ * @param mbomModelDto
+ * @return
+ */
+ Integer addMbom(MbomModelDto mbomModelDto);
+
+ /**
+ * 鍒犻櫎
+ * @param id
+ */
+ void delMbomById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ */
+ void delAllMbom(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/RecordModelService.java b/base-server/src/main/java/com/yuanchu/mom/service/RecordModelService.java
new file mode 100644
index 0000000..0bc69f5
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/RecordModelService.java
@@ -0,0 +1,59 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.RecordModel;
+import com.yuanchu.mom.pojo.dto.RecordModelDto;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 璁板綍鍐呭缁存姢琛�(RecordModel)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-29 15:40:38
+ */
+public interface RecordModelService extends IService<RecordModel> {
+
+ /**
+ * 鏌ヨ璁板綍鍐呭缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎褰曞唴瀹�
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> selectAllRecord(Integer id);
+
+ /**
+ * 鏂板璁板綍鍐呭缁存姢
+ * @param recordModelDto
+ * @return
+ */
+ Integer addRecord(RecordModelDto recordModelDto);
+
+ /**
+ * 鏍规嵁id鏌ョ湅璇︽儏
+ * @param id 璁板綍鍐呭id
+ * @return
+ */
+ List<Map<String,Object>> selecRecordById(Integer id);
+
+ /**
+ * 缂栬緫
+ * @param id
+ * @param recordModelDto
+ */
+ void writeRecordById(Integer id, RecordModelDto recordModelDto);
+
+ /**
+ * 鍒犻櫎
+ * @param id
+ */
+ void delRecordById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ */
+ void delAllRecord(String ids);
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/SelfcheckModelService.java b/base-server/src/main/java/com/yuanchu/mom/service/SelfcheckModelService.java
new file mode 100644
index 0000000..3163d6d
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/SelfcheckModelService.java
@@ -0,0 +1,44 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.SelfcheckModel;
+import com.yuanchu.mom.pojo.dto.SelfcheckModelDto;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鑷椤圭洰缁存姢琛�(SelfcheckModel)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-29 14:40:08
+ */
+public interface SelfcheckModelService extends IService<SelfcheckModel> {
+
+ /**
+ * 鏌ヨ鑷椤圭洰缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎嚜妫�椤圭洰
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> selectAllSelf(Integer id);
+
+ /**
+ * 鏂板鑷椤圭洰
+ * @param selfcheckModelDto
+ * @return
+ */
+ Integer addSelfcheck(SelfcheckModelDto selfcheckModelDto);
+
+ /**
+ * 鍒犻櫎
+ * @param id 鑷椤圭洰id
+ */
+ void delSelfcheckById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids 鑷椤圭洰ids
+ */
+ void delAllSelfcheck(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java b/base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java
index a725a18..eba56c2 100644
--- a/base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java
+++ b/base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java
@@ -51,30 +51,33 @@
*
* @param technicalModelDto
*/
- void addTechMode(Integer id, TechnicalModelDto technicalModelDto);
+ void addTechMode(TechnicalModelDto technicalModelDto);
/**
* 鏍规嵁id鏌ヨ璇︽儏
+ *
* @param id 鎶�鏈寚鏍噄d
* @return
*/
- List<Map<String,Object>> selecTechById(Integer id);
+ List<Map<String, Object>> selecTechById(Integer id);
/**
* 缂栬緫
- * @param id
+ *
* @param technicalModelDto
*/
void writeTechById(Integer id, TechnicalModelDto technicalModelDto);
/**
* 鍒犻櫎
+ *
* @param id
*/
void delTechById(Integer id);
/**
* 鎵归噺鍒犻櫎
+ *
* @param ids
*/
void delAllTech(String ids);
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/TechniqueModelService.java b/base-server/src/main/java/com/yuanchu/mom/service/TechniqueModelService.java
new file mode 100644
index 0000000..ab5087e
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/TechniqueModelService.java
@@ -0,0 +1,73 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.TechniqueModel;
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐢熶骇宸ヨ壓缁存姢琛�(TechniqueModel)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-29 09:26:37
+ */
+public interface TechniqueModelService extends IService<TechniqueModel> {
+
+ /**
+ * 鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鑳戒娇鐢ㄧ殑璁惧鎵�鑳藉仛鐨勯」鐩�
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> selectAllTeque(Integer id);
+
+ /**
+ * 鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨椤圭洰鐖剁被,瀛愮被,甯﹀嚭鍗曚綅
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> choosePro(Integer id);
+
+ /**
+ * 鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨璁惧
+ * @param id 宸ヨ壓璺嚎id
+ * @return
+ */
+ List<Map<String,Object>> chooseDeiv(Integer id);
+
+
+ /**
+ * 鏂板鐢熶骇宸ヨ壓缁存姢
+ * @param techniqueModelDto
+ */
+ Integer addQeMode(TechniqueModelDto techniqueModelDto);
+
+ /**
+ * 鏍规嵁id鏌ョ湅璇︽儏
+ * @param id 鐢熶骇宸ヨ壓id
+ * @return
+ */
+ List<Map<String,Object>> selecQueById(Integer id);
+
+ /**
+ * 缂栬緫
+ * @param id
+ * @param techniqueModelDto
+ */
+ void writeQueById(Integer id, TechniqueModelDto techniqueModelDto);
+
+ /**
+ * 鍒犻櫎
+ * @param id
+ */
+ void delQueById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎
+ * @param ids
+ */
+ void delAllQue(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
new file mode 100644
index 0000000..b4e582b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
@@ -0,0 +1,93 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yuanchu.mom.pojo.Device;
+import com.yuanchu.mom.mapper.DeviceMapper;
+import com.yuanchu.mom.pojo.dto.DeviceDto;
+import com.yuanchu.mom.service.DeviceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
+ * @since 2023-07-31
+ */
+@Service
+public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {
+
+ @Resource
+ private DeviceMapper deviceMapper;
+
+
+ //鏌ヨ璁惧缁存姢-->宸︿晶鍒楄〃璁惧缁勫睍绀�
+ @Override
+ public List<Map<String, Object>> deviceTwoTree(Integer type, String search_class) {
+ return deviceMapper.deviceTwoTree(type, search_class);
+ }
+
+ //鏌ヨ璁惧缁存姢-->鍙充晶鍒楄〃灞曠ず璇ヨ澶囩粍涓嬬殑鎵�鏈夎澶�
+ @Override
+ public List<Map<String, Object>> selectTreeDevice(Integer type, String father, Integer deviceStatus, String message) {
+ return deviceMapper.selectTreeDevice(type, father, deviceStatus, message);
+ }
+
+ //鏌ヨ鎵�鏈夎澶�
+ @Override
+ public List<Device> selectDevice() {
+ return deviceMapper.selectList(new QueryWrapper<>());
+ }
+
+ //鏍规嵁璁惧id鑾峰彇璁惧鍚嶇О
+ @Override
+ public String getDeviceNameById(Integer id) {
+ Device device = deviceMapper.selectById(id);
+ return device.getName();
+ }
+
+ //鏂板浠櫒璁惧
+ @Override
+ public Integer addDevice(DeviceDto deviceDto) {
+ Device device = new Device();
+ BeanUtils.copyProperties(deviceDto, device);
+ deviceMapper.insert(device);
+ return device.getId();
+ }
+
+ //鏍规嵁鍒嗙粍鏌ヨ璁惧鍚�
+ @Override
+ public List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup) {
+ return deviceMapper.getDeviceNameByGroup(deviceGroup);
+ }
+
+ //鏌ヨ鎵�鏈夎澶囩紪鍙峰拰璁惧鍚嶇О
+ @Override
+ public List<Map<String, Object>> selectDeviceIdAndName() {
+ LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
+ wrapper.select(Device::getId, Device::getName, Device::getCode);
+ return deviceMapper.selectMaps(wrapper);
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delDeviceById(Integer id) {
+ Device device = new Device();
+ device.setId(id);
+ device.setState(0);
+ deviceMapper.updateById(device);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllDevice(String ids) {
+ deviceMapper.delAllDevice(ids);
+ }
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/MbomModelServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/MbomModelServiceImpl.java
new file mode 100644
index 0000000..b45e247
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/MbomModelServiceImpl.java
@@ -0,0 +1,58 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.MbomModelMapper;
+import com.yuanchu.mom.pojo.MbomModel;
+import com.yuanchu.mom.pojo.dto.MbomModelDto;
+import com.yuanchu.mom.service.MbomModelService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐗╂枡娓呭崟缁存姢琛�(MbomModel)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-30 09:17:26
+ */
+@Service
+public class MbomModelServiceImpl extends ServiceImpl<MbomModelMapper, MbomModel> implements MbomModelService {
+
+ @Resource
+ MbomModelMapper mbomModelMapper;
+
+
+ //鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹烘墍闇�瑕佺殑鍘熸潗鏂�
+ @Override
+ public List<Map<String, Object>> selectAllMbom(Integer id) {
+ return mbomModelMapper.selectAllMbom(id);
+ }
+
+ //鏂板鐗╂枡娓呭崟缁存姢琛�
+ @Override
+ public Integer addMbom(MbomModelDto mbomModelDto) {
+ MbomModel mbomModel = new MbomModel();
+ BeanUtils.copyProperties(mbomModelDto,mbomModel);
+ mbomModelMapper.insert(mbomModel);
+ return mbomModel.getId();
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delMbomById(Integer id) {
+ MbomModel mbomModel = new MbomModel();
+ mbomModel.setId(id);
+ mbomModel.setState(0);
+ mbomModelMapper.updateById(mbomModel);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllMbom(String ids) {
+ mbomModelMapper.delAllMbom(ids);
+ }
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/RecordModelServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/RecordModelServiceImpl.java
new file mode 100644
index 0000000..3f0292e
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/RecordModelServiceImpl.java
@@ -0,0 +1,76 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.RecordModelMapper;
+import com.yuanchu.mom.pojo.RecordModel;
+import com.yuanchu.mom.pojo.dto.RecordModelDto;
+import com.yuanchu.mom.service.RecordModelService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 璁板綍鍐呭缁存姢琛�(RecordModel)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-29 15:40:39
+ */
+@Service
+public class RecordModelServiceImpl extends ServiceImpl<RecordModelMapper, RecordModel> implements RecordModelService {
+
+ @Resource
+ RecordModelMapper recordModelMapper;
+
+ //鏌ヨ璁板綍鍐呭缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎褰曞唴瀹�
+ @Override
+ public List<Map<String, Object>> selectAllRecord(Integer id) {
+ return recordModelMapper.selectAllRecord(id);
+ }
+
+ //鏂板璁板綍鍐呭缁存姢
+ @Override
+ public Integer addRecord(RecordModelDto recordModelDto) {
+ RecordModel recordModel = RecordModel.builder()
+ .name(recordModelDto.getName())
+ .techTemId(recordModelDto.getTechTemId())
+ .unit(recordModelDto.getUnit())
+ .note(recordModelDto.getNote())
+ .build();
+ recordModelMapper.insert(recordModel);
+ return recordModel.getId();
+ }
+
+ //鏍规嵁id鏌ョ湅璇︽儏
+ @Override
+ public List<Map<String, Object>> selecRecordById(Integer id) {
+ return recordModelMapper.selecRecordById(id);
+ }
+
+ //缂栬緫
+ @Override
+ public void writeRecordById(Integer id, RecordModelDto recordModelDto) {
+ RecordModel recordModel = new RecordModel();
+ BeanUtils.copyProperties(recordModelDto, recordModel);
+ recordModel.setId(id);
+ recordModelMapper.updateById(recordModel);
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delRecordById(Integer id) {
+ RecordModel recordModel = new RecordModel();
+ recordModel.setId(id);
+ recordModel.setState(0);
+ recordModelMapper.updateById(recordModel);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllRecord(String ids) {
+ recordModelMapper.delAllRecord(ids);
+ }
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/SelfcheckModelServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/SelfcheckModelServiceImpl.java
new file mode 100644
index 0000000..22a6dc4
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/SelfcheckModelServiceImpl.java
@@ -0,0 +1,61 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.SelfcheckModelMapper;
+import com.yuanchu.mom.pojo.SelfcheckModel;
+import com.yuanchu.mom.pojo.dto.SelfcheckModelDto;
+import com.yuanchu.mom.service.SelfcheckModelService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鑷椤圭洰缁存姢琛�(SelfcheckModel)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-29 14:40:08
+ */
+@Service
+public class SelfcheckModelServiceImpl extends ServiceImpl<SelfcheckModelMapper, SelfcheckModel> implements SelfcheckModelService {
+
+ @Resource
+ SelfcheckModelMapper selfcheckModelMapper;
+
+ //鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎嚜妫�椤圭洰
+ @Override
+ public List<Map<String, Object>> selectAllSelf(Integer id) {
+ return selfcheckModelMapper.selectAllSelf(id);
+ }
+
+ //鏂板鑷椤圭洰
+ @Override
+ public Integer addSelfcheck(SelfcheckModelDto selfcheckModelDto) {
+ SelfcheckModel selfcheckModel = SelfcheckModel.builder()
+ .name(selfcheckModelDto.getName())
+ .techTemId(selfcheckModelDto.getTechTemId())
+ .unit(selfcheckModelDto.getUnit())
+ .required(selfcheckModelDto.getRequired())
+ .internal(selfcheckModelDto.getInternal())
+ .build();
+ selfcheckModelMapper.insert(selfcheckModel);
+ return selfcheckModel.getId();
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delSelfcheckById(Integer id) {
+ SelfcheckModel selfcheckModel = new SelfcheckModel();
+ selfcheckModel.setId(id);
+ selfcheckModel.setState(0);
+ selfcheckModelMapper.updateById(selfcheckModel);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllSelfcheck(String ids) {
+ selfcheckModelMapper.delAllSelfcheck(ids);
+ }
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java
index e15387a..dd5df9a 100644
--- a/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java
@@ -51,10 +51,13 @@
//鏂板鎶�鏈寚鏍囩淮鎶�
@Override
- public void addTechMode(Integer id, TechnicalModelDto technicalModelDto) {
- TechnicalModel technicalModel = new TechnicalModel();
- BeanUtils.copyProperties(technicalModelDto, technicalModel);
- technicalModel.setTechTemId(id);
+ public void addTechMode(TechnicalModelDto technicalModelDto) {
+ TechnicalModel technicalModel = TechnicalModel.builder()
+ .techTemId(technicalModelDto.getTechTemId())
+ .father(technicalModelDto.getFather())
+ .name(technicalModelDto.getName())
+ .unit(technicalModelDto.getUnit())
+ .build();
technicalModelMapper.insert(technicalModel);
}
@@ -66,7 +69,7 @@
//缂栬緫
@Override
- public void writeTechById(Integer id, TechnicalModelDto technicalModelDto) {
+ public void writeTechById(Integer id,TechnicalModelDto technicalModelDto) {
TechnicalModel technicalModel = new TechnicalModel();
BeanUtils.copyProperties(technicalModelDto, technicalModel);
technicalModel.setId(id);
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueModelServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueModelServiceImpl.java
new file mode 100644
index 0000000..6a46465
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueModelServiceImpl.java
@@ -0,0 +1,89 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.TechniqueModelMapper;
+import com.yuanchu.mom.pojo.TechniqueModel;
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
+import com.yuanchu.mom.service.TechniqueModelService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐢熶骇宸ヨ壓缁存姢琛�(TechniqueModel)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-29 09:26:37
+ */
+@Service
+public class TechniqueModelServiceImpl extends ServiceImpl<TechniqueModelMapper, TechniqueModel> implements TechniqueModelService {
+
+ @Resource
+ TechniqueModelMapper techniqueModelMapper;
+
+ //鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鑳戒娇鐢ㄧ殑璁惧鎵�鑳藉仛鐨勯」鐩�
+ @Override
+ public List<Map<String, Object>> selectAllTeque(Integer id) {
+ return techniqueModelMapper.selectAllTeque(id);
+ }
+
+ //鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨椤圭洰鐖剁被,瀛愮被,甯﹀嚭鍗曚綅
+ @Override
+ public List<Map<String, Object>> choosePro(Integer id) {
+ return techniqueModelMapper.choosePro(id);
+ }
+
+ //鏂板鐢熶骇宸ヨ壓缁存姢-->閫夋嫨璁惧
+ @Override
+ public List<Map<String, Object>> chooseDeiv(Integer id) {
+ return techniqueModelMapper.chooseDeiv(id);
+ }
+
+ //鏂板鐢熶骇宸ヨ壓缁存姢
+ @Override
+ public Integer addQeMode(TechniqueModelDto techniqueModelDto) {
+ TechniqueModel techniqueModel = TechniqueModel.builder()
+ .technicalModelId(techniqueModelDto.getTechnicalModelId())
+ .techTemId(techniqueModelDto.getTechTemId())
+ .deviceId(techniqueModelDto.getDevId())
+ .build();
+ techniqueModelMapper.insert(techniqueModel);
+ return techniqueModel.getId();
+ }
+
+ //鏍规嵁鐢熶骇宸ヨ壓id鏌ョ湅璇︽儏
+ @Override
+ public List<Map<String, Object>> selecQueById(Integer id) {
+ return techniqueModelMapper.selecQueById(id);
+ }
+
+ //缂栬緫
+ @Override
+ public void writeQueById(Integer id, TechniqueModelDto techniqueModelDto) {
+ TechniqueModel techniqueModel = new TechniqueModel();
+ BeanUtils.copyProperties(techniqueModelDto,techniqueModel);
+ techniqueModel.setId(id);
+ techniqueModelMapper.updateById(techniqueModel);
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delQueById(Integer id) {
+ TechniqueModel techniqueModel = new TechniqueModel();
+ techniqueModel.setId(id);
+ techniqueModel.setState(0);
+ techniqueModelMapper.updateById(techniqueModel);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllQue(String ids) {
+ techniqueModelMapper.delAllQue(ids);
+ }
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java
index 65a3728..43ba437 100644
--- a/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java
@@ -45,6 +45,18 @@
@Resource
TechnicalModelMapper technicalModelMapper;
+ @Resource
+ TechniqueModelMapper techniqueModelMapper;
+
+ @Resource
+ SelfcheckModelMapper selfcheckModelMapper;
+
+ @Resource
+ RecordModelMapper recordModelMapper;
+
+ @Resource
+ MbomModelMapper mbomModelMapper;
+
//鏂板宸ヨ壓璺嚎-->閫夋嫨璁惧缁�
@Override
@@ -128,7 +140,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public void delTechById(Integer id) {
- //鍒犻櫎宸ヨ壓琛�
+ //鍒犻櫎宸ヨ壓璺嚎缁存姢琛�
TechnologyTemplate technologyTemplate = new TechnologyTemplate();
technologyTemplate.setId(id).setState(0);
technologyTemplateMapper.updateById(technologyTemplate);
@@ -136,7 +148,14 @@
elementTechnologyService.delElemaByTechsId(id);
//鍒犻櫎鎶�鏈寚鏍囩淮鎶よ〃
technicalModelMapper.delTeMoByTechId(id);
- //todo:鍒犻櫎鏈畬寰呯画
+ //鍒犻櫎鐢熶骇宸ヨ壓缁存姢琛�
+ techniqueModelMapper.delQueByTechId(id);
+ //鍒犻櫎鑷椤圭洰缁存姢琛�
+ selfcheckModelMapper.delSelfByTechId(id);
+ //鍒犻櫎璁板綍鍐呭缁存姢琛�
+ recordModelMapper.delRecordByTechId(id);
+ //鍒犻櫎鐗╂枡娓呭崟缁存姢琛�
+ mbomModelMapper.delMbomByTechId(id);
}
//鎵归噺鍒犻櫎
@@ -149,6 +168,14 @@
elementTechnologyService.delAllByTechId(ids);
//鎵归噺鍒犻櫎鎸囨爣缁存姢琛�
technicalModelMapper.delAllByTechId(ids);
+ //鎵归噺鍒犻櫎鐢熶骇宸ヨ壓缁存姢琛�
+ techniqueModelMapper.delAllByTechId(ids);
+ //鎵归噺鍒犻櫎鑷椤圭洰缁存姢琛�
+ selfcheckModelMapper.delAllByTechId(ids);
+ //鎵归噺鍒犻櫎璁板綍鍐呭缁存姢琛�
+ recordModelMapper.delAllByTechId(ids);
+ //鎵归噺鍒犻櫎鐗╂枡娓呭崟缁存姢琛�
+ mbomModelMapper.delAllByTechId(ids);
}
}
diff --git a/base-server/src/main/resources/mapper/DeviceMapper.xml b/base-server/src/main/resources/mapper/DeviceMapper.xml
new file mode 100644
index 0000000..8da494e
--- /dev/null
+++ b/base-server/src/main/resources/mapper/DeviceMapper.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yuanchu.mom.mapper.DeviceMapper">
+ <!--鏌ヨ璁惧缁存姢 宸︿晶鍒楄〃璁惧缁勫睍绀�-->
+ <select id="deviceTwoTree" resultType="java.util.Map">
+ SELECT distinct father,type
+ FROM mom_ocean.device d
+ WHERE d.state = 1
+ AND d.type = #{type}
+ <if test="search_class !=null and search_class != ''">
+ AND d.`name` like concat('%',#{search_class},'%')
+ </if>
+ </select>
+ <!--鏌ヨ璁惧缁存姢 鍙充晶鍒楄〃灞曠ず璇ヨ澶囩粍涓嬬殑鎵�鏈夎澶�-->
+ <select id="selectTreeDevice" resultType="java.util.Map">
+ select device.id,
+ code,
+ device.name,
+ user.name userName,
+ DATE_FORMAT(end_measure, '%Y-%m-%d'),
+ device_status,
+ factory
+ from mom_ocean.device,mom_ocean.user
+ where device.state=1
+ and user.id=keeper
+ and type=#{type}
+ and father=#{father}
+ <if test="deviceStatus!=null and deviceStatus!=''">
+ and device_status=#{deviceStatus}
+ </if>
+ <if test="message!=null and message!=''">
+ and code like concat('%',#{message},'%')
+ or name like concat('%',#{message},'%')
+ </if>
+ </select>
+ <!--鏍规嵁璁惧鍒嗙粍鏌ヨ璁惧-->
+ <select id="getDeviceNameByGroup" resultType="java.util.Map">
+ select id, name
+ from mom_ocean.device
+ where state = 1
+ and father = #{deviceGroup}
+ and device_status in (1, 5)
+ </select>
+ <!--閫夋嫨璁惧缁�-->
+ <select id="chooseDevGroup" resultType="java.util.Map">
+ select distinct father
+ from mom_ocean.device
+ where state = 1
+ and device_status in (1, 5)
+ </select>
+ <!--鎵归噺鍒犻櫎-->
+ <update id="delAllDevice">
+ update mom_ocean.device
+ set state=0
+ where id in (${ids})
+ </update>
+</mapper>
diff --git a/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml b/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml
index 94074f6..930f502 100644
--- a/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml
+++ b/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml
@@ -12,6 +12,6 @@
<update id="delAllByTechId">
update mom_ocean.element_technology
set state=0
- where tech_tem_id in (${id})
+ where tech_tem_id in (${ids})
</update>
</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/MbomModelMapper.xml b/base-server/src/main/resources/mapper/MbomModelMapper.xml
new file mode 100644
index 0000000..24a5bbf
--- /dev/null
+++ b/base-server/src/main/resources/mapper/MbomModelMapper.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.MbomModelMapper">
+ <!--鏌ヨ鐗╂枡娓呭崟缁存姢鍒楄〃 鍙宠竟灞曠ず璇ュ伐鑹烘墍闇�瑕佺殑鍘熸潗鏂�-->
+ <select id="selectAllMbom" resultType="java.util.Map">
+ select id,
+ name,
+ unit
+ from mom_ocean.mbom_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏍规嵁鐗╂枡娓呭崟id鎵归噺鍒犻櫎-->
+ <update id="delAllMbom">
+ update mom_ocean.mbom_model
+ set state=0
+ where id in (${ids})
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎-->
+ <update id="delMbomByTechId">
+ update mom_ocean.mbom_model
+ set state=0
+ where tech_tem_id = #{id}
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+ <update id="delAllByTechId">
+ update mom_ocean.mbom_model
+ set state=0
+ where tech_tem_id in (${ids})
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/RecordModelMapper.xml b/base-server/src/main/resources/mapper/RecordModelMapper.xml
new file mode 100644
index 0000000..5495be6
--- /dev/null
+++ b/base-server/src/main/resources/mapper/RecordModelMapper.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.RecordModelMapper">
+ <!--鏌ヨ璁板綍鍐呭缁存姢鍒楄〃 鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎褰曞唴瀹�-->
+ <select id="selectAllRecord" resultType="java.util.Map">
+ select id,
+ name,
+ unit,
+ note
+ from mom_ocean.record_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏍规嵁璁板綍鍐呭id鏌ョ湅璇︽儏-->
+ <select id="selecRecordById" resultType="java.util.Map">
+ select type,
+ father techFather,
+ tt.name techName,
+ rm.name,
+ unit,
+ note
+ from mom_ocean.record_model rm,
+ mom_ocean.technology_template tt
+ where rm.state = 1
+ and tech_tem_id = tt.id
+ and rm.id = #{id}
+ </select>
+
+ <!--鏍规嵁璁板綍鍐呭id鎵归噺鍒犻櫎-->
+ <update id="delAllRecord">
+ update mom_ocean.record_model
+ set state=0
+ where id in (${ids})
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎-->
+ <update id="delRecordByTechId">
+ update mom_ocean.record_model
+ set state=0
+ where tech_tem_id = #{id}
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+ <update id="delAllByTechId">
+ update mom_ocean.record_model
+ set state=0
+ where tech_tem_id in (${ids})
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/SelfcheckModelMapper.xml b/base-server/src/main/resources/mapper/SelfcheckModelMapper.xml
new file mode 100644
index 0000000..142a2d9
--- /dev/null
+++ b/base-server/src/main/resources/mapper/SelfcheckModelMapper.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.SelfcheckModelMapper">
+ <!--鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃 鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬墍鏈夎嚜妫�椤圭洰-->
+ <select id="selectAllSelf" resultType="java.util.Map">
+ select id,
+ name,
+ unit,
+ required,
+ internal
+ from mom_ocean.selfcheck_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏍规嵁鑷椤圭洰id鎵归噺鍒犻櫎-->
+ <update id="delAllSelfcheck">
+ update mom_ocean.selfcheck_model
+ set state=0
+ where id in (${ids})
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎-->
+ <update id="delSelfByTechId">
+ update mom_ocean.selfcheck_model
+ set state=0
+ where selfcheck_model.tech_tem_id = #{id}
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+ <update id="delAllByTechId">
+ update mom_ocean.selfcheck_model
+ set state=0
+ where selfcheck_model.tech_tem_id in (${ids})
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/TechnicalModelMapper.xml b/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
index b859a48..62485d2 100644
--- a/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
+++ b/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="com.yuanchu.mom.mapper.TechnicalModelMapper">
<!--鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛� 宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹� -->
<resultMap id="selectAllTechTemMap" type="map">
- <id property="father" column="father"/>
+ <id property="name" column="father"/>
<collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
</resultMap>
<resultMap id="selectAllTechTemTowMap" type="map">
@@ -24,13 +24,13 @@
<!--鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛� 鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�-->
<resultMap id="selectAllTechNamMap" type="map">
- <id property="father" column="father"/>
+ <id property="name" column="father"/>
<collection property="children" resultMap="selectAllTechNamTowMap" javaType="List"/>
</resultMap>
<resultMap id="selectAllTechNamTowMap" type="map">
<id property="id" column="id"/>
<result property="name" column="name"/>
- <result property="unit" column="unit"/>
+ <result property="name" column="unit"/>
</resultMap>
<select id="selectAllTechNam" resultMap="selectAllTechNamMap">
select id,
@@ -44,15 +44,15 @@
<!--鏂板鎶�鏈寚鏍囩淮鎶� 閫夋嫨宸ュ簭鍜屽伐鑹�-->
<resultMap id="chooseTechFathMap" type="map">
- <id property="techFather" column="techFather"/>
+ <id property="name" column="techFather"/>
<collection property="children" resultMap="chooseTechFathTowMap" javaType="List"/>
</resultMap>
<resultMap id="chooseTechFathTowMap" type="map">
- <id property="id" column="id"/>
- <result property="techName" column="techName"/>
+ <id property="id" column="techTemId"/>
+ <result property="name" column="techName"/>
</resultMap>
<select id="chooseTechFath" resultMap="chooseTechFathMap">
- select id,
+ select id techTemId,
name techName,
father techFather
from mom_ocean.technology_template
diff --git a/base-server/src/main/resources/mapper/TechniqueModelMapper.xml b/base-server/src/main/resources/mapper/TechniqueModelMapper.xml
new file mode 100644
index 0000000..aed3cf0
--- /dev/null
+++ b/base-server/src/main/resources/mapper/TechniqueModelMapper.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.TechniqueModelMapper">
+ <!--鏌ヨ鐢熶骇宸ヨ壓缁存姢鍒楄〃 鍙宠竟灞曠ず璇ュ伐鑹轰笅鑳戒娇鐢ㄧ殑璁惧鎵�鑳藉仛鐨勯」鐩�-->
+ <resultMap id="selectAllTequeMap" type="map">
+ <id property="name" column="dname"/>
+ <collection property="children" resultMap="selectAllTequeMaps" javaType="List"/>
+ </resultMap>
+ <resultMap id="selectAllTequeMaps" type="map">
+ <id property="id" column="id"/>
+ <result property="name" column="father"/>
+ <result property="name" column="unit"/>
+ <result property="name" column="name"/>
+ </resultMap>
+ <select id="selectAllTeque" resultMap="selectAllTequeMap">
+ select d.name dname,
+ qm.id,
+ cm.father,
+ unit,
+ cm.name
+ from mom_ocean.technique_model qm,
+ mom_ocean.technical_model cm,
+ mom_ocean.device d,
+ mom_ocean.technology_template tt
+ where qm.state = 1
+ and d.id = qm.device_id
+ and cm.id = qm.technical_model_id
+ and tt.id = qm.tech_tem_id
+ and qm.tech_tem_id = #{id}
+ </select>
+
+ <!--鏂板鐢熶骇宸ヨ壓缁存姢 閫夋嫨椤圭洰鐖剁被,瀛愮被,甯﹀嚭鍗曚綅-->
+ <resultMap id="chooseProMap" type="map">
+ <id property="name" column="father"/>
+ <collection property="children" resultMap="chooseProMaps" javaType="List"/>
+ </resultMap>
+ <resultMap id="chooseProMaps" type="map">
+ <id property="id" column="technicalModelId"/>
+ <result property="name" column="name"/>
+ <result property="name" column="unit"/>
+ </resultMap>
+ <select id="choosePro" resultMap="chooseProMap">
+ select father,
+ id technicalModelId,
+ name,
+ unit
+ from mom_ocean.technical_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏂板鐢熶骇宸ヨ壓缁存姢 閫夋嫨璁惧-->
+ <select id="chooseDeiv" resultType="java.util.Map">
+ select id devId,
+ name
+ from mom_ocean.device
+ where state = 1
+ and device_status in (1, 5)
+ and father = (select device_group
+ from mom_ocean.technology_template
+ where technology_template.state = 1
+ and technology_template.id = #{id})
+ </select>
+
+ <!--鏍规嵁鐢熶骇宸ヨ壓id鏌ョ湅璇︽儏-->
+ <select id="selecQueById" resultType="java.util.Map">
+ select tt.type,
+ tt.father techFather,
+ tt.name techName,
+ d.name dname,
+ cm.father,
+ cm.name,
+ unit
+ from mom_ocean.technique_model qm,
+ mom_ocean.technology_template tt,
+ mom_ocean.device d,
+ mom_ocean.technical_model cm
+ where qm.tech_tem_id = tt.id
+ and device_id = d.id
+ and cm.id = qm.technical_model_id
+ and qm.id = #{id}
+ </select>
+
+ <!--鎵归噺鍒犻櫎-->
+ <update id="delAllQue">
+ update mom_ocean.technique_model
+ set state=0
+ where id in (${ids})
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎-->
+ <update id="delQueByTechId">
+ update mom_ocean.technique_model
+ set state=0
+ where tech_tem_id = #{id}
+ </update>
+
+ <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+ <update id="delAllByTechId">
+ update mom_ocean.technique_model
+ set state=0
+ where tech_tem_id in (${ids})
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml b/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
index 803a3f4..2a8d27f 100644
--- a/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
+++ b/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
@@ -9,14 +9,14 @@
<!--鏌ヨ宸ヨ壓璺嚎鍒楄〃 宸﹁竟浜岀骇灞曠ず-->
<resultMap id="selectAllTechTemMap" type="map">
- <id property="elname" column="elname"/>
+ <id property="name" column="elname"/>
<collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
</resultMap>
<resultMap id="selectAllTechTemTowMap" type="map">
- <result property="father" column="father"/>
+ <result property="name" column="father"/>
</resultMap>
<select id="selectAllTechTem" resultMap="selectAllTechTemMap">
- select e.name elname,
+ select e.name elname,
father
from mom_ocean.technology_template t,
mom_ocean.element e,
@@ -49,10 +49,10 @@
<!--鏍规嵁id鏌ョ湅璇︽儏-->
<resultMap id="selecTechByIdMap" type="map">
- <id property="type" column="type"/>
- <result property="father" column="father"/>
+ <id property="id" column="type"/>
+ <result property="name" column="father"/>
<result property="name" column="name"/>
- <result property="deviceGroup" column="device_group"/>
+ <result property="name" column="device_group"/>
<collection property="children" resultMap="selecTechByIdsMap" javaType="List"/>
</resultMap>
<resultMap id="selecTechByIdsMap" type="map">
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/RawInsProductController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/RawInsProductController.java
similarity index 100%
rename from standard-server/src/main/java/com/yuanchu/mom/controller/RawInsProductController.java
rename to inspect-server/src/main/java/com/yuanchu/mom/controller/RawInsProductController.java
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
similarity index 61%
rename from standard-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
rename to inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
index 51635dc..a875079 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
@@ -15,12 +15,6 @@
*/
public interface RawInsProductMapper extends BaseMapper<RawInsProduct> {
- List<Map<String, Object>> selectInspectIdAndName();
- IPage<Map<String, Object>> selectPageDevice(Integer pageNo, Integer pageSize, String codeOrNameOrModel);
-
- Map<String, Object> inspectIdSelect(Integer inspectId);
-
- List<Map<String, Object>> parentClassification();
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/RawInsProduct.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/RawInsProduct.java
similarity index 100%
rename from standard-server/src/main/java/com/yuanchu/mom/pojo/RawInsProduct.java
rename to inspect-server/src/main/java/com/yuanchu/mom/pojo/RawInsProduct.java
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java
similarity index 68%
rename from standard-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java
rename to inspect-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java
index 92c76c8..c2b2f25 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/RawInsProductService.java
@@ -22,12 +22,6 @@
*/
void updaterawInsProduct(int userId, RawInsProduct rawInsProduct);
- List<Map<String, Object>> selectInspectIdAndName();
- IPage<Map<String, Object>> selectPageDevice(Integer pageNo, Integer pageSize, String codeOrNameOrModel);
-
- Map<String, Object> inspectIdSelect(Integer inspectId);
-
- List<Map<String, Object>> parentClassification();
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java
similarity index 85%
rename from standard-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java
rename to inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java
index 2cef33c..23e7853 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInsProductServiceImpl.java
@@ -42,26 +42,6 @@
rawInsProductMapper.update(rawInsProduct, updateWrapper);
}
- @Override
- public List<Map<String, Object>> selectInspectIdAndName() {
- return rawInsProductMapper.selectInspectIdAndName();
- }
-
- @Override
- public IPage<Map<String, Object>> selectPageDevice(Integer pageNo, Integer pageSize, String codeOrNameOrModel) {
- return rawInsProductMapper.selectPageDevice(pageNo, pageSize, codeOrNameOrModel);
- }
-
- @Override
- public Map<String, Object> inspectIdSelect(Integer inspectId) {
- return rawInsProductMapper.inspectIdSelect(inspectId);
- }
-
- @Override
- public List<Map<String, Object>> parentClassification() {
- return rawInsProductMapper.parentClassification();
- }
-
/*鍒ゆ柇妫�娴嬪�兼槸鍚︽弧瓒虫爣鍑嗗�煎拰鍐呮帶鍊肩殑瑕佹眰,濡傛灉涓嶆弧瓒冲垯妫�楠岀粨璁轰负涓嶅悎鏍�*/
private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) {
boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr);
diff --git a/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml b/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
new file mode 100644
index 0000000..f2dda01
--- /dev/null
+++ b/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.RawInsProductMapper">
+</mapper>
diff --git a/standard-server/pom.xml b/standard-server/pom.xml
index 85d7b0c..56ce9f0 100644
--- a/standard-server/pom.xml
+++ b/standard-server/pom.xml
@@ -33,6 +33,11 @@
<artifactId>user-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>com.yuanchu.mom</groupId>
+ <artifactId>base-server</artifactId>
+ <version>1.0.0</version>
+ </dependency>
</dependencies>
</project>
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
deleted file mode 100644
index f980a60..0000000
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.yuanchu.mom.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.yuanchu.mom.pojo.Device;
-import com.yuanchu.mom.service.DeviceService;
-import com.yuanchu.mom.service.RawInsProductService;
-import com.yuanchu.mom.service.UserService;
-import com.yuanchu.mom.utils.MyUtil;
-import com.yuanchu.mom.vo.Result;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 鍓嶇鎺у埗鍣�
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-07-31
- */
-@Api(tags = "鎶�鏈鐞�-->鏍囧噯MOM-->宸ヨ壓璺嚎")
-@RestController
-@RequestMapping("/device")
-public class DeviceController {
-
- @Autowired
- private DeviceService deviceService;
-
- @Autowired
- private UserService userService;
-
- @Autowired
- private RawInsProductService rawInsProductService;
-
- @ApiOperation(value = "鐐瑰嚮琛ㄦ牸涓殑閫夋嫨")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "deviceGroup", value = "璁惧缁�", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/select")
- public Result<?> selectTreeDevice(String deviceGroup){
- Map<String, Object> map = deviceService.selectTechnology(deviceGroup);
- return Result.success(map);
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @PostMapping("/add")
- public Result<?> addDevice(@RequestBody Device device){
- Boolean isUpdateSuccess = deviceService.addDevice(device);
- if (isUpdateSuccess){
- return Result.success("娣诲姞鎴愬姛锛�");
- }
- return Result.fail("娣诲姞澶辫触锛�");
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧锛氫繚绠′汉涓嬫媺妗�", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @GetMapping("/list_user")
- public Result<?> selectUserIdAndName(){
- List<Map<String, Object>> maps = userService.listUserIdAndName();
- return Result.success(maps);
- }
-
- @ApiOperation(value = "浜岀骇鏍�:榛樿鐢熶骇璁惧", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = String.class),
- @ApiImplicitParam(name = "search_class", value = "鎼滅储妗嗗唴瀹�", dataTypeClass = String.class)
- })
- @GetMapping("/two_tree")
- public Result<?> deviceTwoTree(@RequestParam(defaultValue = "1") Integer type, String search_class){
- List<Map<String, Object>> mapList= deviceService.deviceTwoTree(type, search_class);
- return Result.success(mapList);
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧锛氭楠岄」鐩笅鎷夋", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @GetMapping("/listInspect")
- public Result<?> selectInspectIdAndName(){
- List<Map<String, Object>> mapList = rawInsProductService.selectInspectIdAndName();
- return Result.success(mapList);
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧锛氭楠岄」鐩笅鎷夋", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "pageNo", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "codeOrNameOrModel", value = "缂栧彿鍚嶇О瑙勬牸鍨嬪彿", dataTypeClass = String.class)
- })
- @GetMapping("/page")
- public Result<?> selectPageDevice(Integer pageNo, Integer pageSize, String codeOrNameOrModel){
- IPage<Map<String, Object>> mapList = rawInsProductService.selectPageDevice(pageNo, pageSize, codeOrNameOrModel);
- return Result.success(mapList);
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧锛氭牴鎹楠岄」鐩甀D鏌ヨ鏁版嵁", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "inspectId", value = "妫�楠岄」鐩甀d", dataTypeClass = Integer.class, required = true)
- })
- @GetMapping("/inspectId")
- public Result<?> inspectIdSelect(Integer inspectId){
- Map<String, Object> map = rawInsProductService.inspectIdSelect(inspectId);
- return Result.success(map);
- }
-
- @ApiOperation(value = "鏂板浠櫒璁惧锛氭煡璇㈢埗绾у垎绫�", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @GetMapping("/parent_classification")
- public Result<?> parentClassification(){
- List<Map<String, Object>> map = rawInsProductService.parentClassification();
- return Result.success(map);
- }
-
- @ApiOperation(value = "瀹為獙瀹ゆā鍧楄〃鏍兼暟鎹�", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "type", value = "绫诲瀷:榛樿鐢熶骇璁惧", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "codeNameModel", value = "缂栧彿鍚嶇О瑙勬牸鍨嬪彿", dataTypeClass = String.class),
- @ApiImplicitParam(name = "deviceStatue", value = "璁惧鐘舵��", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "deviceId", value = "璁惧Id", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "fatherName", value = "鐖剁骇鍒嗙被", dataTypeClass = String.class)
- })
- @GetMapping("/table_list")
- public Result<?> tableData(String codeNameModel, @RequestParam(defaultValue = "1") Integer type, Integer deviceStatue, Integer deviceId, String fatherName){
- List<Map<String, Object>> map = deviceService.DevicePageList(codeNameModel, type, deviceStatue, deviceId, fatherName);
- return Result.success(map);
- }
-
- @ApiOperation(value = "鍒犻櫎瀹為獙瀹ゆā鍧楁暟鎹�", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "deviceId", value = "鏍规嵁璁惧Id鍒犻櫎", dataTypeClass = Integer.class)
- })
- @DeleteMapping("/delete")
- public Result<?> deviceDelete(Integer deviceId){
- Integer map = deviceService.deviceDelete(deviceId);
- if (map == 1){
- return Result.success("鍒犻櫎鎴愬姛锛�");
- }
- return Result.fail("鍒犻櫎澶辫触锛�");
- }
-
- @ApiOperation(value = "鍒犻櫎鏍戞ā鍧楁暟鎹�", tags = "QMS绠$悊-->瀹為獙瀹ょ鐞�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鏍规嵁璁惧Id鍒犻櫎", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "type", value = "璁惧绫诲瀷", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "deviceFather", value = "鏍规嵁璁惧鍒嗙被鍒犻櫎", dataTypeClass = String.class)
- })
- @DeleteMapping("/deleteIdorFather")
- public Result<?> deviceDeleteIdOrFather(Integer id, Integer type, String deviceFather){
- Integer map = deviceService.deviceDeleteIdOrFather(id, type, deviceFather);
- if (map >= 1){
- return Result.success("鍒犻櫎鎴愬姛锛�");
- }
- return Result.fail("鍒犻櫎澶辫触锛�");
- }
-}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/MaterialController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/MaterialController.java
index 30ac074..1d833ab 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/MaterialController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/MaterialController.java
@@ -1,22 +1,19 @@
package com.yuanchu.mom.controller;
-import com.yuanchu.mom.pojo.dto.MaterialTreeDto;
-import com.yuanchu.mom.service.MaterialService;
+import com.yuanchu.mom.pojo.dto.MaterialDto;
+import com.yuanchu.mom.service.*;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
-import java.util.List;
-import java.util.Map;
+import javax.annotation.Resource;
-@Api(tags = "鎶�鏈鐞�-->鏍囧噯MOM-->鐗╂枡妯″潡")
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM")
@RestController
@RequestMapping("/material")
public class MaterialController {
@@ -24,10 +21,78 @@
@Autowired
private MaterialService materialService;
- @ApiOperation(value = "鏌ヨ鐗╂枡鐨勬爲")
+ @Resource
+ TechnologyService technologyService;
+
+ @Resource
+ ProductService productService;
+
+ @Resource
+ MbomService mbomService;
+
+ @Resource
+ TechniqueService techniqueService;
+
+ @ApiOperation(value = "宸︿晶浜旂骇鏍戝睍绀�")
@GetMapping("/selectTreeByMaterial")
- public Result<List<MaterialTreeDto>> selectTreeByMaterial(){
+ public Result selectTreeByMaterial() {
return Result.success(materialService.selectTreeByMaterial());
}
+ @ApiOperation("(1,2绾�)鏂板-->鐗╂枡,鏍囧噯,鍨嬪彿")
+ @PostMapping("/add")
+ public Result<?> addMaterial(@Validated @RequestBody MaterialDto materialDto) {
+ materialService.addMaterial(materialDto);
+ return Result.success("娣诲姞鐗╂枡銆�" + materialDto.getName() + "銆戞垚鍔�");
+ }
+
+ @ApiOperation(value = "鍙充晶鏁版嵁灞曠ず-->閫夋嫨鐗堟湰")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "specificationsId", value = "鍨嬪彿id", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "type", value = "绫诲瀷(0:宸ヨ壓璺嚎;1:鎶�鏈寚鏍�;2:鐗╂枡娓呭崟;3:鐢熶骇宸ヨ壓)", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectVersion")
+ public Result selectVersion(Integer type, Integer specificationsId) {
+ switch (type) {
+ case 0:
+ //宸ヨ壓璺嚎
+ return Result.success(technologyService.selectVerByTec(specificationsId));
+ case 1:
+ //鎶�鏈寚鏍�
+ return Result.success(productService.selectVerByPro(specificationsId));
+ case 2:
+ //鐗╂枡娓呭崟
+ return Result.success(mbomService.selectVerByMbom(specificationsId));
+ case 3:
+ //鐢熶骇宸ヨ壓
+ return Result.success(techniqueService.selectVerByTeq(specificationsId));
+ }
+ return Result.fail("娌℃湁璇ョ被鍨�!");
+ }
+
+ @ApiOperation(value = "鍙充晶鏁版嵁灞曠ず")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "specificationsId", value = "鍨嬪彿id", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "type", value = "绫诲瀷(0:宸ヨ壓璺嚎;1:鎶�鏈寚鏍�;2:鐗╂枡娓呭崟;3:鐢熶骇宸ヨ壓)", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "version", value = "鐗堟湰(榛樿鏈�鏂�)", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "message", value = "鎼滅储鍐呭", dataTypeClass = String.class)
+ })
+ @GetMapping("/selectAll")
+ public Result selectAll(Integer specificationsId, Integer type, Integer version,String message) {
+ switch (type) {
+ case 0:
+ //宸ヨ壓璺嚎
+ return Result.success(technologyService.selectAllTec(specificationsId, version,message));
+ case 1:
+ //鎶�鏈寚鏍�
+ return Result.success(productService.selectAllPro(specificationsId, version,message));
+ case 2:
+ //鐗╂枡娓呭崟
+ return Result.success(mbomService.selectAllMbom(specificationsId, version,message));
+ case 3:
+ //鐢熶骇宸ヨ壓
+ return Result.success(techniqueService.selectAllTeq(specificationsId, version,message));
+ }
+ return Result.fail("娌℃湁璇ョ被鍨�!");
+ }
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/MbomController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/MbomController.java
new file mode 100644
index 0000000..9449ea8
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/MbomController.java
@@ -0,0 +1,25 @@
+package com.yuanchu.mom.controller;
+
+
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.MbomService;
+
+
+/**
+ * 鏍囧噯BOM-鐗╂枡娓呭崟琛�(Mbom)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-31 11:58:23
+ */
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM-->鐗╂枡娓呭崟")
+@RestController
+@RequestMapping("/mbom")
+public class MbomController {
+
+ @Autowired
+ private MbomService mbomService;
+
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/ProductController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/ProductController.java
index f1870a8..404440d 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/ProductController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/ProductController.java
@@ -14,7 +14,7 @@
import java.util.List;
-@Api(tags = "鎶�鏈鐞�-->鏍囧噯MOM-->椤圭洰妯″潡")
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM-->鎶�鏈寚鏍�(妫�楠岄」鐩�)")
@RestController
@RequestMapping("/product")
public class ProductController {
@@ -22,14 +22,4 @@
@Autowired
private ProductService productService;
- @ApiOperation(value = "椤圭洰琛ㄦ牸浜岀骇鏍�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "project", value = "椤圭洰", dataTypeClass = String.class),
- @ApiImplicitParam(name = "specifications", value = "鍨嬪彿ID", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/selectTreeByMaterial")
- public Result<?> selectTreeProduct(String specifications, String project){
- List<ProductDto> map = productService.selectTreeProduct(specifications, project);
- return Result.success(map);
- }
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/SpecificationsController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/SpecificationsController.java
new file mode 100644
index 0000000..e9f2a46
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/SpecificationsController.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.SpecificationsDto;
+import com.yuanchu.mom.pojo.dto.StandardDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.SpecificationsService;
+
+
+/**
+ * 鍨嬪彿琛�(Specifications)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-31 09:35:56
+ */
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM")
+@RestController
+@RequestMapping("/specifications")
+public class SpecificationsController {
+
+ @Autowired
+ private SpecificationsService specificationsService;
+
+ @ApiOperation("(4绾�)鏂板-->鍨嬪彿")
+ @PostMapping("/add")
+ public Result<?> addSpecifications(@Validated @RequestBody SpecificationsDto specificationsDto) {
+ specificationsService.addSpecifications(specificationsDto);
+ return Result.fail("娣诲姞鍨嬪彿銆�"+ specificationsDto.getSpecifications() +"銆戞垚鍔燂紒");
+ }
+
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/StandardController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/StandardController.java
new file mode 100644
index 0000000..cb39b4c
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/StandardController.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.MaterialDto;
+import com.yuanchu.mom.pojo.dto.StandardDto;
+import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.StandardService;
+
+
+/**
+ * 鏍囧噯琛�(Standard)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-31 09:35:38
+ */
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM")
+@RestController
+@RequestMapping("/standard")
+public class StandardController {
+
+ @Autowired
+ private StandardService standardService;
+
+ @ApiOperation("(3绾�)鏂板-->鏍囧噯,鍨嬪彿")
+ @PostMapping("/add")
+ public Result<?> addStandard(@Validated @RequestBody StandardDto standardDto) {
+ standardService.addStandard(standardDto);
+ return Result.fail("娣诲姞鏍囧噯銆�"+ standardDto.getStandard() +"銆戞垚鍔燂紒");
+ }
+
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java
new file mode 100644
index 0000000..24831fd
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java
@@ -0,0 +1,25 @@
+package com.yuanchu.mom.controller;
+
+
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.yuanchu.mom.service.TechniqueService;
+
+
+/**
+ * 鏍囧噯BOM-鐢熶骇宸ヨ壓琛�(Technique)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-31 11:57:52
+ */
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM-->鐢熶骇宸ヨ壓")
+@RestController
+@RequestMapping("/technique")
+public class TechniqueController {
+
+ @Autowired
+ private TechniqueService techniqueService;
+
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
index d9f788f..b56b93d 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
@@ -24,7 +24,7 @@
* @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
* @since 2023-07-31
*/
-@Api(tags = "鎶�鏈鐞�-->鏍囧噯MOM-->宸ヨ壓璺嚎")
+@Api(tags = "鎶�鏈鐞�-->鏍囧噯BOM-->宸ヨ壓璺嚎")
@RestController
@RequestMapping("/technology")
public class TechnologyController {
@@ -32,14 +32,5 @@
@Autowired
private TechnologyService technologyService;
- @ApiOperation(value = "閫夋嫨宸ヨ壓璺嚎鍑虹幇鐨勮〃鏍兼煡璇�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "technologyName", value = "宸ヨ壓鍚嶇О", dataTypeClass = String.class),
- @ApiImplicitParam(name = "specificationId", value = "瑙勬牸ID", dataTypeClass = String.class,required = true)
- })
- @GetMapping("/select")
- public Result<?> selectTechnology(String technologyName, String specificationId){
- List<Map<String, Object>> map = technologyService.selectTechnology(technologyName);
- return Result.success(map);
- }
+
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java
deleted file mode 100644
index 6193bba..0000000
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/DeviceMapper.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.yuanchu.mom.mapper;
-
-import com.yuanchu.mom.pojo.Device;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * Mapper 鎺ュ彛
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-07-31
- */
-public interface DeviceMapper extends BaseMapper<Device> {
-
- List<Map<String, Object>> deviceTwoTree(Integer type, String search_class);
-
- List<Map<String, Object>> DevicePageList(String codeNameModel, Integer type, Integer deviceStatue, Integer deviceId, String fatherName);
-
- List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup);
-
- //閫夋嫨璁惧缁�
- List<Map<String, Object>> chooseDevGroup();
-
-}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/MaterialMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/MaterialMapper.java
index 7d429c1..47d4ae2 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/MaterialMapper.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/MaterialMapper.java
@@ -2,8 +2,6 @@
import com.yuanchu.mom.pojo.Material;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.yuanchu.mom.pojo.dto.MaterialTreeDto;
-import org.apache.ibatis.annotations.MapKey;
import java.util.List;
import java.util.Map;
@@ -17,14 +15,18 @@
public interface MaterialMapper extends BaseMapper<Material> {
- @MapKey("id")
- List<MaterialTreeDto> selectTreeByMaterial();
+
+ //鏍囧噯MOM-->宸︿晶浜旂骇鏍戝睍绀�
+ List<Map<String,Object>> selectTreeByMaterial();
//鏍规嵁鐗╂枡鍚嶇О鏌ヨ鐗╂枡id鍜岀墿鏂欑紪鐮�
List<Material> selectMcodeId(String name);
//鏍规嵁鐗╂枡鍚嶇О鍜岀墿鏂欑紪鐮佹煡璇㈢墿鏂檌d,瑙勬牸淇℃伅鍜屽瀷鍙蜂俊鎭�
List<Map> selectIdByCoNa(String name, String code);
+
+ //鏍规嵁鏍囧噯id鏌ヨ鐗╂枡
+ Material selFath(Integer id);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/MbomMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/MbomMapper.java
new file mode 100644
index 0000000..babe5a2
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/MbomMapper.java
@@ -0,0 +1,23 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.Mbom;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐗╂枡娓呭崟琛�(Mbom)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-31 11:58:23
+ */
+public interface MbomMapper extends BaseMapper<Mbom> {
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ List<Integer> selectVerByMbom(Integer specificationsId);
+
+ //鍙充晶鏁版嵁灞曠ず-->鐗╂枡娓呭崟
+ List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message);
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/ProductMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/ProductMapper.java
index 55edfae..d78d10a 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/ProductMapper.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/ProductMapper.java
@@ -15,7 +15,14 @@
*/
public interface ProductMapper extends BaseMapper<Product> {
- List<ProductDto> selectTreeProduct(String specifications, String project);
+ //鏍规嵁鍨嬪彿id鏌ヨ椤圭洰(鎶�鏈寚鏍�)
+ List<Map<String, Object>> selectProductList(Integer specificationsId);
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ List<Integer> selectVerByPro(Integer specificationsId);
+
+ //鍙充晶鏁版嵁灞曠ず-->鎶�鏈寚鏍�(妫�楠岄」鐩�)
+ List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java
new file mode 100644
index 0000000..bde10e3
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java
@@ -0,0 +1,23 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.Technique;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐢熶骇宸ヨ壓琛�(Technique)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-31 11:57:52
+ */
+public interface TechniqueMapper extends BaseMapper<Technique> {
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ List<Integer> selectVerByTeq(Integer specificationsId);
+
+ //鍙充晶鏁版嵁灞曠ず-->鐢熶骇宸ヨ壓
+ List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message);
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/mapper/TechnologyMapper.java b/standard-server/src/main/java/com/yuanchu/mom/mapper/TechnologyMapper.java
index 719f2fb..db1af29 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/TechnologyMapper.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/TechnologyMapper.java
@@ -3,6 +3,9 @@
import com.yuanchu.mom.pojo.Technology;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import java.util.List;
+import java.util.Map;
+
/**
* <p>
* Mapper 鎺ュ彛
@@ -13,4 +16,9 @@
*/
public interface TechnologyMapper extends BaseMapper<Technology> {
+ //鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
+ List<Integer> selectVerByTec(Integer specificationsId);
+
+ //鍙充晶鏁版嵁灞曠ず-->宸ヨ壓璺嚎
+ List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Material.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/Material.java
index adff440..6656d43 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/Material.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/Material.java
@@ -7,6 +7,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
import lombok.Data;
/**
@@ -33,26 +34,30 @@
private String name;
/**
- * 0锛氬師鏉愭枡锛�1锛氭垚鍝侊紱2锛氬崐鎴愬搧
+ * 1锛氭垚鍝侊紱2锛氬崐鎴愬搧
*/
private Integer type;
+ /**
+ * 0锛氭鑳惰繛鎺ュ櫒锛�1锛氶噾灞炶繛鎺ュ櫒锛�2锛氭箍鎻掓嫈鐢佃繛鎺ュ櫒锛�3锛氬垎鏀粍浠�
+ **/
+ private Integer father;
+
+
@ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
- @TableLogic(value = "1", delval = "0")
private Integer state;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
- @ApiModelProperty(value = "涔愯閿�", hidden = true)
- @Version
+ //鐗堟湰
private Integer version;
@TableField(exist = false)
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Mbom.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/Mbom.java
new file mode 100644
index 0000000..be586bb
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/Mbom.java
@@ -0,0 +1,89 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鏍囧噯BOM-鐗╂枡娓呭崟琛�(Mbom)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-31 11:58:24
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("mbom")
+public class Mbom implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓璺嚎id
+ **/
+ private Integer technologyId;
+
+ /**
+ * 鍘熸潗鏂欏悕绉�
+ **/
+ private String name;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 鏁伴噺
+ **/
+ private Integer num;
+
+ /**
+ * 渚涘簲鍟�
+ **/
+ private String supplier;
+
+ /**
+ * 璐ㄩ噺杩芥函鍙�
+ **/
+ private String qualityTraceability;
+
+ /**
+ * (鍘熸潗鏂欑殑)瑙勬牸鍨嬪彿
+ **/
+ private String specifications;
+
+ /**
+ * 鐗堟湰
+ **/
+ private Integer version;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Product.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/Product.java
index 85018af..09940bd 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/Product.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/Product.java
@@ -48,27 +48,25 @@
private String internal;
@ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
- @TableLogic(value = "1", delval = "0")
private Integer state;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
- @ApiModelProperty(value = "涔愯閿�", hidden = true)
- @Version
+ //鐗堟湰
private Integer version;
/**
- * 鍏宠仈 鍨嬪彿id
+ * 鍏宠仈 宸ヨ壓璺嚎id
*/
- private Integer specificationsId;
+ private Integer technologyId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Technique.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/Technique.java
new file mode 100644
index 0000000..d77d3d2
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/Technique.java
@@ -0,0 +1,79 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鏍囧噯BOM-鐢熶骇宸ヨ壓琛�(Technique)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-31 11:57:53
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("technique")
+public class Technique implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓璺嚎id
+ **/
+ private Integer technologyId;
+
+ /**
+ * 璁惧鍚嶇О
+ **/
+ private String device;
+
+ /**
+ * 妫�楠岄」鐩�(鐖剁被)
+ **/
+ private String productFather;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 鎸囨爣(瀛愮被椤圭洰)
+ **/
+ private String product;
+
+ /**
+ * 鐗堟湰
+ **/
+ private Integer version;
+
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/Technology.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/Technology.java
index 21389a2..04140ad 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/Technology.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/Technology.java
@@ -40,25 +40,26 @@
@ApiModelProperty(value = "璁惧缁�")
private String deviceGroup;
- @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
- @TableLogic(value = "1", delval = "0")
- private Integer state;
-
- @TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
- private Date createTime;
-
- @TableField(fill = FieldFill.INSERT_UPDATE)
- @ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
- private Date updateTime;
-
@ApiModelProperty(value = "鍏宠仈 鍨嬪彿id")
private Integer specificationsId;
@ApiModelProperty(value = "鐢熶骇瀹氶(涓�/澶�)")
private Integer productionQuota;
+ @ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
+ private Integer state;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "鏇存柊鏃堕棿", hidden = true)
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date updateTime;
+
+
+
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialDto.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialDto.java
new file mode 100644
index 0000000..6d43cad
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialDto.java
@@ -0,0 +1,33 @@
+package com.yuanchu.mom.pojo.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+
+@Data
+//鏍囧噯BOM鏂板鍙傛暟(1,2绾ф柊澧�)
+public class MaterialDto {
+
+ @JsonSerialize
+ @NotNull(message = "绫诲瀷(鎴愬搧鍗婃垚鍝�)涓嶈兘涓虹┖")
+ private Integer type;
+
+ @JsonSerialize
+ @NotNull(message = "浜у搧澶х被(4澶х被)涓嶈兘涓虹┖")
+ private Integer father;
+
+ @JsonSerialize
+ @NotBlank(message = "鐗╂枡鍚嶇О涓嶈兘涓虹┖")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "鏍囧噯涓嶈兘涓虹┖")
+ private String standard;
+
+ @JsonSerialize
+ @NotBlank(message = "鍨嬪彿涓嶈兘涓虹┖")
+ private String specifications;
+
+}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialTreeDto.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialTreeDto.java
deleted file mode 100644
index 1b26fcb..0000000
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/MaterialTreeDto.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.yuanchu.mom.pojo.dto;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class MaterialTreeDto {
-
- private Integer id;
-
- private String name;
-
- private Integer type;
-
- private String code = "[2]";
-
- List<StandardDto> children;
-
-}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/SpecificationsDto.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/SpecificationsDto.java
index 62ffdb6..eec157c 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/SpecificationsDto.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/SpecificationsDto.java
@@ -1,15 +1,22 @@
package com.yuanchu.mom.pojo.dto;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
import java.util.List;
@Data
-class SpecificationsDto {
+//鏍囧噯BOM鏂板鍙傛暟(4绾ф柊澧�)
+public class SpecificationsDto {
+
+ @JsonSerialize
+ @NotNull(message = "鏍囧噯id涓嶈兘涓虹┖")
private Integer id;
- private String name;
-
- private String code = "[4]";
+ @JsonSerialize
+ @NotBlank(message = "鍨嬪彿涓嶈兘涓虹┖")
+ private String specifications;
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/StandardDto.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/StandardDto.java
index 2796d34..f49fc1b 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/StandardDto.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/StandardDto.java
@@ -1,17 +1,26 @@
package com.yuanchu.mom.pojo.dto;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
import java.util.List;
@Data
-class StandardDto {
+//鏍囧噯BOM鏂板鍙傛暟(3绾ф柊澧�)
+public class StandardDto {
+
+ @JsonSerialize
+ @NotNull(message = "鐗╂枡id涓嶈兘涓虹┖")
private Integer id;
- private String name;
+ @JsonSerialize
+ @NotBlank(message = "鏍囧噯涓嶈兘涓虹┖")
+ private String standard;
- private String code = "[3]";
-
- List<SpecificationsDto> children;
+ @JsonSerialize
+ @NotBlank(message = "鍨嬪彿涓嶈兘涓虹┖")
+ private String specifications;
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/DeviceService.java b/standard-server/src/main/java/com/yuanchu/mom/service/DeviceService.java
deleted file mode 100644
index 8d58673..0000000
--- a/standard-server/src/main/java/com/yuanchu/mom/service/DeviceService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.yuanchu.mom.service;
-
-import com.yuanchu.mom.pojo.Device;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 鏈嶅姟绫�
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-07-31
- */
-public interface DeviceService extends IService<Device> {
-
- Map<String, Object> selectTechnology(String deviceGroup);
-
- List<Device> selectDevice();
-
- /**
- * 鏍规嵁璁惧id鏌ヨ璁惧鍚嶇О
- * @param id
- */
- String getDeviceNameById(Integer id);
-
- @Transactional(rollbackFor = Exception.class)
- Boolean addDevice(Device device);
-
- List<Map<String, Object>> deviceTwoTree(Integer type, String search_class);
-
- List<Map<String, Object>> DevicePageList(String codeNameModel, Integer type, Integer deviceStatue, Integer deviceId, String fatherName);
-
- Integer deviceDelete(Integer deviceId);
-
- List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup);
-
- Integer deviceDeleteIdOrFather(Integer id, Integer type, String deviceFather);
-
- List<Map<String, Object>> selectDeviceIdAndName();
-}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java b/standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java
index 4268c33..1951cea 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java
@@ -2,7 +2,7 @@
import com.yuanchu.mom.pojo.Material;
import com.baomidou.mybatisplus.extension.service.IService;
-import com.yuanchu.mom.pojo.dto.MaterialTreeDto;
+import com.yuanchu.mom.pojo.dto.MaterialDto;
import java.util.List;
import java.util.Map;
@@ -14,7 +14,19 @@
*/
public interface MaterialService extends IService<Material> {
- List<MaterialTreeDto> selectTreeByMaterial();
+
+ /**
+ * 鏍囧噯MOM-->宸︿晶浜旂骇鏍戝睍绀�
+ * @return
+ */
+ List<Map<String,Object>> selectTreeByMaterial();
+
+ /**
+ * (1,2绾�)鏂板-->鐗╂枡,鏍囧噯,鍨嬪彿
+ * @param materialDto
+ * @return
+ */
+ void addMaterial(MaterialDto materialDto);
/**
* 鏍规嵁鐗╂枡鍚嶇О鏌ヨ鐗╂枡id鍜岀墿鏂欑紪鐮�
@@ -30,8 +42,9 @@
* @return
*/
List<Map> selectIdByCoNa(String name, String code);
+
/**
- * 妫�楠屾ā鍧�-->OMS绠$悊-->鎴愬搧妫�楠�-->鏂板(椤圭洰鍚嶇О涓嬫媺妗嗭細Id涓庡悕绉帮紝缂栫爜)
+ * 妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(椤圭洰鍚嶇О涓嬫媺妗嗭細Id涓庡悕绉帮紝缂栫爜)
*/
List<Map<String, Object>> selectMaterialIdAndNameAndCode();
@@ -40,4 +53,5 @@
* @return
*/
List<Material> selectMaterial();
+
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/MbomService.java b/standard-server/src/main/java/com/yuanchu/mom/service/MbomService.java
new file mode 100644
index 0000000..d41d71f
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/MbomService.java
@@ -0,0 +1,32 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.Mbom;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐗╂枡娓呭崟琛�(Mbom)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-31 11:58:23
+ */
+public interface MbomService extends IService<Mbom> {
+
+ /**
+ * 鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ * @param specificationsId
+ * @return
+ */
+ List<Integer> selectVerByMbom(Integer specificationsId);
+
+ /**
+ *鍙充晶鏁版嵁灞曠ず-->鐗╂枡娓呭崟
+ * @param specificationsId
+ * @param version
+ * @return
+ */
+ List<Map<String,Object>> selectAllMbom(Integer specificationsId, Integer version,String message);
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/ProductService.java b/standard-server/src/main/java/com/yuanchu/mom/service/ProductService.java
index 99cbeff..ffa0dc2 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/ProductService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/ProductService.java
@@ -14,7 +14,25 @@
*/
public interface ProductService extends IService<Product> {
- List<ProductDto> selectTreeProduct(String specifications, String project);
-
+ /**
+ * 鏍规嵁鍨嬪彿id鏌ヨ椤圭洰(鎶�鏈寚鏍�)
+ * @param specificationsId
+ * @return
+ */
List<Map<String, Object>> selectProductList(Integer specificationsId);
+
+ /**
+ * 鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
+ * @param specificationsId
+ * @return
+ */
+ List<Integer> selectVerByPro(Integer specificationsId);
+
+ /**
+ *鍙充晶鏁版嵁灞曠ず-->鎶�鏈寚鏍�(妫�楠岄」鐩�)
+ * @param specificationsId
+ * @param version
+ * @return
+ */
+ List<Map<String,Object>> selectAllPro(Integer specificationsId, Integer version,String message);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java b/standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java
index bcba5e7..a89d774 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java
@@ -4,6 +4,7 @@
import com.yuanchu.mom.pojo.Material;
import com.yuanchu.mom.pojo.Specifications;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.dto.SpecificationsDto;
import java.util.List;
@@ -30,4 +31,11 @@
* 妫�楠屾ā鍧�-->OMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佽鏍煎瀷鍙风殑Id涓庡悕绉�)
*/
List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId);
+
+ /**
+ * (4绾�)鏂板-->鍨嬪彿
+ * @param specificationsDto
+ */
+ void addSpecifications(SpecificationsDto specificationsDto);
+
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/StandardService.java b/standard-server/src/main/java/com/yuanchu/mom/service/StandardService.java
index 8461cf4..8a8f37f 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/StandardService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/StandardService.java
@@ -2,6 +2,7 @@
import com.yuanchu.mom.pojo.Standard;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.dto.StandardDto;
/**
* @author Administrator
@@ -10,4 +11,9 @@
*/
public interface StandardService extends IService<Standard> {
+ /**
+ * (3绾�)鏂板-->鏍囧噯,鍨嬪彿
+ * @param standardDto
+ */
+ void addStandard(StandardDto standardDto);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java b/standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java
new file mode 100644
index 0000000..45dddad
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java
@@ -0,0 +1,32 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.Technique;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐢熶骇宸ヨ壓琛�(Technique)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-31 11:57:53
+ */
+public interface TechniqueService extends IService<Technique> {
+
+ /**
+ * 鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ * @param specificationsId
+ * @return
+ */
+ List<Integer> selectVerByTeq(Integer specificationsId);
+
+ /**
+ * 鍙充晶鏁版嵁灞曠ず-->鐢熶骇宸ヨ壓
+ * @param specificationsId
+ * @param version
+ * @return
+ */
+ List<Map<String,Object>> selectAllTeq(Integer specificationsId, Integer version,String message);
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java b/standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java
index b6935c8..6f709cc 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java
@@ -16,5 +16,17 @@
*/
public interface TechnologyService extends IService<Technology> {
- List<Map<String, Object>> selectTechnology(String technologyName);
+ /**
+ * 鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
+ * @return
+ */
+ List<Integer> selectVerByTec(Integer specificationsId);
+
+ /**
+ * 鍙充晶鏁版嵁灞曠ず-->宸ヨ壓璺嚎
+ * @param specificationsId 鍨嬪彿id
+ * @param version 鐗堟湰
+ * @return
+ */
+ List<Map<String,Object>> selectAllTec(Integer specificationsId, Integer version,String message);
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
deleted file mode 100644
index 4d21f86..0000000
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.yuanchu.mom.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.yuanchu.mom.pojo.Device;
-import com.yuanchu.mom.mapper.DeviceMapper;
-import com.yuanchu.mom.pojo.RawInsProduct;
-import com.yuanchu.mom.service.DeviceService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.service.RawInsProductService;
-import com.yuanchu.mom.utils.MyUtil;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 鏈嶅姟瀹炵幇绫�
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-07-31
- */
-@Service
-public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {
-
- @Resource
- private DeviceMapper deviceMapper;
-
- @Resource
- private RawInsProductService rawInsProductService;
-
- @Override
- public Map<String, Object> selectTechnology(String deviceGroup) {
- String[] split = deviceGroup.split("\\+");
- Map<String, Object> map = new HashMap<>();
- for (String str : split){
- LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(Device::getFather, str);
- wrapper.select(Device::getId, Device::getName);
- List<Map<String, Object>> maps = deviceMapper.selectMaps(wrapper);
- map.put("first", str);
- map.put("children", maps);
- }
- return map;
- }
-
- //鏌ヨ鎵�鏈夎澶�
- @Override
- public List<Device> selectDevice() {
- return deviceMapper.selectList(new QueryWrapper<>());
- }
-
- //鏍规嵁璁惧id鑾峰彇璁惧鍚嶇О
- @Override
- public String getDeviceNameById(Integer id) {
- Device device = deviceMapper.selectById(id);
- return device.getName();
- }
-
- @Override
- public Boolean addDevice(Device device) {
- int insert = deviceMapper.insert(device);
- if (insert == 1){
- LambdaUpdateWrapper<RawInsProduct> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.eq(RawInsProduct::getId, device.getRawInsProductId());
- updateWrapper.set(RawInsProduct::getDeviceId, device.getId());
- return rawInsProductService.update(updateWrapper);
- }
-
- return false;
- }
-
- @Override
- public List<Map<String, Object>> deviceTwoTree(Integer type, String search_class) {
- return deviceMapper.deviceTwoTree(type, search_class);
- }
-
- @Override
- public List<Map<String, Object>> DevicePageList(String codeNameModel,Integer type, Integer deviceStatue, Integer deviceId, String fatherName) {
- return deviceMapper.DevicePageList(codeNameModel, type, deviceStatue, deviceId, fatherName);
- }
-
- @Override
- public Integer deviceDelete(Integer deviceId) {
- LambdaUpdateWrapper<Device> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.eq(Device::getId, deviceId);
- updateWrapper.set(Device::getState, 0);
- return deviceMapper.update(new Device(), updateWrapper);
- }
-
- @Override
- public Integer deviceDeleteIdOrFather(Integer id, Integer type, String deviceFather) {
- LambdaUpdateWrapper<Device> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.set(Device::getState, 0);
- if (id == null && deviceFather == null) {
- return 0;
- } else if (id != null) {
- updateWrapper.eq(Device::getId, id);
- } else if (deviceFather != null) {
- updateWrapper.eq(Device::getType, type);
- updateWrapper.eq(Device::getFather, deviceFather);
- }
- return deviceMapper.update(new Device(), updateWrapper);
- }
-
- //鏍规嵁鍒嗙粍鏌ヨ璁惧鍚�
- @Override
- public List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup) {
- return deviceMapper.getDeviceNameByGroup(deviceGroup);
- }
-
- @Override
- public List<Map<String, Object>> selectDeviceIdAndName() {
- LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
- wrapper.select(Device::getId, Device::getName, Device::getCode);
- return deviceMapper.selectMaps(wrapper);
- }
-}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java
index 722e4c3..ed84a91 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java
@@ -3,16 +3,19 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.pojo.Material;
-import com.yuanchu.mom.pojo.dto.MaterialTreeDto;
-import com.yuanchu.mom.service.MaterialService;
-import com.yuanchu.mom.mapper.MaterialMapper;
-import com.yuanchu.mom.utils.JackSonUtil;
+import com.yuanchu.mom.mapper.*;
+import com.yuanchu.mom.pojo.*;
+import com.yuanchu.mom.pojo.dto.MaterialDto;
+import com.yuanchu.mom.service.*;
+import com.yuanchu.mom.utils.MyUtil;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* @author Administrator
@@ -20,19 +23,139 @@
* @createDate 2023-07-26 15:52:50
*/
@Service
-public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material>
- implements MaterialService {
+public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
@Resource
MaterialMapper materialMapper;
+ @Resource
+ StandardMapper standardMapper;
+
+ @Resource
+ SpecificationsMapper specificationsMapper;
+
+ @Resource
+ TechnologyService technologyService;
+
+ @Resource
+ TechnologyTemplateMapper technologyTemplateMapper;
+
+ @Resource
+ ProductService productService;
+
+ @Resource
+ TechnicalModelMapper technicalModelMapper;
+
+ @Resource
+ MbomService mbomService;
+
+ @Resource
+ MbomModelMapper mbomModelMapper;
+
+ @Resource
+ TechniqueService techniqueService;
+
+ @Resource
+ TechniqueModelMapper techniqueModelMapper;
+
+ @Resource
+ DeviceMapper deviceMapper;
+
+ //鏍囧噯MOM-->宸︿晶浜旂骇鏍戝睍绀�
@Override
- public List<MaterialTreeDto> selectTreeByMaterial() {
- List<MaterialTreeDto> materialTreeDtos = materialMapper.selectTreeByMaterial();
- materialTreeDtos.forEach(System.out::println);
+ public List<Map<String, Object>> selectTreeByMaterial() {
return materialMapper.selectTreeByMaterial();
}
+ //(1,2绾�)鏂板-->鐗╂枡,鏍囧噯,鍨嬪彿
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void addMaterial(MaterialDto materialDto) {
+ /*鏂板鐗╂枡琛�*/
+ Material material = new Material();
+ material.setCode(MyUtil.getTimeSixNumberCode("ML", "ML"));
+ material.setName(materialDto.getName());
+ material.setType(materialDto.getType());
+ material.setFather(materialDto.getFather());
+ materialMapper.insert(material);
+ /*鏂板鏍囧噯琛�*/
+ Standard standard = new Standard();
+ standard.setName(materialDto.getStandard());
+ standard.setMaterial_id(material.getId());
+ standardMapper.insert(standard);
+ /*鏂板鍨嬪彿琛�*/
+ Specifications specifications = new Specifications();
+ specifications.setName(materialDto.getSpecifications());
+ specifications.setStandardId(standard.getId());
+ specificationsMapper.insert(specifications);
+ /*鏂板鏍囧噯BOM-->宸ヨ壓璺嚎(鎵归噺娣诲姞)*/
+ List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", materialDto.getFather()));
+ List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> {
+ Technology technology = new Technology();
+ technology.setSpecificationsId(specifications.getId());
+ technology.setFather(technologyTemplate.getFather());
+ technology.setName(technologyTemplate.getName());
+ technology.setDeviceGroup(technologyTemplate.getDeviceGroup());
+ return technology;
+ }).collect(Collectors.toList());
+ technologyService.saveBatch(technologyList);
+ /*鏂板鏍囧噯BOM-->鎶�鏈寚鏍�(鎵归噺娣诲姞)*/
+ //鏂板鐨勫伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList());
+ //鍩虹鏁版嵁涓伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList());
+ //涓よ�呴暱搴︿竴瀹氫竴鏍�
+ List<Product> productList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechnicalModel technicalModel : technicalModelList) {
+ Product product = new Product();
+ product.setFather(technicalModel.getFather());
+ product.setName(technicalModel.getName());
+ product.setUnit(technicalModel.getUnit());
+ product.setTechnologyId(technologyIds.get(i));
+ productList.add(product);
+ }
+ }
+ productService.saveBatch(productList);
+ /*鏂板鏍囧噯BOM-->鐗╂枡娓呭崟(鎵归噺娣诲姞)*/
+ List<Mbom> mbomList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (MbomModel mbomModel : mbomModelList) {
+ Mbom mbom = new Mbom();
+ mbom.setUnit(mbomModel.getUnit());
+ mbom.setName(mbomModel.getName());
+ mbom.setSupplier(mbomModel.getSupplier());
+ mbom.setQualityTraceability(mbomModel.getQualityTraceability());
+ mbom.setSpecifications(mbomModel.getSpecifications());
+ mbom.setTechnologyId(technologyIds.get(i));
+ mbomList.add(mbom);
+ }
+ }
+ mbomService.saveBatch(mbomList);
+ /*鏂板鏍囧噯BOM-->鐢熶骇宸ヨ壓(鎵归噺娣诲姞)*/
+ List<Technique> techniqueList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechniqueModel techniqueModel : techniqueModelList) {
+ //鏌ヨ璁惧鍚嶇О
+ Device device = deviceMapper.selectById(techniqueModel.getDeviceId());
+ //鏌ヨ鍩虹鐢熶骇宸ヨ壓涓瘡涓澶囩殑鍏蜂綋椤圭洰
+ TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId());
+ Technique technique = new Technique();
+ technique.setTechnologyId(technologyIds.get(i));
+ technique.setDevice(device.getName());
+ technique.setProductFather(technicalModel.getFather());
+ technique.setProduct(technicalModel.getName());
+ technique.setUnit(technicalModel.getUnit());
+ techniqueList.add(technique);
+ }
+ }
+ techniqueService.saveBatch(techniqueList);
+ }
+
+ //妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(椤圭洰鍚嶇О涓嬫媺妗嗭細Id涓庡悕绉帮紝缂栫爜)
@Override
public List<Map<String, Object>> selectMaterialIdAndNameAndCode() {
LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
@@ -55,7 +178,7 @@
//鏍规嵁鐗╂枡鍚嶇О鍜岀墿鏂欑紪鐮佹煡璇㈢墿鏂檌d,瑙勬牸淇℃伅鍜屽瀷鍙蜂俊鎭�
@Override
public List<Map> selectIdByCoNa(String name, String code) {
- return materialMapper.selectIdByCoNa(name,code);
+ return materialMapper.selectIdByCoNa(name, code);
}
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/MbomServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/MbomServiceImpl.java
new file mode 100644
index 0000000..f6fffbb
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/MbomServiceImpl.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.MbomMapper;
+import com.yuanchu.mom.pojo.Mbom;
+import com.yuanchu.mom.service.MbomService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐗╂枡娓呭崟琛�(Mbom)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-31 11:58:24
+ */
+@Service
+public class MbomServiceImpl extends ServiceImpl<MbomMapper, Mbom> implements MbomService {
+
+ @Resource
+ MbomMapper mbomMapper;
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ @Override
+ public List<Integer> selectVerByMbom(Integer specificationsId) {
+ return mbomMapper.selectVerByMbom(specificationsId);
+ }
+
+ //鍙充晶鏁版嵁灞曠ず-->鐗╂枡娓呭崟
+ @Override
+ public List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message) {
+ return mbomMapper.selectAllMbom(specificationsId,version,message);
+ }
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java
index 331d83d..4ccc9d7 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java
@@ -23,17 +23,22 @@
@Resource
private ProductMapper productMapper;
- @Override
- public List<ProductDto> selectTreeProduct(String specifications, String project) {
- return productMapper.selectTreeProduct(specifications, project);
- }
-
+ //鏍规嵁鍨嬪彿id鏌ヨ椤圭洰(鎶�鏈寚鏍�)
@Override
public List<Map<String, Object>> selectProductList(Integer specificationsId) {
- LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(Product::getSpecificationsId, specificationsId);
- wrapper.select(Product::getName, Product::getFather, Product::getRequired, Product::getInternal, Product::getUnit);
- return productMapper.selectMaps(wrapper);
+ return productMapper.selectProductList(specificationsId);
+ }
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ @Override
+ public List<Integer> selectVerByPro(Integer specificationsId) {
+ return productMapper.selectVerByPro(specificationsId);
+ }
+
+ //鍙充晶鏁版嵁灞曠ず-->鎶�鏈寚鏍�(妫�楠岄」鐩�)
+ @Override
+ public List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message) {
+ return productMapper.selectAllPro(specificationsId,version,message);
}
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java
index 75ea50f..1c418b5 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java
@@ -3,18 +3,21 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.mapper.SpecificationsMapper;
-import com.yuanchu.mom.pojo.Specifications;
-import com.yuanchu.mom.service.SpecificationsService;
+import com.yuanchu.mom.mapper.*;
+import com.yuanchu.mom.pojo.*;
+import com.yuanchu.mom.pojo.dto.SpecificationsDto;
+import com.yuanchu.mom.service.*;
import com.yuanchu.mom.utils.MyUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* @author Administrator
@@ -22,14 +25,120 @@
* @createDate 2023-07-26 16:01:49
*/
@Service
-public class SpecificationsServiceImpl extends ServiceImpl<SpecificationsMapper, Specifications>
- implements SpecificationsService {
+public class SpecificationsServiceImpl extends ServiceImpl<SpecificationsMapper, Specifications> implements SpecificationsService {
@Resource
- private SpecificationsMapper specificationsMapper;
+ MaterialMapper materialMapper;
+
+ @Resource
+ SpecificationsMapper specificationsMapper;
+
+ @Resource
+ TechnologyService technologyService;
+
+ @Resource
+ TechnologyTemplateMapper technologyTemplateMapper;
+
+ @Resource
+ ProductService productService;
+
+ @Resource
+ TechnicalModelMapper technicalModelMapper;
+
+ @Resource
+ MbomService mbomService;
+
+ @Resource
+ MbomModelMapper mbomModelMapper;
+
+ @Resource
+ TechniqueService techniqueService;
+
+ @Resource
+ TechniqueModelMapper techniqueModelMapper;
+
+ @Resource
+ DeviceMapper deviceMapper;
+
+ //(4绾�)鏂板-->鍨嬪彿
+ @Override
+ public void addSpecifications(SpecificationsDto specificationsDto) {
+ /*鏂板鍨嬪彿琛�*/
+ Specifications specifications = new Specifications();
+ specifications.setStandardId(specificationsDto.getId());
+ specifications.setName(specificationsDto.getSpecifications());
+ specificationsMapper.insert(specifications);
+ /*鏂板鏍囧噯BOM-->宸ヨ壓璺嚎(鎵归噺娣诲姞)*/
+ //鏍规嵁鏍囧噯id鏌ヨ鐗╂枡澶х被
+ Material material = materialMapper.selFath(specificationsDto.getId());
+ List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", material.getFather()));
+ List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> {
+ Technology technology = new Technology();
+ technology.setSpecificationsId(specifications.getId());
+ technology.setFather(technologyTemplate.getFather());
+ technology.setName(technologyTemplate.getName());
+ technology.setDeviceGroup(technologyTemplate.getDeviceGroup());
+ return technology;
+ }).collect(Collectors.toList());
+ technologyService.saveBatch(technologyList);
+ /*鏂板鏍囧噯BOM-->鎶�鏈寚鏍�(鎵归噺娣诲姞)*/
+ //鏂板鐨勫伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList());
+ //鍩虹鏁版嵁涓伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList());
+ //涓よ�呴暱搴︿竴瀹氫竴鏍�
+ List<Product> productList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechnicalModel technicalModel : technicalModelList) {
+ Product product = new Product();
+ product.setFather(technicalModel.getFather());
+ product.setName(technicalModel.getName());
+ product.setUnit(technicalModel.getUnit());
+ product.setTechnologyId(technologyIds.get(i));
+ productList.add(product);
+ }
+ }
+ productService.saveBatch(productList);
+ /*鏂板鏍囧噯BOM-->鐗╂枡娓呭崟(鎵归噺娣诲姞)*/
+ List<Mbom> mbomList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (MbomModel mbomModel : mbomModelList) {
+ Mbom mbom = new Mbom();
+ mbom.setUnit(mbomModel.getUnit());
+ mbom.setName(mbomModel.getName());
+ mbom.setSupplier(mbomModel.getSupplier());
+ mbom.setQualityTraceability(mbomModel.getQualityTraceability());
+ mbom.setSpecifications(mbomModel.getSpecifications());
+ mbom.setTechnologyId(technologyIds.get(i));
+ mbomList.add(mbom);
+ }
+ }
+ mbomService.saveBatch(mbomList);
+ /*鏂板鏍囧噯BOM-->鐢熶骇宸ヨ壓(鎵归噺娣诲姞)*/
+ List<Technique> techniqueList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechniqueModel techniqueModel : techniqueModelList) {
+ //鏌ヨ璁惧鍚嶇О
+ Device device = deviceMapper.selectById(techniqueModel.getDeviceId());
+ //鏌ヨ鍩虹鐢熶骇宸ヨ壓涓瘡涓澶囩殑鍏蜂綋椤圭洰
+ TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId());
+ Technique technique = new Technique();
+ technique.setTechnologyId(technologyIds.get(i));
+ technique.setDevice(device.getName());
+ technique.setProductFather(technicalModel.getFather());
+ technique.setProduct(technicalModel.getName());
+ technique.setUnit(technicalModel.getUnit());
+ techniqueList.add(technique);
+ }
+ }
+ techniqueService.saveBatch(techniqueList);
+ }
/**
- * 妫�楠屾ā鍧�-->OMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佽鏍煎瀷鍙风殑Id涓庡悕绉�)
+ * 妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佽鏍煎瀷鍙风殑Id涓庡悕绉�)
*/
@Override
public List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId) {
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/StandardServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/StandardServiceImpl.java
index f52274f..647020d 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/StandardServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/StandardServiceImpl.java
@@ -1,10 +1,18 @@
package com.yuanchu.mom.service.impl;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.pojo.Standard;
-import com.yuanchu.mom.service.StandardService;
-import com.yuanchu.mom.mapper.StandardMapper;
+import com.yuanchu.mom.mapper.*;
+import com.yuanchu.mom.pojo.*;
+import com.yuanchu.mom.pojo.dto.StandardDto;
+import com.yuanchu.mom.service.*;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
/**
* @author Administrator
@@ -14,6 +22,124 @@
@Service
public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> implements StandardService {
+ @Resource
+ MaterialMapper materialMapper;
+
+ @Resource
+ StandardMapper standardMapper;
+
+ @Resource
+ SpecificationsMapper specificationsMapper;
+
+ @Resource
+ TechnologyService technologyService;
+
+ @Resource
+ TechnologyTemplateMapper technologyTemplateMapper;
+
+ @Resource
+ ProductService productService;
+
+ @Resource
+ TechnicalModelMapper technicalModelMapper;
+
+ @Resource
+ MbomService mbomService;
+
+ @Resource
+ MbomModelMapper mbomModelMapper;
+
+ @Resource
+ TechniqueService techniqueService;
+
+ @Resource
+ TechniqueModelMapper techniqueModelMapper;
+
+ @Resource
+ DeviceMapper deviceMapper;
+
+ //(3绾�)鏂板-->鏍囧噯,鍨嬪彿
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void addStandard(StandardDto standardDto) {
+ /*鏂板鏍囧噯琛�*/
+ Standard standard = new Standard();
+ standard.setMaterial_id(standardDto.getId());
+ standard.setName(standardDto.getStandard());
+ standardMapper.insert(standard);
+ /*鏂板鍨嬪彿琛�*/
+ Specifications specifications = new Specifications();
+ specifications.setStandardId(standard.getId());
+ specifications.setName(standardDto.getSpecifications());
+ specificationsMapper.insert(specifications);
+ /*鏂板鏍囧噯BOM-->宸ヨ壓璺嚎(鎵归噺娣诲姞)*/
+ //鏌ヨ鐗╂枡鐨勫ぇ绫�(鏍规嵁鐗╂枡id)
+ Material material = materialMapper.selectById(standardDto.getId());
+ List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", material.getFather()));
+ List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> {
+ Technology technology = new Technology();
+ technology.setSpecificationsId(specifications.getId());
+ technology.setFather(technologyTemplate.getFather());
+ technology.setName(technologyTemplate.getName());
+ technology.setDeviceGroup(technologyTemplate.getDeviceGroup());
+ return technology;
+ }).collect(Collectors.toList());
+ technologyService.saveBatch(technologyList);
+ /*鏂板鏍囧噯BOM-->鎶�鏈寚鏍�(鎵归噺娣诲姞)*/
+ //鏂板鐨勫伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList());
+ //鍩虹鏁版嵁涓伐鑹鸿矾绾縤d闆嗗悎
+ List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList());
+ //涓よ�呴暱搴︿竴瀹氫竴鏍�
+ List<Product> productList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechnicalModel technicalModel : technicalModelList) {
+ Product product = new Product();
+ product.setFather(technicalModel.getFather());
+ product.setName(technicalModel.getName());
+ product.setUnit(technicalModel.getUnit());
+ product.setTechnologyId(technologyIds.get(i));
+ productList.add(product);
+ }
+ }
+ productService.saveBatch(productList);
+ /*鏂板鏍囧噯BOM-->鐗╂枡娓呭崟(鎵归噺娣诲姞)*/
+ List<Mbom> mbomList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (MbomModel mbomModel : mbomModelList) {
+ Mbom mbom = new Mbom();
+ mbom.setUnit(mbomModel.getUnit());
+ mbom.setName(mbomModel.getName());
+ mbom.setSupplier(mbomModel.getSupplier());
+ mbom.setQualityTraceability(mbomModel.getQualityTraceability());
+ mbom.setSpecifications(mbomModel.getSpecifications());
+ mbom.setTechnologyId(technologyIds.get(i));
+ mbomList.add(mbom);
+ }
+ }
+ mbomService.saveBatch(mbomList);
+ /*鏂板鏍囧噯BOM-->鐢熶骇宸ヨ壓(鎵归噺娣诲姞)*/
+ List<Technique> techniqueList = new ArrayList<>();
+ for (int i = 0; i < technologyIds.size(); i++) {
+ List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i)));
+ for (TechniqueModel techniqueModel : techniqueModelList) {
+ //鏌ヨ璁惧鍚嶇О
+ Device device = deviceMapper.selectById(techniqueModel.getDeviceId());
+ //鏌ヨ鍩虹鐢熶骇宸ヨ壓涓瘡涓澶囩殑鍏蜂綋椤圭洰
+ TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId());
+ Technique technique = new Technique();
+ technique.setTechnologyId(technologyIds.get(i));
+ technique.setDevice(device.getName());
+ technique.setProductFather(technicalModel.getFather());
+ technique.setProduct(technicalModel.getName());
+ technique.setUnit(technicalModel.getUnit());
+ techniqueList.add(technique);
+ }
+ }
+ techniqueService.saveBatch(techniqueList);
+ }
}
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueServiceImpl.java
new file mode 100644
index 0000000..256cd31
--- /dev/null
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueServiceImpl.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.TechniqueMapper;
+import com.yuanchu.mom.pojo.Technique;
+import com.yuanchu.mom.service.TechniqueService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鏍囧噯BOM-鐢熶骇宸ヨ壓琛�(Technique)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-31 11:57:53
+ */
+@Service
+public class TechniqueServiceImpl extends ServiceImpl<TechniqueMapper, Technique> implements TechniqueService {
+
+ @Resource
+ TechniqueMapper techniqueMapper;
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�
+ @Override
+ public List<Integer> selectVerByTeq(Integer specificationsId) {
+ return techniqueMapper.selectVerByTeq(specificationsId);
+ }
+
+ //鍙充晶鏁版嵁灞曠ず-->鐢熶骇宸ヨ壓
+ @Override
+ public List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message) {
+ return techniqueMapper.selectAllTeq(specificationsId,version,message);
+ }
+}
+
diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
index 38a5bfb..e66d960 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
@@ -24,15 +24,18 @@
public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technology> implements TechnologyService {
@Resource
- private TechnologyMapper technologyMapper;
+ TechnologyMapper technologyMapper;
+
+ //鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
@Override
- public List<Map<String, Object>> selectTechnology(String technologyName) {
- LambdaQueryWrapper<Technology> wrapper = new LambdaQueryWrapper<>();
- if (!ObjectUtils.isEmpty(technologyName)){
- wrapper.like(Technology::getName, technologyName);
- }
- wrapper.select(Technology::getId, Technology::getName, Technology::getDeviceGroup, Technology::getFather);
- return technologyMapper.selectMaps(wrapper);
+ public List<Integer> selectVerByTec(Integer specificationsId) {
+ return technologyMapper.selectVerByTec(specificationsId);
+ }
+
+ //鍙充晶鏁版嵁灞曠ず-->宸ヨ壓璺嚎
+ @Override
+ public List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message) {
+ return technologyMapper.selectAllTec(specificationsId,version,message);
}
}
diff --git a/standard-server/src/main/resources/mapper/DeviceMapper.xml b/standard-server/src/main/resources/mapper/DeviceMapper.xml
deleted file mode 100644
index f6cc9da..0000000
--- a/standard-server/src/main/resources/mapper/DeviceMapper.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.yuanchu.mom.mapper.DeviceMapper">
- <select id="selectDeviceTables" resultType="map">
- SELECT d.`id`, d.`name`, d.`father`, t.`quota`
- FROM device d,
- technology t
- WHERE d.`state` = 1
- AND d.`id` = t.`device_id`
- </select>
-
- <resultMap id="deviceTwoTreeOneMap" type="map">
- <id property="name" column="father"/>
- <collection property="children" resultMap="deviceTwoTreeTwoMap" javaType="List"/>
- </resultMap>
-
- <resultMap id="deviceTwoTreeTwoMap" type="map">
- <id property="id" column="id"/>
- <result property="name" column="name"/>
- </resultMap>
-
- <select id="deviceTwoTree" resultMap="deviceTwoTreeOneMap">
- SELECT d.`id`, d.`name`, d.`father`
- FROM device d
- WHERE d.state = 1
- AND d.type = #{type}
- <if test="search_class !=null and search_class != ''">
- AND d.`name` like concat('%',#{search_class},'%')
- </if>
- </select>
-
- <select id="DevicePageList" resultType="Map">
- SELECT d.id, d.`code`, d.`name`, u.`name` keeper, DATE_FORMAT(d.`end_measure`,'%Y-%m-%d') end_measure,
- d.`device_status`, d.`factory`, r.`name` inspectProject, i.`name` testSample, i.`user_name`
- FROM (device d, `user` u)
- LEFT JOIN raw_ins_product r
- ON d.`id` = r.`device_id`
- LEFT JOIN raw_inspect i
- ON r.`raw_inspect_id` = i.`id`
- WHERE r.`test_state` IS NULL
- AND d.`state` = 1
- AND (r.`state` = 1 OR r.`state` IS NULL)
- AND d.`keeper` = u.`id`
- AND d.type = #{type}
- <if test="codeNameModel != null and codeNameModel != ''">
- AND (d.`name` LIKE CONCAT('%',#{codeNameModel},'%') OR d.`code` LIKE CONCAT('%',#{codeNameModel},'%') OR
- i.`specifications` LIKE CONCAT('%',#{codeNameModel},'%'))
- </if>
- <if test="deviceStatue != null and deviceStatue != ''">
- AND d.`device_status` = #{deviceStatue}
- </if>
- <if test="deviceId != null and deviceId != ''">
- AND d.id = #{deviceId}
- </if>
- <if test="fatherName != null and fatherName != ''">
- AND d.`father` = #{fatherName}
- </if>
- </select>
-
- <select id="getDeviceNameByGroup" resultType="java.util.Map">
- select id as deviceid, name deviceName
- from mom_ocean.device
- where state = 1
- and father = #{deviceGroup}
- and device_status in (1, 5)
- </select>
- <!--閫夋嫨璁惧缁�-->
- <select id="chooseDevGroup" resultType="java.util.Map">
- select distinct father
- from mom_ocean.device
- where state=1 and device_status in(1,5)
- </select>
-</mapper>
diff --git a/standard-server/src/main/resources/mapper/MaterialMapper.xml b/standard-server/src/main/resources/mapper/MaterialMapper.xml
index 3609c3b..53e1662 100644
--- a/standard-server/src/main/resources/mapper/MaterialMapper.xml
+++ b/standard-server/src/main/resources/mapper/MaterialMapper.xml
@@ -3,49 +3,43 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.MaterialMapper">
- <resultMap id="BaseResultMap" type="Material">
- <id property="id" column="id" jdbcType="INTEGER"/>
- <result property="code" column="code" jdbcType="VARCHAR"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="version" column="version" jdbcType="INTEGER"/>
+ <!--鏍囧噯MOM 宸︿晶浜旂骇鏍戝睍绀�-->
+ <resultMap id="selectTreeByMaterialMap" type="map">
+ <id property="id" column="type"/>
+ <collection property="children" resultMap="selectTreeByMaterialMaps1" javaType="List"/>
</resultMap>
-
- <resultMap id="materialTreeDto" type="materialTreeDto">
+ <resultMap id="selectTreeByMaterialMaps1" type="map">
+ <id property="name" column="father"/>
+ <collection property="children" resultMap="selectTreeByMaterialMaps2" javaType="List"/>
+ </resultMap>
+ <resultMap id="selectTreeByMaterialMaps2" type="map">
<id property="id" column="mid"/>
<result property="name" column="mname"/>
- <result property="type" column="type"/>
- <association property="children" resultMap="standardDto"/>
+ <collection property="children" resultMap="selectTreeByMaterialMaps3" javaType="List"/>
</resultMap>
- <resultMap id="standardDto" type="standardDto">
+ <resultMap id="selectTreeByMaterialMaps3" type="map">
<id property="id" column="sid"/>
<result property="name" column="sname"/>
- <association property="children" resultMap="specificationsDto"/>
+ <collection property="children" resultMap="selectTreeByMaterialMaps4" javaType="List"/>
</resultMap>
- <resultMap id="specificationsDto" type="specificationsDto">
+ <resultMap id="selectTreeByMaterialMaps4" type="map">
<id property="id" column="spid"/>
<result property="name" column="spname"/>
</resultMap>
-
- <select id="selectTreeByMaterial" resultMap="materialTreeDto">
- select m.type,
- m.id mid,
- m.name mname,
- s.id sid,
- s.name sname,
- s2.id spid,
- s2.name spname,
- p.id pid,
- p.name pname
- from (select type, id, name from material where state = 1) m
- left join (select id, name, material_id from standard where state = 1) s on m.id = s.material_id
- left join (select id, name, standard_id from specifications where state = 1) s2
- on s2.standard_id = s.id
- left join (select id, name, specifications_id from product where state = 1) p
- on s2.id = p.specifications_id
+ <select id="selectTreeByMaterial" resultMap="selectTreeByMaterialMap">
+ select m.type, #涓�绾х被鍨�
+ father, #浜岀骇浜у搧澶х被(4澶х被)
+ m.id mid, #涓夌骇鐗╂枡id
+ m.name mname, #涓夌骇鏍峰搧鍚嶇О
+ s.id sid, #鍥涚骇鏍囧噯id
+ s.name sname, #鍥涚骇鏍囧噯鍚�
+ sp.id spid, #浜旂骇鍨嬪彿id
+ sp.name spname #浜旂骇鍨嬪彿鍚�
+ from (select type, id, name, father from mom_ocean.material where state = 1) m
+ left join (select id, name, material_id from mom_ocean.standard where state = 1) s
+ on m.id = s.material_id
+ left join (select id, name, standard_id from mom_ocean.specifications where state = 1) sp
+ on sp.standard_id = s.id
</select>
<select id="selectMcodeId" resultType="com.yuanchu.mom.pojo.Material">
@@ -55,10 +49,10 @@
</select>
<select id="selectIdByCoNa" resultType="java.util.Map">
- select m.id '鐗╂枡id',
- st.id '瑙勬牸id',
- st.name '瑙勬牸鍚嶇О',
- sp.name '鍨嬪彿鍚嶇О'
+ select m.id '鐗╂枡id',
+ st.id '瑙勬牸id',
+ st.name '瑙勬牸鍚嶇О',
+ sp.name '鍨嬪彿鍚嶇О'
from mom_ocean.material m,
mom_ocean.standard st,
mom_ocean.specifications sp
@@ -67,4 +61,15 @@
and m.name = #{name}
and code = #{code}
</select>
+
+ <!--鏍规嵁鏍囧噯id鏌ヨ鐗╂枡-->
+ <select id="selFath" resultType="com.yuanchu.mom.pojo.Material">
+ select *
+ from mom_ocean.material
+ where state = 1
+ and id = (select material_id
+ from mom_ocean.standard
+ where standard.state = 1
+ and standard.id = #{id})
+ </select>
</mapper>
diff --git a/standard-server/src/main/resources/mapper/MbomMapper.xml b/standard-server/src/main/resources/mapper/MbomMapper.xml
new file mode 100644
index 0000000..4a312a6
--- /dev/null
+++ b/standard-server/src/main/resources/mapper/MbomMapper.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.MbomMapper">
+ <!--鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�-->
+ <select id="selectVerByMbom" resultType="java.lang.Integer">
+ select distinct version
+ from mom_ocean.mbom
+ where state = 1
+ and technology_id in (select id
+ from mom_ocean.technology
+ where technology.state = 1
+ and specifications_id = #{specificationsId})
+ order by version desc
+ </select>
+
+ <!--鍙充晶鏁版嵁灞曠ず 鐗╂枡娓呭崟-->
+ <resultMap id="oneMap" type="map">
+ <id property="father" column="father"/>
+ <collection property="children" resultMap="twoMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="twoMap" type="map">
+ <id property="tname" column="tname"/>
+ <collection property="children" resultMap="threeMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="threeMap" type="map">
+ <id property="id" column="mid"/>
+ <result property="mname" column="mname"/>
+ <result property="specifications" column="specifications"/>
+ <result property="unit" column="unit"/>
+ <result property="num" column="num"/>
+ </resultMap>
+ <select id="selectAllMbom" resultMap="oneMap">
+ select m.id mid,
+ m.name mname,
+ unit,
+ num,
+ specifications,
+ t.name tname,
+ father
+ from mom_ocean.mbom m
+ left join mom_ocean.technology t on m.technology_id = t.id
+ where m.state = 1
+ and m.version = #{version}
+ and specifications_id = #{specificationsId}
+ <if test="message!=null and message!=''">
+ and m.name like concat('%',#{message},'%')
+ </if>
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/standard-server/src/main/resources/mapper/ProductMapper.xml b/standard-server/src/main/resources/mapper/ProductMapper.xml
index cee2fea..4fcd5c3 100644
--- a/standard-server/src/main/resources/mapper/ProductMapper.xml
+++ b/standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -3,42 +3,69 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.ProductMapper">
+ <!--鏍规嵁鍨嬪彿id鏌ヨ椤圭洰(鎶�鏈寚鏍�)-->
+ <select id="selectProductList" resultType="java.util.Map">
+ select name,
+ father,
+ unit,
+ required,
+ internal
+ from mom_ocean.product
+ where state = 1
+ and technology_id in (select id
+ from mom_ocean.technology
+ where technology.state = 1
+ and specifications_id = #{specificationsId})
+ </select>
- <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.Product">
- <id property="id" column="id" jdbcType="INTEGER"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="father" column="father" jdbcType="VARCHAR"/>
- <result property="unit" column="unit" jdbcType="VARCHAR"/>
- <result property="required" column="required" jdbcType="VARCHAR"/>
- <result property="internal" column="internal" jdbcType="VARCHAR"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="version" column="version" jdbcType="INTEGER"/>
- <result property="specificationsId" column="specifications_id" jdbcType="INTEGER"/>
+ <!--鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�-->
+ <select id="selectVerByPro" resultType="java.lang.Integer">
+ select distinct version
+ from mom_ocean.product
+ where state = 1
+ and technology_id in (select id
+ from mom_ocean.technology
+ where technology.state = 1
+ and specifications_id = #{specificationsId})
+ order by version desc
+ </select>
+
+ <!--鍙充晶鏁版嵁灞曠ず 鎶�鏈寚鏍�(妫�楠岄」鐩�)-->
+ <resultMap id="oneMap" type="map">
+ <id property="tfather" column="tfather"/>
+ <collection property="children" resultMap="twoMap" javaType="List"/>
</resultMap>
-
- <resultMap id="selectTreeProduct" type="ProductDto">
- <id property="father" column="father" jdbcType="VARCHAR"/>
- <collection property="children" resultMap="productDto2ListMap"/>
+ <resultMap id="twoMap" type="map">
+ <id property="tname" column="tname"/>
+ <collection property="children" resultMap="threeMap" javaType="List"/>
</resultMap>
-
- <resultMap id="productDto2ListMap" type="ProductDto2">
- <id property="id" column="id" jdbcType="INTEGER"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="unit" column="unit" jdbcType="VARCHAR"/>
- <result property="required" column="required" jdbcType="VARCHAR"/>
- <result property="internal" column="internal" jdbcType="VARCHAR"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
+ <resultMap id="threeMap" type="map">
+ <id property="pfather" column="pfather"/>
+ <collection property="children" resultMap="fourMap" javaType="List"/>
</resultMap>
-
- <select id="selectTreeProduct" resultMap="selectTreeProduct">
- SELECT p.id, p.`name`, IFNULL(p.`father`,p.`name`) father, p.`unit`, p.`required`, p.`internal`
- FROM product p
- where p.specifications_id = #{specifications}
- <if test="project != null and project != ''">
- AND p.father like concat('%',#{project},'%')
- </if>
- and p.state = 1
+ <resultMap id="fourMap" type="map">
+ <id property="pid" column="pid"/>
+ <result property="pname" column="pname"/>
+ <result property="unit" column="unit"/>
+ <result property="required" column="required"/>
+ <result property="internal" column="internal"/>
+ </resultMap>
+ <select id="selectAllPro" resultMap="oneMap">
+ select p.id pid,
+ p.name pname,
+ p.father pfather,
+ unit,
+ required,
+ internal,
+ t.father tfather,
+ t.name tname
+ from mom_ocean.product p
+ left join mom_ocean.technology t on p.technology_id = t.id
+ where p.state = 1
+ and p.version = #{version}
+ and specifications_id = #{specificationsId}
+ <if test="message!=null and message!=''">
+ and p.name like concat('%',#{message},'%')
+ </if>
</select>
</mapper>
diff --git a/standard-server/src/main/resources/mapper/RawInsProductMapper.xml b/standard-server/src/main/resources/mapper/RawInsProductMapper.xml
deleted file mode 100644
index 94f8892..0000000
--- a/standard-server/src/main/resources/mapper/RawInsProductMapper.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.yuanchu.mom.mapper.RawInsProductMapper">
- <select id="selectInspectIdAndName" resultType="map">
- SELECT r.`id`, r.`name`
- FROM raw_ins_product r
- LEFT JOIN device d
- ON r.`device_id` = d.`id`
- WHERE r.`state` = 1
- AND ((r.`device_id` IS NULL
- OR (r.`device_id` IS NOT NULL AND r.`test_state` IS NOT NULL))
- OR (d.`state` = 0 AND r.`device_id` IS NOT NULL))
- </select>
-
- <select id="selectPageDevice" resultType="map">
-
- </select>
-
- <select id="inspectIdSelect" resultType="map">
- SELECT r.`name`, r.`specifications`, r.`user_name`
- FROM raw_inspect r, raw_ins_product p
- WHERE p.`id` = #{inspectId}
- AND p.`state` = 1
- AND r.`state` = 1
- AND r.`id` = p.`raw_inspect_id`
- </select>
-
- <select id="parentClassification" resultType="map">
- SELECT DISTINCT d.`father`
- FROM device d
- WHERE d.`state` = 1
- AND d.`father` IS NOT NULL
- </select>
-</mapper>
diff --git a/standard-server/src/main/resources/mapper/TechniqueMapper.xml b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
new file mode 100644
index 0000000..0d8255b
--- /dev/null
+++ b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.mom.mapper.TechniqueMapper">
+ <!--鏍规嵁鍨嬪彿id鏌ヨ鎵�鏈夌増鏈�-->
+ <select id="selectVerByTeq" resultType="java.lang.Integer">
+ select distinct version
+ from mom_ocean.technique
+ where state = 1
+ and technology_id in (select id
+ from mom_ocean.technology
+ where technology.state = 1
+ and specifications_id = #{specificationsId})
+ order by version desc
+ </select>
+
+ <!--鍙充晶鏁版嵁灞曠ず 鐢熶骇宸ヨ壓-->
+ <resultMap id="oneMap" type="map">
+ <id property="father" column="father"/>
+ <collection property="children" resultMap="twoMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="twoMap" type="map">
+ <id property="name" column="name"/>
+ <collection property="children" resultMap="threeMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="threeMap" type="map">
+ <id property="tqid" column="tqid"/>
+ <result property="device" column="device"/>
+ <result property="productFather" column="product_father"/>
+ <result property="product" column="product"/>
+ <result property="unit" column="unit"/>
+ </resultMap>
+ <select id="selectAllTeq" resultMap="oneMap">
+ select tq.id tqid,
+ device,
+ product_father,
+ product,
+ unit,
+ name,
+ father
+ from mom_ocean.technique tq
+ left join mom_ocean.technology tc on tq.technology_id = tc.id
+ where tq.state = 1
+ and specifications_id = #{specificationsId}
+ and tq.version = #{version}
+ <if test="message!=null and message!=''">
+ and device like concat('%',#{message},'%')
+ </if>
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/standard-server/src/main/resources/mapper/TechnologyMapper.xml b/standard-server/src/main/resources/mapper/TechnologyMapper.xml
index 1a5c4fe..aacc7ab 100644
--- a/standard-server/src/main/resources/mapper/TechnologyMapper.xml
+++ b/standard-server/src/main/resources/mapper/TechnologyMapper.xml
@@ -1,5 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.TechnologyMapper">
+ <!--鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰-->
+ <select id="selectVerByTec" resultType="java.lang.Integer">
+ select distinct version
+ from mom_ocean.technology
+ where state = 1
+ and specifications_id = #{specificationsId}
+ order by version desc
+ </select>
+ <!--鍙充晶鏁版嵁灞曠ず 宸ヨ壓璺嚎-->
+ <resultMap id="selectAllTecMap" type="map">
+ <id property="father" column="father"/>
+ <collection property="children" resultMap="selectAllTecMaps" javaType="List"/>
+ </resultMap>
+ <resultMap id="selectAllTecMaps" type="map">
+ <id property="id" column="id"/>
+ <result property="name" column="name"/>
+ <result property="dg" column="dg"/>
+ <result property="pq" column="pq"/>
+ </resultMap>
+ <select id="selectAllTec" resultMap="selectAllTecMap">
+ select id,
+ name,
+ father,
+ device_group dg,
+ production_quota pq
+ from mom_ocean.technology
+ where state = 1
+ and specifications_id = #{specificationsId}
+ and version = #{version}
+ <if test="message!=null and message!=''">
+ and father like concat('%',#{message},'%')
+ </if>
+ </select>
</mapper>
diff --git a/user-server/src/main/java/com/yuanchu/mom/service/UserService.java b/user-server/src/main/java/com/yuanchu/mom/service/UserService.java
index 8cecbf2..b63b082 100644
--- a/user-server/src/main/java/com/yuanchu/mom/service/UserService.java
+++ b/user-server/src/main/java/com/yuanchu/mom/service/UserService.java
@@ -14,7 +14,7 @@
String selectNameById(Integer id);
/**
- * 妫�楠屾ā鍧�-->OMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佺敤鎴稩d涓庡悕绉�)
+ * 妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佺敤鎴稩d涓庡悕绉�)
*/
List<Map<String, Object>> listUserIdAndName();
--
Gitblit v1.9.3