Merge remote-tracking branch 'origin/master'
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | echoReferConfig(value) { |
| | | this.emitData = value; |
| | | }, |
| | | // 当前已存在编辑过的参照配置,所以直接打开参照配置界面 |
| | | openReconfigInterFace(preReferConfigForm){ |
| | | const form = preReferConfigForm; |
| | |
| | | },{ |
| | | label: '映射其他属性', |
| | | prop: 'mapFields', |
| | | tip: '选择数据后,将选择的数据拷贝到表单里的其他属性,书写格式为{当前表单上的属性:选择数据里的属性,XXXXx:yyyy}', |
| | | tip: '选择数据后,将选择的数据拷贝到表单里的其他属性,书写格式为{当前表单上的属性:选择数据里的属性,"XXXXx":"yyyy"}', |
| | | tipPlacement: 'right', |
| | | span: 7, |
| | | },{ |
| | |
| | | span: 8, |
| | | tip: '分页时每页显示的数量,不分页填-1', |
| | | value: 15, |
| | | rules: [{ |
| | | required: true, |
| | | message: "必填项不能为空", |
| | | trigger: "blur", |
| | | }], |
| | | tipPlacement: 'right', |
| | | },{ |
| | | label: '排序字段', |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | // 选择完参照配置之后点击保存按钮触发 |
| | | async selectedListReferConfig(){ |
| | | // 标记所有表单是否通过校验的变量 |
| | |
| | | break; |
| | | } |
| | | isValid = false; |
| | | //console.log(valid); |
| | | } |
| | | done(); |
| | | }) |
| | |
| | | if (isValid) { |
| | | // 根据类型对form表单中的参数进行过滤,只保留非空且需要的属性 |
| | | let submitForm = this.filterForm(); |
| | | // console.log(submitForm); |
| | | this.$emit('echoReferConfig', submitForm) // 触发update:data将子组件值传递给父组件 |
| | | this.isShowReferConfigForm = false; |
| | | } |
| | |
| | | // 单击表格实现表格行编辑 |
| | | clickAttrEdit(row, column, event){ |
| | | if(this.preClickAttrRow && this.preClickAttrRow != row){ |
| | | //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]); |
| | | this.codeShowFieldConfigVOS[this.preClickAttrRow.$index].$cellEdit = false; |
| | | } |
| | | row.$cellEdit = true; |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | console.log('referer') |
| | | if (!this.referConfig.options) { |
| | | if (!this.referConfig.options && this.referConfig.options.isMuti==undefined) { |
| | | this.referConfig.options = { |
| | | isMuti: false |
| | | isMuti: this.referConfig.options.muti || false |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.page.limit || this.referConfig.options.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; |
| | | if(this.referConfig.options.tableConfig.page){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | | if(this.options.sortField){ |
| | | queryParams['sort'] = this.options.sortField;//字段 |
| | | } |
| | | if(this.options.sortType){ |
| | | queryParams['order'] = this.options.sortType;//方法 |
| | | } |
| | | if (this.options.conditionParams) { |
| | | //说明是扩展属性 |
| | |
| | | if(isMutiValue){ |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | value.push( (item[_itemField] || item['data'][_itemField]) + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | let itemValue=item[_itemField]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_itemField] |
| | | } |
| | | value.push( itemValue + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | }) |
| | | }else { |
| | | value.push(item[_that.props.value] || item['data'][_that.props.value]); |
| | | let itemValue=item[_that.props.value]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_that.props.value] |
| | | } |
| | | value.push(itemValue); |
| | | } |
| | | if(isMutiRaw) { |
| | | var rawFieldArray = _that.props.label.split(","); |
| | | rawFieldArray.forEach((_itemField,_indexField)=>{ |
| | | text.push((item[_itemField] || item['data'][_itemField]) + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | let itemText=item[_itemField]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_itemField] |
| | | } |
| | | text.push(itemText + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | }) |
| | | }else{ |
| | | text.push(item[_that.props.label] || item['data'][_that.props.label]); |
| | | let itemText=item[_that.props.label]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_that.props.label] |
| | | } |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | |
| | | let mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:this.referConfig.fieldMap}); |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | | this.visible=false; |
| | | }, |
| | | searchReset() { |
| | |
| | | }, |
| | | created() { |
| | | this.getParams(); |
| | | |
| | | // console.log('referConfig:') |
| | | // console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | console.log('referrTable') |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.page.limit || this.referConfig.options.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; |
| | | this.page.pageSize=this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.referCrud.doLayout() |
| | |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | | if(this.options.sortField){ |
| | | queryParams['sort'] = this.options.sortField;//字段 |
| | | } |
| | | if(this.options.sortType){ |
| | | queryParams['order'] = this.options.sortType;//方法 |
| | | } |
| | | if (this.options.conditionParams) { |
| | | //说明是扩展属性 |
| | |
| | | if(!tableConfig){ |
| | | this.$message.error( '没有定义参照的表格配置'); |
| | | } |
| | | this.page.pageSize=tableConfig.page.limit || 10; |
| | | if(!paramsData){ |
| | | paramsData = { |
| | | currentUserReferModelKey:this.options.currentUserReferModelKey, |
| | |
| | | if(isMutiValue){ |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | value.push( (item[_itemField] || item['data'][_itemField]) + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | let itemValue=item[_itemField]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_itemField] |
| | | } |
| | | value.push( itemValue + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | }) |
| | | }else { |
| | | value.push(item[_that.props.value] || item['data'][_that.props.value]); |
| | | let itemValue=item[_that.props.value]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_that.props.value] |
| | | } |
| | | value.push(itemValue); |
| | | } |
| | | if(isMutiRaw) { |
| | | var rawFieldArray = _that.props.label.split(","); |
| | | rawFieldArray.forEach((_itemField,_indexField)=>{ |
| | | text.push((item[_itemField] || item['data'][_itemField]) + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | let itemText=item[_itemField]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_itemField] |
| | | } |
| | | text.push(itemText + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | }) |
| | | }else{ |
| | | text.push(item[_that.props.label] || item['data'][_that.props.label]); |
| | | let itemText=item[_that.props.label]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_that.props.label] |
| | | } |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | |
| | | let mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:this.referConfig.fieldMap}); |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | | this.visible=false; |
| | | }, |
| | | searchReset() { |
| | |
| | | queryParams[key] = this.options.rootParams[key]; |
| | | } |
| | | } |
| | | if(this.options.sortField){ |
| | | queryParams['sort'] = this.options.sortField;//字段 |
| | | } |
| | | if(this.options.sortType){ |
| | | queryParams['order'] = this.options.sortType;//方法 |
| | | } |
| | | if (this.options.conditionParams) { |
| | | //说明是扩展属性 |
| | | for (var key in this.options.conditionParams) { |
| | |
| | | } else { |
| | | this.sendGridCodeBasicSec(conditionMaps, true); |
| | | } |
| | | //console.log(conditionMaps); |
| | | } |
| | | }, |
| | | /* 公式编辑框内容改变,子组件编辑完公式之后内容回显时调用 */ |
| | |
| | | }, |
| | | /* 引用码段参照配置,子组件填完参照配置之后内容回显时调用 */ |
| | | setReferConfigValue(content) { |
| | | // console.log(content.referTypeName); |
| | | this.form.referBtmId = content.referType || ""; |
| | | this.form.referBtmName = content.referTypeName || content.referType; |
| | | //转换成JSON字符串进行父组件回显 |
| | | let submitFormJson = JSON.stringify(content); |
| | | this.form.referConfig = submitFormJson || ""; |
| | | debugger; |
| | | }, |
| | | /** 引用码段为【参照引用的业务类型】选取值之后的内容回显时调用 */ |
| | | echoReferBtmType(content) { |
| | |
| | | /** 父分类选择对话框,第二层嵌套对话框,及其相关方法 */ |
| | | /** 保存当前父分类码段的选中行,并进行回显 */ |
| | | saveSelectedParentClassify() { |
| | | //console.log(this.parentClsfyParams.parentClassifySelectionList.length); |
| | | if (this.parentClsfyParams.parentClassifySelectionList.length != 1) { |
| | | this.$message.warning("请选择一条数据!"); |
| | | return false; |
| | |
| | | page.pageSize, |
| | | conditionMaps |
| | | ).then((res) => { |
| | | //console.log(res.data); |
| | | const data = res.data.data; |
| | | parentClsParam.parentClassifyDataPage.total = data.total; |
| | | parentClsParam.parentClassifyData = data.records; |
| | |
| | | /** 加载分类连接属性表格数据 */ |
| | | loadlistClassifyLinkAttr() { |
| | | let attrParam = this.selectAttrParams; |
| | | //console.log(this.currentSelectTreeData); |
| | | this.selectAttrParams.selectAttrOptionLoading = true; |
| | | let conditionMaps = {}; |
| | | if (attrParam.selectAttrQeury) { |
| | |
| | | this.$nextTick(() => { |
| | | this.$refs[attrParam.ref].doLayout(); |
| | | }); |
| | | //console.log(data.data); |
| | | this.selectAttrParams.selectAttrData = data.data; |
| | | this.selectAttrParams.selectAttrOptionLoading = false; |
| | | // 将搜索框内容置空 |
| | |
| | | this.fixedValueOptionLoading = true; |
| | | gridCodeFixedValue(1, -1, { codeFixedSecOid: row.oid }).then((res) => { |
| | | this.fixedValueData = res.data.data.records; |
| | | //console.log(this.fixedValueData); |
| | | this.fixedValueOptionLoading = false; |
| | | }); |
| | | }, |
| | | /** 单击固定码段的码值表中行时触发的事件*/ |
| | | selectedCodeValueRow(row) { |
| | | //console.log(row); |
| | | this.selectedFixedOrCodeclassifyValue = row; |
| | | this.codeFixdForm.id = row.id; |
| | | this.codeFixdForm.description = row.description; |
| | |
| | | } |
| | | this.codeClassifyForm.codeClassifySecOid = |
| | | this.codefixedsecOrCodeclassifysec.oid; |
| | | // console.log(this.codeClassifyForm); |
| | | addSaveCodeClassifyValue(this.codeClassifyForm).then( |
| | | () => { |
| | | this.loadClassifyValueData({ |
| | |
| | | clearFixedOrClassifyForm(condition) { |
| | | //点击取消时清空表单与当前选中的码值,并禁用按钮 |
| | | this.selectedFixedOrCodeclassifyValue = ""; |
| | | //console.log(condition); |
| | | if (condition === "close") { |
| | | this.codeFixdForm = this.$options.data().codeFixdForm; |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | |
| | | }, |
| | | /** 添加*/ |
| | | rowSave(row, done, loading) { |
| | | console.log(row); |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | |
| | | }, |
| | | /** 码段类型改变时,增加对应的form表单中的属性*/ |
| | | changeSectypeFormItems(row) { |
| | | //console.log(row); |
| | | if ( |
| | | func.isEmpty(this.enumParam.secTypeList) || |
| | | this.enumParam.secTypeList.length == 0 |
| | |
| | | componentCodeFlag: this.form.componentCodeFlag, //是否参与编码 |
| | | pkCodeRule: this.form.pkCodeRule, //所属编码规则 |
| | | }; |
| | | //console.log(this.form); |
| | | } |
| | | if (this.form.secType === "codefixedsec") { |
| | | //固定码段 |
| | |
| | | ? row.customCodeSerialClass |
| | | : "", //自定义流水算法 |
| | | }); |
| | | console.log(this.form); |
| | | console.log(this.enumParam.codeFillType); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | | } else if (this.form.secType === "codelevelsec") { |
| | |
| | | : "", //日期格式 |
| | | }); |
| | | } else if (this.form.secType === "codeclassifysec") { |
| | | //console.log(this.form); |
| | | //分类码段 |
| | | this.form = Object.assign({}, this.form, { |
| | | codeSecLengthType: |
| | |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | | } |
| | | // console.log(this.form); |
| | | }, |
| | | /** 第一次请求的枚举数据放缓存*/ |
| | | getLocalStorageEnum(enumKey) { |
| | |
| | | }, |
| | | // 最大流水号 |
| | | maxSerialNum() { |
| | | console.log(this.selectionList); |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择一条编码规则!"); |
| | | return; |
| | |
| | | */ |
| | | @PostMapping(INSERT_BATCH_BY_TYPE) |
| | | R<Integer> insertBatchByType(@RequestParam("btmType")String btmType,@RequestBody List<BaseModel> baseModels); |
| | | |
| | | /** |
| | | * 传入业务类型以及相关数据进行批量更新操作 |
| | | * 更新业务数据同时对码值表数据操作接口 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param baseModels 处理数据 |
| | | * @return 处理状态 |
| | | */ |
| | | @PostMapping(UPDATE_BATCH_BY_TYPE) |
| | | R<Integer> updateBatchByType(@RequestParam("btmType")String btmType,@RequestBody List<BaseModel> baseModels); |
| | | R<Integer>updateBatchBtypeDatas(String btmType, List<BaseModel> baseModels); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> updateBatchByType(String btmType, List<BaseModel> baseModels) { |
| | | public R<Integer> updateBatchBtypeDatas(String btmType, List<BaseModel> baseModels) { |
| | | return R.fail("更新数据失败"); |
| | | } |
| | | |
| | | } |
| | |
| | | public R getApplyGroupCode(DockingReturnStoreVO dockingReturnStoreVO) { |
| | | log.info("获取集团集团码,赋值到主数据 start"); |
| | | try { |
| | | List<BaseModel> editObjectList = new ArrayList(); |
| | | Map<String,List<BaseModel>> editObjectMap = new HashMap<>(); |
| | | |
| | | List<DockingPreApplyForm> dockingPreApplyFormList = new ArrayList(); |
| | | //String classId = javaObject.getClassId(); |
| | |
| | | if (res) { |
| | | //此处需要查询业务数据,去更改 |
| | | BaseModel baseModel = new BaseModel(); |
| | | baseModel.setId("10" + customCoding); |
| | | String classOid=baseModel.getData().getOrDefault("CODECLSFID",""); |
| | | if(partCoe.equals(classOid)){ |
| | | baseModel.setId(10+customCoding); |
| | | } |
| | | String btmeName=baseModel.getBtmname(); |
| | | baseModel.getData().put("groupcode",customCoding); |
| | | log.info("申请单:"+applyId+",集团码:"+customCoding+"编码:"+baseModel.getId()); |
| | | editObjectList.add(baseModel); |
| | | editObjectMap.getOrDefault(btmeName,new ArrayList<>()).add(baseModel); |
| | | |
| | | } |
| | | List<String> dataOidList=new ArrayList<>(); |
| | | dataOidList.add(jdataid); |
| | | } |
| | | if(!CollectionUtils.isEmpty(editObjectMap)) { |
| | | //调用主数据服务批量保存接口 |
| | | mdmEngineClient.updateBatchByType(jdatabtmname,editObjectList); |
| | | editObjectMap.forEach((btmName, modeList) -> { |
| | | mdmEngineClient.updateBatchBtypeDatas(btmName, modeList); |
| | | }); |
| | | } |
| | | dockingPreApplyFormService.saveOrUpdateBatch(dockingPreApplyFormList); |
| | | |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | return R.fail("集团码集成赋值失败"+e); |
| | |
| | | import com.vci.ubcs.code.applyjtcodeservice.entity.*; |
| | | import com.vci.ubcs.code.applyjtcodeservice.service.IGroupMdmInterService; |
| | | import com.vci.ubcs.code.applyjtcodeservice.vo.*; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.result.xml.XMLResultDataObjectDetailDO; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.code.applyjtcodeservice.feign.MdmApplyGroupCodeProvider; |
| | | import com.vci.ubcs.code.applyjtcodeservice.mapper.DockingPreAttrMappingMapper; |
| | |
| | | if (isEditDatas) { |
| | | if (baseModelMap.containsKey(applyId)) { |
| | | BaseModel baseModel = baseModelMap.get(applyId); |
| | | baseModel.getData().getOrDefault("codeclassid",""); |
| | | String classOid=baseModel.getData().getOrDefault("CODECLSFID",""); |
| | | if(partCoe.equals(classOid)){ |
| | | baseModel.setId(10+customCoding); |
| | | } |
| | | BeanUtilForVCI.copyDeclaredIgnoreCase(baseModel, baseModel); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel); |
| | | //baseModel.setId(customCoding); |
| | | |
| | | baseModel.getData().getOrDefault("groupCode", customCoding); |
| | | updateCbos.add(baseModel);//更新数据集团code |
| | | } |
| | |
| | | } |
| | | //保存表单数据 |
| | | dockingPreApplyFormService.saveOrUpdateBatch(dockingPreAttrMappings); |
| | | mdmEngineClient.updateBatchByType(btmName, updateCbos);//保存数据 |
| | | mdmEngineClient.updateBatchBtypeDatas(btmName, updateCbos);//保存数据 |
| | | } |
| | | return R.success("申请接口调用成功"); |
| | | } catch (VciBaseException e) { |
| | |
| | | return R.fail("申请接口开关已关闭,不申请集团码"); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * 主数据像集团更改编码 |
| | | * @param oids 需要修改的数据主键数组 |
| | |
| | | if (baseModelMap.containsKey(applyId)) { |
| | | BaseModel baseModel = baseModelMap.get(applyId); |
| | | //BeanUtilForVCI.copyDeclaredIgnoreCase(baseModelVO, baseModel); |
| | | String classOid=baseModel.getData().getOrDefault("CODECLSFID",""); |
| | | if(partCoe.equals(classOid)){ |
| | | baseModel.setId(10+customCoding); |
| | | } |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel); |
| | | // baseModel.setId(customCoding); |
| | | baseModel.getData().put("groupCode", customCoding); |
| | |
| | | } |
| | | //保存表单数据 |
| | | dockingPreApplyFormService.saveOrUpdateBatch(dockingPreAttrMappings); |
| | | mdmEngineClient.updateBatchByType(btmName, updateCbos);//保存数据 |
| | | mdmEngineClient.updateBatchBtypeDatas(btmName, updateCbos);//保存数据 |
| | | } |
| | | return R.success("更新接口调用成功"); |
| | | } catch (VciBaseException e) { |
| | |
| | | @RestController |
| | | @RequestMapping("/codeSyncUniversalController") |
| | | public class CodeSyncUniversalController { |
| | | |
| | | /** |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 接口集成服务 |
| | | */ |
| | | @Autowired |
| | | private UniversalInterfaceI universalInterfaceI; |
| | | |
| | | /**** |
| | | * 申请接口 |
| | | * @param dataString 属性信息 |
| | |
| | | * @throws Throwable |
| | | */ |
| | | @PostMapping("/applyCode") |
| | | public String applyCode(@RequestParam("dataString")String dataString, @RequestParam("dataType")String dataType) { |
| | | public String applyCode(@RequestParam("dataString")String dataString, @RequestParam("dataType")String dataType, ServletRequest request) { |
| | | String result=""; |
| | | HttpServletRequest httpServletRequest = (HttpServletRequest) request; |
| | | try { |
| | | result = universalInterfaceI.applyCode(dataString, dataType); |
| | | }catch (Throwable e){ |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /**** |
| | | * 更新/删除/状态接口 |
| | | * @param dataString 属性信息 |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /**** |
| | | * 查询分类口 |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 传入业务类型以及相关数据进行批量插入操作 |
| | | * 更新业务数据同时对码值表数据操作接口 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param baseModels 处理数据 |
| | |
| | | */ |
| | | @Override |
| | | @PostMapping(UPDATE_BATCH_BY_TYPE) |
| | | public R<Integer> updateBatchByType(String btmType, List<BaseModel> baseModels) { |
| | | public R<Integer>updateBatchBtypeDatas(String btmType, List<BaseModel> baseModels){ |
| | | try { |
| | | return mdmEngineService.updateBatchByBaseModel(btmType,baseModels); |
| | | return mdmEngineService.updateBatchBtypeDatas(btmType,baseModels); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | import org.apache.http.auth.AuthenticationException; |
| | | |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 免密登录服务 |
| | |
| | | |
| | | /** |
| | | * 免密登录方法 |
| | | * @param username 账号 |
| | | * @param userName 账号 |
| | | * @return |
| | | */ |
| | | boolean passwordFreeLogin(String username, ServletRequest request) throws AuthenticationException; |
| | | boolean passwordFreeLogin(String userName, ServletRequest request) throws AuthenticationException; |
| | | |
| | | } |
| | |
| | | R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels); |
| | | |
| | | /** |
| | | * 更新业务数据同时对码值表数据操作接口 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param baseModels 处理数据 |
| | | * @return 处理状态 |
| | | */ |
| | | public R<Integer>updateBatchBtypeDatas(String btmType, List<BaseModel> baseModels); |
| | | |
| | | /** |
| | | * 默认列表 |
| | | * @param referConfigVO |
| | | * @return |
| | |
| | | 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.vo.CodeKeyAttrRepeatVO; |
| | | import com.vci.ubcs.code.vo.CodeReferConfigVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; |
| | |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import oracle.sql.TIMESTAMP; |
| | | import org.aspectj.apache.bcel.classfile.Code; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | |
| | | |
| | | return R.success("更新成功!"); |
| | | } |
| | | /** |
| | | * 更新业务数据同时对码值表数据操作接口 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param baseModels 处理数据 |
| | | * @return 处理状态 |
| | | */ |
| | | @Transactional(rollbackFor = VciBaseException.class) |
| | | @Override |
| | | public R<Integer> updateBatchBtypeDatas(String btmType, List<BaseModel> baseModels) { |
| | | |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //获取当前业务类型所有字段用来做对比 |
| | | R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(btmType); |
| | | if (!allAttributeByBtmId.isSuccess() || allAttributeByBtmId.getData().getAttributes().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应字段信息,请检查!"); |
| | | } |
| | | Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> { |
| | | return btmTypeAttributeVO.getId(); |
| | | }).collect(Collectors.toSet()); |
| | | if(!CollectionUtils.isEmpty(baseModels)){ |
| | | List<String> oidList=baseModels.stream().filter(data-> com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(data.getOid())).map(BaseModel::getOid).distinct().collect(Collectors.toList()); |
| | | LambdaQueryWrapper<CodeAllCode> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(CodeAllCode::getCreateCodeOid,oidList); |
| | | List<CodeAllCode> codeAllCodeList= codeAllCodeService.selectByWrapper(lqw); |
| | | Map<String, CodeAllCode> cboMap = codeAllCodeList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getCreateCodeOid(), t -> t)); |
| | | List<CodeAllCode> newCodeAllCodeList=new ArrayList<>(); |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String, String>> maps = new ArrayList<>(); |
| | | try { |
| | | baseModels.stream().forEach(baseModel->{ |
| | | String oid=baseModel.getOid(); |
| | | try { |
| | | maps.add(VciBaseUtil.convertBean2Map(baseModel,existFild)); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |
| | | if(cboMap.containsKey(oid)){ |
| | | CodeAllCode codeAllCode= cboMap.get(oid); |
| | | codeAllCode.setId(baseModel.getId()); |
| | | codeAllCode.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | codeAllCode.setLastModifyTime(new Date()); |
| | | codeAllCode.setLcStatus(baseModel.getLcStatus()); |
| | | newCodeAllCodeList.add(codeAllCode); |
| | | } |
| | | }); |
| | | commonsMapper.updateBatchByBaseModel(listR.getData().get(0).getTableName(), maps); |
| | | codeAllCodeService.saveOrUpdateBatch(newCodeAllCodeList); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | return R.success("更新成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 获取参照的信息 |
| | |
| | | //是否调用集团接口申请接口 |
| | | if(isCodeOrGroupCode){ |
| | | List<String> IdList=resultDataObjectDetailDOs.stream().filter(xMLResultDataObjectDetailDO-> com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(xMLResultDataObjectDetailDO.getId())).map(XMLResultDataObjectDetailDO::getId).distinct().collect(Collectors.toList()); |
| | | |
| | | |
| | | |
| | | if(!CollectionUtils.isEmpty(IdList)) { |
| | | this.sendApplyGroupcode(IdList, classifyFullInfo.getTopClassifyVO().getBtmTypeId(),sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue()); |
| | | } |
| | |
| | | // 通过服务注册中心获取网关的端口号 |
| | | @Autowired |
| | | private DiscoveryClient discoveryClient; |
| | | @Value("${user-info.pwd-free-tenant-id}") |
| | | // 配置的免密登录的账号所属的租户id |
| | | @Value("${password-free.pwd-free-tenant-id}") |
| | | // 配置的token在redis中的生存时间 |
| | | private String pwdFreeTenantId; |
| | | @Value("${password-free.token-redis-expire}") |
| | | private Long tokenRedisExpire; |
| | | @Autowired |
| | | private BladeRedis bladeRedis; |
| | | |
| | | // 缓存名 |
| | | public static final String PWD_FREE_LOGIN_TOKEN = "pwdFreeLogin:Token:"; |
| | | private static JwtProperties jwtProperties; |
| | |
| | | |
| | | /** |
| | | * 免密登录,改变当前webservice请求的header |
| | | * @param username 账号 |
| | | * @param userName 账号 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean passwordFreeLogin(String username, ServletRequest servletRequest) throws AuthenticationException { |
| | | public boolean passwordFreeLogin(String userName, ServletRequest servletRequest) throws AuthenticationException { |
| | | //进来先判断缓存中是否存在token |
| | | // 请求来自己哪个ip地址 |
| | | HttpServletRequest request = (HttpServletRequest) servletRequest; |
| | | String ipAddr = request.getRemoteAddr(); |
| | | // 先尝试从缓存当中取,存在就直接从缓存中获取 |
| | | String authToken = bladeRedis.get(PWD_FREE_LOGIN_TOKEN+ipAddr); |
| | | String authToken = bladeRedis.get(PWD_FREE_LOGIN_TOKEN+ipAddr+":"+userName); |
| | | BladeUser user = null; |
| | | //不存在就请求 |
| | | if(Func.isEmpty(authToken)){ |
| | |
| | | headers.set("Tenant-Id", pwdFreeTenantId); |
| | | //设置请求体参数 |
| | | MultiValueMap<String,String> parameters = new LinkedMultiValueMap<String,String>(); |
| | | parameters.add("username",username); |
| | | parameters.add("username",userName); |
| | | parameters.add("grant_type", "passwordfree"); |
| | | parameters.add("scope", "all"); |
| | | parameters.add("type", "account"); |
| | |
| | | // 拼接token格式 |
| | | authToken = "bearer " + tokenUserObject.getAccess_token(); |
| | | // 将token存入缓存当中,过期时间为24小时 |
| | | bladeRedis.setEx(PWD_FREE_LOGIN_TOKEN+ipAddr,"bearer "+tokenUserObject.getAccess_token(),60*60*60*24L); |
| | | bladeRedis.setEx(PWD_FREE_LOGIN_TOKEN+ipAddr+":"+userName,"bearer "+tokenUserObject.getAccess_token(),tokenRedisExpire); |
| | | } |
| | | // 解析token存放进attr中 |
| | | String token2 = JwtUtil.getToken(authToken); |
| | |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | import com.vci.ubcs.system.vo.RoleVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | 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 javax.jws.WebMethod; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.ws.rs.core.Context; |
| | | import javax.xml.ws.WebServiceContext; |
| | | import javax.xml.ws.handler.MessageContext; |
| | | import java.util.*; |
| | |
| | | @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; |
| | | |
| | | /*** |
| | | * 人员相关配置服务 |
| | | */ |
| | | @Autowired(required = false) |
| | | private PersonAndDeptConfig personAndDeptConfig; |
| | | |
| | | /** |
| | | * 缓存服务 |
| | | */ |
| | | //@Autowired |
| | | //private RedisService redisService; |
| | | |
| | | /** |
| | | * 主题库分类的服务 |
| | | */ |
| | |
| | | /** |
| | | * 密级的服务 |
| | | */ |
| | | |
| | | @Resource |
| | | private MdmIOService mdmIOService; |
| | | |
| | |
| | | ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | systemId = interParameterVO.getData().getSystemId(); |
| | | UserVO userVo = interParameterVO.getData().getUser(); |
| | | //免密登录申请token,header往token中添加 |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | |
| | | //调用集团申请接口申请集团码 |
| | | return resultStr; |
| | | } |
| | | |
| | | |
| | | |
| | | /**** |
| | | * 人员数据同步 |
| | |
| | | |
| | | return resultOrgData; |
| | | } |
| | | |
| | | /**** |
| | | * 部门数据同步 |
| | | * @param orgData |
| | |
| | | } |
| | | return resultOrgData; |
| | | } |
| | | |
| | | /*** |
| | | * 统一更新接口(更改状态,更改属性信息)接口 |
| | | * @param data |
| | |
| | | ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | systemId = interParameterVO.getData().getSystemId(); |
| | | UserVO userVo = interParameterVO.getData().getUser(); |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | InterParameterVO finalInterParameterVO = interParameterVO; |
| | | //这是账号信息 |
| | |
| | | } |
| | | QueryData queryData=queryClassifyVO.getData(); |
| | | UserVO userVo=queryData.getUser(); |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | systemId=queryData.getSystemId(); |
| | | QueryLibraryVO libraryVO= queryData.getLibrary(); |
| | | String libId= libraryVO.getId(); |
| | |
| | | CondtionsVO condtionsVO=dataCondtionsVO.getCondtions(); |
| | | systemId=condtionsVO.getSystemId(); |
| | | UserVO userVo=condtionsVO.getUser(); |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | CondtionVO condtionVO= condtionsVO.getCondtion(); |
| | | SessionInfo sessionInfo = new SessionInfo(); |
| | | sessionInfo.setUserId(userVo.getUserName()); |
| | |
| | | return resultStr; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String queryClassifyRule(String data, String dataType) throws Throwable { |
| | | |
| | |
| | | } |
| | | QueryData queryData=queryClassifyVO.getData(); |
| | | UserVO userVo=queryData.getUser(); |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | systemId=queryData.getSystemId(); |
| | | QueryLibraryVO libraryVO= queryData.getLibrary(); |
| | | String libId= libraryVO.getId(); |