|
|
|
@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.huoran.common.response.R; |
|
|
|
|
import com.huoran.common.utils.TokenUtils; |
|
|
|
|
import com.huoran.users.entity.EnterpriseCertification; |
|
|
|
|
import com.huoran.users.entity.EnterpriseCertification; |
|
|
|
|
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; |
|
|
|
|
import com.huoran.users.service.EnterpriseCertificationService; |
|
|
|
|
import com.huoran.users.service.EnterpriseCertificationService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
@ -37,6 +35,7 @@ public class EnterpriseCertificationController { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 |
|
|
|
|
* |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -57,10 +56,10 @@ public class EnterpriseCertificationController { |
|
|
|
|
|
|
|
|
|
@PostMapping("/enterpriseCertificationStatus") |
|
|
|
|
@ApiOperation(value = "查询企业当前认证状态", response = EnterpriseCertification.class) |
|
|
|
|
public R enterpriseCertificationStatus(HttpServletRequest request) { |
|
|
|
|
String accountId = TokenUtils.getIdByJwtToken(request); |
|
|
|
|
public R enterpriseCertificationStatus(@ApiParam(name = "openId", value = "微信openId", required = true) Integer openId) { |
|
|
|
|
/*String accountId = TokenUtils.getIdByJwtToken(request);*/ |
|
|
|
|
QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("account_id",accountId); |
|
|
|
|
queryWrapper.eq("open_id", openId); |
|
|
|
|
EnterpriseCertification enterpriseCertification = service.getOne(queryWrapper); |
|
|
|
|
return R.ok().put("data", enterpriseCertification); |
|
|
|
|
} |
|
|
|
@ -86,6 +85,29 @@ public class EnterpriseCertificationController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/informationAudit") |
|
|
|
|
@ApiOperation(value = "信息审核", response = EnterpriseCertification.class) |
|
|
|
|
public R informationAudit(@ApiParam(name = "auditStatus", value = "审核状态(2.通过,3.不通过)", required = true) Integer auditStatus, @ApiParam(name = "id", value = "主键", required = true) Integer id, HttpServletRequest request) { |
|
|
|
|
String accountId = TokenUtils.getIdByJwtToken(request); |
|
|
|
|
|
|
|
|
|
EnterpriseCertification enterpriseCertification = new EnterpriseCertification(); |
|
|
|
|
enterpriseCertification.setAccountId(Integer.valueOf(accountId)); |
|
|
|
|
enterpriseCertification.setAuditStatus(auditStatus); |
|
|
|
|
switch (auditStatus) { |
|
|
|
|
case 2: |
|
|
|
|
//通过:更改认证状态 认证状态(0默认未认证 1.认证中2.已认证)
|
|
|
|
|
enterpriseCertification.setAuthenticationStatus(2); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
//不通过
|
|
|
|
|
enterpriseCertification.setAuthenticationStatus(0); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean updateState = service.updateById(enterpriseCertification); |
|
|
|
|
return updateState ? R.ok() : R.error("编辑失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
|
@ApiOperation(value = "批量删除", response = EnterpriseCertification.class) |
|
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List<Integer> ids) { |
|
|
|
|