value
2024-04-23 6ca23797c5221b37b18247c7a610da70a05913a9
功能调整
已修改6个文件
76 ■■■■ 文件已修改
cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsSampleMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,
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));
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java
@@ -67,6 +67,8 @@
     */
    private String model;
    private String methodS;
    /**
     * 子实验室
     */
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -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;
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());
                                        //如果标准库里面的要求有值则不更新,要求为null则同步更新
                                        if (ObjectUtils.isNotEmpty(pl1.getAsk())){
                                            pl2.setAsk(null);
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>