From 44e158d5705dc22aef41a2d9e2c1c1b1d6cc0181 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Sun, 5 Mar 2023 19:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=8A=80=E8=83=BD=E8=AE=A4?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker/WorkerCertificationController.java | 27 ++++++++++++++++--- .../mapper/goods/DeptGoodsCategoryMapper.xml | 7 +++-- .../worker/domain/WorkerCertification.java | 10 +++++++ .../ghy/worker/domain/WorkerSpecialSkill.java | 8 ++++++ 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java index c31c83d6..2e8d62de 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java @@ -12,11 +12,14 @@ import com.ghy.common.utils.ExceptionUtil; import com.ghy.common.utils.ObjectUtils; import com.ghy.common.utils.StringUtils; import com.ghy.common.utils.poi.ExcelUtil; +import com.ghy.goods.domain.DeptGoodsCategory; +import com.ghy.goods.service.DeptGoodsCategoryService; import com.ghy.system.domain.SysArea; import com.ghy.system.service.ISysAreaService; import com.ghy.worker.domain.Worker; import com.ghy.worker.domain.WorkerBank; import com.ghy.worker.domain.WorkerCertification; +import com.ghy.worker.domain.WorkerSpecialSkill; import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.WorkerBankService; import com.ghy.worker.service.WorkerService; @@ -59,6 +62,9 @@ public class WorkerCertificationController extends BaseController @Autowired private WorkerService workerService; + @Autowired + private DeptGoodsCategoryService deptGoodsCategoryService; + @RequiresPermissions("worker:certification:view") @GetMapping() public String certification() @@ -167,9 +173,7 @@ public class WorkerCertificationController extends BaseController int insertRows = workerCertificationService.insertWorkerCertification(request); Assert.isTrue(insertRows == 1, "实名认证记录新增失败"); // 入驻特殊技能信息持久化 - if (!CollectionUtils.isEmpty(request.getSpecialSkills())) { - workerSpecialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills()); - } + workerSpecialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills()); return AjaxResult.success("保存成功"); } @@ -179,7 +183,22 @@ public class WorkerCertificationController extends BaseController try { WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId()); if (workerCertification != null) { - workerCertification.setSpecialSkills(workerSpecialSkillService.getByWorker(request.getWorkerId())); + List byWorker = workerSpecialSkillService.getByWorker(request.getWorkerId()); + byWorker.forEach(workerSpecialSkill -> { + DeptGoodsCategory three = deptGoodsCategoryService.selectOneByGoodsCategoryId(workerSpecialSkill.getSpecialSkillId()); + if(three != null){ + workerSpecialSkill.setThreeDeptGoodsCategory(three); + DeptGoodsCategory two = deptGoodsCategoryService.selectOneByGoodsCategoryId(three.getParentCategoryId()); + if(two != null){ + workerSpecialSkill.setTwoDeptGoodsCategory(two); + DeptGoodsCategory first = deptGoodsCategoryService.selectOneByGoodsCategoryId(two.getParentCategoryId()); + if(first != null){ + workerSpecialSkill.setFirstDeptGoodsCategory(first); + } + } + } + }); + workerCertification.setSpecialSkills(byWorker); if (workerCertification.getCompanyCountryId() != null) { SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId()); workerCertification.setMergerName(sysArea.getMergerName()); diff --git a/ghy-goods/src/main/resources/mapper/goods/DeptGoodsCategoryMapper.xml b/ghy-goods/src/main/resources/mapper/goods/DeptGoodsCategoryMapper.xml index ad1162bb..84b5f273 100644 --- a/ghy-goods/src/main/resources/mapper/goods/DeptGoodsCategoryMapper.xml +++ b/ghy-goods/src/main/resources/mapper/goods/DeptGoodsCategoryMapper.xml @@ -61,6 +61,9 @@ and gc.type = #{type} + + and dgc.dept_goods_category_id = #{deptGoodsCategoryId} + @@ -165,8 +168,8 @@