¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import com.vci.ubcs.code.service.MdmEngineService; |
| | | import com.vci.ubcs.code.service.MdmIOService; |
| | | import com.vci.ubcs.code.vo.CodeClstemplateVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeImProtRusultVO; |
| | | import com.vci.ubcs.starter.bo.WriteExcelData; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.ubcs.starter.poi.bo.SheetDataSet; |
| | | import com.vci.ubcs.starter.poi.bo.SheetRowData; |
| | | import com.vci.ubcs.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.ubcs.starter.poi.util.ExcelUtil; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciDateUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFRichTextString; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | | import org.apache.poi.ss.usermodel.Font; |
| | | import org.apache.poi.ss.usermodel.RichTextString; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.druid.util.FnvHash.Constants.LIMIT; |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.CODE_FIELD; |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_ATTR_LIST; |
| | | import static com.vci.ubcs.starter.poi.util.ExcelUtil.KEY_ATTR_CHAR; |
| | | import static com.vci.ubcs.starter.poi.util.ExcelUtil.REQUIRED_CHAR; |
| | | |
| | | @Service |
| | | public class MdmIOServiceImpl implements MdmIOService { |
| | | |
| | | |
| | | /** |
| | | * 主é¢åºåç±»çæå¡ |
| | | */ |
| | | @Resource |
| | | private ICodeClassifyService classifyService; |
| | | |
| | | /** |
| | | * 模æ¿çæå¡ |
| | | */ |
| | | @Resource |
| | | private CodeClstemplateServiceImpl templateService; |
| | | |
| | | /** |
| | | * ä¸»æ°æ®å¼æçæå¡ |
| | | */ |
| | | @Resource |
| | | private MdmEngineService engineService; |
| | | |
| | | /** |
| | | * çæå¯¼å
¥çæä»¶ |
| | | * |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | | * @param isHistory æ¯å¦å岿°æ®å¯¼å
¥ |
| | | * @return excelçæä»¶å°å |
| | | */ |
| | | @Override |
| | | public String createImportExcel(String codeClassifyOid, boolean isHistory) { |
| | | List<CodeClstemplateVO> templateVOList=new ArrayList<>(); |
| | | |
| | | VciBaseUtil.alertNotNull("å¯¼åºæ¨¡æ¿","导åºçé
ç½®",codeClassifyOid,"主é¢åºåç±»ç主é®"); |
| | | |
| | | CodeClassifyVO codeClassifyVO = classifyService.getObjectByOid(codeClassifyOid); |
| | | |
| | | if(isHistory){ |
| | | templateVOList= templateService.childTemplates(codeClassifyOid); |
| | | }else{ |
| | | //æ¾æ¨¡æ¿ |
| | | CodeClstemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(codeClassifyOid); |
| | | templateVOList.add(templateVO); |
| | | } |
| | | |
| | | WriteExcelOption eo = new WriteExcelOption(); |
| | | eo.setAppend(true); |
| | | //å¢å 模æ¿çä¿¡æ¯å¯¼å
¥ |
| | | LinkedList<WriteExcelData> tempEDList = new LinkedList<>(); |
| | | tempEDList.add(new WriteExcelData(0,0,"模æ¿ä¸»é®")); |
| | | tempEDList.add(new WriteExcelData(0,1,"模æ¿ä»£å·")); |
| | | tempEDList.add(new WriteExcelData(0,2,"模æ¿åç§°")); |
| | | for(int j=0;j<templateVOList.size();j++){ |
| | | CodeClstemplateVO templateVO=templateVOList.get(j); |
| | | |
| | | //ç»åæ ¼å¼çä¸å¯¼å
¥ï¼ |
| | | // æä¸¾çæä¾åºåçéæ© |
| | | //æ¶é´å
¨é¨ç»ä¸ä¸ºyyyy-MM-dd HH:mm:ss |
| | | //åç
§çèªè¡è¾å
¥åç§° |
| | | //å类注å
¥çä¸ç¨ï¼é½æ¯å¯¼å
¥åèªå¨å¤çç |
| | | //ç¼ç ï¼ç¶æçåæ®µä¸å¯¼å
¥ |
| | | List<CodeClassifyTemplateAttrVO> templateAttrVOS = templateVO.getAttributes().stream().filter(s -> |
| | | !DEFAULT_ATTR_LIST.contains(s.getId()) |
| | | && StringUtils.isBlank(s.getComponentRule()) |
| | | && StringUtils.isBlank(s.getClassifyInvokeAttr()) |
| | | && (isHistory || VciBaseUtil.getBoolean(s.getFormDisplayFlag())) |
| | | ).collect(Collectors.toList()); |
| | | |
| | | if(CollectionUtils.isEmpty(templateAttrVOS)){ |
| | | throw new VciBaseException("æ¨¡æ¿æ²¡æé
置任ä½ãè¡¨åæ¾ç¤ºãä¸ºãæ¯ãç屿§"); |
| | | } |
| | | List<CodeClassifyTemplateAttrVO> idAttrVOList = templateVO.getAttributes().stream().filter(s -> s.getId().equalsIgnoreCase(CODE_FIELD)).collect(Collectors.toList()); |
| | | LinkedList<WriteExcelData> excelDataList = new LinkedList<>(); |
| | | Workbook workbook = new HSSFWorkbook(); |
| | | if(isHistory){ |
| | | excelDataList.add(new WriteExcelData(0,0,"å类路å¾")); |
| | | excelDataList.add(new WriteExcelData(0,1,"ç æ®µå®½åº¦")); |
| | | excelDataList.add(new WriteExcelData(0,2,!CollectionUtils.isEmpty(idAttrVOList)?idAttrVOList.get(0).getName():"ä¼ä¸ç¼ç ")); |
| | | } |
| | | for (int i = 0; i < templateAttrVOS.size(); i++) { |
| | | CodeClassifyTemplateAttrVO attrVO = templateAttrVOS.get(i); |
| | | |
| | | Object text = attrVO.getName(); |
| | | text = exportKeyAndRequired(workbook,attrVO,text); |
| | | int colIndex = (isHistory?3:0) + i; |
| | | WriteExcelData excelData = new WriteExcelData(0, colIndex, text); |
| | | if(StringUtils.isNotBlank(attrVO.getCodeDateFormat()) |
| | | || VciFieldTypeEnum.VTDateTime.name().equalsIgnoreCase(attrVO.getAttributeDataType()) |
| | | || VciFieldTypeEnum.VTDate.name().equalsIgnoreCase(attrVO.getAttributeDataType()) |
| | | ||VciFieldTypeEnum.VTTime.name().equalsIgnoreCase(attrVO.getAttributeDataType())){ |
| | | excelData.setDateFormat(VciDateUtil.DateTimeFormat); |
| | | } |
| | | if(text instanceof RichTextString){ |
| | | excelData.setFontColor(String.valueOf(HSSFColor.HSSFColorPredefined.RED.getIndex())); |
| | | } |
| | | excelDataList.add(excelData); |
| | | if(StringUtils.isNotBlank(attrVO.getEnumString()) || StringUtils.isNotBlank(attrVO.getEnumId())){ |
| | | //æ·»å æ°æ®æææ§ |
| | | List<String> enumValueList = new ArrayList<>(); |
| | | enumValueList.add(""); |
| | | List<KeyValue> valueList = engineService.listComboboxItems(attrVO); |
| | | if(!CollectionUtils.isEmpty(valueList)){ |
| | | valueList.stream().forEach(kv->{ |
| | | enumValueList.add(kv.getValue()); |
| | | }); |
| | | } |
| | | //é»è®¤å 1䏿¡ |
| | | WriteExcelData ed = new WriteExcelData(1,colIndex,""); |
| | | ed.setRowTo(100); |
| | | ed.setColTo(colIndex); |
| | | ed.setValidation(true); |
| | | ed.setValidationDataList(enumValueList); |
| | | ed.setValidationErrorMsg("请å¨åºåä¸éæ©æ£ç¡®çå¼"); |
| | | excelDataList.add(ed); |
| | | } |
| | | if(VciFieldTypeEnum.VTBoolean.name().equalsIgnoreCase(attrVO.getAttributeDataType())){ |
| | | List<String> booleanList = new ArrayList<>(); |
| | | |
| | | booleanList.add("æ¯"); |
| | | booleanList.add("å¦"); |
| | | //é»è®¤å 1䏿¡ |
| | | WriteExcelData ed = new WriteExcelData(1,colIndex,""); |
| | | ed.setRowTo(100); |
| | | ed.setColTo(colIndex); |
| | | ed.setValidation(true); |
| | | ed.setValidationDataList(booleanList); |
| | | ed.setValidationErrorMsg("请å¨åºåä¸éæ©æ£ç¡®çå¼"); |
| | | excelDataList.add(ed); |
| | | } |
| | | } |
| | | eo.addSheetDataList(j+templateVO.getName(),excelDataList); |
| | | tempEDList.add(new WriteExcelData(j+1,0,templateVO.getOid())); |
| | | tempEDList.add(new WriteExcelData(j+1,1,templateVO.getId())); |
| | | tempEDList.add(new WriteExcelData(j+1,2,templateVO.getName())); |
| | | } |
| | | String excelName = LocalFileUtil.getDefaultTempFolder() + File.separator + codeClassifyVO.getName() + (isHistory?"_å岿°æ®å¯¼å
¥æ¨¡æ¿.xls": "_导å
¥æ¨¡æ¿.xls"); |
| | | eo.addSheetDataList(templateVOList.size()+"模æ¿ä¿¡æ¯ã请å¿å é¤æç§»å¨ã",tempEDList); |
| | | ExcelUtil.writeDataToFile(excelName,eo); |
| | | return excelName; |
| | | } |
| | | |
| | | /** |
| | | * 导åºçæ¶åå°è£
å¿
è¾åå
³é®å±æ§ |
| | | * @param attrVO 屿§çæ¾ç¤ºå¯¹è±¡ |
| | | * @param text åå
æ ¼çå¼ |
| | | */ |
| | | private Object exportKeyAndRequired(Workbook workbook,CodeClassifyTemplateAttrVO attrVO,Object text){ |
| | | //å¿
è¾å *ï¼å
³é®å±æ§ä¸ºèè² |
| | | if (VciBaseUtil.getBoolean(attrVO.getRequireFlag()) || VciBaseUtil.getBoolean(attrVO.getKeyAttrFlag())) { |
| | | String value = text.toString(); |
| | | if(VciBaseUtil.getBoolean(attrVO.getRequireFlag())) { |
| | | value += REQUIRED_CHAR; |
| | | } |
| | | if(VciBaseUtil.getBoolean(attrVO.getKeyAttrFlag())){ |
| | | value += KEY_ATTR_CHAR; |
| | | } |
| | | RichTextString ts = new HSSFRichTextString(value); |
| | | if(VciBaseUtil.getBoolean(attrVO.getRequireFlag())){ |
| | | Font font = workbook.createFont(); |
| | | font.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex()); |
| | | ts.applyFont(font); |
| | | } |
| | | |
| | | if(VciBaseUtil.getBoolean(attrVO.getKeyAttrFlag())){ |
| | | Font font = workbook.createFont(); |
| | | font.setColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex()); |
| | | ts.applyFont(font); |
| | | } |
| | | return ts; |
| | | } |
| | | return text; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹éç³è¯·ç¼ç æ°æ® |
| | | * |
| | | * @param orderDTO ç¼ç ç³è¯·ä¿¡æ¯ï¼å¿
é¡»å
å«å类主é®åç æ®µçä¿¡æ¯ |
| | | * @param file excelæä»¶çä¿¡æ¯ |
| | | * @return æé误信æ¯çexcelçæä»¶ |
| | | */ |
| | | @Override |
| | | public CodeImProtRusultVO batchImportCode(CodeOrderDTO orderDTO, File file) { |
| | | VciBaseUtil.alertNotNull(orderDTO,"ç¼ç ç³è¯·ç¸å
³çæ°æ®",orderDTO.getCodeClassifyOid(),"主é¢åºå类主é®"); |
| | | ReadExcelOption reo = new ReadExcelOption(); |
| | | reo.setReadAllSheet(true); |
| | | List<SheetDataSet> sheetDataSetList = ExcelUtil.readDataObjectFromExcel(file,null,reo); |
| | | if(CollectionUtils.isEmpty(sheetDataSetList) || CollectionUtils.isEmpty(sheetDataSetList.get(0).getRowData()) |
| | | ||sheetDataSetList.get(0).getRowData().size()<1){ |
| | | throw new VciBaseException("没æè¯»åå°ä»»ä½çæ°æ®"); |
| | | } |
| | | if(sheetDataSetList.size()>LIMIT+1){ |
| | | throw new VciBaseException("为äºä¿è¯ç³»ç»çç¨³å®æ§ï¼è¯·ä¸æ¬¡ä¸è¦å¯¼å
¥è¶
è¿1䏿¡çæ°æ®"); |
| | | } |
| | | //å
æ¾å°æ¯ä¸è¡çæ é¢ï¼ç¶åæ ¹æ®æ 颿¥è·å对åºç屿§ |
| | | SheetDataSet dataSet = sheetDataSetList.get(0); |
| | | //æ¾ç¬¬ä¸è¡ï¼ä¸ºäºæ¾æ é¢ |
| | | CodeClstemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(orderDTO.getCodeClassifyOid()); |
| | | |
| | | //æ ¡éªæ¨¡æ¿æ¯ä¸æ¯ææ°ç |
| | | checkTemplateSync(sheetDataSetList,templateVO,0); |
| | | //å
ä¸ç¨ç®¡å±æ§æ¯å¦é½åå¨ï¼å
转æ¢ä¸ä¸æ°æ® |
| | | Map<String,String> errorMap = new HashMap<>(); |
| | | String redisUUid=batchImportCodes(orderDTO,templateVO,dataSet,errorMap,true); |
| | | CodeImProtRusultVO codeImProtRusultVO = new CodeImProtRusultVO(); |
| | | List<String> needRowIndexList = new ArrayList<>(); |
| | | // String filePath = returnErrorToExcel(dataSet.getRowData(), errorMap, needRowIndexList, dataSet.getColName()); |
| | | // if(StringUtils.isNotBlank(filePath)) { |
| | | // codeImProtRusultVO.setFilePath(filePath); |
| | | // } |
| | | // if(StringUtils.isNotBlank(redisUUid)){ |
| | | // codeImProtRusultVO.setRedisUuid(redisUUid); |
| | | // } |
| | | return null; |
| | | // return codeImProtRusultVO; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæ¨¡æ¿æ¯å¦ä¸ºåæ¥ç |
| | | * @param sheetDataSetList exceléçå
容 |
| | | * @param templateVO 模æ¿çä¿¡æ¯ |
| | | */ |
| | | private void checkTemplateSync(List<SheetDataSet> sheetDataSetList,CodeClstemplateVO templateVO,int i){ |
| | | String templateOidInExcel = ""; |
| | | String templateName=""; |
| | | if(!CollectionUtils.isEmpty(sheetDataSetList) |
| | | && sheetDataSetList.size()>1 && !CollectionUtils.isEmpty(sheetDataSetList.get(sheetDataSetList.size()-1).getColName())){ |
| | | List<SheetRowData> rowData= sheetDataSetList.get(sheetDataSetList.size()-1).getRowData(); |
| | | templateName=rowData.get(i).getData().get(2); |
| | | templateOidInExcel=rowData.get(i).getData().get(0); |
| | | //templateOidInExcel = sheetDataSetList.get(sheetDataSetList.size()-1).getColName().get(sheetDataSetList.size()-i); |
| | | } |
| | | /* if(!CollectionUtils.isEmpty(sheetDataSetList) |
| | | && sheetDataSetList.size()>1 && !CollectionUtils.isEmpty(sheetDataSetList.get(sheetDataSetList.size()-1).getColName())){ |
| | | List<SheetRowData> rowData= sheetDataSetList.get(sheetDataSetList.size()-1).getRowData(); |
| | | templateOidInExcel=rowData.get(i).getData().get(0); |
| | | //templateOidInExcel = sheetDataSetList.get(sheetDataSetList.size()-1).getColName().get(sheetDataSetList.size()-i); |
| | | }*/ |
| | | if(StringUtils.isBlank(templateOidInExcel) || !templateOidInExcel.equalsIgnoreCase(templateVO.getOid())){ |
| | | throw new VciBaseException("模æ¿ã"+templateName+"ãä¸çæ°æ®è·åçæ¨¡çä¿¡æ¯ä¸å½å模æ¿ä¸å¹é
ï¼è¯·ç¡®ä¿excelæä»¶éæã模æ¿ä¿¡æ¯-请å¿ç§»å¨æå é¤ãçå·¥ä½è¡¨ï¼ä¸ç¡®ä¿æ¯æ¬¡å¯¼å
¥é½æ¯å
ä¸è½½ç导å
¥æ¨¡æ¿åæ·»å çæ°æ®"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * æ¹éå¤çç³è¯·æ°æ® |
| | | * @param orderDTO |
| | | * @param templateVO |
| | | * @param dataSet |
| | | * @return |
| | | */ |
| | | private String batchImportCodes(CodeOrderDTO orderDTO,CodeClstemplateVO templateVO,SheetDataSet dataSet,Map<String,String> errorMap,boolean isEnumType){ |
| | | List<String> codeList=new ArrayList<>(); |
| | | // CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | //è§åç主é®éè¦å»è·å |
| | | // CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo); |
| | | // //1.夿è§åä¸é¤äºæµæ°´ç æ®µï¼æ¯å¦æå
¶ä»ç 段 |
| | | // engineService.checkSecValueOnOrder(ruleVO,orderDTO); |
| | | // List<SheetRowData> rowDataList = dataSet.getRowData(); |
| | | // |
| | | // //é¤å»é»è®¤ç屿§.è¿æåªæè¡¨åæ¾ç¤ºçåæ®µæå¯¼å
¥ |
| | | // List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> |
| | | // !DEFAULT_ATTR_LIST.contains(s.getId()) && VciBaseUtil.getBoolean(s.getFormdisplayflag()) |
| | | // ).collect(Collectors.toList()); |
| | | // Map<Integer/**åå·**/,String/**åæ®µçåç§°**/> fieldIndexMap = new HashMap<>(); |
| | | // List<String> titleRowData = dataSet.getColName(); |
| | | // Map<String/**䏿åç§°**/, String/**è±æåç§°**/> attrNameIdMap = attrVOS.stream().collect(Collectors.toMap(s -> s.getName(), t -> t.getId().toLowerCase(Locale.ROOT),(o1, o2)->o2)); |
| | | // getFieldIndexMap(titleRowData,attrNameIdMap,fieldIndexMap); |
| | | // |
| | | // //éè¦å¤ææ¯å¦ææç屿§é½å¨æ¨¡æ¿ä¸äº |
| | | // List<CodeClassifyTemplateAttrVO> unExistAttrVOs = attrVOS.stream().filter(s -> !fieldIndexMap.containsValue(s.getId().toLowerCase(Locale.ROOT)) |
| | | // && StringUtils.isBlank(s.getComponentrule()) && StringUtils.isBlank(s.getClassifyinvokeattr())//ç»åè§ååå类注å
¥ç¡®å®æ²¡ç»ç¨æ·å¯¼åºå» |
| | | // ).collect(Collectors.toList()); |
| | | // if(!CollectionUtils.isEmpty(unExistAttrVOs)){ |
| | | // throw new VciBaseException("ã" + unExistAttrVOs.stream().map(CodeClassifyTemplateAttrVO::getName) + "ãè¿äºå±æ§å¨åè¡¨ä¸æ²¡ææ¾å°"); |
| | | // } |
| | | // List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | // String fullPath = getFullPath(classifyFullInfo); |
| | | // excelToCbo(classifyFullInfo,fieldIndexMap,rowDataList,templateVO,cboList,fullPath,true); |
| | | // |
| | | // //é½è½¬æ¢å®äºãéè¦æ¹éæ£æ¥ |
| | | // //妿åºéäºï¼æä»¬ä¾ç¶æ§è¡ææçæ°æ®ï¼æ æçæ°æ®ååå°excelä¸ |
| | | // //2.夿å¿
è¾é¡¹ããéè¦å
¨é¨ç屿§ï¼å¦ææ¯å¿
è¾ï¼ä½æ¯è¡¨åéé¢ä¸æ¾ç¤ºçï¼åªè½æ¯å类注å
¥æè
ç»åè§å |
| | | // batchCheckRequiredAttrOnOrder(templateVO,cboList,errorMap); |
| | | // //3.夿å
³é®å±æ§ |
| | | // CodeImportResultVO keyResultVO = batchCheckKeyAttrOnOrder(classifyFullInfo, templateVO, cboList); |
| | | // Set<String> selfRepeatRowIndexList = keyResultVO.getSelfRepeatRowIndexList(); |
| | | // Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList(); |
| | | // if(!CollectionUtils.isEmpty(selfRepeatRowIndexList)){ |
| | | // selfRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | // errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å¨å½åå¤ççæ°æ®æä»¶ä¸å
³é®å±æ§éå¤" ); |
| | | // }); |
| | | // } |
| | | // if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){ |
| | | // keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | // errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å
³é®å±æ§ä¸ç³»ç»ä¸çéå¤" ); |
| | | // }); |
| | | // } |
| | | // //å类注å
¥ |
| | | // batchSwitchClassifyAttrOnOrder(attrVOS,cboList,classifyFullInfo,false); |
| | | // //boolean |
| | | // reSwitchBooleanAttrOnOrder(attrVOS,cboList); |
| | | // //4.æ ¡éªè§å |
| | | // batchCheckVerifyOnOrder(attrVOS, cboList,errorMap); |
| | | // if(isEnumType) {//æ¯å¦éè¦æ ¡éªæä¸¾/åç
§ |
| | | // //5.æ ¡éªæä¸¾æ¯å¦æ£ç¡® |
| | | // batchSwitchEnumAttrOnOrder(attrVOS, cboList, errorMap); |
| | | // //7.å¤çåç
§çæ
åµ |
| | | // batchSwitchReferAttrOnOrder(attrVOS,cboList,errorMap); |
| | | // } |
| | | // //6.æ¶é´æ ¼å¼çéªè¯ |
| | | // //6.æ¶é´çï¼å¿
é¡»ç»ä¸ä¸ºyyyy-MM-dd HH:mm:ss |
| | | // batchSwitchDateAttrOnOrder(attrVOS,cboList,errorMap); |
| | | // //æåå¼ç»åè§å |
| | | // batchSwitchComponentAttrOnOrder(attrVOS,cboList); |
| | | // String uuid=redisService.getUUIDEveryDay(); |
| | | // Map<String, ClientBusinessObject> rowIndexCboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t)); |
| | | // |
| | | // if(errorMap.size()>0) { |
| | | // createRedisDatas(uuid + "-error",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, errorMap,false); |
| | | // } |
| | | // boolean isCreateUUid=false; |
| | | // List<ClientBusinessObject> needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !errorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // //ç¸ä¼¼æ ¡éª |
| | | // Map<String,String>resembleMap=new HashMap<>(); |
| | | // List<DataResembleVO> dataResembleVOS=new ArrayList<>(); |
| | | // String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | // bathcResembleQuery(orderDTO.getCodeClassifyOid(),templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS); |
| | | // if(resembleMap.size()>0) { |
| | | // isCreateUUid=true; |
| | | // if(!CollectionUtils.isEmpty(dataResembleVOS)) { |
| | | // redisService.setCacheList(uuid + "-resemble-data", dataResembleVOS); |
| | | // createRedisDatas(uuid + "-resemble",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, resembleMap, false); |
| | | // } |
| | | // } |
| | | // //æé¤é误çï¼å©ä¸æ£ç¡®ç |
| | | // Map<String,String> newErrorMap=new HashMap<>(); |
| | | // newErrorMap.putAll(resembleMap); |
| | | // newErrorMap.putAll(errorMap); |
| | | // needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !newErrorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // if((errorMap.size()>0&&needSaveCboList.size()>0)||resembleMap.size()>0){ |
| | | // isCreateUUid=true; |
| | | // } |
| | | // createRedisByCodeClassify(uuid + "-class",templateVO,dataSet,fieldIndexMap,false); |
| | | // if(newErrorMap.size()>0) { |
| | | // createRedisDatas(uuid + "-ok",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, newErrorMap,true); |
| | | // }else { |
| | | // uuid=""; |
| | | // //è¦æä»¥ä¸çé误ç齿åºåï¼åç»§ç»å¤çæ¶é´åç»åè§å |
| | | // needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !newErrorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // if (!CollectionUtils.isEmpty(needSaveCboList)) { |
| | | // //9.æä»¬å¤çä¸å¡æ°æ® |
| | | // //çæç¼ç çå
容 |
| | | // codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), needSaveCboList); |
| | | // //妿æ¯ç¼ç çæå¤±è´¥ï¼åç´æ¥å°±å¤±è´¥äºï¼å
¶ä»çå¤æåºæ¥æé误çæä»¬é½ç»ä¸è¿åå°exceléé¢ |
| | | // engineService.batchSaveSelectChar(templateVO, needSaveCboList); |
| | | // } |
| | | // } |
| | | // if(!isCreateUUid){ |
| | | // return uuid=""; |
| | | // } |
| | | // return uuid; |
| | | return null; |
| | | } |
| | | } |