| | |
| | | * 业务数据 |
| | | * Created by wuxw on 2018/4/13. |
| | | */ |
| | | public class Business implements Comparable{ |
| | | public class Business implements Comparable<Business>{ |
| | | |
| | | private String bId; |
| | | |
| | | //业务编码 |
| | | private String serviceCode; |
| | | |
| | | private String businessTypeCd; |
| | | |
| | | private String serviceName; |
| | | |
| | | private String remark; |
| | | |
| | | private String isInstance; |
| | | |
| | | private JSONObject datas; |
| | | |
| | | //透传 |
| | | private String transferData; |
| | | |
| | | private JSONArray attrs; |
| | | //返回 编码 |
| | |
| | | this.seq = seq; |
| | | } |
| | | |
| | | public String getIsInstance() { |
| | | return isInstance; |
| | | } |
| | | |
| | | public void setIsInstance(String isInstance) { |
| | | this.isInstance = isInstance; |
| | | } |
| | | |
| | | public String getTransferData() { |
| | | return transferData; |
| | | } |
| | | |
| | | public void setTransferData(String transferData) { |
| | | this.transferData = transferData; |
| | | } |
| | | |
| | | /** |
| | | * 构建成对象 |
| | | * @return |
| | |
| | | |
| | | try{ |
| | | this.setbId(businessObj.getString("bId")); |
| | | this.setServiceCode(businessObj.getString("serviceCode")); |
| | | this.setServiceName(businessObj.getString("serviceName")); |
| | | this.setRemark(businessObj.getString("remark")); |
| | | this.setDatas(businessObj.getJSONObject("datas")); |
| | | this.setAttrs(businessObj.getJSONArray("attrs")); |
| | | this.setBusinessTypeCd(businessObj.getString("businessTypeCd")); |
| | | if(businessObj.containsKey("serviceName")) { |
| | | this.setServiceName(businessObj.getString("serviceName")); |
| | | } |
| | | if(businessObj.containsKey("remark")) { |
| | | this.setRemark(businessObj.getString("remark")); |
| | | } |
| | | |
| | | if(businessObj.containsKey("isInstance")){ |
| | | this.setIsInstance(businessObj.getString("isInstance")); |
| | | } |
| | | if(businessObj.containsKey("datas")) { |
| | | this.setDatas(businessObj.getJSONObject("datas")); |
| | | } |
| | | |
| | | if(businessObj.containsKey("attrs")){ |
| | | this.setAttrs(businessObj.getJSONArray("attrs")); |
| | | } |
| | | |
| | | if(businessObj.containsKey("transferData")){ |
| | | this.setTransferData(businessObj.getString("transferData")); |
| | | } |
| | | |
| | | if(businessObj.containsKey("response")){ |
| | | this.setCode(businessObj.getJSONObject("response").getString("code")); |
| | | this.setMessage(businessObj.getJSONObject("response").getString("message")); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int compareTo(Object o) { |
| | | Business otherBusiness = (Business)o; |
| | | public int compareTo(Business otherBusiness) { |
| | | if(this.getSeq() > otherBusiness.getSeq()) { |
| | | return -1; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public String getBusinessTypeCd() { |
| | | return businessTypeCd; |
| | | } |
| | | |
| | | public void setBusinessTypeCd(String businessTypeCd) { |
| | | this.businessTypeCd = businessTypeCd; |
| | | } |
| | | } |