Source/UBCS-WEB/src/components/Crud/Crud.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ <template> <avue-crud :data="data" ></avue-crud> </template> <script> export default { name: "Crud.vue", data(){ return{ data:[], option:{} } } } </script> <style scoped> </style> Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -539,7 +539,7 @@ cell: false, labelWidth: 110, width: 125, sortable: true, sortable: false, }, { label: "屿§ä¸æåç§°", @@ -860,16 +860,17 @@ }, // æåº sortChange(val) { switch (val.order) { // case "ascending": // this.data = this.data.sort((a,b) => { return b['name'].localeCompare(a['name']) }) // this.data = this.data.sort((a,b) => { return b['id'].localeCompare(a['id']) }) // break; // case "descending": // this.data = this.data.sort((a,b) => { return a['name'].localeCompare(b['name']) }) // this.data = this.data.sort((a,b) => { return a['id'].localeCompare(b['id']) }) // break; } console.log(val) // switch (val.order) { // // case "ascending": // // this.data = this.data.sort((a,b) => { return b['name'].localeCompare(a['name']) }) // // this.data = this.data.sort((a,b) => { return b['id'].localeCompare(a['id']) }) // // break; // // case "descending": // // this.data = this.data.sort((a,b) => { return a['name'].localeCompare(b['name']) }) // // this.data = this.data.sort((a,b) => { return a['id'].localeCompare(b['id']) }) // // break; // } } } } Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue
@@ -42,7 +42,8 @@ }, { label:"æè¿°", prop:"description" prop:"description", labelWidth:128, }, { label: 'åå¨çä¸å¡ç±»å', @@ -57,17 +58,18 @@ }, { label:"ç¼ç è§å", prop:"coderuleoidName" prop:"coderuleoidName", labelWidth:128, }, { label:"忽ç¥å¤§å°åæ¥é", label:"å ³é®å±æ§æ¥è¯¢è§å", prop:"codekeyattrrepeatoidName", labelWidth:128, }, { label:"ç¸ä¼¼æ¥è¯¢è§å", prop:"codeResembleRuleOidName", labelWidth:100, labelWidth:128, }, ] }, Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
@@ -12,7 +12,6 @@ <el-button plain size="small" type="primary" @click="flushed">å·æ°</el-button> </div> <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px"> </div> </div> <!-- æ èç¹æ·»å å¯¹è¯æ¡--> @@ -50,9 +49,9 @@ </el-dialog> <!-- ä¿®æ¹å¯¹è¯æ¡--> <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="ä¿®æ¹åç±»"> <classifyTreeform ref="childForm" :TreeNewForm="TreeList" :nodeList="nodeList"></classifyTreeform> <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList"></classifyTreeform> </el-dialog> <avue-tree ref="tree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false" :option="Treeoption" style="height: 80.5vh;padding-top: 5px;padding-bottom: 30px" @node-click=" nodeClick" @@ -74,6 +73,7 @@ @row-save="CrudRowSave" @row-del="CrudRowDel" @row-update="CrudRowUpdata" :before-close="beforeClose" > <template slot="menuLeft"> <el-button plain size="small" type="primary" @click="FindFormVisible = true;">æ¥è¯¢</el-button> @@ -118,12 +118,12 @@ <el-container> <el-aside width="300px"> <div style="margin-bottom: 5px"><el-tag>主é¢åºåç±»</el-tag></div> <!-- å 鿍¡æ¿çæ æ²¿ç¨é¦é¡µæ çloadingåoptionï¼ä½æ¯dataåv-modelç»å®çæ°æ®å建ä¸ä¸ªæ°çåéï¼å¦å¤ç¹å»æ¹æ³ä¹æ¯éæ°è·åæ¥æä½å 鿍¡æ¿çæ°æ®--> <avue-tree ref="tree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" :option="Treeoption" style="height: 50.5vh;margin-right: 10px" @node-click=" nodeClick" @check-change="checkChange" @node-click="ClonenodeClick" > </avue-tree> </el-aside> @@ -244,6 +244,7 @@ TreeAddFormVisible: false, //å½åç¹å»é¡¹ nodeClickList: "", ClonenodeClickList:"", //åç±»å主é¢åºç¶æ TreeFlag: false, //æ å è½½ @@ -264,7 +265,10 @@ }, //avue-treeæ°æ®ï¼ææ¶æ²¡æä½ç¨ï¼éé¢åè½ç¨elementåäºï¼åªç¨avueçä¸ä¸ªæ ç»ä»¶ä¸ç¨å 置表åäºã TreeAvueform: {}, //å éæ CloneTreeAvueform:{}, Treedata: [], CloneTreedata:[], Treeoption: { addBtn: false, editBtn: false, @@ -290,7 +294,7 @@ CloneSelectOptions: [{ value: '0', label: '模æ¿ç¼å·' }, }, { value: '1', label: '模æ¿åç§°' @@ -343,7 +347,7 @@ }, { label: "模æ¿åç§°", prop: "name" prop: "name", }, { label: "æ¨¡æ¿æè¿°", @@ -401,18 +405,20 @@ getAttr() { getAtrrList().then(res => { this.Treedata = res.data; this.Treedata.forEach(() => { this.CloneTreedata = res.data; this.Treedata.forEach((item) => { for (let i = 0; i < this.Treedata.length; i++) { this.Treedata[i].value = i; } }) //è°ç¨ä¿®æ¹å±æ§åæ¹æ³ this.ModifyProperties(this.Treedata, 'text', 'label'); this.ModifyProperties(this.CloneTreedata, 'text', 'label'); }).catch(res => { this.$message.error(res) }) }, //å®ä¹ä¸ä¸ªä¿®æ¹å¯¹è±¡å±æ§åçæ¹æ³ è¿é嫿¹ï¼ï¼ï¼å¥½åæ¯åå°æ¥å£æ°æ®å段ä¸ä¸è´ï¼æ·»å çæ¹æ³ãå ·ä½ä»ä¹åå æä¹å¿è®°äº //å®ä¹ä¸ä¸ªä¿®æ¹æ°æ®å±æ§åçæ¹æ³ ModifyProperties(obj, oldName, newName) { for (let key in obj) { if (key === oldName) { @@ -598,21 +604,12 @@ }) //模æ¿ç®¡çè¡¨æ ¼æ°æ® await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res => { if (this.CloneVisible != true) { this.Formlist = res.data.data.filter(item => { if (item.codeclassifyoid != "") { this.codeClassifyOid = item.codeclassifyoid return item.codeclassifyoid == this.nodeClickList.oid } }) } else { this.CloneFormlist = res.data.data.filter(item => { if (item.codeclassifyoid != "") { this.codeClassifyOid = item.codeclassifyoid return item.codeclassifyoid == this.nodeClickList.oid } }) } this.Formlist = res.data.data.filter(item => { if (item.codeclassifyoid != "") { this.codeClassifyOid = item.codeclassifyoid return item.codeclassifyoid == this.nodeClickList.oid } }) gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => { this.ProData = res.data.data console.log(this.ProData) @@ -633,9 +630,22 @@ console.log(error) } }, //å 鿍¡æ¿æ çç¹å»åæ¢æ°æ® async ClonenodeClick(data){ this.ClonenodeClickList=data; console.log("aaa",this.ClonenodeClickList.oid) await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res=>{ this.CloneFormlist = res.data.data.filter(item => { if (item.codeclassifyoid != "") { this.codeClassifyOid = item.codeclassifyoid return item.codeclassifyoid == this.ClonenodeClickList.oid } }) }) }, //tabæ 忢 handleChange(column) { this.type = column this.type = column; }, // //é«çº§æ¥è¯¢æé® // handleSelectChange(key) { @@ -702,22 +712,24 @@ this.Formlist = res.data.data }) }, //模æ¿ç®¡çè¡¨æ ¼æ·»å CrudRowSave(row,done) { debugger console.log(nodeClickList.length) if (this.nodeClickList.length <= 0) { this.$message({ type: 'warning', message: '请å 仿 ä¸éæ©ä¸æ¡æ°æ®!' }); } else { console.log(this.nodeClickList) let codeClassifyOid = this.codeClassifyOid this.$set(row, "codeclassifyoid", codeClassifyOid) addSave(row).then(res => { this.$message({ type: "success", message: "æ·»å æå!" }); done(row) this.CrudRend() done() }).catch(res => { this.$message({ type: 'info', @@ -727,14 +739,16 @@ } }, //模æ¿ç®¡çä¿®æ¹ CrudRowUpdata(row) { editSave(row).then(() => { CrudRowUpdata(row,index,done) { editSave(row).then((res) => { this.CrudRend() }).catch(res => { this.$message({ type: 'info', message: res type: "success", message: "æä½æå!" }); done() }).catch(res => { console.log(res) }) }, //模æ¿ç®¡çå é¤ @@ -777,7 +791,7 @@ }, //å 鿍¡æ¿éæ©ç¡®å® Clonehandler(){ if(this.CloneFormlist.length <= 0){ if(this.CloneSelect.length <= 0){ this.$message({ type: 'warning', message: 'è¯·éæ©è¦å éçæ¨¡æ¿!' @@ -788,7 +802,8 @@ message: 'åªè½éæ©ä¸æ¡æ°æ®!' }); } else { this.CloneinnerVisible=true this.CloneinnerVisible=true; } }, //ç¹å»ä»å ¶å®æ¨¡æ¿å é @@ -804,16 +819,27 @@ }, //å 鿍¡æ¿åéæ¡æ¹å selectionChange(row){ console.log(row) this.CloneSelect=row this.CloneSelect=row; //ååç»å®ï¼æäº¤è¡¨åè¾å ¥æ¡åå¡«ä¸å½åéæ©çæ°æ® this.CloneModel.id=row[0].id; this.CloneModel.name=row[0].name; //è¿éæç¹ç»ï¼CloneSelectæ¯æéæ©æ¡éæ©çæ°æ®ãçäºthis.nodeClickList.oidæ¯å 为ï¼å 鿍¡æ¿ä¼ éæ°æ®è¦æå½åéæ©æ çoidä¼ éç»å端ãè䏿¯å½åè¦å 鿍¡æ¿çoid this.CloneSelect[0].codeclassifyoid=this.nodeClickList.oid }, //å é表åæäº¤ Clonesubmit(done){ Clonesubmit(row,done){ //éæ°èµå¼CloneSelectä¼ éçæ°æ®ä¸ºè¾å ¥æ¡å¯ä»¥ä¿®æ¹çæ°æ®ï¼CloneModelæäº¤è¡¨åè¾å ¥æ¡ååç»å®æ°æ® this.CloneSelect[0].id=this.CloneModel.id; this.CloneSelect[0].name=this.CloneModel.name; copy(this.CloneSelect[0]).then(res=>{ console.log(res) done() //å 为æ¯åµå¥å¼¹çªæä»¥æå¨å ³éCloneinnerVisibleï¼CloneVisible两个弹çªã this.CloneinnerVisible=false this.CloneVisible=false this.$message.success("å¤å¶æå") this.CrudRend() done(row) }).catch(res=>{ done(res) }) }, //å·æ° @@ -831,10 +857,6 @@ setTimeout(() => { this.FormLoing = false }, 600); }, // å·¦æ å¤é checkChange(val) { console.log(val) }, } } Source/UBCS-WEB/src/main.js
@@ -40,6 +40,7 @@ import referConfigCrudDialog from "@/components/code-dialog-page/referConfigCrudDialog" import referConfigFormDialog from "@/components/code-dialog-page/referConfigFormDialog" import businessAdd from "@/views/modeling/BusinessAdd" import TableCrud from "@/components/Crud/Crud" // å°å·¥å ·å½æ°æ·»å å°å ¨å± import utilFunc from './util/func' @@ -81,6 +82,7 @@ Vue.component('referConfigFormDialog',referConfigFormDialog) Vue.component('businessAdd',businessAdd) Vue.component('attrCrud',attrCrud) Vue.component('TableCrud',TableCrud) Source/UBCS-WEB/src/views/MasterData/items.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,77 @@ <template> <el-container> <el-aside> <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;"> <avue-tree :option="option" :data="data" v-model="form" style="height: 80.5vh;padding-top: 5px;padding-bottom: 30px"></avue-tree> </basic-container> </el-aside> <el-main> <TableCrud></TableCrud> </el-main> </el-container> </template> <script> export default { name: "items.vue", data(){ return{ form:{}, data:[ { value:0, label:'ä¸çº§é¨é¨', children:[ { value:1, label:'ä¸çº§é¨é¨1', },{ value:2, label:'ä¸çº§é¨é¨2', } ] },{ value:3, label:'äºçº§é¨é¨', children:[ { value:4, label:'äºçº§é¨é¨1', },{ value:5, label:'äºçº§é¨é¨2', } ] } ], option:{ title:'ææ¯æ é¢', filterText:"æç´¢å ³é®åèªå®ä¹", defaultExpandAll:true, addBtnText:'æ°å¢èªå®ä¹ææ¡', editBtnText:'ä¿®æ¹èªå®ä¹ææ¡', delBtnText:'å é¤èªå®ä¹ææ¡', defaultExpandedKeys:[1], height:900, formOption:{ labelWidth:100, column:[{ label:'èªå®ä¹é¡¹', prop:'label' }], }, props:{ labelText:'æ é¢', label:'label', value:'value', children:'children' } } } } } </script> <style scoped> </style> Source/UBCS-WEB/src/views/modeling/classifyTree.vue
@@ -15,6 +15,7 @@ crudTreeOption: { index: true, border: true, height:180, column: [ { label: "模æ¿ç¼å·", Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeKeyAttrRepeat.java
@@ -126,7 +126,7 @@ * */ @ApiModelProperty(value = "") private Short revisionseq; private Integer revisionseq; /** * */ @@ -136,7 +136,7 @@ * */ @ApiModelProperty(value = "") private Short versionseq; private Integer versionseq; /** * */ Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeSerialValue.java
@@ -13,7 +13,7 @@ * @date 2022-3-1 */ @Data @TableName("PL_CODE_CODESERIALVALUE") @TableName("PL_CODE_SERIALVALUE") @ApiModel(value = "CodeSerialValue对象", description = "ç¼ç è§åçæµæ°´å¼") @EqualsAndHashCode(callSuper = true) public class CodeSerialValue extends BaseModel { Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeWupin.java
@@ -116,7 +116,7 @@ * */ @ApiModelProperty(value = "") private Short materialtype; private Integer materialtype; /** * */ Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingPreApplyFormVO.java
@@ -1,6 +1,5 @@ package com.vci.ubcs.code.vo.pagemodel; import javax.xml.soap.SAAJResult; /** * è®°å½éæå±æ°æ®ç³è¯·id Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/service/RevisionModelUtil.java
@@ -55,6 +55,7 @@ oidValues.add(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField(s, doObject))); }); tree.setOid((String)oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); tree.setName((String) VciBaseUtil.getValueFromField("name", doObject)); if (f != null) { tree.setText((String)f.apply(doObject)); } else { Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java
@@ -14,6 +14,7 @@ private static final long serialVersionUID = 6886695271635257882L; private String oid; private String text; private String name; private boolean leaf = false; private boolean showCheckbox = false; private boolean checked = false; @@ -44,6 +45,14 @@ this.oid = oid; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getText() { return this.text; } Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/BeanUtilForVCI.java
@@ -7,9 +7,19 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; import java.util.*; public class BeanUtilForVCI { @@ -159,4 +169,136 @@ return result; } } /** * å°ä¸ä¸ª Map 对象转å为ä¸ä¸ª JavaBean * @param clazz è¦è½¬åçç±»å * @param map å å«å±æ§å¼ç map * @return 转ååºæ¥ç JavaBean 对象 * @throws IntrospectionException * 妿åæç±»å±æ§å¤±è´¥ * @throws IllegalAccessException * 妿å®ä¾å JavaBean 失败 * @throws InstantiationException * 妿å®ä¾å JavaBean 失败 * @throws InvocationTargetException * 妿è°ç¨å±æ§ç setter æ¹æ³å¤±è´¥ */ public static <T>T convertMap(Class<T> clazz, Map map) throws IntrospectionException, IllegalAccessException, InstantiationException, InvocationTargetException { BeanInfo beanInfo = Introspector.getBeanInfo(clazz); // è·åç±»å±æ§ T obj = clazz.newInstance(); // ç» JavaBean 对象ç屿§èµå¼ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); for (int i = 0; i< propertyDescriptors.length; i++) { PropertyDescriptor descriptor = propertyDescriptors[i]; String propertyName = descriptor.getName(); if (map.containsKey(propertyName)) { // ä¸é¢ä¸å¥å¯ä»¥ try èµ·æ¥ï¼è¿æ ·å½ä¸ä¸ªå±æ§èµå¼å¤±è´¥çæ¶åå°±ä¸ä¼å½±åå ¶ä»å±æ§èµå¼ã Object value = map.get(propertyName); Object[] args = new Object[1]; args[0] = value; Field privateField = getPrivateField(propertyName, clazz); if (privateField == null) { } privateField.setAccessible(true); String type = privateField.getGenericType().toString(); if (type.equals("class java.lang.String")) { privateField.set(obj, value); } else if (type.equals("class java.lang.Boolean")) { privateField.set(obj, Boolean.parseBoolean(String.valueOf(value))); } else if (type.equals("class java.lang.Long")) { privateField.set(obj, Long.parseLong(String.valueOf(value))); } else if (type.equals("class java.lang.Integer")) { privateField.set(obj, Integer.parseInt(String.valueOf(value))); } else if (type.equals("class java.lang.Double")) { privateField.set(obj,Double.parseDouble(String.valueOf(value))); } else if (type.equals("class java.lang.Float")) { privateField.set(obj,Float.parseFloat(String.valueOf(value))); } else if (type.equals("class java.math.BigDecimal")){ privateField.set(obj,new BigDecimal(String.valueOf(value))); }//å¯ç»§ç»è¿½å ç±»å } } return obj; } /*æ¿å°åå°ç¶ç±»ç§æå±æ§*/ private static Field getPrivateField(String name, Class cls) { Field declaredField = null; try { declaredField = cls.getDeclaredField(name); } catch (NoSuchFieldException ex) { if (cls.getSuperclass() == null) { return declaredField; } else { declaredField = getPrivateField(name, cls.getSuperclass()); } } return declaredField; } /** * è·åå°å¯¹è±¡ä¸å±æ§ä¸ºnullç屿§å * * @param source * @return */ private static String[] getNullPropertyNames(Object source) { final BeanWrapper src = new BeanWrapperImpl(source); PropertyDescriptor[] pds = src.getPropertyDescriptors(); Set<String> emptyNames = new HashSet<>(); for (PropertyDescriptor pd : pds) { Object srcValue = src.getPropertyValue(pd.getName()); if (ObjectUtils.isEmpty(srcValue)) { emptyNames.add(pd.getName()); } } String[] result = new String[emptyNames.size()]; return emptyNames.toArray(result); } /** * æ·è´éç©ºå¯¹è±¡å±æ§å¼ * * @param source * @param target */ public static void copyPropertiesIgnoreNull(Object source, Object target) { BeanUtils.copyProperties(source, target, getNullPropertyNames(source)); } /** * éåæ·è´éç©ºæ°æ® * * @param source æ°æ®æº * @param target ç®æ * @param propertyName è¦å¹é ç屿§å,ä¾å¦ä¸¤ä¸ªéå使ç¨idè¿è¡å¹é æ·è´ propertyName: "id" */ public static void copyListPropertiesIgnoreNull(List<?> source, List<?> target, String propertyName) { if (CollectionUtils.isEmpty(source)) { throw new NullPointerException("copyListPropertiesIgnoreNull sourceæºæ°æ®ä¸ºç©º!"); } Map<Object, Object> map = new HashMap<>(source.size()); source.forEach(s -> { final BeanWrapper sourceBean = new BeanWrapperImpl(s); Object value = sourceBean.getPropertyValue(propertyName); if (value == null) { throw new NullPointerException("copyListPropertiesIgnoreNullè·ååæ°å¼å¸¸"); } map.put(value, s); }); target.forEach(s -> { final BeanWrapper targetBean = new BeanWrapperImpl(s); Object value = targetBean.getPropertyValue(propertyName); if (value == null) { throw new NullPointerException("copyListPropertiesIgnoreNullè·ååæ°å¼å¸¸"); } Object o = map.get(value); copyPropertiesIgnoreNull(o, s); }); } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
@@ -687,13 +687,14 @@ if(StringUtils.isBlank(ruleOid)){ return new ArrayList<>(); } Map<String,String> conditionMap = new HashMap<>(); conditionMap.put("pkCodeRule",ruleOid); // Map<String,String> conditionMap = new HashMap<>(); // conditionMap.put("pkCodeRule",ruleOid); // PageHelper pageHelper = new PageHelper(-1); // pageHelper.addDefaultAsc("ordernum"); QueryWrapper<CodeBasicSec> wrapper = new QueryWrapper<>(); wrapper.eq("pkCodeRule",ruleOid); wrapper.orderByAsc("ordernum"); List<CodeBasicSec> secDOList = codeBasicSecMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper); List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper); return codeBasicSecDO2VOs(secDOList,true); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -25,6 +25,7 @@ import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.CodeKeyAttrRepeatRuleVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.core.log.exception.ServiceException; import com.vci.ubcs.starter.bo.WriteExcelData; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.poi.bo.ReadExcelOption; @@ -45,7 +46,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -255,7 +255,7 @@ if(StringUtils.isBlank(oid)){ throw new ServiceException("oidä¸è½ä¸ºç©ºï¼"); } return !codeClassifyMapper.checkHasChild(oid.trim()); return codeClassifyMapper.checkHasChild(oid.trim()); } @@ -1089,14 +1089,16 @@ CodeClassify classifyDO = selectByOid(codeClassifyOid); //æ¥è¯¢ä¸çº§ fullInfo.setCurrentClassifyVO(codeClassifyDO2VO(classifyDO)); List<Map<String, Object>> maps = codeClassifyMapper.selectAllLevelParentByOid(codeClassifyOid); List<CodeClassify> codeClassifyList = new ArrayList<>(); for (Map<String, Object> map : maps) { CodeClassify codeClassify = new CodeClassify(); codeClassify.setOid(String.valueOf(map.get("OID"))); codeClassify.setOid(String.valueOf(map.get("LEVEL"))); codeClassifyList.add(codeClassify); } // List<Map<String, Object>> maps = codeClassifyMapper.selectAllLevelParentByOid(codeClassifyOid); // List<Map<String, Object>> maps = selectAllLevelParentByOid(codeClassifyOid); List<CodeClassify> codeClassifyList = selectAllLevelParentByOid(codeClassifyOid); // for (Map<String, Object> map : maps) { // CodeClassify codeClassify = new CodeClassify(); // codeClassify.setOid(String.valueOf(map.get("OID"))); // codeClassify.setDataLevel((Integer) map.get("LEVEL")); // codeClassifyList.add(codeClassify); // } fullInfo.setParentClassifyVOs(codeClassifyDO2VOs(codeClassifyList)); if(!CollectionUtils.isEmpty(fullInfo.getParentClassifyVOs())){ fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentcodeclassifyoid())).findFirst().orElseGet(()->null)); Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClstemplateServiceImpl.java
@@ -648,7 +648,10 @@ codeClassifyTemplateDO_old.setDescription(codeClassifyDTO.getDescription());//æè¿° codeClassifyTemplateDO_old.setCodeClassifyOid(codeClassifyOid);//åç±»oid codeClassifyTemplateDO_old.setOid(newOid); List<CodeClassifyTemplate> codeClassifyTemplateDOList = new ArrayList<CodeClassifyTemplate>(); codeClassifyTemplateDO_old.setTs(new Date()); codeClassifyTemplateDO_old.setCreateTime(new Date()); codeClassifyTemplateDO_old.setLastModifyTime(new Date()); List<CodeClassifyTemplate> codeClassifyTemplateDOList = new ArrayList<>(); codeClassifyTemplateDOList.add(codeClassifyTemplateDO_old); //å¤å¶æ¨¡æ¿å±æ§ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -21,6 +21,9 @@ import com.vci.ubcs.code.vo.pagemodel.*; import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; import com.vci.ubcs.code.vo.pagemodel.UITablePageVO; import com.vci.ubcs.omd.feign.IEnumClient; import com.vci.ubcs.omd.feign.IEnumItemClient; import com.vci.ubcs.omd.vo.EnumVO; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; import com.vci.ubcs.starter.revision.service.RevisionModelUtil; @@ -31,12 +34,10 @@ import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; import com.vci.ubcs.starter.web.pagemodel.*; import com.vci.ubcs.starter.web.toolmodel.DateConverter; import com.vci.ubcs.starter.web.util.VciBaseUtil; import com.vci.ubcs.starter.web.util.VciDateUtil; import com.vci.ubcs.starter.web.util.VciQueryWrapperForDO; import com.vci.ubcs.starter.web.util.WebUtil; import com.vci.ubcs.starter.web.util.*; import com.vci.ubcs.system.entity.DictBiz; import com.vci.ubcs.system.feign.IDictBizClient; import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,10 +45,13 @@ import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cglib.beans.BeanMap; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; @@ -84,10 +88,15 @@ @Resource private MdmProductCodeService productCodeService; /** * åå ¸çæå¡ * å¯è¾å¯éçæå¡ */ @Resource IDictBizClient iDictBizClient; /** * åå ¸çæå¡ */ @Resource IEnumClient enumClient; /** * å ¬å¼çæå¡ */ @@ -244,19 +253,19 @@ */ @Override public List<KeyValue> listComboboxItems(CodeClassifyTemplateAttrVO attrVO) { List<KeyValue> comboboxKVs = null; List<KeyValue> comboboxKVs = new ArrayList<>(); if (StringUtils.isNotBlank(attrVO.getEnumString())) { comboboxKVs = JSONObject.parseArray(attrVO.getEnumString(), KeyValue.class); } else { // comboboxKVs = enumService.getEnum(attrVO.getEnumid()); // Dict dict = new Dict(); // dict.setParentId(Long.valueOf(attrVO.getEnumid())); R<List<DictBiz>> list = iDictBizClient.getList(attrVO.getEnumId()); R<List<EnumVO>> list = enumClient.getList(attrVO.getEnumId()); if(list.isSuccess()){ for (DictBiz datum : list.getData()) { for (EnumVO datum : list.getData()) { KeyValue keyValue = new KeyValue(); keyValue.setKey(datum.getDictKey()); keyValue.setValue(datum.getDictValue()); keyValue.setKey(datum.getItemValue()); keyValue.setValue(datum.getItemName()); comboboxKVs.add(keyValue); } } @@ -563,7 +572,9 @@ //没æéå¶åç±»ï¼ä½æ¯ä¸ä¸ªæ¨¡æ¿åªå¯è½å¨ä¸ä¸ªä¸å¡ç±»åéé¢ï¼æä»¥ç´æ¥æ¥è¯¢è¿ä¸ªä¸å¡ç±»åå³å¯ if (!CollectionUtils.isEmpty(conditionMap)) { final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "}; //表éè¦æ¹ // final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "}; final String[] sql = {"select count(*) from pl_code_wupin t where 1 = 1 "}; conditionMap.forEach((key, value) -> { sql[0] += " and " + key + " = " + value; }); @@ -700,7 +711,7 @@ */ private void copyValueToCBO(CodeClassifyFullInfoBO classifyFullInfo, CodeWupin cbo, CodeOrderDTO orderDTO, CodeClassifyTemplateVO templateVO, boolean edit) { boolean edit) { String fullPath = ""; if (!CollectionUtils.isEmpty(classifyFullInfo.getParentClassifyVOs())) { fullPath = classifyFullInfo.getParentClassifyVOs().stream().sorted(((o1, o2) -> o2.getDataLevel().compareTo(o1.getDataLevel()))) @@ -710,8 +721,8 @@ } // BeanUtils. BeanUtils.copyProperties(orderDTO.getData(),cbo); cbo.setMaterialtype(Short.valueOf("1001")); // BeanUtils.copyProperties(orderDTO.getData(),cbo); // cbo.setMaterialtype(Short.valueOf("1001")); // orderDTO.getData().forEach((key, value) -> { // if (!edit || (!checkUnAttrUnEdit(key) && // !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) { @@ -722,18 +733,19 @@ // } // } // }); // BeanMap beanMap = BeanMap.create(cbo); // beanMap.putAll(orderDTO.getData()); try { BeanUtilForVCI.copyPropertiesIgnoreNull(BeanUtilForVCI.convertMap(CodeWupin.class,orderDTO.getData()),cbo); cbo.setCodeclsfid(classifyFullInfo.getCurrentClassifyVO().getOid()); cbo.setCodetemplateoid(templateVO.getOid()); cbo.setCodeclsfpath(fullPath); // cbo.setMaterialclassify("model_type"); // cbo.setMaterialname(orderDTO.getData().get("materialname")); // cbo.setShifoupihaoguanli("true"); // cbo.setKucunwl("true"); // cbo.setXiaoshouwl("false"); cbo.setTs(new Date()); if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) { //æ¾çå½å¨æçèµ·å§ç¶æï¼æä¸ªç¹ï¼ççå½å¨ææ¯å¦éè¦å建 //æ¾çå½å¨æçèµ·å§ç¶æï¼æä¸ªç¹ï¼çå½å¨ææ¯å¦éè¦å建 if (StringUtils.isNotBlank(cbo.getLctid())) { // OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(cbo.getLctid()); // if (lifeCycleVO != null) { @@ -748,7 +760,7 @@ } int secret = VciBaseUtil.getInt(cbo.getSecretGrade().toString()); int secret = VciBaseUtil.getInt(String.valueOf(cbo.getSecretGrade())); //æä¸ªç¹ï¼åç»çå¯çº§æå¡æ¯å¦å¯ç¨ // if (secret == 0 || !secretService.checkDataSecret(secret)) { if (secret == 0 ) { @@ -789,13 +801,13 @@ // } // ClientBusinessObject cbo = cloneClientBusinessObject(hasCreatedCbos.get(btmName)); QueryWrapper<CodeOsbtmtypeEntity> btmWrapper = new QueryWrapper<>(); btmWrapper.eq("ID",btmName); CodeOsbtmtypeEntity btmTypeVO = codeOsbtmtypeMapper.selectOne(btmWrapper); // QueryWrapper<CodeOsbtmtypeEntity> btmWrapper = new QueryWrapper<>(); // btmWrapper.eq("ID",btmName); // CodeOsbtmtypeEntity btmTypeVO = codeOsbtmtypeMapper.selectOne(btmWrapper); // OsBtmTypeVO btmTypeVO = btmService.getBtmById(boName); String userName = AuthUtil.getUser().getUserName(); CodeWupin wupinEntity = new CodeWupin(); wupinEntity.setOid(null); wupinEntity.setOid(VciBaseUtil.getPk()); // bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); // bo.setNameoid((new ObjectUtility()).getNewObjectID36()); wupinEntity.setBtmname(btmName); @@ -807,13 +819,13 @@ wupinEntity.setCreateTime(new Date()); wupinEntity.setLastModifier(userName); wupinEntity.setLastModifyTime(new Date()); wupinEntity.setRevisionRule(btmTypeVO.getRevisionruleid()); wupinEntity.setVersionRule(String.valueOf(btmTypeVO.getVersionRule())); if(StringUtils.isNotBlank(btmTypeVO.getRevisionruleid())){ //æä¸ªç¹ï¼éè¦é®åå¥çæ¬é®é¢ï¼å±ç¤ºé»è®¤ä¸º1 wupinEntity.setRevisionRule("numberversionrule"); wupinEntity.setVersionRule("0"); // if(StringUtils.isNotBlank(btmTypeVO.getRevisionruleid())){ // // OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionruleid()); wupinEntity.setRevisionValue("1"); } wupinEntity.setRevisionValue("1"); // } wupinEntity.setRevisionSeq(1); wupinEntity.setVersionSeq(1); @@ -827,7 +839,7 @@ wupinEntity.setOwner(userName); wupinEntity.setCheckinby(userName); wupinEntity.setCopyFromVersion(""); wupinEntity.setMaterialtype((short) 1001); wupinEntity.setMaterialtype(1001); wupinEntity.setCaigouwl("true"); wupinEntity.setShifoupihaoguanli("true"); wupinEntity.setKucunwl("true"); @@ -1341,7 +1353,7 @@ maps.stream().forEach(map -> { Map<String, String> data = new HashMap<>(); map.forEach((key, value) -> { data.put(((String) key).toLowerCase(Locale.ROOT), (String) value); data.put(((String) key).toLowerCase(Locale.ROOT), String.valueOf(value)); }); dataList.add(data); }); @@ -1514,8 +1526,9 @@ referVO.setValueField(VciQueryWrapperForDO.OID_FIELD); referVO.setTextField("name"); } String referTable = VciBaseUtil.getTableName(referVO.getReferType()); //表éè¦æ¹ // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); String referTable = "pl_code_wupin"; String referTableNick = attrVO.getId() + "0"; String left = " left join " + referTable + " " + referTableNick + " on " + referTableNick + "." + referVO.getValueField() + " = t." + attrVO.getId(); joinTableList.put(attrVO.getId(), left); @@ -1603,7 +1616,9 @@ } whereSql += " and ( t.secretGrade <= " + userSecret + ") "; } String tableName = VciBaseUtil.getTableName(btmType); //è¦æ¹ï¼è¡¨æè·åæé®é¢ // String tableName = VciBaseUtil.getTableName(btmType); String tableName = "pl_code_wupin"; String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(",")) + " from " + tableName + SPACE + "t" + SPACE + joinTableList.values().stream().collect(Collectors.joining(SPACE)) @@ -2049,12 +2064,13 @@ if (!classifyService.checkHasChild(codeClassifyOid)) { conditionMap.put(CODE_CLASSIFY_OID_FIELD, codeClassifyOid); } else { conditionMap.put(CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from " + VciBaseUtil.getTableName(MdmBtmTypeConstant.CODE_CLASSIFY) + " where lcstatus='" + FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED + //表éè¦æ¹ // conditionMap.put(CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from " + VciBaseUtil.getTableName(MdmBtmTypeConstant.CODE_CLASSIFY) conditionMap.put(CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from pl_code_wupin where lcstatus='" + FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED + "' start with parentCodeClassifyOid = '" + codeClassifyOid + "' CONNECT BY PRIOR OID = parentCodeClassifyOid )"); } conditionMap.put("islastr", "1"); conditionMap.put("islastv", "1"); conditionMap.put("lastr", "1"); conditionMap.put("lastv", "1"); return queryGrid(btmTypeId, templateVO, conditionMap, pageHelper); // List<String> selectFieldList = templateVO.getAttributes().stream().map(CodeClassifyTemplateAttrVO::getId).collect(Collectors.toList()); // //åç §è®©å¹³å°ç´æ¥æ¥è¯¢å°±è¡ @@ -2437,7 +2453,7 @@ executionId = executionId.substring(0, executionId.lastIndexOf(".")); } String sql = "select wm_concat(distinct (t.codetempattrOidArr)) codetempattroidarr\n" + "from " + VciBaseUtil.getTableName(MdmBtmTypeConstant.CODE_CLASSIFY_PROCESS_TEMPLATE) + " t\n" + "from pl_code_wupin t\n" + "join PLFLOWINSTANCE plfi on t.ID = plfi.PLTEMPLATEPUID\n" + "where plfi.PLEXECUTIONID = '" + executionId + "' and t.CLASSIFYTEMPLATEOID = '" + templateOid + "' and t.CODEPROCESSUSE = '" + processUse + "'"; // List<ClientBusinessObject> tempAttrOidArr = boService.queryByOnlySql(sql); Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -20,6 +20,7 @@ import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; import com.vci.ubcs.starter.web.constant.QueryOptionConstant; import com.vci.ubcs.starter.web.constant.RegExpConstant; import com.vci.ubcs.starter.web.enumpck.OsCodeFillTypeEnum; @@ -304,6 +305,9 @@ s.setLcStatus(statusMap.get(s.getOid())); }); allCodeDOList.stream().forEach( allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");} ); codeAllCodeService.saveBatch(allCodeDOList); iCodeWupinService.saveBatch(dataCBOList); // batchCBO.getCreateCbos().stream().filter(s -> StringUtils.equalsIgnoreCase("codeallcode",s.getBtmName())).forEach(s -> { Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -52,9 +52,9 @@ </select> <select id="checkHasChild" resultType="java.lang.Boolean"> select count(oid) <![CDATA[select count(oid) from PL_CODE_CLASSIFY where parentCodeClassifyOid = #{oid} where parentCodeClassifyOid = #{oid}]]> </select> <select id="selectCodeClassifyVOByTree" resultMap="plCodeClassifyResultMap"> @@ -141,7 +141,8 @@ </select> <select id="selectAllLevelParentByOid" resultType="java.util.HashMap"> select oid,level from pl_code_classify start with oid= #{oid} connect by prior PARENTCODECLASSIFYOID = oid select oid, level from pl_code_classify start with oid= #{oid} connect by prior PARENTCODECLASSIFYOID = oid </select> <select id="selectByFieldNamePath" resultMap="plCodeClassifyResultMap"> Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodePhaseAttrMapper.xml
@@ -80,31 +80,27 @@ description, oid, versionseq, checkinby, revisionrule, lctid, id, owner, checkoutby, creator, createtime, isfirstv, firstv, attributegroup, revisionoid, btmname, checkouttime, revisionvalue, versionrule, name, islastr, lastr, lastmodifytime, copyfromversion, nameoid, lcstatus, islastv, checkintime, lastv, codephaseoid, isfirstr firstr from PL_CODE_PHASEATTR where codephaseoid in (#{oids})