实名问题修复
This commit is contained in:
parent
ce09120724
commit
6abf247932
|
|
@ -154,27 +154,23 @@ public class WorkerCertificationController extends BaseController
|
|||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult appAddCertify(@RequestBody WorkerCertification request) {
|
||||
try {
|
||||
// 将师傅状态设置为冻结
|
||||
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());
|
||||
// 插入新的认证记录
|
||||
request.setStatus(WorkerCertifyStatus.AUDITING.getCode());
|
||||
int insertRows = workerCertificationService.insertWorkerCertification(request);
|
||||
Assert.isTrue(insertRows == 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());
|
||||
// 插入新的认证记录
|
||||
request.setStatus(WorkerCertifyStatus.AUDITING.getCode());
|
||||
int insertRows = workerCertificationService.insertWorkerCertification(request);
|
||||
Assert.isTrue(insertRows == 1, "实名认证记录新增失败");
|
||||
// 入驻特殊技能信息持久化
|
||||
if (!CollectionUtils.isEmpty(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")
|
||||
|
|
@ -184,8 +180,10 @@ public class WorkerCertificationController extends BaseController
|
|||
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
|
||||
if (workerCertification != null) {
|
||||
workerCertification.setSpecialSkills(workerSpecialSkillService.getByWorker(request.getWorkerId()));
|
||||
SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId());
|
||||
workerCertification.setMergerName(sysArea.getMergerName());
|
||||
if (workerCertification.getCompanyCountryId() != null) {
|
||||
SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId());
|
||||
workerCertification.setMergerName(sysArea.getMergerName());
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(workerCertification);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertWorkerCertification" parameterType="WorkerCertification" useGeneratedKeys="true" keyProperty="workerCertificationId">
|
||||
insert into worker_certification
|
||||
<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="idCardNum != null and idCardNum != ''">id_card_num,</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>
|
||||
</trim>
|
||||
<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="idCardNum != null and idCardNum != ''">#{idCardNum},</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 FROM worker_certification WHERE worker_id = #{workerId}
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="changeStatus">
|
||||
UPDATE worker_certification set status = #{status}
|
||||
WHERE worker_certification_id in ( #{ids} )
|
||||
|
|
|
|||
Loading…
Reference in New Issue