From 13c8b105a7ddf7ac43fbbdea93946f389cd032e9 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 28 八月 2023 18:00:13 +0800
Subject: [PATCH] 工艺路线+技术指标
---
base-server/src/main/java/com/yuanchu/mom/service/ElementService.java | 15
base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java | 82 ++++
inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java | 3
base-server/src/main/java/com/yuanchu/mom/pojo/Element.java | 55 ++
base-server/src/main/resources/mapper/ElementMapper.xml | 10
base-server/src/main/java/com/yuanchu/mom/mapper/TechnicalModelMapper.java | 42 ++
base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java | 91 ++++
base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java | 60 +-
base-server/src/main/resources/mapper/ElementTechnologyMapper.xml | 17
base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java | 119 +++++
inventory-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java | 2
base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java | 23 +
base-server/src/main/java/com/yuanchu/mom/mapper/ElementTechnologyMapper.java | 22 +
base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java | 70 +++
base-server/src/main/java/com/yuanchu/mom/service/impl/ElementTechnologyServiceImpl.java | 36 +
base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml | 78 +++
base-server/src/main/java/com/yuanchu/mom/pojo/ElementTechnology.java | 62 +++
base-server/src/main/java/com/yuanchu/mom/pojo/TechnologyTemplate.java | 4
base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyTemplateDto.java | 4
base-server/src/main/java/com/yuanchu/mom/service/ElementTechnologyService.java | 22 +
base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java | 99 ++++
inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java | 8
base-server/src/main/java/com/yuanchu/mom/service/impl/ElementServiceImpl.java | 19
base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.java | 37 +
base-server/src/main/java/com/yuanchu/mom/mapper/ElementMapper.java | 20 +
base-server/src/main/resources/mapper/TechnicalModelMapper.xml | 106 +++++
inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java | 13
base-server/src/main/java/com/yuanchu/mom/service/TechnologyTemplateService.java | 39 +
28 files changed, 1,090 insertions(+), 68 deletions(-)
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
new file mode 100644
index 0000000..044cc10
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/TechnicalModelController.java
@@ -0,0 +1,119 @@
+package com.yuanchu.mom.controller;
+
+
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto;
+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.TechnicalModelService;
+
+
+/**
+ * 鎶�鏈寚鏍囩淮鎶よ〃(TechnicalModel)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-08-28 16:09:19
+ */
+@Api(tags = "鍩虹鏁版嵁-->鎶�鏈寚鏍囩淮鎶�")
+@RestController
+@RequestMapping("/technicalModel")
+public class TechnicalModelController {
+
+ @Autowired
+ private TechnicalModelService technicalModelService;
+
+
+ @ApiOperation(value = "鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "type", value = "绫诲瀷(涓虹┖=0姗¤兌杩炴帴鍣�)", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "message", value = "鎼滅储鍐呭", dataTypeClass = String.class)
+ })
+ @GetMapping("/selectAllTechTem")
+ public Result selectAllTechTem(Integer type, String message) {
+ return Result.success(technicalModelService.selectAllTechTem(type, message));
+ }
+
+ @ApiOperation(value = "鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectAllTechNam")
+ public Result selectAllTechNam(Integer id) {
+ return Result.success(technicalModelService.selectAllTechNam(id));
+ }
+
+ @ApiOperation(value = "鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨宸ュ簭鍜屽伐鑹�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/chooseTechFath")
+ public Result chooseTechFath(Integer type) {
+ return Result.success(technicalModelService.chooseTechFath(type));
+ }
+
+ @ApiOperation(value = "鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨椤圭洰鐖剁被")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/chooseProFath")
+ public Result chooseProFath(Integer id) {
+ return Result.success(technicalModelService.chooseProFath(id));
+ }
+
+ @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);
+ return Result.success("鏂板鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鏍规嵁id鏌ヨ璇︽儏")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class,required = true)
+ })
+ @GetMapping("/selecTechById")
+ public Result selecTechById(Integer id) {
+ return Result.success(technicalModelService.selecTechById(id));
+ }
+
+ @ApiOperation(value = "缂栬緫")
+ @ApiImplicitParams(value = {
+ @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+"鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "鎶�鏈寚鏍噄d", dataTypeClass = Integer.class,required = true)
+ })
+ @PostMapping("/delTechById")
+ public Result delTechById(Integer id) {
+ technicalModelService.delTechById(id);
+ return Result.success("鍒犻櫎"+id+"鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "鎶�鏈寚鏍噄d", dataTypeClass = String.class,required = true)
+ })
+ @PostMapping("/delAllTech")
+ public Result delAllTech(String ids) {
+ technicalModelService.delAllTech(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java b/base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java
index ee2d9b9..9c14bd9 100644
--- a/base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java
+++ b/base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java
@@ -28,7 +28,7 @@
* @author zss
* @since 2023-08-18 16:59:14
*/
-@Api(tags = "鍩虹鏁版嵁-->宸ヨ壓璺嚎缁存姢琛ㄦ帴鍙�")
+@Api(tags = "鍩虹鏁版嵁-->宸ヨ壓璺嚎缁存姢")
@RestController
@RequestMapping("/technologyTemplate")
public class TechnologyTemplateController {
@@ -43,62 +43,76 @@
return Result.success(technologyTemplateService.chooseDevGroup());
}
+ @ApiOperation(value = "鏂板宸ヨ壓璺嚎缁存姢-->閫夋嫨宸ュ簭")
+ @GetMapping("/chooseTech")
+ public Result chooseTech() {
+ return Result.success(technologyTemplateService.chooseTech());
+ }
+
+ @ApiOperation(value = "鏂板宸ヨ壓璺嚎缁存姢-->閫夋嫨鍏冧欢")
+ @GetMapping("/chooseElement")
+ public Result chooseElement() {
+ return Result.success(technologyTemplateService.chooseElement());
+ }
+
@ApiOperation(value = "鏂板宸ヨ壓璺嚎缁存姢")
@PostMapping("/addTechTemp")
- public Result addSale(@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) {
- technologyTemplateService.addSale(technologyTemplateDto);
+ public Result addTechTemp(@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) {
+ technologyTemplateService.addTechTemp(technologyTemplateDto);
return Result.success("鏂板鎴愬姛!");
}
- @ApiOperation(value = "鏌ヨ宸ヨ壓璺嚎鍒楄〃")
+ @ApiOperation(value = "鏌ヨ宸ヨ壓璺嚎鍒楄〃-->宸﹁竟浜岀骇灞曠ず")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "name", value = "宸ヨ壓", dataTypeClass = String.class),
- @ApiImplicitParam(name = "father", value = "宸ュ簭", dataTypeClass = String.class)
+ @ApiImplicitParam(name = "type", value = "绫诲瀷(涓虹┖=0姗¤兌杩炴帴鍣�)", dataTypeClass = Integer.class,required = true),
+ @ApiImplicitParam(name = "message", value = "鎼滅储鍐呭", dataTypeClass = String.class)
})
@GetMapping("/selectAllTechTem")
- public Result selectAllTechTem(int pageSize, int countSize, Integer type, String name, String father) {
- IPage<Map<String, Object>> technologyTemplatePage = technologyTemplateService.selectAllTechTem(new Page<Object>(pageSize, countSize), type, name, father);
- Map<String, Object> map = new HashMap<>();
- map.put("total", technologyTemplatePage.getTotal());
- map.put("row", technologyTemplatePage.getRecords());
- return Result.success(map);
+ public Result selectAllTechTem(Integer type,String message) {
+ return Result.success(technologyTemplateService.selectAllTechTem(type,message));
+ }
+
+ @ApiOperation(value = "鏌ヨ宸ヨ壓璺嚎鍒楄〃-->鍙宠竟灞曠ず宸ヨ壓鍜岃澶�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "father", value = "宸ュ簭(鐖剁被)", dataTypeClass = String.class,required = true)
+ })
+ @GetMapping("/selectAllTechNam")
+ public Result selectAllTechNam(String father) {
+ return Result.success(technologyTemplateService.selectAllTechNam(father));
}
@ApiOperation(value = "鏍规嵁id鏌ヨ璇︽儏")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "宸ヨ壓id", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class,required = true)
})
@GetMapping("/selecTechById")
public Result selecTechById(Integer id) {
- return Result.success(technologyTemplateService.getById(id));
+ return Result.success(technologyTemplateService.selecTechById(id));
}
@ApiOperation(value = "缂栬緫")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "宸ヨ壓id", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class,required = true)
})
@PostMapping("/writeTechById")
- public Result writeTechById(Integer id,@RequestBody TechnologyTemplateDto technologyTemplateDto) {
+ public Result writeTechById(Integer id,@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) {
technologyTemplateService.writeTechById(id,technologyTemplateDto);
- return Result.success("淇敼鎴愬姛!");
+ return Result.success("淇敼"+id+"鎴愬姛!");
}
@ApiOperation(value = "鍒犻櫎")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "宸ヨ壓id", dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class,required = true)
})
@PostMapping("/delTechById")
public Result delTechById(Integer id) {
technologyTemplateService.delTechById(id);
- return Result.success("鍒犻櫎鎴愬姛!");
+ return Result.success("鍒犻櫎"+id+"鎴愬姛!");
}
@ApiOperation(value = "鎵归噺鍒犻櫎")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "ids", value = "宸ヨ壓id", dataTypeClass = String.class,required = true)
+ @ApiImplicitParam(name = "ids", value = "宸ヨ壓璺嚎id", dataTypeClass = String.class,required = true)
})
@PostMapping("/delAllTech")
public Result delAllTech(String ids) {
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/ElementMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/ElementMapper.java
new file mode 100644
index 0000000..c04cf0b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/ElementMapper.java
@@ -0,0 +1,20 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.Element;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鍏冧欢琛�(Element)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-28 10:48:45
+ */
+public interface ElementMapper extends BaseMapper<Element> {
+
+ //鏂板宸ヨ壓璺嚎-->閫夋嫨鍏冧欢
+ List<Map<String,Object>> chooseElement();
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/ElementTechnologyMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/ElementTechnologyMapper.java
new file mode 100644
index 0000000..41e3e39
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/ElementTechnologyMapper.java
@@ -0,0 +1,22 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.ElementTechnology;
+
+import java.util.List;
+
+/**
+ * 鍏冧欢宸ヨ壓涓棿琛�(ElementTechnology)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-28 10:49:07
+ */
+public interface ElementTechnologyMapper extends BaseMapper<ElementTechnology> {
+
+ //鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ void delElemaByTechsId(Integer id);
+
+ //鎵归噺鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ void delAllByTechId(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/TechnicalModelMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/TechnicalModelMapper.java
new file mode 100644
index 0000000..d189cc8
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/TechnicalModelMapper.java
@@ -0,0 +1,42 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.TechnicalModel;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 鎶�鏈寚鏍囩淮鎶よ〃(TechnicalModel)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-08-28 16:09:19
+ */
+public interface TechnicalModelMapper extends BaseMapper<TechnicalModel> {
+
+ //鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�
+ List<Map<String, Object>> selectAllTechTem(Integer type, String message);
+
+ //鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�
+ List<Map<String, Object>> selectAllTechNam(Integer id);
+
+ //鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨宸ュ簭鍜屽伐鑹�
+ List<Map<String,Object>> chooseTechFath(Integer type);
+
+ //鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨椤圭洰鐖剁被
+ List<String> chooseProFath(Integer id);
+
+ //鏍规嵁id鏌ヨ璇︽儏
+ List<Map<String, Object>> selecTechById(Integer id);
+
+ //鎵归噺鍒犻櫎鏍规嵁鎶�鏈寚鏍噄d
+ void delAllTech(String ids);
+
+ //鍒犻櫎鏍规嵁宸ヨ壓璺嚎id
+ void delTeMoByTechId(Integer id);
+
+ //鎵归噺鍒犻櫎鏍规嵁宸ヨ壓璺嚎id
+ void delAllByTechId(String ids);
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java b/base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java
index 550a7cb..dd8dc57 100644
--- a/base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java
+++ b/base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java
@@ -16,10 +16,29 @@
*/
public interface TechnologyTemplateMapper extends BaseMapper<TechnologyTemplate> {
- //鏌ヨ宸ヨ壓璺嚎鍒楄〃
- IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father);
+ //鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
+ List<String> chooseTech();
+
+ //鏌ヨ宸ヨ壓璺嚎鍒楄〃-->宸﹁竟浜岀骇灞曠ず
+ List<Map<String,Object>> selectAllTechTem(Integer type,String message);
+
+ //鏌ヨ宸ヨ壓璺嚎鍒楄〃-->鍙宠竟灞曠ず宸ヨ壓鍜岃澶�
+ List<Map<String, Object>> selectAllTechNam(String father);
+
+ /**
+ * 鏍规嵁id鏌ョ湅璇︽儏
+ * @param id 宸ヨ壓id
+ * @return
+ */
+ List<Map<String, Object>> selecTechById(Integer id);
+
//鎵归噺鍒犻櫎
void delAllTech(String ids);
+
+
+
+
+
}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/Element.java b/base-server/src/main/java/com/yuanchu/mom/pojo/Element.java
new file mode 100644
index 0000000..adb271b
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/Element.java
@@ -0,0 +1,55 @@
+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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鍏冧欢琛�(Element)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-28 10:48:45
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("element")
+public class Element implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏冧欢鍚嶇О
+ **/
+ private String name;
+
+ @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/ElementTechnology.java b/base-server/src/main/java/com/yuanchu/mom/pojo/ElementTechnology.java
new file mode 100644
index 0000000..0191bf2
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/ElementTechnology.java
@@ -0,0 +1,62 @@
+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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鍏冧欢宸ヨ壓涓棿琛�(ElementTechnology)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-28 10:49:07
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("element_technology")
+public class ElementTechnology implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+
+ /**
+ * 鍏宠仈 鍏冧欢id
+ **/
+ private Integer elementId;
+
+
+ @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
new file mode 100644
index 0000000..7750fad
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/TechnicalModel.java
@@ -0,0 +1,70 @@
+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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * 鎶�鏈寚鏍囩淮鎶よ〃(TechnicalModel)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-08-28 16:09:19
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("technical_model")
+public class TechnicalModel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 鍏宠仈 宸ヨ壓id
+ **/
+ private Integer techTemId;
+
+ /**
+ * 椤圭洰鐖剁被
+ **/
+ private String father;
+
+ /**
+ * 椤圭洰鍚嶇О
+ **/
+ private String name;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ @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/TechnologyTemplate.java b/base-server/src/main/java/com/yuanchu/mom/pojo/TechnologyTemplate.java
index e7dc98f..8ebdd82 100644
--- a/base-server/src/main/java/com/yuanchu/mom/pojo/TechnologyTemplate.java
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/TechnologyTemplate.java
@@ -62,10 +62,6 @@
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
- /**
- * 鍏冧欢0:鎻掑ご1:鎻掍欢
- **/
- private String element;
/**
* 璁惧缁�
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
new file mode 100644
index 0000000..743bfc8
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnicalModelDto.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 TechnicalModelDto {
+
+
+ @JsonSerialize
+ @NotNull(message = "绫诲瀷涓嶈兘涓虹┖")
+ private Integer type;
+
+ @JsonSerialize
+ @NotBlank(message = "宸ュ簭涓嶈兘涓虹┖")
+ private String TechFather;
+
+ @JsonSerialize
+ @NotBlank(message = "宸ヨ壓涓嶈兘涓虹┖")
+ private String TechName;
+
+ @JsonSerialize
+ @NotBlank(message = "椤圭洰鐖剁被涓嶈兘涓虹┖")
+ private String father;
+
+ @JsonSerialize
+ @NotBlank(message = "椤圭洰涓嶈兘涓虹┖")
+ private String name;
+
+ @JsonSerialize
+ @NotBlank(message = "鍗曚綅涓嶈兘涓虹┖")
+ private String unit;
+}
diff --git a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyTemplateDto.java b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyTemplateDto.java
index 1baefff..46ec316 100644
--- a/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyTemplateDto.java
+++ b/base-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyTemplateDto.java
@@ -23,8 +23,8 @@
private String name;
@JsonSerialize
- @NotBlank(message = "鍏冧欢涓嶈兘涓虹┖")
- private String element;
+ @NotBlank(message = "鍏冧欢id涓嶈兘涓虹┖")
+ private String elementId;
@JsonSerialize
@NotBlank(message = "璁惧缁勪笉鑳戒负绌�")
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/ElementService.java b/base-server/src/main/java/com/yuanchu/mom/service/ElementService.java
new file mode 100644
index 0000000..33bbfb4
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/ElementService.java
@@ -0,0 +1,15 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.Element;
+
+/**
+ * 鍏冧欢琛�(Element)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-28 10:48:45
+ */
+public interface ElementService extends IService<Element> {
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/ElementTechnologyService.java b/base-server/src/main/java/com/yuanchu/mom/service/ElementTechnologyService.java
new file mode 100644
index 0000000..4077f11
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/ElementTechnologyService.java
@@ -0,0 +1,22 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.ElementTechnology;
+
+import java.util.List;
+
+/**
+ * 鍏冧欢宸ヨ壓涓棿琛�(ElementTechnology)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-28 10:49:07
+ */
+public interface ElementTechnologyService extends IService<ElementTechnology> {
+
+ //鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ void delElemaByTechsId(Integer id);
+
+ //鎵归噺鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ void delAllByTechId(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
new file mode 100644
index 0000000..a725a18
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/TechnicalModelService.java
@@ -0,0 +1,82 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.TechnicalModel;
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鎶�鏈寚鏍囩淮鎶よ〃(TechnicalModel)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-08-28 16:09:19
+ */
+public interface TechnicalModelService extends IService<TechnicalModel> {
+
+ /**
+ * 鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�
+ *
+ * @param type
+ * @param message
+ * @return
+ */
+ List<Map<String, Object>> selectAllTechTem(Integer type, String message);
+
+ /**
+ * 鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�
+ *
+ * @param id 宸ヨ壓id
+ * @return
+ */
+ List<Map<String, Object>> selectAllTechNam(Integer id);
+
+ /**
+ * 鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨宸ュ簭鍜屽伐鑹�
+ *
+ * @return
+ */
+ List<Map<String, Object>> chooseTechFath(Integer type);
+
+ /**
+ * 鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨椤圭洰(鐖剁被)
+ *
+ * @return
+ */
+ List<String> chooseProFath(Integer id);
+
+ /**
+ * 鏂板鎶�鏈寚鏍囩淮鎶�
+ *
+ * @param technicalModelDto
+ */
+ void addTechMode(Integer id, TechnicalModelDto technicalModelDto);
+
+ /**
+ * 鏍规嵁id鏌ヨ璇︽儏
+ * @param id 鎶�鏈寚鏍噄d
+ * @return
+ */
+ 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/TechnologyTemplateService.java b/base-server/src/main/java/com/yuanchu/mom/service/TechnologyTemplateService.java
index 2a80f59..f55fcb6 100644
--- a/base-server/src/main/java/com/yuanchu/mom/service/TechnologyTemplateService.java
+++ b/base-server/src/main/java/com/yuanchu/mom/service/TechnologyTemplateService.java
@@ -18,26 +18,49 @@
public interface TechnologyTemplateService extends IService<TechnologyTemplate> {
/**
- * 閫夋嫨璁惧缁�
+ * 鏂板宸ヨ壓璺嚎-->閫夋嫨璁惧缁�
* @return
*/
List<Map<String,Object>> chooseDevGroup();
/**
+ *鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
+ * @return
+ */
+ List<String> chooseTech();
+
+ /**
+ * 鏂板宸ヨ壓璺嚎-->閫夋嫨鍏冧欢
+ * @return
+ */
+ List<Map<String,Object>> chooseElement();
+
+ /**
* 鏂板宸ヨ壓璺嚎
* @param technologyTemplateDto
*/
- void addSale(TechnologyTemplateDto technologyTemplateDto);
+ void addTechTemp(TechnologyTemplateDto technologyTemplateDto);
/**
- * 鏌ヨ宸ヨ壓璺嚎鍒楄〃
- * @param page
+ * 鏌ヨ宸ヨ壓璺嚎鍒楄〃-->宸﹁竟浜岀骇灞曠ず
* @param type
- * @param name
+ * @return
+ */
+ List<Map<String,Object>> selectAllTechTem(Integer type,String message);
+
+ /**
+ * 鏌ヨ宸ヨ壓璺嚎鍒楄〃-->鍙宠竟灞曠ず宸ヨ壓鍜岃澶�
* @param father
* @return
*/
- IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father);
+ List<Map<String,Object>> selectAllTechNam(String father);
+
+ /**
+ * 鏍规嵁id鏌ヨ璇︽儏
+ * @param id 宸ヨ壓id
+ * @return
+ */
+ List<Map<String,Object>> selecTechById(Integer id);
/**
@@ -49,7 +72,7 @@
/**
* 鍒犻櫎
- * @param id
+ * @param id 宸ヨ壓璺嚎id
*/
void delTechById(Integer id);
@@ -58,5 +81,7 @@
* @param ids
*/
void delAllTech(String ids);
+
+
}
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementServiceImpl.java
new file mode 100644
index 0000000..7321ef5
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementServiceImpl.java
@@ -0,0 +1,19 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.ElementMapper;
+import com.yuanchu.mom.pojo.Element;
+import com.yuanchu.mom.service.ElementService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 鍏冧欢琛�(Element)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-28 10:48:45
+ */
+@Service
+public class ElementServiceImpl extends ServiceImpl<ElementMapper, Element> implements ElementService {
+
+}
+
diff --git a/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementTechnologyServiceImpl.java b/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementTechnologyServiceImpl.java
new file mode 100644
index 0000000..6ba56b5
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/ElementTechnologyServiceImpl.java
@@ -0,0 +1,36 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.ElementTechnologyMapper;
+import com.yuanchu.mom.pojo.ElementTechnology;
+import com.yuanchu.mom.service.ElementTechnologyService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 鍏冧欢宸ヨ壓涓棿琛�(ElementTechnology)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-28 10:49:07
+ */
+@Service
+public class ElementTechnologyServiceImpl extends ServiceImpl<ElementTechnologyMapper, ElementTechnology> implements ElementTechnologyService {
+
+ @Resource
+ ElementTechnologyMapper elementTechnologyMapper;
+
+ //鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ @Override
+ public void delElemaByTechsId(Integer id) {
+ elementTechnologyMapper.delElemaByTechsId(id);
+ }
+
+ //鎵归噺鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)
+ @Override
+ public void delAllByTechId(String ids) {
+ elementTechnologyMapper.delAllByTechId(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
new file mode 100644
index 0000000..e15387a
--- /dev/null
+++ b/base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java
@@ -0,0 +1,91 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.TechnicalModelMapper;
+import com.yuanchu.mom.pojo.TechnicalModel;
+import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
+import com.yuanchu.mom.service.TechnicalModelService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鎶�鏈寚鏍囩淮鎶よ〃(TechnicalModel)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-08-28 16:09:19
+ */
+@Service
+public class TechnicalModelServiceImpl extends ServiceImpl<TechnicalModelMapper, TechnicalModel> implements TechnicalModelService {
+
+ @Resource
+ TechnicalModelMapper technicalModelMapper;
+
+ //鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹�
+ @Override
+ public List<Map<String, Object>> selectAllTechTem(Integer type, String message) {
+ return technicalModelMapper.selectAllTechTem(type, message);
+ }
+
+ //鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛�-->鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�
+ @Override
+ public List<Map<String, Object>> selectAllTechNam(Integer id) {
+ return technicalModelMapper.selectAllTechNam(id);
+ }
+
+ //鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨宸ュ簭鍜屽伐鑹�
+ @Override
+ public List<Map<String, Object>> chooseTechFath(Integer type) {
+ return technicalModelMapper.chooseTechFath(type);
+ }
+
+
+ //鏂板鎶�鏈寚鏍囩淮鎶�-->閫夋嫨椤圭洰鐖剁被
+ @Override
+ public List<String> chooseProFath(Integer id) {
+ return technicalModelMapper.chooseProFath(id);
+ }
+
+ //鏂板鎶�鏈寚鏍囩淮鎶�
+ @Override
+ public void addTechMode(Integer id, TechnicalModelDto technicalModelDto) {
+ TechnicalModel technicalModel = new TechnicalModel();
+ BeanUtils.copyProperties(technicalModelDto, technicalModel);
+ technicalModel.setTechTemId(id);
+ technicalModelMapper.insert(technicalModel);
+ }
+
+ //鏍规嵁id鏌ヨ璇︽儏
+ @Override
+ public List<Map<String, Object>> selecTechById(Integer id) {
+ return technicalModelMapper.selecTechById(id);
+ }
+
+ //缂栬緫
+ @Override
+ public void writeTechById(Integer id, TechnicalModelDto technicalModelDto) {
+ TechnicalModel technicalModel = new TechnicalModel();
+ BeanUtils.copyProperties(technicalModelDto, technicalModel);
+ technicalModel.setId(id);
+ technicalModelMapper.updateById(technicalModel);
+ }
+
+ //鍒犻櫎
+ @Override
+ public void delTechById(Integer id) {
+ TechnicalModel technicalModel = new TechnicalModel();
+ technicalModel.setState(0);
+ technicalModel.setId(id);
+ technicalModelMapper.updateById(technicalModel);
+ }
+
+ //鎵归噺鍒犻櫎
+ @Override
+ public void delAllTech(String ids) {
+ technicalModelMapper.delAllTech(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 aa8345b..65a3728 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
@@ -1,19 +1,25 @@
package com.yuanchu.mom.service.impl;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.mapper.DeviceMapper;
-import com.yuanchu.mom.mapper.TechnologyTemplateMapper;
+import com.yuanchu.mom.mapper.*;
+import com.yuanchu.mom.pojo.ElementTechnology;
import com.yuanchu.mom.pojo.TechnologyTemplate;
import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto;
+import com.yuanchu.mom.service.ElementTechnologyService;
import com.yuanchu.mom.service.TechnologyTemplateService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* 宸ヨ壓璺嚎缁存姢琛�(TechnologyTemplate)琛ㄦ湇鍔″疄鐜扮被
@@ -30,48 +36,119 @@
@Resource
DeviceMapper deviceMapper;
+ @Resource
+ ElementMapper elementMapper;
- //閫夋嫨璁惧缁�
+ @Resource
+ ElementTechnologyService elementTechnologyService;
+
+ @Resource
+ TechnicalModelMapper technicalModelMapper;
+
+
+ //鏂板宸ヨ壓璺嚎-->閫夋嫨璁惧缁�
@Override
public List<Map<String, Object>> chooseDevGroup() {
return deviceMapper.chooseDevGroup();
}
+ //鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
+ @Override
+ public List<String> chooseTech() {
+ return technologyTemplateMapper.chooseTech();
+ }
+
+ //鏂板宸ヨ壓璺嚎-->閫夋嫨鍏冧欢
+ @Override
+ public List<Map<String, Object>> chooseElement() {
+ return elementMapper.chooseElement();
+ }
+
//鏂板宸ヨ壓璺嚎
@Override
- public void addSale(TechnologyTemplateDto technologyTemplateDto) {
+ @Transactional(rollbackFor = Exception.class)
+ public void addTechTemp(TechnologyTemplateDto technologyTemplateDto) {
+ /*鏂板宸ヨ壓*/
TechnologyTemplate technologyTemplate = new TechnologyTemplate();
- BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate);
+ BeanUtils.copyProperties(technologyTemplateDto, technologyTemplate);
technologyTemplateMapper.insert(technologyTemplate);
+ /*鏂板宸ヨ壓鍏冧欢涓棿琛�*/
+ String[] split = technologyTemplateDto.getElementId().split(",");
+ List<ElementTechnology> elementTechnologies = Arrays.stream(split).map(s -> {
+ ElementTechnology elementTechnology = new ElementTechnology();
+ elementTechnology.setTechTemId(technologyTemplate.getId());
+ elementTechnology.setElementId(Integer.parseInt(s));
+ return elementTechnology;
+ }).collect(Collectors.toList());
+ elementTechnologyService.saveBatch(elementTechnologies);
}
- //鏌ヨ宸ヨ壓璺嚎鍒楄〃
+ //鏌ヨ宸ヨ壓璺嚎鍒楄〃-->宸﹁竟浜岀骇灞曠ず
@Override
- public IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father) {
- return technologyTemplateMapper.selectAllTechTem(page,type,name,father);
+ public List<Map<String, Object>> selectAllTechTem(Integer type, String message) {
+ return technologyTemplateMapper.selectAllTechTem(type, message);
}
- //缂栬緫
+ //鏌ヨ宸ヨ壓璺嚎鍒楄〃-->鍙宠竟灞曠ず宸ヨ壓鍜岃澶�
@Override
+ public List<Map<String, Object>> selectAllTechNam(String father) {
+ return technologyTemplateMapper.selectAllTechNam(father);
+ }
+
+ //鏍规嵁id鏌ョ湅璇︽儏
+ @Override
+ public List<Map<String, Object>> selecTechById(Integer id) {
+ return technologyTemplateMapper.selecTechById(id);
+ }
+
+ //缂栬緫 (宸ヨ壓id)
+ @Override
+ @Transactional(rollbackFor = Exception.class)
public void writeTechById(Integer id, TechnologyTemplateDto technologyTemplateDto) {
+ /*宸ヨ壓琛ㄦ洿鏂�*/
TechnologyTemplate technologyTemplate = new TechnologyTemplate();
- BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate);
+ BeanUtils.copyProperties(technologyTemplateDto, technologyTemplate);
technologyTemplate.setId(id);
technologyTemplateMapper.updateById(technologyTemplate);
+ /*鏇存敼涓棿琛�*/
+ //鎵归噺鍒犻櫎鍘熸湁鐨勪腑闂磋〃(鏍规嵁宸ュ簭id)
+ elementTechnologyService.delElemaByTechsId(id);
+ //鎵归噺娣诲姞涓棿琛�
+ String[] split = technologyTemplateDto.getElementId().split(",");
+ List<ElementTechnology> elementTechnologies = Arrays.stream(split).map(s -> {
+ ElementTechnology elementTechnology = new ElementTechnology();
+ elementTechnology.setTechTemId(technologyTemplate.getId());
+ elementTechnology.setElementId(Integer.parseInt(s));
+ return elementTechnology;
+ }).collect(Collectors.toList());
+ elementTechnologyService.saveBatch(elementTechnologies);
}
- //鍒犻櫎
+ //鍒犻櫎(宸ヨ壓璺嚎id)
@Override
+ @Transactional(rollbackFor = Exception.class)
public void delTechById(Integer id) {
+ //鍒犻櫎宸ヨ壓琛�
TechnologyTemplate technologyTemplate = new TechnologyTemplate();
technologyTemplate.setId(id).setState(0);
technologyTemplateMapper.updateById(technologyTemplate);
+ //鍒犻櫎涓棿琛�
+ elementTechnologyService.delElemaByTechsId(id);
+ //鍒犻櫎鎶�鏈寚鏍囩淮鎶よ〃
+ technicalModelMapper.delTeMoByTechId(id);
+ //todo:鍒犻櫎鏈畬寰呯画
}
//鎵归噺鍒犻櫎
@Override
+ @Transactional(rollbackFor = Exception.class)
public void delAllTech(String ids) {
+ //鎵归噺鍒犻櫎宸ヨ壓琛�
technologyTemplateMapper.delAllTech(ids);
+ //鎵归噺鍒犻櫎涓棿琛�
+ elementTechnologyService.delAllByTechId(ids);
+ //鎵归噺鍒犻櫎鎸囨爣缁存姢琛�
+ technicalModelMapper.delAllByTechId(ids);
}
}
diff --git a/base-server/src/main/resources/mapper/ElementMapper.xml b/base-server/src/main/resources/mapper/ElementMapper.xml
new file mode 100644
index 0000000..c25da5b
--- /dev/null
+++ b/base-server/src/main/resources/mapper/ElementMapper.xml
@@ -0,0 +1,10 @@
+<?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.ElementMapper">
+ <!--鏂板宸ヨ壓璺嚎 閫夋嫨鍏冧欢-->
+ <select id="chooseElement" resultType="java.util.Map">
+ select id, name
+ from mom_ocean.element
+ where state=1
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml b/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml
new file mode 100644
index 0000000..94074f6
--- /dev/null
+++ b/base-server/src/main/resources/mapper/ElementTechnologyMapper.xml
@@ -0,0 +1,17 @@
+<?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.ElementTechnologyMapper">
+ <!--鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)-->
+ <update id="delElemaByTechsId">
+ update mom_ocean.element_technology
+ set state=0
+ where tech_tem_id = #{id}
+ </update>
+
+ <!--鎵归噺鍒犻櫎涓棿琛�(鏍规嵁宸ュ簭id)-->
+ <update id="delAllByTechId">
+ update mom_ocean.element_technology
+ set state=0
+ where tech_tem_id in (${id})
+ </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
new file mode 100644
index 0000000..b859a48
--- /dev/null
+++ b/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
@@ -0,0 +1,106 @@
+<?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.TechnicalModelMapper">
+ <!--鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛� 宸﹁竟浜岀骇灞曠ず宸ュ簭鍜屽伐鑹� -->
+ <resultMap id="selectAllTechTemMap" type="map">
+ <id property="father" column="father"/>
+ <collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="selectAllTechTemTowMap" type="map">
+ <id property="id" column="id"/>
+ <result property="name" column="name"/>
+ </resultMap>
+ <select id="selectAllTechTem" resultMap="selectAllTechTemMap">
+ select id,
+ name,
+ father
+ from mom_ocean.technology_template
+ where state=1
+ and type=#{type}
+ <if test="message!=null and message!=''">
+ and name like concat('%',#{message},'%')
+ </if>
+ </select>
+
+ <!--鏌ヨ鎶�鏈寚鏍囩淮鎶ゅ垪琛� 鍙宠竟灞曠ず璇ュ伐鑹轰笅鐨勬楠岄」鐩�-->
+ <resultMap id="selectAllTechNamMap" type="map">
+ <id property="father" 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"/>
+ </resultMap>
+ <select id="selectAllTechNam" resultMap="selectAllTechNamMap">
+ select id,
+ father,
+ name,
+ unit
+ from mom_ocean.technical_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏂板鎶�鏈寚鏍囩淮鎶� 閫夋嫨宸ュ簭鍜屽伐鑹�-->
+ <resultMap id="chooseTechFathMap" type="map">
+ <id property="techFather" 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"/>
+ </resultMap>
+ <select id="chooseTechFath" resultMap="chooseTechFathMap">
+ select id,
+ name techName,
+ father techFather
+ from mom_ocean.technology_template
+ where state = 1
+ and type = #{type}
+ </select>
+
+ <!--鏂板鎶�鏈寚鏍囩淮鎶� 閫夋嫨椤圭洰鐖剁被-->
+ <select id="chooseProFath" resultType="java.lang.String">
+ select distinct father
+ from mom_ocean.technical_model
+ where state = 1
+ and tech_tem_id = #{id}
+ </select>
+
+ <!--鏍规嵁id鏌ヨ璇︽儏-->
+ <select id="selecTechById" resultType="java.util.Map">
+ select technical_model.father,
+ technical_model.name,
+ unit,
+ technology_template.name techName,
+ technology_template.father techFather,
+ type
+ from mom_ocean.technical_model,
+ mom_ocean.technology_template
+ where technical_model.state = 1
+ and technology_template.id = tech_tem_id
+ and technical_model.id = #{id}
+ </select>
+
+ <!--鎵归噺鍒犻櫎鏍规嵁鎶�鏈寚鏍噄d-->
+ <update id="delAllTech">
+ update mom_ocean.technical_model
+ set state=0
+ where id in (${ids})
+ </update>
+
+ <!--鍒犻櫎鏍规嵁宸ヨ壓璺嚎id-->
+ <update id="delTeMoByTechId">
+ update mom_ocean.technical_model
+ set state=0
+ where tech_tem_id=#{id}
+ </update>
+
+ <!--鎵归噺鍒犻櫎鏍规嵁宸ヨ壓璺嚎id-->
+ <update id="delAllByTechId">
+ update mom_ocean.technical_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 cd5b7db..803a3f4 100644
--- a/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
+++ b/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
@@ -6,22 +6,70 @@
set state=0
where id in (${ids})
</update>
- <select id="selectAllTechTem" resultType="java.util.Map">
+
+ <!--鏌ヨ宸ヨ壓璺嚎鍒楄〃 宸﹁竟浜岀骇灞曠ず-->
+ <resultMap id="selectAllTechTemMap" type="map">
+ <id property="elname" column="elname"/>
+ <collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="selectAllTechTemTowMap" type="map">
+ <result property="father" column="father"/>
+ </resultMap>
+ <select id="selectAllTechTem" resultMap="selectAllTechTemMap">
+ select e.name elname,
+ father
+ from mom_ocean.technology_template t,
+ mom_ocean.element e,
+ mom_ocean.element_technology et
+ where e.id = et.element_id
+ and t.id = tech_tem_id
+ and t.state = 1
+ and type=#{type}
+ <if test="message!=null and message!=''">
+ and father like concat('%',#{message},'%')
+ </if>
+ </select>
+
+ <!--鏌ヨ宸ヨ壓璺嚎鍒楄〃 鍙宠竟灞曠ず宸ヨ壓鍜岃澶�-->
+ <select id="selectAllTechNam" resultType="java.util.Map">
select id,
- name,
- father,
- element,
- device_group
+ name,
+ device_group
from mom_ocean.technology_template
- where state=1
- <if test="type!=null">
- and type=#{type}
- </if>
- <if test="name!=null and name!=''">
- and name like concat('%',#{name},'%')
- </if>
- <if test="father!=null and father!=''">
- and father like concat('%',#{father},'%')
- </if>
+ where state = 1
+ and father = #{father}
+ </select>
+
+ <!--鏂板宸ヨ壓璺嚎 閫夋嫨宸ュ簭-->
+ <select id="chooseTech" resultType="java.lang.String">
+ select distinct father
+ from mom_ocean.technology_template
+ where state = 1
+ </select>
+
+ <!--鏍规嵁id鏌ョ湅璇︽儏-->
+ <resultMap id="selecTechByIdMap" type="map">
+ <id property="type" column="type"/>
+ <result property="father" column="father"/>
+ <result property="name" column="name"/>
+ <result property="deviceGroup" column="device_group"/>
+ <collection property="children" resultMap="selecTechByIdsMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="selecTechByIdsMap" type="map">
+ <id property="id" column="id"/>
+ </resultMap>
+ <select id="selecTechById" resultMap="selecTechByIdMap">
+ select e.id,
+ father,
+ t.name,
+ type,
+ device_group
+ from mom_ocean.technology_template t,
+ mom_ocean.element e,
+ mom_ocean.element_technology et
+ where e.id = et.element_id
+ and t.id = tech_tem_id
+ and t.state = 1
+ and t.id = #{id}
</select>
</mapper>
\ No newline at end of file
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java
index 39fd6f4..84fe3bf 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java
@@ -3,6 +3,8 @@
import lombok.Data;
+import java.math.BigDecimal;
+
@Data
public class StatisticsData {
private int material; //鍘熸潗鏂欏悎鏍�
@@ -11,6 +13,12 @@
private int unmaterial; //鍘熸潗鏂欎笉鍚堟牸
private int unprocess; //杩囩▼涓嶅悎鏍�
private int unfinished; //鎴愬搧涓嶅悎鏍�
+ /*private BigDecimal imaterial; //鍘熸潗鏂欏悎鏍肩巼
+ private BigDecimal iprocess; //杩囩▼鍚堟牸鐜�
+ private BigDecimal ifinished; //鎴愬搧鍚堟牸鐜�
+ private BigDecimal iunmaterial; //鍘熸潗鏂欎笉鍚堟牸鐜�
+ private BigDecimal iunprocess; //杩囩▼涓嶅悎鏍肩巼
+ private BigDecimal iunfinished; //鎴愬搧涓嶅悎鏍肩巼*/
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java
index dae4d0c..8abc759 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java
@@ -12,6 +12,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
@@ -141,4 +142,16 @@
.finishedList(StringUtils.join(finishedList, ','))
.build();
}
+
+
+ /*璁$畻鐧惧垎姣�*/
+ private BigDecimal getRadio(Integer all, Long num) {
+ if (all.intValue() == 0) {
+ return new BigDecimal(0);
+ }
+ BigDecimal numBigDecimal = new BigDecimal(num);
+ BigDecimal allBigDecimal = new BigDecimal(all);
+ BigDecimal divide = numBigDecimal.divide(allBigDecimal, 4, BigDecimal.ROUND_HALF_UP);
+ return divide.multiply(new BigDecimal(100));
+ }
}
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java b/inventory-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java
index 77ece38..e7d2ba5 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java
@@ -58,7 +58,7 @@
@PostMapping("/compile")
public Result compile(Integer id) {
ordersService.compile(id);
- return Result.success("缂栧埗瀹屾垚!");
+ return Result.success("缂栧埗浜у搧"+id+"瀹屾垚!");
}
}
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java
index d228fbf..b924d76 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java
@@ -3,15 +3,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.mapper.*;
import com.yuanchu.mom.pojo.*;
-import com.yuanchu.mom.service.ManufactureOrderService;
import com.yuanchu.mom.service.OrdersService;
import com.yuanchu.mom.utils.MyUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
--
Gitblit v1.9.3