📄 accrplattribute.java
字号:
package com.doone.fj1w.fjmgr.sysmgr;
import javax.servlet.http.HttpServletRequest;
import com.doone.data.DataTable;
import com.doone.fj1w.fjmgr.order.CommonMethod;
public class AccRPLAttribute {
private HttpServletRequest request = null;
private String accountId = "";
private String accountName = "";
private String cityCode = "0590";
private String cityName = "";
private int relateNbr = 0;
private int unrelateNbr = 0;
private String actionName = "";
private String actionID = "";
private DataTable _dtRelate = null;
private DataTable _dtUnRelate = null;
private boolean isExistRelate = false;
private boolean isExistUnRelate = false;
private boolean isState = false;
String[] statu = new String[] { "A","N","L","D"};
String[] statuName = new String[] {"激活","待激活", "过期","注销" };
public DataTable get_dtRelate() {
return _dtRelate;
}
public void set_dtRelate(DataTable relate) {
_dtRelate = relate;
}
public DataTable get_dtUnRelate() {
return _dtUnRelate;
}
public void set_dtUnRelate(DataTable unRelate) {
_dtUnRelate = unRelate;
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public int getRelateNbr() {
return relateNbr;
}
public void setRelateNbr(int relateNbr) {
this.relateNbr = relateNbr;
}
public HttpServletRequest getRequest() {
return request;
}
public void setRequest(HttpServletRequest request) {
this.request = request;
}
public int getUnrelateNbr() {
return unrelateNbr;
}
public void setUnrelateNbr(int unrelateNbr) {
this.unrelateNbr = unrelateNbr;
}
public AccRPLAttribute() {
}
public void regist(HttpServletRequest request) {
this.request = request;
init();
}
private void init() {
this.setAccountId(request.getParameter("accountid"));
this.setAccountName(request.getParameter("accountname"));
ForgetCihper fc = new ForgetCihper();
this.set_dtRelate(fc.getRelaListByAcct(this.getAccountId(), "E"));
this.set_dtUnRelate(fc.getRelaListByAcct(this.getAccountId(), "D"));
if (this.get_dtRelate() != null
&& this.get_dtRelate().getRows().getCount() > 0) {
this.setRelateNbr(this.get_dtRelate().getRows().getCount());
this.setExistRelate(true);
}
if (this.get_dtUnRelate() != null
&& this.get_dtUnRelate().getRows().getCount() > 0) {
this.setUnrelateNbr(this.get_dtUnRelate().getRows().getCount());
this.setExistUnRelate(true);
}
if (this.isExistRelate) {
this.setCityCode(get_dtRelate().getRow(0).getString("citycode"));
} else if (this.isExistUnRelate) {
this.setCityCode(get_dtUnRelate().getRow(0).getString("citycode"));
}
this.setCityName(CommonMethod.getCityName(this.getCityCode()));
this.setActionID(request.getParameter("action"));
if(this.getActionID() == null || this.getActionID().equals("")){
this.setActionID("N");
}
for (int i = 0; i < this.statu.length; i++) {
if(this.getActionID().equals(statu[i]))
this.setActionName(this.statuName[i]);
}
//为激活状态的帐号才能操作
if(this.getActionID().equals("A"))
this.isState = true;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public boolean isExistRelate() {
return isExistRelate;
}
public boolean isExistUnRelate() {
return isExistUnRelate;
}
public void setExistRelate(boolean isExistRelate) {
this.isExistRelate = isExistRelate;
}
public void setExistUnRelate(boolean isExistUnRelate) {
this.isExistUnRelate = isExistUnRelate;
}
public String getRelationProduct() {
try {
if (!isExistRelate()) {
return "<tr><font color='red'>暂时没有记录!</font></tr>";
}
StringBuffer _sb = new StringBuffer();
_sb.append("<input type=\"hidden\" name=\"SelectedUserid\" value='");
_sb.append(get_dtRelate().getRow(0).getString(8));
_sb.append("'/>");
for (int i = 0; i < get_dtRelate().getRows().getCount(); i++) {
String sCreateTime = get_dtRelate().getRow(i).getString(4);
String sState = get_dtRelate().getRow(i).getString(5);
String sCancel = get_dtRelate().getRow(i).getString(6);
if(sCancel ==null || sCancel.equals(""))
sCancel = "0";
try {
switch (Integer.parseInt(sCancel)) {
case 1:
// 在用的状态下,撤销原因是1的情况下属于默认数据,需要剔除。。
sCancel = "";
break;
case 2:
// 以下的状态一般不可能出现,但是还是需要提时,可以在前台直接发现问题。
sCancel = "后台撤销";
break;
case 3:
sCancel = "过户自动撤销";
break;
default:
sCancel = "";
break;
}
} catch (Exception ex) {
// 有错误,代码不能识别,并且可能不是数字的。
sCancel = "";
}
if (sState.equals("E")) {
sState = "在用";
} else if (sState.equals("D")) {
sState = "禁用";
} else {
sState = "未知";
}
_sb.append("<tr bgcolor=\"#FFFFFF\" >");
_sb.append("<td class=\"body_td\"><div align=\"center\">");
_sb.append(get_dtRelate().getRow(i).getString(1));
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"left\">");
_sb.append(get_dtRelate().getRow(i).getString(3));
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(sCreateTime);
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"><div align=\"center\">");
_sb.append(sState).append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(sCancel);
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(get_dtRelate().getRow(i).getString(7));
_sb.append("</div></td>");
_sb.append("</tr>");
}
return _sb.toString();
} catch (Exception ex) {
return "";
}
}
public String getUnRelationProduct() {
try {
if (!this.isExistUnRelate()) {
return "<tr><font color='red'>暂时没有记录!</font></tr>";
}
StringBuffer _sb = new StringBuffer();
for (int i = 0; i < get_dtUnRelate().getRows().getCount(); i++) {
String sCreateTime = get_dtUnRelate().getRow(i).getString("createtime");
String sState = get_dtUnRelate().getRow(i).getString("state");
String sCancel = get_dtUnRelate().getRow(i).getString("cancel_res");
if(sCancel ==null || sCancel.equals(""))
sCancel = "0";
try {
switch (Integer.parseInt(sCancel)) {
case 1:
sCancel = "客户撤销";
break;
case 2:
sCancel = "后台撤销";
break;
case 3:
sCancel = "过户自动撤销";
break;
default:
sCancel = "";
break;
}
} catch (Exception ex) {
// 有错误,代码不能识别,并且可能不是数字的。
ex.printStackTrace();
sCancel = "";
}
if (sState.equals("E")) {
sState = "在用";
} else if (sState.equals("D")) {
sState = "禁用";
} else {
sState = "未知";
}
_sb.append("<tr bgcolor=\"#FFFFFF\" >");
_sb.append("<td class=\"body_td\"><div align=\"center\">");
_sb.append(get_dtUnRelate().getRow(i).getString("productname"));
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"left\">");
_sb.append(get_dtUnRelate().getRow(i).getString("phonenum"));
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(sCreateTime);
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"><div align=\"center\">");
_sb.append(sState).append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(sCancel);
_sb.append("</div></td>");
_sb.append("<td class=\"body_td\"> <div align=\"center\">");
_sb.append(get_dtUnRelate().getRow(i).getString("cancel_comment"));
_sb.append("</div></td>");
_sb.append("</tr>");
}
return _sb.toString();
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public String getBecause(){
return (String)this.request.getSession().getAttribute("can_becaues");
}
public String getActionID() {
return actionID;
}
public void setActionID(String actionID) {
this.actionID = actionID;
}
public String getActionName() {
return actionName;
}
public void setActionName(String actionName) {
this.actionName = actionName;
}
public boolean isState() {
return isState;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -