value
2024-05-08 4430c26482f219b1313fdf916d58dc8a8bd1cbfe
区间项目下单
已修改8个文件
130 ■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/pojo/StructureItemParameter.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/StandardTreeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardTreeMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsSample.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/StructureItemParameter.java
@@ -48,11 +48,11 @@
    @ApiModelProperty(value = "单价(元)")
    private BigDecimal price;
    @ApiModelProperty(value = "实验室")
    @ApiModelProperty(value = "场所")
    private String laboratory;
    @ValueTableShow(4)
    @ApiModelProperty(value = "子实验室")
    @ApiModelProperty(value = "试验室")
    private String sonLaboratory;
    @ValueTableShow(5)
inspect-server/src/main/java/com/yuanchu/mom/controller/StandardTreeController.java
@@ -51,7 +51,7 @@
        return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree));
    }
    @ValueClassify("标准库")
    @ApiOperation(value = "修改标准库中的要求值")
    @ApiOperation(value = "修改标准库中的内容")
    @PostMapping("/upStandardProductList")
    public Result upStandardProductList(@RequestBody StandardProductList list){
        return Result.success(standardProductListService.upStandardProductList(list));
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardTreeMapper.java
@@ -31,6 +31,8 @@
    List<StandardProductList> selectStandardProductListByTree2(String tree, String sample, String model, String trees);
    List<StandardProductList> selectStandardProductListByTree3(String tree, String sample, String model, String trees);
    List<SampleTypeDto> getStandardTree2();
}
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsSample.java
@@ -1,15 +1,12 @@
package com.yuanchu.mom.pojo;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * 检验样品
@@ -111,4 +108,5 @@
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java
@@ -6,7 +6,6 @@
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@@ -59,13 +58,13 @@
     * 单价(元)
     */
    @ApiModelProperty("单价")
    private BigDecimal price;
    private String price;
    /**
     * 工时(H)
     */
    @ApiModelProperty("工时")
    private Double manHour;
    private String manHour;
    /**
     * 工时分组
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -187,7 +187,7 @@
                    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 + ""));
                        insProduct.setLastValue(o.equals("")?null:(o + ""));
                    }
                }catch (Exception e){}
                if (jo.get("equipValue") != null) {
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
@@ -47,29 +49,47 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, insSample.getModel()));
        String[] models = insSample.getModel().split("-");
        List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]));
        list = list.stream().filter(a -> {
            try {
                if (a.getSection() != null && !Objects.equals(a.getSection(), "")) {
                    if (a.getSection().contains("~")) {
                        String[] split = a.getSection().split("~");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[0])) > -1 && new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[1])) < 1;
                    } else if (a.getSection().contains("≥") || a.getSection().contains(">=")) {
                        String param = a.getSection().replace("≥", "").replace(">=", "");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) > -1;
                    } else if (a.getSection().contains("≤") || a.getSection().contains("<=")) {
                        String param = a.getSection().replace("≤", "").replace("<=", "");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) < 1;
                    } else if (a.getSection().contains(">")) {
                        String param = a.getSection().replace(">", "");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) > 0;
                    } else if (a.getSection().contains("<")) {
                        String param = a.getSection().replace("<", "");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) < 0;
                    } else if (a.getSection().contains("=")) {
                        String param = a.getSection().replace("=", "");
                        return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) == 0;
                    List<String> sections = JSON.parseArray(a.getSection(), String.class);
                    List<String> asks = JSON.parseArray(a.getAsk(), String.class);
                    List<String> tells = JSON.parseArray(a.getTell(), String.class);
                    List<String> manHours = JSON.parseArray(a.getManHour(), String.class);
                    List<String> prices = JSON.parseArray(a.getPrice(), String.class);
                    boolean isIf = false;
                    for (int i = 0;i<sections.size();i++){
                        if (sections.get(i).contains("&")) {
                            String[] split = sections.get(i).split("&");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(split[0])) > -1 && new BigDecimal(models[1]).compareTo(new BigDecimal(split[1])) < 1;
                        } else if (sections.get(i).contains("≥") || sections.get(i).contains(">=")) {
                            String param = sections.get(i).replace("≥", "").replace(">=", "");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(param)) > -1;
                        } else if (sections.get(i).contains("≤") || sections.get(i).contains("<=")) {
                            String param = sections.get(i).replace("≤", "").replace("<=", "");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(param)) < 1;
                        } else if (sections.get(i).contains(">")) {
                            String param = sections.get(i).replace(">", "");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(param)) > 0;
                        } else if (sections.get(i).contains("<")) {
                            String param = sections.get(i).replace("<", "");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(param)) < 0;
                        } else if (sections.get(i).contains("=")) {
                            String param = sections.get(i).replace("=", "");
                            isIf = new BigDecimal(models[1]).compareTo(new BigDecimal(param)) == 0;
                        }
                        if(isIf) {
                            a.setSection(sections.get(i));
                            a.setAsk(asks.get(i));
                            a.setTell(tells.get(i));
                            a.setPrice(prices.get(i));
                            a.setManHour(manHours.get(i));
                            return true;
                        }
                    }
                    return false;
                }
            } catch (Exception ignored) {
                return false;
@@ -87,7 +107,7 @@
            List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]));
            for (StandardTree standardTree : treeList) {
                String str = tree+" - "+standardTree.getSample()+" - "+standardTree.getModel();
                list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str));
                list.addAll(standardTreeMapper.selectStandardProductListByTree3("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str));
            }
        } else if (trees.length == 4){
            List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]));
@@ -129,7 +149,7 @@
            }
        }
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
//        CompletableFuture.supplyAsync(() -> {
        CompletableFuture.supplyAsync(() -> {
            standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree));
            saveBatch(list.stream().map(a->{
                a.setFactory(trees[0]);
@@ -140,12 +160,12 @@
                a.setStandardMethodListId(id);
                return a;
            }).collect(Collectors.toList()));
            /*return null;
            return null;
        }).thenAccept(res -> {
        }).exceptionally(e -> {
            e.printStackTrace();
            return null;
        });*/
        });
        return list;
    }
}
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -51,13 +51,15 @@
               l.laboratory_name  laboratory,
               sto.specimen_name  sample_type,
               p.name             sample,
               st.model
               st.model,
               sto.code
        from laboratory l
                 left join structure_test_object sto on sto.laboratory_id = l.id
                 left join product p on p.object_id = sto.id
                 left join standard_tree st on st.laboratory = l.laboratory_name
            and st.sample_type = sto.specimen_name
            and st.sample = p.name
        order by l.id,CAST(sto.code AS DECIMAL),st.id
    </select>
    <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList">
@@ -205,4 +207,39 @@
                 left join standard_tree st on st.sample_type = sto.specimen_name
            and st.sample = p.name
    </select>
    <select id="selectStandardProductListByTree3" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select sample sample2,
               inspection_item,
               inspection_item_en,
               inspection_item_subclass,
               inspection_item_subclass_en,
               method,
               son_laboratory,
               unit,
               ask_tell tell,
               ask,
               price,
               man_hour,
               man_hour_group,
               man_day,
               inspection_item_type,
               inspection_value_type,
               bsm,
               template_id,
               laboratory,
               checkout_number,
               section,
               dic,
               0 state,
               #{model} model,
               #{sample} sample,
               #{trees} tree
        from structure_item_parameter
        where (
                      sample is NULL
                      OR sample = ''
                      or sample = '[]'
                      OR sample LIKE CONCAT('%', #{tree}, '%')
                  )
    </select>
</mapper>