From 8f92976f571844f73942b8004e80c068a98e30b9 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Mon, 3 Mar 2025 09:13:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/taglibrary/TagLibraryController.java | 8 ++++---- .../service/inspectionslog/InspectionsLogServiceImpl.java | 8 ++++++++ .../system/service/taskinfo/TaskInfoServiceImpl.java | 2 -- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java index 9d4c189..dea7feb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java @@ -39,14 +39,14 @@ public class TagLibraryController { @PostMapping("/create") @Operation(summary = "创建企业标签") - @PreAuthorize("@ss.hasPermission('system:tag-library:create')") +// @PreAuthorize("@ss.hasPermission('system:tag-library:create')") public CommonResult createTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO createReqVO) { return success(tagLibraryService.createTagLibrary(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新企业标签") - @PreAuthorize("@ss.hasPermission('system:tag-library:update')") +// @PreAuthorize("@ss.hasPermission('system:tag-library:update')") public CommonResult updateTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO updateReqVO) { tagLibraryService.updateTagLibrary(updateReqVO); return success(true); @@ -55,7 +55,7 @@ public class TagLibraryController { @DeleteMapping("/delete") @Operation(summary = "删除企业标签") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('system:tag-library:delete')") +// @PreAuthorize("@ss.hasPermission('system:tag-library:delete')") public CommonResult deleteTagLibrary(@RequestParam("id") Integer id) { tagLibraryService.deleteTagLibrary(id); return success(true); @@ -89,7 +89,7 @@ public class TagLibraryController { @GetMapping("/childrenList") // @Operation(summary = "获得标签分页") - @PreAuthorize("@ss.hasPermission('system:tag-library:query')") +// @PreAuthorize("@ss.hasPermission('system:tag-library:query')") public CommonResult> childrenList(Long id) { List pageResult = tagLibraryService.childrenList(id); return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java index 0f89ee2..8fc494a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java @@ -327,6 +327,14 @@ public class InspectionsLogServiceImpl implements InspectionsLogService { InspectionsLogDO updateObj = BeanUtils.toBean(createReqVO, InspectionsLogDO.class); inspectionsLogMapper.insert(updateObj); + //todo 如果本次是通过, 查看该任务下所有任务时候已经通过, 如果全部都已经通过, 把任务状态修改成已结束 +// final EnterpriseInspectionsDO enterpriseInspectionsDO1 = enterpriseInspectionsMapper.selectById(updateObj.getInspectionsId()); +// if (enterpriseInspectionsDO1 == null) { +// throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS); +// } +// enterpriseInspectionsDO1.setStatus(3); +// enterpriseInspectionsMapper.updateById(enterpriseInspectionsDO1); + List signInLogDOS = signInLogMapper.selectList(new QueryWrapper().eq("ins_id", inspectionsLogNew.getId())); //插入图片 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java index 8694599..b471785 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java @@ -278,8 +278,6 @@ public class TaskInfoServiceImpl implements TaskInfoService { final DeptDO deptDO = deptService.getByUserId(value); item.setDeptName(deptDO.getName()); } - - }); } From bf36c713be2bf8fdf5d5b50aa8707929414d487b Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Mon, 3 Mar 2025 14:38:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=8C=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseInspectionsServiceImpl.java | 25 +++++++++++++++---- .../service/taskinfo/TaskInfoServiceImpl.java | 8 +++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java index afba306..8647f71 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.enterpriseinspections; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.RoleNameAndSelectTypeVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; @@ -23,6 +24,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import cn.iocoder.yudao.module.system.service.dept.DeptService; +import cn.iocoder.yudao.module.system.service.dict.DictDataService; import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService; import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; @@ -85,6 +87,8 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe private SignInLogMapper signInLogMapper; @Resource private AdminAuthService authService; + @Resource + private DictDataService dictDataService; @Override public Long createEnterpriseInspections(EnterpriseInspectionsSaveReqVO createReqVO) { @@ -245,12 +249,23 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe } //查询企业标签 - final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(taskInfoDO.getTaskType()); - if (tagLibrary != null) { - List list = new ArrayList<>(); - list.add(tagLibrary.getTagName()); - item.setTagList(list); + final List tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterpriseDO.getId()); + //添加地址 + final DictDataDO enterprisesArea = dictDataService.getDictData("enterprises_area", enterpriseDO.getRegion()); + + if (tagLibraryDOS != null && tagLibraryDOS.size() > 0) { + final List collect = tagLibraryDOS.stream().map(tagLibraryDO -> tagLibraryDO.getTagName()).collect(Collectors.toList()); + + if (enterprisesArea != null) { + collect.add(0, enterprisesArea.getLabel()); + } + + item.setTagList(collect); + } + + + item.setEnterpriseName(enterpriseDO.getEnterprisesName()); item.setEnterpriseAddress(enterpriseDO.getAddress()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java index b471785..20b683a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java @@ -267,9 +267,11 @@ public class TaskInfoServiceImpl implements TaskInfoService { if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) { taskInfoDOPageResult.getList().forEach(item->{ //获取任务标签 - final List tagLibraryDOS1 = tagLibraryService.listByTaskId(item.getId()); - if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { - item.setTagList(tagLibraryDOS1.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList())); + final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(item.getTaskType()); + if (tagLibrary != null) { + List list = new ArrayList<>(); + list.add(tagLibrary.getTagName()); + item.setTagList(list); } //发布的部门