From 19b596d3c05b1ca7ff80d8b802e7f6e03ad77dad Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 11 九月 2023 18:02:17 +0800
Subject: [PATCH] 修改   9.11

---
 inventory-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java        |   11 +
 inventory-server/src/main/java/com/yuanchu/mom/mapper/RepertoryMapper.java                |    2 
 inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java     |   18 +++
 standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java                 |    3 
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java  |   13 ++
 inventory-server/src/main/java/com/yuanchu/mom/service/impl/RepertoryServiceImpl.java     |    4 
 base-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java    |    7 +
 inventory-server/src/main/java/com/yuanchu/mom/controller/RepertoryController.java        |    7 
 standard-server/src/main/java/com/yuanchu/mom/service/impl/SpecificationsServiceImpl.java |   11 -
 standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java        |   15 +++
 standard-server/src/main/resources/mapper/TechniqueMapper.xml                             |   23 ++++
 standard-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyDto.java                 |    2 
 base-server/src/main/java/com/yuanchu/mom/mapper/TechnologyTemplateMapper.java            |    2 
 standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java     |   18 +-
 standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java         |   27 ++++
 standard-server/src/main/java/com/yuanchu/mom/service/SpecificationsService.java          |    5 -
 standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java               |   17 +++
 inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/InspectionItemDto2.java             |    2 
 inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java           |   10 ++
 inventory-server/src/main/java/com/yuanchu/mom/service/RepertoryService.java              |    2 
 base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml                        |    1 
 standard-server/src/main/java/com/yuanchu/mom/service/impl/ProductServiceImpl.java        |    4 
 base-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyTemplateServiceImpl.java |    4 
 standard-server/src/main/java/com/yuanchu/mom/service/impl/TechniqueServiceImpl.java      |   18 +++
 inventory-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java          |    8 +
 standard-server/src/main/java/com/yuanchu/mom/service/TechnologyService.java              |    9 +
 base-server/src/main/resources/mapper/TechnicalModelMapper.xml                            |    7 
 base-server/src/main/java/com/yuanchu/mom/service/TechnologyTemplateService.java          |    2 
 28 files changed, 195 insertions(+), 57 deletions(-)

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 9c14bd9..4dc370b 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
@@ -44,9 +44,12 @@
     }
 
     @ApiOperation(value = "鏂板宸ヨ壓璺嚎缁存姢-->閫夋嫨宸ュ簭")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "type", value = "绫诲瀷(涓虹┖=0姗¤兌杩炴帴鍣�)", dataTypeClass = Integer.class,required = true)
+    })
     @GetMapping("/chooseTech")
