value
2024-06-19 461fb02ec8264079f73fd2b6f937ad4f40754cb9
Merge remote-tracking branch 'origin/master'

# Conflicts:
# inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
已修改10个文件
179 ■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardProductListMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsOrder.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/pojo/Evaluate.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/EvaluateService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardProductListMapper.java
@@ -3,6 +3,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanchu.mom.pojo.StandardProductList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Administrator
@@ -15,6 +18,10 @@
    IPage<StandardProductList> standardProductListIPage(Integer id, String tree, IPage<StandardProductList> iPage, String laboratory, String item, String items);
    StandardProductList getOne(Integer standardMethodListId, String inspectionItem, String sample, String inspectionItemSubclass, String model);
    List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model);
    List<StandardProductList> selectDetail2(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("tree") String tree);
}
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsOrder.java
@@ -203,4 +203,7 @@
    private Long companyId;
    @ValueTableShow(value = 15, name = "制单人")
    private String prepareUser;
}
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -787,7 +787,8 @@
            } catch (Exception e) {
                throw new ErrorException("找不到检验人的签名");
            }
            Custom custom = customMapper.selectById(user.get("company"));
            //Custom custom = customMapper.selectById(user.get("company"));
            Custom custom = customMapper.selectById(insOrder.getCompanyId());
            if (!resultCh.get().equals("")) {
                resultCh.set("依据委托要求," + resultCh.get().replaceFirst("、", "") + "等所检项目不符合要求,其余所检项目均符合要求。");
                resultEn.set("According to commissioned requirements," + resultEn.get().replaceFirst("、", "") + " these inspected items do not meet the requirements, all other inspected items meet the requirements.");
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -78,9 +78,9 @@
                    List<String> prices = JSON.parseArray(a.getPrice(), String.class);
                    boolean isIf;
                    for (int i = 0; i < sections.size(); i++) {
                        if(Objects.equals(a.getBsm(), "1")){
                        if (Objects.equals(a.getBsm(), "1")) {
                            return true;
                        }else{
                        } else {
                            if (sections.get(i).contains("&")) {
                                String[] split = sections.get(i).split("&");
                                isIf = getIsIf(split[0], models[1]) && getIsIf(split[1], models[1]);
@@ -107,7 +107,7 @@
        return list;
    }
    private boolean getIsIf(String str, String model){
    private boolean getIsIf(String str, String model) {
        Matcher matcher = Pattern.compile("\\d+(\\.\\d+)?").matcher(model);
        String model2 = "";
        while (matcher.find()) {
@@ -119,10 +119,10 @@
        } else if (str.contains("≤") || str.contains("<=")) {
            String param = str.replace("≤", "").replace("<=", "");
            return new BigDecimal(model2).compareTo(new BigDecimal(param)) < 1;
        } else if (str.contains(">")||str.contains(">")) {
        } else if (str.contains(">") || str.contains(">")) {
            String param = str.replace(">", "").replace(">", "");
            return new BigDecimal(model2).compareTo(new BigDecimal(param)) > 0;
        } else if (str.contains("<")||str.contains("<")) {
        } else if (str.contains("<") || str.contains("<")) {
            String param = str.replace("<", "").replace("<", "");
            return new BigDecimal(model2).compareTo(new BigDecimal(param)) < 0;
        } else if (str.contains("=")) {
@@ -175,7 +175,7 @@
        for (StandardProductList sp : standardProductLists) {
            for (StandardProductList pl : list) {
                if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem())
                        && Objects.equals((sp.getInspectionItemSubclass() == null)? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass())
                        && Objects.equals((sp.getInspectionItemSubclass() == null) ? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass())
                        && Objects.equals(sp.getModel(), pl.getModel())
                        && Objects.equals(sp.getStructureItemParameterId(), pl.getStructureItemParameterId())) {
                    pl.setId(sp.getId());
@@ -203,7 +203,7 @@
                    if (sp.getTemplateId() != null && !sp.getTemplateId().equals("")) {
                        pl.setTemplateId(sp.getTemplateId());
                    }
                    if(sp.getTree() != null && !sp.getTree().equals("")){
                    if (sp.getTree() != null && !sp.getTree().equals("")) {
                        pl.setTree(sp.getTree());
                    }
                    break;
@@ -213,9 +213,9 @@
        if (page == 1) {
            Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
            CompletableFuture.supplyAsync(() -> {
                if(trees.length == 5){
                if (trees.length == 5) {
                    standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree));
                }else{
                } else {
                    standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree));
                }
                standardProductListService2.saveBatch(list.stream().map(a -> {
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml
@@ -60,4 +60,20 @@
            and model = #{model}
        </if>
    </select>
    <select id="selectDetail" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select * from standard_product_list
        where standard_method_list_id = #{standardMethodListId}
        and state =#{state}
        and model=#{model}
        order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED),
                 man_hour_group REGEXP '^[0-9]', id asc
    </select>
    <select id="selectDetail2" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select * from standard_product_list
        where standard_method_list_id = #{standardMethodListId}
          and state =#{state}
          and tree=#{tree}
        order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED),
                 man_hour_group REGEXP '^[0-9]', id asc
    </select>
</mapper>
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -3,7 +3,6 @@
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.StandardTreeMapper">
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.StandardTree">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="factory" column="factory" jdbcType="VARCHAR"/>
@@ -47,10 +46,10 @@
    </resultMap>
    <select id="selectStandardTreeList" resultMap="FactoryDto">
        select '中天科技检测中心' factory,
               l.laboratory_name  laboratory,
               sto.specimen_name  sample_type,
               p.name             sample,
        select '中天科技检测中心'        factory,
               l.laboratory_name laboratory,
               sto.specimen_name sample_type,
               p.name            sample,
               st.model,
               sto.code
        from laboratory l
@@ -58,7 +57,7 @@
                 left join product p on p.object_id = sto.id
                 left join standard_tree st on st.sample_type = sto.specimen_name
            and st.sample = p.name
        order by l.id,CAST(sto.code AS DECIMAL),p.id,ISNULL(st.id),st.id
        order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id
    </select>
    <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList">
@@ -117,10 +116,10 @@
        </if>
    </select>
    <select id="selectStandardTreeList2" resultType="com.yuanchu.mom.pojo.StandardTree">
        select '中天科技检测中心' factory,
               l.laboratory_name  laboratory,
               sto.specimen_name  sample_type,
               p.name             sample
        select '中天科技检测中心'        factory,
               l.laboratory_name laboratory,
               sto.specimen_name sample_type,
               p.name            sample
        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
@@ -131,7 +130,7 @@
        group by sto.specimen_name
    </select>
    <select id="selectStandardProductListByTree" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select sample sample2,
        select sample    sample2,
               inspection_item,
               inspection_item_en,
               inspection_item_subclass,
@@ -141,7 +140,7 @@
               method,
               son_laboratory,
               unit,
               ask_tell tell,
               ask_tell  tell,
               ask,
               price,
               man_hour,
@@ -155,11 +154,11 @@
               checkout_number,
               section,
               dic,
               0 state,
               #{model} model,
               0         state,
               #{model}  model,
               #{sample} sample,
               #{trees} tree,
               id structure_item_parameter_id
               #{trees}  tree,
               id        structure_item_parameter_id
        from structure_item_parameter
        where (
                      sample is NULL
@@ -167,10 +166,12 @@
                      or sample = '[]'
                      OR sample LIKE CONCAT('%[', #{tree}, ']%')
                  )
        order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED),
                 man_hour_group REGEXP '^[0-9]', id asc
    </select>
    <select id="selectStandardProductListByTree2" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select sample sample2,
        select sample    sample2,
               inspection_item,
               inspection_item_en,
               inspection_item_subclass,
@@ -180,7 +181,7 @@
               method,
               son_laboratory,
               unit,
               ask_tell tell,
               ask_tell  tell,
               ask,
               price,
               man_hour,
@@ -194,13 +195,15 @@
               checkout_number,
               section,
               dic,
               0 state,
               #{model} model,
               0         state,
               #{model}  model,
               #{sample} sample,
               #{trees} tree,
               id structure_item_parameter_id
               #{trees}  tree,
               id        structure_item_parameter_id
        from structure_item_parameter
        where sample LIKE CONCAT('%[', #{tree}, ']%')
        order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED),
                 man_hour_group REGEXP '^[0-9]', id asc
    </select>
    <select id="getStandardTree2" resultMap="SampleTypeDto">
@@ -213,7 +216,7 @@
            and st.sample = p.name
    </select>
    <select id="selectStandardProductListByTree3" resultType="com.yuanchu.mom.pojo.StandardProductList">
        select sample sample2,
        select sample    sample2,
               inspection_item,
               inspection_item_en,
               inspection_item_subclass,
@@ -223,7 +226,7 @@
               method,
               son_laboratory,
               unit,
               ask_tell tell,
               ask_tell  tell,
               ask,
               price,
               man_hour,
@@ -237,11 +240,11 @@
               checkout_number,
               section,
               dic,
               0 state,
               #{model} model,
               0         state,
               #{model}  model,
               #{sample} sample,
               #{trees} tree,
               id structure_item_parameter_id
               #{trees}  tree,
               id        structure_item_parameter_id
        from structure_item_parameter
        where (
                      sample is NULL
@@ -249,18 +252,20 @@
                      or sample = '[]'
                      OR sample LIKE CONCAT('%', #{tree}, '%')
                  )
        order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED),
                 man_hour_group REGEXP '^[0-9]', id asc
    </select>
    <select id="getStandardTree3" resultType="com.yuanchu.mom.dto.SampleDto">
        select model label,
               model value
        from standard_tree
        where sample_type = #{sampleType}
        and sample is null
          and sample is null
    </select>
    <select id="getLaboratory" resultType="java.lang.String">
        select l.laboratory_name
        from structure_test_object sto
        left join laboratory l on sto.laboratory_id = l.id
                 left join laboratory l on sto.laboratory_id = l.id
        where sto.specimen_name = #{str}
    </select>
    <select id="getStructureItemParameterId" resultType="java.lang.Integer">
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateController.java
@@ -1,8 +1,21 @@
package com.yuanchu.mom.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.pojo.AuxiliaryWorkingHours;
import com.yuanchu.mom.pojo.Evaluate;
import com.yuanchu.mom.service.EvaluateService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
 * <p>
@@ -17,4 +30,17 @@
@RequestMapping("/evaluate")
public class EvaluateController {
    @Resource
    private EvaluateService evaluateService;
    @ValueClassify("人员考评")
    @ApiOperation(value="考评分页查询")
    @PostMapping("/page")
    public Result page(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        Evaluate entity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Evaluate.class);
        return Result.success(evaluateService.getPage(page,entity));
    }
}
performance-server/src/main/java/com/yuanchu/mom/pojo/Evaluate.java
@@ -1,9 +1,11 @@
package com.yuanchu.mom.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.yuanchu.mom.annotation.ValueTableShow;
import com.yuanchu.mom.common.OrderBy;
@@ -61,4 +63,16 @@
    @ApiModelProperty("月份")
    private String month;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
}
performance-server/src/main/java/com/yuanchu/mom/service/EvaluateService.java
@@ -1,7 +1,10 @@
package com.yuanchu.mom.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.Evaluate;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
/**
 * <p>
@@ -13,4 +16,5 @@
 */
public interface EvaluateService extends IService<Evaluate> {
    Map<String,Object> getPage(Page page, Evaluate entity);
}
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateServiceImpl.java
@@ -1,10 +1,18 @@
package com.yuanchu.mom.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.common.GetLook;
import com.yuanchu.mom.common.PrintChina;
import com.yuanchu.mom.pojo.Evaluate;
import com.yuanchu.mom.mapper.EvaluateMapper;
import com.yuanchu.mom.service.EvaluateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.utils.QueryWrappers;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
 * <p>
@@ -17,4 +25,19 @@
@Service
public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService {
    @Resource
    EvaluateMapper evaluateMapper;
    @Resource
    GetLook getLook;
    @Override
    public Map<String, Object> getPage(Page page, Evaluate evaluate) {
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(Evaluate.class));
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("getPage");
        if(map1.get("look")==1) evaluate.setCreateUser(map1.get("userId"));
        //map.put("body", evaluateMapper.getPage(page, QueryWrappers.queryWrappers(evaluate)));
        return map;
    }
}