赵鹏 1 month ago
parent
commit
488404370d
  1. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java
  2. 25
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java
  3. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java
  4. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java

8
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") @PostMapping("/create")
@Operation(summary = "创建企业标签") @Operation(summary = "创建企业标签")
@PreAuthorize("@ss.hasPermission('system:tag-library:create')") // @PreAuthorize("@ss.hasPermission('system:tag-library:create')")
public CommonResult<Integer> createTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO createReqVO) { public CommonResult<Integer> createTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO createReqVO) {
return success(tagLibraryService.createTagLibrary(createReqVO)); return success(tagLibraryService.createTagLibrary(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新企业标签") @Operation(summary = "更新企业标签")
@PreAuthorize("@ss.hasPermission('system:tag-library:update')") // @PreAuthorize("@ss.hasPermission('system:tag-library:update')")
public CommonResult<Boolean> updateTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO updateReqVO) { public CommonResult<Boolean> updateTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO updateReqVO) {
tagLibraryService.updateTagLibrary(updateReqVO); tagLibraryService.updateTagLibrary(updateReqVO);
return success(true); return success(true);
@ -55,7 +55,7 @@ public class TagLibraryController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除企业标签") @Operation(summary = "删除企业标签")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:tag-library:delete')") // @PreAuthorize("@ss.hasPermission('system:tag-library:delete')")
public CommonResult<Boolean> deleteTagLibrary(@RequestParam("id") Integer id) { public CommonResult<Boolean> deleteTagLibrary(@RequestParam("id") Integer id) {
tagLibraryService.deleteTagLibrary(id); tagLibraryService.deleteTagLibrary(id);
return success(true); return success(true);
@ -89,7 +89,7 @@ public class TagLibraryController {
@GetMapping("/childrenList") @GetMapping("/childrenList")
// @Operation(summary = "获得标签分页") // @Operation(summary = "获得标签分页")
@PreAuthorize("@ss.hasPermission('system:tag-library:query')") // @PreAuthorize("@ss.hasPermission('system:tag-library:query')")
public CommonResult<List<TagLibraryRespVO>> childrenList(Long id) { public CommonResult<List<TagLibraryRespVO>> childrenList(Long id) {
List<TagLibraryDO> pageResult = tagLibraryService.childrenList(id); List<TagLibraryDO> pageResult = tagLibraryService.childrenList(id);
return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class)); return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class));

25
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.controller.admin.auth.vo.RoleNameAndSelectTypeVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; 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.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; 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.dal.mysql.user.AdminUserMapper;
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; 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.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.inspectionslog.InspectionsLogService;
import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService; import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
@ -85,6 +87,8 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
private SignInLogMapper signInLogMapper; private SignInLogMapper signInLogMapper;
@Resource @Resource
private AdminAuthService authService; private AdminAuthService authService;
@Resource
private DictDataService dictDataService;
@Override @Override
public Long createEnterpriseInspections(EnterpriseInspectionsSaveReqVO createReqVO) { public Long createEnterpriseInspections(EnterpriseInspectionsSaveReqVO createReqVO) {
@ -245,12 +249,23 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
} }
//查询企业标签 //查询企业标签
final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(taskInfoDO.getTaskType()); final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterpriseDO.getId());
if (tagLibrary != null) { //添加地址
List<String> list = new ArrayList<>(); final DictDataDO enterprisesArea = dictDataService.getDictData("enterprises_area", enterpriseDO.getRegion());
list.add(tagLibrary.getTagName());
item.setTagList(list); if (tagLibraryDOS != null && tagLibraryDOS.size() > 0) {
final List<String> 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.setEnterpriseName(enterpriseDO.getEnterprisesName());
item.setEnterpriseAddress(enterpriseDO.getAddress()); item.setEnterpriseAddress(enterpriseDO.getAddress());

8
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); InspectionsLogDO updateObj = BeanUtils.toBean(createReqVO, InspectionsLogDO.class);
inspectionsLogMapper.insert(updateObj); 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<SignInLogDO> signInLogDOS = signInLogMapper.selectList(new QueryWrapper<SignInLogDO>().eq("ins_id", inspectionsLogNew.getId())); List<SignInLogDO> signInLogDOS = signInLogMapper.selectList(new QueryWrapper<SignInLogDO>().eq("ins_id", inspectionsLogNew.getId()));
//插入图片 //插入图片

10
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) { if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) {
taskInfoDOPageResult.getList().forEach(item->{ taskInfoDOPageResult.getList().forEach(item->{
//获取任务标签 //获取任务标签
final List<TagLibraryDO> tagLibraryDOS1 = tagLibraryService.listByTaskId(item.getId()); final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(item.getTaskType());
if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { if (tagLibrary != null) {
item.setTagList(tagLibraryDOS1.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList())); List<String> list = new ArrayList<>();
list.add(tagLibrary.getTagName());
item.setTagList(list);
} }
//发布的部门 //发布的部门
@ -278,8 +280,6 @@ public class TaskInfoServiceImpl implements TaskInfoService {
final DeptDO deptDO = deptService.getByUserId(value); final DeptDO deptDO = deptService.getByUserId(value);
item.setDeptName(deptDO.getName()); item.setDeptName(deptDO.getName());
} }
}); });
} }

Loading…
Cancel
Save