parent
1bab75ece5
commit
1e82fe25e4
12 changed files with 430 additions and 23 deletions
@ -0,0 +1,80 @@ |
|||||||
|
package com.huoran.users.controller; |
||||||
|
|
||||||
|
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; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 前端控制器 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
|
||||||
|
@Api(value = "后台-企业实名认证相关", tags = "后台-企业实名认证相关") |
||||||
|
@RestController |
||||||
|
@RequestMapping("/enterprise/certification") |
||||||
|
public class EnterpriseCertificationController { |
||||||
|
|
||||||
|
|
||||||
|
@Autowired |
||||||
|
public EnterpriseCertificationService service; |
||||||
|
|
||||||
|
@PostMapping("/selectEnterpriseCertificationList") |
||||||
|
@ApiOperation(value = "企业认证列表", response = EnterpriseCertification.class) |
||||||
|
public R selectEnterpriseCertificationList(@RequestBody EnterpriseCertificationLIstReq req) { |
||||||
|
return service.selectEnterpriseCertificationList(req); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/findById") |
||||||
|
@ApiOperation(value = "查询详情", response = EnterpriseCertification.class) |
||||||
|
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { |
||||||
|
EnterpriseCertification enterpriseCertification = service.getById(id); |
||||||
|
return R.ok().put("data", enterpriseCertification); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperation(value = "新增", response = EnterpriseCertification.class) |
||||||
|
public R save(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { |
||||||
|
String accountId = TokenUtils.getIdByJwtToken(request); |
||||||
|
enterpriseCertification.setAccountId(Integer.valueOf(accountId)); |
||||||
|
boolean addState = service.save(enterpriseCertification); |
||||||
|
return addState ? R.ok() : R.error("新增失败"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperation(value = "修改", response = EnterpriseCertification.class) |
||||||
|
public R update(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { |
||||||
|
String accountId = TokenUtils.getIdByJwtToken(request); |
||||||
|
enterpriseCertification.setAccountId(Integer.valueOf(accountId)); |
||||||
|
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) { |
||||||
|
boolean delState = service.removeByIds(ids); |
||||||
|
return delState ? R.ok() : R.error("删除失败"); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
@ -0,0 +1,97 @@ |
|||||||
|
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.TableId; |
||||||
|
import java.io.Serializable; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.experimental.Accessors; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = false) |
||||||
|
@Accessors(chain = true) |
||||||
|
@TableName("hr_enterprise_certification") |
||||||
|
@ApiModel(value="EnterpriseCertification对象", description="企业认证审核") |
||||||
|
public class EnterpriseCertification implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键") |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请认证人账号id") |
||||||
|
private Integer accountId; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称") |
||||||
|
private String companyName; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "统一社会信用代码") |
||||||
|
private String creditCode; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "法人") |
||||||
|
private String legalPerson; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司类型") |
||||||
|
private String type; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司注册日期") |
||||||
|
private String establishDate; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司营业期限终止日期") |
||||||
|
private String validPeriod; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司地址") |
||||||
|
private String address; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册资本") |
||||||
|
private String capital; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "经营范围") |
||||||
|
private String business; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "营业执照照片") |
||||||
|
private String businessLicensePicture; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "办学许可证") |
||||||
|
private String licenseForRunningSchool; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提交时间") |
||||||
|
private Date submitTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "审核状态(0默认待审核,1通过,2驳回)") |
||||||
|
private Integer auditStatus; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") |
||||||
|
private String platformsOurce; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账号") |
||||||
|
@TableField(exist = false) |
||||||
|
private String account; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人") |
||||||
|
@TableField(exist = false) |
||||||
|
private String proposer; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "联系方式") |
||||||
|
@TableField(exist = false) |
||||||
|
private String contactInformation; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
package com.huoran.users.entity.req; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "EnterpriseCertification对象", description = "企业认证审核列表请求参数") |
||||||
|
public class EnterpriseCertificationLIstReq { |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字") |
||||||
|
private String keyWord; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "开始提交时间") |
||||||
|
private String startCommitTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "结束提交时间") |
||||||
|
private String endCommitTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "认证状态(0默认待审核,1通过,2驳回)") |
||||||
|
private Integer auditStatus; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") |
||||||
|
private String platformsOurce; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账号") |
||||||
|
private String account; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) |
||||||
|
private Integer pageNum; |
||||||
|
@ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) |
||||||
|
private Integer pageSize; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.huoran.users.entity.req; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
@ApiModel(value = "企业认证请求参数") |
||||||
|
public class EnterpriseCertificationReq { |
||||||
|
@ApiModelProperty(value = "公司的名字") |
||||||
|
private String comapnyName; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "法人") |
||||||
|
private String legalPerson; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "统一社会信用代码") |
||||||
|
private String creditCode; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司类型") |
||||||
|
private String type; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司注册日期(例:证件上为2014年04月16日,算法返回20140416") |
||||||
|
private String establishDate; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司营业期限终止日期(例:证件上为2014年04月16日至2034年04月15日,算法返回20340415)") |
||||||
|
private String validPeriod; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "公司地址,没有识别出来时返回FailInRecognition") |
||||||
|
private String address; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册资本,没有识别出来时返回FailInRecognition") |
||||||
|
private String capital; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "经营范围,没有识别出来时返回FailInRecognition") |
||||||
|
private String business; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "营业执照图片") |
||||||
|
private String businessLicensePicture; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "办学许可证件") |
||||||
|
private String licenseForRunningSchool; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人") |
||||||
|
private String proposer; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "联系方式") |
||||||
|
private String contactInformation; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "提交时间") |
||||||
|
private Date submitTime; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.huoran.users.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.huoran.users.entity.EnterpriseCertification; |
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 Mapper 接口 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
public interface EnterpriseCertificationMapper extends BaseMapper<EnterpriseCertification> { |
||||||
|
|
||||||
|
IPage<EnterpriseCertification> selectEnterpriseCertificationList(IPage<EnterpriseCertification> page, @Param("req")EnterpriseCertificationLIstReq req); |
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.huoran.users.mapper.EnterpriseCertificationMapper"> |
||||||
|
|
||||||
|
<select id="selectEnterpriseCertificationList" |
||||||
|
resultType="com.huoran.users.entity.EnterpriseCertification"> |
||||||
|
SELECT |
||||||
|
t.* |
||||||
|
FROM |
||||||
|
( |
||||||
|
SELECT |
||||||
|
IFNULL( info.real_name, u.user_name ) proposer, |
||||||
|
a.phone AS contactInformation, |
||||||
|
a.account, |
||||||
|
c.* |
||||||
|
FROM |
||||||
|
hr_enterprise_certification c |
||||||
|
INNER JOIN hr_user_account a ON a.id = c.account_id |
||||||
|
INNER JOIN hr_user_info u ON u.user_id = a.user_id |
||||||
|
LEFT JOIN hr_user_authentication_information info ON info.account_id = a.id |
||||||
|
WHERE |
||||||
|
a.is_del = 0 |
||||||
|
AND u.is_del = 0 |
||||||
|
) t WHERE t.platforms_ource = #{req.platformsOurce} |
||||||
|
|
||||||
|
|
||||||
|
<if test=" req.auditStatus!= null"> |
||||||
|
and t.audit_status = #{req.auditStatus} |
||||||
|
</if> |
||||||
|
|
||||||
|
|
||||||
|
<if test="req.startCommitTime != '' and req.startCommitTime!= null |
||||||
|
and req.endCommitTime != '' and req.endCommitTime!= null"> |
||||||
|
AND date_format( t.submit_time, '%Y-%m-%d' ) |
||||||
|
BETWEEN #{req.startCommitTime} AND #{req.endCommitTime} |
||||||
|
</if> |
||||||
|
|
||||||
|
<if test="req.keyWord!=null and req.keyWord!='' "> |
||||||
|
and ( |
||||||
|
proposer like concat('%' #{req.keyWord} '%') |
||||||
|
or account like concat('%' #{req.keyWord} '%') |
||||||
|
or contactInformation like concat('%' #{req.keyWord} '%') |
||||||
|
or company_name like concat('%' #{req.keyWord} '%')) |
||||||
|
</if> |
||||||
|
</select> |
||||||
|
</mapper> |
@ -1,5 +1,4 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
<mapper namespace="com.huoran.users.mapper.UserAuthenticationInformationMapper"> |
<mapper namespace="com.huoran.users.mapper.UserAuthenticationInformationMapper"> |
||||||
|
|
||||||
</mapper> |
</mapper> |
||||||
|
@ -0,0 +1,20 @@ |
|||||||
|
package com.huoran.users.service; |
||||||
|
|
||||||
|
import com.huoran.common.response.R; |
||||||
|
import com.huoran.users.entity.EnterpriseCertification; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 服务类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
public interface EnterpriseCertificationService extends IService<EnterpriseCertification> { |
||||||
|
EnterpriseCertification checkWhetherItExists(String comapnyName); |
||||||
|
|
||||||
|
R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req); |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
package com.huoran.users.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.huoran.common.response.R; |
||||||
|
import com.huoran.users.entity.EnterpriseCertification; |
||||||
|
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; |
||||||
|
import com.huoran.users.mapper.EnterpriseCertificationMapper; |
||||||
|
import com.huoran.users.service.EnterpriseCertificationService; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 企业认证审核 服务实现类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author chen |
||||||
|
* @since 2023-12-18 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCertificationMapper, EnterpriseCertification> implements EnterpriseCertificationService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public EnterpriseCertification checkWhetherItExists(String company_name) { |
||||||
|
QueryWrapper<EnterpriseCertification> wrapper = new QueryWrapper<>(); |
||||||
|
wrapper.eq("company_name", company_name); |
||||||
|
return getOne(wrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public R selectEnterpriseCertificationList(EnterpriseCertificationLIstReq req) { |
||||||
|
Page<EnterpriseCertification> page = new Page<EnterpriseCertification>(req.getPageNum(), req.getPageSize()); |
||||||
|
IPage<EnterpriseCertification> pageList = baseMapper.selectEnterpriseCertificationList(page, req); |
||||||
|
return R.ok().put("data", pageList); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue