已修改10个文件
已重命名4个文件
已添加6个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | |
| | | import com.vci.base.ui.swing.VCISwingUtil; |
| | | import com.vci.base.ui.swing.components.VCIJButton; |
| | | import com.vci.base.ui.swing.components.VCIJLabel; |
| | | import com.vci.base.ui.swing.components.VCIJPanel; |
| | | import com.vci.base.ui.swing.components.VCIJTextField; |
| | | import com.vci.ubcs.code.vo.webserviceModel.coderule.CodeShowFieldConfigVO; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefer; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.awt.*; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class attarSearchPanel extends VCIJPanel { |
| | | |
| | | private LinkedHashMap<String , VCIJTextField> attrInerNameValMap = new LinkedHashMap<String,VCIJTextField>(); |
| | | private UIFormRefer uiFormRefer; |
| | | public attarSearchPanel(UIFormRefer uiFormRefer){ |
| | | this.uiFormRefer = uiFormRefer; |
| | | init(); |
| | | } |
| | | private void init(){ |
| | | initcomponam(); |
| | | } |
| | | private void initcomponam(){ |
| | | this.setLayout(new GridBagLayout()); |
| | | setAttrSearch(); |
| | | this.setVisible(true); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * <p>æåºæ¬å±æ§ä¿¡æ¯åå§åå°ç»ä»¶ä¸é¢ãå¹¶ä¿å屿§å°Mapï¼å±æ§å
é¨åç§°--textFieldï¼ä¸</p> |
| | | * |
| | | * @time 2013-3-17 |
| | | */ |
| | | private void setAttrSearch(){ |
| | | List<CodeShowFieldConfigVO> codeShowFieldConfigVOS=this.uiFormRefer.getCodeShowFieldConfigVOS(); |
| | | if(!CollectionUtils.isEmpty(codeShowFieldConfigVOS)){ |
| | | CodeShowFieldConfigVO[] objs=codeShowFieldConfigVOS.toArray(new CodeShowFieldConfigVO []{}); |
| | | GridBagConstraints cons = new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.EAST , GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0); |
| | | for(int i = 0 ;i<objs.length;i++){ |
| | | if(cons.gridx == 1 ){ |
| | | cons.gridwidth = GridBagConstraints.REMAINDER; |
| | | cons.anchor = GridBagConstraints.WEST; |
| | | }else if(cons.gridx >1){ |
| | | cons.gridx = 0; |
| | | cons.anchor = GridBagConstraints.EAST; |
| | | cons.gridy++; |
| | | cons.gridwidth = 1; |
| | | } |
| | | VCIJPanel oneSearch = new VCIJPanel(); |
| | | oneSearch.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
| | | String attrName = objs[i].getTitle(); |
| | | |
| | | VCIJLabel attarLabel = new VCIJLabel(attrName+":"); |
| | | VCIJTextField attrText = new VCIJTextField(""); |
| | | attrInerNameValMap.put(objs[i].getField(), attrText); |
| | | attrText.setPreferredSize(new Dimension(300, 30)); |
| | | oneSearch.add(attarLabel); |
| | | oneSearch.add(attrText); |
| | | cons.gridx++; |
| | | this.add(oneSearch,cons); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * <p>è¿ååä¸ªå±æ§ç»è¿æ¼æ¥åçæ¥è¯¢SQLè¯å¥</p> |
| | | * |
| | | * @time 2013-3-17 |
| | | * @return |
| | | */ |
| | | public String getAttrSearchFilterString(){ |
| | | String result = ""; |
| | | StringBuilder sql = new StringBuilder(); |
| | | Set<String> keys = attrInerNameValMap.keySet(); |
| | | for (Iterator it = keys.iterator(); it.hasNext();) { |
| | | String key = (String)it.next(); |
| | | VCIJTextField textField = attrInerNameValMap.get(key); |
| | | String message = textField.getText().replaceAll(" ", "").trim(); |
| | | if(message.equals("")) continue; |
| | | String text = getTextQueryVal(message); |
| | | sql.append(" "+key+" "); |
| | | sql.append(" like "); |
| | | sql.append("'"+text+"'"); |
| | | sql.append(" and"); |
| | | } |
| | | if(sql.length() != 0){ |
| | | result = sql.substring(0, sql.lastIndexOf("and")); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * <p>æ ¹æ®ææ¬æ¡è¾å
¥å
å®¹ï¼æé æ¥è¯¢æ¡ä»¶ã |
| | | * è¿èç»æï¼ 1ãå½å
å®¹æ¯ ä»¥*å¼å¤´ï¼å¦'*abc',åè¿åå
容"%abc"ï¼ |
| | | * 2ãå½å
容以*ç»æï¼å¦"abc*"ï¼åè¿åå
容"abc%"ï¼ |
| | | * 3ãå½å
容ä¸é´å
å«*ï¼å¦"abc*def"ï¼åè¿åå
容"abc%def"ï¼ |
| | | * 4ãè¾å
¥çå
容妿æ¯ç©ºï¼åè¿å"%" |
| | | * 5ãå
¶ä»æ
åµåè¿åå
容æ¬èº« |
| | | * </p> |
| | | * @time 2013-3-17 |
| | | * @param text |
| | | * @return |
| | | */ |
| | | private String getTextQueryVal(String text){ |
| | | if(text.equals("")){ |
| | | return "%"; |
| | | } |
| | | StringBuilder result = new StringBuilder(); |
| | | // update by xchao 2013.05.21 begin |
| | | // æ¯ææ´çµæ´»çæç´¢ |
| | | // ä¸»ææ³æ§å¶é»è¾ |
| | | // 1ãå°è¾å
¥çæ¡ä»¶ä¸ç*æ¿æ¢ä¸º%ï¼XXX*XXX-> XXX%XXX |
| | | // 2ã妿è¾å
¥çæ¡ä»¶ä¸å
å«*ï¼å卿¡ä»¶çååé½å ä¸%ï¼ä»¥å®æå
¨æ¨¡ç³ï¼'%XXX%' |
| | | // 3ãåé¢ä¸è¾å
¥*ãåé¢ä¸è¾å
¥*ä¸ä¹åä¸è´ |
| | | // å³ï¼åé¢ä¸å
å«*ï¼åè¡¨ææ¥è¯¢çæ¯â以XXXå¼å¤´âçæ°æ®ï¼'XXX%' |
| | | // åé¢ä¸å
å«*ï¼åè¡¨é¢æ¥è¯¢çæ¯â以XXXç»æâçæ°æ®ï¼'%XXX' |
| | | // 4ã |
| | | if(text.indexOf("*") >= 0){ |
| | | // result.append(text.replace("*", "%")); |
| | | // ä¸å¥å¯ä»¥æ¯æä¸é´* |
| | | result.append("%").append(text.replace("*", "%")).append("%"); |
| | | } else { |
| | | result.append("%").append(text).append("%"); |
| | | } |
| | | // update by xchao 2013.05.21 end |
| | | |
| | | // int midel = text.lastIndexOf("*"); |
| | | // if(text.startsWith("*")){ |
| | | // result.append("%"); |
| | | // result.append(text.substring(1)); |
| | | // }else if(text.endsWith("*")){ |
| | | // result.append(text.substring(0, text.length()-1)); |
| | | // result.append("%"); |
| | | // }else if(midel > 0){ |
| | | // String before = text.substring(0, midel); |
| | | // result.append(before); |
| | | // result.append("%"); |
| | | // String after = text.substring(midel+1); |
| | | // result.append(after); |
| | | // }else{ |
| | | // result.append(text); |
| | | // } |
| | | return result.toString(); |
| | | } |
| | | public void clear(){ |
| | | Set<String> keys = attrInerNameValMap.keySet(); |
| | | for (Iterator it = keys.iterator(); it.hasNext();) { |
| | | String key = (String)it.next(); |
| | | VCIJTextField textField = attrInerNameValMap.get(key); |
| | | textField.setText(""); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.codeapply.swing.RealTextField; |
| | | import com.vci.ubcs.codeapply.swing.VCIJComboxBox; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import net.bytebuddy.implementation.bytecode.Throw; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | |
| | | /**ç³»ç»åªå 载代ç 项 妿libNameä¸ä¸ºç©ºï¼ç´æ¥è·å对åºç代ç 项**/ |
| | | Map<String,String> condtionMap=new HashMap<>(); |
| | | condtionMap.put("codeClassId", rmType.getOid()); |
| | | R r=HttpUtil.sendGet(url+"/getCodeRuleByClassifyFullInfo",condtionMap,new HashMap<>()); |
| | | R r= HttpUtil.sendGet(url+"/getCodeRuleByClassifyFullInfo",condtionMap,new HashMap<>()); |
| | | CodeRuleVO codeRuleVO=new CodeRuleVO(); |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | |
| | | cbx.setModel(model); |
| | | compt = cbx; |
| | | } |
| | | } else if(StringUtils.isNotBlank(attrObj.getReferConfig())){//åç
§çéè¦è®¾ç½®æä¸ææ¡ï¼å¹¶ä¸åªè¯» |
| | | VCIJComboBox cbx = new VCIJComboBox(); |
| | | DefaultComboBoxModel model = new DefaultComboBoxModel(); |
| | | KeyValue keyValue = new KeyValue(); |
| | | keyValue.setValue(""); |
| | | keyValue.setKey(""); |
| | | AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue); |
| | | model.addElement(wrapper); |
| | | cbx.setModel(model); |
| | | compt = cbx; |
| | | } else { // ä¸åå¨åå¼èå´åæç±»åçæä¸åçæ§ä»¶ |
| | | if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean)) { // Booleanç±»å |
| | | VCIJComboBox cbx = new VCIJComboBox(); |
| | |
| | | ownerDialog = new VCIJDialog(); |
| | | ownerDialog.setSize(880, 500); |
| | | }*/ |
| | | final String referTempId = tempPropObj.getReferBtmId(); |
| | | //final String referTempId = tempPropObj.getReferBtmId(); |
| | | final RMDataReferTempDialog dialog = new RMDataReferTempDialog(this,tempPropObj); |
| | | dialog.setDialogCallback(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | /*LinkedList<RMDataObject> list = dialog.getRMDataMainPanel().getTablePanel().getSelectedRowObjects(); |
| | | if(dialog.isFromTableDoubleClick()){ |
| | | KeyValue keyValue=new KeyValue(); |
| | | /*if(dialog.isFromTableDoubleClick()){ |
| | | int index = dialog.getRMDataMainPanel().getTablePanel().getTable().getSelectedRow(); |
| | | list.clear(); |
| | | list.add(dialog.getRMDataMainPanel().getTablePanel().getTableModel().getList().get(index).getObject()); |
| | | } |
| | | |
| | | RMDataObject rmDataObj = list.get(0);//éæ©çå¼ç¨æ¨¡æ¿æ°æ® |
| | | LinkedHashMap<String, Integer> innnerNamesMaps = rmDataObj.getInnerNameIndexMap(); |
| | | String[] datas = rmDataObj.getDatas(); |
| | | for(CodeClassifyTemplateAttrVO obj : tempPropList) { |
| | | if(obj.getReferTempId().equals(referTempId)) { |
| | | AttributeObject attrObj = getAttrObjById(obj.getReferAttrId()); |
| | | JComponent comp = attrIdToCtrlMaps.get(obj.getId()); |
| | | if(comp instanceof VCIJTextField) { |
| | | int index = innnerNamesMaps.get(attrObj.getInternalname()); |
| | | }*/ |
| | | keyValue= dialog.getKeyValue(); |
| | | //for(CodeClassifyTemplateAttrVO obj : tempPropList) { |
| | | if(attrIdToCtrlMaps.containsKey(tempPropObj.getId())) { |
| | | JComponent comp = attrIdToCtrlMaps.get(tempPropObj.getId()); |
| | | /*if(comp instanceof VCIJTextField) { |
| | | int index = innnerNamesMaps.get(tempPropObj.getInternalname()); |
| | | ((VCIJTextField) comp).setText(datas[index]); |
| | | }else if (comp instanceof VCIJCalendarPanel) { |
| | | int index = innnerNamesMaps.get(attrObj.getInternalname()); |
| | | int index = innnerNamesMaps.get(tempPropObj.getInternalname()); |
| | | ((VCIJCalendarPanel) comp).setDateString(datas[index]); |
| | | } else if (comp instanceof VCIJComboBox) { |
| | | int index = innnerNamesMaps.get(attrObj.getId()); |
| | | ((VCIJComboBox) comp).setSelectedIndex(index); |
| | | } else */ |
| | | if (comp instanceof VCIJComboBox) { |
| | | //DefaultComboBoxModel model = new DefaultComboBoxModel(); |
| | | if(keyValue!=null) { |
| | | AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue); |
| | | ((VCIJComboBox) comp).getModel().setSelectedItem(wrapper); |
| | | } |
| | | //model.addElement(wrapper); |
| | | //((VCIJComboBox) comp).setModel(model); |
| | | } |
| | | } |
| | | }*/ |
| | | //} |
| | | |
| | | } |
| | | }); |
| | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.base.ui.exception.VCIException; |
| | | import com.vci.base.ui.swing.VCIOptionPane; |
| | | import com.vci.base.ui.swing.components.VCIJPanel; |
| | | import com.vci.base.ui.tree.VCIBaseTree; |
| | |
| | | import com.vci.ubcs.codeapply.object.CodeClassify; |
| | | import com.vci.ubcs.codeapply.object.R; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import javax.swing.event.TreeExpansionEvent; |
| | | import javax.swing.event.TreeExpansionListener; |
| | |
| | | condtionMap.put("desc", this.clsfName); |
| | | condtionMap.put("codeLibName",rootNode.toString()); |
| | | |
| | | R r=HttpUtil.sendGet(url+"/getRMTypeByDescAndLib",condtionMap,new HashMap<>()); |
| | | R r= HttpUtil.sendGet(url+"/getRMTypeByDescAndLib",condtionMap,new HashMap<>()); |
| | | List<CodeClassify> codeClassifyList = new ArrayList<>(); |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | |
| | | import com.vci.ubcs.codeapply.object.CodeClassify; |
| | | import com.vci.ubcs.codeapply.object.R; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import lombok.SneakyThrows; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | |
| | | if(libName.length>0) { |
| | | condtionMap.put("libName", StringUtils.join(libName,",") ); |
| | | } |
| | | R r=HttpUtil.sendGet(url+"/getRMLibByName",condtionMap,new HashMap<>()); |
| | | R r= HttpUtil.sendGet(url+"/getRMLibByName",condtionMap,new HashMap<>()); |
| | | List<CodeClassify> codeClassifyList = new ArrayList<>(); |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | |
| | | import com.vci.base.ui.swing.components.VCIJPanel; |
| | | import com.vci.base.ui.swing.components.table.AbstractVCIJTableDataProvider; |
| | | import com.vci.base.ui.swing.components.table.VCIJTablePanel; |
| | | import com.vci.ubcs.codeapply.object.BaseModel; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefer; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | |
| | | import java.awt.*; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class CodeDataMainPanel extends VCIJPanel { |
| | | |
| | | /** |
| | | * èªå®ä¹é¡¶é¨æ§ä»¶åºå |
| | | */ |
| | | private VCIJPanel customTopPanel = null; |
| | | private AttarSearchPanel customTopPanel = null; |
| | | private UIFormRefer uiFormRefer; |
| | | private CodeDataMainPanelActionListener actionListener = new CodeDataMainPanelActionListener(this); |
| | | private VCIJButton btnSearch = VCISwingUtil.createVCIJButton("search", "æ¥è¯¢", "æ¥è¯¢", "search.png", actionListener); |
| | |
| | | public CodeDataMainPanel(UIFormRefer uiFormRefer) { |
| | | this.uiFormRefer=uiFormRefer; |
| | | } |
| | | |
| | | private Map<String,String> customCondtionMap=new HashMap<>(); |
| | | public void buildPanel(){ |
| | | this.init(); |
| | | } |
| | |
| | | /** |
| | | * æ ¹æ®ç±»åæ¾ç¤ºtable |
| | | */ |
| | | private VCIJTablePanel<T> tablePanel = null; |
| | | private AbstractVCIJTableDataProvider<T> dataProvider = null; |
| | | private VCIJTablePanel<BaseModel> tablePanel = null; |
| | | private AbstractVCIJTableDataProvider<BaseModel> dataProvider = null; |
| | | private VCIJPanel createCenterDataTablePanel() { |
| | | tablePanel = new VCIJTablePanel<T>(dataProvider); |
| | | tablePanel = new VCIJTablePanel<BaseModel>(dataProvider); |
| | | //tablePanel.setCustomButtons(getCombinedButtons()); |
| | | tablePanel.setShowExport(true); |
| | | tablePanel.setShowPaging(true); |
| | | tablePanel.setShowProgressBar(false); |
| | | tablePanel.setPageButtonFlowAlign(FlowLayout.CENTER); |
| | | tablePanel.setCustomButtonFlowAlign(FlowLayout.CENTER); |
| | | tablePanel.buildTablePanel(); |
| | |
| | | return palRes; |
| | | } |
| | | |
| | | public VCIJPanel getCustomTopPanel() { |
| | | public AttarSearchPanel getCustomTopPanel() { |
| | | return customTopPanel; |
| | | } |
| | | |
| | | public void setCustomTopPanel(VCIJPanel customTopPanel) { |
| | | public void setCustomTopPanel(AttarSearchPanel customTopPanel) { |
| | | this.customTopPanel = customTopPanel; |
| | | } |
| | | |
| | | public VCIJTablePanel<T> getTablePanel() { |
| | | public VCIJTablePanel<BaseModel> getTablePanel() { |
| | | return tablePanel; |
| | | } |
| | | |
| | | public void setTablePanel(VCIJTablePanel<T> tablePanel) { |
| | | public void setTablePanel(VCIJTablePanel<BaseModel> tablePanel) { |
| | | this.tablePanel = tablePanel; |
| | | } |
| | | |
| | |
| | | this.uiFormRefer = uiFormRefer; |
| | | } |
| | | |
| | | public AbstractVCIJTableDataProvider<T> getDataProvider() { |
| | | public AbstractVCIJTableDataProvider<BaseModel> getDataProvider() { |
| | | return dataProvider; |
| | | } |
| | | |
| | | public void setDataProvider(AbstractVCIJTableDataProvider<T> dataProvider) { |
| | | public void setDataProvider(AbstractVCIJTableDataProvider<BaseModel> dataProvider) { |
| | | this.dataProvider = dataProvider; |
| | | } |
| | | |
| | | public Map<String, String> getCustomCondtionMap() { |
| | | if(this.getCustomTopPanel()!=null){ |
| | | Map<String,String> newCustomCondtionMap= this.getCustomTopPanel().getAttrSearchFilterString(); |
| | | customCondtionMap.putAll(newCustomCondtionMap); |
| | | } |
| | | return customCondtionMap; |
| | | } |
| | | |
| | | public void setCustomCondtionMap(Map<String, String> customCondtionMap) { |
| | | this.customCondtionMap = customCondtionMap; |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空æ¡ä»¶ |
| | | * <p>Description: </p> |
| | | * |
| | | * @author liujw |
| | | */ |
| | | public void clearCustomTopPanel(){ |
| | | customCondtionMap.clear(); |
| | | AttarSearchPanel search = (AttarSearchPanel)getCustomTopPanel(); |
| | | search.clear(); |
| | | } |
| | | } |
| | |
| | | actionMaps.put("search", new Runnable() { public void run() { |
| | | search(); |
| | | }}); |
| | | actionMaps.put("clear_search", new Runnable() { public void run() { |
| | | clear_search(); |
| | | }}); |
| | | } |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | String key = e.getActionCommand(); |
| | | if(actionMaps.containsKey(key)){ |
| | | actionMaps.get(key).run(); |
| | | } |
| | | } |
| | | |
| | | private void clear_search(){ |
| | | owner.clearCustomTopPanel(); |
| | | owner.getTablePanel().refreshTableData(); |
| | | } |
| | | private void search() { |
| | | owner.getTablePanel().setPageIndex(1); |
| | | owner.getTablePanel().refreshTableData(); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.vci.base.ui.swing.components.table.AbstractVCIJTableDataProvider; |
| | | import com.vci.base.ui.swing.components.table.VCIJTableNode; |
| | | import com.vci.ubcs.codeapply.object.BaseModel; |
| | | import com.vci.ubcs.codeapply.object.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.base.ui.swing.VCIOptionPane; |
| | | import com.vci.ubcs.code.vo.webserviceModel.coderule.CodeShowFieldConfigVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.coderule.CodeSrchCondConfigVO; |
| | | import com.vci.ubcs.codeapply.object.R; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefer; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefers; |
| | | import com.vci.ubcs.starter.web.pagemodel.UITableFieldVO; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class CodeDataMainPanelDataProvider extends AbstractVCIJTableDataProvider<T> { |
| | | public class CodeDataMainPanelDataProvider extends AbstractVCIJTableDataProvider<BaseModel> { |
| | | private CodeDataMainPanel ownerPanel; |
| | | private String[] specialColumns = {}; |
| | | |
| | | private String url= ConfigUtils.getConfigValue("410.code.url","http://127.0.0.1:36014/codeApplySwingController"); |
| | | private String[] fields = {}; |
| | | |
| | | public CodeDataMainPanelDataProvider(CodeDataMainPanel ownerPanel) { |
| | | this.ownerPanel=ownerPanel; |
| | |
| | | fieldList.add(field); |
| | | }); |
| | | specialColumns = nameList.toArray(new String[]{}); |
| | | fields = fieldList.toArray(new String[]{}); |
| | | return specialColumns; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public VCIJTableNode<T> getNewRowNode(T t) { |
| | | return null; |
| | | public VCIJTableNode<BaseModel> getNewRowNode(BaseModel model) { |
| | | Map<String,String> dataMap= model.getData(); |
| | | Map<String, String> defaultDataMap= VciBaseUtil.objectToMapString(model); |
| | | defaultDataMap.putAll(dataMap); |
| | | VCIJTableNode<BaseModel> res = new VCIJTableNode<BaseModel>(model); |
| | | int i=dataColumnStartIndex; |
| | | for (String field:fields){ |
| | | String data=defaultDataMap.getOrDefault(field,""); |
| | | res.setPropertyValue(getColumns()[i++], data); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public T[] getDatas(int pageIndex, int pageSize) { |
| | | public BaseModel[] getDatas(int pageIndex, int pageSize) { |
| | | /**ç³»ç»åªå 载代ç 项 妿libNameä¸ä¸ºç©ºï¼ç´æ¥è·å对åºç代ç 项**/ |
| | | Map<String,String> condtionMap=new HashMap<>(); |
| | | Page<BaseModel> iPage= new Page<BaseModel>() {}; |
| | | try{ |
| | | UIFormRefer uiFormRefer= this.ownerPanel.getUiFormRefer(); |
| | | condtionMap.put("referType", StringUtils.isBlank(uiFormRefer.getReferType())?"":uiFormRefer.getReferType()); |
| | | condtionMap.put("page",pageIndex+""); |
| | | condtionMap.put("limit",pageSize+""); |
| | | |
| | | return new T[0]; |
| | | List<CodeSrchCondConfigVO> codeSrchCondConfigVOS=uiFormRefer.getCodeSrchCondConfigVOS(); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | if(!CollectionUtils.isEmpty(codeSrchCondConfigVOS)){ |
| | | codeSrchCondConfigVOS.stream().forEach(codeSrchCondConfigVO -> { |
| | | String field=codeSrchCondConfigVO.getFilterField(); |
| | | String value=codeSrchCondConfigVO.getFilterValue(); |
| | | String filterType= codeSrchCondConfigVO.getFilterType(); |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | } |
| | | Map<String, String> customCondtionMap=ownerPanel.getCustomCondtionMap(); |
| | | if(customCondtionMap!=null&&customCondtionMap.size()>0){ |
| | | customCondtionMap.forEach((field, value) -> { |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | |
| | | } |
| | | Map<String,String> headers=new HashMap<>(); |
| | | |
| | | R r= HttpUtil.sendGet(url+"/defaultReferDataGrid",condtionMap,new HashMap<>()); |
| | | |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | | if(object!=null) { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | iPage = objectMapper.readValue(object.toString(), Page.class); |
| | | } |
| | | }else{ |
| | | VCIOptionPane.showMessage(this.ownerPanel,r.getMsg()); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | this.total= new Long(iPage.getTotal()).intValue(); |
| | | List dataList= iPage.getRecords(); |
| | | BaseModel [] baseModels=new BaseModel[]{}; |
| | | if(!CollectionUtils.isEmpty(dataList)) { |
| | | List<BaseModel> hostInfos = (List<BaseModel>) dataList.stream().map(entity -> JSONUtil.toBean(JSONUtil.parseObj(entity), BaseModel.class)).collect(Collectors.toList()); |
| | | baseModels = hostInfos.toArray(new BaseModel[]{}); |
| | | } |
| | | return baseModels; |
| | | } |
| | | } |
| | |
| | | import com.vci.base.ui.tree.VCIBaseTreeNode; |
| | | import com.vci.ubcs.codeapply.object.*; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | |
| | | condtionMap.put("parentFieldName",StringUtils.isBlank(uiFormRefer.getParentFieldName())?"":uiFormRefer.getParentFieldName()); |
| | | condtionMap.put("textField",StringUtils.isBlank(uiFormRefer.getTextField())?"":uiFormRefer.getTextField()); |
| | | condtionMap.put("muti",uiFormRefer.isMuti()?"true":"false"); |
| | | condtionMap.put("queryAllLevel", "false");//queryAllLevel |
| | | condtionMap.put("queryAllLevel", StringUtils.isBlank(uiFormRefer.getLoadType())?"false":"true");//queryAllLevel |
| | | //condtionMap.put("parentOid",null); |
| | | R r=HttpUtil.sendGet(url+"/defaultReferTree",condtionMap,new HashMap<>()); |
| | | R r= HttpUtil.sendGet(url+"/defaultReferTree",condtionMap,new HashMap<>()); |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | | if(object!=null) { |
| | |
| | | import com.vci.ubcs.codeapply.enums.CodeReferConfigTypeEnum; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefer; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefers; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | |
| | | public class RMDataReferTempDialog extends VCIJDialog { |
| | |
| | | CodeReferTreePanel typeTreePanel; |
| | | private VCIBaseTree leftTree = null; |
| | | private VCIBaseTreeModel leftTreeModel = null; |
| | | private KeyValue keyValue; |
| | | public RMDataReferTempDialog(CodeApplyFor410MainPanel owner, CodeClassifyTemplateAttrVO codeClassifyTemplateAttr) { |
| | | //super(true); |
| | | this.owner = owner; |
| | |
| | | * æ ¹æ®ç±»åæ¾ç¤ºtable |
| | | */ |
| | | private CodeDataMainPanel codeDataMainPanel = null; |
| | | private CodeDataMainPanelDataProvider dataProvider; |
| | | public CodeDataMainPanel getRMDataMainPanel() { |
| | | codeDataMainPanel=new CodeDataMainPanel(uiFormRefer); |
| | | CodeDataMainPanelDataProvider dataProvider=new CodeDataMainPanelDataProvider(codeDataMainPanel); |
| | | codeDataMainPanel.setDataProvider(dataProvider); |
| | | codeDataMainPanel.setCustomTopPanel(new attarSearchPanel(uiFormRefer)); |
| | | codeDataMainPanel.setCustomTopPanel(new AttarSearchPanel(uiFormRefer)); |
| | | codeDataMainPanel.buildPanel(); |
| | | VCIJTable table = codeDataMainPanel.getTablePanel().getTable(); |
| | | VCIJTable table = codeDataMainPanel.getTablePanel().getTable(); |
| | | table.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | | if (e.getButton() == 1 && e.getClickCount() == 2) { |
| | |
| | | private static final long serialVersionUID = 8121108576137012228L; |
| | | @Override |
| | | public void tree_valueChanged(TreeSelectionEvent e) { |
| | | |
| | | self.leftTree_valueChanged(e); |
| | | } |
| | | }; |
| | |
| | | * @param e |
| | | */ |
| | | private void leftTree_valueChanged(TreeSelectionEvent e) { |
| | | |
| | | btnOk.doClick(); |
| | | } |
| | | /***è·åèµæºæ°æ®ç䏻颿¿**/ |
| | | /* |
| | |
| | | return transmit; |
| | | }*/ |
| | | |
| | | public KeyValue getKeyValue() { |
| | | return keyValue; |
| | | } |
| | | |
| | | public void setKeyValue(KeyValue keyValue) { |
| | | this.keyValue = keyValue; |
| | | } |
| | | |
| | | public UIFormRefer getUiFormRefer() { |
| | | return uiFormRefer; |
| | | } |
| | | |
| | | public void setUiFormRefer(UIFormRefer uiFormRefer) { |
| | | this.uiFormRefer = uiFormRefer; |
| | | } |
| | | |
| | | public CodeReferTreePanel getTypeTreePanel() { |
| | | return typeTreePanel; |
| | | } |
| | | |
| | | public void setTypeTreePanel(CodeReferTreePanel typeTreePanel) { |
| | | this.typeTreePanel = typeTreePanel; |
| | | } |
| | | |
| | | public CodeDataMainPanel getCodeDataMainPanel() { |
| | | return codeDataMainPanel; |
| | | } |
| | | |
| | | public void setCodeDataMainPanel(CodeDataMainPanel codeDataMainPanel) { |
| | | this.codeDataMainPanel = codeDataMainPanel; |
| | | } |
| | | } |
| | |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.vci.base.ui.swing.VCIOptionPane; |
| | | import com.vci.base.ui.swing.components.VCIJDialog.DialogResult; |
| | | import com.vci.base.ui.tree.VCIBaseTreeNode; |
| | | import com.vci.ubcs.codeapply.enums.CodeReferConfigTypeEnum; |
| | | import com.vci.ubcs.codeapply.object.BaseModel; |
| | | import com.vci.ubcs.codeapply.object.UIFormRefer; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | |
| | | import javax.swing.tree.TreePath; |
| | | |
| | | public class RMDataReferTempDialogActionListener implements ActionListener { |
| | | |
| | |
| | | } |
| | | |
| | | private void ok(){ |
| | | if(!owner.isFromTableDoubleClick()){ |
| | | /*LinkedList<RMDataObject> list = this.owner.getRMDataMainPanel().getTablePanel().getSelectedRowObjects(); |
| | | //if(!owner.isFromTableDoubleClick()){ |
| | | /* LinkedList<RMDataObject> list = this.owner.getRMDataMainPanel().getTablePanel().getSelectedRowObjects(); |
| | | if(list.size() > 1) { |
| | | VCIOptionPane.showMessageDialog(this.owner, "ä¸å
è®¸éæ©å¤æ¡æ°æ®è¿è¡æä½!"); |
| | | return; |
| | |
| | | VCIOptionPane.showMessageDialog(this.owner, "è¯·éæ©æ°æ®è¿è¡æä½!"); |
| | | return; |
| | | }*/ |
| | | } |
| | | |
| | | UIFormRefer uiFormRefer=owner.getUiFormRefer(); |
| | | String textField=uiFormRefer.getTextField(); |
| | | String valueField=uiFormRefer.getValueField(); |
| | | if(uiFormRefer !=null&&(uiFormRefer.getType().equals(CodeReferConfigTypeEnum.TREE.getValue()) |
| | | ||uiFormRefer.getType().equals(CodeReferConfigTypeEnum.ORGDEPARTMENTREFER.getValue()))){ |
| | | TreePath treePath=this.owner.getTypeTreePanel().getTree().getSelectionPath(); |
| | | VCIBaseTreeNode treeNode = (VCIBaseTreeNode)treePath.getLastPathComponent(); |
| | | if(treeNode.getObj() instanceof Tree) { |
| | | Tree tree =(Tree)treeNode.getObj(); |
| | | Map<String,String> attibuteMap= tree.getAttributes(); |
| | | String fieldValue=attibuteMap.getOrDefault(valueField,""); |
| | | String textValue=attibuteMap.getOrDefault(textField,""); |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(fieldValue); |
| | | keyValue.setValue(textValue); |
| | | this.owner.setKeyValue(keyValue); |
| | | } |
| | | |
| | | }else{ |
| | | LinkedList<BaseModel> list =this.owner.getCodeDataMainPanel().getTablePanel().getSelectedRowObjects(); |
| | | if(list.size() > 1) { |
| | | VCIOptionPane.showMessageDialog(this.owner, "ä¸å
è®¸éæ©å¤æ¡æ°æ®è¿è¡æä½!"); |
| | | return; |
| | | } else if(list.size() <= 0) { |
| | | VCIOptionPane.showMessageDialog(this.owner, "è¯·éæ©æ°æ®è¿è¡æä½!"); |
| | | return; |
| | | } |
| | | BaseModel baseModel=list.get(0); |
| | | Map<String, String> defaultDataMap= VciBaseUtil.objectToMapString(list.get(0)); |
| | | defaultDataMap.putAll(baseModel.getData()); |
| | | String fieldValue=defaultDataMap.getOrDefault(valueField,""); |
| | | String textValue=defaultDataMap.getOrDefault(textField,""); |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(fieldValue); |
| | | keyValue.setValue(textValue); |
| | | this.owner.setKeyValue(keyValue); |
| | | } |
| | | //} |
| | | owner.setDialogResult(DialogResult.OK); |
| | | close(); |
| | | owner.getDialogCallback().run(); |
| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.awt.*; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class attarSearchPanel extends VCIJPanel { |
| | | public class AttarSearchPanel extends VCIJPanel { |
| | | |
| | | private LinkedHashMap<String , VCIJTextField> attrInerNameValMap = new LinkedHashMap<String,VCIJTextField>(); |
| | | private UIFormRefer uiFormRefer; |
| | | public attarSearchPanel(UIFormRefer uiFormRefer){ |
| | | public AttarSearchPanel(UIFormRefer uiFormRefer){ |
| | | this.uiFormRefer = uiFormRefer; |
| | | init(); |
| | | } |
| | |
| | | * @time 2013-3-17 |
| | | * @return |
| | | */ |
| | | public String getAttrSearchFilterString(){ |
| | | public Map<String,String> getAttrSearchFilterString(){ |
| | | String result = ""; |
| | | StringBuilder sql = new StringBuilder(); |
| | | Map<String,String> customConditionMap=new HashMap<>(); |
| | | Set<String> keys = attrInerNameValMap.keySet(); |
| | | for (Iterator it = keys.iterator(); it.hasNext();) { |
| | | String key = (String)it.next(); |
| | |
| | | String message = textField.getText().replaceAll(" ", "").trim(); |
| | | if(message.equals("")) continue; |
| | | String text = getTextQueryVal(message); |
| | | sql.append(" "+key+" "); |
| | | sql.append(" like "); |
| | | sql.append("'"+text+"'"); |
| | | sql.append(" and"); |
| | | customConditionMap.put(key,text); |
| | | } |
| | | if(sql.length() != 0){ |
| | | result = sql.substring(0, sql.lastIndexOf("and")); |
| | | } |
| | | return result; |
| | | |
| | | return customConditionMap; |
| | | } |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply.object; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.data.annotation.Transient; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | public class BaseModel { |
| | | private String oid; |
| | | private String id; |
| | | private String name; |
| | | private String description; |
| | | private String revisionOid; |
| | | private String nameOid; |
| | | private String btmname; |
| | | private String lastR; |
| | | private String firstR; |
| | | private String lastV; |
| | | private String firstV; |
| | | private String creator; |
| | | private Date createTime; |
| | | private String lastModifier; |
| | | private Date lastModifyTime; |
| | | private String revisionRule; |
| | | private Integer revisionSeq; |
| | | private String revisionValue; |
| | | private String versionRule; |
| | | private Integer versionSeq; |
| | | private String versionValue; |
| | | private String lcStatus; |
| | | private String lcStatusText; |
| | | private Date ts; |
| | | private String owner; |
| | | // private String checkInBy; |
| | | // private Date checkInTime; |
| | | // private String checkOutBy; |
| | | // private Date checkOutTime; |
| | | private String copyFromVersion; |
| | | private Integer secretGrade; |
| | | private String secretGradeText; |
| | | private String lctid; |
| | | private Map<String, String> data; |
| | | |
| | | public String getOid() { |
| | | return oid; |
| | | } |
| | | |
| | | public void setOid(String oid) { |
| | | this.oid = oid; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getRevisionOid() { |
| | | return revisionOid; |
| | | } |
| | | |
| | | public void setRevisionOid(String revisionOid) { |
| | | this.revisionOid = revisionOid; |
| | | } |
| | | |
| | | public String getNameOid() { |
| | | return nameOid; |
| | | } |
| | | |
| | | public void setNameOid(String nameOid) { |
| | | this.nameOid = nameOid; |
| | | } |
| | | |
| | | public String getBtmname() { |
| | | return btmname; |
| | | } |
| | | |
| | | public void setBtmname(String btmname) { |
| | | this.btmname = btmname; |
| | | } |
| | | |
| | | public String getLastR() { |
| | | return lastR; |
| | | } |
| | | |
| | | public void setLastR(String lastR) { |
| | | this.lastR = lastR; |
| | | } |
| | | |
| | | public String getFirstR() { |
| | | return firstR; |
| | | } |
| | | |
| | | public void setFirstR(String firstR) { |
| | | this.firstR = firstR; |
| | | } |
| | | |
| | | public String getLastV() { |
| | | return lastV; |
| | | } |
| | | |
| | | public void setLastV(String lastV) { |
| | | this.lastV = lastV; |
| | | } |
| | | |
| | | public String getFirstV() { |
| | | return firstV; |
| | | } |
| | | |
| | | public void setFirstV(String firstV) { |
| | | this.firstV = firstV; |
| | | } |
| | | |
| | | public String getCreator() { |
| | | return creator; |
| | | } |
| | | |
| | | public void setCreator(String creator) { |
| | | this.creator = creator; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getLastModifier() { |
| | | return lastModifier; |
| | | } |
| | | |
| | | public void setLastModifier(String lastModifier) { |
| | | this.lastModifier = lastModifier; |
| | | } |
| | | |
| | | public Date getLastModifyTime() { |
| | | return lastModifyTime; |
| | | } |
| | | |
| | | public void setLastModifyTime(Date lastModifyTime) { |
| | | this.lastModifyTime = lastModifyTime; |
| | | } |
| | | |
| | | public String getRevisionRule() { |
| | | return revisionRule; |
| | | } |
| | | |
| | | public void setRevisionRule(String revisionRule) { |
| | | this.revisionRule = revisionRule; |
| | | } |
| | | |
| | | public Integer getRevisionSeq() { |
| | | return revisionSeq; |
| | | } |
| | | |
| | | public void setRevisionSeq(Integer revisionSeq) { |
| | | this.revisionSeq = revisionSeq; |
| | | } |
| | | |
| | | public String getRevisionValue() { |
| | | return revisionValue; |
| | | } |
| | | |
| | | public void setRevisionValue(String revisionValue) { |
| | | this.revisionValue = revisionValue; |
| | | } |
| | | |
| | | public String getVersionRule() { |
| | | return versionRule; |
| | | } |
| | | |
| | | public void setVersionRule(String versionRule) { |
| | | this.versionRule = versionRule; |
| | | } |
| | | |
| | | public Integer getVersionSeq() { |
| | | return versionSeq; |
| | | } |
| | | |
| | | public void setVersionSeq(Integer versionSeq) { |
| | | this.versionSeq = versionSeq; |
| | | } |
| | | |
| | | public String getVersionValue() { |
| | | return versionValue; |
| | | } |
| | | |
| | | public void setVersionValue(String versionValue) { |
| | | this.versionValue = versionValue; |
| | | } |
| | | |
| | | public String getLcStatus() { |
| | | return lcStatus; |
| | | } |
| | | |
| | | public void setLcStatus(String lcStatus) { |
| | | this.lcStatus = lcStatus; |
| | | } |
| | | |
| | | public String getLcStatusText() { |
| | | return lcStatusText; |
| | | } |
| | | |
| | | public void setLcStatusText(String lcStatusText) { |
| | | this.lcStatusText = lcStatusText; |
| | | } |
| | | |
| | | public Date getTs() { |
| | | return ts; |
| | | } |
| | | |
| | | public void setTs(Date ts) { |
| | | this.ts = ts; |
| | | } |
| | | |
| | | public String getOwner() { |
| | | return owner; |
| | | } |
| | | |
| | | public void setOwner(String owner) { |
| | | this.owner = owner; |
| | | } |
| | | |
| | | public String getCopyFromVersion() { |
| | | return copyFromVersion; |
| | | } |
| | | |
| | | public void setCopyFromVersion(String copyFromVersion) { |
| | | this.copyFromVersion = copyFromVersion; |
| | | } |
| | | |
| | | public Integer getSecretGrade() { |
| | | return secretGrade; |
| | | } |
| | | |
| | | public void setSecretGrade(Integer secretGrade) { |
| | | this.secretGrade = secretGrade; |
| | | } |
| | | |
| | | public String getSecretGradeText() { |
| | | return secretGradeText; |
| | | } |
| | | |
| | | public void setSecretGradeText(String secretGradeText) { |
| | | this.secretGradeText = secretGradeText; |
| | | } |
| | | |
| | | public String getLctid() { |
| | | return lctid; |
| | | } |
| | | |
| | | public void setLctid(String lctid) { |
| | | this.lctid = lctid; |
| | | } |
| | | |
| | | public Map<String, String> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Map<String, String> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BaseModel{" + |
| | | "oid='" + oid + '\'' + |
| | | ", id='" + id + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", description='" + description + '\'' + |
| | | ", revisionOid='" + revisionOid + '\'' + |
| | | ", nameOid='" + nameOid + '\'' + |
| | | ", btmname='" + btmname + '\'' + |
| | | ", lastR='" + lastR + '\'' + |
| | | ", firstR='" + firstR + '\'' + |
| | | ", lastV='" + lastV + '\'' + |
| | | ", firstV='" + firstV + '\'' + |
| | | ", creator='" + creator + '\'' + |
| | | ", createTime=" + createTime + |
| | | ", lastModifier='" + lastModifier + '\'' + |
| | | ", lastModifyTime=" + lastModifyTime + |
| | | ", revisionRule='" + revisionRule + '\'' + |
| | | ", revisionSeq=" + revisionSeq + |
| | | ", revisionValue='" + revisionValue + '\'' + |
| | | ", versionRule='" + versionRule + '\'' + |
| | | ", versionSeq=" + versionSeq + |
| | | ", versionValue='" + versionValue + '\'' + |
| | | ", lcStatus='" + lcStatus + '\'' + |
| | | ", lcStatusText='" + lcStatusText + '\'' + |
| | | ", ts=" + ts + |
| | | ", owner='" + owner + '\'' + |
| | | ", copyFromVersion='" + copyFromVersion + '\'' + |
| | | ", secretGrade=" + secretGrade + |
| | | ", secretGradeText='" + secretGradeText + '\'' + |
| | | ", lctid='" + lctid + '\'' + |
| | | ", data=" + data + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply.object; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public interface IPage<T> extends Serializable { |
| | | List<OrderItem> orders(); |
| | | |
| | | default boolean optimizeCountSql() { |
| | | return true; |
| | | } |
| | | |
| | | default boolean optimizeJoinOfCountSql() { |
| | | return true; |
| | | } |
| | | |
| | | default boolean searchCount() { |
| | | return true; |
| | | } |
| | | |
| | | default long offset() { |
| | | long current = this.getCurrent(); |
| | | return current <= 1L ? 0L : Math.max((current - 1L) * this.getSize(), 0L); |
| | | } |
| | | |
| | | default Long maxLimit() { |
| | | return null; |
| | | } |
| | | |
| | | default long getPages() { |
| | | if (this.getSize() == 0L) { |
| | | return 0L; |
| | | } else { |
| | | long pages = this.getTotal() / this.getSize(); |
| | | if (this.getTotal() % this.getSize() != 0L) { |
| | | ++pages; |
| | | } |
| | | |
| | | return pages; |
| | | } |
| | | } |
| | | |
| | | default IPage<T> setPages(long pages) { |
| | | return this; |
| | | } |
| | | |
| | | List<T> getRecords(); |
| | | |
| | | IPage<T> setRecords(List<T> records); |
| | | |
| | | long getTotal(); |
| | | |
| | | IPage<T> setTotal(long total); |
| | | |
| | | long getSize(); |
| | | |
| | | IPage<T> setSize(long size); |
| | | |
| | | long getCurrent(); |
| | | |
| | | IPage<T> setCurrent(long current); |
| | | |
| | | default <R> IPage<T> convert(Function<? super T, ? extends R> mapper) { |
| | | List<T> collect = (List)this.getRecords().stream().map(mapper).collect(Collectors.toList()); |
| | | return this.setRecords(collect); |
| | | } |
| | | default String countId() { |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply.object; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class OrderItem { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | private String column; |
| | | private boolean asc = true; |
| | | |
| | | public static OrderItem asc(String column) { |
| | | return build(column, true); |
| | | } |
| | | |
| | | public static OrderItem desc(String column) { |
| | | return build(column, false); |
| | | } |
| | | |
| | | public static List<OrderItem> ascs(String... columns) { |
| | | return (List) Arrays.stream(columns).map(OrderItem::asc).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public static List<OrderItem> descs(String... columns) { |
| | | return (List)Arrays.stream(columns).map(OrderItem::desc).collect(Collectors.toList()); |
| | | } |
| | | |
| | | private static OrderItem build(String column, boolean asc) { |
| | | return new OrderItem(column, asc); |
| | | } |
| | | |
| | | public String getColumn() { |
| | | return this.column; |
| | | } |
| | | |
| | | public boolean isAsc() { |
| | | return this.asc; |
| | | } |
| | | |
| | | public void setColumn(final String column) { |
| | | this.column = column; |
| | | } |
| | | |
| | | public void setAsc(final boolean asc) { |
| | | this.asc = asc; |
| | | } |
| | | |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | | } else if (!(o instanceof OrderItem)) { |
| | | return false; |
| | | } else { |
| | | OrderItem other = (OrderItem)o; |
| | | if (!other.canEqual(this)) { |
| | | return false; |
| | | } else if (this.isAsc() != other.isAsc()) { |
| | | return false; |
| | | } else { |
| | | Object this$column = this.getColumn(); |
| | | Object other$column = other.getColumn(); |
| | | if (this$column == null) { |
| | | if (other$column != null) { |
| | | return false; |
| | | } |
| | | } else if (!this$column.equals(other$column)) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | protected boolean canEqual(final Object other) { |
| | | return other instanceof com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | } |
| | | |
| | | public int hashCode() { |
| | | int result = 1; |
| | | result = result * 59 + (this.isAsc() ? 79 : 97); |
| | | Object $column = this.getColumn(); |
| | | result = result * 59 + ($column == null ? 43 : $column.hashCode()); |
| | | return result; |
| | | } |
| | | |
| | | public String toString() { |
| | | return "OrderItem(column=" + this.getColumn() + ", asc=" + this.isAsc() + ")"; |
| | | } |
| | | |
| | | public OrderItem() { |
| | | } |
| | | |
| | | public OrderItem(final String column, final boolean asc) { |
| | | this.column = column; |
| | | this.asc = asc; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply.object; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.function.Predicate; |
| | | |
| | | public class Page<T> { |
| | | private static final long serialVersionUID = 8545996863226528798L; |
| | | protected List<T> records; |
| | | protected long total; |
| | | protected long size; |
| | | protected long current; |
| | | protected List<OrderItem> orders; |
| | | protected boolean optimizeCountSql; |
| | | protected boolean searchCount; |
| | | protected boolean optimizeJoinOfCountSql; |
| | | protected String countId; |
| | | protected Long maxLimit; |
| | | protected long pages; |
| | | |
| | | |
| | | public Page() { |
| | | this.records = Collections.emptyList(); |
| | | this.total = 0L; |
| | | this.size = 10L; |
| | | this.current = 1L; |
| | | this.orders = new ArrayList(); |
| | | this.optimizeCountSql = true; |
| | | this.searchCount = true; |
| | | this.optimizeJoinOfCountSql = true; |
| | | } |
| | | |
| | | public Page(long current, long size) { |
| | | this(current, size, 0L); |
| | | } |
| | | |
| | | public Page(long current, long size, long total) { |
| | | this(current, size, total, true); |
| | | } |
| | | |
| | | public Page(long current, long size, boolean searchCount) { |
| | | this(current, size, 0L, searchCount); |
| | | } |
| | | |
| | | public Page(long current, long size, long total, boolean searchCount) { |
| | | this.records = Collections.emptyList(); |
| | | this.total = 0L; |
| | | this.size = 10L; |
| | | this.current = 1L; |
| | | this.orders = new ArrayList(); |
| | | this.optimizeCountSql = true; |
| | | this.searchCount = true; |
| | | this.optimizeJoinOfCountSql = true; |
| | | if (current > 1L) { |
| | | this.current = current; |
| | | } |
| | | |
| | | this.size = size; |
| | | this.total = total; |
| | | this.searchCount = searchCount; |
| | | } |
| | | |
| | | public boolean hasPrevious() { |
| | | return this.current > 1L; |
| | | } |
| | | |
| | | public boolean hasNext() { |
| | | return this.current < this.getPages(); |
| | | } |
| | | |
| | | public List<T> getRecords() { |
| | | return this.records; |
| | | } |
| | | |
| | | public Page<T> setRecords(List records) { |
| | | this.records = records; |
| | | return this; |
| | | } |
| | | |
| | | public long getTotal() { |
| | | return this.total; |
| | | } |
| | | |
| | | public Page<T> setTotal(long total) { |
| | | this.total = total; |
| | | return this; |
| | | } |
| | | |
| | | public long getSize() { |
| | | return this.size; |
| | | } |
| | | |
| | | public Page<T> setSize(long size) { |
| | | this.size = size; |
| | | return this; |
| | | } |
| | | |
| | | public long getCurrent() { |
| | | return this.current; |
| | | } |
| | | |
| | | public Page<T> setCurrent(long current) { |
| | | this.current = current; |
| | | return this; |
| | | } |
| | | |
| | | public String countId() { |
| | | return this.countId; |
| | | } |
| | | |
| | | public Long maxLimit() { |
| | | return this.maxLimit; |
| | | } |
| | | |
| | | private String[] mapOrderToArray(Predicate<OrderItem> filter) { |
| | | List<String> columns = new ArrayList(this.orders.size()); |
| | | this.orders.forEach((i) -> { |
| | | if (filter.test(i)) { |
| | | columns.add(i.getColumn()); |
| | | } |
| | | |
| | | }); |
| | | return (String[])columns.toArray(new String[0]); |
| | | } |
| | | |
| | | private void removeOrder(Predicate<OrderItem> filter) { |
| | | for(int i = this.orders.size() - 1; i >= 0; --i) { |
| | | if (filter.test(this.orders.get(i))) { |
| | | this.orders.remove(i); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public Page<T> addOrder(OrderItem... items) { |
| | | this.orders.addAll(Arrays.asList(items)); |
| | | return this; |
| | | } |
| | | |
| | | public Page<T> addOrder(List<OrderItem> items) { |
| | | this.orders.addAll(items); |
| | | return this; |
| | | } |
| | | |
| | | public List<OrderItem> orders() { |
| | | return this.orders; |
| | | } |
| | | |
| | | public boolean optimizeCountSql() { |
| | | return this.optimizeCountSql; |
| | | } |
| | | |
| | | public static <T> Page<T> of(long current, long size, long total, boolean searchCount) { |
| | | return new Page(current, size, total, searchCount); |
| | | } |
| | | |
| | | public boolean optimizeJoinOfCountSql() { |
| | | return this.optimizeJoinOfCountSql; |
| | | } |
| | | |
| | | public Page<T> setSearchCount(boolean searchCount) { |
| | | this.searchCount = searchCount; |
| | | return this; |
| | | } |
| | | |
| | | public Page<T> setOptimizeCountSql(boolean optimizeCountSql) { |
| | | this.optimizeCountSql = optimizeCountSql; |
| | | return this; |
| | | } |
| | | |
| | | public long getPages() { |
| | | return getPages(); |
| | | } |
| | | |
| | | public void setPages(long pages) { |
| | | this.pages = pages; |
| | | } |
| | | |
| | | public static <T> Page<T> of(long current, long size) { |
| | | return of(current, size, 0L); |
| | | } |
| | | |
| | | public static <T> Page<T> of(long current, long size, long total) { |
| | | return of(current, size, total, true); |
| | | } |
| | | |
| | | public static <T> Page<T> of(long current, long size, boolean searchCount) { |
| | | return of(current, size, 0L, searchCount); |
| | | } |
| | | |
| | | public boolean searchCount() { |
| | | return this.total < 0L ? false : this.searchCount; |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public String getCountId() { |
| | | return this.countId; |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public Long getMaxLimit() { |
| | | return this.maxLimit; |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public List<OrderItem> getOrders() { |
| | | return this.orders; |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public boolean isOptimizeCountSql() { |
| | | return this.optimizeCountSql; |
| | | } |
| | | |
| | | /** @deprecated */ |
| | | @Deprecated |
| | | public boolean isSearchCount() { |
| | | return this.searchCount; |
| | | } |
| | | |
| | | public void setOrders(final List<OrderItem> orders) { |
| | | this.orders = orders; |
| | | } |
| | | |
| | | public void setOptimizeJoinOfCountSql(final boolean optimizeJoinOfCountSql) { |
| | | this.optimizeJoinOfCountSql = optimizeJoinOfCountSql; |
| | | } |
| | | |
| | | public void setCountId(final String countId) { |
| | | this.countId = countId; |
| | | } |
| | | |
| | | public void setMaxLimit(final Long maxLimit) { |
| | | this.maxLimit = maxLimit; |
| | | } |
| | | } |
ÎļþÃû´Ó Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/HttpClient.java ÐÞ¸Ä |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | package com.vci.ubcs.codeapply.utils; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
ÎļþÃû´Ó Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/HttpClient3.java ÐÞ¸Ä |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | package com.vci.ubcs.codeapply.utils; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
ÎļþÃû´Ó Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/HttpUtil.java ÐÞ¸Ä |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | package com.vci.ubcs.codeapply.utils; |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.shaded.com.google.gson.JsonObject; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.codeapply.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class MdmEngineConstant { |
| | | /** |
| | | * ç¼ç çåæ®µ |
| | | */ |
| | | public static final String OID_FIELD = "Oid"; |
| | | |
| | | |
| | | /** |
| | | * ç¼ç çåæ®µ |
| | | */ |
| | | public static final String CODE_FIELD = "id"; |
| | | /** |
| | | * åç§° |
| | | */ |
| | | public static final String NAME_FIELD = "name"; |
| | | /*** |
| | | * æè¿° |
| | | */ |
| | | public static final String DESCRIPTION_FIELD = "description"; |
| | | |
| | | /*** |
| | | * å建è
|
| | | */ |
| | | public static final String CREATOR_FIELD = "creator"; |
| | | /*** |
| | | * å建æ¶é´ |
| | | */ |
| | | public static final String CREATORTIME_FIELD = "createTime"; |
| | | |
| | | /*** |
| | | * ä¿®æ¹è
|
| | | */ |
| | | public static final String EDITOR_FIELD = "lastModifier"; |
| | | |
| | | /*** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | public static final String EDITORTIME_FIELD = "lastModifyTime"; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | public static final String CODE_STATUS_FILED = "lcstatus"; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | public static final String CODE_STATUS_TEXT_FILED = "lcStatusText"; |
| | | |
| | | |
| | | /** |
| | | * éå¢ç çåæ®µ |
| | | */ |
| | | public static final String CODE_GROUP_FIELD = "groupcode"; |
| | | |
| | | /** |
| | | * åç±»ç主é®å段 |
| | | */ |
| | | public static final String CODE_CLASSIFY_OID_FIELD = "codeclsfid"; |
| | | |
| | | /** |
| | | * 模æ¿ç主é®å段 |
| | | */ |
| | | public static final String CODE_TEMPLATE_OID_FIELD = "codetemplateoid"; |
| | | |
| | | /** |
| | | * åç±»å
¨è·¯å¾çåæ®µ |
| | | */ |
| | | public static final String CODE_FULL_PATH_FILED = "codeclsfpath"; |
| | | |
| | | /** |
| | | * ç æ®µçé¿åº¦çåæ®µï¼-è¿ä¸æ¯æ°æ®åºéçåæ®µ |
| | | */ |
| | | public static final String CODE_SEC_LENGTH_FIELD = "codeSecLengthField"; |
| | | |
| | | /** |
| | | * å¯çº§çåæ®µ |
| | | */ |
| | | public static final String SECRET_FIELD = "secretgrade"; |
| | | /** |
| | | * æ¥æè
|
| | | */ |
| | | public static final String OWNER_FIELD = "owner"; |
| | | |
| | | |
| | | /** |
| | | * é»è®¤ç屿§å表 |
| | | */ |
| | | public static final List DEFAULT_ATTR_LIST = new ArrayList(){{ |
| | | add(OID_FIELD); |
| | | add(CODE_FIELD); |
| | | add(NAME_FIELD); |
| | | add(DESCRIPTION_FIELD); |
| | | add(CREATOR_FIELD); |
| | | add(CREATORTIME_FIELD); |
| | | add(EDITOR_FIELD); |
| | | add(EDITORTIME_FIELD); |
| | | add(CODE_STATUS_FILED); |
| | | add(CODE_STATUS_TEXT_FILED); |
| | | add(CODE_GROUP_FIELD); |
| | | add(CODE_CLASSIFY_OID_FIELD); |
| | | add(CODE_TEMPLATE_OID_FIELD); |
| | | add(CODE_FULL_PATH_FILED); |
| | | add(OWNER_FIELD); |
| | | add(SECRET_FIELD); |
| | | }}; |
| | | } |
ÎļþÃû´Ó Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/httpClient4.java ÐÞ¸Ä |
| | |
| | | package com.vci.ubcs.codeapply; |
| | | package com.vci.ubcs.codeapply.utils; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |