|
@@ -61,24 +61,35 @@ public class AdminPostageController {
|
|
|
Admin admin = new Admin();
|
|
|
admin.setAdminStatus(1);
|
|
|
List<Admin> adminList = sysService.listSelectAdmin(admin);
|
|
|
+
|
|
|
+ int operationPermissions = getAdminDept(); //0=无任何权限 1=客服 2=客服经理 3=财务经理 4=超级管理员
|
|
|
+
|
|
|
+ mv.addObject("operationPermissions", operationPermissions);
|
|
|
+ mv.addObject("adminList", adminList);
|
|
|
+ StitchAttrUtil.setModelAndView(postage, mv, "/admin/postage/postage_list", pagedResult);
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取登录用户的权限
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Integer getAdminDept(){
|
|
|
//获取登录人id
|
|
|
Admin loginAdmin = AdminUtils.getLoginAdmin();
|
|
|
//判断当前登录人权限
|
|
|
- int operationPermissions = 0;//0=无任何权限 1=客服 2=客服经理 3=财务经理 4=超级管理员
|
|
|
+ int operationPermissions = 0;//0=无任何权限 1=客服 2=客服经理 3=财务经理 4=超级管理员 5=财务打款
|
|
|
if(loginAdmin.getAdminDept() == 3){
|
|
|
operationPermissions = 1;
|
|
|
if(loginAdmin.getAdminManager() == 2){
|
|
|
operationPermissions = 2;
|
|
|
}
|
|
|
- }else if(loginAdmin.getAdminDept() == 4 && loginAdmin.getAdminManager() == 2){
|
|
|
+ }else if(loginAdmin.getAdminDept() == 5){
|
|
|
operationPermissions = 3;
|
|
|
- }else if(loginAdmin.getAdminDept() == 1 && loginAdmin.getAdminManager() == 2){
|
|
|
+ }else if(loginAdmin.getAdminDept() == 1){
|
|
|
operationPermissions = 4;
|
|
|
}
|
|
|
- mv.addObject("operationPermissions", operationPermissions);
|
|
|
- mv.addObject("adminList", adminList);
|
|
|
- StitchAttrUtil.setModelAndView(postage, mv, "/admin/postage/postage_list", pagedResult);
|
|
|
- return mv;
|
|
|
+ return operationPermissions;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -93,27 +104,47 @@ public class AdminPostageController {
|
|
|
if(postageId == null || postageId == 0){
|
|
|
return new ResponseJson(500, "未获取到记录id", 500);
|
|
|
}
|
|
|
- if(type == null || type == 0){
|
|
|
- return new ResponseJson(500, "修改失败。请刷新重试", 500);
|
|
|
- }
|
|
|
- if(status == null || status == 0){
|
|
|
- return new ResponseJson(500, "修改失败。请刷新重试", 500);
|
|
|
+ if(type == null || type == 0 || status == null || status == 0){
|
|
|
+ return new ResponseJson(500, "修改失败,请重试", 500);
|
|
|
}
|
|
|
+
|
|
|
+ Postage post = postageService.getPostage(postageId);
|
|
|
+
|
|
|
+ int operationPermissions = getAdminDept(); //0=无任何权限 1=客服 2=客服经理 3=财务经理 4=超级管理员
|
|
|
+
|
|
|
Postage postage = new Postage();
|
|
|
postage.setPostageId(postageId);
|
|
|
- //判断修改类型 1=客服修改申请状态 2=客服经理修改审核状态 3=财务经理修改转账状态
|
|
|
+ //判断修改类型 1=客服修改申请状态 2=客服经理修改审核状态 3=财务经理修改审核转账状态
|
|
|
+ Integer num = 0;
|
|
|
switch (type){
|
|
|
case 1:
|
|
|
- postage.setPostageCustomerStatus(status);
|
|
|
- break;
|
|
|
+ if(post.getPostageCustomerStatus() == 1 && (operationPermissions == 1 || operationPermissions ==2 || operationPermissions ==4)){
|
|
|
+ if(status == 2){
|
|
|
+ postage.setPostageCustomerStatus(status); //申请中,
|
|
|
+ postage.setPostageManagerStatus(1); //审核中
|
|
|
+ }
|
|
|
+ num = postageService.updatePostage(postage);
|
|
|
+ }
|
|
|
+ break;
|
|
|
case 2:
|
|
|
- postage.setPostageManagerStatus(status);
|
|
|
+ if(post.getPostageManagerStatus() == 1 && (operationPermissions ==2 || operationPermissions ==4)){
|
|
|
+ if(status == 2){ //状态(客服经理审核)1:审核中 2:通过 3:驳回
|
|
|
+ postage.setPostageManagerStatus(status);
|
|
|
+ postage.setPostageFinanceStatus(1); //审核中
|
|
|
+ }else{
|
|
|
+ postage.setPostageManagerStatus(status); //驳回
|
|
|
+ }
|
|
|
+ num = postageService.updatePostage(postage);
|
|
|
+ }
|
|
|
break;
|
|
|
case 3:
|
|
|
- postage.setPostageFinanceStatus(status);
|
|
|
+ if((post.getPostageFinanceStatus() == 1 ||post.getPostageFinanceStatus() == 2) && (operationPermissions ==3 || operationPermissions ==4)){
|
|
|
+ //状态(财务审核) 1:审核中 2:通过(已申请待转账) 3:驳回 4:已转账
|
|
|
+ postage.setPostageFinanceStatus(status);
|
|
|
+ num = postageService.updatePostage(postage);
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
- Integer num = postageService.updatePostage(postage);
|
|
|
if(num > 0){
|
|
|
return new ResponseJson(200, "修改成功", 200);
|
|
|
}else{
|