zss
2024-10-12 1214b18558c19b09c02161b1dbbef342ad2c1e8f
试验前后样品检查+开始结束时间
已修改8个文件
103 ■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsOrder.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductResult.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/vo/InsOrderPlanVO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsOrderMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsSampleMapper.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
@@ -238,4 +238,6 @@
        CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class);
       insOrderService.export(costStatisticsDto,response);
    }
}
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsOrder.java
@@ -259,5 +259,8 @@
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate issueTime;
    @ApiModelProperty("判定规则:不考虑不确定度/考虑不确定度(%)")
    private String rule;
}
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductResult.java
@@ -43,6 +43,10 @@
    private String equipName;
    private String beforeCheck;
    private String afterCheck;
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -182,7 +182,11 @@
        if (BeanUtil.isEmpty(order.getInsTime())) {
            insOrder.setInsTime(LocalDateTime.now());
            insOrderMapper.updateById(insOrder);
            insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, id).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 1));
            insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate()
                    .eq(InsOrderState::getInsOrderId, id)
                    .eq(InsOrderState::getLaboratory, laboratory)
                    .set(InsOrderState::getInsTime, LocalDateTime.now())
                    .set(InsOrderState::getInsState, 1));
        }
        Map<String, Object> map = insOrderService.getInsOrderAndSample(id, laboratory);
        List<SampleProductDto> list = JSON.parseArray(JSON.toJSONString(map.get("sampleProduct")), SampleProductDto.class);
@@ -520,6 +524,26 @@
                    }
                } catch (Exception e) {
                    insProduct.setLastValue("");//''
                }
                //试验前样品检查
                try {
                    JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("beforeCheck")));
                    if (resValue.get("v") != null) {
                        Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v");
                        result.setBeforeCheck(o.equals("") ? null : (o.toString()));
                    }
                } catch (Exception e) {
                    result.setBeforeCheck("");//''
                }
                //试验后样品检查
                try {
                    JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("afterCheck")));
                    if (resValue.get("v") != null) {
                        Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v");
                        result.setAfterCheck(o.equals("") ? null : (o.toString()));
                    }
                } catch (Exception e) {
                    result.setAfterCheck("");//''
                }
                //设备编号
                if (jo.get("equipValue") != null) {
@@ -1005,7 +1029,6 @@
                    insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate()
                            .eq(InsOrderState::getInsOrderId, orderId)
                            .eq(InsOrderState::getLaboratory, laboratory)
                            .set(InsOrderState::getInsTime, now)
                            .set(InsOrderState::getInsState, 6)
                            .set(InsOrderState::getVerifyTell, tell)
                            .set(InsOrderState::getVerifyUser, userId));
@@ -1015,7 +1038,6 @@
                    insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate()
                            .eq(InsOrderState::getInsOrderId, orderId)
                            .eq(InsOrderState::getLaboratory, laboratory)
                            .set(InsOrderState::getInsTime, now)
                            .set(InsOrderState::getInsState, 5)
                            .set(InsOrderState::getVerifyTell, tell)
                            .set(InsOrderState::getVerifyUser, userId));
@@ -1117,7 +1139,6 @@
        insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate()
                .eq(InsOrderState::getInsOrderId, orderId)
                .eq(InsOrderState::getLaboratory, laboratory)
                .set(InsOrderState::getInsTime, LocalDateTime.now())
                .set(InsOrderState::getInsState, 3)
                .set(InsOrderState::getVerifyUser, verifyUser));
        /*这个情况先关闭----如果是C类订单且是下发到质量部,则直接复核通过(结束试验)*/
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -63,6 +63,7 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】
        String[] models1 = insSample.getModel().split(";(?=[^;]*$)");//拆分最后一个【-】
        List<Integer> ids = Arrays.stream(insSample.getStandardMethodListId().split(","))
                .map(String::trim).map(Integer::parseInt).collect(Collectors.toList());
        List<StandardProductList> list = standardProductListMapper.selectDetail(ids, 1, models[0]);
@@ -102,9 +103,16 @@
                        } else {
                            if (sections.get(i).contains("&")) {
                                String[] split = sections.get(i).split("&");
                                isIf = getIsIf(split[0], models[1]) && getIsIf(split[1], models[1]);
                                isIf = getIsIf(split[0], models1[1]) && getIsIf(split[1], models[1].split(";")[0]);
                            } else {
                                isIf = getIsIf(sections.get(i), models[1]);
                                if (ObjectUtils.isNotEmpty(models[1].split(";")[0])){
                                    isIf = getIsIf(sections.get(i), models[1].split(";")[0]);
                                    if (!isIf) {
                                        isIf = getIsIf(sections.get(i), models1[1]);
                                    }
                                }else {
                                    isIf = getIsIf(sections.get(i), models1[1]);
                                }
                            }
                            if (isIf) {
                                a.setSection(sections.get(i));
@@ -133,9 +141,10 @@
    private boolean getIsIf(String str, String model) {
        Matcher matcher = Pattern.compile("\\d+(\\.\\d+)?").matcher(model);
        String model2 = "";
        while (matcher.find()) {
        if (matcher.find()) {
            model2 += matcher.group();
            break;
        }else {
            model2=model;
        }
        if (str.contains("≥") || str.contains(">=")) {
            String param = str.replace("≥", "").replace(">=", "");
@@ -151,7 +160,11 @@
            return new BigDecimal(model2).compareTo(new BigDecimal(param)) < 0;
        } else if (str.contains("=")) {
            String param = str.replace("=", "");
            return new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0;
            if (matcher.find()) {
                return new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0;
            }else {
                return model2.equals(param);
            }
        }
        return false;
    }
inspect-server/src/main/java/com/yuanchu/mom/vo/InsOrderPlanVO.java
@@ -32,13 +32,16 @@
    @ValueTableShow(value = 8,name = "检验开始时间")
    private String insTime;
    @ValueTableShow(value = 9,name = "检验结束时间")
    private String submitTime;
    @ValueTableShow(value = 6,name = "约定时间")
    private String appointed;
    @ValueTableShow(value = 7,name = "下发时间")
    private String sendTime;
    @ValueTableShow(value = 8,name = "理由")
    @ValueTableShow(value = 10,name = "理由")
    private String verifyTell;
inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -14,6 +14,7 @@
        <result property="appointed" column="appointed" jdbcType="TIMESTAMP"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="rule" column="rule" jdbcType="VARCHAR"/>
        <result property="otcCode" column="otc_code" jdbcType="VARCHAR"/>
        <result property="createUser" column="create_user" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -27,8 +27,18 @@
    <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO">
        select * from(select * from(
        SELECT
        a.*,ios.ins_state,ios.verify_tell,verify_user,ios.id
        orderStateId,ios.create_time,ios.sort,sort_time,version,ios.num-1 num1
        a.*,
        ios.ins_state,
        ios.verify_tell,
        verify_user,
        ios.id orderStateId,
        ios.create_time,
        (SELECT ins_time FROM ins_order_state WHERE ins_order_id = a.id AND laboratory = a.son_laboratory ORDER BY ins_time DESC LIMIT 1) AS ins_time ,
        iou.submit_time ,
        ios.sort,
        sort_time,
        version,
        ios.num-1 num1
        FROM
        (
        SELECT
@@ -41,7 +51,6 @@
        userName,
        checkName,
        ip.son_laboratory,
        io.ins_time,
        io.laboratory
        FROM
        ins_order io
@@ -74,6 +83,7 @@
        io.id
        ) a
        LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
        LEFT JOIN ins_order_user iou ON ios.id = iou.ins_order_state_id and ios.num=iou.num
        ORDER BY
        ios.sort,
        sort_time desc,
@@ -263,6 +273,8 @@
               ipr.com_value,
               ipr.equip_value,
               ipr.equip_name,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -331,6 +343,8 @@
               ipr.com_value,
               ipr.equip_value,
               ipr.equip_name,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -403,6 +417,8 @@
               ipr.ins_value,
               ipr.com_value,
               ipr.equip_value,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -475,6 +491,8 @@
               ipr.ins_value,
               ipr.com_value,
               ipr.equip_value,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -576,6 +594,8 @@
               ipr.com_value,
               ipr.equip_value,
               ipr.equip_name,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -642,6 +662,8 @@
               ipr.com_value,
               ipr.equip_value,
               ipr.equip_name,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -706,6 +728,8 @@
               ipr.com_value,
               ipr.equip_value,
               ipr.equip_name,
               ipr.before_check,
               ipr.after_check,
               ipr2.frequency,
               ipr2.often,
               ipr2.port,
@@ -840,6 +864,8 @@
        <result property="insValue" column="ins_value" jdbcType="VARCHAR"/>
        <result property="comValue" column="com_value" jdbcType="VARCHAR"/>
        <result property="equipValue" column="equip_value" jdbcType="VARCHAR"/>
        <result property="beforeCheck" column="before_check" jdbcType="VARCHAR"/>
        <result property="afterCheck" column="after_check" jdbcType="VARCHAR"/>
        <result property="equipName" column="equip_name" jdbcType="VARBINARY"/>
    </resultMap>
    <resultMap id="insProductResult2" type="com.yuanchu.mom.pojo.InsProductResult2">
@@ -918,7 +944,7 @@
        from ins_sample isa
                 left join ins_product ip on isa.id = ip.ins_sample_id
        where son_laboratory = '电路试验'
        and state=1
        and ins_order_id=#{insOrderId}
          and state = 1
          and ins_order_id = #{insOrderId}
    </select>
</mapper>