|
|
@@ -1,8 +1,6 @@
|
|
|
package com.goafanti.admin.controller;
|
|
|
|
|
|
-import java.text.ParseException;
|
|
|
import java.util.Calendar;
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
-import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
import com.goafanti.common.enums.AttachmentType;
|
|
|
@@ -25,9 +22,9 @@ import com.goafanti.common.enums.IdentityAuditStatus;
|
|
|
import com.goafanti.common.enums.IdentityProcess;
|
|
|
import com.goafanti.common.enums.OrganizationIdentityFields;
|
|
|
import com.goafanti.common.enums.UserIdentityFields;
|
|
|
+import com.goafanti.common.enums.UserLevel;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
import com.goafanti.common.model.UserIdentity;
|
|
|
-import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.user.bo.InputOrganizationIdentity;
|
|
|
import com.goafanti.user.bo.InputUserIdentity;
|
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
|
@@ -41,24 +38,23 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
@Resource
|
|
|
private OrganizationIdentityService organizationIdentityService;
|
|
|
@Resource
|
|
|
- private AdminService adminService;
|
|
|
-
|
|
|
+ private AdminService adminService;
|
|
|
+
|
|
|
/**
|
|
|
* 审核员--获取客户经理下拉
|
|
|
*/
|
|
|
@RequestMapping(value = "/accountManager", method = RequestMethod.GET)
|
|
|
- public Result getAccountManager(){
|
|
|
+ public Result getAccountManager() {
|
|
|
Result res = new Result();
|
|
|
res.setData(adminService.selectAccoutManager());
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 审核员--获取业务员(技术员)下拉
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/technician", method = RequestMethod.GET)
|
|
|
- public Result getTechnician(){
|
|
|
+ public Result getTechnician() {
|
|
|
Result res = new Result();
|
|
|
res.setData(adminService.selectTechnician());
|
|
|
return res;
|
|
|
@@ -66,11 +62,6 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
|
|
|
/**
|
|
|
* 上传认证资料(营业执照图片、组织机构代码证图片、上年度纳税申报表)
|
|
|
- *
|
|
|
- * @param req
|
|
|
- * @param sign
|
|
|
- * @param uid
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
|
|
public Result uploadCertify(HttpServletRequest req, String sign, String uid) {
|
|
|
@@ -94,9 +85,6 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
|
|
|
/**
|
|
|
* 审核员--个人用户详情
|
|
|
- *
|
|
|
- * @param uid
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/userDetail", method = RequestMethod.GET)
|
|
|
public Result userDetail(String uid) {
|
|
|
@@ -111,11 +99,6 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
|
|
|
/**
|
|
|
* 审核员审核个人用户信息
|
|
|
- *
|
|
|
- * @param userIdentity
|
|
|
- * @param bindingResult
|
|
|
- * @param paymentDateFormattedDate
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
|
|
|
public Result disposeUser(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
|
|
|
@@ -127,58 +110,59 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- if (null == userIdentity.getUid()) {
|
|
|
+ if (StringUtils.isBlank(userIdentity.getId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(userIdentity.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- if (!StringUtils.isBlank(paymentDateFormattedDate)) {
|
|
|
- try {
|
|
|
- userIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
- } catch (ParseException e) {
|
|
|
+ if (null == userIdentity.getAuditStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == userIdentity.getLevel()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!UserLevel.GENERAL.getCode().equals(userIdentity.getLevel())
|
|
|
+ || IdentityAuditStatus.PASSED.getCode().equals(userIdentity.getAuditStatus())) {
|
|
|
+ if (StringUtils.isBlank(aid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(mid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
|
|
|
+ return res;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
UserIdentity ui = new UserIdentity();
|
|
|
BeanUtils.copyProperties(userIdentity, ui);
|
|
|
- if (StringUtils.isBlank(ui.getId())) {
|
|
|
- ui.setId(UUID.randomUUID().toString());
|
|
|
- ui.setAuditStatus(null == ui.getAuditStatus() ? 0 : ui.getAuditStatus());
|
|
|
- if (IdentityAuditStatus.UNCOMMITTED.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.COMMITTED.getCode() == ui.getAuditStatus()
|
|
|
- || IdentityAuditStatus.UNPAID.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.PAID.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
- } else if (IdentityAuditStatus.NOTPASSED.getCode() == ui.getAuditStatus()
|
|
|
- || IdentityAuditStatus.PASSED.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
- }
|
|
|
- res.setData(userIdentityService.insertByAdmin(ui, aid, mid, null));
|
|
|
- } else {
|
|
|
- ui.setAuditStatus(null == ui.getAuditStatus() ? 0 : ui.getAuditStatus());
|
|
|
- if (IdentityAuditStatus.UNCOMMITTED.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.COMMITTED.getCode() == ui.getAuditStatus()
|
|
|
- || IdentityAuditStatus.UNPAID.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.PAID.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
- } else if (IdentityAuditStatus.NOTPASSED.getCode() == ui.getAuditStatus()
|
|
|
- || IdentityAuditStatus.PASSED.getCode() == ui.getAuditStatus()) {
|
|
|
- ui.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
- }
|
|
|
- res.setData(userIdentityService.updateUserDetail(ui, aid, mid, null));
|
|
|
+
|
|
|
+ if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(ui.getAuditStatus())) {
|
|
|
+ ui.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
+ } else if (IdentityAuditStatus.COMMITTED.getCode().equals(ui.getAuditStatus())
|
|
|
+ || IdentityAuditStatus.UNPAID.getCode().equals(ui.getAuditStatus())) {
|
|
|
+ ui.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
+ } else if (IdentityAuditStatus.PAID.getCode().equals(ui.getAuditStatus())) {
|
|
|
+ ui.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
+ } else if (IdentityAuditStatus.NOTPASSED.getCode().equals(ui.getAuditStatus())
|
|
|
+ || IdentityAuditStatus.PASSED.getCode().equals(ui.getAuditStatus())) {
|
|
|
+ ui.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
}
|
|
|
+ res.setData(userIdentityService.updateUserDetailByAuditAdmin(ui, aid, mid, userIdentity.getLevel()));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 审核员---团体用户详情
|
|
|
- *
|
|
|
- * @param uid
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
|
|
|
public Result orgDetail(String uid) {
|
|
|
@@ -193,11 +177,6 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
|
|
|
/**
|
|
|
* 审核员审核团体用户信息
|
|
|
- *
|
|
|
- * @param orgIdentity
|
|
|
- * @param bindingResult
|
|
|
- * @param paymentDateFormattedDate
|
|
|
- * @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
|
|
|
public Result diposeOrg(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
|
|
|
@@ -210,55 +189,56 @@ public class AdminUserCertifyApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- if (null == orgIdentity.getUid()) {
|
|
|
+ if (StringUtils.isBlank(orgIdentity.getId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(orgIdentity.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (!StringUtils.isBlank(paymentDateFormattedDate)) {
|
|
|
- try {
|
|
|
- orgIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
- } catch (ParseException e) {
|
|
|
+
|
|
|
+ if (null == orgIdentity.getAuditStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == orgIdentity.getLevel()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!UserLevel.GENERAL.getCode().equals(orgIdentity.getLevel())
|
|
|
+ || IdentityAuditStatus.PASSED.getCode().equals(orgIdentity.getAuditStatus())) {
|
|
|
+ if (StringUtils.isBlank(aid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(mid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
|
|
|
+ return res;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
OrganizationIdentity oi = new OrganizationIdentity();
|
|
|
BeanUtils.copyProperties(orgIdentity, oi);
|
|
|
|
|
|
- if (StringUtils.isBlank(oi.getId())) {
|
|
|
- oi.setId(UUID.randomUUID().toString());
|
|
|
- oi.setIdentityType(null == oi.getIdentityType() ? 0 : oi.getIdentityType());
|
|
|
- oi.setAuditStatus(null == oi.getAuditStatus() ? 0 : oi.getAuditStatus());
|
|
|
- if (IdentityAuditStatus.UNCOMMITTED.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.COMMITTED.getCode() == oi.getAuditStatus()
|
|
|
- || IdentityAuditStatus.UNPAID.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.PAID.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
- } else if (IdentityAuditStatus.NOTPASSED.getCode() == oi.getAuditStatus()
|
|
|
- || IdentityAuditStatus.PASSED.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
- }
|
|
|
- oi.setListed(null == oi.getListed() ? 0 : oi.getListed());
|
|
|
- oi.setListedType(null == oi.getListedType() ? 0 : oi.getListedType());
|
|
|
- res.setData(organizationIdentityService.insertByAdmin(oi, aid, mid, null));
|
|
|
- } else {
|
|
|
- oi.setAuditStatus(null == oi.getAuditStatus() ? 0 : oi.getAuditStatus());
|
|
|
- if (IdentityAuditStatus.UNCOMMITTED.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.COMMITTED.getCode() == oi.getAuditStatus()
|
|
|
- || IdentityAuditStatus.UNPAID.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
- } else if (IdentityAuditStatus.PAID.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
- } else if (IdentityAuditStatus.NOTPASSED.getCode() == oi.getAuditStatus()
|
|
|
- || IdentityAuditStatus.PASSED.getCode() == oi.getAuditStatus()) {
|
|
|
- oi.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
- }
|
|
|
- res.setData(organizationIdentityService.updateOrgDetail(oi, aid, mid, null));
|
|
|
+ if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(oi.getAuditStatus())) {
|
|
|
+ oi.setProcess(IdentityProcess.UNCOMMITTED.getCode());
|
|
|
+ } else if (IdentityAuditStatus.COMMITTED.getCode().equals(oi.getAuditStatus())
|
|
|
+ || IdentityAuditStatus.UNPAID.getCode().equals(oi.getAuditStatus())) {
|
|
|
+ oi.setProcess(IdentityProcess.COMMITTED.getCode());
|
|
|
+ } else if (IdentityAuditStatus.PAID.getCode().equals(oi.getAuditStatus())) {
|
|
|
+ oi.setProcess(IdentityProcess.FILLIN.getCode());
|
|
|
+ } else if (IdentityAuditStatus.NOTPASSED.getCode().equals(oi.getAuditStatus())
|
|
|
+ || IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())){
|
|
|
+ oi.setProcess(IdentityProcess.RESULTS.getCode());
|
|
|
}
|
|
|
+ res.setData(organizationIdentityService.updateOrgDetailByAuditAdmin(oi, aid, mid, orgIdentity.getLevel()));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|