value
2024-05-01 3acf98a35622e85ccc01bbc44e4c72d24b336fc9
修复post请求体过大导致数据不全的问题
已修改2个文件
20 ■■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderPlanController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderPlanController.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
@@ -72,8 +73,9 @@
    @ApiOperation(value = "保存检验内容")
    @PostMapping("/saveInsContext")
    @ValueAuth
    public Result<?> saveInsContext(@RequestBody Map<String, Object> param){
        insOrderPlanService.saveInsContext(param);
    public Result<?> saveInsContext(String param){
        Map<String, Object> param2 = JSON.parseObject(param, Map.class);
        insOrderPlanService.saveInsContext(param2);
        return Result.success();
    }
}
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -141,7 +141,6 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveInsContext(Map<String, Object> insContext) {
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        CompletableFuture.supplyAsync(() -> {
@@ -173,7 +172,7 @@
                    }
                    result.setInsValue(JSON.toJSONString(iv));
                }
                if (jo.get("comValue") != null) {
                if (jo.get("comValue") != null && !Objects.equals(jo.get("comValue"), "")) {
                    JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("comValue")));
                    List<Map<String, Object>> cv = new ArrayList<>();
                    for (Object o : jsonArray2) {
@@ -184,10 +183,13 @@
                    }
                    result.setComValue(JSON.toJSONString(cv));
                }
                JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("resValue")));
                if (resValue.get("v") != null) {
                    insProduct.setLastValue(JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v") + "");
                }
                try {
                    JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("resValue")));
                    if (resValue.get("v") != null) {
                        Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v");
                        insProduct.setLastValue(o==null?null:(o + ""));
                    }
                }catch (Exception e){}
                if (jo.get("equipValue") != null) {
                    JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("equipValue")));
                    List<Map<String, Object>> ev = new ArrayList<>();