| | |
| | | String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); |
| | | int num; |
| | | if (tableName.equals("ins_order")) { |
| | | num = systemLogMapper.countRowsByNow2(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | } else { |
| | | num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | } |
| | | num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | String nums = num + ""; |
| | | if (nums.length() == 1) nums = "00" + num; |
| | | else if (nums.length() == 2) nums = "0" + num; |
| | |
| | | } |
| | | |
| | | //检验单委托单号的生成规则 |
| | | public String giveCode2(String code, Long companyId, String laboratory, String tableName, String symbol, String patten) { |
| | | public String giveCode2(String code, String tableName, String symbol, String patten) { |
| | | String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); |
| | | int num; |
| | | num = systemLogMapper.countRowsByNow3(tableName, companyId, laboratory, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | num = systemLogMapper.countRowsByNow2(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | String nums = num + ""; |
| | | if (nums.length() == 1) nums = "00" + num; |
| | | else if (nums.length() == 2) nums = "0" + num; |
| | | return code + (date2 == null ? date : date2) + symbol + nums; |
| | | } |
| | | |
| | | //检验单生成外部委托编号的规则 |
| | | public String giveCode3(String code, Long companyId, String laboratory, String tableName, String symbol, String patten) { |
| | | String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); |
| | | int num; |
| | | num = systemLogMapper.countRowsByNow4(tableName, companyId, laboratory, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"))) + 1; |
| | | String nums = num + ""; |
| | | if (nums.length() == 1) nums = "0000" + num; |
| | | else if (nums.length() == 2) nums = "000" + num; |
| | | else if (nums.length() == 3) nums = "00" + num; |
| | | else if (nums.length() == 4) nums = "0" + num; |
| | | return code + (date2 == null ? date : date2) + symbol + nums; |
| | | } |
| | | |
| | | } |
| | |
| | | List<StandardProductList> selectDetail(@Param("ids") List<Integer> ids, @Param("state") int state, @Param("model") String model); |
| | | |
| | | List<StandardProductList> selectDetail2(@Param("ids") List<Integer> ids, @Param("state") int state, @Param("tree") String tree); |
| | | |
| | | String selectStandardMethodById(Integer standardMethodListId); |
| | | } |
| | | |
| | | |
| | |
| | | insOrder.setCompanyId(one.getId()); |
| | | code = one.getCode2(); |
| | | } |
| | | //实验室编号 |
| | | String code2 = baseMapper.selLaboratoryCode(insOrder.getLaboratory()); |
| | | if (StringUtils.isEmpty(code2)) { |
| | | code2 = ""; |
| | | } |
| | | //外部委托编号 |
| | | insOrder.setOutEntrustCode(giveCode.giveCode3("ZT/" + code2 + "-" + code + "-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMM")); |
| | | insOrder.setOutEntrustCode(giveCode.giveCode("WT-", "ins_order", "-", "yyMMdd")); |
| | | String giveCode = this.giveCode.giveCode("JCZX-" + code + "-", "ins_sample", "", "yyMMdd"); |
| | | insOrderMapper.insert(insOrder); |
| | | AtomicInteger count = new AtomicInteger(); |
| | |
| | | a.setInsOrderId(insOrder.getId()); |
| | | //样品编号 |
| | | if (StrUtil.isEmpty(a.getSampleCode())) { |
| | | a.setSampleCode("TX(WYQJ)-" + giveCode.split("-")[2] + "-" + count.get()); |
| | | a.setSampleCode("YP-" + a.getModel()+"-" + giveCode.split("-")[2] + "-" + count.get()); |
| | | } |
| | | insSampleMapper.insert(a); |
| | | //样品的检验项目 |
| | |
| | | insOrder.setExamineTime(LocalDateTime.now()); |
| | | if (insOrder.getState() == 1) { |
| | | //审核通过才会生成委托编号 |
| | | Custom custom = customMapper.selectById(order.getCompanyId()); |
| | | System.out.println("=============" + custom.getCompany()); |
| | | System.out.println("-------------" + order.getCompany()); |
| | | insOrder.setEntrustCode(giveCode.giveCode2("TXJC-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMMdd")); |
| | | insOrder.setEntrustCode(giveCode.giveCode2("WT-", "ins_order", "-", "yyMMdd")); |
| | | int day = insProductService.selectOrderManDay(insOrder.getId());//预计完成时间 |
| | | //确定订单的下发时间和约定时间 |
| | | insOrder.setAppointed(LocalDate.parse(LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); |
| | |
| | | for (File f : files) { |
| | | // 根据文件名查询id |
| | | String name = f.getName(); |
| | | InsReport insReport = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery().like(InsReport::getCode, f.getName().replace(".docx", "").replace("JCZX", "JCZX/"))); |
| | | InsReport insReport = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery().like(InsReport::getCode, f.getName().replace(".docx", ""))); |
| | | if (ObjectUtils.isEmpty(insReport)) { |
| | | throw new ErrorException("没有找到 " + f.getName() + " 这个文件对应的报告数据"); |
| | | } |
| | |
| | | List<SampleProductDto> samples = insSampleMapper.selectSampleProductListByOrderId(orderId); |
| | | String sampleCode = samples.get(0).getSampleCode(); |
| | | InsReport insReport = new InsReport(); |
| | | insReport.setCode(insOrder.getEntrustCode()); |
| | | insReport.setCode(insOrder.getEntrustCode().replace("WT","TXJC")); |
| | | insReport.setInsOrderId(orderId); |
| | | List<Map<String, Object>> tables = new ArrayList<>(); |
| | | Set<String> standardMethod = new HashSet<>(); |
| | |
| | | models.add(s.getModel()); |
| | | standardMethod.addAll(standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery() |
| | | .in(StandardMethodList::getId,Arrays.stream(s.getStandardMethodListId().replaceAll("[\\[\\]]", "").split(",")) |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()))).stream().map(StandardMethodList::getCode).distinct().collect(Collectors.toList())); |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()))).stream().map(aa->{return aa.getCode()+" "+aa.getName();}).distinct().collect(Collectors.toList())); |
| | | //总数 |
| | | Long productCount = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId())); |
| | |
| | | } |
| | | StringBuilder standardMethod2 = new StringBuilder(); |
| | | for (String s : standardMethod) { |
| | | standardMethod2.append("、").append(s); |
| | | standardMethod2.append(";\n").append(s); |
| | | } |
| | | standardMethod2.append(";\n").append("GB/T 9410-2008 《移动通信天线通用技术规范》"); |
| | | standardMethod2.replace(0, 1, ""); |
| | | tables.forEach(table -> { |
| | | table.put("tableSize", tables.size() + 1); |
| | |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.dto.ProductDto; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.StandardMethodListMapper; |
| | | import com.yuanchu.mom.mapper.StandardProductListMapper; |
| | | import com.yuanchu.mom.mapper.StandardTreeMapper; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.pojo.StandardMethodList; |
| | | import com.yuanchu.mom.pojo.StandardProductList; |
| | | import com.yuanchu.mom.pojo.StandardTree; |
| | | import com.yuanchu.mom.service.StandardProductListService; |
| | |
| | | return false; |
| | | } |
| | | return true; |
| | | }).map(standardProductList -> { |
| | | String code = baseMapper.selectStandardMethodById(standardProductList.getStandardMethodListId()); |
| | | standardProductList.setMethodS(code); |
| | | return standardProductList; |
| | | }).collect(Collectors.toList()); |
| | | return list; |
| | | } |
| | |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | <select id="selectStandardMethodById" resultType="java.lang.String"> |
| | | select code from standard_method where id=#{standardMethodListId} |
| | | </select> |
| | | </mapper> |