-    public Result chooseTech() {
-        return Result.success(technologyTemplateService.chooseTech());
+    public Result chooseTech(Integer type) {
+        return Result.success(technologyTemplateService.chooseTech(type));
     }
 
     @ApiOperation(value = "鏂板宸ヨ壓璺嚎缁存姢-->閫夋嫨鍏冧欢")
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 dd8dc57..06a132f 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
@@ -17,7 +17,7 @@
 public interface TechnologyTemplateMapper extends BaseMapper<TechnologyTemplate> {
 
     //鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
-    List<String> chooseTech();
+    List<String> chooseTech(Integer type);
 
     //鏌ヨ宸ヨ壓璺嚎鍒楄〃-->宸﹁竟浜岀骇灞曠ず
     List<Map<String,Object>> selectAllTechTem(Integer type,String message);
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 f55fcb6..6126b1d 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
@@ -27,7 +27,7 @@
      *鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
      * @return
      */
-    List<String> chooseTech();
+    List<String> chooseTech(Integer type);
 
     /**
      * 鏂板宸ヨ壓璺嚎-->閫夋嫨鍏冧欢
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 43ba437..5f408c8 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
@@ -66,8 +66,8 @@
 
     //鏂板宸ヨ壓璺嚎-->閫夋嫨宸ュ簭
     @Override
-    public List<String> chooseTech() {
-        return technologyTemplateMapper.chooseTech();
+    public List<String> chooseTech(Integer type) {
+        return technologyTemplateMapper.chooseTech(type);
     }
 
     //鏂板宸ヨ壓璺嚎-->閫夋嫨鍏冧欢
diff --git a/base-server/src/main/resources/mapper/TechnicalModelMapper.xml b/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
index 7effd0b..731903d 100644
--- a/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
+++ b/base-server/src/main/resources/mapper/TechnicalModelMapper.xml
@@ -52,7 +52,7 @@
         <result property="name" column="techName"/>
     </resultMap>
     <select id="chooseTechFath" resultMap="chooseTechFathMap">
-        select id techTemId,
+        select id     techTemId,
                name   techName,
                father techFather
         from mom_ocean.technology_template
@@ -73,6 +73,7 @@
         select technical_model.father,
                technical_model.name,
                unit,
+               technology_template.id,
                technology_template.name   techName,
                technology_template.father techFather,
                type
@@ -93,8 +94,8 @@
     <!--鍒犻櫎鏍规嵁宸ヨ壓璺嚎id-->
     <update id="delTeMoByTechId">
         update mom_ocean.technical_model
-            set state=0
-        where tech_tem_id=#{id}
+        set state=0
+        where tech_tem_id = #{id}
     </update>
 
     <!--鎵归噺鍒犻櫎鏍规嵁宸ヨ壓璺嚎id-->
diff --git a/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml b/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
index 088dc3b..25ad42f 100644
--- a/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
+++ b/base-server/src/main/resources/mapper/TechnologyTemplateMapper.xml
@@ -46,6 +46,7 @@
         select distinct father
         from mom_ocean.technology_template
         where state = 1
+          and type = #{type}
     </select>
 
     <!--鏍规嵁id鏌ョ湅璇︽儏-->
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java
index fed0cf2..d08c2a8 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java
@@ -42,7 +42,7 @@
     })
     @GetMapping("/list_user")
     public Result<?> selectInspectionItem(Integer id, Integer type) {
-        List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id,type);
+        List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id, type);
         return Result.success(inspectionItemDto);
     }
 
@@ -54,10 +54,10 @@
     })
     @GetMapping("/chooseDev")
     public Result<?> chooseDev(Integer technologyId, String father, String name) {
-        return Result.success(inspectionItemService.chooseDev(technologyId,father,name));
+        return Result.success(inspectionItemService.chooseDev(technologyId, father, name));
     }
 
-    @ApiOperation(value = "鏂板鎸夐挳-->2銆佹楠岄」鐩殑妫�楠屽��-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�")
+    @ApiOperation(value = "妫�楠岄」鐩殑妫�楠屽��-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�")
     @PostMapping("/lose_focus_update")
     public Result<?> addInspectionItem(@RequestHeader("token") String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception {
         Map<String, String> usernameMessage = jwt.readJWT(token);
@@ -70,4 +70,16 @@
         return Result.success(map);
     }
 
+    @ApiOperation(value = "鏇存敼璁惧")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "妫�楠屽崟Id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "DevId", value = "璁惧id", dataTypeClass = Integer.class, required = true)
+    })
+    @PostMapping("/updateDevByInsId")
+    public Result updateDevByInsId(Integer id, Integer type, Integer devId) {
+        inspectionItemService.updateDevByInsId(id, type, devId);
+        return Result.success();
+    }
+
 }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/InspectionItemDto2.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/InspectionItemDto2.java
index d9ad4d5..d23112c 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/InspectionItemDto2.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/InspectionItemDto2.java
@@ -24,7 +24,7 @@
     private String inspectionValue;
 
     @ApiModelProperty(value = "璇曢獙璁惧")
-    private Integer deviceId;
+    private String dname;
 
     @ApiModelProperty(value = "缁撹")
     private Integer result;
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java
index 231202d..522d317 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java
@@ -42,4 +42,14 @@
      * @return
      */
     List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name);
+
+
+    /**
+     * 鏇存敼璁惧
+     * @param id
+     * @param type
+     * @param devId
+     */
+    void updateDevByInsId(Integer id, Integer type, Integer devId);
+
 }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java
