Merge remote-tracking branch 'origin/master'
# Conflicts:
# inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
| | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private Long companyId; |
| | | |
| | | @ValueTableShow(value = 15, name = "制单人") |
| | | private String prepareUser; |
| | | |
| | | } |
| | |
| | | } 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."); |
| | |
| | | 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]); |
| | |
| | | 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()) { |
| | |
| | | } 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("=")) { |
| | |
| | | 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()); |
| | |
| | | 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; |
| | |
| | | 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 -> { |
| | |
| | | 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> |
| | |
| | | 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"/> |
| | |
| | | </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 |
| | |
| | | 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"> |
| | |
| | | </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 |
| | |
| | | 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, |
| | |
| | | method, |
| | | son_laboratory, |
| | | unit, |
| | | ask_tell tell, |
| | | ask_tell tell, |
| | | ask, |
| | | price, |
| | | man_hour, |
| | |
| | | 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 |
| | |
| | | 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, |
| | |
| | | method, |
| | | son_laboratory, |
| | | unit, |
| | | ask_tell tell, |
| | | ask_tell tell, |
| | | ask, |
| | | price, |
| | | man_hour, |
| | |
| | | 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"> |
| | |
| | | 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, |
| | |
| | | method, |
| | | son_laboratory, |
| | | unit, |
| | | ask_tell tell, |
| | | ask_tell tell, |
| | | ask, |
| | | price, |
| | | man_hour, |
| | |
| | | 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 |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | @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)); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @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; |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface EvaluateService extends IService<Evaluate> { |
| | | |
| | | Map<String,Object> getPage(Page page, Evaluate entity); |
| | | } |
| | |
| | | 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> |
| | |
| | | @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; |
| | | } |
| | | } |