From 48f2a3844d250848fc3bc5f476a2973200a52867 Mon Sep 17 00:00:00 2001 From: zy <276996223@qq.com> Date: Mon, 10 Feb 2025 14:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E3=80=81=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E8=B5=84=E8=B4=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise/EnterpriseController.java | 1 - .../enterprise/vo/EnterprisePageReqVO.java | 11 +++- .../admin/taskinfo/TaskInfoController.java | 65 ++++++++++++++++++- .../admin/taskinfo/vo/TaskInfoPageReqVO.java | 7 ++ .../admin/taskinfo/vo/TaskInfoRespVO.java | 24 +++++++ .../admin/taskinfo/vo/TaskInfoSaveReqVO.java | 3 + .../dataobject/enterprise/EnterpriseDO.java | 8 +-- .../dal/dataobject/taskinfo/TaskInfoDO.java | 16 +++-- .../mysql/enterprise/EnterpriseMapper.java | 25 ++++++- .../EnterpriseInspectionsMapper.java | 11 ++++ .../dal/mysql/taskinfo/TaskInfoMapper.java | 4 ++ .../dal/mysql/tasktag/TaskTagMapper.java | 14 ++++ .../service/enterprise/EnterpriseService.java | 3 + .../enterprise/EnterpriseServiceImpl.java | 7 ++ .../EnterpriseInspectionsService.java | 11 +++- .../EnterpriseInspectionsServiceImpl.java | 24 ++++++- .../service/taskinfo/TaskInfoService.java | 2 + .../service/taskinfo/TaskInfoServiceImpl.java | 36 +++++++--- .../service/tasktag/TaskTagService.java | 10 +++ .../service/tasktag/TaskTagServiceImpl.java | 6 ++ 20 files changed, 263 insertions(+), 25 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java index 1a3dc0f..25d621b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java @@ -138,7 +138,6 @@ public class EnterpriseController { pageResult.getList().forEach(item->{ item.setInviterName(adminUserService.getUser(Long.valueOf(item.getUserId())).getNickname()); }); - return success(BeanUtils.toBean(pageResult, EnterpriseRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java index 8d32687..0cc39ae 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java @@ -17,6 +17,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class EnterprisePageReqVO extends PageParam { + + @Schema(description = "ID", example = "10990") + private Long Id; + @Schema(description = "所属部门ID", example = "10990") private Long departmentId; @@ -64,11 +68,14 @@ public class EnterprisePageReqVO extends PageParam { @Schema(description = "修改人") private String updater; - @Schema(description = "管理部门", example = "26433") - private Long deptId; +// @Schema(description = "管理部门", example = "26433") +// private Long deptId; @Schema(description = "邀请人") private String inviterName; + @Schema(description = "邀请人") + private List ids; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java index 6ff7364..c41e5d4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java @@ -1,11 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.taskinfo; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.infra.api.job.JobApi; +import cn.iocoder.yudao.module.system.controller.admin.enterprise.vo.EnterprisePageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsPageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsSaveReqVO; +import cn.iocoder.yudao.module.system.controller.admin.tasktag.vo.TaskTagPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; +import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; +import cn.iocoder.yudao.module.system.service.enterprise.EnterpriseService; +import cn.iocoder.yudao.module.system.service.enterpriseinspections.EnterpriseInspectionsService; +import cn.iocoder.yudao.module.system.service.tasktag.TaskTagService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.springframework.security.access.prepost.PreAuthorize; @@ -47,6 +59,12 @@ public class TaskInfoController { private AdminUserService adminUserService; @Resource private DeptService deptService; + @Resource + private EnterpriseInspectionsService enterpriseInspectionsService; + @Resource + private TaskTagService taskTagService; + @Resource + private EnterpriseService enterpriseService; @PostMapping("/create") @@ -60,6 +78,19 @@ public class TaskInfoController { @Operation(summary = "更新任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。") @PreAuthorize("@ss.hasPermission('system:task-info:update')") public CommonResult updateTaskInfo(@Valid @RequestBody TaskInfoSaveReqVO updateReqVO) { + List eid=updateReqVO.getEnterpriseIds(); + if (eid == null || eid.isEmpty()) { + return success(false); + } + int del=enterpriseInspectionsService.deleteEnterpriseInspectionsTaskId(updateReqVO.getId()); + EnterpriseInspectionsSaveReqVO enterpriseInspectionsSaveReqVO=new EnterpriseInspectionsSaveReqVO(); + for(Long enterprise:eid) { + enterpriseInspectionsSaveReqVO.setTaskId(updateReqVO.getId()); + enterpriseInspectionsSaveReqVO.setEnterpriseId(enterprise); + if(del>0){ + enterpriseInspectionsService.createEnterpriseInspections(enterpriseInspectionsSaveReqVO); + } + } taskInfoService.updateTaskInfo(updateReqVO); return success(true); } @@ -79,7 +110,29 @@ public class TaskInfoController { @PreAuthorize("@ss.hasPermission('system:task-info:query')") public CommonResult getTaskInfo(@RequestParam("id") Long id) { TaskInfoDO taskInfo = taskInfoService.getTaskInfo(id); - return success(BeanUtils.toBean(taskInfo, TaskInfoRespVO.class)); + //获取任务包含企业 + EnterpriseInspectionsPageReqVO enterpriseInspectionsPageReqVO=new EnterpriseInspectionsPageReqVO(); + enterpriseInspectionsPageReqVO.setTaskId(taskInfo.getId()); + List enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO); + EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO(); + List longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId); + enterprisePageReqVO.setIds(longs); + List enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO); + TaskInfoRespVO bean = BeanUtils.toBean(taskInfo, TaskInfoRespVO.class); + bean.setEnterpriseIdes(enterpriseIdes); + + //获取任务标签 + TaskTagPageReqVO taskTagPageReqVO=new TaskTagPageReqVO(); + taskTagPageReqVO.setTaskId(taskInfo.getId()); + List taskTagides=taskTagService.getTaskTagList(taskTagPageReqVO); + + List taglongs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId); + + + bean.setTaskTagIdes(taskTagides); + + return success(bean); + } @GetMapping("/page") @@ -89,9 +142,19 @@ public class TaskInfoController { PageResult pageResult = taskInfoService.getTaskInfoPage(pageReqVO); AdminUserDO user = adminUserService.getUser(SecurityFrameworkUtils.getLoginUserId()); DeptDO dep= deptService.getDept( user.getDeptId()); + EnterpriseInspectionsPageReqVO enterpriseInspectionsPageReqVO=new EnterpriseInspectionsPageReqVO(); + pageResult.getList().forEach(item->{ item.setPublishDep(dep.getName()); item.setCreateName(adminUserService.getUser(Long.valueOf(item.getCreator())).getRealName()); + enterpriseInspectionsPageReqVO.setTaskId(item.getId()); + List enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO); + EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO(); + List longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId); + enterprisePageReqVO.setIds(longs); + List enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO); + item.setEnterpriseIdes(enterpriseIdes); + }); return success(BeanUtils.toBean(pageResult, TaskInfoRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java index 9f08545..75f3efa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo; +import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; import lombok.*; import java.time.LocalDate; @@ -63,4 +64,10 @@ public class TaskInfoPageReqVO extends PageParam { @Schema(description = "总共几步") private Integer taskTotal; + + @Schema(description = "企业集合", example = "1") + private List enterpriseInspectionsIdes; + + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java index 8201a65..0e3dad9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java @@ -1,5 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo; +import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; +import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; +import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -94,6 +98,26 @@ public class TaskInfoRespVO { @ExcelProperty("发布部门") private String publishDep; + @Schema(description = "企业集合") + @ExcelProperty("企业集合") + private List enterpriseIdes; + + @Schema(description = "标签集合") + @ExcelProperty("标签集合") + private List taskTagIdes; + + @Schema(description = "标签集合") + @ExcelProperty("标签集合") + private List tagLibraryIds; + + + + + + + + + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java index 573d6d0..7d28ab0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java @@ -16,6 +16,9 @@ public class TaskInfoSaveReqVO { @Schema(description = "任务ID,主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4541") private Long id; + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED) + private String taskNumber; + @Schema(description = "任务标题", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "任务标题不能为空") private String title; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java index 45863f9..bd3d76f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java @@ -80,10 +80,10 @@ public class EnterpriseDO extends BaseDO { */ private String gpsLocation; - /** - * 管理部门 - */ - private Long deptId; +// /** +// * 管理部门 +// */ +// private Long deptId; @TableField(exist = false) private Integer audit; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java index 44d828e..d7abff8 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java @@ -1,10 +1,16 @@ package cn.iocoder.yudao.module.system.dal.dataobject.taskinfo; +import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler; +import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; +import com.alibaba.excel.annotation.ExcelProperty; import com.sun.xml.bind.v2.TODO; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; import com.baomidou.mybatisplus.annotation.*; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; @@ -30,8 +36,9 @@ public class TaskInfoDO extends BaseDO { @TableId private Long id; + //任务编号 - @TableField(exist = false) +// @TableField(exist = false) private String taskNumber; /** * 任务标题 @@ -94,10 +101,9 @@ public class TaskInfoDO extends BaseDO { @TableField(exist = false) private String publishDep; - - - - + //企业集合 + @TableField(exist = false) + private List enterpriseIdes; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java index c1a1d49..05affdd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java @@ -34,7 +34,7 @@ public interface EnterpriseMapper extends BaseMapperX { .eqIfPresent(EnterpriseDO::getCreator, reqVO.getCreate()) .betweenIfPresent(EnterpriseDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(EnterpriseDO::getUpdater, reqVO.getUpdater()) - .eqIfPresent(EnterpriseDO::getDeptId, reqVO.getDeptId()) + .inIfPresent(EnterpriseDO::getId,reqVO.getIds()) .orderByDesc(EnterpriseDO::getId)); } @@ -42,4 +42,27 @@ public interface EnterpriseMapper extends BaseMapperX { return selectList(); } + + default List selectList(EnterprisePageReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(EnterpriseDO::getId, reqVO.getId()) + .eqIfPresent(EnterpriseDO::getDepartmentId, reqVO.getDepartmentId()) + .eqIfPresent(EnterpriseDO::getUserId, reqVO.getUserId()) + .eqIfPresent(EnterpriseDO::getType, reqVO.getType()) + .eqIfPresent(EnterpriseDO::getRegion, reqVO.getRegion()) + .likeIfPresent(EnterpriseDO::getEnterprisesName, reqVO.getEnterprisesName()) + .eqIfPresent(EnterpriseDO::getAddress, reqVO.getAddress()) + .likeIfPresent(EnterpriseDO::getContactName, reqVO.getContactName()) + .eqIfPresent(EnterpriseDO::getEnvironmentalContactPhone, reqVO.getEnvironmentalContactPhone()) + .eqIfPresent(EnterpriseDO::getRegistrationNumber, reqVO.getRegistrationNumber()) + .eqIfPresent(EnterpriseDO::getIntroduction, reqVO.getIntroduction()) + .betweenIfPresent(EnterpriseDO::getEstablishmentDate, reqVO.getEstablishmentDate()) + .eqIfPresent(EnterpriseDO::getGpsLocation, reqVO.getGpsLocation()) + .eqIfPresent(EnterpriseDO::getCreator, reqVO.getCreate()) + .betweenIfPresent(EnterpriseDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(EnterpriseDO::getUpdater, reqVO.getUpdater()) + .inIfPresent(EnterpriseDO::getId,reqVO.getIds()) + .orderByDesc(EnterpriseDO::getId)); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java index e1ab961..643f803 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java @@ -25,4 +25,15 @@ public interface EnterpriseInspectionsMapper extends BaseMapperX selectList(EnterpriseInspectionsPageReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId()) + .eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId()) + .betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(EnterpriseInspectionsDO::getId)); + } + + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java index 6ea61eb..0c8a4ce 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java @@ -20,6 +20,7 @@ public interface TaskInfoMapper extends BaseMapperX { default PageResult selectPage(TaskInfoPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(TaskInfoDO::getTitle, reqVO.getTitle()) + .eqIfPresent(TaskInfoDO::getTaskNumber, reqVO.getTaskNumber()) .eqIfPresent(TaskInfoDO::getDescription, reqVO.getDescription()) .eqIfPresent(TaskInfoDO::getExecCycle, reqVO.getExecCycle()) .eqIfPresent(TaskInfoDO::getTaskType, reqVO.getTaskType()) @@ -35,4 +36,7 @@ public interface TaskInfoMapper extends BaseMapperX { .orderByDesc(TaskInfoDO::getId)); } + + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java index 8a43317..d49ac61 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java @@ -5,6 +5,8 @@ import java.util.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsPageReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.system.controller.admin.tasktag.vo.*; @@ -25,4 +27,16 @@ public interface TaskTagMapper extends BaseMapperX { .orderByDesc(TaskTagDO::getId)); } + + + + default List selectList(TaskTagPageReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(TaskTagDO::getTaskId, reqVO.getTaskId()) + .eqIfPresent(TaskTagDO::getTagId, reqVO.getTagId()) + .betweenIfPresent(TaskTagDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(TaskTagDO::getId)); + } + + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java index ce5151d..db3951f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java @@ -53,5 +53,8 @@ public interface EnterpriseService { */ PageResult getEnterprisePage(EnterprisePageReqVO pageReqVO); + + List getEnterpriseList(EnterprisePageReqVO pageReqVO); + PageResult getEnterpriseByUserId(EnterprisePageReqVO pageReqVO); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java index b446dea..49e3919 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java @@ -139,6 +139,13 @@ public class EnterpriseServiceImpl implements EnterpriseService { return enterpriseMapper.selectPage(pageReqVO); } + + @Override + public List getEnterpriseList(EnterprisePageReqVO pageReqVO) { + return enterpriseMapper.selectList(pageReqVO); + } + + @Override public PageResult getEnterpriseByUserId(EnterprisePageReqVO pageReqVO) { pageReqVO.setCreate(getLoginUserId().toString()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java index 246adf2..1b08d54 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java @@ -4,7 +4,6 @@ import java.util.*; import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; import javax.validation.Valid; @@ -45,6 +44,10 @@ public interface EnterpriseInspectionsService { */ EnterpriseInspectionsDO getEnterpriseInspections(Long id); + + + int deleteEnterpriseInspectionsTaskId(Long taskId); + /** * 获得企业检查记录表,用于记录与企业相关的环保检查信息。分页 * @@ -53,4 +56,10 @@ public interface EnterpriseInspectionsService { */ PageResult getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO); + + List getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO); + + + + } 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 7718ca3..a8d1f69 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 @@ -1,14 +1,14 @@ package cn.iocoder.yudao.module.system.service.enterpriseinspections; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; import java.util.*; import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper; @@ -56,6 +56,17 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe enterpriseInspectionsMapper.deleteById(id); } + + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteEnterpriseInspectionsTaskId(Long taskId) { + LambdaQueryWrapper taskMembersDOLambdaQueryWrapper = new LambdaQueryWrapper<>(); + taskMembersDOLambdaQueryWrapper.eq(EnterpriseInspectionsDO::getTaskId, taskId); + // 删除 + return enterpriseInspectionsMapper.delete(taskMembersDOLambdaQueryWrapper); + + } + private void validateEnterpriseInspectionsExists(Long id) { if (enterpriseInspectionsMapper.selectById(id) == null) { throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS); @@ -72,4 +83,13 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe return enterpriseInspectionsMapper.selectPage(pageReqVO); } + @Override + public List getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO) { + return enterpriseInspectionsMapper.selectList(pageReqVO); + } + + + + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java index a570089..920b587 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java @@ -53,6 +53,8 @@ public interface TaskInfoService { */ PageResult getTaskInfoPage(TaskInfoPageReqVO pageReqVO); +// List getTaskInfoList(TaskInfoPageReqVO pageReqVO); + //定时执行任务 void sendTask(Long taskId); 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 1178bcb..440ac6f 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 @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.service.taskinfo; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.module.infra.api.job.JobApi; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; @@ -51,7 +53,15 @@ public class TaskInfoServiceImpl implements TaskInfoService { @Transactional public Long createTaskInfo(TaskInfoSaveReqVO createReqVO) { // 插入 + TaskInfoDO taskInfo = BeanUtils.toBean(createReqVO, TaskInfoDO.class); + + String serialNumber = ""; + String time = ""; + time = DateUtil.format(new Date(), "yyyyMMddHHmm"); + serialNumber = "HB" + time; + taskInfo.setTaskNumber(serialNumber); + taskInfoMapper.insert(taskInfo); //添加任务标签 @@ -61,14 +71,7 @@ public class TaskInfoServiceImpl implements TaskInfoService { }); } -// -// //添加定时任务 -// JobSaveReqVO jobSaveReqVO = new JobSaveReqVO(); -// try { -// jobApi.createJob(jobSaveReqVO); -// } catch (Throwable e) { -// throw new RuntimeException(e); -// } + //添加企业范围 if (!createReqVO.getEnterpriseIds().isEmpty() && createReqVO.getEnterpriseIds().size() > 0) { List list = new ArrayList<>(); @@ -87,6 +90,16 @@ public class TaskInfoServiceImpl implements TaskInfoService { enterpriseInspectionsMapper.insertBatch(list); } + if(taskInfo.getId()>0){ +// //添加定时任务 +// JobSaveReqVO jobSaveReqVO = new JobSaveReqVO(); +// try { +// jobApi.createJob(jobSaveReqVO); +// } catch (Throwable e) { +// throw new RuntimeException(e); +// } + + } // 返回 return taskInfo.getId(); @@ -143,6 +156,13 @@ public class TaskInfoServiceImpl implements TaskInfoService { return taskInfoMapper.selectPage(pageReqVO); } + + + + + + + @Override public void sendTask(Long taskId) { final TaskInfoDO taskInfoDO = taskInfoMapper.selectById(taskId); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java index a4b8638..b9494aa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java @@ -53,4 +53,14 @@ public interface TaskTagService { */ PageResult getTaskTagPage(TaskTagPageReqVO pageReqVO); + + + /** + * 获得任务标签关联分页 + * + * @param pageReqVO 分页查询 + * @return 任务标签关联分页 + */ + List getTaskTagList(TaskTagPageReqVO pageReqVO); + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java index ac4b4bf..529acc4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java @@ -72,4 +72,10 @@ public class TaskTagServiceImpl implements TaskTagService { return taskTagMapper.selectPage(pageReqVO); } + @Override + public List getTaskTagList(TaskTagPageReqVO pageReqVO) { + return taskTagMapper.selectList(pageReqVO); + } + + }