a7418fdc3875d68b03f5d89ceaa0c66a8e3902cd..8ebb968641c80accdc03551164cfeb93e41ff976
2025-12-29 zouyu
修改零件批次属性问题修复
8ebb96 对比 | 目录
2025-12-29 zouyu
报告生成调整
a40e6b 对比 | 目录
已修改4个文件
82 ■■■■■ 文件已修改
inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java
@@ -3,6 +3,7 @@
import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 27233
@@ -13,6 +14,7 @@
@Mapper
public interface IfsPartPropsRecordMapper extends BaseMapper<IfsPartPropsRecord> {
    Long selectCountByPartNoAndLotBatchNo(@Param("partNo") String partNo, @Param("lotBatchNo") String lotBatchNo);
}
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java
@@ -48,29 +48,33 @@
        if(Objects.isNull(ifsPartPropsRecord)){
            throw new RuntimeException("参数不能为空");
        }
        //判断是新增还是更新
        String actionType = Objects.isNull(ifsPartPropsRecord.getId())?"New":"Modify";
        Map<String, Object> inAttrMap = new HashMap<>();
        inAttrMap.put("RECORD_ID", UUID.randomUUID().toString());
        inAttrMap.put("SYSCODE", "LIMS");
        inAttrMap.put("SYSMODEL", "库存物料批次属性修改");
        HashMap<String, Object> batchInfoMap = new HashMap<>();
        batchInfoMap.put("CONTRACT","ZTNS");//域
        batchInfoMap.put("PART_NO",ifsPartPropsRecord.getPartNo());//零件号
        batchInfoMap.put("LOT_BATCH_NO",ifsPartPropsRecord.getLotBatchNo());//批次号
        batchInfoMap.put("ATTR1",ifsPartPropsRecord.getDrumNo());//载具编号
        batchInfoMap.put("ATTR2",ifsPartPropsRecord.getStartMeterMark().toString());//起始米标
        batchInfoMap.put("ATTR3",ifsPartPropsRecord.getEndMeterMark().toString());//截止米标
        batchInfoMap.put("ATTR4", ifsPartPropsRecord.getOuterColor());//外护颜色
        batchInfoMap.put("ATTR5",ifsPartPropsRecord.getInsulationColor());//绝缘颜色
        batchInfoMap.put("ATTR8",ifsPartPropsRecord.getLetteringInfo());//印字信息
        batchInfoMap.put("ATTR23","车间订单");//入库来源
        batchInfoMap.put("ATTR24","0");//分割预留数量
        batchInfoMap.put("ACTION_TYPE",actionType);//操作类型
        inAttrMap.put("BATCH_INFO", Collections.singletonList(batchInfoMap));
        Result result = ifsApiUtils.importPartLotAttr(JSONUtil.toJsonStr(inAttrMap));
        if(result.getCode()!=200){
            throw new RuntimeException("库存物料批次属性更新失败:"+result.getMessage());
        //查询是否已有同批次同零件号的批次属性,没有才更新
        Long count = baseMapper.selectCountByPartNoAndLotBatchNo(ifsPartPropsRecord.getPartNo(),ifsPartPropsRecord.getLotBatchNo());
        if(count==0){
            //判断是新增还是更新
            String actionType = Objects.isNull(ifsPartPropsRecord.getId())?"New":"Modify";
            Map<String, Object> inAttrMap = new HashMap<>();
            inAttrMap.put("RECORD_ID", UUID.randomUUID().toString());
            inAttrMap.put("SYSCODE", "LIMS");
            inAttrMap.put("SYSMODEL", "库存物料批次属性修改");
            HashMap<String, Object> batchInfoMap = new HashMap<>();
            batchInfoMap.put("CONTRACT","ZTNS");//域
            batchInfoMap.put("PART_NO",ifsPartPropsRecord.getPartNo());//零件号
            batchInfoMap.put("LOT_BATCH_NO",ifsPartPropsRecord.getLotBatchNo());//批次号
            batchInfoMap.put("ATTR1",ifsPartPropsRecord.getDrumNo());//载具编号
            batchInfoMap.put("ATTR2",ifsPartPropsRecord.getStartMeterMark().toString());//起始米标
            batchInfoMap.put("ATTR3",ifsPartPropsRecord.getEndMeterMark().toString());//截止米标
            batchInfoMap.put("ATTR4", ifsPartPropsRecord.getOuterColor());//外护颜色
            batchInfoMap.put("ATTR5",ifsPartPropsRecord.getInsulationColor());//绝缘颜色
            batchInfoMap.put("ATTR8",ifsPartPropsRecord.getLetteringInfo());//印字信息
            batchInfoMap.put("ATTR23","车间订单");//入库来源
            batchInfoMap.put("ATTR24","0");//分割预留数量
            batchInfoMap.put("ACTION_TYPE",actionType);//操作类型
            inAttrMap.put("BATCH_INFO", Collections.singletonList(batchInfoMap));
            Result result = ifsApiUtils.importPartLotAttr(JSONUtil.toJsonStr(inAttrMap));
            if(result.getCode()!=200){
                throw new RuntimeException("库存物料批次属性更新失败:"+result.getMessage());
            }
        }
        return this.saveOrUpdate(ifsPartPropsRecord);
    }
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -1798,7 +1798,7 @@
            AtomicInteger finalIndex = new AtomicInteger(1);
            List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId());
            max = cableTags.size();
            max = Math.max(cableTags.size(),1);
            //处理电缆配置检测项
            Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>();
            Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>();
