| | |
| | | INSERT INTO standard_product_list (id, inspection_item, inspection_item_en, inspection_item_subclass, inspection_item_subclass_en, factory, laboratory, sample_type, sample, model, son_laboratory, unit, price, man_hour, man_hour_group, inspection_item_type, inspection_value_type, checkout_number, section, cores, method, method_s, man_day, bsm, ask, tell, standard_method_list_id, template_id, state, dic, tree, structure_item_parameter_id, inspection_item_class, inspection_item_class_en, radius, radius_list, rates, sort, conductor_material, conductor_type) |
| | | VALUES |
| | | <foreach item="item" collection="productLists" open="(" separator="),(" close=")"> |
| | | #{item.id}, #{item.inspectionItem}, #{item.inspectionItemEn}, #{item.inspectionItemSubclass}, #{item.inspectionItemSubclassEn}, #{item.factory}, #{item.sonLaboratory}, #{item.sampleType}, #{item.sample}, #{item.model}, #{item.sonLaboratory}, #{item.unit}, #{item.price}, #{item.manHour}, #{item.manHourGroup}, #{item.inspectionItemType}, #{item.inspectionValueType}, #{item.checkoutNumber}, #{item.section}, #{item.cores}, #{item.method}, #{item.methodS}, #{item.manDay}, #{item.bsm}, #{item.ask}, #{item.tell}, #{item.standardMethodListId}, #{item.templateId}, #{item.state}, #{item.dic}, #{item.tree}, #{item.structureItemParameterId}, |
| | | #{item.id}, #{item.inspectionItem}, #{item.inspectionItemEn}, #{item.inspectionItemSubclass}, #{item.inspectionItemSubclassEn}, #{item.factory}, #{item.laboratory}, #{item.sampleType}, #{item.sample}, #{item.model}, #{item.sonLaboratory}, #{item.unit}, #{item.price}, #{item.manHour}, #{item.manHourGroup}, #{item.inspectionItemType}, #{item.inspectionValueType}, #{item.checkoutNumber}, #{item.section}, #{item.cores}, #{item.method}, #{item.methodS}, #{item.manDay}, #{item.bsm}, #{item.ask}, #{item.tell}, #{item.standardMethodListId}, #{item.templateId}, #{item.state}, #{item.dic}, #{item.tree}, #{item.structureItemParameterId}, |
| | | #{item.inspectionItemClass}, #{item.inspectionItemClassEn}, #{item.radius}, #{item.radiusList}, #{item.rates}, #{item.sort}, #{item.conductorMaterial}, #{item.conductorType} |
| | | </foreach> |
| | | |
| | |
| | | info.setCreateUser(user.getName()); |
| | | info.setMessageType("6"); |
| | | info.setTheme("CNASè´¨éçç£è®°å½å®¡æ¹éç¥"); |
| | | info.setContent("çç£é¡¹ç®ä¸º: " + superviseDetails.getSuperviseProject() + " çç£è®°å½å¸¦å®¡æ¹"); |
| | | info.setContent("çç£é¡¹ç®ä¸º: " + superviseDetails.getSuperviseProject() + " çç£è®°å½å¾
审æ¹"); |
| | | info.setSenderId(userId); |
| | | // æ¥æ¶äºº |
| | | info.setConsigneeId(qualitySuperviseDetailsRecord.getRatifyUserId()); |
| | |
| | | String message = ""; |
| | | message += "CNASè´¨éçç£è®°å½å®¡æ¹éç¥"; |
| | | message += "\n请å»è¿ç¨è¦æ±-è´¨éçç£è®¡å"; |
| | | message += "\n" + "çç£é¡¹ç®ä¸º: " + superviseDetails.getSuperviseProject() + " çç£è®°å½å¸¦å®¡æ¹"; |
| | | message += "\n" + "çç£é¡¹ç®ä¸º: " + superviseDetails.getSuperviseProject() + " çç£è®°å½å¾
审æ¹"; |
| | | //åéä¼ä¸å¾®ä¿¡æ¶æ¯éç¥ |
| | | try { |
| | | WxCpUtils.inform(people.getAccount(), message, null); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspect.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ£æµé¡¹åæç»ææ°æ® |
| | | * |
| | | * @Author zhuo |
| | | * @Date 2025/3/26 |
| | | */ |
| | | @Data |
| | | public class InsProductAnalysisDto { |
| | | |
| | | @ApiModelProperty("æ£æµé¡¹id") |
| | | private Integer insProductId; |
| | | |
| | | @ApiModelProperty("æ£æµç»æ") |
| | | @TableField("`last_value`") |
| | | private String lastValue; |
| | | |
| | | @ApiModelProperty("订åid") |
| | | private Integer insOrderId; |
| | | |
| | | @ApiModelProperty("æ ·åid") |
| | | private Integer insSampleId; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.inspect.dto.InsProductAnalysisDto; |
| | | import com.ruoyi.inspect.dto.ProductResultDto2; |
| | | import com.ruoyi.inspect.dto.SampleProductRawAnalysisDto; |
| | | import com.ruoyi.inspect.pojo.InsProduct; |
| | |
| | | * @return |
| | | */ |
| | | List<InsProduct> selectProductByOrderId(Integer orderId); |
| | | |
| | | /** |
| | | * æ¥è¯¢åä¸åå·, åä¸åå®¶, å䏿£æµé¡¹çæ£æµæ°æ® |
| | | * @param insProduct |
| | | * @param supplierName |
| | | * @return |
| | | */ |
| | | List<InsProductAnalysisDto> selectAnalysis(@Param("insProduct") InsProduct insProduct, @Param("supplierName") String supplierName); |
| | | } |
| | | |
| | | |
| | |
| | | // 夿æ¯å¦æä¸åæ ¼, æä¸åæ ¼ä¸è½ç§»åº |
| | | // todo: ifsç§»åº |
| | | insReportService.isRawMaterial(order); |
| | | |
| | | // 16 夿å½åæ ·åæ¯å¦ä¸ºåææ, åææéè¦è¿è¡æ°æ®åæ, 夿ä¹å10æ¡æ°æ®åä¸ä¸ªä¾åºå, åä¸ä¸ªæ£éªé¡¹çåå·®æ¯å¦è¶
è¿10% |
| | | // æ¥è¯¢ifsä¿¡æ¯è·åè·åå10个ä¾åºå䏿 ·ç, æ£éªé¡¹ä¸æ ·ä¿¡æ¯ |
| | | // threadPoolTaskExecutor.execute(() -> { |
| | | // |
| | | // for (InsProduct insProduct : productList) { |
| | | // // todo: ææ¶å¤ææ¯å¦æ¯èå |
| | | // if (insProduct.getInspectionItem().contains("èå")) { |
| | | // List<InsProductAnalysisDto> insProductAnalysisDtoList = insProductMapper.selectAnalysis(insProduct, ifsInventoryQuantity.getSupplierName()); |
| | | // |
| | | // // 夿å½åæ£æµé¡¹æ¯å¦åå·®è¶
è¿10% |
| | | // List<String> laseValueList = insProductAnalysisDtoList.stream().map(InsProductAnalysisDto::getLastValue) |
| | | // .collect(Collectors.toList()); |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | } else { |
| | | // ä¿®æ¹æåç¶æ |
| | | // 夿æ¯å¦æä¸åæ ¼ |
| | |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * *****计ç®åå·®**** |
| | | * @param data |
| | | * @param targetStr |
| | | * @return |
| | | */ |
| | | public static double isDeviationOverTenPercent(List<String> data, String targetStr) { |
| | | if (data.isEmpty()) { |
| | | return 0; |
| | | } |
| | | List<Double> doubleData = data.stream() |
| | | .map(Double::parseDouble) |
| | | .collect(Collectors.toList()); |
| | | double sum = doubleData.stream().mapToDouble(Double::doubleValue).sum(); |
| | | double average = sum / doubleData.size(); |
| | | |
| | | double target = Double.parseDouble(targetStr); |
| | | double deviationPercent = Math.abs(target - average) / average * 100; |
| | | |
| | | return deviationPercent; |
| | | } |
| | | |
| | | /** |
| | | * ******åå§è®°å½æ¨¡æ¿å¤å¶***** |
| | | * @param orderId |
| | | * @param ids |
| | | */ |
| | | private void templateCopy(Integer orderId, List<Integer> ids) { |
| | | // å é¤åæ¬æ¨¡æ¿ |
| | | insOrderStandardTemplateService.remove(Wrappers.<InsOrderStandardTemplate>lambdaQuery() |
| | |
| | | left join ins_sample is2 on is2.id = ip.ins_sample_id |
| | | where is2.ins_order_id = #{orderId} |
| | | </select> |
| | | <select id="selectAnalysis" resultType="com.ruoyi.inspect.dto.InsProductAnalysisDto"> |
| | | select ip.id insProductId, |
| | | ip.`last_value`, |
| | | io.id insOrderId, |
| | | is2.id insSampleId |
| | | from ins_product ip |
| | | left join ins_sample is2 on is2.id = ip.ins_sample_id |
| | | left join ins_order io on io.id = is2.ins_order_id |
| | | left join ifs_inventory_quantity iiq on iiq.id = io.ifs_inventory_id |
| | | where concat(ip.inspection_item, ip.inspection_item_subclass) = concat(#{insProduct.inspectionItem}, #{insProduct.inspectionItemSubclass}) |
| | | and ip.model = #{insProduct.model} |
| | | and iiq.supplier_name = #{supplierName} |
| | | and io.state = 4 |
| | | and ip.ins_result = 1 |
| | | order by io.first_submit_date desc |
| | | limit 10 |
| | | </select> |
| | | </mapper> |