From a86d2feff2af246bdf09c32e6591eb590cefa672 Mon Sep 17 00:00:00 2001 From: JYW <2013732181@qq.com> Date: 星期二, 23 四月 2024 09:00:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java | 1 inspect-server/src/main/resources/mapper/InsSampleMapper.xml | 7 ++- inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java | 5 ++ inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 61 ++++++++++++------------------ cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 2 + inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java | 2 + 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml index 9db70b9..428ec1f 100644 --- a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml +++ b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml @@ -6,8 +6,10 @@ <select id="selectItemParameterList" resultType="com.yuanchu.mom.pojo.StructureItemParameter"> select id, inspection_item, + inspection_item_en, inspection_item_classify, inspection_item_subclass, + inspection_item_subclass_en, laboratory, unit, price, diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java index 3f32791..12210bd 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java @@ -1,5 +1,6 @@ package com.yuanchu.mom.controller; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -18,6 +19,8 @@ import com.yuanchu.mom.vo.Result; import io.swagger.annotations.*; import lombok.AllArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.context.annotation.Bean; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -57,7 +60,7 @@ @ApiOperation(value = "娣诲姞妫�楠屼笅鍗曟暟鎹�") @PostMapping("/addInsOrder") public Result<?> addInsOrder(@RequestBody Map<String, Object> map) { - JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(map.get("list"))); + JSONArray jsonArray = JSON.parseArray(map.get("list")+""); List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class); InsOrder insOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), InsOrder.class); return Result.success(insOrderService.addInsOrder(list, insOrder)); diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java index 92e92df..687666d 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java @@ -67,6 +67,8 @@ */ private String model; + private String methodS; + /** * 瀛愬疄楠屽 */ diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java index b3eda3a..a8ba372 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java @@ -123,9 +123,9 @@ public Map<String, Object> doInsOrder(Integer id, String laboratory) { InsOrder insOrder = new InsOrder(); insOrder.setId(id); - insOrder.setInsState(1); InsOrder order = insOrderMapper.selectById(id); if (BeanUtil.isEmpty(order.getInsTime())) { + insOrder.setInsState(1); insOrder.setInsTime(LocalDateTime.now()); insOrderMapper.updateById(insOrder); } @@ -165,7 +165,7 @@ map.put("v", JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v")); try { if ((insValue.get("u") == null || insValue.get("u").equals("")) && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) { - map.put("u", userId); + map.put("u", userId + ""); } else { map.put("u", insValue.get("u")); } @@ -190,14 +190,23 @@ if (resValue.get("v") != null) { insProduct.setLastValue(JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v") + ""); } - JSONObject equipValue = JSON.parseObject(JSON.toJSONString(jo.get("equipValue"))); - try { - result.setEquipValue(JSON.parseObject(JSON.toJSONString(equipValue.get("v"))).get("v") + ""); - } catch (Exception ignored) { - result.setEquipValue(null); + if (jo.get("equipValue") != null) { + JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("equipValue"))); + List<Map<String, Object>> ev = new ArrayList<>(); + for (Object o : jsonArray2) { + JSONObject equipValue = JSON.parseObject(JSON.toJSONString(o)); + Map<String, Object> map = new HashMap<>(); + map.put("v", JSON.parseObject(JSON.toJSONString(equipValue.get("v"))).get("v")); + ev.add(map); + } + result.setEquipValue(JSON.toJSONString(ev)); } - JSONObject insResult = JSON.parseObject(JSON.toJSONString(jo.get("insResult"))); - insProduct.setInsResult(Integer.parseInt(JSON.parseObject(JSON.toJSONString(insResult.get("v"))).get("v") + "")); + try { + JSONObject insResult = JSON.parseObject(JSON.toJSONString(jo.get("insResult"))); + String ir = JSON.parseObject(JSON.toJSONString(insResult.get("v"))).get("v") + ""; + insProduct.setInsResult(Integer.parseInt(ir)); + } catch (Exception e) { + } if (BeanUtil.isEmpty(result.getId())) { result.setCreateUser(userId); result.setUpdateUser(userId); @@ -496,33 +505,9 @@ JSONObject sheet = JSON.parseObject(JSON.toJSONString(JSON.parseArray(JSON.toJSONString(JSON.parseObject(thing).get("data"))).get(0))); JSONObject config = JSON.parseObject(JSON.toJSONString(sheet.get("config"))); List<JSONObject> cellData = JSON.parseArray(JSON.toJSONString(sheet.get("celldata")), JSONObject.class); -// List<JSONObject> tableData = new ArrayList<>(); Map<String, Object> style = new HashMap<>(); style.put("rowlen", config.get("rowlen")); style.put("columnlen", config.get("columnlen")); - /*int r = -1; - if (BeanUtil.isNotEmpty(cellData)) { - for (JSONObject o : cellData) { - JSONObject v = JSON.parseObject(JSON.toJSONString(o.get("v"))); - tableData.add(o); - if (BeanUtil.isNotEmpty(v.get("ps"))) { - JSONObject ps = JSON.parseObject(JSON.toJSONString(v.get("ps"))); - if (ps.get("value").equals("妫�楠岄」") && v.get("v").equals(product.getInspectionItem())) { - tableData.add(o); - r = Integer.parseInt(o.get("r") + ""); - continue; - } - } - if (tableData.size() > 0) { - if ((Integer.parseInt(o.get("r") + "") == r + 1 || Integer.parseInt(o.get("r") + "") == r) && !(o.get("v") + "").equals("{\"ht\":\"0\"}")) { - r = Integer.parseInt(o.get("r") + ""); - tableData.add(o); - } else { - break; - } - } - } - }*/ product.setTemplate(cellData); product.setStyle(style); } @@ -533,9 +518,13 @@ public int submitPlan(Integer orderId, String laboratory) { List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); - List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, ids).eq(InsProduct::getSonLaboratory, laboratory).isNotNull(InsProduct::getInsResult)); - if (insProducts.size() == 0) { - return 0; + List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, ids).eq(InsProduct::getSonLaboratory, laboratory).eq(InsProduct::getState, 1).isNull(InsProduct::getInsResult)); + if (insProducts.size() > 0) { + String str = ""; + for (InsProduct product : insProducts) { + str += product.getInspectionItem()+product.getInspectionItemSubclass()+"锛�"; + } + throw new ErrorException("浠ヤ笅鏄湭妫�楠岀殑椤圭洰锛�"+str); } insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, orderId).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 3)); return 1; diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java index 2f3ea2e..61026bf 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java @@ -181,6 +181,7 @@ pl2.setUpdateTime(LocalDateTime.now()); pl2.setId(pl1.getId()); pl2.setSample(tree.getSample()); + pl2.setDic(pl1.getDic()); //濡傛灉鏍囧噯搴撻噷闈㈢殑瑕佹眰鏈夊�煎垯涓嶆洿鏂�,瑕佹眰涓簄ull鍒欏悓姝ユ洿鏂� if (ObjectUtils.isNotEmpty(pl1.getAsk())){ pl2.setAsk(null); diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml index f5822aa..1e5bee5 100644 --- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml +++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml @@ -104,7 +104,8 @@ template_id, ipr.ins_value, ipr.com_value, - ipr.equip_value + ipr.equip_value, + ip.method_s from ins_sample isa left join ins_product ip on isa.id = ip.ins_sample_id left join ins_product_result ipr on ip.id = ipr.ins_product_id @@ -148,7 +149,8 @@ template_id, ipr.ins_value, ipr.com_value, - ipr.equip_value + ipr.equip_value, + ip.method_s from ins_sample isa left join ins_product ip on isa.id = ip.ins_sample_id left join ins_product_result ipr on ip.id = ipr.ins_product_id @@ -216,6 +218,7 @@ <result property="createTime" column="ip_create_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="ip_update_time" jdbcType="TIMESTAMP"/> <result property="templateId" column="template_id" jdbcType="INTEGER"/> + <result property="methodS" column="method_s"/> <collection property="insProductResult" resultMap="insProductResult"/> </resultMap> -- Gitblit v1.9.3