index c84861f..e503657 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java
@@ -3,6 +3,7 @@
 import com.yuanchu.mom.mapper.InspectionItemMapper;
 import com.yuanchu.mom.mapper.TechniqueMapper;
 import com.yuanchu.mom.pojo.InspectionItem;
+import com.yuanchu.mom.pojo.RawInsProduct;
 import com.yuanchu.mom.pojo.dto.InspectionItemDto;
 import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto;
 import com.yuanchu.mom.service.DeviceService;
@@ -51,6 +52,18 @@
         return techniqueMapper.selDevByVerTecIdFaNam(technologyId, father, name, ver);
     }
 
+    //鏇存敼璁惧
+    @Override
+    public void updateDevByInsId(Integer id, Integer type, Integer devId) {
+        InspectionItem inspectionItem = new InspectionItem();
+        inspectionItem.setId(id);
+        inspectionItem.setType(type);
+        inspectionItem.setDeviceId(devId);
+        inspectionItem.setInspectionValue(null);
+        inspectionItem.setResult(null);
+        inspectionItemMapper.updateById(inspectionItem);
+    }
+
     //鏂板鎸夐挳-->2銆佹楠岄」鐩�-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�
     @Override
     public Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto) {
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/controller/RepertoryController.java b/inventory-server/src/main/java/com/yuanchu/mom/controller/RepertoryController.java
index f9e1eb2..e9fea45 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/controller/RepertoryController.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/controller/RepertoryController.java
@@ -34,12 +34,11 @@
             @ApiImplicitParam(name = "name", value = "浜у搧鍚嶇О", dataTypeClass = String.class),
             @ApiImplicitParam(name = "specifications", value = "浜у搧鍨嬪彿", dataTypeClass = String.class),
             @ApiImplicitParam(name = "time", value = "鍏ュ簱鏃ユ湡", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "type", value = "绫诲瀷(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "result", value = "妫�楠岀粨鏋�(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class)
+            @ApiImplicitParam(name = "type", value = "绫诲瀷(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class)
     })
     @GetMapping("/selectAllRepertory")
-    public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type,Integer result) {
-        IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type,result);
+    public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type) {
+        IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type);
         Map<String, Object> map = new HashMap<>();
         map.put("total", repertoryPage.getTotal());
         map.put("row", repertoryPage.getRecords());
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/mapper/RepertoryMapper.java b/inventory-server/src/main/java/com/yuanchu/mom/mapper/RepertoryMapper.java
index 181baff..b8e2a04 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/mapper/RepertoryMapper.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/mapper/RepertoryMapper.java
@@ -18,7 +18,7 @@
 public interface RepertoryMapper extends BaseMapper<Repertory> {
 
     //鏌ヨ鎵�鏈夊簱瀛樺垪琛�
-    IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result);
+    IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type);
 
 }
 
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/service/RepertoryService.java b/inventory-server/src/main/java/com/yuanchu/mom/service/RepertoryService.java
index e3f3951..6ea463e 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/service/RepertoryService.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/service/RepertoryService.java
@@ -25,7 +25,7 @@
      * @param type
      * @return
      */
-    IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result);
+    IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type);
 
 }
 
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 8fa48b7..48c3b9d 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
@@ -1,5 +1,6 @@
 package com.yuanchu.mom.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -87,16 +88,18 @@
                 .build();
         //鏂板鐢熶骇璁㈠崟
         manufactureOrderMapper.insert(manufactureOrder);
-        //鏌ヨ浜у搧鐨勬渶鏂板伐搴�
         //浜у搧缂栫爜
         String code = materialMapper.selMcode(manufactureOrder.getName());
         //鍨嬪彿id
         Integer specificationId = getSpecificationId(manufactureOrder.getName(), code, manufactureOrder.getSpecifications());
         //榛樿鏈�鏂扮増鏈�
         Integer version = technologyMapper.selectVerByTec(specificationId).get(0);
