| | |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getIfsByOver" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |
| | | select * from (<include refid="getIfsOrder"/> |
| | | <where> |
| | |
| | | </if> |
| | | order by send_time desc |
| | | </select> |
| | | |
| | | <select id="getIfsByOverList" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |
| | | select * from (<include refid="getIfsOrder"/> |
| | | <where> |
| | |
| | | package com.ruoyi.inspect.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class InsOrderPlanDTO implements Serializable { |
| | | public class InsOrderPlanDTO extends IfsInventoryQuantity implements Serializable { |
| | | |
| | | @ApiModelProperty("检验任务主键id") |
| | | private Long insSampleId; |
| | |
| | | @ApiModelProperty(value = "下单类别") |
| | | private Integer typeSource; |
| | | |
| | | @ApiModelProperty(value = "物料属性") |
| | | private String materialProp; |
| | | |
| | | @ApiModelProperty(value = "检验类别") |
| | | private String orderType; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【ins_sample(检验样品)】的数据库操作Mapper |
| | | * @createDate 2024-03-14 17:14:57 |
| | | * @Entity com.yuanchu.mom.pojo.InsSample |
| | | */ |
| | | * @author Administrator |
| | | * @description 针对表【ins_sample(检验样品)】的数据库操作Mapper |
| | | * @createDate 2024-03-14 17:14:57 |
| | | * @Entity com.yuanchu.mom.pojo.InsSample |
| | | */ |
| | | @Mapper |
| | | public interface InsSampleMapper extends BaseMapper<InsSample> { |
| | | |
| | | IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page, |
| | | @Param("ew") QueryWrapper<InsOrderPlanDTO> ew, |
| | | @Param("userName") String userName , |
| | | @Param("userName") String userName, |
| | | @Param("userId") Integer userId, |
| | | @Param("sonLaboratory") String sonLaboratory, |
| | | @Param("laboratory") String laboratory, |
| | | @Param("isCheck") Integer isCheck); |
| | | @Param("isCheck") Integer isCheck, |
| | | @Param("materialProp") String materialProp); |
| | | |
| | | IPage<InsOrderPlanTaskSwitchVo> inspectionOrderDetailsTaskSwitching(Page page, @Param("ew") QueryWrapper<InsOrderPlanDTO> ew, @Param("userId") Integer userId, @Param("sonLaboratory") String sonLaboratory, @Param("laboratory") String laboratory); |
| | | |
| | |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId2(@Param("id") Integer id); |
| | | |
| | | Map<String,Object> selectInsOrder(@Param("id") Integer id); |
| | | Map<String, Object> selectInsOrder(@Param("id") Integer id); |
| | | |
| | | List<SampleProductDto> getInsOrderAndSample(@Param("id") Integer id, @Param("laboratory") String laboratory); |
| | | |
| | |
| | | |
| | | /** |
| | | * 可能没有产品直接就是对象 |
| | | * |
| | | * @param sample |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 样品 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 原材料 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @param rawMaterialTag |
| | |
| | | |
| | | /** |
| | | * 电缆配置查看配置标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 原材料查看配置标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查看重复标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询厂家密度(有型号) |
| | | * |
| | | * @param sample |
| | | * @param production |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询厂家密度(没型号) |
| | | * |
| | | * @param sample |
| | | * @param production |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询检验项检验结果 |
| | | * |
| | | * @param itemIds |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据订单id查询样品 |
| | | * |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 检验下单 |
| | | * @TableName ins_order |
| | | */ |
| | | * 检验下单 |
| | | * |
| | | * @TableName ins_order |
| | | */ |
| | | @Data |
| | | @TableName("ins_order") |
| | | @ExcelIgnoreUnannotated |
| | |
| | | @ApiModelProperty("零件描述") |
| | | private String partDetail; |
| | | |
| | | @ApiModelProperty("是否是免检, 0否 1是" ) |
| | | @ApiModelProperty("是否是免检, 0否 1是") |
| | | private Integer isExemption; |
| | | |
| | | @ApiModelProperty("温度") |
| | |
| | | @TableField(exist = false) |
| | | private Integer issueUser; |
| | | |
| | | @ApiModelProperty("新增批号") |
| | | private String updateBatchNo; |
| | | |
| | | @ApiModelProperty("零件描述") |
| | | private String partDesc; |
| | | |
| | | @ApiModelProperty("供应商名称") |
| | | private String supplierName; |
| | | |
| | | } |
| | |
| | | Integer isCheck = insOrderPlanDTO.getIsCheck(); |
| | | insOrderPlanDTO.setIsCheck(null); |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | // 数据置空,防止反射生成重复数据 |
| | | String materialProp = insOrderPlanDTO.getMaterialProp(); |
| | | insOrderPlanDTO.setMaterialProp(null); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, |
| | | QueryWrappers.queryWrappers(insOrderPlanDTO), |
| | | userName, |
| | | userId, |
| | | sonLaboratory, |
| | | laboratory, |
| | | isCheck); |
| | | isCheck, |
| | | materialProp); |
| | | return insOrderPage; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String,Object> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | public Map<String, Object> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<String> collect = new ArrayList<>(); |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | |
| | | //查询ifs拆分订单是否有已下单但是未检完的单子 |
| | | long count = 0L; |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | if(Objects.nonNull(insOrder.getIfsInventoryId())){ |
| | | if (Objects.nonNull(insOrder.getIfsInventoryId())) { |
| | | IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); |
| | | //过滤出不合格或未提交的单子 |
| | | count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(),one.getLineNo(),one.getReleaseNo(),one.getReceiptNo(),one.getOrderNo()) |
| | | count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo()) |
| | | .stream() |
| | | .filter(f->(Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(),orderId)) && (Objects.isNull(f.getInsResult()) || 0==f.getInsResult())).count(); |
| | | .filter(f -> (Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(), orderId)) && (Objects.isNull(f.getInsResult()) || 0 == f.getInsResult())).count(); |
| | | } |
| | | map.put("errorMsg",collect); |
| | | map.put("unInsOrderCount",count); |
| | | map.put("errorMsg", collect); |
| | | map.put("unInsOrderCount", count); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 查询模板内容 |
| | | * |
| | | * @param order |
| | | * @param insProducts |
| | | */ |
| | |
| | | |
| | | /** |
| | | * todo: 原始记录模板清除没有使用的检验项(暂时有bug无法使用) |
| | | * |
| | | * @param sheet |
| | | * @param itemNameList |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 坐标拼接 |
| | | * |
| | | * @param r 横坐标 |
| | | * @param c 纵坐标 |
| | | * @return |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults) { |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode, Boolean registerInsResults) { |
| | | InsOrder order = insOrderMapper.selectById(orderId); |
| | | // 1. 判断是否有重复编号, 有重复编号做提醒 |
| | | Long codeCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery() |
| | |
| | | int count = 0; |
| | | for (InsProduct product : insProducts) { |
| | | count++; |
| | | str += (count != 0 ? "\n" : "") + count + ":" + |
| | | str += (count != 0 ? "\n" : "") + count + ":" + |
| | | product.getInspectionItemClass() + " " + |
| | | product.getInspectionItem() + " " + |
| | | product.getInspectionItemSubclass(); |
| | |
| | | // 登记检验结果 |
| | | // 判断是否有不合格, 有不合格不能移库 |
| | | // todo: ifs移库 |
| | | insReportService.isRawMaterial(order,registerInsResults,false); |
| | | insReportService.isRawMaterial(order, registerInsResults, false); |
| | | |
| | | // 15 判断当前样品是否为原材料, 原材料需要进行数据分析, 判断之前10条数据同一个供应商, 同一个检验项的偏差是否超过10% |
| | | // 查询ifs信息获取获取前10个供应商一样的, 检验项一样信息 |
| | |
| | | |
| | | /** |
| | | * *****添加分析数据****** |
| | | * |
| | | * @param productList |
| | | * @param ifsInventoryQuantity |
| | | * @param order |
| | |
| | | |
| | | /** |
| | | * *****计算偏差**** |
| | | * |
| | | * @param data |
| | | * @param targetStr |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * *****计算偏差**** |
| | | * |
| | | * @param targetStr |
| | | * @return |
| | | */ |
| | | public static double isDeviationOverTenPercentByAsked(String asked, String targetStr) { |
| | | if(!isNumeric(asked)) return 0; |
| | | if (!isNumeric(asked)) return 0; |
| | | double average = Double.parseDouble(asked); |
| | | |
| | | double target = Double.parseDouble(targetStr); |
| | |
| | | |
| | | /** |
| | | * ******原始记录模板复制***** |
| | | * |
| | | * @param orderId |
| | | * @param ids |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 检验任务复核 |
| | | * |
| | | * @param orderId |
| | | * @param laboratory |
| | | * @param type |
| | |
| | | |
| | | /** |
| | | * 生成报告 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | private void generateReport(Integer orderId) { |
| | |
| | | |
| | | /** |
| | | * 电缆配置, 查看配置标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 原材料查看标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查看重复标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 新增不合格复测内容 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询进货原始记录 |
| | | * |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 保存原材料进货验证 |
| | | * |
| | | * @param factoryVerify |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 设置表格样式 |
| | | * |
| | | * @param max 标识最大个数 |
| | | * @return |
| | | */ |
| | | private TableStyle setTableStyle(int max){ |
| | | private TableStyle setTableStyle(int max) { |
| | | //设置样式 |
| | | TableStyle tableStyle = new TableStyle(); |
| | | if(max<=5){ |
| | | if (max <= 5) { |
| | | for (int i = 1; i <= max; i++) { |
| | | // 根据检验结果个数修改长度 |
| | | switch (i) { |
| | |
| | | |
| | | /** |
| | | * 处理有电缆颜色标识的检测项 |
| | | * @param cableTags 电缆颜色标识 |
| | | * @param collect 检测项列表 |
| | | * |
| | | * @param cableTags 电缆颜色标识 |
| | | * @param collect 检测项列表 |
| | | * @param startIndex 起始下标 |
| | | * @param endIndex 结束下标 |
| | | * @return |
| | | */ |
| | | private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags,Map<String, List<SampleProductExportDto>> collect,int startIndex,int endIndex){ |
| | | private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags, Map<String, List<SampleProductExportDto>> collect, int startIndex, int endIndex) { |
| | | List<SampleProductExportDto> sampleProductExportDtos = new ArrayList<>(); |
| | | for (String s : collect.keySet()) { |
| | | List<String> lastValueList = new ArrayList<>(); |
| | | SampleProductExportDto dto = new SampleProductExportDto(); |
| | | BeanUtil.copyProperties(collect.get(s).get(0),dto); |
| | | BeanUtil.copyProperties(collect.get(s).get(0), dto); |
| | | Set<String> tellSet = new HashSet<>(); |
| | | for (int i = startIndex; i < endIndex; i++) { |
| | | String cableTag = cableTags.get(i); |
| | | for (SampleProductExportDto sDto : collect.get(s)) { |
| | | tellSet.add(sDto.getTell()); |
| | | if(sDto.getCableTag().equals(cableTag)){ |
| | | if (sDto.getCableTag().equals(cableTag)) { |
| | | lastValueList.add(sDto.getLastValue()); |
| | | } |
| | | } |
| | | } |
| | | //切割电缆配置项 |
| | | dto.setTell(String.join("\n",tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()))); |
| | | dto.setTell(String.join("\n", tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()))); |
| | | dto.setLastValueList(lastValueList); |
| | | sampleProductExportDtos.add(dto); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 检测项排序 |
| | | * |
| | | * @param sourceMap |
| | | * @param targetMap |
| | | */ |
| | | private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap,Map<String, List<SampleProductExportDto>> targetMap){ |
| | | private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap, Map<String, List<SampleProductExportDto>> targetMap) { |
| | | List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sourceMap.entrySet()); |
| | | entries.sort(Comparator.comparingInt(o -> (o.getValue().get(0).getSort() == null ? 0 : o.getValue().get(0).getSort()))); |
| | | for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) { |
| | |
| | | |
| | | /** |
| | | * 小报告生成 |
| | | * |
| | | * @param orderId |
| | | * @param insOrder |
| | | * @param insSamples |
| | |
| | | //查询零件属性 |
| | | IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery() |
| | | .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId())); |
| | | if(Objects.nonNull(ifsPartPropsRecord)){ |
| | | if (Objects.nonNull(ifsPartPropsRecord)) { |
| | | enterFactoryReport.setOuterColor(ifsPartPropsRecord.getOuterColor()); |
| | | } |
| | | enterFactoryReport.setQtyArrived(ifsInventoryQuantity.getQtyArrived() == null ? "" : |
| | |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | List<TextRenderData> text = new ArrayList<>(); |
| | | RowRenderData rowRenderData = null; |
| | | List<Map<String,Object>> cableTagEnclosureTables = new ArrayList<>(); |
| | | List<Map<String, Object>> cableTagEnclosureTables = new ArrayList<>(); |
| | | |
| | | // 查询检验内容 |
| | | List<SampleProductExportDto> sampleProductDto2s = insOrderMapper.selectSampleBySampleId(insSamples.stream() |
| | |
| | | Integer max = insSamples.stream().mapToInt(InsSample::getQuantity).sum(); |
| | | TableRenderData tableRenderData = new TableRenderData(); |
| | | String templateName; |
| | | if(StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){ |
| | | if (StringUtils.equals(OrderType.WG.getValue(), ifsInventoryQuantity.getOrderType())) { |
| | | //过滤不判定的检测项 |
| | | List<SampleProductExportDto> filterItems = sampleProductDto2s.stream().filter(f -> f.getInsResult() != 3).collect(Collectors.toList()); |
| | | int maxCableTag = 5;//单个表格,电缆颜色标识最大个数 |
| | | templateName = "/static/small-wg-report-template.docx"; |
| | | //查询检验单消息 |
| | | InsSampleUserVO insSampleUser = insSampleUserMapper.selectUserNameByOrderId(orderId); |
| | | if(Objects.nonNull(insSampleUser)){ |
| | | if (Objects.nonNull(insSampleUser)) { |
| | | enterFactoryReport.setPartDesc(insSampleUser.getModel()); |
| | | enterFactoryReport.setInspector(insSampleUser.getInspector()); |
| | | enterFactoryReport.setInspectDate(insSampleUser.getInspectDate()); |
| | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId()); |
| | | max = Math.max(cableTags.size(),1); |
| | | max = Math.max(cableTags.size(), 1); |
| | | //处理电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>(); |
| | | Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>(); |
| | |
| | | List<SampleProductExportDto> sampleProductExportDtos2; |
| | | //处理电缆配置项 |
| | | Map<String, List<SampleProductExportDto>> collect = listMap2.get(key).stream().collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItemSubclass)); |
| | | if(cableTags.size()>maxCableTag){ |
| | | sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,maxCableTag); |
| | | sampleProductExportDtos2 = transformSampleProduct(cableTags,collect,maxCableTag,cableTags.size()); |
| | | tempMap2.put(key,sampleProductExportDtos2); |
| | | }else{ |
| | | sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,cableTags.size()); |
| | | if (cableTags.size() > maxCableTag) { |
| | | sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, maxCableTag); |
| | | sampleProductExportDtos2 = transformSampleProduct(cableTags, collect, maxCableTag, cableTags.size()); |
| | | tempMap2.put(key, sampleProductExportDtos2); |
| | | } else { |
| | | sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, cableTags.size()); |
| | | } |
| | | cableTagItem.put(key,sampleProductExportDtos); |
| | | cableTagItem.put(key, sampleProductExportDtos); |
| | | } |
| | | //处理非电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> listMap = filterItems.stream() |
| | | .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) |
| | | .collect(Collectors.groupingBy(s->s.getInspectionItem()+"&")); |
| | | .collect(Collectors.groupingBy(s -> s.getInspectionItem() + "&")); |
| | | //合并检测项列表 |
| | | tempMap.putAll(cableTagItem); |
| | | tempMap.putAll(listMap); |
| | | sortSampleProduct(tempMap,totalItem); |
| | | int tagNum = Math.min(max,maxCableTag); |
| | | List<String> tagList = cableTags.isEmpty()?new ArrayList<>():cableTags.subList(0,tagNum); |
| | | handlerSampleItems(OrderType.WG.getValue(),totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | sortSampleProduct(tempMap, totalItem); |
| | | int tagNum = Math.min(max, maxCableTag); |
| | | List<String> tagList = cableTags.isEmpty() ? new ArrayList<>() : cableTags.subList(0, tagNum); |
| | | handlerSampleItems(OrderType.WG.getValue(), totalItem, finalIndex, sampleList, tagNum, text, rows, rowRenderData, resultCh, tagList, true); |
| | | |
| | | if(CollectionUtil.isNotEmpty(tempMap2)){ |
| | | sortSampleProduct(tempMap2,cableTagEnclosureItem); |
| | | if (CollectionUtil.isNotEmpty(tempMap2)) { |
| | | sortSampleProduct(tempMap2, cableTagEnclosureItem); |
| | | //生成附件电缆表格 |
| | | TableRenderData tableRenderData2 = new TableRenderData(); |
| | | List<String> newCableTags = cableTags.subList(maxCableTag,cableTags.size()); |
| | | List<String> newCableTags = cableTags.subList(maxCableTag, cableTags.size()); |
| | | AtomicInteger finalIndex2 = new AtomicInteger(1); |
| | | List<TextRenderData> newText = new ArrayList<TextRenderData>(); |
| | | List<RowRenderData> newRows = new ArrayList<>(); |
| | | RowRenderData newRowRenderData = null; |
| | | handlerSampleItems(OrderType.WG.getValue(),cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true); |
| | | handlerSampleItems(OrderType.WG.getValue(), cableTagEnclosureItem, finalIndex2, new ArrayList<>(), newCableTags.size(), newText, newRows, newRowRenderData, resultCh, newCableTags, true); |
| | | tableRenderData2.setRows(newRows); |
| | | tableRenderData2.setTableStyle(setTableStyle(newCableTags.size())); |
| | | HashMap<String, Object> tableMap = new HashMap<>(); |
| | | tableMap.put("enclosureTable",tableRenderData2); |
| | | tableMap.put("enclosureTable", tableRenderData2); |
| | | tableMap.put("resultCh", resultCh); |
| | | tableMap.put("writeUrl", null); |
| | | tableMap.put("examineUrl", null); |
| | |
| | | resultCh.set("本产品符合相关标准要求,经检验合格准予出厂(盖章有效)"); |
| | | } |
| | | |
| | | }else{ |
| | | } else { |
| | | templateName = "/static/small-report-template.docx"; |
| | | // 转成Mpa进行排序 |
| | | Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream() |
| | |
| | | .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); |
| | | // // 创建一个 LinkedHashMap 来保持插入顺序 |
| | | Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>(); |
| | | sortSampleProduct(sortedMap,item); |
| | | sortSampleProduct(sortedMap, item); |
| | | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | handlerSampleItems(OrderType.RAW.getValue(), item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true); |
| | | handlerSampleItems(OrderType.RAW.getValue(), item, finalIndex, sampleList, max, text, rows, rowRenderData, resultCh, null, true); |
| | | tableRenderData.setRows(rows); |
| | | tableRenderData.setTableStyle(setTableStyle(max)); |
| | | |
| | |
| | | put("standardMethod", standardMethod2.toString().equals("null") ? "" : standardMethod2); |
| | | put("orderType", orderType); |
| | | put("table", tableRenderData); |
| | | put("enclosureTables", cableTagEnclosureTables.isEmpty()?null:cableTagEnclosureTables); |
| | | put("enclosureTables", cableTagEnclosureTables.isEmpty() ? null : cableTagEnclosureTables); |
| | | put("resultCh", resultCh); |
| | | put("writeUrl", null); |
| | | put("examineUrl", null); |
| | |
| | | |
| | | /** |
| | | * 处理常规检测项 |
| | | * |
| | | * @param item |
| | | * @param finalIndex |
| | | * @param sampleList |
| | |
| | | * @param rowRenderData |
| | | * @param resultCh |
| | | */ |
| | | private static void handlerSampleItems(String orderType,Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){ |
| | | private static void handlerSampleItems(String orderType, Map<String, List<SampleProductExportDto>> item, AtomicInteger finalIndex, List<SampleProductExportDto> sampleList, Integer max, List<TextRenderData> text, List<RowRenderData> rows, RowRenderData rowRenderData, AtomicReference<String> resultCh, List<String> cableTagList, Boolean hasAddHead) { |
| | | item.forEach((s, sampleProductDtoInside) -> { |
| | | // 添加检验项 |
| | | SampleProductExportDto dto2 = new SampleProductExportDto(); |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |
| | |
| | | }); |
| | | |
| | | // 添加小报告表头 |
| | | if(hasAddHead){ |
| | | text = addSmallHead(text, max, rows,cableTagList); |
| | | if (hasAddHead) { |
| | | text = addSmallHead(text, max, rows, cableTagList); |
| | | } |
| | | |
| | | // 中间检测值添加 |
| | |
| | | // 检验项目 |
| | | TextRenderData middleRenderData2 = new TextRenderData(); |
| | | String[] split = sample.getInspectionName().split("&"); |
| | | String itemName = split.length>0?split[0]:sample.getInspectionName(); |
| | | middleRenderData2.setText(itemName+"∑"+itemName+i+"_"+finalIndex); |
| | | String itemName = split.length > 0 ? split[0] : sample.getInspectionName(); |
| | | middleRenderData2.setText(itemName + "∑" + itemName + i + "_" + finalIndex); |
| | | Style middleStyle2 = new Style(); |
| | | middleStyle2.setFontFamily("宋体"); |
| | | middleStyle2.setColor("000000"); |
| | |
| | | TextRenderData middleRenderData6 = new TextRenderData(); |
| | | middleRenderData6.setText((StringUtils.isNotEmpty(sample.getLastValue()) ? |
| | | sample.getLastValue() : "") |
| | | + "∑" + (finalIndex.get() +"_"+ i)); |
| | | + "∑" + (finalIndex.get() + "_" + i)); |
| | | Style middleStyle6 = new Style(); |
| | | middleStyle6.setFontFamily("宋体"); |
| | | middleStyle6.setColor("000000"); |
| | |
| | | |
| | | /** |
| | | * 添加小报告表头 |
| | | * |
| | | * @param text |
| | | * @param max |
| | | * @param rows |
| | | * @return |
| | | */ |
| | | private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows,List<String> cableTagList) { |
| | | private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows, List<String> cableTagList) { |
| | | RowRenderData rowRenderData; |
| | | // // 头 |
| | | TextRenderData headRenderData1 = new TextRenderData(); |
| | |
| | | text = new ArrayList<>(); |
| | | } |
| | | //如果有电缆颜色,生成颜色标识行 |
| | | if(CollectionUtil.isNotEmpty(cableTagList)){ |
| | | if (CollectionUtil.isNotEmpty(cableTagList)) { |
| | | TextRenderData tagRenderData1 = new TextRenderData(); |
| | | tagRenderData1.setText(""); |
| | | Style tagStyle1 = new Style(); |
| | |
| | | |
| | | /** |
| | | * 创建大报告 |
| | | * |
| | | * @param orderId |
| | | * @param insOrder |
| | | * @param |
| | |
| | | |
| | | /** |
| | | * 调整高度 |
| | | * |
| | | * @param row |
| | | * @param rowHeight |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 添加报告表头 |
| | | * |
| | | * @param sample |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | | * @param max |
| | | * @param cableTags 线芯颜色 |
| | | * @param cableTags 线芯颜色 |
| | | */ |
| | | private static void addHead(SampleProductDto sample, List<TextRenderData> text, RowRenderData rowRenderData, List<RowRenderData> rows, int max, List<String> cableTags) { |
| | | // 第一行 |
| | |
| | | |
| | | /** |
| | | * 添加检测值 |
| | | * @param a 当前样品 |
| | | * |
| | | * @param a 当前样品 |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | | * @param max 检验数量 |
| | | * @param max 检验数量 |
| | | * @param resultChList 不符合信息中文 |
| | | * @param resultEhList 不符合信息英文 |
| | | * @param insSamples |
| | | * @param cableTags 线芯颜色 |
| | | * @param isOneSample 判断是否是只有一个样品 |
| | | * @param cableTags 线芯颜色 |
| | | * @param isOneSample 判断是否是只有一个样品 |
| | | */ |
| | | private int addTestValue(SampleProductDto a, |
| | | List<TextRenderData> text, |
| | |
| | | |
| | | /** |
| | | * 添加报告结论中英文 |
| | | * |
| | | * @param sample |
| | | * @param itemCh |
| | | * @param itemEn |
| | |
| | | |
| | | /** |
| | | * 格式化修改检验项 |
| | | * |
| | | * @param sampleProductDto2s |
| | | */ |
| | | private void formatProducts(List<SampleProductExportDto> sampleProductDto2s) { |
| | |
| | | |
| | | /** |
| | | * 添加结尾 |
| | | * |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | |
| | | |
| | | /** |
| | | * 判断当前内容是否是科学计数法 |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改要求描述的科学计数法 |
| | | * |
| | | * @param input |
| | | */ |
| | | public static String convertToScientificNotation(String input) { |
| | |
| | | |
| | | /** |
| | | * 展示成科学计数法 |
| | | * |
| | | * @param number |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据要求描述保留结果小数点位数 |
| | | * |
| | | * @param reference |
| | | * @param value |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 保留位数, 如果等于0 返回找到的一个非0位数 |
| | | * |
| | | * @param number 当前数字 |
| | | * @param scale 原本保留的位数 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * *****保存元此阿里进货验证原始记录***** |
| | | * @param insOrderId 订单Id |
| | | * @param examineUserId 复核人Id |
| | | * @param writeUserId 检验员Id |
| | | * |
| | | * @param insOrderId 订单Id |
| | | * @param examineUserId 复核人Id |
| | | * @param writeUserId 检验员Id |
| | | */ |
| | | private void reportFactoryVerify(Integer insOrderId, Integer examineUserId, Integer writeUserId) { |
| | | // 查询进货验证原始记录 |
| | |
| | | |
| | | /** |
| | | * ***格式化进厂验证内容**** |
| | | * |
| | | * @param basicType |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ***word转换pdf*** |
| | | * |
| | | * @param path |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * *****修改成品抽样状态****** |
| | | * |
| | | * @param insSamples |
| | | * @param order |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加工时 |
| | | * |
| | | * @param userId |
| | | * @param insProduct |
| | | * @param insOrder |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InsOrderPlanVO{ |
| | | public class InsOrderPlanVO { |
| | | |
| | | |
| | | private Integer id; |
| | |
| | | @ApiModelProperty("样品名称") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty("物料属性") |
| | | private String materialProp; |
| | | |
| | | @ApiModelProperty("零件描述") |
| | | private String partDesc; |
| | | |
| | |
| | | io.laboratory, |
| | | io.ifs_inventory_id, |
| | | iiq.is_copper, |
| | | iiq.material_prop, |
| | | ip.son_laboratory, |
| | | iiq.update_batch_no, |
| | | iiq.part_desc, |
| | |
| | | left join ins_product ip on ip.ins_sample_id = is2.id |
| | | where 1=1 |
| | | and ir.is_pass = 1 |
| | | <if test="createOrderUser != null and createOrderUser != ''"> |
| | | and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = #{createOrderUser}) |
| | | <if test="createOrderUser != null"> |
| | | and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = |
| | | #{createOrderUser}) |
| | | </if> |
| | | <if test="laboratory!=null and laboratory!=''"> |
| | | and laboratory=#{laboratory} |
| | | and io.laboratory=#{laboratory} |
| | | </if> |
| | | <if test="queryStatus != null and queryStatus != ''"> |
| | | <!-- 待提交--> |
| | | <if test='queryStatus == 0'> |
| | | <if test='queryStatus == "0"'> |
| | | and ir.state = 0 |
| | | </if> |
| | | <!-- 待审批--> |
| | | <if test='queryStatus == 1'> |
| | | <if test='queryStatus == "1"'> |
| | | and ir.state = 1 and (ir.is_examine != 1 or ir.is_examine is null) |
| | | </if> |
| | | <!-- 待批准--> |
| | | <if test='queryStatus == 2'> |
| | | <if test='queryStatus == "2"'> |
| | | and ir.state = 1 and ir.is_examine = 1 and (ir.is_ratify != 1 or ir.is_ratify is null) |
| | | </if> |
| | | </if> |
| | |
| | | </if> |
| | | ORDER BY a.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="getLaboratoryByName" resultType="java.lang.String"> |
| | | select s.address from seal s |
| | | left join laboratory l on s.lab_id = l.id |
| | | select s.address |
| | | from seal s |
| | | left join laboratory l on s.lab_id = l.id |
| | | where l.laboratory_name = #{name} |
| | | and s.type = #{type} |
| | | and s.type = #{type} |
| | | order by s.create_time desc |
| | | limit 1 |
| | | </select> |
| | |
| | | <!-- 报告报表导出 --> |
| | | <select id="reportAllExport" resultType="com.ruoyi.inspect.dto.InsReportExport"> |
| | | select code, |
| | | case when type_source = 0 then '成品下单' else '原材料下单' end type_source, |
| | | case when type_source = 0 then '成品下单' else '原材料下单' end type_source, |
| | | case |
| | | when order_type = '抽检' then '抽检' |
| | | when order_type = 'Customer-ordered test' then '委托检验' |
| | | when order_type = '进厂检验' then '进厂检验' |
| | | when order_type = 'Quarterly inspection' then '季度检验' |
| | | else '' end order_type, |
| | | DATE_FORMAT(create_Time, '%Y-%m-%d %H:%i:%s') create_Time, |
| | | else '' end order_type, |
| | | DATE_FORMAT(create_Time, '%Y-%m-%d %H:%i:%s') create_Time, |
| | | write_user_name, |
| | | DATE_FORMAT(write_time, '%Y-%m-%d %H:%i:%s') write_time, |
| | | case when state = 0 then '待提交' when state = 1 then '已提交' else '' end state, |
| | | DATE_FORMAT(write_time, '%Y-%m-%d %H:%i:%s') write_time, |
| | | case when state = 0 then '待提交' when state = 1 then '已提交' else '' end state, |
| | | examine_user, |
| | | DATE_FORMAT(examine_time, '%Y-%m-%d %H:%i:%s') examine_time, |
| | | DATE_FORMAT(examine_time, '%Y-%m-%d %H:%i:%s') examine_time, |
| | | case when is_examine = 0 then '不通过' when is_examine = 1 then '通过' else '' end is_examine, |
| | | examine_tell, |
| | | ratify_user, |
| | | DATE_FORMAT(ratify_time, '%Y-%m-%d %H:%i:%s') ratify_time, |
| | | case when is_ratify = 0 then '不批准' when is_ratify = 1 then '批准' else '' end is_ratify, |
| | | DATE_FORMAT(ratify_time, '%Y-%m-%d %H:%i:%s') ratify_time, |
| | | case when is_ratify = 0 then '不批准' when is_ratify = 1 then '批准' else '' end is_ratify, |
| | | ratify_tell |
| | | from ( |
| | | select |
| | |
| | | where 1=1 |
| | | and ir.is_pass = 1 |
| | | <if test="createOrderUser != null and createOrderUser != ''"> |
| | | and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = #{createOrderUser}) |
| | | and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = |
| | | #{createOrderUser}) |
| | | </if> |
| | | <if test="queryStatus != null and queryStatus != ''"> |
| | | <!-- 待提交--> |
| | |
| | | ip.structure_item_parameter_id |
| | | </sql> |
| | | |
| | | |
| | | <select id="findInsSampleAndOrder" resultType="com.ruoyi.inspect.vo.InsOrderPlanVO"> |
| | | select * from(select * from( |
| | | SELECT * FROM ( |
| | | SELECT * FROM ( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user |
| | | FROM |
| | | ( |
| | | a.*, |
| | | ios.ins_state, |
| | | ios.verify_tell, |
| | | verify_user |
| | | FROM ( |
| | | SELECT |
| | | io.id, |
| | | io.entrust_code, |
| | |
| | | io.appointed, |
| | | io.send_time, |
| | | io.order_type, |
| | | case when |
| | | io.type_source = 0 |
| | | then io.sample_view |
| | | else io.sample end sample, |
| | | CASE WHEN io.type_source = 0 THEN io.sample_view ELSE io.sample END AS sample, |
| | | GROUP_CONCAT(DISTINCT isa.model SEPARATOR ' ') AS sample_model, |
| | | userName, |
| | | checkName, |
| | |
| | | io.laboratory, |
| | | io.type_source, |
| | | io.ifs_inventory_id, |
| | | ira.id ins_report_id, |
| | | ira.id AS ins_report_id, |
| | | ira.url, |
| | | ira.url_s, |
| | | ira.temp_url_pdf, |
| | | iiq.is_copper, |
| | | iiq.is_split_order, |
| | | iiq.update_batch_no, |
| | | iiq.part_desc |
| | | |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.update_batch_no |
| | | ELSE io.update_batch_no |
| | | END AS update_batch_no, |
| | | |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.part_desc |
| | | ELSE io.part_desc |
| | | END AS part_desc, |
| | | |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.supplier_name |
| | | ELSE io.supplier_name |
| | | END AS supplier_name, |
| | | |
| | | iiq.material_prop AS material_prop |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id |
| | | LEFT JOIN ins_report ira ON ira.ins_order_id = io.id |
| | | LEFT JOIN ifs_inventory_quantity iiq ON iiq.id = io.ifs_inventory_id |
| | | LEFT JOIN ( |
| | | SELECT ins_sample_id,GROUP_CONCAT( DISTINCT uu.name SEPARATOR ',') AS userName |
| | | FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state=0 |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and son_laboratory=#{sonLaboratory} |
| | | SELECT |
| | | ins_sample_id, |
| | | GROUP_CONCAT(DISTINCT uu.name SEPARATOR ',') AS userName |
| | | FROM ins_sample_user u |
| | | LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state = 0 |
| | | <if test="sonLaboratory != null and sonLaboratory != ''"> |
| | | AND son_laboratory = #{sonLaboratory} |
| | | </if> |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id |
| | | ) isu ON isu.ins_sample_id = io.id |
| | | LEFT JOIN ( |
| | | SELECT ins_sample_id,uu.name checkName |
| | | FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state=1 |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and son_laboratory=#{sonLaboratory} |
| | | SELECT |
| | | ins_sample_id, |
| | | uu.name AS checkName |
| | | FROM ins_sample_user u |
| | | LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state = 1 |
| | | <if test="sonLaboratory != null and sonLaboratory != ''"> |
| | | AND son_laboratory = #{sonLaboratory} |
| | | </if> |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id |
| | | )isu2 ON isu2.ins_sample_id = io.id |
| | | ) isu2 ON isu2.ins_sample_id = io.id |
| | | LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id |
| | | WHERE io.state = 1 and send_time is not null |
| | | |
| | | WHERE io.state = 1 |
| | | AND io.send_time IS NOT NULL |
| | | |
| | | <if test="materialProp != null and materialProp != ''"> |
| | | AND iiq.material_prop LIKE CONCAT('%', #{materialProp}, '%') |
| | | </if> |
| | | |
| | | <if test="sonLaboratory != null and sonLaboratory != ''"> |
| | | AND ip.son_laboratory = #{sonLaboratory} |
| | | </if> |
| | | <if test="isCheck != null"> |
| | | <if test="userName !=null and userName!=''"> |
| | | and checkName like CONCAT ('%', #{userName},'%') |
| | | <if test="userName != null and userName != ''"> |
| | | AND checkName LIKE CONCAT('%', #{userName}, '%') |
| | | </if> |
| | | </if> |
| | | <if test="isCheck == null"> |
| | | <if test="userName !=null and userName!=''"> |
| | | and userName like CONCAT ('%', #{userName},'%') |
| | | <if test="userName != null and userName != ''"> |
| | | AND userName LIKE CONCAT('%', #{userName}, '%') |
| | | </if> |
| | | </if> |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and ip.son_laboratory = #{sonLaboratory} |
| | | </if> |
| | | |
| | | GROUP BY |
| | | ip.son_laboratory, |
| | | io.id |
| | |
| | | a.type DESC, |
| | | a.id |
| | | ) b |
| | | where ins_state is not null |
| | | <if test="laboratory!=null and laboratory!=''"> |
| | | and laboratory=#{laboratory} |
| | | WHERE ins_state IS NOT NULL |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | AND laboratory = #{laboratory} |
| | | </if> |
| | | )A |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | ORDER BY send_time asc |
| | | ORDER BY send_time ASC |
| | | </select> |
| | | |
| | | <select id="inspectionOrderDetailsTaskSwitching" resultType="com.ruoyi.inspect.vo.InsOrderPlanTaskSwitchVo"> |
| | |
| | | LEFT JOIN user ON isu.user_id = user.id |
| | | WHERE |
| | | io.state = 1 |
| | | -- # AND io.ins_state != 5 |
| | | -- # AND io.ins_state != 5 |
| | | and send_time is not null |
| | | <if test="userId !=null and userId!=''"> |
| | | and (isu.user_id = #{userId} OR isu.user_id is NULL ) |
| | |
| | | |
| | | <select id="selectSampleProductListByOrderId" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ip.method_s |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_order_id = #{id} |
| | | and state = 1 |
| | | -- and ins_fiber_id is null |
| | | -- and ins_fibers_id is null |
| | | and <!--isa.sample_code NOT REGEXP '/'--> |
| | | isa.id in(select id1 from (select is2.id id1 ,ip.id from ins_sample is2 left join ins_product ip on is2.id = ip.ins_sample_id where ip.id is not null)s ) |
| | | and state = 1 |
| | | -- and ins_fiber_id is null |
| | | -- and ins_fibers_id is null |
| | | and <!--isa.sample_code NOT REGEXP '/'--> |
| | | isa.id in(select id1 from (select is2.id id1 ,ip.id from ins_sample is2 left join ins_product ip on is2.id = |
| | | ip.ins_sample_id where ip.id is not null)s ) |
| | | order by ip.sort asc, |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | |
| | | limit 1 |
| | | </select> |
| | | <select id="selectInsOrder" resultType="map"> |
| | | SELECT |
| | | ifs.order_no AS orderNo, |
| | | ifs.supplier_id AS supplierId, |
| | | ifs.supplier_name AS supplierName, |
| | | ifs.part_no AS partNo, |
| | | ifs.qty_arrived AS qtyArrived, |
| | | ifs.receiver_date AS receiverDate, |
| | | ifs.update_batch_no AS updateBatchNo, |
| | | ifs.part_desc AS partDesc, |
| | | io.send_time AS sendTime, |
| | | ifs.declare_user declareUser, |
| | | ifs.id inventoryQuantityId, |
| | | ifs.buy_unit_meas buyUnitMeas, |
| | | io.test_quantity testQuantity, |
| | | ifs.buy_unit_meas buyUnitMeas, |
| | | ifs.declare_date declareDate |
| | | FROM |
| | | ifs_inventory_quantity ifs |
| | | LEFT JOIN ins_order io ON ifs.id = io.ifs_inventory_id |
| | | WHERE |
| | | io.id = #{id} |
| | | SELECT ifs.order_no AS orderNo, |
| | | ifs.supplier_id AS supplierId, |
| | | ifs.supplier_name AS supplierName, |
| | | ifs.part_no AS partNo, |
| | | ifs.qty_arrived AS qtyArrived, |
| | | ifs.receiver_date AS receiverDate, |
| | | ifs.update_batch_no AS updateBatchNo, |
| | | ifs.part_desc AS partDesc, |
| | | io.send_time AS sendTime, |
| | | ifs.declare_user declareUser, |
| | | ifs.id inventoryQuantityId, |
| | | ifs.buy_unit_meas buyUnitMeas, |
| | | io.test_quantity testQuantity, |
| | | ifs.buy_unit_meas buyUnitMeas, |
| | | ifs.declare_date declareDate |
| | | FROM ifs_inventory_quantity ifs |
| | | LEFT JOIN ins_order io ON ifs.id = io.ifs_inventory_id |
| | | WHERE io.id = #{id} |
| | | </select> |
| | | <select id="selectSampleProductListByOrderId2" resultMap="sampleDto"> |
| | | select isa.*, |
| | |
| | | and state = 1 |
| | | and ip.is_binding != 1 |
| | | order by ip.sort asc, |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | | else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | WHEN man_hour_group REGEXP '[0-9]+' |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | , id asc |
| | | </select> |
| | | |
| | | <select id="getInsProduct1" resultMap="product"> |
| | | select <include refid="getInsProducSql"/> |
| | | select |
| | | <include refid="getInsProducSql"/> |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and standard_method_list_id is not null |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and standard_method_list_id is not null |
| | | /* 电缆配置标识 */ |
| | | <if test="cableTag == null or cableTag == ''"> |
| | | and ip.cable_tag is null |
| | |
| | | </select> |
| | | |
| | | <select id="getInsProduct6" resultMap="product"> |
| | | select <include refid="getInsProducSql"/> |
| | | select |
| | | <include refid="getInsProducSql"/> |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_sample_id = #{id} |
| | |
| | | WHEN COUNT(ip.last_value) = 0 THEN '0' |
| | | WHEN COUNT(CASE WHEN ip.last_value = '' OR ip.last_value IS NULL THEN 1 END) = 0 THEN '2' |
| | | ELSE '2' |
| | | END AS status |
| | | END AS status |
| | | from ins_product ip |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | |
| | | WHEN COUNT(ip.last_value) = 0 THEN '0' |
| | | WHEN COUNT(CASE WHEN ip.last_value = '' OR ip.last_value IS NULL THEN 1 END) = 0 THEN '2' |
| | | ELSE '1' |
| | | END AS status |
| | | END AS status |
| | | from ins_product ip |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | |
| | | <!-- 查看重复标识 --> |
| | | <select id="getRepetitionTag" resultType="java.util.Map"> |
| | | select ip.repetition_tag repetitionTag, |
| | | CASE |
| | | WHEN COUNT(ip.last_value) = 0 THEN '0' |
| | | WHEN COUNT(CASE WHEN ip.last_value = '' OR ip.last_value IS NULL THEN 1 END) = 0 THEN '2' |
| | | ELSE '1' |
| | | END AS status, |
| | | GROUP_CONCAT(DISTINCT ip.radius SEPARATOR ',') AS radius |
| | | CASE |
| | | WHEN COUNT(ip.last_value) = 0 THEN '0' |
| | | WHEN COUNT(CASE WHEN ip.last_value = '' OR ip.last_value IS NULL THEN 1 END) = 0 THEN '2' |
| | | ELSE '1' |
| | | END AS status, |
| | | GROUP_CONCAT(DISTINCT ip.radius SEPARATOR ',') AS radius |
| | | from ins_product ip |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and standard_method_list_id is not null |
| | | and ip.repetition_tag is not null |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and standard_method_list_id is not null |
| | | and ip.repetition_tag is not null |
| | | /* 电缆配置标识 */ |
| | | <if test="cableTag == null or cableTag == ''"> |
| | | and ip.cable_tag is null |
| | |
| | | |
| | | <!-- 查询检验项检验结果 --> |
| | | <select id="selectProductResult" resultMap="product"> |
| | | select <include refid="getInsProducSql"/> |
| | | select |
| | | <include refid="getInsProducSql"/> |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ip.id in |