zss
2024-06-19 02e13964dd95077c5f515156bc0da5187f5c8cf3
工时分组排序+制单人字段
已修改10个文件
116 ■■■■■ 文件已修改
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 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | 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
@@ -788,7 +788,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
@@ -56,16 +56,23 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        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<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]);
       /* List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery()
                .eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId())
                .eq(StandardProductList::getState, 1)
                .eq(StandardProductList::getModel, models[0])
                .apply("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 "));*/
        if (list.size() == 0) {
            if(Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null){
                return null;
            }
            String[] split = insSample.getFactory().split(" - ");
            list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery()
            list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]);
            /*list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery()
                    .eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId())
                    .eq(StandardProductList::getState, 1)
                    .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]));
                    .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3])
                    .apply("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 "));*/
        }
        list = list.stream().filter(a -> {
            try {
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml
@@ -57,4 +57,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"/>
@@ -167,6 +166,8 @@
                      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">
@@ -201,6 +202,8 @@
               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">
@@ -249,6 +252,8 @@
                      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,
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;
    }
}