-        List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query()
-                .eq("specifications_id", specificationId)
-                .eq("version", version));
+        /*姝e簭鏌ヨ璇ュ瀷鍙锋渶鏂扮増鏈笅鐨勫伐鑹鸿矾绾�*/
+        LambdaQueryWrapper<Technology> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Technology::getSpecificationsId,specificationId);
+        queryWrapper.eq(Technology::getVersion,version);
+        queryWrapper.orderByAsc(Technology::getFather);
+        List<Technology> technologyList = technologyMapper.selectList(queryWrapper);
         for (Technology technology : technologyList) {
             ManualTechnology manualTechnology = ManualTechnology.builder()
                     .techname(technology.getName())
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/RepertoryServiceImpl.java b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/RepertoryServiceImpl.java
index 088ba9b..8202492 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/RepertoryServiceImpl.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/RepertoryServiceImpl.java
@@ -26,8 +26,8 @@
 
     //鏌ヨ鎵�鏈夊簱瀛樺垪琛�
     @Override
-    public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result) {
-        return repertoryMapper.selectAllRepertory(page,name,specifications,time,type,result);
+    public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type) {
+        return repertoryMapper.selectAllRepertory(page,name,specifications,time,type);
     }
 }
 
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java
index 616b11a..c26a616 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java
@@ -16,6 +16,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.Date;
@@ -48,6 +49,7 @@
 
     //鏂板閿�鍞崟
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String addSale(String saleman, SaleDto saleDto) {
         Sale sale = new Sale();
         BeanUtils.copyProperties(saleDto, sale);
@@ -82,6 +84,7 @@
 
     //鏍规嵁閿�鍞崟id鍒犻櫎
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void delSale(Integer id) {
         Sale sale = saleMapper.selectById(id);
         sale.setState(0);
@@ -95,6 +98,7 @@
 
     //鏍规嵁id鎵归噺鍒犻櫎
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void delAllSale(List<Integer> ids) {
         List<Sale> sales = saleMapper.selectBatchIds(ids);
         for (Sale sale : sales) {
@@ -110,6 +114,7 @@
 
     //鏍规嵁閿�鍞崟id淇敼淇℃伅
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void updateSaleById(String saleman, Integer id, SaleVo saleVo) {
         Sale sale = saleMapper.selectById(id);
         sale.setSaleman(saleman);
@@ -119,13 +124,14 @@
         List<SaleMaterialDto> saleMaterialDtos = saleVo.getSaleMaterialList();
         for (SaleMaterialDto saleMaterialDto : saleMaterialDtos) {
             SaleMaterial saleMaterial = new SaleMaterial();
-            BeanUtils.copyProperties(saleMaterialDto,saleMaterial);
+            BeanUtils.copyProperties(saleMaterialDto, saleMaterial);
             saleMaterialMapper.updateById(saleMaterial);
         }
     }
 
     //瀹℃牳
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void check(String checkname, Integer id, Integer type) {
         Sale sale = saleMapper.selectById(id);
         sale.setType(type);
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
index f5415f0..07d5de5 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/TechniqueController.java
@@ -65,19 +65,40 @@
         return Result.success("娣诲姞鐢熶骇宸ヨ壓鎴愬姛");
     }
 
+    @ApiOperation(value = "鏍规嵁id鏌ョ湅璇︽儏")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "鐢熶骇宸ヨ壓id", dataTypeClass = Integer.class, required = true)
+    })
+    @GetMapping("/selTeqById")
+    public Result selTeqById(Integer id) {
+        return Result.success(techniqueService.selTeqById(id));
+    }
+
+    @ApiOperation(value = "缂栬緫")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "鐢熶骇宸ヨ壓id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "product", value = "妫�楠岄」鐩�(鐖剁被)", dataTypeClass = String.class, required = true),
+            @ApiImplicitParam(name = "productFather", value = "鎸囨爣(瀛愰」鐩�)", dataTypeClass = String.class, required = true),
+            @ApiImplicitParam(name = "unit", value = "鍗曚綅", dataTypeClass = String.class, required = true)
+    })
+    @PostMapping("/wriTeqById")
+    public Result wriTeqById(Integer id, String product, String productFather, String unit) {
+        return Result.success(techniqueService.wriTeqById(id, product, productFather, unit));
+    }
+
     @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("/delTeqById")
     public Result delTeqById(Integer id) {
         techniqueService.delTeqById(id);
-        return Result.success("鍒犻櫎"+id+"鎴愬姛!");
+        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("/delAllTeq")
     public Result delAllTeq(String ids) {
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 176ae9b..2d6787b 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
@@ -69,6 +69,21 @@
         return Result.fail("鏇存柊澶辫触");
     }
 
+    @ApiOperation("閫夋嫨璁惧缁�,榧犳爣绉诲紑淇濆瓨")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "deviceGroup", value = "璁惧缁�", dataTypeClass = String.class, required = true)
+
+    })
+    @PostMapping("/writeDevice")
+    public Result<?> writeDevice(Integer id, String deviceGroup) {
+        Integer write = technologyService.writeDevice(id, deviceGroup);
+        if (write >= 1) {
+            return Result.success("鏇存柊鎴愬姛");
+        }
+        return Result.fail("鏇存柊澶辫触");
+    }
+
 
     @ApiOperation(value = "鍒犻櫎")
     @ApiImplicitParams(value = {
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
index e53a42f..913cdb1 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/mapper/TechniqueMapper.java
@@ -43,5 +43,8 @@
 
     //鏌ヨ璇ュ伐鑹轰笅鏈�鏂扮増鏈湪涓�涓楠岄」鐩笅鍙互浣跨敤鍝簺璁惧
     List<Map<String, Object>> selDevByVerTecIdFaNam(Integer technologyId, String father, String name, Integer ver);
+
+    //鏍规嵁id鏌ョ湅璇︽儏
+    List<Map<String, Object>> selTeqById(Integer id);
 }
 
diff --git a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyDto.java b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyDto.java
index b04f6fa..ada9a56 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyDto.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/pojo/dto/TechnologyDto.java
@@ -1,6 +1,6 @@
 package com.yuanchu.mom.pojo.dto;
 
-import io.swagger.annotations.ApiModelProperty;
+
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
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 e2bb76f..b6cb65f 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
@@ -20,11 +20,6 @@
 
 
     /**
-     * 妫�楠屾ā鍧�-->OMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佽鏍煎瀷鍙风殑Id涓庡悕绉�)
-     */
-    List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId);
-
-    /**
      *   (4绾�)鏂板-->鍨嬪彿
      * @param specificationsDto
      */
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
index 1a68826..bb75ca9 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/TechniqueService.java
@@ -69,5 +69,22 @@
      * @param ids
      */
     void delAllTeq(String ids);
