From c28d3bb363dde2afb44c168b93379b2bf6b1f67f Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期四, 07 九月 2023 15:26:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java | 81 ++++++++++++----------------------------
1 files changed, 25 insertions(+), 56 deletions(-)
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 3eeed10..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
@@ -1,17 +1,25 @@
package com.yuanchu.mom.controller;
-
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.RawInspect;
+import com.yuanchu.mom.pojo.vo.RawInsProductVo;
+import com.yuanchu.mom.pojo.vo.RawInspectVo;
import com.yuanchu.mom.service.*;
+import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.utils.Jwt;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.*;
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;
+import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@@ -26,24 +34,30 @@
@Resource
Jwt jwt;
- @Resource
- MaterialService materialService;
- @Resource
- SpecificationsService specificationsService;
+ @ApiOperation(value = "鏂板鍘熸潗鏂欐楠屽崟")
+ @PostMapping("/addRawInspects")
+ 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));
+ }
- @ApiOperation(value = "鏌ヨ鍘熸潗鏂欐楠屽崟鍒楄〃")
+ @ApiOperation(value = "鍒嗛〉鏌ヨ鍘熸潗鏂欐楠屽崟鍒楄〃")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
@ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
@ApiImplicitParam(name = "formTime", value = "鏉ユ枡鏃ユ湡", dataTypeClass = String.class),
- @ApiImplicitParam(name = "createTime", value = "鎶ユ鏃ユ湡", dataTypeClass = String.class),
- @ApiImplicitParam(name = "insState", value = "妫�娴嬬姸鎬�: 鍏ㄩ儴榛樿2", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "judgeState", value = "鍚堟牸鐘舵��: 鍏ㄩ儴榛樿2", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "code", value = "鍘熸潗鏂欑紪鐮�", dataTypeClass = String.class),
+ @ApiImplicitParam(name = "insState", value = "妫�娴嬬姸鎬�(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
+ @ApiImplicitParam(name = "name", value = "鍘熸潗鏂欏悕绉�", dataTypeClass = String.class)
})
@PostMapping("/selectRawInspectsList")
- public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String createTime, Integer insState, Integer judgeState) {
- return Result.success(rawInspectService.selectRawInspectsList(pageSize, countSize, formTime, createTime, insState, judgeState));
+ public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String code, Integer insState, String name) {
+ IPage<Map<String, Object>> page = rawInspectService.selectRawInspectsList(new Page<Object>(pageSize, countSize), formTime, code, insState, name);
+ Map<String, Object> map = new HashMap<>();
+ map.put("total", page.getTotal());
+ map.put("row", page.getRecords());
+ return Result.success(map);
}
@ApiOperation(value = "鏍规嵁妫�楠屽崟id鏌ヨ鍘熸潗鏂欐楠屽崟璇︽儏")
@@ -67,51 +81,6 @@
return Result.fail("宸茬粡涓婃姤杩囦簡,涓嶈兘鍐嶆涓婃姤!");
}
return Result.success(rawInspectService.updateRawInspectsById(id));
- }
-
- @ApiOperation(value = "鏌ヨ鎵�鏈夊師鏉愭枡淇℃伅")
- @GetMapping("/selectMaterial")
- public Result selectMaterial() {
- return Result.success(materialService.selectMaterial());
- }
-
- @ApiOperation(value = "閫夋嫨鐗╂枡鍚嶇О鏌ヨ鐗╂枡淇℃伅(鐗╂枡id鍜岀紪鐮�)")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "name", value = "鍘熸潗鏂欏悕绉�(鐗╂枡鍚嶇О)", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/selectMcodeId")
- public Result selectMcodeId(String name) {
- return Result.success(materialService.selectMcodeId(name));
- }
-
- @ApiOperation(value = "閫夋嫨鐗╂枡缂栫爜(鑾峰彇鐗╂枡瑙勬牸id.鍚嶇О鍜屽瀷鍙峰悕绉�)")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "name", value = "鍘熸潗鏂欏悕绉�(鐗╂枡鍚嶇О)", dataTypeClass = String.class, required = true),
- @ApiImplicitParam(name = "code", value = "鍘熸潗鏂欑紪鍙�(鐗╂枡缂栧彿)", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/selectIdByCoNa")
- public Result selectIdByCoNa(String name, String code) {
- return Result.success(materialService.selectIdByCoNa(name, code));
- }
-
- @ApiOperation(value = "閫夋嫨鐗╂枡瑙勬牸(鏍规嵁瑙勬牸id鑾峰彇鐗╂枡鍨嬪彿)")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鐗╂枡瑙勬牸id", dataTypeClass = Integer.class, required = true)
- })
- @GetMapping("/selectSpBySt")
- public Result selectSpBySt(Integer id) {
- return Result.success(specificationsService.selectSpecificationIdAndName(id));
- }
-
-
- @ApiOperation(value = "鏂板妫�楠屽崟")
- @PostMapping("/addRawInspects")
- public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspect rawInspect) throws JSONException {
- Map<String, String> map = jwt.readJWT(token);
- String data = map.get("data");
- JSONObject jsonObject = new JSONObject(data);
- String userName = jsonObject.getString("name");
- return Result.success(rawInspectService.addRawInspects(userName, rawInspect));
}
}
--
Gitblit v1.9.3