|
|
@@ -29,6 +29,7 @@ import com.goafanti.common.model.AdminLocation;
|
|
|
import com.goafanti.common.utils.PasswordUtil;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.customer.service.CustomerService;
|
|
|
import com.goafanti.user.service.UserService;
|
|
|
|
|
|
@Controller
|
|
|
@@ -42,7 +43,8 @@ public class AdminSuperviseApiController extends CertifyApiController {
|
|
|
private AdminLocationService adminLocationService;
|
|
|
@Resource
|
|
|
private UserService userService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private CustomerService customerService;
|
|
|
/**
|
|
|
* 审核人员、客户经理、营销经理检索全部客户名称
|
|
|
*/
|
|
|
@@ -211,11 +213,16 @@ public class AdminSuperviseApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
Admin a = adminService.selectByPrimaryKey(admin.getId());
|
|
|
-
|
|
|
- if (null == a) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
+ boolean updateCustomer = false; //是否修改客户表层级关系
|
|
|
+ if (null == a) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
|
|
|
return res;
|
|
|
+
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(a.getSuperiorId())&&StringUtils.isBlank(admin.getSuperiorId())) updateCustomer = true;
|
|
|
+ if(StringUtils.isBlank(a.getSuperiorId())&&StringUtils.isNotBlank(admin.getSuperiorId())) updateCustomer = true;
|
|
|
+ if(StringUtils.isNotBlank(a.getSuperiorId())&&StringUtils.isNotBlank(admin.getSuperiorId())
|
|
|
+ &&!a.getSuperiorId().equals(admin.getSuperiorId())) updateCustomer = true;
|
|
|
Admin ad = new Admin();
|
|
|
BeanUtils.copyProperties(admin, ad);
|
|
|
res = disposeAdminLocationList(res, jo, ad);
|
|
|
@@ -230,6 +237,9 @@ public class AdminSuperviseApiController extends CertifyApiController {
|
|
|
}
|
|
|
}
|
|
|
res.setData(adminService.updateByPrimaryKeySelective(ad, roles, adminLocationList));
|
|
|
+ if(updateCustomer){
|
|
|
+ customerService.updateLadderIds(admin.getId());
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|