+
+    /**
+     * 鏍规嵁id鏌ョ湅璇︽儏
+     * @param id
+     * @return
+     */
+    List<Map<String,Object>> selTeqById(Integer id);
+
+    /**
+     * 缂栬緫
+     * @param id
+     * @param product
+     * @param productFather
+     * @param unit
+     * @return
+     */
+    String wriTeqById(Integer id, String product, String productFather, String unit);
 }
 
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 d766ca0..b603ed6 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
@@ -69,4 +69,13 @@
      * @param ids
      */
     void delAllTech(String ids);
+
+    /**
+     * 閫夋嫨璁惧缁�,榧犳爣绉诲紑淇濆瓨
+     * @param id
+     * @param deviceGroup
+     * @return
+     */
+    Integer writeDevice(Integer id, String deviceGroup);
+
 }
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 c42c0d4..e40dde9 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
@@ -1,16 +1,13 @@
 package com.yuanchu.mom.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yuanchu.mom.mapper.TechnologyMapper;
 import com.yuanchu.mom.pojo.Product;
 import com.yuanchu.mom.pojo.dto.ProductDto;
 import com.yuanchu.mom.service.ProductService;
 import com.yuanchu.mom.mapper.ProductMapper;
-import com.yuanchu.mom.utils.MyUtil;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
-
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.Map;
@@ -80,7 +77,6 @@
             if (requ != '>' && requ != '<' && requ != '=') {
                 return "鏍囧噯鍊艰緭鍏ユ牸寮忔湁闂!";
             }
