| | |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.thoughtworks.xstream.XStream; |
| | | import com.thoughtworks.xstream.io.xml.DomDriver; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.constant.MdmDuckingConstant; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.dto.CodeOrderSecDTO; |
| | | import com.vci.ubcs.code.entity.*; |
| | | import com.vci.ubcs.code.enumpack.CodeDefaultLC; |
| | | import com.vci.ubcs.code.enumpack.CodeSecTypeEnum; |
| | | import com.vci.ubcs.code.enumpack.*; |
| | | import com.vci.ubcs.code.mapper.CommonsMapper; |
| | | import com.vci.ubcs.code.service.*; |
| | | import com.vci.ubcs.code.util.ClientBusinessObject; |
| | |
| | | import com.vci.ubcs.code.wrapper.CodeClassifyWrapper; |
| | | import com.vci.ubcs.omd.feign.IBtmTypeClient; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.ubcs.starter.util.UBCSSqlKeyword; |
| | | import com.vci.ubcs.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST; |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.IMPORT_ROW_INDEX; |
| | | import static com.vci.ubcs.code.enumpack.CodeSecTypeEnum.CODE_CLASSIFY_SEC; |
| | | |
| | | /*** |
| | |
| | | @Slf4j |
| | | @VciWebservice(path = "/universalInterface") |
| | | public class UniversalInterfaceImpl<IDockingLogeServiceing> implements UniversalInterfaceI { |
| | | |
| | | @Value("${code.universalinterface.checkSystemConfig:true}") |
| | | public boolean CODE_CHECKCONFIG; |
| | | @Autowired(required = false) |
| | | private AttributeMapConfig attributeMapConfig; |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private MdmIOService mdmIOService; |
| | | |
| | | @Resource |
| | | private IDockingSystemConfigService dockingSystemConfigService; |
| | | |
| | | @Autowired |
| | | private ICodeClassifyValueService codeClassifyValueService; |
| | |
| | | } |
| | | ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | systemId = interParameterVO.getData().getSystemId(); |
| | | //校验是否配置 |
| | | boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue()); |
| | | if(!checkPass){ |
| | | errorid="101"; |
| | | throw new Throwable("系统标识为【"+systemId+"】,"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | UserVO userVo = interParameterVO.getData().getUser(); |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | |
| | | } |
| | | ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | systemId = interParameterVO.getData().getSystemId(); |
| | | |
| | | //校验是否配置 |
| | | boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue()); |
| | | if (!checkPass) { |
| | | errorid = "101"; |
| | | throw new Throwable("系统标识为【" + systemId + "】," + sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText() + "接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | UserVO userVo = interParameterVO.getData().getUser(); |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | |
| | | String libId= libraryVO.getId(); |
| | | List<String> classifyIdList= libraryVO.getClassifyid(); |
| | | List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>(); |
| | | //校验是否配置 |
| | | boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getValue()); |
| | | if (!checkPass) { |
| | | errorid = "101"; |
| | | throw new Throwable("系统标识为【" + systemId + "】," + sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getText() + "接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | |
| | | //这是账号信息 |
| | | //这是账号信息 |
| | | if(userVo!=null) { |
| | |
| | | errorid = "101"; |
| | | msg = "接口参数:library 为null"; |
| | | throw new Throwable(msg); |
| | | } |
| | | |
| | | //校验是否配置 |
| | | boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue()); |
| | | if (!checkPass) { |
| | | errorid = "101"; |
| | | throw new Throwable("系统标识为【" + systemId + "】," + sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText() + "接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | |
| | | //先简称是否有关联模板,有模板要先删除 |
| | |
| | | String libId= libraryVO.getId(); |
| | | List<String> classifyIdList= libraryVO.getClassifyid(); |
| | | List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>(); |
| | | |
| | | //校验是否配置 |
| | | boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getValue()); |
| | | if (!checkPass) { |
| | | errorid = "101"; |
| | | throw new Throwable("系统标识为【" + systemId + "】," + sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getText() + "接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | |
| | | //这是账号信息 |
| | | //这是账号信息 |
| | | if(userVo!=null) { |
| | |
| | | }else if(secType.equals("coderefersec")){//引用码段 |
| | | codeBasicSecVO.getReferAttributeId(); |
| | | codeBasicSecVO.getReferCodeClassifyOid(); |
| | | codeBasicSecVO.getReferBtmId(); |
| | | codeBasicSecVO.getReferBtmName(); |
| | | //codeBasicSecVO.getReferValueInfo(); |
| | | String referBtmId=codeBasicSecVO.getReferBtmId(); |
| | | String btmName=codeBasicSecVO.getReferBtmName(); |
| | | String referConfig= codeBasicSecVO.getReferConfig(); |
| | | CoderefersecSearchVO coderefersecSearchVO=new CoderefersecSearchVO(); |
| | | if(StringUtils.isNotBlank(referConfig)){ |
| | | coderefersecSearchVO = JSONObject.toJavaObject(JSONObject.parseObject(referConfig), CoderefersecSearchVO.class); |
| | | } |
| | | String buildSqlwhere=""; |
| | | if(coderefersecSearchVO!=null){ |
| | | Map<String,Object> condtionMap=new HashMap<>(); |
| | | List<CodeSrchCondConfigVO> codeSrchCondConfigVOList=coderefersecSearchVO.getCodeSrchCondConfigVOS(); |
| | | |
| | | if(!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) { |
| | | codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> { |
| | | condtionMap.put(codeSrchCondConfigVO.getFilterField()+codeSrchCondConfigVO.getFilterType(),codeSrchCondConfigVO.getFilterValue()); |
| | | }); |
| | | buildSqlwhere= UBCSSqlKeyword.buildSqlwhere(condtionMap); |
| | | } |
| | | } |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | String referTable = listR.getData().get(0).getTableName(); |
| | | StringBuffer sb=new StringBuffer(); |
| | | sb.append(" select * from "); |
| | | sb.append(referTable); |
| | | sb.append(" where 1=1 "); |
| | | if(StringUtils.isNotBlank(buildSqlwhere)){ |
| | | sb.append( buildSqlwhere ); |
| | | } |
| | | List<Map> ListMap= commonsMapper.selectBySql(sb.toString()); |
| | | String valueField=coderefersecSearchVO.getValueField(); |
| | | String textField=coderefersecSearchVO.getTextField(); |
| | | final int[] num = {0}; |
| | | if(!CollectionUtils.isEmpty(ListMap)){ |
| | | ListMap.stream().forEach(map->{ |
| | | num[0]++; |
| | | String id= map.getOrDefault("OID".toUpperCase(Locale.ROOT),"").toString(); |
| | | String value= map.getOrDefault(valueField.toUpperCase(Locale.ROOT),"").toString(); |
| | | String text=map.getOrDefault(textField.toUpperCase(Locale.ROOT),"").toString(); |
| | | String description=map.getOrDefault("description".toUpperCase(Locale.ROOT),"").toString(); |
| | | CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(id, num[0]+"",value,text,"",description); |
| | | codeSectionValueVOList.add(sectionValueVO); |
| | | }); |
| | | } |
| | | log.info(libId); |
| | | }else if(secType.equals("codelevelsec")) {//层级码段 |
| | | int level = codeBasicSecVO.getCodeLevelValue(); |
| | | CodeClassifyVO levelCodeClassifyVO = new CodeClassifyVO(); |
| | |
| | | return resultStr; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 校验是否做了配置 |
| | | * @param systemId,系统标识 |
| | | * @param type:接口类型 |
| | | * @param operationType:接口操作类型 |
| | | * @return |
| | | */ |
| | | private boolean checkIspass(String systemId,String type,String operationType){ |
| | | if(!CODE_CHECKCONFIG) { |
| | | return true; |
| | | } |
| | | //根据类型去查询需要集成的分类或者数据 |
| | | LambdaQueryWrapper<DockingSystemConfig> queryWrapper = Wrappers.<DockingSystemConfig>lambdaQuery(); |
| | | queryWrapper.eq(DockingSystemConfig::getUsedFlag, MdmDuckingConstant.SEND_FLAG_TRUE); |
| | | queryWrapper.eq(DockingSystemConfig::getSysBaseId,systemId); |
| | | queryWrapper.eq(DockingSystemConfig::getDataFlowType,type); |
| | | queryWrapper.eq(DockingSystemConfig::getPushType,operationType); |
| | | return dockingSystemConfigService.count(queryWrapper)>0?true:false; |
| | | } |
| | | } |