From fa0d4fc230b44c04b969b4f7c7bd0ea72a61572d Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 06 九月 2023 18:02:41 +0800
Subject: [PATCH] 产品检验+过程检验(初步完成)
---
inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml | 151 ++-
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml | 21
inspect-server/src/main/resources/mapper/RawInspectMapper.xml | 6
production-server/src/main/java/com/yuanchu/mom/mapper/ManualTechnologyMapper.java | 3
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectionItemController.java | 33
inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo.java | 41 +
inspect-server/src/main/java/com/yuanchu/mom/service/impl/FinishedInspectServiceImpl.java | 316 +++------
inspect-server/src/main/java/com/yuanchu/mom/controller/ProcessInspectController.java | 100 +++
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java | 22
inspect-server/src/main/java/com/yuanchu/mom/pojo/ProcessInspect.java | 100 +++
inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectUnacceptedMapper.java | 4
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InspectionItemServiceImpl.java | 76 +-
inspect-server/src/main/java/com/yuanchu/mom/mapper/FinishedInspectMapper.java | 17
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java | 1
inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectionItem.java | 96 +-
inspect-server/src/main/java/com/yuanchu/mom/service/impl/ProcessInspectServiceImpl.java | 205 ++++++
inspect-server/src/main/java/com/yuanchu/mom/service/FinishedInspectService.java | 44
inspect-server/src/main/java/com/yuanchu/mom/mapper/ProcessInspectMapper.java | 28
inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectionItemDto.java | 10
inspect-server/src/main/java/com/yuanchu/mom/service/ProcessInspectService.java | 59 +
inspect-server/src/main/java/com/yuanchu/mom/pojo/FinishedInspect.java | 104 +-
inspect-server/src/main/java/com/yuanchu/mom/service/InspectionItemService.java | 25
standard-server/src/main/java/com/yuanchu/mom/service/impl/MaterialServiceImpl.java | 7
inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/ProcessInspectVo.java | 10
production-server/src/main/resources/mapper/ManualTechnologyMapper.xml | 19
standard-server/src/main/java/com/yuanchu/mom/service/MaterialService.java | 7
system-run/src/main/resources/application-dev.yml | 4
/dev/null | 157 ----
inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java | 84 -
inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInspectServiceImpl.java | 28
inspect-server/src/main/resources/mapper/InspectionItemMapper.xml | 34
inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInspectMapper.java | 2
inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectionItemMapper.java | 11
inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java | 4
inspect-server/src/main/resources/mapper/ProcessInspectMapper.xml | 120 +++
inspect-server/src/main/java/com/yuanchu/mom/service/RawInspectService.java | 11
inspect-server/src/main/resources/mapper/RawInsProductMapper.xml | 12
37 files changed, 1,183 insertions(+), 789 deletions(-)
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java
index ce2e053..8dd51eb 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.FinishedInspect;
-import com.yuanchu.mom.pojo.vo.FinishedInspectVo1;
+import com.yuanchu.mom.pojo.ProcessInspect;
+import com.yuanchu.mom.pojo.vo.FinishedInspectVo;
import com.yuanchu.mom.service.*;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.utils.Jwt;
@@ -19,7 +21,6 @@
import java.util.Date;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
/**
@@ -50,7 +51,7 @@
@Autowired
Jwt jwt;
- @ApiOperation(value = "鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�")
+ @ApiOperation(value = "鏂板鎴愬搧妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "orderNumber", value = "璁㈠崟缂栧彿", dataTypeClass = String.class, required = true)
})
@@ -59,69 +60,48 @@
return Result.success(finishedInspectService.chooseMater(orderNumber));
}
- @ApiOperation(value = "鏂板杩囩▼妫�楠屽崟-->閫夋嫨璁惧")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "technologyId", value = "鍏宠仈鐨勫伐鑹鸿矾绾縤d", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "father", value = "椤圭洰鐖跺悕绉�", dataTypeClass = String.class, required = true),
- @ApiImplicitParam(name = "name", value = "椤圭洰鍚嶇О", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/chooseDev")
- public Result<?> chooseDev(Integer technologyId, String father, String name) {
- return Result.success(finishedInspectService.chooseDev(technologyId,father,name));
- }
-
- @ApiOperation(value = "鏂板杩囩▼妫�楠屽崟")
- @PostMapping("/addProcess")
- public Result<?> addProcess(@RequestHeader("token") String token, @RequestBody FinishedInspectVo1 finishedInspectVo1) throws Exception {
+ @ApiOperation(value = "鏂板鎴愬搧妫�楠屽崟")
+ @PostMapping("/addFinish")
+ public Result<?> addFinish(@RequestHeader("token") String token, @Validated @RequestBody FinishedInspectVo finishedInspectVo) throws Exception {
Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
- return Result.success(finishedInspectService.addProcess(data.get("id").replaceAll("\"", ""), finishedInspectVo1));
+ return Result.success(finishedInspectService.addProcessInspectionSheet(data.get("id").replaceAll("\"", ""), finishedInspectVo));
}
- @ApiOperation(value = "鏂板鎸夐挳-->1銆佹柊澧炴垚鍝佹楠屽崟")
- @PostMapping("/add_process_inspection_sheet")
- public Result<?> addProcessInspectionSheet(@Validated @RequestBody FinishedInspect finishedInspect) {
- Integer isInsertSuccess = finishedInspectService.addProcessInspectionSheet(finishedInspect);
- if (isInsertSuccess == 1) {
- return Result.success("鏂板鎴愬姛锛�", finishedInspect.getId());
- }
- return Result.fail("鏂板澶辫触锛�");
- }
-
-
- @ApiOperation(value = "鏂板鎸夐挳-->1銆佹柊澧炶繃绋嬫楠屽崟-->1銆侀」鐩悕绉颁笅鎷夋")
- @GetMapping("/list_material")
- public Result<?> selectMaterialIdAndNameAndCode() {
- List<Map<String, Object>> maps = materialService.selectMaterialIdAndNameAndCode();
- return Result.success(maps);
- }
-
- @ApiOperation(value = "鏂板鎸夐挳-->3銆佹楠岀粨璁�")
+ @ApiOperation(value = "涓婃姤(鏇存柊妫�楠岀姸鎬�)")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "finishedInspectId", value = "妫�楠屽崟Id", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "result", value = "妫�楠岀粨璁�", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
- @PostMapping("/inspection_conclusion")
- public Result<?> inspectionConclusion(@RequestHeader("token") String token, Integer finishedInspectId, Integer result) throws Exception {
- Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
- Integer isInsertSuccess = finishedInspectService.inspectionConclusion(data.get("name").replaceAll("\"", ""), finishedInspectId, result);
- if (isInsertSuccess == 1) {
- return Result.success("涓婃姤鎴愬姛锛�");
+ @PostMapping("/updateFinishInspectsById")
+ public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id) throws Exception {
+ //濡傛灉宸茬粡涓婃姤浜嗕笉鑳藉啀涓�娆′笂鎶�
+ FinishedInspect finishedInspect = finishedInspectService.getById(id);
+ if (ObjectUtils.isNotEmpty(finishedInspect.getResult())) {
+ return Result.fail("宸茬粡涓婃姤杩囦簡,涓嶈兘鍐嶆涓婃姤!");
}
- return Result.fail("涓婃姤澶辫触锛�");
+ Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
+ return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id));
}
- @ApiOperation(value = "4銆佷富椤靛垎椤�")
+ @ApiOperation(value = "鏍规嵁妫�楠屽崟id鏌ヨ鎴愬搧妫�楠屽崟璇︽儏")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectFinishInspectsListById")
+ public Result selectFinishInspectsListById(Integer id) {
+ return Result.success(finishedInspectService.selectFinishInspectsListById(id));
+ }
+
+ @ApiOperation(value = "鍒嗛〉鏌ヨ鎴愬搧妫�楠屽崟鍒楄〃")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "pageNo", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
@ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "inspectResult", value = "妫�楠岀粨鏋�", dataTypeClass = Integer.class),
- @ApiImplicitParam(name = "inspectDate", value = "妫�楠屾棩鏈�", dataTypeClass = Date.class, dataType = "date"),
- @ApiImplicitParam(name = "inspectUsername", value = "涓绘満宸�", dataTypeClass = String.class)
+ @ApiImplicitParam(name = "result", value = "妫�楠岀粨鏋�(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
+ @ApiImplicitParam(name = "material", value = "浜у搧鍚嶇О", dataTypeClass = String.class)
})
@GetMapping("/list_page")
- public Result<?> selectFinishedInspectPage(Integer pageNo, Integer pageSize, Integer inspectResult, String inspectDate, String inspectUsername) {
- IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageNo, pageSize), inspectResult, inspectDate, inspectUsername);
+ public Result<?> list_page(Integer pageNo, Integer pageSize, Integer result, String material) {
+ IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageNo, pageSize), result, material);
Map<String, Object> map = new HashMap<>();
map.put("total", page.getTotal());
map.put("row", page.getRecords());
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
index dd389f2..d81715a 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -29,6 +29,7 @@
* @author zss
* @since 2023-08-07 10:04:01
*/
+@Api(tags = "QMS绠$悊-->涓嶅悎鏍煎搧绠$悊")
@RestController
@RequestMapping("/inspectUnaccepted")
public class InspectUnacceptedController {
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 e77f84b..fed0cf2 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
@@ -17,13 +17,13 @@
/**
* <p>
- * 鍓嶇鎺у埗鍣�
+ * 鍓嶇鎺у埗鍣�
* </p>
*
* @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
* @since 2023-08-01
*/
-@Api(tags = "QMS绠$悊-->鎴愬搧妫�楠�")
+@Api(tags = "QMS绠$悊-->鎴愬搧杩囩▼妫�楠岄」鐩�")
@RestController
@RequestMapping("/inspection-item")
public class InspectionItemController {
@@ -31,22 +31,35 @@
@Autowired
private InspectionItemService inspectionItemService;
+
@Autowired
private Jwt jwt;
@ApiOperation(value = "鏂板鎸夐挳-->2銆佹煡璇㈡墍鏈夋楠岄」鐩�")
@ApiImplicitParams(value = {
- @ApiImplicitParam(name = "finishInspectId",value = "鎴愬搧妫�楠屽崟Id",dataTypeClass = Integer.class,required = true)
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟Id", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/list_user")
- public Result<?> selectInspectionItem(Integer finishInspectId){
- List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(finishInspectId);
+ public Result<?> selectInspectionItem(Integer id, Integer type) {
+ List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id,type);
return Result.success(inspectionItemDto);
}
- @ApiOperation(value = "鏂板鎸夐挳-->2銆佹楠岄」鐩�-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�")
+ @ApiOperation(value = "鏂板妫�楠屽崟-->閫夋嫨璁惧")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "technologyId", value = "鍏宠仈鐨勫伐鑹鸿矾绾縤d", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "father", value = "椤圭洰鐖跺悕绉�", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "name", value = "椤圭洰鍚嶇О", dataTypeClass = String.class, required = true)
+ })
+ @GetMapping("/chooseDev")
+ public Result<?> chooseDev(Integer technologyId, String father, String name) {
+ return Result.success(inspectionItemService.chooseDev(technologyId,father,name));
+ }
+
+ @ApiOperation(value = "鏂板鎸夐挳-->2銆佹楠岄」鐩殑妫�楠屽��-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�")
@PostMapping("/lose_focus_update")
- public Result<?> addInspectionItem(@RequestHeader("token")String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception {
+ public Result<?> addInspectionItem(@RequestHeader("token") String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception {
Map<String, String> usernameMessage = jwt.readJWT(token);
Map<String, Object> usernameAndId = JackSonUtil.unmarshal(usernameMessage.get("data"), Map.class);
String name = usernameAndId.get("name").toString().replaceAll("\"", "");
@@ -57,10 +70,4 @@
return Result.success(map);
}
- @ApiOperation(value = "鏂板鎸夐挳-->2銆佹楠岄」鐩�-->璇曢獙璁惧涓嬫媺妗�")
- @GetMapping("/list_device")
- public Result<?> selectDeviceIdAndName(){
- List<Map<String, Object>> maps = inspectionItemService.selectDeviceIdAndName();
- return Result.success(maps);
- }
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/ProcessInspectController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/ProcessInspectController.java
new file mode 100644
index 0000000..e3fac84
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/ProcessInspectController.java
@@ -0,0 +1,100 @@
+package com.yuanchu.mom.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yuanchu.mom.pojo.ProcessInspect;
+import com.yuanchu.mom.pojo.vo.ProcessInspectVo;
+import com.yuanchu.mom.utils.JackSonUtil;
+import com.yuanchu.mom.utils.Jwt;
+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.ProcessInspectService;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * 杩囩▼妫�楠�(ProcessInspect)琛ㄦ帶鍒跺眰
+ *
+ * @author zss
+ * @since 2023-09-06 13:36:02
+ */
+@Api(tags = "QMS绠$悊-->杩囩▼妫�楠�")
+@RestController
+@RequestMapping("/processInspect")
+public class ProcessInspectController {
+
+ @Autowired
+ private ProcessInspectService processInspectService;
+
+ @Resource
+ Jwt jwt;
+
+ @ApiOperation(value = "鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "orderNumber", value = "璁㈠崟缂栧彿", dataTypeClass = String.class, required = true)
+ })
+ @GetMapping("/chooseMater")
+ public Result<?> chooseMater(String orderNumber) {
+ return Result.success(processInspectService.chooseMater(orderNumber));
+ }
+
+ @ApiOperation(value = "鏂板杩囩▼妫�楠屽崟")
+ @PostMapping("/addProcess")
+ public Result<?> addProcess(@RequestHeader("token") String token,@Validated @RequestBody ProcessInspectVo processInspectVo) throws Exception {
+ Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
+ return Result.success(processInspectService.addProcess(data.get("id").replaceAll("\"", ""), processInspectVo));
+ }
+
+ @ApiOperation(value = "涓婃姤(鏇存柊妫�楠岀姸鎬�)")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/updateProcessInspectsById")
+ public Result updateProcessInspectsById(Integer id) {
+ //濡傛灉宸茬粡涓婃姤浜嗕笉鑳藉啀涓�娆′笂鎶�
+ ProcessInspect processInspect = processInspectService.getById(id);
+ if (ObjectUtils.isNotEmpty(processInspect.getResult())) {
+ return Result.fail("宸茬粡涓婃姤杩囦簡,涓嶈兘鍐嶆涓婃姤!");
+ }
+ return Result.success(processInspectService.updateProcessInspectsById(id));
+ }
+
+ @ApiOperation(value = "鏍规嵁妫�楠屽崟id鏌ヨ杩囩▼妫�楠屽崟璇︽儏")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/selectProcessInspectsListById")
+ public Result selectProcessInspectsListById(Integer id) {
+ return Result.success(processInspectService.selectProcessInspectsListById(id));
+ }
+
+ @ApiOperation(value = "鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "techfather", value = "宸ュ簭", dataTypeClass = String.class),
+ @ApiImplicitParam(name = "result", value = "妫�娴嬬粨鏋�(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
+ @ApiImplicitParam(name = "name", value = "浜у搧鍚嶇О", dataTypeClass = String.class)
+ })
+ @PostMapping("/selectProcessInspectsList")
+ public Result selectProcessInspectsList(Integer pageSize, Integer countSize, String techfather, Integer result, String name) {
+ IPage<Map<String, Object>> page = processInspectService.selectProcessInspectsList(new Page<Object>(pageSize, countSize), techfather, result, name);
+ Map<String, Object> map = new HashMap<>();
+ map.put("total", page.getTotal());
+ map.put("row", page.getRecords());
+ return Result.success(map);
+ }
+
+}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java
index 399a283..8a3518e 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java
@@ -14,6 +14,7 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -36,7 +37,7 @@
@ApiOperation(value = "鏂板鍘熸潗鏂欐楠屽崟")
@PostMapping("/addRawInspects")
- public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspectVo rawInspectVo) throws Exception {
+ public Result addRawInspects(@RequestHeader("token") String token,@Validated @RequestBody RawInspectVo rawInspectVo) throws Exception {
Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
return Result.success(rawInspectService.addRawInspects(data.get("id").replaceAll("\"", ""), rawInspectVo));
}
@@ -82,23 +83,4 @@
return Result.success(rawInspectService.updateRawInspectsById(id));
}
- @ApiOperation(value = "鍒犻櫎")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鍘熸潗鏂欐楠屽崟id", dataTypeClass = Integer.class, required = true)
- })
- @PostMapping("/delRawInsById")
- public Result delRawInsById(Integer id) {
- rawInspectService.delRawInsById(id);
- return Result.success("鍒犻櫎" + id + "鎴愬姛!");
- }
-
- @ApiOperation(value = "鎵归噺鍒犻櫎")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "ids", value = "鍘熸潗鏂欐楠屽崟id", dataTypeClass = String.class, required = true)
- })
- @PostMapping("/delAllRawIns")
- public Result delAllRawIns(String ids) {
- rawInspectService.delAllRawIns(ids);
- return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
- }
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/ResportController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/ResportController.java
deleted file mode 100644
index 6673339..0000000
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/ResportController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.yuanchu.mom.controller;
-
-
-import com.yuanchu.mom.pojo.StatisticsData;
-import com.yuanchu.mom.service.ResportService;
-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.format.annotation.DateTimeFormat;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.time.LocalDate;
-
-
-@RestController
-@RequestMapping("/resport")
-@Api(tags = "QMS绠$悊-->璐ㄩ噺缁熻")
-public class ResportController {
-
- @Resource
- ResportService resportService;
-
-
- @ApiOperation("璁$畻鍚堟牸涓庝笉鍚堟牸鏁伴噺鎺ュ彛")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "begin", value = "缁熻寮�濮嬫棩鏈�", dataTypeClass = String.class, required = true),
- @ApiImplicitParam(name = "end", value = "缁熻缁撴潫鏃ユ湡", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/qualifiedStatistics")
- public Result turno(String begin, String end) {
- StatisticsData statisticsData=resportService.turno(begin,end);
- return Result.success(statisticsData);
- }
-
- @ApiOperation("璁$畻浜у搧鏁伴噺鎺ュ彛")
- @GetMapping("/allNum")
- public Result allNum() {
- return Result.success(resportService.allNum());
- }
-
- @ApiOperation("璁$畻浜у搧杈炬爣鏁伴噺鎺ュ彛")
- @GetMapping("/statisNum")
- public Result statisNum() {
- return Result.success(resportService.statisNum());
- }
-}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/FinishedInspectMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/FinishedInspectMapper.java
index 87b4a99..20e1362 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/FinishedInspectMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/FinishedInspectMapper.java
@@ -2,10 +2,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yuanchu.mom.pojo.FinishedInspect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yuanchu.mom.pojo.FinishedInspect;
-import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@@ -19,14 +18,12 @@
*/
public interface FinishedInspectMapper extends BaseMapper<FinishedInspect> {
- IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername);
+ //鍒嗛〉鏌ヨ鎴愬搧妫�楠�
+ IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material);
- //璁$畻鎴愬搧鎴栬�呰繃绋嬫楠屽湪鏌愪竴涓椂闂存鐨勫悎鏍兼暟
- Integer selCountFin(String begin, String end, int type,int result);
-
- //璁$畻鏈堜骇閲�
- Long seAllCount(String begin, String end, int type);
-
- //鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
+ //鏂板妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
List<Map<String, Object>> chooseMater(String orderNumber);
+
+ //鏍规嵁妫�楠屽崟id鏌ヨ鎴愬搧妫�楠屽崟璇︽儏
+ List<Map<String, Object>> selectFinishInspectsListById(Integer id);
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectUnacceptedMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectUnacceptedMapper.java
index 1ba404f..8f9e557 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectUnacceptedMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectUnacceptedMapper.java
@@ -18,11 +18,7 @@
//鏌ヨ鎴愬搧妫�楠屼腑涓嶅悎鏍煎搧妫�楠屽崟鍒楄〃
IPage<Map<String, Object>> selectInsList(Page<Object> page, String formTime, Integer dealState);
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍝�
- void updaRawIns(Integer id);
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍝�
- void delAllRawIns(String ids);
IPage<Map<String, Object>> selectUnqualifiedRawMaterials(Page<Object> page, String formTime, String productName, String supplier, Integer processingStatus);
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectionItemMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectionItemMapper.java
index 991b8c7..f3a2c89 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectionItemMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InspectionItemMapper.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.mapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchu.mom.mybatis_config.MyBaseMapper;
import com.yuanchu.mom.pojo.InspectionItem;
import com.yuanchu.mom.pojo.dto.InspectionItemDto;
@@ -14,7 +15,13 @@
* @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
* @since 2023-08-01
*/
-public interface InspectionItemMapper extends MyBaseMapper<InspectionItem> {
+public interface InspectionItemMapper extends BaseMapper<InspectionItem> {
- List<InspectionItemDto> selectInspectionItem(Integer finishInspectId);
+
+ //鑾峰彇璇ョ被鍨嬫楠屽崟id涓嬬殑妫�楠岄」鐩粨鏋滈泦
+ List<Integer> getResult(Integer id, int type);
+
+ List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type);
+
+
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/ProcessInspectMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/ProcessInspectMapper.java
new file mode 100644
index 0000000..c986c40
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/ProcessInspectMapper.java
@@ -0,0 +1,28 @@
+package com.yuanchu.mom.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yuanchu.mom.pojo.ProcessInspect;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 杩囩▼妫�楠�(ProcessInspect)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author zss
+ * @since 2023-09-06 13:36:02
+ */
+public interface ProcessInspectMapper extends BaseMapper<ProcessInspect> {
+
+ //鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�
+ List<Map<String, Object>> chooseMater(String orderNumber);
+
+ //鏍规嵁妫�楠屽崟id鏌ヨ杩囩▼妫�楠屽崟璇︽儏
+ List<Map<String, Object>> selectProcessInspectsListById(Integer id);
+
+ //鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃
+ IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name);
+}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
index 74ac78c..5a34469 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInsProductMapper.java
@@ -19,10 +19,6 @@
//鏍规嵁鍘熸潗鏂欐楠屽崟id鏌ヨ妫�楠岄」鐩�
List<Integer> getresult(Integer id);
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎
- void updaRawInsById(Integer id);
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎鍘熸潗鏂欐楠岄」鐩�
- void delAllRawIns(String ids);
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInspectMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInspectMapper.java
index a536bd6..8d99714 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInspectMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/RawInspectMapper.java
@@ -29,8 +29,6 @@
//鏍规嵁鍘熸潗鏂欐楠屽崟id鏌ョ湅璇︽儏
List<Map<String, Object>> selectRawInspectsListById(Integer id);
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎
- void delAllRawIns(String ids);
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/FinishedInspect.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/FinishedInspect.java
index 052f517..1373879 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/FinishedInspect.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/FinishedInspect.java
@@ -1,97 +1,105 @@
package com.yuanchu.mom.pojo;
import com.baomidou.mybatisplus.annotation.*;
-
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-
import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
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 javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.io.Serializable;
/**
- * <p>
+ * 鎴愬搧妫�楠�(FinishedInspect)琛ㄥ疄浣撶被
*
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-08-01
+ * @author zss
+ * @since 2023-09-06 13:33:56
*/
@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
-@ApiModel(value="FinishedInspect瀵硅薄", description="")
+@TableName("finished_inspect")
public class FinishedInspect implements Serializable {
-
private static final long serialVersionUID = 1L;
- @ApiModelProperty(value = "涓婚敭", hidden = true)
- @TableId(value = "id", type = IdType.AUTO)
+ /**
+ * 涓婚敭
+ **/
+ @TableId(type = IdType.AUTO)
private Integer id;
-
- @ApiModelProperty(value = "璁㈠崟鍙�", required = true, example = "DDH202308010001")
+ /**
+ * 璁㈠崟鍙�
+ **/
private String orderNumber;
-
- @ApiModelProperty(value = "瀹㈡埛鍚嶇О", required = true, example = "鎳掓磱娲�")
+ /**
+ * 瀹㈡埛鍚嶇О
+ **/
private String customerName;
-
- @ApiModelProperty(value = "宸ョ▼鍚嶇О", required = true, example = "娑蹭綋纭呮鑳�")
+ /**
+ * 宸ョ▼鍚嶇О
+ **/
private String projectName;
-
- @ApiModelProperty(value = "璐ㄩ噺杩芥函鍙�", required = true, example = "ZLZSH202308010001")
+ /**
+ * 璐ㄩ噺杩芥函鍙�
+ **/
private String qualityTraceability;
- @ApiModelProperty(value = "0:鎴愬搧;1锛氳繃绋�;", hidden = true)
- private Integer type;
-
-
- @ApiModelProperty(value = "鍗曚綅", required = true, example = "鍚�")
+ /**
+ * 鍗曚綅
+ **/
private String unit;
-
- @ApiModelProperty(value = "鏁伴噺", required = true, example = "50")
+ /**
+ * 鏁伴噺
+ **/
private Integer quantity;
-
- @ApiModelProperty(value = "瑙勬牸鍨嬪彿鎷兼帴瀛楃", required = true, example = "8.7/15kV JLS-3.2")
+ /**
+ * 瑙勬牸鍨嬪彿
+ **/
private String specificationsModel;
-
- @ApiModelProperty(value = "浜у搧缂栫爜", required = true, example = "GX20230807")
- private String materialCode;
-
-
- @ApiModelProperty(value = "浜у搧鍚嶇О", required = true, example = "鍏夌氦")
+ /**
+ * 鐗╂枡鍚嶇О
+ **/
private String material;
+ /**
+ * 鐗╂枡缂栫爜
+ **/
+ private String materialCode;
- @ApiModelProperty(value = "鎶ユ浜�:鐢ㄦ埛id", required = true, example = "1")
+ /**
+ * 鎶ユ浜�:鐢ㄦ埛id
+ **/
private Integer userId;
- @ApiModelProperty(value = "妫�楠岀粨璁�", hidden = true, required = true, example = "DDH202308010001")
+ /**
+ * 妫�楠岀粨璁�;0:涓嶅悎鏍�;1:鍚堟牸
+ **/
private Integer result;
@ApiModelProperty(value = "閫昏緫鍒犻櫎 姝e父>=1,鍒犻櫎<=0", hidden = true)
private Integer state;
@TableField(fill = FieldFill.INSERT)
- @ApiModelProperty(value = "鍒涘缓鏃堕棿", hidden = true)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @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")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
-
-
}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectionItem.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectionItem.java
index 0ed6e61..1d640c1 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectionItem.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectionItem.java
@@ -1,81 +1,107 @@
package com.yuanchu.mom.pojo;
import com.baomidou.mybatisplus.annotation.*;
-
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
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;
/**
- * <p>
+ * 鎴愬搧/杩囩▼妫�楠岄」鐩�(InspectionItem)琛ㄥ疄浣撶被
*
- * </p>
- *
- * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
- * @since 2023-08-01
+ * @author zss
+ * @since 2023-09-06 13:34:17
*/
@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
-@ApiModel(value="InspectionItem瀵硅薄", description="")
-public class InspectionItem extends Model<InspectionItem> implements Serializable {
-
+@TableName("inspection_item")
+public class InspectionItem implements Serializable {
private static final long serialVersionUID = 1L;
- @ApiModelProperty(value = "涓婚敭")
- @TableId(value = "id", type = IdType.AUTO)
+ /**
+ * 涓婚敭
+ **/
+ @TableId(type = IdType.AUTO)
private Integer id;
- @ApiModelProperty(value = "椤圭洰鍚嶇О")
+ /**
+ * 椤圭洰鍚嶇О
+ **/
private String name;
- @ApiModelProperty(value = "鐖跺悕绉�")
+ /**
+ * 鐖跺悕绉�
+ **/
private String father;
- @ApiModelProperty(value = "鍗曚綅")
+ /**
+ * 鍗曚綅
+ **/
private String unit;
- @ApiModelProperty(value = "鏍囧噯鍊�")
+ /**
+ * 鏍囧噯鍊�
+ **/
private String required;
- @ApiModelProperty(value = "鍐呮帶鍊�")
+ /**
+ * 鍐呮帶鍊�
+ **/
private String internal;
- @ApiModelProperty(value = "鎴愬搧妫�楠屽崟Id")
- private Integer finishInspectId;
-
- @ApiModelProperty(value = "妫�楠屽��")
+ /**
+ * 妫�楠屽��
+ **/
private String inspectionValue;
- @ApiModelProperty(value = "璇曢獙璁惧")
+ /**
+ * 璇曢獙璁惧Id 鍏宠仈
+ **/
private Integer deviceId;
- @ApiModelProperty(value = "缁撹")
+ /**
+ * 缁撹
+ **/
private Integer result;
- @ApiModelProperty(value = "妫�楠屼汉")
+ /**
+ * 妫�楠屽崟Id
+ **/
+ private Integer inspectId;
+
+ /**
+ * 妫�楠屼汉
+ **/
private String username;
- @TableField(fill = FieldFill.INSERT)
+ /**
+ * 绫诲瀷 1:杩囩▼;2:鎴愬搧
+ **/
+ private Integer type;
+
@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")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @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")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date updateTime;
}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/ProcessInspect.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/ProcessInspect.java
new file mode 100644
index 0000000..e30e1ad
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/ProcessInspect.java
@@ -0,0 +1,100 @@
+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;
+
+/**
+ * 杩囩▼妫�楠�(ProcessInspect)琛ㄥ疄浣撶被
+ *
+ * @author zss
+ * @since 2023-09-06 13:36:03
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@TableName("process_inspect")
+public class ProcessInspect implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 涓婚敭
+ **/
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 璁㈠崟鍙�
+ **/
+ private String orderNumber;
+
+ /**
+ * 浜у搧鍚嶇О
+ **/
+ private String material;
+
+ /**
+ * 浜у搧缂栫爜
+ **/
+ private String materialCode;
+
+ /**
+ * 鍗曚綅
+ **/
+ private String unit;
+
+ /**
+ * 鏁伴噺
+ **/
+ private Integer quantity;
+
+ /**
+ * 瑙勬牸鍨嬪彿
+ **/
+ private String specificationsModel;
+
+ /**
+ * 宸ュ簭
+ **/
+ private String techfather;
+
+ /**
+ * 宸ヨ壓
+ **/
+ private String techname;
+
+ /**
+ * 鎶ユ浜�:鐢ㄦ埛id
+ **/
+ private Integer userId;
+
+ /**
+ * 妫�楠岀粨璁�;0:涓嶅悎鏍�;1:鍚堟牸
+ **/
+ private Integer result;
+
+ @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/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java
deleted file mode 100644
index 84fe3bf..0000000
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/StatisticsData.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.yuanchu.mom.pojo;
-
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-@Data
-public class StatisticsData {
- private int material; //鍘熸潗鏂欏悎鏍�
- private int process; //杩囩▼鍚堟牸
- private int finished; //鎴愬搧鍚堟牸
- 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; //鎴愬搧涓嶅悎鏍肩巼*/
-
-
-
-}
\ No newline at end of file
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectionItemDto.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectionItemDto.java
index 71fe288..bbec45c 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectionItemDto.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectionItemDto.java
@@ -7,17 +7,11 @@
public class UpdateInspectionItemDto {
@ApiModelProperty(value = "妫�楠屽�糏d锛氭牴鎹繖涓狪D淇敼", required = true, example = "5079")
- String inspectionItemId;
-
- @ApiModelProperty(value = "鏍囧噯鍊�", required = true, example = ">=1")
- private String required;
-
- @ApiModelProperty(value = "鍐呮帶鍊�", required = true, example = ">2")
- private String internal;
+ Integer inspectionItemId;
@ApiModelProperty(value = "妫�楠屽��", required = true, example = "3")
String inspectionValue;
@ApiModelProperty(value = "璇曢獙璁惧", required = true, example = "1")
- String deviceId;
+ Integer deviceId;
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo.java
new file mode 100644
index 0000000..41fd7aa
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo.java
@@ -0,0 +1,41 @@
+package com.yuanchu.mom.pojo.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+//鏂板鎴愬搧妫�楠屽弬鏁�
+public class FinishedInspectVo {
+ @NotBlank(message = "璁㈠崟鍙蜂笉鑳戒负绌�!")
+ private String orderNumber;
+
+ @NotBlank(message = "瀹㈡埛鍚嶇О涓嶈兘涓虹┖!")
+ private String prname;
+
+ @NotBlank(message = "宸ョ▼鍚嶇О涓嶈兘涓虹┖!")
+ private String sname;
+
+ @NotBlank(message = "璐ㄩ噺杩芥函鍙蜂笉鑳戒负绌�!")
+ private String qualityTraceability;
+
+ @NotBlank(message = "鍗曚綅涓嶈兘涓虹┖!")
+ private String unit;
+
+ @NotNull(message = "鏁伴噺涓嶈兘涓虹┖!")
+ private Integer quantity;
+
+ @NotBlank(message = "瑙勬牸鍨嬪彿涓嶈兘涓虹┖!")
+ private String specificationsModel;
+
+ @NotBlank(message = "浜у搧鍚嶇О涓嶈兘涓虹┖!")
+ private String material;
+
+ @NotBlank(message = "浜у搧缂栫爜涓嶈兘涓虹┖!")
+ private String mcode;
+
+ @NotNull(message = "鐢熶骇璁㈠崟id涓嶈兘涓虹┖!")
+ private Integer id;
+
+}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo1.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/ProcessInspectVo.java
similarity index 86%
rename from inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo1.java
rename to inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/ProcessInspectVo.java
index ffcd306..6845e2e 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo1.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/ProcessInspectVo.java
@@ -7,7 +7,7 @@
@Data
//鏂板杩囩▼妫�楠屽弬鏁�
-public class FinishedInspectVo1 {
+public class ProcessInspectVo {
@NotBlank(message = "璁㈠崟鍙蜂笉鑳戒负绌�!")
private String orderNumber;
@@ -30,12 +30,10 @@
@NotBlank(message = "宸ヨ壓涓嶈兘涓虹┖!")
private String techname;
+ @NotNull(message = "鏁伴噺涓嶈兘涓虹┖!")
+ private Integer quantity;
+
@NotNull(message = "鍏宠仈鐨勫伐鑹鸿矾绾縤d涓嶈兘涓虹┖!")
private Integer technologyId;
- //妫�楠屽��
- private String inspectionValue;
-
- //璁惧id
- private Integer deviceId;
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/FinishedInspectService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/FinishedInspectService.java
index 7a7ae4a..38545ce 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/FinishedInspectService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/FinishedInspectService.java
@@ -2,9 +2,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yuanchu.mom.pojo.FinishedInspect;
import com.baomidou.mybatisplus.extension.service.IService;
-import com.yuanchu.mom.pojo.vo.FinishedInspectVo1;
+import com.yuanchu.mom.pojo.FinishedInspect;
+import com.yuanchu.mom.pojo.vo.FinishedInspectVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -20,15 +20,8 @@
*/
public interface FinishedInspectService extends IService<FinishedInspect> {
- @Transactional(rollbackFor = Exception.class)
- Integer addProcessInspectionSheet(FinishedInspect finishedInspect);
-
- Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result);
-
- IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername);
-
/**
- * 鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
+ * 鏂板妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
*
* @param orderNumber
* @return
@@ -36,19 +29,34 @@
List<Map<String, Object>> chooseMater(String orderNumber);
/**
- * 鏂板杩囩▼妫�楠屽崟
+ * 鏂板鎴愬搧妫�楠屽崟
*
- * @param finishedInspectVo1
+ * @param finishedInspectVo
* @return
*/
- String addProcess(String userId, FinishedInspectVo1 finishedInspectVo1);
+ Integer addProcessInspectionSheet(String userId, FinishedInspectVo finishedInspectVo);
+
/**
- * 鏂板杩囩▼妫�楠屽崟-->閫夋嫨璁惧
- * @param mtid
- * @param father
- * @param name
+ * 涓婃姤(鏇存柊妫�楠岀姸鎬�)
+ * @param id
* @return
*/
- List<Map<String,Object>> chooseDev(Integer technologyId, String father, String name);
+ String updateFinishInspectsById(String username,Integer id);
+
+ /**
+ * 鍒嗛〉鏌ヨ鎴愬搧妫�楠屽崟鍒楄〃
+ * @param page
+ * @param result
+ * @param material
+ * @return
+ */
+ IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material);
+
+ /**
+ * 鏍规嵁妫�楠屽崟id鏌ヨ鎴愬搧妫�楠屽崟璇︽儏
+ * @param id
+ * @return
+ */
+ List<Map<String,Object>> selectFinishInspectsListById(Integer id);
}
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 ecf667f..58c06ff 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
@@ -1,7 +1,7 @@
package com.yuanchu.mom.service;
-import com.yuanchu.mom.pojo.InspectionItem;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.InspectionItem;
import com.yuanchu.mom.pojo.dto.InspectionItemDto;
import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto;
@@ -18,11 +18,28 @@
*/
public interface InspectionItemService extends IService<InspectionItem> {
- void insertList(Integer finishInspectId, List<Map<String, Object>> list);
- List<InspectionItemDto> selectInspectionItem(Integer finishInspectId);
+ /**
+ * 鏂板鎸夐挳-->2銆佹煡璇㈡墍鏈夋楠岄」鐩�
+ * @param finishInspectId
+ * @return
+ */
+ List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type);
+ /**
+ * 鏂板鎸夐挳-->2銆佹楠岄」鐩�-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�
+ * @param username
+ * @param updateInspectionItemDto
+ * @return
+ */
Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto);
- List<Map<String, Object>> selectDeviceIdAndName();
+ /**
+ * 鏂板鎸夐挳-->閫夋嫨璁惧
+ * @param technologyId
+ * @param father
+ * @param name
+ * @return
+ */
+ List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name);
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/ProcessInspectService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/ProcessInspectService.java
new file mode 100644
index 0000000..7f20d43
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/ProcessInspectService.java
@@ -0,0 +1,59 @@
+package com.yuanchu.mom.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yuanchu.mom.pojo.ProcessInspect;
+import com.yuanchu.mom.pojo.vo.ProcessInspectVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 杩囩▼妫�楠�(ProcessInspect)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author zss
+ * @since 2023-09-06 13:36:03
+ */
+public interface ProcessInspectService extends IService<ProcessInspect> {
+
+ /**
+ * 鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�
+ * @param orderNumber
+ * @return
+ */
+ List<Map<String, Object>> chooseMater(String orderNumber);
+
+ /**
+ * 鏂板杩囩▼妫�楠屽崟
+ * @param id
+ * @param processInspectVo
+ * @return
+ */
+ Integer addProcess(String id, ProcessInspectVo processInspectVo);
+
+ /**
+ * 涓婃姤(鏇存柊妫�楠岀姸鎬�)
+ * @param id
+ * @return
+ */
+ String updateProcessInspectsById(Integer id);
+
+ /**
+ * 鏍规嵁妫�楠屽崟id鏌ヨ杩囩▼妫�楠屽崟璇︽儏
+ * @param id
+ * @return
+ */
+ List<Map<String,Object>> selectProcessInspectsListById(Integer id);
+
+ /**
+ * 鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃
+ * @param page
+ * @param techfather
+ * @param result
+ * @param name
+ * @return
+ */
+ IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name);
+}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/RawInspectService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/RawInspectService.java
index ba303c1..93976f0 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/RawInspectService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/RawInspectService.java
@@ -47,15 +47,4 @@
*/
String updateRawInspectsById(Integer id);
- /**
- * 鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎
- * @param id
- */
- void delRawInsById(Integer id);
-
- /**
- * 鎵归噺鍒犻櫎
- * @param ids
- */
- void delAllRawIns(String ids);
}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/ResportService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/ResportService.java
deleted file mode 100644
index 9e9ef87..0000000
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/ResportService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.yuanchu.mom.service;
-
-import com.yuanchu.mom.pojo.StatisticsData;
-import com.yuanchu.mom.pojo.ProReport;
-
-public interface ResportService {
-
- /**
- * 璁$畻鍚堟牸涓庝笉鍚堟牸鏁伴噺
- * @param begin
- * @param end
- * @return
- */
- StatisticsData turno(String begin, String end);
-
- /**
- * 璁$畻浜у搧鎬婚噺
- * @return
- */
- ProReport allNum();
-
- /**
- * 璁$畻杈炬爣鎬婚噺
- * @return
- */
- ProReport statisNum();
-
-}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/FinishedInspectServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/FinishedInspectServiceImpl.java
index b7466c0..9704d8b 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/FinishedInspectServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/FinishedInspectServiceImpl.java
@@ -3,12 +3,11 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.mapper.*;
import com.yuanchu.mom.pojo.*;
-import com.yuanchu.mom.pojo.vo.FinishedInspectVo1;
+import com.yuanchu.mom.pojo.vo.FinishedInspectVo;
import com.yuanchu.mom.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
@@ -17,7 +16,6 @@
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.Objects;
@@ -35,7 +33,7 @@
public class FinishedInspectServiceImpl extends ServiceImpl<FinishedInspectMapper, FinishedInspect> implements FinishedInspectService {
@Resource
- private FinishedInspectMapper finishedInspectMapper;
+ FinishedInspectMapper finishedInspectMapper;
@Resource
MaterialMapper materialMapper;
@@ -47,13 +45,16 @@
SpecificationsService specificationsService;
@Resource
- InspectionItemService inspectionItemService;
-
- @Autowired
- private ProductService productService;
+ ManualTechnologyMapper manualTechnologyMapper;
@Resource
- UserMapper userMapper;
+ ProductService productService;
+
+ @Resource
+ InspectionItemService inspectionItemService;
+
+ @Resource
+ InspectionItemMapper inspectionItemMapper;
@Resource
InspectUnacceptedMapper inspectUnacceptedMapper;
@@ -61,228 +62,125 @@
@Resource
RepertoryMapper repertoryMapper;
- @Resource
- ImportRepertoryMapper importRepertoryMapper;
-
- @Resource
- TechnologyMapper technologyMapper;
-
- @Resource
- TechniqueMapper techniqueMapper;
-
- @Override
- public Integer addProcessInspectionSheet(FinishedInspect finishedInspect) {
- finishedInspect.setType(0);
- int insert = finishedInspectMapper.insert(finishedInspect);
- if (insert == 1) {
- /*List<Map<String, Object>> maps = productService.selectProductList(finishedInspect.getSpecificationsId());
- inspectionItemService.insertList(finishedInspect.getId(), maps);*/
- return insert;
- }
- return 0;
- }
-
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result) {
- //鏇存柊妫�楠屽崟閲岄潰鐨勬楠岀粨璁�
- LambdaUpdateWrapper<FinishedInspect> updateWrapper = new LambdaUpdateWrapper<>();
- updateWrapper.eq(FinishedInspect::getId, finishedInspectId);
- updateWrapper.set(FinishedInspect::getResult, result);
- finishedInspectMapper.update(new FinishedInspect(), updateWrapper);
- FinishedInspect finishedInspect = finishedInspectMapper.selectById(finishedInspectId);
- /*妫�楠岀粨璁轰负涓嶅悎鏍�*/
- if (result == 0) {
- //濡傛灉鏄垚鍝佺殑缁撹涓轰笉鍚堟牸,闇�瑕佹柊澧炴垚鍝佷笉鍚堟牸妫�楠屽崟
- if (finishedInspect.getType() == 0) {
- /*鏂板鎴愬搧涓嶅悎鏍兼楠屽崟*/
- InspectUnaccepted inspectUnaccepted = InspectUnaccepted.builder()
- .reason(finishedInspect.getProjectName() + "涓嶅悎鏍�") //鏆備笖瀹氫箟涓哄伐绋嬪悕绉颁笉鍚堟牸
- .rawInspectId(finishedInspectId)
- .build();
- inspectUnacceptedMapper.insert(inspectUnaccepted);
- }
- //濡傛灉鏄繃绋嬫楠岀殑缁撹涓轰笉鍚堟牸,闇�瑕佹柊澧炲崐鎴愬搧搴撳瓨涓旀楠岀粨鏋滀负涓嶅悎鏍�
- if (finishedInspect.getType() == 1) {
- /*鏂板鍗婃垚鍝�(1)搴撳瓨*/
- //濡傛灉鍏ュ簱鐨勪俊鎭竴鏍峰彧鏈夊簱瀛樹笉涓�鏍�,鍒欏湪鍘熸潵鐨勫簱瀛樻暟閲忎笂鍔犱笂鐩稿簲鐨勬暟閲�
- LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber())
- .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability())
- .eq(Repertory::getName, finishedInspect.getMaterial())
- .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel())
- .eq(Repertory::getUnit, finishedInspect.getUnit())
- .eq(Repertory::getType, 1)
- .eq(Repertory::getCheckResult, 0);
- Repertory rep = repertoryMapper.selectOne(queryWrapper);
- if (rep != null) {
- rep.setNumber(rep.getNumber() + finishedInspect.getQuantity());
- rep.setUserName(username);
- repertoryMapper.updateById(rep);
- } else {
- //濡傛灉闄や簡搴撳瓨鍒殑淇℃伅鏈変换浣曚竴涓笉涓�鏍�,鍒欐柊澧炰竴鏉″崐鎴愬搧搴撳瓨
- Repertory repertory = Repertory.builder()
- .orderCode(finishedInspect.getOrderNumber())
- .qualityTraceability(finishedInspect.getQualityTraceability())
- .name(finishedInspect.getMaterial())
- .specifications(finishedInspect.getSpecificationsModel())
- .unit(finishedInspect.getUnit())
- .number(finishedInspect.getQuantity())
- .userName(username)
- .type(1)
- .checkResult(0)//妫�楠岀粨鏋滀负涓嶅悎鏍�
- .build();
- repertoryMapper.insert(repertory);
- }
- }
- }
- /*妫�楠岀粨璁轰负鍚堟牸*/
- if (result == 1) {
- //濡傛灉鏄垚鍝佹楠屽悎鏍�,,闇�瑕佹柊澧炴垚鍝�(0)搴撳瓨鍜屽叆搴撹褰�
- if (finishedInspect.getType() == 0) {
- /*鏂板鎴愬搧鍏ュ簱璁板綍*/
- ImportRepertory importRepertory = ImportRepertory.builder()
- .orderCode(finishedInspect.getOrderNumber())
- .qualityTraceability(finishedInspect.getQualityTraceability())
- .name(finishedInspect.getMaterial())
- .specifications(finishedInspect.getSpecificationsModel())
- .unit(finishedInspect.getUnit())
- .number(finishedInspect.getQuantity())
- .userName(username)
- .build();
- importRepertoryMapper.insert(importRepertory);
- /*鏂板鎴愬搧(0)搴撳瓨*/
- //濡傛灉鍏ュ簱鐨勪俊鎭竴鏍峰彧鏈夊簱瀛樹笉涓�鏍�,鍒欏湪鍘熸潵鐨勫簱瀛樻暟閲忎笂鍔犱笂鐩稿簲鐨勬暟閲�
- LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber())
- .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability())
- .eq(Repertory::getName, finishedInspect.getMaterial())
- .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel())
- .eq(Repertory::getUnit, finishedInspect.getUnit())
- .eq(Repertory::getType, 0)
- .eq(Repertory::getCheckResult, 1);
- Repertory rep = repertoryMapper.selectOne(queryWrapper);
- if (rep != null) {
- rep.setNumber(rep.getNumber() + finishedInspect.getQuantity());
- rep.setUserName(username);
- repertoryMapper.updateById(rep);
- } else {
- //濡傛灉闄や簡搴撳瓨鍒殑淇℃伅鏈変换浣曚竴涓笉涓�鏍�,鍒欐柊澧炰竴鏉℃垚鍝佸簱瀛�
- Repertory repertory = Repertory.builder()
- .orderCode(finishedInspect.getOrderNumber())
- .qualityTraceability(finishedInspect.getQualityTraceability())
- .name(finishedInspect.getMaterial())
- .specifications(finishedInspect.getSpecificationsModel())
- .unit(finishedInspect.getUnit())
- .number(finishedInspect.getQuantity())
- .userName(username)
- .type(0)
- .checkResult(1) //搴撳瓨妫�楠岀粨鏋滀负鍚堟牸
- .build();
- repertoryMapper.insert(repertory);
- }
- }
- //濡傛灉鏄繃绋嬫楠屽悎鏍�,闇�瑕佹柊澧炲崐鎴愬搧(1)搴撳瓨,妫�楠岀粨鏋滀负鍚堟牸1
- if (finishedInspect.getType() == 1) {
- /*鏂板鍗婃垚鍝�(1)搴撳瓨*/
- //濡傛灉鍏ュ簱鐨勪俊鎭竴鏍峰彧鏈夊簱瀛樹笉涓�鏍�,鍒欏湪鍘熸潵鐨勫簱瀛樻暟閲忎笂鍔犱笂鐩稿簲鐨勬暟閲�
- LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber())
- .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability())
- .eq(Repertory::getName, finishedInspect.getMaterial())
- .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel())
- .eq(Repertory::getUnit, finishedInspect.getUnit())
- .eq(Repertory::getType, 1)
- .eq(Repertory::getCheckResult, 1);
- Repertory rep = repertoryMapper.selectOne(queryWrapper);
- if (rep != null) {
- rep.setNumber(rep.getNumber() + finishedInspect.getQuantity());
- rep.setUserName(username);
- repertoryMapper.updateById(rep);
- } else {
- //濡傛灉闄や簡搴撳瓨鍒殑淇℃伅鏈変换浣曚竴涓笉涓�鏍�,鍒欐柊澧炰竴鏉″崐鎴愬搧搴撳瓨
- Repertory repertory = Repertory.builder()
- .orderCode(finishedInspect.getOrderNumber())
- .qualityTraceability(finishedInspect.getQualityTraceability())
- .name(finishedInspect.getMaterial())
- .specifications(finishedInspect.getSpecificationsModel())
- .unit(finishedInspect.getUnit())
- .number(finishedInspect.getQuantity())
- .userName(username)
- .type(1)
- .checkResult(1)//妫�楠岀粨鏋滀负鍚堟牸
- .build();
- repertoryMapper.insert(repertory);
- }
- }
-
- }
- return 1;
- }
-
- @Override
- public IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername) {
- return finishedInspectMapper.selectFinishedInspectPage(page, inspectResult, inspectDate, inspectUsername);
- }
-
- //鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
+ //鏂板妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅
@Override
public List<Map<String, Object>> chooseMater(String orderNumber) {
return finishedInspectMapper.chooseMater(orderNumber);
}
- //鏂板杩囩▼妫�楠屽崟
+ //鏂板鎴愬搧妫�楠屽崟
@Override
@Transactional(rollbackFor = Exception.class)
- public String addProcess(String userId, FinishedInspectVo1 finishedInspectVo1) {
- /*鏂板杩囩▼妫�楠屽崟*/
+ public Integer addProcessInspectionSheet(String userId, FinishedInspectVo finishedInspectVo) {
+ /*鏂板鎴愬搧妫�楠屽崟*/
FinishedInspect finishedInspect = new FinishedInspect();
- finishedInspect.setType(1);
finishedInspect.setUserId(Integer.parseInt(userId));
- BeanUtils.copyProperties(finishedInspectVo1, finishedInspect);
+ finishedInspect.setOrderNumber(finishedInspectVo.getOrderNumber());
+ finishedInspect.setCustomerName(finishedInspectVo.getPrname());
+ finishedInspect.setProjectName(finishedInspectVo.getSname());
+ finishedInspect.setQualityTraceability(finishedInspectVo.getQualityTraceability());
+ finishedInspect.setUnit(finishedInspectVo.getUnit());
+ finishedInspect.setQuantity(finishedInspectVo.getQuantity());
+ finishedInspect.setSpecificationsModel(finishedInspectVo.getSpecificationsModel());
+ finishedInspect.setMaterial(finishedInspectVo.getMaterial());
+ finishedInspect.setMaterialCode(finishedInspectVo.getMcode());
finishedInspectMapper.insert(finishedInspect);
- /*鎵归噺鏂板杩囩▼妫�楠岄」鐩〃*/
+ /*鎵归噺鏂板鎴愬搧妫�楠岄」鐩崟*/
//鑾峰彇鍨嬪彿id
- Integer specificationId = getSpecificationId(finishedInspectVo1.getMaterial(), finishedInspectVo1.getMaterialCode(), finishedInspectVo1.getSpecificationsModel());
+ Integer specificationId = getSpecificationId(finishedInspectVo.getMaterial(), finishedInspectVo.getMcode(), finishedInspectVo.getSpecificationsModel());
+ //鏍规嵁鐢熶骇璁㈠崟id鏌ヨ缂栧埗宸ュ簭鐨勬渶鍚庝竴閬撳伐鑹�
+ List<ManualTechnology> manualTechnologyList = manualTechnologyMapper.selAllByMoId(finishedInspectVo.getId());
+ //鑾峰彇鏈�鍚庝竴閬撳伐鑹哄叧鑱旂殑宸ヨ壓璺嚎id
+ Integer technologyId = manualTechnologyList.get(0).getTechnologyId();
//鏌ヨ鏍囧噯BOM鎶�鏈寚鏍囦腑璇ュ瀷鍙峰伐鑹轰笅鏈�鏂扮増鏈殑妫�楠岄」鐩�
Integer ver = productService.selectVerByPro(specificationId).get(0);//璇ュ瀷鍙蜂笅鎶�鏈寚鏍囨渶鏂扮増鏈�
- List<Product> productList = productService.selProByVerSpe(finishedInspectVo1.getTechnologyId(), ver);
+ List<Product> productList = productService.selProByVerSpe(technologyId, ver);
List<InspectionItem> inspectionItemList = productList.stream().map(product -> {
InspectionItem inspectionItem = new InspectionItem();
BeanUtils.copyProperties(product, inspectionItem);
- inspectionItem.setFinishInspectId(finishedInspect.getId());
- //濡傛灉鏂板鏃惰繕濉啓浜嗘楠屽�煎垯瑕佽繘琛屽垽鏂楠岀粨鏋�
- if (ObjectUtils.isNotEmpty(finishedInspectVo1.getInspectionValue())) {
- inspectionItem.setInspectionValue(finishedInspectVo1.getInspectionValue());
- //鍒ゆ柇妫�娴嬪�兼槸鍚︽弧瓒虫爣鍑嗗�煎拰鍐呮帶鍊肩殑瑕佹眰,濡傛灉涓嶆弧瓒冲垯妫�楠岀粨璁轰负涓嶅悎鏍�0
- String required = product.getRequired();//鏍囧噯鍊�
- String internal = product.getInternal();//鍐呮帶鍊�
- String testValue = finishedInspectVo1.getInspectionValue();//妫�娴嬪��
- List<Integer> list = Arrays.stream(testValue.split(",")).map(s -> {
- int values = checkValues(required, internal, s);
- return values;
- }).collect(Collectors.toList());
- if (list.contains(0)) {
- //濡傛灉鍏朵腑涓�涓楠屽�间笉鍚堟牸鍒欒椤圭洰妫�楠屼笉鍚堟牸
- inspectionItem.setResult(0);
- } else {
- inspectionItem.setResult(1);
- }
- inspectionItem.setUsername(userMapper.selectById(userId).getName());
- }
+ inspectionItem.setInspectId(finishedInspect.getId());
+ inspectionItem.setType(2);//鎴愬搧
return inspectionItem;
}).collect(Collectors.toList());
inspectionItemService.saveBatch(inspectionItemList);
- return "鏂板杩囩▼妫�楠屽崟"+finishedInspect.getId()+"鎴愬姛!";
+ return finishedInspect.getId();
}
- //鏂板杩囩▼妫�楠屽崟-->閫夋嫨璁惧
+ //涓婃姤(鏇存柊妫�楠岀姸鎬�)
@Override
- public List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name) {
- //璇ュ伐鑹篿d涓嬬敓浜у伐鑹烘渶鏂扮増鏈�
- Integer ver = techniqueMapper.selectVerByTeId(technologyId).get(0);
- return techniqueMapper.selDevByVerTecIdFaNam(technologyId,father,name,ver);
+ @Transactional(rollbackFor = Exception.class)
+ public String updateFinishInspectsById(String username,Integer id) {
+ /*鏇存柊妫�楠屽崟閲岄潰鐨勬楠岀粨璁�*/
+ //鍏堝垽鏂楠岀粨鏋�
+ List<Integer> results = inspectionItemMapper.getResult(id,1);
+ int count = 0;
+ for (Integer result : results) {
+ if (result != null && result == 1) {
+ count++;
+ }
+ }
+ FinishedInspect finishedInspect = finishedInspectMapper.selectById(id);
+ //濡傛灉妫�楠岄」鐩腑鐨勭粨璁哄寘鍚笉鍚堟牸鍒欐楠屽崟涓嶅悎鏍�
+ if (results.contains(0)) {
+ finishedInspect.setResult(0);//涓嶅悎鏍�
+ //鏇存柊妫�楠屽崟
+ finishedInspectMapper.updateById(finishedInspect);
+ } else if (count == results.size()) {
+ finishedInspect.setResult(1);//鍚堟牸
+ finishedInspectMapper.updateById(finishedInspect);
+ } else return "椤圭洰鏈楠屽畬!";
+ /*濡傛灉妫�楠岀粨璁轰负涓嶅悎鏍�,鍒欓渶瑕佹柊澧炰笉鍚堟牸妫�楠屽崟*/
+ if (finishedInspect.getResult() == 0) {
+ InspectUnaccepted finishUnaccepted = InspectUnaccepted.builder()
+ .reason(finishedInspect.getMaterial() + "涓嶅悎鏍�") //鏆備笖瀹氫箟涓轰骇鍝佸悕绉颁笉鍚堟牸
+ .rawInspectId(id)
+ .type(1) //绫诲瀷涓烘垚鍝佹楠�
+ .build();
+ inspectUnacceptedMapper.insert(finishUnaccepted);
+ }
+ /*濡傛灉妫�楠岀粨璁轰负鍚堟牸,鍒欓渶瑕佹柊澧炲崐鎴愬搧搴撳瓨*/
+ if (finishedInspect.getResult() == 1) {
+ //濡傛灉鍏ュ簱鐨勪俊鎭竴鏍峰彧鏈夊簱瀛樹笉涓�鏍�,鍒欏湪鍘熸潵鐨勫簱瀛樻暟閲忎笂鍔犱笂鐩稿簲鐨勬暟閲�
+ LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber())
+ .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability())
+ .eq(Repertory::getName, finishedInspect.getMaterial())
+ .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel())
+ .eq(Repertory::getUnit, finishedInspect.getUnit())
+ .eq(Repertory::getType, 1);
+ Repertory rep = repertoryMapper.selectOne(queryWrapper);
+ if (rep != null ) {
+ rep.setNumber(rep.getNumber() + finishedInspect.getQuantity());
+ rep.setUserName(username);
+ repertoryMapper.updateById(rep);
+ } else {
+ //濡傛灉闄や簡搴撳瓨鍒殑淇℃伅鏈変换浣曚竴涓笉涓�鏍�,鍒欐柊澧炰竴鏉℃垚鍝佸簱瀛�
+ Repertory repertory = new Repertory();
+ repertory.setOrderCode(finishedInspect.getOrderNumber());
+ repertory.setQualityTraceability(finishedInspect.getQualityTraceability());
+ repertory.setName(finishedInspect.getMaterial());
+ repertory.setSpecifications(finishedInspect.getSpecificationsModel());
+ repertory.setUnit(finishedInspect.getUnit());
+ repertory.setNumber(finishedInspect.getQuantity());
+ repertory.setUserName(username);
+ repertory.setType(1);//鍗婃垚鍝�
+ repertory.setCheckResult(1);//鏆傚畾涓嶅垹
+ repertoryMapper.insert(repertory);
+ }
+ }
+ return "涓婃姤鎴愬姛!";
+ }
+
+ //鍒嗛〉鏌ヨ鎴愬搧妫�楠屽崟鍒楄〃
+ @Override
+ public IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material) {
+ return finishedInspectMapper.selectFinishedInspectPage(page, result,material);
+ }
+
+ //鏍规嵁妫�楠屽崟id鏌ヨ鎴愬搧妫�楠屽崟璇︽儏
+ @Override
+ public List<Map<String, Object>> selectFinishInspectsListById(Integer id) {
+ return finishedInspectMapper.selectFinishInspectsListById(id);
}
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 e0a13f1..82273bf 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
@@ -1,26 +1,21 @@
package com.yuanchu.mom.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.yuanchu.mom.pojo.Device;
-import com.yuanchu.mom.pojo.InspectionItem;
import com.yuanchu.mom.mapper.InspectionItemMapper;
+import com.yuanchu.mom.mapper.TechniqueMapper;
+import com.yuanchu.mom.pojo.InspectionItem;
import com.yuanchu.mom.pojo.dto.InspectionItemDto;
import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto;
import com.yuanchu.mom.service.DeviceService;
import com.yuanchu.mom.service.InspectionItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yuanchu.mom.service.SpecificationsService;
-import com.yuanchu.mom.utils.JackSonUtil;
-import com.yuanchu.mom.utils.MyUtil;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* <p>
@@ -36,51 +31,48 @@
@Resource
private InspectionItemMapper inspectionItemMapper;
- @Autowired
- private DeviceService deviceService;
+ @Resource
+ TechniqueMapper techniqueMapper;
+
+
+ //鏂板鎸夐挳-->2銆佹煡璇㈡墍鏈夋楠岄」鐩�
@Override
- public void insertList(Integer finishInspectId, List<Map<String, Object>> list) {
- List<InspectionItem> list1 = new ArrayList<>();
- for (Map<String, Object> map : list){
- try {
- InspectionItem inspectionItem = JackSonUtil.unmarshal(JackSonUtil.marshal(map), InspectionItem.class);
- inspectionItem.setFinishInspectId(finishInspectId);
- list1.add(inspectionItem);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- inspectionItemMapper.insertBatchSomeColumn(list1);
+ public List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type) {
+ return inspectionItemMapper.selectInspectionItem(finishInspectId,type);
}
+
+ //鏂板杩囩▼妫�楠屽崟-->閫夋嫨璁惧
@Override
- public List<InspectionItemDto> selectInspectionItem(Integer finishInspectId) {
- return inspectionItemMapper.selectInspectionItem(finishInspectId);
+ public List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name) {
+ //璇ュ伐鑹篿d涓嬬敓浜у伐鑹烘渶鏂扮増鏈�
+ Integer ver = techniqueMapper.selectVerByTeId(technologyId).get(0);
+ return techniqueMapper.selDevByVerTecIdFaNam(technologyId, father, name, ver);
}
+ //鏂板鎸夐挳-->2銆佹楠岄」鐩�-->澶卞幓鐒︾偣鍙戣捣璇ヨ姹�
@Override
public Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto) {
- LambdaUpdateWrapper<InspectionItem> wrapper = new LambdaUpdateWrapper<>();
- wrapper.eq(InspectionItem::getId, updateInspectionItemDto.getInspectionItemId());
- wrapper.set(InspectionItem::getInspectionValue, updateInspectionItemDto.getInspectionValue());
- wrapper.set(InspectionItem::getDeviceId, updateInspectionItemDto.getDeviceId());
- int i = checkValues(updateInspectionItemDto.getRequired(), updateInspectionItemDto.getInternal(), updateInspectionItemDto.getInspectionValue());
- wrapper.set(InspectionItem::getResult, i);
- wrapper.set(InspectionItem::getUsername, username);
- int update = inspectionItemMapper.update(new InspectionItem(), wrapper);
- if (update > 0){
- return i;
+ //鏌ヨ鍐呮帶鍊煎拰鏍囧噯鍊�
+ InspectionItem inspectionItem = inspectionItemMapper.selectById(updateInspectionItemDto.getInspectionItemId());
+ inspectionItem.setInspectionValue(updateInspectionItemDto.getInspectionValue());
+ inspectionItem.setDeviceId(updateInspectionItemDto.getDeviceId());
+ List<Integer> list = Arrays.stream( updateInspectionItemDto.getInspectionValue().split(",")).map(s -> {
+ int values = checkValues(inspectionItem.getRequired(), inspectionItem.getInternal(), s);
+ return values;
+ }).collect(Collectors.toList());
+ if (list.contains(0)) {
+ //濡傛灉鍏朵腑涓�涓楠屽�间笉鍚堟牸鍒欒椤圭洰妫�楠屼笉鍚堟牸
+ inspectionItem.setResult(0);
+ } else {
+ inspectionItem.setResult(1);
}
- return 2;
+ inspectionItemMapper.updateById(inspectionItem);
+ //杩斿洖妫�楠岄」鐩殑缁撹
+ return inspectionItem.getResult();
}
- @Override
- public List<Map<String, Object>> selectDeviceIdAndName() {
- LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
- wrapper.select(Device::getId, Device::getName);
- return deviceService.listMaps(wrapper);
- }
/*鍒ゆ柇妫�娴嬪�兼槸鍚︽弧瓒虫爣鍑嗗�煎拰鍐呮帶鍊肩殑瑕佹眰,濡傛灉涓嶆弧瓒冲垯妫�楠岀粨璁轰负涓嶅悎鏍�*/
private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) {
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ProcessInspectServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ProcessInspectServiceImpl.java
new file mode 100644
index 0000000..ca30a73
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ProcessInspectServiceImpl.java
@@ -0,0 +1,205 @@
+package com.yuanchu.mom.service.impl;
+
+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.pojo.vo.ProcessInspectVo;
+import com.yuanchu.mom.service.*;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 杩囩▼妫�楠�(ProcessInspect)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author zss
+ * @since 2023-09-06 13:36:03
+ */
+@Service
+public class ProcessInspectServiceImpl extends ServiceImpl<ProcessInspectMapper, ProcessInspect> implements ProcessInspectService {
+
+ @Resource
+ ProcessInspectMapper processInspectMapper;
+
+ @Resource
+ MaterialMapper materialMapper;
+
+ @Resource
+ StandardService standardService;
+
+ @Resource
+ SpecificationsService specificationsService;
+
+ @Resource
+ ProductService productService;
+
+ @Resource
+ InspectionItemMapper inspectionItemMapper;
+
+ @Resource
+ InspectionItemService inspectionItemService;
+
+ @Resource
+ InspectUnacceptedMapper inspectUnacceptedMapper;
+
+ //鏂板杩囩▼妫�楠屽崟-->鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�
+ @Override
+ public List<Map<String, Object>> chooseMater(String orderNumber) {
+ return processInspectMapper.chooseMater(orderNumber);
+ }
+
+ //鏂板杩囩▼妫�楠屽崟
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Integer addProcess(String userId, ProcessInspectVo processInspectVo) {
+ /*鏂板杩囩▼妫�楠屽崟*/
+ ProcessInspect processInspect = new ProcessInspect();
+ processInspect.setUserId(Integer.parseInt(userId));
+ BeanUtils.copyProperties(processInspectVo, processInspect);
+ processInspectMapper.insert(processInspect);
+ /*鎵归噺鏂板杩囩▼妫�楠岄」鐩〃*/
+ //鑾峰彇鍨嬪彿id
+ Integer specificationId = getSpecificationId(processInspectVo.getMaterial(), processInspectVo.getMaterialCode(), processInspectVo.getSpecificationsModel());
+ //鏌ヨ鏍囧噯BOM鎶�鏈寚鏍囦腑璇ュ瀷鍙峰伐鑹轰笅鏈�鏂扮増鏈殑妫�楠岄」鐩�
+ Integer ver = productService.selectVerByPro(specificationId).get(0);//璇ュ瀷鍙蜂笅鎶�鏈寚鏍囨渶鏂扮増鏈�
+ List<Product> productList = productService.selProByVerSpe(processInspectVo.getTechnologyId(), ver);
+ List<InspectionItem> inspectionItemList = productList.stream().map(product -> {
+ InspectionItem inspectionItem = new InspectionItem();
+ BeanUtils.copyProperties(product, inspectionItem);
+ inspectionItem.setInspectId(processInspect.getId());
+ inspectionItem.setType(1);
+ return inspectionItem;
+ }).collect(Collectors.toList());
+ inspectionItemService.saveBatch(inspectionItemList);
+ return processInspect.getId();
+ }
+
+ //涓婃姤(鏇存柊妫�楠岀姸鎬�)
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public String updateProcessInspectsById(Integer id) {
+ /*鏇存柊妫�楠屽崟閲岄潰鐨勬楠岀粨璁�*/
+ //鍏堝垽鏂楠岀粨鏋�
+ List<Integer> results = inspectionItemMapper.getResult(id,1);
+ int count = 0;
+ for (Integer result : results) {
+ if (result != null && result == 1) {
+ count++;
+ }
+ }
+ ProcessInspect processInspect = processInspectMapper.selectById(id);
+ //濡傛灉妫�楠岄」鐩腑鐨勭粨璁哄寘鍚笉鍚堟牸鍒欐楠屽崟涓嶅悎鏍�
+ if (results.contains(0)) {
+ processInspect.setResult(0);//涓嶅悎鏍�
+ //鏇存柊妫�楠屽崟
+ processInspectMapper.updateById(processInspect);
+ } else if (count == results.size()) {
+ processInspect.setResult(1);//鍚堟牸
+ processInspectMapper.updateById(processInspect);
+ } else return "椤圭洰鏈楠屽畬!";
+ /*濡傛灉妫�楠岀粨璁轰负涓嶅悎鏍�,鍒欓渶瑕佹柊澧炰笉鍚堟牸妫�楠屽崟*/
+ if (processInspect.getResult() == 0) {
+ InspectUnaccepted processUnaccepted = InspectUnaccepted.builder()
+ .reason(processInspect.getMaterial() +processInspect.getTechname()+ "涓嶅悎鏍�") //鏆備笖瀹氫箟涓轰骇鍝佸悕绉�+宸ヨ壓涓嶅悎鏍�
+ .rawInspectId(id)
+ .type(2) //绫诲瀷涓鸿繃绋嬫楠�
+ .build();
+ inspectUnacceptedMapper.insert(processUnaccepted);
+ }
+ return "涓婃姤鎴愬姛!";
+ }
+
+ //鏍规嵁妫�楠屽崟id鏌ヨ杩囩▼妫�楠屽崟璇︽儏
+ @Override
+ public List<Map<String, Object>> selectProcessInspectsListById(Integer id) {
+ return processInspectMapper.selectProcessInspectsListById(id);
+ }
+
+ //鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃
+ @Override
+ public IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name) {
+ return processInspectMapper.selectProcessInspectsList(page,techfather,result,name);
+ }
+
+
+ /*鏍规嵁鏍峰搧鍚嶇О,鏍峰搧缂栧彿,鍨嬪彿瑙勬牸鑾峰彇鍨嬪彿id*/
+ private Integer getSpecificationId(String name, String mcode, String specification) {
+ //鑾峰彇鐗╂枡id
+ Material material = materialMapper.selectOne(Wrappers.<Material>query()
+ .eq("name", name)
+ .eq("code", mcode));
+ if (Objects.isNull(material)) {
+ return null;
+ }
+ //鑾峰彇瑙勬牸鍚嶇О鍜屽瀷鍙峰悕绉�
+ String[] split = specification.split("-");
+ String stName = split[0];
+ String spName = split[1];
+ //鑾峰彇瑙勬牸id
+ Standard standard = standardService.getOne(Wrappers.<Standard>query()
+ .eq("name", stName)
+ .eq("material_id", material.getId()));
+ //鑾峰彇鍨嬪彿id
+ Specifications specifications = specificationsService.getOne(Wrappers.<Specifications>query()
+ .eq("name", spName)
+ .eq("standard_id", standard.getId()));
+ return specifications.getId();
+ }
+
+ /*鍒ゆ柇妫�娴嬪�兼槸鍚︽弧瓒虫爣鍑嗗�煎拰鍐呮帶鍊肩殑瑕佹眰,濡傛灉涓嶆弧瓒冲垯妫�楠岀粨璁轰负涓嶅悎鏍�*/
+ private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) {
+ boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr);
+ boolean isControlValueSatisfied = isValueSatisfied(controlValueStr, detectionValueStr);
+
+ if (isStandardValueSatisfied && isControlValueSatisfied) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ private boolean isValueSatisfied(String valueStr, String detectionValueStr) {
+ String substring = valueStr.substring(1, 2);
+ if (substring.equals("=")) {
+ String operator = valueStr.substring(0, 2);
+ Double standardValue = Double.parseDouble(valueStr.substring(2));
+ Double detectionValue = Double.parseDouble(detectionValueStr);
+ switch (operator) {
+ case ">=":
+ return detectionValue >= standardValue;
+ case "<=":
+ return detectionValue <= standardValue;
+ default:
+ return false;
+ }
+ } else {
+ String operator = valueStr.substring(0, 1);
+ Double standardValue = Double.parseDouble(valueStr.substring(1));
+ Double detectionValue = Double.parseDouble(detectionValueStr);
+ switch (operator) {
+ case ">":
+ return detectionValue > standardValue;
+ case "鈮�":
+ return detectionValue >= standardValue;
+ case "鈮�":
+ return detectionValue <= standardValue;
+ case "<":
+ return detectionValue < standardValue;
+ case "=":
+ return detectionValue.equals(standardValue);
+ default:
+ return false;
+ }
+ }
+ }
+}
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInspectServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInspectServiceImpl.java
index 72b3615..b5ad1d0 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInspectServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/RawInspectServiceImpl.java
@@ -147,34 +147,6 @@
return "涓婃姤鎴愬姛!";
}
- //鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void delRawInsById(Integer id) {
- /*鍒犻櫎鍘熸潗鏂欐楠屽崟*/
- RawInspect rawInspect = new RawInspect();
- rawInspect.setId(id);
- rawInspect.setState(0);
- rawInspectMapper.updateById(rawInspect);
- /*鍒犻櫎鍘熸潗鏂欐楠岄」鐩〃*/
- rawInsProductMapper.updaRawInsById(id);
- /*鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍗�*/
- inspectUnacceptedMapper.updaRawIns(id);
- }
-
- //鎵归噺鍒犻櫎
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void delAllRawIns(String ids) {
- /*鎵归噺鍒犻櫎鍘熸潗鏂欐楠屽崟*/
- rawInspectMapper.delAllRawIns(ids);
- /*鎵归噺鍒犻櫎鍘熸潗鏂欐楠岄」鐩〃*/
- rawInsProductMapper.delAllRawIns(ids);
- /*鎵归噺鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍗�*/
- inspectUnacceptedMapper.delAllRawIns(ids);
-
- }
-
/*鍒ゆ柇妫�娴嬪�兼槸鍚︽弧瓒虫爣鍑嗗�煎拰鍐呮帶鍊肩殑瑕佹眰,濡傛灉涓嶆弧瓒冲垯妫�楠岀粨璁轰负涓嶅悎鏍�*/
private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) {
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
deleted file mode 100644
index 8abc759..0000000
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ResportServiceImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.yuanchu.mom.service.impl;
-
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.yuanchu.mom.mapper.FinishedInspectMapper;
-import com.yuanchu.mom.mapper.RawInspectMapper;
-import com.yuanchu.mom.pojo.ProReport;
-import com.yuanchu.mom.pojo.RawInspect;
-import com.yuanchu.mom.pojo.StatisticsData;
-import com.yuanchu.mom.service.ResportService;
-import lombok.Data;
-import org.apache.tomcat.util.buf.StringUtils;
-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;
-import java.util.Date;
-
-
-@Service
-public class ResportServiceImpl implements ResportService {
-
- @Resource
- RawInspectMapper rawInspectMapper;
-
- @Resource
- FinishedInspectMapper finishedInspectMapper;
-
- //璁$畻鍚堟牸涓庝笉鍚堟牸鏁伴噺
- @Override
- public StatisticsData turno(String begin, String end) {
- StatisticsData statisticsData = new StatisticsData();
- //鍘熸潗鏂欏悎鏍�
- Integer material = rawInspectMapper.selCountRaw(begin, end, 1);
- statisticsData.setMaterial(material);
- //鍘熸潗鏂欎笉鍚堟牸
- Integer unmaterial = rawInspectMapper.selCountRaw(begin, end, 0);
- statisticsData.setUnmaterial(unmaterial);
- //杩囩▼鍚堟牸鏁�
- Integer process = finishedInspectMapper.selCountFin(begin, end, 1, 1);
- statisticsData.setProcess(process);
- //杩囩▼涓嶅悎鏍�
- Integer unprocess = finishedInspectMapper.selCountFin(begin, end, 1, 0);
- statisticsData.setUnprocess(unprocess);
- //鎴愬搧鍚堟牸鏁�
- Integer finished = finishedInspectMapper.selCountFin(begin, end, 0, 1);
- statisticsData.setFinished(finished);
- //鎴愬搧涓嶅悎鏍�
- Integer unfinished = finishedInspectMapper.selCountFin(begin, end, 0, 0);
- statisticsData.setUnfinished(unfinished);
- return statisticsData;
- }
-
- //璁$畻浜у搧鎬婚噺
- @Override
- public ProReport allNum() {
- // 鑾峰彇褰撳墠鏃ユ湡鐨勫墠涓や釜鏈堢殑鏃ユ湡
- ArrayList<String> dateList = new ArrayList<>();
- LocalDate now = LocalDate.now();
- LocalDate oneAgo = now.minusMonths(1);
- LocalDate twoAgo = now.minusMonths(2);
- // 鏍煎紡鍖栨棩鏈熷璞�
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
- dateList.add(twoAgo.format(formatter));
- dateList.add(oneAgo.format(formatter));
- dateList.add(now.format(formatter));
- //鑾峰彇鍘熸潗鏂欐湀浜ч噺
- Long cLong = rawInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString());
- Long bLong = rawInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString());
- Long aLong = rawInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString());
- ArrayList<String> materialList = new ArrayList<>();
- materialList.add(aLong.toString());
- materialList.add(bLong.toString());
- materialList.add(cLong.toString());
- //鑾峰彇杩囩▼鏈堜骇閲�
- Long c1Long = finishedInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- Long b1Long = finishedInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- Long a1Long = finishedInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- ArrayList<String> processList = new ArrayList<>();
- processList.add(a1Long.toString());
- processList.add(b1Long.toString());
- processList.add(c1Long.toString());
- //鑾峰彇鎴愬搧鏈堜骇閲�
- Long c2Long = finishedInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0);
- Long b2Long = finishedInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0);
- Long a2Long = finishedInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0);
- ArrayList<String> finishedList = new ArrayList<>();
- finishedList.add(a2Long.toString());
- finishedList.add(b2Long.toString());
- finishedList.add(c2Long.toString());
- return ProReport.builder()
- .dateList(StringUtils.join(dateList, ','))
- .materialList(StringUtils.join(materialList, ','))
- .processList(StringUtils.join(processList, ','))
- .finishedList(StringUtils.join(finishedList, ','))
- .build();
- }
-
- //璁$畻杈炬爣鎬婚噺
- @Override
- public ProReport statisNum() {
- // 鑾峰彇褰撳墠鏃ユ湡鐨勫墠涓や釜鏈堢殑鏃ユ湡
- ArrayList<String> dateList = new ArrayList<>();
- LocalDate now = LocalDate.now();
- LocalDate oneAgo = now.minusMonths(1);
- LocalDate twoAgo = now.minusMonths(2);
- // 鏍煎紡鍖栨棩鏈熷璞�
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
- dateList.add(twoAgo.format(formatter));
- dateList.add(oneAgo.format(formatter));
- dateList.add(now.format(formatter));
- //鑾峰彇鍘熸潗鏂欐湀杈炬爣浜ч噺
- Integer c = rawInspectMapper.selCountRaw(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- Integer b = rawInspectMapper.selCountRaw(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- Integer a = rawInspectMapper.selCountRaw(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1);
- ArrayList<String> materialList = new ArrayList<>();
- materialList.add(a.toString());
- materialList.add(b.toString());
- materialList.add(c.toString());
- //鑾峰彇杩囩▼鏈堣揪鏍囦骇閲�
- Integer c1 = finishedInspectMapper.selCountFin(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1);
- Integer b1 = finishedInspectMapper.selCountFin(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1);
- Integer a1 = finishedInspectMapper.selCountFin(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1);
- ArrayList<String> processList = new ArrayList<>();
- processList.add(a1.toString());
- processList.add(b1.toString());
- processList.add(c1.toString());
- //鑾峰彇鎴愬搧鏈堣揪鏍囦骇閲�
- Integer c2 = finishedInspectMapper.selCountFin(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1);
- Integer b2 = finishedInspectMapper.selCountFin(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1);
- Integer a2 = finishedInspectMapper.selCountFin(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1);
- ArrayList<String> finishedList = new ArrayList<>();
- finishedList.add(a2.toString());
- finishedList.add(b2.toString());
- finishedList.add(c2.toString());
- return ProReport.builder()
- .dateList(StringUtils.join(dateList, ','))
- .materialList(StringUtils.join(materialList, ','))
- .processList(StringUtils.join(processList, ','))
- .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/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml b/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
index 5dc7ac5..4c3684d 100644
--- a/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
+++ b/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
@@ -2,76 +2,119 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.FinishedInspectMapper">
<select id="selectFinishedInspectPage" resultType="map">
- SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`,
- f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`,
- f.`quantity`, u.`name`, DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, f.`result`
- FROM finished_inspect f, `user` u
+ SELECT f.`id`,
+ f.`order_number`,
+ f.`customer_name`,
+ f.`project_name`,
+ f.`quality_traceability`,
+ f.`material_code`,
+ f.`material`,
+ f.`specifications_model`,
+ f.`unit`,
+ f.`quantity`,
+ u.`name`,
+ DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod,
+ f.`result`
+ FROM mom_ocean.finished_inspect f, mom_ocean.`user` u
WHERE f.`user_id` = u.`id`
AND f.`state` = 1
- <if test="inspectResult != null and inspectResult != ''">
- AND f.result = #{inspectResult}
+ <if test="result != null ">
+ AND f.result = #{result}
</if>
- <if test="inspectDate != null and inspectDate != ''">
- AND DATE_FORMAT(f.`create_time`, '%Y-%m-%d') = #{inspectDate}
- </if>
- <if test="inspectUsername != null and inspectUsername != ''">
- AND u.`name` LIKE CONCAT('%',#{inspectUsername},'%')
+ <if test="material != null and material != ''">
+ AND f.`material` LIKE CONCAT('%',#{material},'%')
</if>
</select>
- <select id="selCountFin" resultType="java.lang.Integer">
- select count(id)
- from mom_ocean.finished_inspect
- where state=1
- and result=#{result}
- and type=#{type}
- <if test="begin != null and begin!=''">
- and finished_inspect.create_time >= #{begin}
- </if>
- <if test="end != null and end!=''">
- and finished_inspect.create_time <= #{end}
- </if>
- </select>
- <select id="seAllCount" resultType="java.lang.Long">
- select count(id)
- from mom_ocean.finished_inspect
- where state=1
- and type=#{type}
- <if test="begin != null and begin!=''">
- and finished_inspect.create_time >= #{begin}
- </if>
- <if test="end != null and end!=''">
- and finished_inspect.create_time <= #{end}
- </if>
- </select>
- <!--鏂板杩囩▼妫�楠屽崟-鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅-->
+
+ <!--鏂板妫�楠屽崟-鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅-->
<resultMap id="oneMap" type="map">
- <id property="name" column="material"/>
- <result property="code" column="code"/>
- <result property="specifications" column="specifications"/>
- <result property="unit" column="unit"/>
+ <id property="prname" column="prname"/>
+ <result property="sname" column="sname"/>
<collection property="children" resultMap="twoMap" javaType="List"/>
</resultMap>
<resultMap id="twoMap" type="map">
- <result property="name" column="techfather"/>
+ <id property="id" column="moid"/>
+ <result property="name" column="material"/>
+ <result property="mcode" column="mcode"/>
+ <result property="qualityTraceability" column="quality_traceability"/>
+ <result property="specifications" column="specifications"/>
+ <result property="unit" column="unit"/>
<collection property="children" resultMap="threeMap" javaType="List"/>
</resultMap>
- <resultMap id="threeMap" type="map">
- <id property="id" column="technologyId"/>
- <result property="name" column="techname"/>
- </resultMap>
<select id="chooseMater" resultMap="oneMap">
- select mo.name material,
- code,
+ select s.proname prname,
+ s.name sname,
+ quality_traceability,
+ m.code mcode,
+ mo.name material,
specifications,
unit,
- technology_id technologyId,
- techfather,
- techname
- from mom_ocean.manual_technology mt
- left join mom_ocean.manufacture_order mo on mt.manufacture_order_id = mo.id
+ mo.id moid
+ from mom_ocean.manufacture_order mo
left join mom_ocean.material m on m.name = mo.name
+ left join mom_ocean.sale s on order_number = order_code
where mo.state = 1
- and type = 1
+ and m.type = 1
and order_code = #{orderNumber}
</select>
+
+ <!--鏍规嵁妫�楠屽崟id鏌ヨ鎴愬搧妫�楠屽崟璇︽儏-->
+ <resultMap id="seProInsListById" type="map">
+ <id property="name" column="order_number"/>
+ <result property="customerName" column="customer_name"/>
+ <result property="projectName" column="project_name"/>
+ <result property="qualityTraceability" column="quality_traceability"/>
+ <result property="materialCode" column="material_code"/>
+ <result property="material" column="material"/>
+ <result property="specifications" column="specifications_model"/>
+ <result property="funit" column="funit"/>
+ <result property="quantity" column="quantity"/>
+ <result property="fresult" column="fresult"/>
+ <collection property="children" resultMap="seProInsListByIdmap" javaType="List"/>
+ </resultMap>
+ <resultMap id="seProInsListByIdmap" type="map">
+ <result property="ifather" column="ifather"/>
+ <collection property="children" resultMap="seProInsListByIdmaps" javaType="List"/>
+ </resultMap>
+ <resultMap id="seProInsListByIdmaps" type="map">
+ <id property="iid" column="iid"/>
+ <result property="iname" column="iname"/>
+ <result property="iunit" column="iunit"/>
+ <result property="required" column="required"/>
+ <result property="internal" column="internal"/>
+ <result property="inspectionValue" column="inspection_value"/>
+ <result property="dname" column="dname"/>
+ <result property="iresult" column="iresult"/>
+ <result property="username" column="username"/>
+ </resultMap>
+ <select id="selectFinishInspectsListById" resultMap="seProInsListById">
+ select order_number,
+ customer_name,
+ project_name,
+ quality_traceability,
+ material_code,
+ material,
+ specifications_model,
+ fi.unit funit,
+ quantity,
+ ii.id iid,
+ ii.father ifather,
+ ii.name iname,
+ ii.unit iunit,
+ required,
+ internal,
+ inspection_value,
+ device.name dname,
+ ii.result iresult,
+ username,
+ fi.result fresult
+ from mom_ocean.inspection_item ii
+ left join mom_ocean.finished_inspect fi on fi.id = inspect_id
+ left join mom_ocean.device
+ on ii.device_id = device.id
+ where ii.type = 2
+ and ii.state = 1
+ and fi.state = 1
+ and fi.id = #{id}
+ </select>
</mapper>
diff --git a/inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml b/inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml
index 4e0ab3c..cfb2fcf 100644
--- a/inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml
@@ -1,20 +1,7 @@
<?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.InspectUnacceptedMapper">
- <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍝�-->
- <update id="updaRawIns">
- update mom_ocean.inspect_unaccepted
- set state=0
- where raw_inspect_id = #{id}
- and type = 0
- </update>
- <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎鍘熸潗鏂欎笉鍚堟牸鍝�-->
- <update id="delAllRawIns">
- update mom_ocean.inspect_unaccepted
- set state=0
- where raw_inspect_id in (${ids})
- and type = 0
- </update>
+
<select id="selectUnRawInspectsList" resultType="java.util.Map">
select ru.id,
@@ -58,9 +45,9 @@
deal_state,
deal_reasult,
DATE_FORMAT(deal_time, '%Y-%m-%d') processingDate
- FROM (inspect_unaccepted ru,
- `user` u)
- LEFT JOIN finished_inspect fi ON fi.`id` = ru.`raw_inspect_id`
+ FROM (mom_ocean.inspect_unaccepted ru,
+ mom_ocean.`user` u)
+ LEFT JOIN mom_ocean.finished_inspect fi ON fi.`id` = ru.`raw_inspect_id`
where fi.id = ru.raw_inspect_id
AND ru.type = 1
AND ru.state=1
diff --git a/inspect-server/src/main/resources/mapper/InspectionItemMapper.xml b/inspect-server/src/main/resources/mapper/InspectionItemMapper.xml
index 4ee7346..b117cab 100644
--- a/inspect-server/src/main/resources/mapper/InspectionItemMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InspectionItemMapper.xml
@@ -1,12 +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.InspectionItemMapper">
-
<resultMap id="selectInspectionItemMap" type="inspectionItemDto">
- <id property="father" column="father"/>
+ <id property="father" column="ifather"/>
<association property="children" resultMap="selectInspectionItemDto2Map"/>
</resultMap>
-
<resultMap id="selectInspectionItemDto2Map" type="inspectionItemDto2">
<id property="id" column="id"/>
<result property="name" column="name"/>
@@ -14,14 +12,34 @@
<result property="internal" column="internal"/>
<result property="required" column="required"/>
<result property="inspectionValue" column="inspection_value"/>
- <result property="deviceId" column="device_id"/>
+ <result property="dname" column="dname"/>
<result property="result" column="result"/>
+ <result property="username" column="username"/>
</resultMap>
-
<select id="selectInspectionItem" resultMap="selectInspectionItemMap">
- SELECT i.`id`, IFNULL(i.`father`,i.`name`) father, i.`name`, i.`unit`, i.`internal`, i.`required`, i.`inspection_value`, i.`device_id`, i.`result`
- FROM inspection_item i
- WHERE i.`finish_inspect_id` = #{finishInspectId}
+ SELECT i.`id`,
+ i.`father` ifather,
+ i.`name`,
+ i.`unit`,
+ i.`internal`,
+ i.`required`,
+ i.`inspection_value`,
+ device.name dname,
+ i.`result`,
+ username
+ FROM mom_ocean.inspection_item i
+ left join mom_ocean.device on i.device_id = device.id
+ WHERE i.`inspect_id` = #{id}
AND i.`state` = 1
+ and i.type = #{type}
+ </select>
+
+ <!--鑾峰彇璇ユ楠屽崟涓嬫楠岄」鐩殑缁撴灉闆�-->
+ <select id="getResult" resultType="java.lang.Integer">
+ select distinct result
+ from mom_ocean.inspection_item
+ where state = 1
+ and type = #{type}
+ and inspect_id = #{id}
</select>
</mapper>
diff --git a/inspect-server/src/main/resources/mapper/ProcessInspectMapper.xml b/inspect-server/src/main/resources/mapper/ProcessInspectMapper.xml
new file mode 100644
index 0000000..ce020f7
--- /dev/null
+++ b/inspect-server/src/main/resources/mapper/ProcessInspectMapper.xml
@@ -0,0 +1,120 @@
+<?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.ProcessInspectMapper">
+ <!--鏂板杩囩▼妫�楠屽崟-鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧淇℃伅鍜屽伐鑹�-->
+ <resultMap id="oneMap" type="map">
+ <id property="name" column="material"/>
+ <result property="code" column="code"/>
+ <result property="specifications" column="specifications"/>
+ <result property="unit" column="unit"/>
+ <collection property="children" resultMap="twoMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="twoMap" type="map">
+ <result property="name" column="techfather"/>
+ <collection property="children" resultMap="threeMap" javaType="List"/>
+ </resultMap>
+ <resultMap id="threeMap" type="map">
+ <id property="id" column="technologyId"/>
+ <result property="name" column="techname"/>
+ </resultMap>
+ <select id="chooseMater" resultMap="oneMap">
+ select mo.name material,
+ code,
+ specifications,
+ unit,
+ technology_id technologyId,
+ techfather,
+ techname
+ from mom_ocean.manual_technology mt
+ left join mom_ocean.manufacture_order mo on mt.manufacture_order_id = mo.id
+ left join mom_ocean.material m on m.name = mo.name
+ where mo.state = 1
+ and type = 1
+ and order_code = #{orderNumber}
+ </select>
+
+ <!--鏍规嵁妫�楠屽崟id鏌ヨ杩囩▼妫�楠屽崟璇︽儏-->
+ <resultMap id="seProInsListById" type="map">
+ <id property="name" column="order_number"/>
+ <result property="materialCode" column="material_code"/>
+ <result property="material" column="material"/>
+ <result property="specifications" column="specifications_model"/>
+ <result property="techfather" column="techfather"/>
+ <result property="techname" column="techname"/>
+ <result property="punit" column="punit"/>
+ <result property="quantity" column="quantity"/>
+ <result property="presult" column="presult"/>
+ <collection property="children" resultMap="seProInsListByIdmap" javaType="List"/>
+ </resultMap>
+ <resultMap id="seProInsListByIdmap" type="map">
+ <result property="ifather" column="ifather"/>
+ <collection property="children" resultMap="seProInsListByIdmaps" javaType="List"/>
+ </resultMap>
+ <resultMap id="seProInsListByIdmaps" type="map">
+ <id property="iid" column="iid"/>
+ <result property="iname" column="iname"/>
+ <result property="iunit" column="iunit"/>
+ <result property="required" column="required"/>
+ <result property="internal" column="internal"/>
+ <result property="inspectionValue" column="inspection_value"/>
+ <result property="dname" column="dname"/>
+ <result property="iresult" column="iresult"/>
+ <result property="username" column="username"/>
+ </resultMap>
+ <select id="selectProcessInspectsListById" resultMap="seProInsListById">
+ select order_number,
+ material_code,
+ material,
+ specifications_model,
+ techfather,
+ techname,
+ pi.unit punit,
+ quantity,
+ ii.id iid,
+ ii.father ifather,
+ ii.name iname,
+ ii.unit iunit,
+ required,
+ internal,
+ inspection_value,
+ device.name dname,
+ ii.result iresult,
+ username,
+ pi.result presult
+ from mom_ocean.inspection_item ii
+ left join mom_ocean.process_inspect pi on pi.id = inspect_id
+ left join mom_ocean.device on ii.device_id = device.id
+ where ii.type = 1
+ and ii.state = 1
+ and pi.state = 1
+ and pi.id = #{id}
+ </select>
+ <!--鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃-->
+ <select id="selectProcessInspectsList" resultType="java.util.Map">
+ select process_inspect.id,
+ order_number,
+ material_code,
+ material,
+ specifications_model,
+ techfather,
+ techname,
+ unit,
+ quantity,
+ DATE_FORMAT(process_inspect.create_time, '%Y-%m-%d') createTime,
+ name,
+ DATE_FORMAT(process_inspect.update_time, '%Y-%m-%d') updateTime,
+ result
+ from mom_ocean.process_inspect
+ left join mom_ocean.user on process_inspect.user_id = user.id
+ where process_inspect.state = 1
+ <if test="techfather!=null and techfather!=''">
+ and techfather like concat('%',#{techfather},'%')
+ </if>
+ <if test="material!=null and material!=''">
+ and material like concat('%',#{name},'%')
+ </if>
+ <if test="result!=null ">
+ and result =#{result}
+ </if>
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml b/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
index d8e0d2a..3c9a5d9 100644
--- a/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
+++ b/inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
@@ -1,18 +1,6 @@
<?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">
- <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鍒犻櫎-->
- <update id="updaRawInsById">
- update mom_ocean.raw_ins_product
- set state=0
- where raw_inspect_id = #{id}
- </update>
- <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎鍘熸潗鏂欐楠岄」鐩�-->
- <update id="delAllRawIns">
- update mom_ocean.raw_ins_product
- set state=0
- where raw_inspect_id in (${ids})
- </update>
<!--鏍规嵁鍘熸潗鏂欐楠屽崟id鏌ヨ妫�楠岄」鐩�-->
<select id="getresult" resultType="java.lang.Integer">
select test_state
diff --git a/inspect-server/src/main/resources/mapper/RawInspectMapper.xml b/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
index 327ba05..1c9b84b 100644
--- a/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
+++ b/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
@@ -3,12 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.RawInspectMapper">
- <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鎵归噺鍒犻櫎-->
- <update id="delAllRawIns">
- update mom_ocean.raw_inspect
- set state=0
- where id in (${ids})
- </update>
<select id="selCountRaw" resultType="java.lang.Integer">
select count(id)
from mom_ocean.raw_inspect
diff --git a/production-server/src/main/java/com/yuanchu/mom/mapper/ManualTechnologyMapper.java b/production-server/src/main/java/com/yuanchu/mom/mapper/ManualTechnologyMapper.java
index 5a063a4..1fabcfa 100644
--- a/production-server/src/main/java/com/yuanchu/mom/mapper/ManualTechnologyMapper.java
+++ b/production-server/src/main/java/com/yuanchu/mom/mapper/ManualTechnologyMapper.java
@@ -18,5 +18,8 @@
List<Map<String, Object>> seleDatil(Integer manOrdId);
List<Map<String, Object>> selectListTowTree(Integer schedulingId);
+
+ //鏍规嵁鐢熶骇璁㈠崟鏌ヨ鎵�鏈�(鍊掑簭)
+ List<ManualTechnology> selAllByMoId(Integer id);
}
diff --git a/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml b/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
index 752abcd..b6fe2a0 100644
--- a/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
+++ b/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
@@ -1,7 +1,6 @@
<?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.ManualTechnologyMapper">
-
<resultMap id="seleDatilMap" type="map">
<id property="lable" column="techfather"/>
<collection property="children" resultMap="seleDatilTowMap" javaType="List"/>
@@ -37,8 +36,13 @@
<result property="period" column="period"/>
</resultMap>
<select id="selectListTowTree" resultMap="selectListTowTreeFirstMap">
- SELECT p.`id`, t.`techfather`, t.`techname`, d.`name`, DATE_FORMAT(p.`start_time`, '%Y-%m-%d') start_time,
- DATE_FORMAT(p.`end_time`, '%Y-%m-%d') end_time, p.`period`
+ SELECT p.`id`,
+ t.`techfather`,
+ t.`techname`,
+ d.`name`,
+ DATE_FORMAT(p.`start_time`, '%Y-%m-%d') start_time,
+ DATE_FORMAT(p.`end_time`, '%Y-%m-%d') end_time,
+ p.`period`
FROM manufacture_order_process p
LEFT JOIN device d ON d.`id` = p.`device_id`
LEFT JOIN manual_technology t ON t.`id` = p.`manual_technology_id`
@@ -46,4 +50,13 @@
AND p.`manufacture_scheduling_id` = #{schedulingId}
ORDER BY p.`create_time` DESC
</select>
+
+ <!--鏍规嵁鐢熶骇璁㈠崟id鏌ヨ鎵�鏈�(鍊掑簭)-->
+ <select id="selAllByMoId" resultType="com.yuanchu.mom.pojo.ManualTechnology">
+ select *
+ from mom_ocean.manual_technology
+ where state = 1
+ and manufacture_order_id = #{id}
+ order by id desc
+ </select>
</mapper>
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 d597262..b5fa40e 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
@@ -29,11 +29,4 @@
String addMaterial(MaterialDto materialDto);
- /**
- * 妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(椤圭洰鍚嶇О涓嬫媺妗嗭細Id涓庡悕绉帮紝缂栫爜)
- */
- List<Map<String, Object>> selectMaterialIdAndNameAndCode();
-
-
-
}
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 5833ad8..f588796 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
@@ -162,13 +162,6 @@
return "娣诲姞鐗╂枡銆�" + materialDto.getName() + "銆戞垚鍔�";
}
- //妫�楠屾ā鍧�-->QMS绠$悊-->鎴愬搧妫�楠�-->鏂板(椤圭洰鍚嶇О涓嬫媺妗嗭細Id涓庡悕绉帮紝缂栫爜)
- @Override
- public List<Map<String, Object>> selectMaterialIdAndNameAndCode() {
- LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
- wrapper.select(Material::getId, Material::getName, Material::getCode);
- return materialMapper.selectMaps(wrapper);
- }
}
diff --git a/system-run/src/main/resources/application-dev.yml b/system-run/src/main/resources/application-dev.yml
index 9eccb15..af31743 100644
--- a/system-run/src/main/resources/application-dev.yml
+++ b/system-run/src/main/resources/application-dev.yml
@@ -34,7 +34,7 @@
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://192.168.65.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
+ url: jdbc:mysql://192.168.218.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
username: user
password: 123456
druid:
@@ -59,7 +59,7 @@
# redis鏁版嵁搴撶储寮�(榛樿涓�0)锛屾垜浠娇鐢ㄧ储寮曚负3鐨勬暟鎹簱锛岄伩鍏嶅拰鍏朵粬鏁版嵁搴撳啿绐�
database: 0
# redis鏈嶅姟鍣ㄥ湴鍧�锛堥粯璁や负localhost锛�
- host: 192.168.65.113
+ host: 192.168.218.113
# redis绔彛锛堥粯璁や负6379锛�
port: 6379
# redis璁块棶瀵嗙爜锛堥粯璁や负绌猴級
--
Gitblit v1.9.3