| | |
| | | |
| | | // 检查模板各属性的输入值是否满足要求 |
| | | String[][] inputValues = this.owner.getRightMainPanel().checkInputValues(); |
| | | //获取属性名称和值的集合 |
| | | Map<String, String> attrNameAndValMap = getAttrMap(inputValues); |
| | | String[] fields = inputValues[0]; |
| | | String[] values = inputValues[1]; |
| | | String[] dataTypes = inputValues[2]; |
| | |
| | | Object object = JSONObject.toJSON(codeOrderDTO); |
| | | Map<String,String> headerMap=new HashMap<>(); |
| | | headerMap.put("content-type","application/json"); |
| | | headerMap.put("Blade-Auth",this.owner.getTokenUserObject().getAccess_token()); |
| | | R r= HttpUtil.sendPost(url+"/addSaveCode",object.toString(),headerMap); |
| | | //R r= HttpUtil.sendPost(url+"/addSaveCode",object.toString(),headerMap); |
| | | String code=""; |
| | | if(r.isSuccess()){ |
| | | code=r.getData().toString(); |
| | | this.owner.setApplyCode(code); |
| | | |
| | | this.owner.getApplyTxt().requestFocusInWindow(); |
| | | this.owner.getApplyTxt().selectAll(); |
| | | this.owner.setAttrNameAndValMap(attrNameAndValMap); |
| | | }else{ |
| | | VCIOptionPane.showMessage(this.owner,r.getMsg()); |
| | | } |
| | | |
| | | } |
| | | private Map<String, String> getAttrMap(String[][] inputValues) { |
| | | Map<String, String> attrNameAndValMap = new LinkedHashMap<String, String>(); |
| | | String[] fields = inputValues[0]; |
| | | String[] values = inputValues[1]; |
| | | String[] outNames = inputValues[3]; |
| | | for(int k = 0;k < fields.length;k++) { |
| | | attrNameAndValMap.put(fields[k], values[k]);//属性内部名称 |
| | | attrNameAndValMap.put(outNames[k], values[k]);//属性外部名称 |
| | | } |
| | | |
| | | return attrNameAndValMap; |
| | | } |
| | | /*** |
| | | * 清空属性 |
| | | */ |