Browse Source

任务、企业、资质功能

master
zy 2 months ago
parent
commit
48f2a3844d
  1. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  2. 11
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java
  3. 65
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java
  4. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java
  5. 24
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java
  6. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java
  7. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java
  8. 16
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java
  9. 25
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java
  10. 11
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java
  11. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java
  12. 14
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java
  13. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java
  14. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  15. 11
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java
  16. 24
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java
  17. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java
  18. 36
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java
  19. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java
  20. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java

1
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));
}

11
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<Long> ids;
}

65
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<Boolean> updateTaskInfo(@Valid @RequestBody TaskInfoSaveReqVO updateReqVO) {
List<Long> 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<TaskInfoRespVO> 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<EnterpriseInspectionsDO> enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO);
EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO();
List<Long> longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
enterprisePageReqVO.setIds(longs);
List<EnterpriseDO> enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO);
TaskInfoRespVO bean = BeanUtils.toBean(taskInfo, TaskInfoRespVO.class);
bean.setEnterpriseIdes(enterpriseIdes);
//获取任务标签
TaskTagPageReqVO taskTagPageReqVO=new TaskTagPageReqVO();
taskTagPageReqVO.setTaskId(taskInfo.getId());
List<TaskTagDO> taskTagides=taskTagService.getTaskTagList(taskTagPageReqVO);
List<Long> taglongs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
bean.setTaskTagIdes(taskTagides);
return success(bean);
}
@GetMapping("/page")
@ -89,9 +142,19 @@ public class TaskInfoController {
PageResult<TaskInfoDO> 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<EnterpriseInspectionsDO> enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO);
EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO();
List<Long> longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
enterprisePageReqVO.setIds(longs);
List<EnterpriseDO> enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO);
item.setEnterpriseIdes(enterpriseIdes);
});
return success(BeanUtils.toBean(pageResult, TaskInfoRespVO.class));
}

7
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<Long> enterpriseInspectionsIdes;
}

24
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<EnterpriseDO> enterpriseIdes;
@Schema(description = "标签集合")
@ExcelProperty("标签集合")
private List<TaskTagDO> taskTagIdes;
@Schema(description = "标签集合")
@ExcelProperty("标签集合")
private List<TagLibraryDO> tagLibraryIds;

3
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;

8
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;

16
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<EnterpriseDO> enterpriseIdes;
}

25
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<EnterpriseDO> {
.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<EnterpriseDO> {
return selectList();
}
default List<EnterpriseDO> selectList(EnterprisePageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<EnterpriseDO>()
.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));
}
}

11
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<EnterpriseInspe
.orderByDesc(EnterpriseInspectionsDO::getId));
}
default List<EnterpriseInspectionsDO> selectList(EnterpriseInspectionsPageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<EnterpriseInspectionsDO>()
.eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId())
.betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EnterpriseInspectionsDO::getId));
}
}

4
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<TaskInfoDO> {
default PageResult<TaskInfoDO> selectPage(TaskInfoPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<TaskInfoDO>()
.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<TaskInfoDO> {
.orderByDesc(TaskInfoDO::getId));
}
}

14
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<TaskTagDO> {
.orderByDesc(TaskTagDO::getId));
}
default List<TaskTagDO> selectList(TaskTagPageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<TaskTagDO>()
.eqIfPresent(TaskTagDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(TaskTagDO::getTagId, reqVO.getTagId())
.betweenIfPresent(TaskTagDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(TaskTagDO::getId));
}
}

3
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<EnterpriseDO> getEnterprisePage(EnterprisePageReqVO pageReqVO);
List<EnterpriseDO> getEnterpriseList(EnterprisePageReqVO pageReqVO);
PageResult<EnterpriseDO> getEnterpriseByUserId(EnterprisePageReqVO pageReqVO);
}

7
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<EnterpriseDO> getEnterpriseList(EnterprisePageReqVO pageReqVO) {
return enterpriseMapper.selectList(pageReqVO);
}
@Override
public PageResult<EnterpriseDO> getEnterpriseByUserId(EnterprisePageReqVO pageReqVO) {
pageReqVO.setCreate(getLoginUserId().toString());

11
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<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO);
List<EnterpriseInspectionsDO> getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO);
}

24
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<EnterpriseInspectionsDO> 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<EnterpriseInspectionsDO> getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO) {
return enterpriseInspectionsMapper.selectList(pageReqVO);
}
}

2
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<TaskInfoDO> getTaskInfoPage(TaskInfoPageReqVO pageReqVO);
// List<TaskInfoDO> getTaskInfoList(TaskInfoPageReqVO pageReqVO);
//定时执行任务
void sendTask(Long taskId);

36
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<EnterpriseInspectionsDO> 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);

10
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<TaskTagDO> getTaskTagPage(TaskTagPageReqVO pageReqVO);
/**
* 获得任务标签关联分页
*
* @param pageReqVO 分页查询
* @return 任务标签关联分页
*/
List<TaskTagDO> getTaskTagList(TaskTagPageReqVO pageReqVO);
}

6
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<TaskTagDO> getTaskTagList(TaskTagPageReqVO pageReqVO) {
return taskTagMapper.selectList(pageReqVO);
}
}

Loading…
Cancel
Save