Merge remote-tracking branch 'origin/main'

main
cheney 11 months ago
commit 46911d5132
  1. 4
      users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java
  2. 34
      users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java
  3. 16
      users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java
  4. 6
      users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java
  5. 6
      users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml
  6. 2
      users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java
  7. 5
      users/src/main/java/com/huoran/users/service/impl/EnterpriseCertificationServiceImpl.java

@ -157,7 +157,7 @@ public class AliRealNameAuthenticationController {
HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class);
if (info.getStatus()) { if (info.getStatus()) {
if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId()))) { if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId(),enterpriseCertification.getOpenId()))) {
errorMsg = "企业名称已存在"; errorMsg = "企业名称已存在";
throw new RuntimeException(errorMsg); throw new RuntimeException(errorMsg);
} }
@ -201,7 +201,7 @@ public class AliRealNameAuthenticationController {
HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class);
if (info.getStatus()) { if (info.getStatus()) {
if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(),null))) { if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(),null, enterpriseCertification.getOpenId()))) {
errorMsg = "企业名称已存在"; errorMsg = "企业名称已存在";
throw new RuntimeException(errorMsg); throw new RuntimeException(errorMsg);
} }

@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.users.entity.EnterpriseCertification; import com.huoran.users.entity.EnterpriseCertification;
import com.huoran.users.entity.EnterpriseCertification;
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; import com.huoran.users.entity.req.EnterpriseCertificationLIstReq;
import com.huoran.users.service.EnterpriseCertificationService; import com.huoran.users.service.EnterpriseCertificationService;
import com.huoran.users.service.EnterpriseCertificationService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -36,7 +34,8 @@ public class EnterpriseCertificationController {
public EnterpriseCertificationService service; public EnterpriseCertificationService service;
/** /**
* 由前台申请认证后才有后台认证记录认证状态有 待审核已通过未驳回三种状态没有未提交这种状态 * 由前台申请认证后才有后台认证记录认证状态有 待审核已通过未驳回三种状态没有未提交这种状态
*
* @param req * @param req
* @return * @return
*/ */
@ -57,10 +56,10 @@ public class EnterpriseCertificationController {
@PostMapping("/enterpriseCertificationStatus") @PostMapping("/enterpriseCertificationStatus")
@ApiOperation(value = "查询企业当前认证状态", response = EnterpriseCertification.class) @ApiOperation(value = "查询企业当前认证状态", response = EnterpriseCertification.class)
public R enterpriseCertificationStatus(HttpServletRequest request) { public R enterpriseCertificationStatus(@ApiParam(name = "openId", value = "微信openId", required = true) Integer openId) {
String accountId = TokenUtils.getIdByJwtToken(request); /*String accountId = TokenUtils.getIdByJwtToken(request);*/
QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>(); QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id",accountId); queryWrapper.eq("open_id", openId);
EnterpriseCertification enterpriseCertification = service.getOne(queryWrapper); EnterpriseCertification enterpriseCertification = service.getOne(queryWrapper);
return R.ok().put("data", enterpriseCertification); 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") @PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除", response = EnterpriseCertification.class) @ApiOperation(value = "批量删除", response = EnterpriseCertification.class)
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List<Integer> ids) { public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List<Integer> ids) {

@ -1,17 +1,18 @@
package com.huoran.users.entity; package com.huoran.users.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
* 企业认证审核 * 企业认证审核
@ -24,7 +25,7 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hr_enterprise_certification") @TableName("hr_enterprise_certification")
@ApiModel(value="EnterpriseCertification对象", description="企业认证审核") @ApiModel(value = "EnterpriseCertification对象", description = "企业认证审核")
public class EnterpriseCertification implements Serializable { public class EnterpriseCertification implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -70,7 +71,6 @@ public class EnterpriseCertification implements Serializable {
private String licenseForRunningSchool; private String licenseForRunningSchool;
@ApiModelProperty(value = "提交时间") @ApiModelProperty(value = "提交时间")
private Date submitTime; private Date submitTime;
@ -102,6 +102,10 @@ public class EnterpriseCertification implements Serializable {
private String city; private String city;
@ApiModelProperty(value = "认证状态(0默认未认证 1.认证中2.已认证)")
private Integer authenticationStatus;
@ApiModelProperty(value = "微信唯一标识")
private String openId;
} }

@ -26,9 +26,13 @@ public class EnterpriseCertificationLIstReq {
@ApiModelProperty(value = "结束提交时间") @ApiModelProperty(value = "结束提交时间")
private String endCommitTime; private String endCommitTime;
@ApiModelProperty(value = "认证状态(0默认待审核,1通过,2驳回)") @ApiModelProperty(value = "审核状态(0默认待审核,1通过,2驳回)")
private Integer auditStatus; private Integer auditStatus;
@ApiModelProperty(value = "认证状态(0默认未认证 1.认证中2.已认证)")
private Integer authenticationStatus;
@ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") @ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)")
private String platformSource; private String platformSource;

@ -33,10 +33,14 @@
<if test=" req.auditStatus!= null and req.auditStatus!= ''"> <if test=" req.auditStatus!= null and req.auditStatus!= ''">
and t.audit_status =#{req.auditStatus,jdbcType=VARCHAR}, and t.audit_status =#{req.auditStatus,jdbcType=VARCHAR}
</if> </if>
<if test=" req.authenticationStatus!= null and req.authenticationStatus!= ''">
and t.authentication_status =#{req.authenticationStatus,jdbcType=VARCHAR}
</if>
<if test="req.startCommitTime != '' and req.startCommitTime!= null <if test="req.startCommitTime != '' and req.startCommitTime!= null
and req.endCommitTime != '' and req.endCommitTime!= null"> and req.endCommitTime != '' and req.endCommitTime!= null">
AND date_format( t.submit_time, '%Y-%m-%d' ) AND date_format( t.submit_time, '%Y-%m-%d' )

@ -14,7 +14,7 @@ import com.huoran.users.entity.req.EnterpriseCertificationLIstReq;
* @since 2023-12-18 * @since 2023-12-18
*/ */
public interface EnterpriseCertificationService extends IService<EnterpriseCertification> { public interface EnterpriseCertificationService extends IService<EnterpriseCertification> {
EnterpriseCertification checkWhetherItExists(String comapnyName, Integer id); EnterpriseCertification checkWhetherItExists(String comapnyName, Integer id,String opnenId);
R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req); R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req);
} }

@ -25,9 +25,10 @@ import org.springframework.util.ObjectUtils;
public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCertificationMapper, EnterpriseCertification> implements EnterpriseCertificationService { public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCertificationMapper, EnterpriseCertification> implements EnterpriseCertificationService {
@Override @Override
public EnterpriseCertification checkWhetherItExists(String company_name, Integer id) { public EnterpriseCertification checkWhetherItExists(String company_name, Integer id,String opnenId) {
QueryWrapper<EnterpriseCertification> wrapper = new QueryWrapper<>(); QueryWrapper<EnterpriseCertification> wrapper = new QueryWrapper<>();
wrapper.eq("company_name", company_name); wrapper.eq("company_name", company_name);
wrapper.eq("open_id", opnenId);
if (!ObjectUtils.isEmpty(id)){ if (!ObjectUtils.isEmpty(id)){
wrapper.last( " and id <> " + id); wrapper.last( " and id <> " + id);
@ -41,6 +42,8 @@ public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCe
public R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req) { public R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req) {
Page<EnterpriseCertification> page = new Page<EnterpriseCertification>(req.getPageNum(), req.getPageSize()); Page<EnterpriseCertification> page = new Page<EnterpriseCertification>(req.getPageNum(), req.getPageSize());
IPage<EnterpriseCertification> pageList = baseMapper.selectEnterpriseCertificationList(page, req); IPage<EnterpriseCertification> pageList = baseMapper.selectEnterpriseCertificationList(page, req);
return R.ok().put("data", pageList); return R.ok().put("data", pageList);
} }
} }

Loading…
Cancel
Save