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 @@