1.手动下单:修复选择样品后查询的检测项缺失问题
2.人员考勤:修复同步ICC考勤数据报错问题
| | |
| | | |
| | | StandardProductList getOne(@Param("standardMethodListId") Integer standardMethodListId, @Param("inspectionItem") String inspectionItem, @Param("sample") String sample, @Param("inspectionItemSubclass") String inspectionItemSubclass, @Param("model") String model, @Param("inspectionItemClass") String inspectionItemClass); |
| | | |
| | | List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model, @Param("isCableTag") String isCableTag); |
| | | List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model,@Param("tree") String tree, @Param("isCableTag") String isCableTag); |
| | | |
| | | List<StandardProductList> selectDetail2(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("tree") String tree, @Param("isCableTag") String isCableTag); |
| | | |
| | |
| | | // String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 |
| | | String model = insSample.getModel(); |
| | | String modelNum = insSample.getModelNum(); |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, model, insSample.getIsCableTag()); |
| | | if (list.size() == 0) { |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, model,insSample.getFactory(), insSample.getIsCableTag()); |
| | | if (list.isEmpty()) { |
| | | if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { |
| | | return null; |
| | | } |
| | |
| | | split[3] = split[3].replace("- ", ""); |
| | | String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree, insSample.getIsCableTag()); |
| | | if (list.size() == 0) { |
| | | if (list.isEmpty()) { |
| | | String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3]; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1, insSample.getIsCableTag()); |
| | | |
| | | // 只有对象的一层 |
| | | if (list.size() == 0) { |
| | | if (list.isEmpty()) { |
| | | String tree2 = split[0] + " - " + split[1] + " - " + split[2] + " - null - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree2, insSample.getIsCableTag()); |
| | | // 样品直接赋值样品分类 |
| | |
| | | } |
| | | } |
| | | String[] split1 = insSample.getFactory().split(" - "); |
| | | if(split1[3].equals("null")){ |
| | | split1[3] = ""; |
| | | } |
| | | if (!isNoSample) { |
| | | //判断长度 |
| | | if (split1.length > 4) { |
| | | if (ObjectUtils.isNotEmpty(split1[3])) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample()) && Objects.equals(list1.getSample(), split1[3])).collect(Collectors.toList()); |
| | | } else if (split1[3].equals("")) { |
| | | } else if (split1[3].isEmpty()) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType()) && Objects.equals(list1.getSampleType(), split1[2])).collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and state =#{state} |
| | | and model=#{model} |
| | | and tree=#{tree} |
| | | <if test="isCableTag != null and isCableTag != ''"> |
| | | and (inspection_item_class like concat('%结构尺寸%') or |
| | | inspection_item_class like concat('%电缆电性能%')or |
| | |
| | | public static String restorePersonCode(Object number) { |
| | | // 1. 空值校验 |
| | | if (number == null) { |
| | | throw new IllegalArgumentException("传入数字不能为空"); |
| | | return ""; |
| | | } |
| | | |
| | | String original = number.toString(); |
| | | try { |
| | | // 2. 统一转换为字符串并去除首尾空格 |
| | | String numStr = number.toString().trim(); |
| | | String numStr = original.trim(); |
| | | |
| | | // 3. 校验是否为纯数字(排除负数、非数字字符) |
| | | if (!numStr.matches("\\d+")) { |
| | | throw new IllegalArgumentException("传入的不是有效正整数:" + numStr); |
| | | } |
| | | String digitStr; |
| | | if (numStr.matches("\\d+")) { |
| | | digitStr = numStr; |
| | | } else if (numStr.matches("(?i)^ZT\\d+$")) { |
| | | digitStr = numStr.substring(2); |
| | | } else if (numStr.matches("(?i)^ZT-\\d+$")) { |
| | | digitStr = numStr.substring(3); |
| | | } else { |
| | | return original; |
| | | } |
| | | |
| | | // 4. 补前置0到指定长度(6位),超出则保留原数字 |
| | | String paddedNum = String.format("%0" + DIGIT_LENGTH + "d", Long.parseLong(numStr)); |
| | | String paddedNum = StringUtils.leftPad(digitStr, DIGIT_LENGTH, '0'); |
| | | |
| | | // 5. 拼接前缀返回 |
| | | return PREFIX + paddedNum; |
| | | return PREFIX + paddedNum; |
| | | } catch (Exception e) { |
| | | return original; |
| | | } |
| | | } |
| | | |
| | | } |