师傅入驻信息查询,师傅状态补充

This commit is contained in:
donqi 2022-06-17 17:05:29 +08:00
parent 2158137e36
commit 1970ec921d
9 changed files with 76 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package com.ghy.web.controller.worker;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.core.page.TableDataInfo;
import com.ghy.common.enums.WorkerStatus;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.web.pojo.vo.WorkerSettledRequest;
import com.ghy.worker.domain.Worker;
@ -80,6 +81,11 @@ public class WorkerController extends BaseController {
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,31 @@
package com.ghy.common.enums;
/**
* 师傅状态
*
* @author ydq
* @date : 2022-06-17 15:32
*/
public enum WorkerStatus {
OK(0, "正常"),
DISABLE(1, "冻结"),
DELETED(2, "删除"),
AUDITING(3, "审核中"),
AUDITFAILED(4, "审核未通过");
private final Integer code;
private final String desc;
WorkerStatus(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@ -29,4 +29,5 @@ public class WorkerArea extends BaseEntity {
@Excel(name = "街道区域id", cellType = Excel.ColumnType.NUMERIC)
private Long streetId;
private String mergerName;
}

View File

@ -25,4 +25,6 @@ public class WorkerGoodsCategory extends BaseEntity {
* 商品类目主键
*/
private Long goodsCategoryId;
private String goodsCategoryName;
}

View File

@ -45,4 +45,8 @@ public class WorkerSpecialSkill extends BaseEntity {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date insuranceEnd;
private String specialSkillName;
private String dangerous;
}

View File

@ -14,8 +14,16 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="mergerName" column="merger_name"/>
</resultMap>
<sql id="selectWorkerArea">
SELECT wa.worker_area_id, wa.worker_id, wa.province_id, wa.city_id, wa.district_id, wa.street_id, wa.create_by, wa.create_time,
wa.update_by, wa.update_time, wa.remark, sa.area_name, sa.merger_name
FROM worker_area wa
LEFT JOIN sys_area sa on wa.street_id = sa.area_id
</sql>
<insert id="insert" parameterType="com.ghy.worker.domain.WorkerArea" useGeneratedKeys="true" keyProperty="workerAreaId">
INSERT INTO worker_area(
<if test="workerId != null and workerId > 0">worker_id,</if>
@ -48,7 +56,8 @@
</insert>
<select id="getByWorker" parameterType="Long" resultMap="WorkerAreaResult">
SELECT * FROM worker_area WHERE worker_id = #{workerId}
<include refid="selectWorkerArea"></include>
WHERE wa.worker_id = #{workerId}
</select>
<delete id="deleteByWorker" parameterType="Long">

View File

@ -11,8 +11,16 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="goodsCategoryName" column="goods_category_name"/>
</resultMap>
<sql id="selectWorkerGoodsCategory">
SELECT wgc.worker_goods_category_id, wgc.worker_id, wgc.goods_category_id, wgc.create_by, wgc.create_time, wgc.update_by,
wgc.update_time, wgc.remark, gc.goods_category_name
FROM worker_goods_category wgc
LEFT JOIN goods_category gc on gc.goods_category_id = wgc.goods_category_id
</sql>
<insert id="insert" parameterType="com.ghy.worker.domain.WorkerGoodsCategory" useGeneratedKeys="true" keyProperty="workerGoodsCategoryId">
INSERT INTO worker_goods_category(
<if test="workerId != null and workerId > 0">worker_id,</if>
@ -38,7 +46,8 @@
</insert>
<select id="getByWorker" parameterType="Long" resultMap="WorkerGoodsCategoryResult">
SELECT * FROM worker_goods_category WHERE worker_id = #{workerId}
<include refid="selectWorkerGoodsCategory"></include>
WHERE wgc.worker_id = #{workerId}
</select>
<delete id="deleteByWorker" parameterType="Long">

View File

@ -76,6 +76,7 @@
update worker
<set>
<if test="type != null"> type = #{type},</if>
<if test="status != null"> status = #{status},</if>
<if test="account != null and account != ''"> account = #{account},</if>
<if test="phone != null and phone != ''"> phone = #{phone},</if>
<if test="leaderTeamRate != null and leaderTeamRate != ''"> leader_team_rate = #{leaderTeamRate},</if>

View File

@ -15,8 +15,17 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="specialSkillName" column="special_skill_name"/>
<result property="dangerous" column="dangerous"/>
</resultMap>
<sql id="selectSpecialSkill">
SELECT wss.worker_special_skill_id, wss.worker_id, wss.special_skill_id, wss.credential, wss.insurance, wss.insurance_start,
wss.insurance_end, wss.create_by, wss.create_time, wss.update_by, wss.update_time, wss.remark, ss.special_skill_name, ss.dangerous
FROM worker_special_skill wss
LEFT JOIN special_skill ss on ss.special_skill_id = wss.special_skill_id
</sql>
<insert id="insert" parameterType="com.ghy.worker.domain.WorkerSpecialSkill" useGeneratedKeys="true"
keyProperty="workerSpecialSkillId">
INSERT INTO worker_special_skill(
@ -53,9 +62,8 @@
</insert>
<select id="getByWorker" parameterType="Long" resultMap="WorkerSpecialSkillResult">
SELECT *
FROM worker_special_skill
WHERE worker_id = #{workerId}
<include refid="selectSpecialSkill"/>
WHERE wss.worker_id = #{workerId}
</select>
<delete id="deleteByWorker" parameterType="Long">