From 614a65609c6c506b304e5199e7dff318c02c2eb0 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Wed, 20 Dec 2023 18:12:57 +0800 Subject: [PATCH] commit --- .../AliRealNameAuthenticationController.java | 4 +-- .../EnterpriseCertificationController.java | 34 +++++++++++++++---- .../users/entity/EnterpriseCertification.java | 16 +++++---- .../req/EnterpriseCertificationLIstReq.java | 6 +++- .../xml/EnterpriseCertificationMapper.xml | 6 +++- .../EnterpriseCertificationService.java | 2 +- .../EnterpriseCertificationServiceImpl.java | 5 ++- 7 files changed, 55 insertions(+), 18 deletions(-) diff --git a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java index 9edaa3d..4214b51 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -157,7 +157,7 @@ public class AliRealNameAuthenticationController { HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); if (info.getStatus()) { - if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId()))) { + if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId(),enterpriseCertification.getOpenId()))) { errorMsg = "企业名称已存在"; throw new RuntimeException(errorMsg); } @@ -201,7 +201,7 @@ public class AliRealNameAuthenticationController { HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); if (info.getStatus()) { - if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(),null))) { + if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(),null, enterpriseCertification.getOpenId()))) { errorMsg = "企业名称已存在"; throw new RuntimeException(errorMsg); } diff --git a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java index 025bfb4..3c0fe4a 100644 --- a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java +++ b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java @@ -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; @@ -36,7 +34,8 @@ public class EnterpriseCertificationController { public EnterpriseCertificationService service; /** - * 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 + * 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 + * * @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 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 ids) { diff --git a/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java b/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java index 2c14525..dd145df 100644 --- a/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java +++ b/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java @@ -1,17 +1,18 @@ package com.huoran.users.entity; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; -import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; 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.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.util.Date; + /** *

* 企业认证审核 @@ -24,7 +25,7 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("hr_enterprise_certification") -@ApiModel(value="EnterpriseCertification对象", description="企业认证审核") +@ApiModel(value = "EnterpriseCertification对象", description = "企业认证审核") public class EnterpriseCertification implements Serializable { private static final long serialVersionUID = 1L; @@ -70,7 +71,6 @@ public class EnterpriseCertification implements Serializable { private String licenseForRunningSchool; - @ApiModelProperty(value = "提交时间") private Date submitTime; @@ -102,6 +102,10 @@ public class EnterpriseCertification implements Serializable { private String city; + @ApiModelProperty(value = "认证状态(0默认未认证 1.认证中2.已认证)") + private Integer authenticationStatus; + @ApiModelProperty(value = "微信唯一标识") + private String openId; } diff --git a/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java b/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java index c6f16d7..69b5900 100644 --- a/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java +++ b/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java @@ -26,9 +26,13 @@ public class EnterpriseCertificationLIstReq { @ApiModelProperty(value = "结束提交时间") private String endCommitTime; - @ApiModelProperty(value = "认证状态(0默认待审核,1通过,2驳回)") + @ApiModelProperty(value = "审核状态(0默认待审核,1通过,2驳回)") private Integer auditStatus; + + @ApiModelProperty(value = "认证状态(0默认未认证 1.认证中2.已认证)") + private Integer authenticationStatus; + @ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") private String platformSource; diff --git a/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml b/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml index 0b6d370..4844d70 100644 --- a/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml +++ b/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml @@ -33,10 +33,14 @@ - and t.audit_status =#{req.auditStatus,jdbcType=VARCHAR}, + and t.audit_status =#{req.auditStatus,jdbcType=VARCHAR} + + and t.authentication_status =#{req.authenticationStatus,jdbcType=VARCHAR} + + AND date_format( t.submit_time, '%Y-%m-%d' ) diff --git a/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java b/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java index bc16fa8..cb30fc7 100644 --- a/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java +++ b/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java @@ -14,7 +14,7 @@ import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; * @since 2023-12-18 */ public interface EnterpriseCertificationService extends IService { - EnterpriseCertification checkWhetherItExists(String comapnyName, Integer id); + EnterpriseCertification checkWhetherItExists(String comapnyName, Integer id,String opnenId); R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req); } diff --git a/users/src/main/java/com/huoran/users/service/impl/EnterpriseCertificationServiceImpl.java b/users/src/main/java/com/huoran/users/service/impl/EnterpriseCertificationServiceImpl.java index 45435f0..cdf7fac 100644 --- a/users/src/main/java/com/huoran/users/service/impl/EnterpriseCertificationServiceImpl.java +++ b/users/src/main/java/com/huoran/users/service/impl/EnterpriseCertificationServiceImpl.java @@ -25,9 +25,10 @@ import org.springframework.util.ObjectUtils; public class EnterpriseCertificationServiceImpl extends ServiceImpl implements EnterpriseCertificationService { @Override - public EnterpriseCertification checkWhetherItExists(String company_name, Integer id) { + public EnterpriseCertification checkWhetherItExists(String company_name, Integer id,String opnenId) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("company_name", company_name); + wrapper.eq("open_id", opnenId); if (!ObjectUtils.isEmpty(id)){ wrapper.last( " and id <> " + id); @@ -41,6 +42,8 @@ public class EnterpriseCertificationServiceImpl extends ServiceImpl page = new Page(req.getPageNum(), req.getPageSize()); IPage pageList = baseMapper.selectEnterpriseCertificationList(page, req); + + return R.ok().put("data", pageList); } }