worker增加一个store_status字段,实名认证调整

This commit is contained in:
donqi 2022-08-23 20:28:52 +08:00
parent 127f8f07d2
commit 2baa5e3ddf
8 changed files with 57 additions and 19 deletions

View File

@ -155,11 +155,11 @@ public class WorkerCertificationController extends BaseController
@Transactional(rollbackFor = Exception.class)
public AjaxResult appAddCertify(@RequestBody WorkerCertification request) {
// 将师傅状态设置为冻结
Worker worker = new Worker();
worker.setWorkerId(request.getWorkerId());
worker.setStatus(WorkerStatus.DISABLE.getCode());
int updateRows = workerService.updateWorker(worker);
Assert.isTrue(updateRows == 1, "实名认证记录新增失败");
// Worker worker = new Worker();
// worker.setWorkerId(request.getWorkerId());
// worker.setStatus(WorkerStatus.DISABLE.getCode());
// int updateRows = workerService.updateWorker(worker);
// Assert.isTrue(updateRows == 1, "实名认证记录新增失败");
// 删除存在的认证记录
workerCertificationService.deleteCertificationByWorkerId(request.getWorkerId());
// 插入新的认证记录

View File

@ -301,13 +301,6 @@ public class WorkerController extends BaseController {
workerAreaService.updateWorkerServArea(request.getWorkerId(), request.getWorkerAreas());
// 入驻服务品类信息持久化
workerGoodsCategoryService.updateWorkerGoodsCategory(request.getWorkerId(), request.getGoodsCategories());
// 入驻特殊技能信息持久化
// specialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills());
// 更新师傅状态为审核中
// Worker worker = new Worker();
// worker.setWorkerId(request.getWorkerId());
// worker.setStatus(WorkerStatus.AUDITING.getCode());
// workerService.updateWorker(worker);
return AjaxResult.success("保存成功");
} catch (Exception e) {
e.printStackTrace();

View File

@ -0,0 +1,26 @@
package com.ghy.common.enums;
/**
* @author ydq
* @date : 2022-08-23 19:14
*/
public enum StoreStatus {
INIT(0, "初始"),
OK(1, "通过");
private Integer code;
private String desc;
StoreStatus(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@ -9,9 +9,7 @@ package com.ghy.common.enums;
public enum WorkerStatus {
OK(0, "正常"),
DISABLE(1, "冻结"),
DELETED(2, "删除"),
AUDITING(3, "审核中"),
AUDITFAILED(4, "审核未通过");
DELETED(2, "删除");
private final Integer code;
private final String desc;

View File

@ -45,6 +45,9 @@ public class Worker extends BaseEntity {
@Excel(name = "用户状态 0生效 1冻结 2删除", readConverterExp = "0=生效,1=冻结,2=删除")
private Integer status;
@Excel(name = "店铺状态")
private Integer storeStatus;
@Excel(name = "用户头像", cellType = Excel.ColumnType.STRING)
private String workerLogoUrl;

View File

@ -24,10 +24,14 @@ public class WorkerCertification extends BaseEntity
@Excel(name = "师傅者id")
private Long workerId;
/** 真实名 */
@Excel(name = "真实")
/** 真实名 */
@Excel(name = "真实")
private String name;
/** 真实姓 */
@Excel(name = "真实姓氏")
private String surname;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCardNum;
@ -286,11 +290,20 @@ public class WorkerCertification extends BaseEntity
this.mergerName = mergerName;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("workerCertificationId", getWorkerCertificationId())
.append("workerId", getWorkerId())
.append("surname", getSurname())
.append("name", getName())
.append("idCardNum", getIdCardNum())
.append("idCardUrl1", getIdCardUrl1())

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="WorkerCertification" id="WorkerCertificationResult">
<result property="workerCertificationId" column="worker_certification_id" />
<result property="workerId" column="worker_id" />
<result property="surname" column="surname" />
<result property="name" column="name" />
<result property="idCardNum" column="id_card_num" />
<result property="idCardUrl1" column="id_card_url_1" />
@ -32,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWorkerCertificationVo">
select worker_certification_id, worker_id, name, id_card_num, id_card_url_1, id_card_url_2, brand_name, company_size, company_name, business_license_num, business_license_url, company_province_id, company_city_id, company_country_id, company_address, legal_persion_name, legal_persion_phone_num, other_serv, status, create_by, create_time, update_by, update_time, remark from worker_certification
select worker_certification_id, worker_id, surname, name, id_card_num, id_card_url_1, id_card_url_2, brand_name, company_size, company_name, business_license_num, business_license_url, company_province_id, company_city_id, company_country_id, company_address, legal_persion_name, legal_persion_phone_num, other_serv, status, create_by, create_time, update_by, update_time, remark from worker_certification
</sql>
<select id="selectWorkerCertificationList" parameterType="WorkerCertification" resultMap="WorkerCertificationResult">
@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workerId != null">worker_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="surname != null and surname != ''">surname,</if>
<if test="idCardNum != null and idCardNum != ''">id_card_num,</if>
<if test="idCardUrl1 != null">id_card_url_1,</if>
<if test="idCardUrl2 != null">id_card_url_2,</if>
@ -98,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workerId != null">#{workerId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="surname != null and surname != ''">#{surname},</if>
<if test="idCardNum != null and idCardNum != ''">#{idCardNum},</if>
<if test="idCardUrl1 != null">#{idCardUrl1},</if>
<if test="idCardUrl2 != null">#{idCardUrl2},</if>

View File

@ -22,12 +22,13 @@
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="bannerUrl" column="banner_url"></result>
<result property="storeStatus" column="store_status" />
</resultMap>
<sql id="selectWorker">
SELECT
w.worker_id, w.name, w.account, w.phone, w.password, w.open_id, w.dept_id, sd.dept_name, sdc.banner_url, w.status, w.worker_logo_url,
w.leader_team_rate, w.leader_team_money, w.create_by, w.create_time, w.update_by, w.update_time, w.remark, w.type
w.leader_team_rate, w.leader_team_money, w.create_by, w.create_time, w.update_by, w.update_time, w.remark, w.type, w.store_status
FROM worker w
LEFT JOIN sys_dept sd ON w.dept_id = sd.dept_id
LEFT JOIN sys_dept_config sdc ON w.dept_id = sdc.dept_id
@ -94,6 +95,7 @@
<set>
<if test="type != null"> type = #{type},</if>
<if test="status != null"> status = #{status},</if>
<if test="storeStatus != null"> store_status = #{storeStatus},</if>
<if test="account != null and account != ''"> account = #{account},</if>
<if test="phone != null and phone != ''"> phone = #{phone},</if>
<if test="password != null and password != ''"> password = #{password},</if>