-
         Product product = new Product();
         product.setId(id);
         product.setRequired(required);
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 8c07dba..cb80931 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
@@ -9,6 +9,7 @@
 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;
@@ -62,6 +63,7 @@
 
     //(4绾�)鏂板-->鍨嬪彿
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String addSpecifications(SpecificationsDto specificationsDto) {
         //鏍¢獙娣诲姞璇ユ爣鍑嗕笅鐨勫瀷鍙锋槸鍚﹂噸澶�
         List<String> specificationsNameList = specificationsMapper.selectList(Wrappers.<Specifications>query().eq("standard_id", specificationsDto.getId())).stream().map(specifications -> {
@@ -144,15 +146,6 @@
         }
         techniqueService.saveBatch(techniqueList);
         return "娣诲姞鍨嬪彿銆�"+ specificationsDto.getSpecifications() +"銆戞垚鍔燂紒";
-    }
-
-    /**
-     * 妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(闇�瑕佽鏍煎瀷鍙风殑Id涓庡悕绉�)
-     */
-    @Override
-    public List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId) {
-        List<Map<String, Object>> maps = specificationsMapper.selectSpecificationIdAndName(materialId);
-        return maps;
     }
 
 }
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
index 1729a3d..00cc745 100644
--- 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
@@ -81,5 +81,23 @@
     public void delAllTeq(String ids) {
         techniqueMapper.delAllTeq(ids);
     }
+
+    //鏍规嵁id鏌ョ湅璇︽儏
+    @Override
+    public List<Map<String, Object>> selTeqById(Integer id) {
+        return techniqueMapper.selTeqById((id));
+    }
+
+    //缂栬緫
+    @Override
+    public String wriTeqById(Integer id, String product, String productFather, String unit) {
+        Technique technique = new Technique();
+        technique.setId(id);
+        technique.setProduct(product);
+        technique.setProductFather(productFather);
+        technique.setUnit(unit);
+        techniqueMapper.updateById(technique);
+        return "淇敼鎴愬姛!";
+    }
 }
 
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 43b8597..13d35a1 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
@@ -42,16 +42,7 @@
     MbomMapper mbomMapper;
 
     @Resource
-    MbomService mbomService;
-
-    @Resource
     TechniqueMapper techniqueMapper;
-
-    @Resource
-    ProductService productService;
-
-    @Resource
-    TechniqueService techniqueService;
 
 
     //鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
@@ -127,4 +118,13 @@
         //鎵归噺鍒犻櫎鐢熶骇宸ヨ壓琛�
         techniqueMapper.delAllByTecId(ids);
     }
+
+    //閫夋嫨璁惧缁�,榧犳爣绉诲紑淇濆瓨
+    @Override
+    public Integer writeDevice(Integer id, String deviceGroup) {
+        Technology technology = new Technology();
+        technology.setId(id);
+        technology.setDeviceGroup(deviceGroup);
+        return technologyMapper.updateById(technology);
+    }
 }
diff --git a/standard-server/src/main/resources/mapper/TechniqueMapper.xml b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
index dfa3f44..2fc35c2 100644
--- a/standard-server/src/main/resources/mapper/TechniqueMapper.xml
+++ b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
@@ -108,6 +108,29 @@
           and version = #{ver}
     </select>
 
+    <!--鏍规嵁id鏌ョ湅璇︽儏-->
+    <select id="selTeqById" resultType="java.util.Map">
+        select m.father,
+               type,
+               m.name,
+               st.name,
+               sp.name,
+               t.father,
+               t.name,
+               technology_id,
+               device,
+               product_father,
+               product,
+               unit
+        from mom_ocean.technique tq
+                 left join mom_ocean.technology t on tq.technology_id = t.id
+                 left join mom_ocean.specifications sp on t.specifications_id = sp.id
+                 left join mom_ocean.standard st on sp.standard_id = st.id
+                 left join mom_ocean.material m on st.material_id = m.id
+        where tq.state = 1
+          and tq.id = #{id}
+    </select>
+
     <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎鐢熶骇宸ヨ壓-->
     <update id="delTeqByTecId">
         update mom_ocean.technique

--
Gitblit v1.9.3