@@ -1828,8 +1828,8 @@
            tempMap.putAll(listMap);
            sortSampleProduct(tempMap,totalItem);
            int tagNum = Math.min(max,maxCableTag);
            List<String> tagList = cableTags.subList(0,tagNum);
            handlerSampleItems(totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true);
            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);
@@ -1840,7 +1840,7 @@
                List<TextRenderData> newText = new ArrayList<TextRenderData>();
                List<RowRenderData> newRows = new ArrayList<>();
                RowRenderData newRowRenderData = null;
                handlerSampleItems(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<>();
@@ -1876,7 +1876,7 @@
            AtomicInteger finalIndex = new AtomicInteger(1);
            handlerSampleItems(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));
@@ -1937,7 +1937,7 @@
     * @param rowRenderData
     * @param resultCh
     */
    private static void handlerSampleItems(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();
@@ -1953,7 +1953,7 @@
                    String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag();
                    if (map.containsKey(productName)) {
                        // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                            map.get(productName)
                                    .getLastValueList()
                                    .add(productDto2.getLastValue());
@@ -1963,7 +1963,7 @@
                                .add(productDto2.getInsResult());
                    } else {
                        // 如果名称不存在,直接放入 map
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList())){
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                            productDto2.setLastValueList(new ArrayList<>()); // 检验内容
                            productDto2.getLastValueList().add(productDto2.getLastValue());
                        }
@@ -1998,7 +1998,7 @@
                    String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag();
                    if (map.containsKey(productName)) {
                        // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                            map.get(productName)
                                    .getLastValueList()
                                    .add(productDto2.getLastValue());
@@ -2008,7 +2008,7 @@
                                .add(productDto2.getInsResult());
                    } else {
                        // 如果名称不存在,直接放入 map
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList())){
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                            productDto2.setLastValueList(new ArrayList<>()); // 检验内容
                            productDto2.getLastValueList().add(productDto2.getLastValue());
                        }
inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml
@@ -21,4 +21,14 @@
        start_meter_mark,end_meter_mark,insulation_color,
        outer_color,lettering_info,part_props_flag
    </sql>
    <select id="selectCountByPartNoAndLotBatchNo" resultType="java.lang.Long">
        select
            COUNT(iiq.id)
        from ifs_inventory_quantity  iiq
            left join ifs_part_props_record ippr
                on iiq.id = ippr.ifs_inventory_id
        where iiq.part_no = #{partNo}
          and iiq.update_batch_no= #{lotBatchNo}
          and ippr.id  is not null
    </select>
</mapper>