📄 customerservicecontrol.java
字号:
package com.doone.fj1w.fjmgr.order.page;
import com.doone.data.DataTable;
import com.doone.fj1w.fjmgr.order.AppealDAO;
import com.doone.fj1w.fjmgr.order.AppealrestoreDAO;
import com.doone.fj1w.fjmgr.order.CommonMethod;
public class CustomerServiceControl {
/**
* 当前审核人员.
*/
private String staffId = "";
/**
* 原单id.
*/
private String parentAppealid = "";
/**
* 工单当前的审核状态.
*/
private String[] statu = null;
/**
* 管理地市编码.
*/
private String staffCityCode = "";
/**
* 工单是查看权限,还是操作权限.默认为查看权限.
*/
private boolean permission = true;
private String attention = "";
/**
* 生成子单id.
*/
private String childProdOrderId = "";
/**
* 上一次审核工单的id.
*/
private String lastProdOrderId = "";
public CustomerServiceControl(String appealid, String staffId,String staffCityCode) {
this.parentAppealid = appealid;
this.staffId = staffId;
this.staffCityCode = staffCityCode;
}
public DataTable control()throws RuntimeException{
try {
AppealDAO appealDAO = new AppealDAO();
/**获取上一次审核的工单id,放这里的目的是为了可以获取上一次审核的内容,如果一开始不取出来,将会覆盖*/
lastProdOrderId = appealDAO.getProdHistoryPId(parentAppealid);
statu = appealDAO.getOrderState(parentAppealid);
if(CommonMethod.isChangeVerify(statu[1],staffCityCode)){
permission = false;
String msg = appealDAO.getValidataOrder(parentAppealid,staffId);
if(msg == null){ msg = "-3"; }
if(msg.equals("-2")){
throw new RuntimeException("数据库连接出错!");
}
if(msg.equals("-3")){
throw new RuntimeException("未知异常情况!");
}
if(msg.equals("-1")){
throw new RuntimeException("客户服务单冲突,系统中存在多条id一样的客户服务单!");
}
if(msg.equals("0")){
throw new RuntimeException("锁定客户服务单失败!");
}
if(msg.equals("1")){
throw new RuntimeException("查询原客户服务单失败!");
}
if(msg.equals("2")){
throw new RuntimeException("添加历史记录单失败!");
}
if(msg.equals("3")){
throw new RuntimeException("查询历史记录单id失败,请重新受理!");
}
if(msg.startsWith("4~")){
permission = true;
String ss[] = msg.split("~");
statu[1] = "9";//工单被锁定后,其它用户只能浏览,等同于完成权限
if( ss.length >= 2){
attention = "提示:受理单被用户:" + ss[1] + "锁定。";
}else{
attention = "提示:受理单被锁定。";
}
}else {
// 生成的新子单id.
childProdOrderId = msg;
}
}
if(permission){
//只有查看操作权限,上面已经取出一次审核的id
childProdOrderId = lastProdOrderId;
}
return appealDAO.getAppealDeail(childProdOrderId);
} catch (Exception ex) {
throw new RuntimeException();
}
}
public String[] getStatu() {
return statu;
}
public String getAttention() {
return attention;
}
/**
* 工单的操作权限.
* @return
*/
public boolean isPermission() {
return permission;
}
public String getChildProdOrderId() {
return childProdOrderId;
}
public String getParentAppealid() {
return parentAppealid;
}
/**
* 获取上一次审核的结果
* @return
*/
public DataTable lastReviewMessage(){
AppealrestoreDAO appealrestoreDAO= new AppealrestoreDAO();
return appealrestoreDAO.getAppealrestoreInfo(this.lastProdOrderId);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -