inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -309,6 +309,8 @@ //先查出这个样品下有哪些管色标,光纤带,光纤色标 //先查出套管 List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); if (insBushings.size()>0) { //通信--温度循环 for (InsBushing insBushing : insBushings) { //再查询出所有的光纤带 List<InsFibers> insFibers = insFibersMapper.selectList(Wrappers.<InsFibers>lambdaQuery().eq(InsFibers::getInsBushingId, insBushing.getId())); @@ -358,6 +360,22 @@ productVos.add(productVo); } } } } } else { //电力--热循环 List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() .eq(InsProduct::getInsSampleId, sampleId) .eq(InsProduct::getInspectionItem, inspectionItem)); for (InsProduct insProduct : insProducts) { InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); ProductVo productVo = new ProductVo(); if (ObjectUtils.isNotEmpty(insProductResult)) { insProduct.setInsProductResult(insProductResult); } productVo.setInsProduct(insProduct); productVos.add(productVo); } } map.put("productVos", productVos); @@ -1584,6 +1602,9 @@ try { signatureUrl = userMapper.selectById(userId).getSignatureUrl(); } catch (Exception e) { throw new ErrorException("找不到检验人的签名"); } if (signatureUrl.equals("")) { throw new ErrorException("找不到检验人的签名"); } //Custom custom = customMapper.selectById(user.get("company")); @@ -3330,7 +3351,26 @@ product.setInsResult(1); } insProductMapper.updateById(product); } else { } //如果是热循环或者是温升试验 else if (product.getInspectionItem().equals("热循环") || product.getInspectionItem().equals("温升试验")){ //查询这些项目下的其他检验项目是否全部检验 List<InsProduct> insProductList = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() .eq(InsProduct::getInsSampleId, product.getInsSampleId()) .like(InsProduct::getInspectionItemSubclass, "温度")); List<Integer> collect = insProductList.stream().filter(insProduct -> insProduct.getInsResult() != null).map(InsProduct::getInsResult).collect(Collectors.toList()); List<Integer> tt = new ArrayList<>(); tt.add(1); if (collect.contains(0)) { product.setLastValue("不合格"); product.setInsResult(0); } else if (collect.size() == insProductList.size() && collect.stream().distinct().collect(Collectors.toList()).containsAll(tt)) { product.setLastValue("合格"); product.setInsResult(1); } insProductMapper.updateById(product); } else { count++; str += "<br/>" + count + ":" + product.getInspectionItem() + " " + product.getInspectionItemSubclass() + "<br/>"; } @@ -3391,7 +3431,7 @@ calendar.setTime(date); int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); int day = calendar.get(Calendar.DAY_OF_MONTH); return day + " " + getWeekDay(dayOfWeek); return getWeekDay(dayOfWeek); } catch (Exception e) { e.printStackTrace(); } inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -318,7 +318,67 @@ } } insProductService.saveBatch(insProductes); } else { } //判断热循环项目的添加和温升试验项目的添加 else if (product.getInspectionItem().equals("热循环") || product.getInspectionItem().equals("温升试验")) { List<InsProduct> insProductess = new ArrayList<>(); insProductess.add(product); List<InsProduct> insProductes = new ArrayList<>(); List<InsProduct> insProducts = new ArrayList<>(); String[] strings = product.getAsk().split(";"); //循环次数 int count = Integer.parseInt(strings[strings.length - 1]); for (int i = 0; i < strings.length - 1; i++) { String[] split = strings[i].split(","); InsProduct insProduct = new InsProduct(); insProduct.setInspectionItem("1");//检验父项--循环次数 insProduct.setInspectionItemSubclass(split[0]);//检验子项--环境温度/导线温度/耐张温度/接续温度 insProduct.setInspectionItemSubclassEn(split[1]);//检验子项英文--环境温度/导线温度/耐张温度/接续温度 insProduct.setAsk(null);//检验要求 insProduct.setTell(null);//检验描述 insProduct.setInsSampleId(sampleId); insProduct.setState(1); insProduct.setFactory(product.getFactory()); insProduct.setLaboratory(product.getLaboratory()); insProduct.setSampleType(product.getSampleType()); insProduct.setSample(product.getSample()); insProduct.setModel(product.getModel()); insProduct.setSonLaboratory(product.getSonLaboratory()); insProduct.setUnit("℃");//单位 insProduct.setManHourGroup(product.getManHourGroup()); insProduct.setInspectionItemType("0"); insProduct.setInspectionValueType("1"); insProducts.add(insProduct); insProductes.add(insProduct); insProductess.add(insProduct); } //热循环才有多次循环次数 if (product.getInspectionItem().equals("热循环")) { //热循环还要加上直流电阻 for (InsProduct insProduct : insProducts) { InsProduct insProduct1 = new InsProduct(); BeanUtils.copyProperties(insProduct, insProduct1); insProduct1.setInspectionItemClass("直流电阻");//检验子子项--直流电阻 insProduct1.setInspectionItemClassEn("DC resistance");//检验子子项英文--直流电阻 insProduct1.setUnit("Ω/km");//单位 insProductes.add(insProduct1); insProductess.add(insProduct1); } } if (count > 1) { //循环超过1次 for (int j = 2; j <= count; j++) { for (InsProduct insProduct : insProductes) { InsProduct insProduct1 = new InsProduct(); BeanUtils.copyProperties(insProduct, insProduct1); insProduct1.setInspectionItem(j + "");//循环次数 insProductess.add(insProduct1); } } } insProductService.saveBatch(insProductess); } else { if (!is) { switch (type) { case 1: inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.common.GetLook; import com.yuanchu.mom.dto.ProductDto; import com.yuanchu.mom.exception.ErrorException; import com.yuanchu.mom.mapper.StandardProductListMapper; import com.yuanchu.mom.mapper.StandardTreeMapper; import com.yuanchu.mom.pojo.InsSample; @@ -49,144 +48,8 @@ @Override public int upStandardProductList(StandardProductList list) { String section = list.getSection(); String a = section; if (a != null) { section = interval(section); list.setSection(section); } else { list.setSection(null); } return standardProductListMapper.updateById(list); } private String interval(String section) { section = section.replace("\"", ""); section = section.replace("[", ""); section = section.replace("]", ""); String[] split = section.split(","); int[] start1 = new int[20]; int[] start2 = new int[20]; int[] end1 = new int[20]; int[] end2 = new int[20]; int y = 0; for (String str : split) { String[] conditions = str.split("&"); for (int i = 0; i < conditions.length; i++) { if (conditions[i].contains("<=")) { end2[y] = Integer.parseInt(conditions[i].replace("<=", "")); y++; } else if (conditions[i].contains("<")) { end1[y] = Integer.parseInt(conditions[i].replace("<", "")); y++; } if (conditions[i].contains(">=")) { start2[y] = Integer.parseInt(conditions[i].replace(">=", "")); y++; } else if (conditions[i].contains(">")) { start1[y] = Integer.parseInt(conditions[i].replace(">", "")); y++; } } } Set<Integer> start = new TreeSet<>(); for ( int value : start1) { start.add(value); } for ( int value : start2) { start.add(value); } Set<Integer> end = new TreeSet<>(); for ( int value : end1) { end.add(value); } for ( int value : end2) { end.add(value); } section = ""; ArrayList<Integer> ab = new ArrayList<>(); for (Integer integer : end) { if (integer != 0) { ab.add(integer); } } ArrayList<Integer> ac = new ArrayList<>(); for (Integer integer : start) { if (integer != 0) { ac.add(integer); } } if (!ab.isEmpty() && !ac.isEmpty()) { int min = Collections.min(ab); int max = Collections.max(ac); if (min <= max) { throw new ErrorException("区间错误"); } int minValue = 0; int maxValue = 0; for (int i = 1; i < end2.length; i++) { if (end2[i] < minValue) { minValue = end2[i]; } } for (int i = 1; i < start2.length; i++) { if (start2[i] > maxValue) { maxValue = start2[i]; } } if (min == minValue && max == maxValue) { section = ("[" + "\"" + ">" + "=" + max + "&" + "<" + "=" + min + "\"" + "]"); } if (min != minValue && max == maxValue) { section = ("[" + "\"" + ">" + "=" + max + "&" + "<" + min + "\"" + "]"); } if (min == minValue && max != maxValue) { section = ("[" + "\"" + ">" + max + "&" + "<" + "=" + min + "\"" + "]"); } if (min != minValue && max != maxValue) { section = ("[" + "\"" + ">" + max + "&" + "<" + min + "\"" + "]"); } } if (ab.isEmpty() && !ac.isEmpty()) { int max = Collections.max(ac); int maxValue = 0; for (int i = 1; i < start2.length; i++) { if (start2[i] > maxValue) { maxValue = start2[i]; } } if (max == maxValue) { section = ("[" + "\"" + ">" + "=" + max + "\"" + "]"); } if (max != maxValue) { section = ("[" + "\"" + ">" + max + "\"" + "]"); } } if (!ab.isEmpty() && ac.isEmpty()) { int min = Collections.min(ab); int minValue = 0; for (int i = 1; i < end2.length; i++) { if (end2[i] < minValue) { minValue = end2[i]; } } if (min == minValue) { section = ("[" + "\"" + "<" + "=" + min + "\"" + "]"); } if (min != minValue) { section = ("[" + "\"" + "<" + min + "\"" + "]"); } } return section; } @Override public int delStandardProduct (JSONArray list){ @@ -196,13 +59,7 @@ @Override public List<StandardProductList> selectStandardProductList (InsSample insSample){ String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 List<StandardProductList> list = new ArrayList<>(); if (models.length==1) { list=standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); } if (models.length==2) { list=standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]+"-"+models[1]); } List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); if (list.size() == 0) { if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { return null; @@ -228,8 +85,8 @@ if (Objects.equals(a.getBsm(), "1")) { return true; } else { if (sections.get(i).contains("@")) { String[] split = sections.get(i).split("@"); if (sections.get(i).contains("&")) { String[] split = sections.get(i).split("&"); isIf = getIsIf(split[0], models[1]) && getIsIf(split[1], models[1]); } else { isIf = getIsIf(sections.get(i), models[1]); @@ -379,6 +236,7 @@ if (page == 1) { Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); CompletableFuture.supplyAsync(() -> { System.out.println("开始开始开始开始!!!!!!!!!!"); if (trees.length == 5) { standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree)); } else { @@ -393,6 +251,7 @@ a.setStandardMethodListId(id); return a; }).collect(Collectors.toList())); System.out.println("结束结束结束结束@@@@@@@@@@@@"); return null; }).thenAccept(res -> { }).exceptionally(e -> { @@ -439,8 +298,7 @@ } @Override public IPage<StandardProductList> selectStandardProductByMethodId (Integer id, String tree, Integer page, String laboratory, String item, String items){ public IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { IPage<StandardProductList> iPage = new Page<>(); iPage.setSize(100); iPage.setCurrent(page); inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -151,7 +151,7 @@ c.price, c.cost, c.inspection_item, u.company, cus.company, u.`name`, i.create_user, c.ins_sample_id @@ -159,6 +159,7 @@ ins_order i LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id LEFT JOIN `user` u ON u.id = i.user_id left join custom cus on cus.id = u.company LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item2 SEPARATOR ',') inspection_item from (select *,GROUP_CONCAT(inspection_item performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryCorrectionHours.java
@@ -41,157 +41,157 @@ @ExcelProperty(value = "类型") private String type; @ApiModelProperty("1日工时") @ApiModelProperty("1日") @ValueTableShow(4) @ExcelProperty(value = "1日") private Double oneHours; @ApiModelProperty("2日工时") @ApiModelProperty("2日") @ValueTableShow(5) @ExcelProperty(value = "2日") private Double twoHours; @ApiModelProperty("3日工时") @ApiModelProperty("3日") @ValueTableShow(6) @ExcelProperty(value = "3日") private Double threeHours; @ApiModelProperty("4日工时") @ApiModelProperty("4日") @ValueTableShow(7) @ExcelProperty(value = "4日") private Double fourHours; @ApiModelProperty("5日工时") @ApiModelProperty("5日") @ValueTableShow(8) @ExcelProperty(value = "5日") private Double fiveHours; @ApiModelProperty("6日工时") @ApiModelProperty("6日") @ValueTableShow(9) @ExcelProperty(value = "6日") private Double sixHours; @ApiModelProperty("7日工时") @ApiModelProperty("7日") @ValueTableShow(10) @ExcelProperty(value = "7日") private Double sevenHours; @ApiModelProperty("8日工时") @ApiModelProperty("8日") @ValueTableShow(11) @ExcelProperty(value = "8日") private Double eightHours; @ApiModelProperty("9日工时") @ApiModelProperty("9日") @ValueTableShow(12) @ExcelProperty(value = "9日") private Double nineHours; @ApiModelProperty("10日工时") @ApiModelProperty("10日") @ValueTableShow(13) @ExcelProperty(value = "10日") private Double tenHours; @ApiModelProperty("11日工时") @ApiModelProperty("11日") @ValueTableShow(14) @ExcelProperty(value = "11日") private Double elevenHours; @ApiModelProperty("12日工时") @ApiModelProperty("12日") @ValueTableShow(15) @ExcelProperty(value = "12日") private Double twelveHours; @ApiModelProperty("13日工时") @ApiModelProperty("13日") @ValueTableShow(16) @ExcelProperty(value = "13日") private Double thirteenHours; @ApiModelProperty("14日工时") @ApiModelProperty("14日") @ValueTableShow(17) @ExcelProperty(value = "14日") private Double fourteenHours; @ApiModelProperty("15日工时") @ApiModelProperty("15日") @ValueTableShow(18) @ExcelProperty(value = "15日") private Double fifteenHours; @ApiModelProperty("16日工时") @ApiModelProperty("16日") @ValueTableShow(19) @ExcelProperty(value = "16日") private Double sixteenHours; @ApiModelProperty("17日工时") @ApiModelProperty("17日") @ValueTableShow(20) @ExcelProperty(value = "17日") private Double seventeenHours; @ApiModelProperty("18日工时") @ApiModelProperty("18日") @ValueTableShow(21) @ExcelProperty(value = "18日") private Double eighteenHours; @ApiModelProperty("19日工时") @ApiModelProperty("19日") @ValueTableShow(22) @ExcelProperty(value = "19日") private Double nineteenHours; @ApiModelProperty("20日工时") @ApiModelProperty("20日") @ValueTableShow(23) @ExcelProperty(value = "20日") private Double twentyHours; @ApiModelProperty("21日工时") @ApiModelProperty("21日") @ValueTableShow(24) @ExcelProperty(value = "21日") private Double twentyOneHours; @ApiModelProperty("22日工时") @ApiModelProperty("22日") @ValueTableShow(25) @ExcelProperty(value = "22日") private Double twentyTwoHours; @ApiModelProperty("23日工时") @ApiModelProperty("23日") @ValueTableShow(26) @ExcelProperty(value = "23日") private Double twentyThreeHours; @ApiModelProperty("24日工时") @ApiModelProperty("24日") @ValueTableShow(27) @ExcelProperty(value = "24日") private Double twentyFourHours; @ApiModelProperty("25日工时") @ApiModelProperty("25日") @ValueTableShow(28) @ExcelProperty(value = "25日") private Double twentyFiveHours; @ApiModelProperty("26日工时") @ApiModelProperty("26日") @ValueTableShow(29) @ExcelProperty(value = "26日") private Double twentySixHours; @ApiModelProperty("27日工时") @ApiModelProperty("27日") @ValueTableShow(30) @ExcelProperty(value = "27日") private Double twentySevenHours; @ApiModelProperty("28日工时") @ApiModelProperty("28日") @ValueTableShow(31) @ExcelProperty(value = "28日") private Double twentyEightHours; @ApiModelProperty("29日工时") @ApiModelProperty("29日") @ValueTableShow(32) @ExcelProperty(value = "29日") private Double twentyNineHours; @ApiModelProperty("30日工时") @ApiModelProperty("30日") @ValueTableShow(33) @ExcelProperty(value = "30日") private Double thirtyHours; @ApiModelProperty("31日工时") @ApiModelProperty("31日") @ValueTableShow(34) @ExcelProperty(value = "31日") private Double thirtyOneHours; performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java
@@ -133,7 +133,7 @@ auxiliaryOriginalHoursDtos.add(getData(objectMap, "总工时")); } } //如果产量工时为空 //如果輔助工时不为空 else if (ObjectUtils.isNotEmpty(maps1)) { for (Map<String, Object> objectMap : maps1) { auxiliaryOriginalHoursDtos.add(getData(objectMap, "总工时")); performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
@@ -82,7 +82,8 @@ } else { //管理员(不添加限制条件所有人都可以看) } } else { } else { //是组长 //查询组长下的组员 List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getDepartLimsId, user.getDepartLimsId())); performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java
@@ -118,7 +118,7 @@ //根据填写的编号查询辅助工时配置 AuxiliaryWorkingHours auxiliaryWorkingHours = auxiliaryWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryWorkingHours>lambdaQuery().eq(AuxiliaryWorkingHours::getNumber, number)); if (ObjectUtils.isEmpty(auxiliaryWorkingHours)) { throw new ErrorException("不存在此辅助配置"); throw new ErrorException("该编号没有对应的辅助工时配置"); } AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay = new AuxiliaryWorkingHoursDay(); BeanUtils.copyProperties(auxiliaryWorkingHours, auxiliaryWorkingHoursDay); performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml
@@ -6,7 +6,7 @@ from (select C.name, C.month, C.manHours + D.manHours as total from (select A.name, A.month, sum(A.manHour) as manHours FORMAT(SUM(manHour), 2) as manHours from ( select user.name, case @@ -35,7 +35,7 @@ from ( select user.name, date_time as month, sum(output_work_time) as manHours FORMAT(SUM(output_work_time), 2) as manHours from auxiliary_output_working_hours aowh left join user on user.id = aowh.`check` left join department_lims dl on depart_lims_id = dl.id performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
@@ -35,7 +35,7 @@ output_work_time, date_time, week, week_day, SUBSTRING(week_day, 2) AS week_day, name FROM auxiliary_output_working_hours aowh left join user on user.id=aowh.`check` @@ -70,7 +70,7 @@ from( select user.name, date_time as month, sum(output_work_time) as manHours FORMAT(SUM(output_work_time), 2) as manHours from auxiliary_output_working_hours aowh left join user on user.id=aowh.`check` left join department_lims dl on depart_lims_id=dl.id performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -69,7 +69,7 @@ <select id="totalHours" resultType="java.util.Map"> select A.name, A.month, sum(A.manHour)as manHours FORMAT(SUM(manHour), 2)as manHours from( select user.name, case when reviewer_nonproductive_time is null then nonproductive_time