| | |
| | | import java.io.StringWriter; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.ForkJoinPool; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | |
| | | */ |
| | | @Value("${bzApply.seriesFlow:seriesFlow}") |
| | | private String seriesFlow; |
| | | |
| | | /*** |
| | | * 是否变更系列 |
| | | */ |
| | | @Value("${bzApply.isEditSeries:isEditSeries}") |
| | | private String isEditSeries; |
| | | |
| | | /*** |
| | | * 控制是否写入值的码段名称 |
| | | */ |
| | |
| | | */ |
| | | @Value("${bzApply.yearSecName:年代号}") |
| | | private String yearSecName; |
| | | |
| | | |
| | | @Value("${code.universalinterface.checkSystemConfig:true}") |
| | | public boolean CODE_CHECKCONFIG; |
| | |
| | | */ |
| | | @Resource |
| | | private IDockingLogeService dockingLogeService; |
| | | |
| | | @Resource |
| | | private IPasswordFreeLoginService passwordFreeLoginService; |
| | | |
| | | /** |
| | | * 自定义并发ForkJoinPool |
| | | */ |
| | | private static final ForkJoinPool customForkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors() - 1); |
| | | |
| | | private static String separator="##VCI##"; |
| | | private String errorid="0"; |
| | |
| | | throw new Throwable("用户鉴权失败."); |
| | | } |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | | //InterParameterVO finalInterParameterVO = interParameterVO; |
| | | //这是账号信息 |
| | | SessionInfo sessionInfo = new SessionInfo(); |
| | | sessionInfo.setUserId(userVo.getUserName()); |
| | | sessionInfo.setUserName(userVo.getTrueName()); |
| | | sessionInfo.setIp(userVo.getIp()); |
| | | VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | // List<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new ArrayList<>(); |
| | | //List<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new ArrayList<>(); |
| | | String finalSystemId = systemId; |
| | | classVOList.stream().forEach(classVO -> { |
| | | log.info("参数:分类COde:" + classVO.getClassCode()); |
| | |
| | | */ |
| | | @Override |
| | | public ResultOrgData syncDataForPerson(PersonData personData) { |
| | | |
| | | boolean isUsedFlag= personAndDeptConfig.isUsedFlag(); |
| | | ResultOrgData resultOrgData=new ResultOrgData(); |
| | | |
| | |
| | | throw new Throwable("编码规则"); |
| | | } |
| | | List<XMLResultDataObjectDetailDO> xDOs=new CopyOnWriteArrayList<>(); |
| | | dataObjectVO.getRowData().parallelStream().forEach(rowData->{ |
| | | final List<RowDatas> rowDatas = dataObjectVO.getRowData(); |
| | | rowDatas.parallelStream().forEach(rowData->{ |
| | | String mesg=""; |
| | | try { |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | |
| | | resultDataObjectDetailDOs.addAll(xDOs); |
| | | boolean finalSuccess1 = success.get(); |
| | | String finalMessage1 = message; |
| | | resultDataObjectDetailDOs.stream().forEach(resultDataObjectDetailDO->{ |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | | resultMdMapping.setBusiDataId(resultDataObjectDetailDO.getId()); |
| | | resultMdMapping.setSuccess(finalSuccess1); |
| | | resultMdMapping.setEntityCode(" "); |
| | | resultMdMapping.setMdmCode(resultDataObjectDetailDO.getCode()); |
| | | resultMdMapping.setMessage(finalMessage1); |
| | | resultMdMapping.setSubMdMappings(null); |
| | | resultMdMappingList.add(resultMdMapping); |
| | | }); |
| | | // 限制线程并行数量 |
| | | customForkJoinPool.submit(()->{ |
| | | resultDataObjectDetailDOs.stream().forEach(resultDataObjectDetailDO->{ |
| | | ResultMdMapping resultMdMapping=new ResultMdMapping(); |
| | | resultMdMapping.setBusiDataId(resultDataObjectDetailDO.getId()); |
| | | resultMdMapping.setSuccess(finalSuccess1); |
| | | resultMdMapping.setEntityCode(" "); |
| | | resultMdMapping.setMdmCode(resultDataObjectDetailDO.getCode()); |
| | | resultMdMapping.setMessage(finalMessage1); |
| | | resultMdMapping.setSubMdMappings(null); |
| | | resultMdMappingList.add(resultMdMapping); |
| | | }); |
| | | }).join(); |
| | | log.info("end:申请获取完毕"); |
| | | } |
| | | }catch (Throwable e){ |
| | |
| | | public ResultOrgData syncDataForOrg(OrgData orgData) { |
| | | boolean isUsedFlag= personAndDeptConfig.isUsedFlag(); |
| | | ResultOrgData resultOrgData=new ResultOrgData(); |
| | | boolean isPersonApplyGroupCode= personAndDeptConfig.isDeptApplyGroupCode(); |
| | | //boolean isPersonApplyGroupCode= personAndDeptConfig.isDeptApplyGroupCode(); |
| | | List<ResultMdMapping> resultMdMappingList=new ArrayList<>(); |
| | | AtomicBoolean success= new AtomicBoolean(true); |
| | | String message=""; |
| | |
| | | List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> !DEFAULT_SYNC_ATTR_LIST.contains(s.getId()) && |
| | | ((Func.isNotEmpty(s.getClassifyInvokeAttr()) || Func.isNotEmpty(s.getClassifyInvokeAttrName())) || VciBaseUtil.getBoolean(s.getFormDisplayFlag())) |
| | | ).collect(Collectors.toList()); |
| | | List<Map> dataList=new ArrayList<>(); |
| | | List<String> codeList=new ArrayList<>(); |
| | | List<ApplyDataVO> applyDataVOList=new ArrayList<>(); |
| | | List<ApplyDataVO> deleteDataVOList=new ArrayList<>(); |
| | |
| | | DataObjectVO dataObjectVO = new DataObjectVO(); |
| | | this.getConfigDatas(systemCode, deptLibrary, editDatasVO, attrVOS, dataObjectVO); |
| | | log.info("start:修改数据执行完毕"); |
| | | boolean personApplyGroupCode =personAndDeptConfig.isPersonApplyGroupCode(); |
| | | boolean personApplyGroupCode = personAndDeptConfig.isPersonApplyGroupCode(); |
| | | mdmIOService.batchSyncEditDatas(codeClassifyVO,dataObjectVO, resultDataObjectDetailDOs,personApplyGroupCode); |
| | | log.info("end:修改数据执行完毕"); |
| | | } |
| | |
| | | throw new Throwable("编码规则"); |
| | | } |
| | | List<XMLResultDataObjectDetailDO> xDOs=new CopyOnWriteArrayList<>(); |
| | | dataObjectVO.getRowData().parallelStream().forEach(rowData->{ |
| | | String mesg=""; |
| | | try { |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList=new ArrayList<>(); |
| | | orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//分类主键 |
| | | orderDTO.setTemplateOid(templateVO.getOid()); |
| | | orderDTO.setCreator(rowData.getCreator()); |
| | | orderDTO.setLastModifier(rowData.getEditor()); |
| | | orderDTO.setLcStatus(rowData.getStatus()); |
| | | if(!CollectionUtils.isEmpty(ruleVO.getSecVOList())) { |
| | | ruleVO.getSecVOList().stream().forEach(codeBasicSecVO -> { |
| | | if (codeBasicSecVO.getSecType().equals("codevariablesec")) {//规则之定义为可变码段存储主数据传递过来的数据 |
| | | CodeOrderSecDTO CodeOrderSecDTO = new CodeOrderSecDTO(); |
| | | CodeOrderSecDTO.setSecOid(codeBasicSecVO.getOid()); |
| | | CodeOrderSecDTO.setSecValue(rowData.getCode()); |
| | | codeOrderSecDTOList.add(CodeOrderSecDTO); |
| | | |
| | | } |
| | | }); |
| | | } |
| | | orderDTO.setCodeRuleOid(ruleVO.getOid()); |
| | | orderDTO.setSecDTOList(codeOrderSecDTOList);//存储编码 |
| | | orderDTO.setData(rowData.getFiledValue()); |
| | | String code=engineService.addSaveCodeNotauthUser(orderDTO,false); |
| | | if(StringUtils.isNotBlank(code)) { |
| | | //限制线程并行数量 |
| | | customForkJoinPool.submit(()->{ |
| | | dataObjectVO.getRowData().parallelStream().forEach(rowData->{ |
| | | String mesg=""; |
| | | try { |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList=new ArrayList<>(); |
| | | orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//分类主键 |
| | | orderDTO.setTemplateOid(templateVO.getOid()); |
| | | orderDTO.setCreator(rowData.getCreator()); |
| | | orderDTO.setLastModifier(rowData.getEditor()); |
| | | orderDTO.setLcStatus(rowData.getStatus()); |
| | | if(!CollectionUtils.isEmpty(ruleVO.getSecVOList())) { |
| | | ruleVO.getSecVOList().stream().forEach(codeBasicSecVO -> { |
| | | if (codeBasicSecVO.getSecType().equals("codevariablesec")) { |
| | | //规则之定义为可变码段存储主数据传递过来的数据 |
| | | CodeOrderSecDTO CodeOrderSecDTO = new CodeOrderSecDTO(); |
| | | CodeOrderSecDTO.setSecOid(codeBasicSecVO.getOid()); |
| | | CodeOrderSecDTO.setSecValue(rowData.getOid()); |
| | | codeOrderSecDTOList.add(CodeOrderSecDTO); |
| | | } |
| | | }); |
| | | } |
| | | orderDTO.setCodeRuleOid(ruleVO.getOid()); |
| | | orderDTO.setSecDTOList(codeOrderSecDTOList);//存储编码 |
| | | orderDTO.setData(rowData.getFiledValue()); |
| | | String code = engineService.addSaveCodeNotauthUser(orderDTO,false); |
| | | /*if(StringUtils.isNotBlank(code)) { |
| | | //rowData.setCode(code); |
| | | StringBuffer sqlsb = new StringBuffer(); |
| | | sqlsb.append(" select * from "); |
| | |
| | | mesg = "数据保存成功,等待申请集团码"; |
| | | } |
| | | } |
| | | }*/ |
| | | } catch (Exception e) { |
| | | mesg=e.getMessage(); |
| | | e.printStackTrace(); |
| | | throw new ServiceException(e.getMessage()); |
| | | }finally { |
| | | XMLResultDataObjectDetailDO x=new XMLResultDataObjectDetailDO(); |
| | | x.setId(rowData.getOid()); |
| | | x.setCode(rowData.getCode()); |
| | | x.setMsg(mesg); |
| | | x.setErrorid("1"); |
| | | xDOs.add(x); |
| | | } |
| | | } catch (Exception e) { |
| | | mesg=e.getMessage(); |
| | | e.printStackTrace(); |
| | | throw new ServiceException(e.getMessage()); |
| | | }finally { |
| | | XMLResultDataObjectDetailDO x=new XMLResultDataObjectDetailDO(); |
| | | x.setId(rowData.getOid()); |
| | | x.setCode(rowData.getCode()); |
| | | x.setMsg(mesg); |
| | | x.setErrorid("1"); |
| | | xDOs.add(x); |
| | | } |
| | | }); |
| | | }); |
| | | }).join(); |
| | | resultDataObjectDetailDOs.addAll(xDOs); |
| | | boolean finalSuccess1 = success.get(); |
| | | String finalMessage1 = message; |
| | |
| | | throw new Throwable("用户鉴权失败"); |
| | | } |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | | //InterParameterVO finalInterParameterVO = interParameterVO; |
| | | //这是账号信息 |
| | | SessionInfo sessionInfo = new SessionInfo(); |
| | | sessionInfo.setUserId(userVo.getUserName()); |