实名问题修复

This commit is contained in:
donqi 2022-07-26 01:07:43 +08:00
parent ce09120724
commit 6abf247932
2 changed files with 22 additions and 24 deletions

View File

@ -154,27 +154,23 @@ public class WorkerCertificationController extends BaseController
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult appAddCertify(@RequestBody WorkerCertification request) { public AjaxResult appAddCertify(@RequestBody WorkerCertification request) {
try { // 将师傅状态设置为冻结
// 将师傅状态设置为冻结 Worker worker = new Worker();
Worker worker = new Worker(); worker.setWorkerId(request.getWorkerId());
worker.setWorkerId(request.getWorkerId()); worker.setStatus(WorkerStatus.DISABLE.getCode());
worker.setStatus(WorkerStatus.DISABLE.getCode()); int updateRows = workerService.updateWorker(worker);
int updateRows = workerService.updateWorker(worker); Assert.isTrue(updateRows == 1, "实名认证记录新增失败");
Assert.isTrue(updateRows == 1, "实名认证记录新增失败"); // 删除存在的认证记录
// 删除存在的认证记录 workerCertificationService.deleteCertificationByWorkerId(request.getWorkerId());
workerCertificationService.deleteCertificationByWorkerId(request.getWorkerId()); // 插入新的认证记录
// 插入新的认证记录 request.setStatus(WorkerCertifyStatus.AUDITING.getCode());
request.setStatus(WorkerCertifyStatus.AUDITING.getCode()); int insertRows = workerCertificationService.insertWorkerCertification(request);
int insertRows = workerCertificationService.insertWorkerCertification(request); Assert.isTrue(insertRows == 1, "实名认证记录新增失败");
Assert.isTrue(insertRows == 1, "实名认证记录新增失败"); // 入驻特殊技能信息持久化
// 入驻特殊技能信息持久化 if (!CollectionUtils.isEmpty(request.getSpecialSkills())) {
workerSpecialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills()); workerSpecialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills());
return AjaxResult.success("保存成功");
} catch (Exception e) {
e.printStackTrace();
logger.error(ExceptionUtil.getExceptionMessage(e));
return AjaxResult.error(e.getMessage());
} }
return AjaxResult.success("保存成功");
} }
@PostMapping("/app/getByWorkerId") @PostMapping("/app/getByWorkerId")
@ -184,8 +180,10 @@ public class WorkerCertificationController extends BaseController
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId()); WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
if (workerCertification != null) { if (workerCertification != null) {
workerCertification.setSpecialSkills(workerSpecialSkillService.getByWorker(request.getWorkerId())); workerCertification.setSpecialSkills(workerSpecialSkillService.getByWorker(request.getWorkerId()));
SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId()); if (workerCertification.getCompanyCountryId() != null) {
workerCertification.setMergerName(sysArea.getMergerName()); SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId());
workerCertification.setMergerName(sysArea.getMergerName());
}
} }
return AjaxResult.success(workerCertification); return AjaxResult.success(workerCertification);
} catch (Exception e) { } catch (Exception e) {

View File

@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertWorkerCertification" parameterType="WorkerCertification" useGeneratedKeys="true" keyProperty="workerCertificationId"> <insert id="insertWorkerCertification" parameterType="WorkerCertification" useGeneratedKeys="true" keyProperty="workerCertificationId">
insert into worker_certification insert into worker_certification
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workerId != null and workerId != ''">worker_id,</if> <if test="workerId != null">worker_id,</if>
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="idCardNum != null and idCardNum != ''">id_card_num,</if> <if test="idCardNum != null and idCardNum != ''">id_card_num,</if>
<if test="idCardUrl1 != null">id_card_url_1,</if> <if test="idCardUrl1 != null">id_card_url_1,</if>
@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workerId != null and workerId != ''">#{workerId},</if> <if test="workerId != null">#{workerId},</if>
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="idCardNum != null and idCardNum != ''">#{idCardNum},</if> <if test="idCardNum != null and idCardNum != ''">#{idCardNum},</if>
<if test="idCardUrl1 != null">#{idCardUrl1},</if> <if test="idCardUrl1 != null">#{idCardUrl1},</if>
@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteCertificationByWorkerId" parameterType="Long"> <delete id="deleteCertificationByWorkerId" parameterType="Long">
DELETE FROM worker_certification WHERE worker_id = #{workerId} DELETE FROM worker_certification WHERE worker_id = #{workerId}
</delete> </delete>
<update id="changeStatus"> <update id="changeStatus">
UPDATE worker_certification set status = #{status} UPDATE worker_certification set status = #{status}
WHERE worker_certification_id in ( #{ids} ) WHERE worker_certification_id in ( #{ids} )