feat(demand): 新增需求管理和版本号功能
- 添加需求管理相关实体类、Mapper、Service和Controller - 实现需求列表查询、详情查看、新增、编辑和删除功能 - 添加版本号管理相关实体类、Mapper、Service和Controller - 实现版本号列表查询、详情查看、新增、编辑和删除功能 - 新增版本号树形结构查询功能 - 更新工作日志实体类,增加需求Id等字段 - 修改定时任务白名单配置dev_1.2.0
parent
91658c71a7
commit
ce64642460
|
@ -0,0 +1,73 @@
|
|||
package tech.unissense.pms.web.controller.business.demand;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
import tech.unissense.pms.business.demand.service.IProjectDemandService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.common.core.controller.BaseController;
|
||||
import tech.unissense.pms.common.core.domain.AjaxResult;
|
||||
import tech.unissense.pms.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectDemand)表控制层
|
||||
* @Date 2025-03-20 14:53:19
|
||||
*/
|
||||
@Api("需求管理")
|
||||
@RestController
|
||||
@RequestMapping("demand")
|
||||
|
||||
public class ProjectDemandController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IProjectDemandService projectDemandService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProjectDemand projectDemand) {
|
||||
startPage();
|
||||
List<ProjectDemand> list = projectDemandService.queryAll(projectDemand);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(projectDemandService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult add(@RequestBody ProjectDemand projectDemand) {
|
||||
return toAjax(projectDemandService.insert(projectDemand));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody ProjectDemand projectDemand) {
|
||||
return toAjax(projectDemandService.update(projectDemand));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(projectDemandService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(projectDemandService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package tech.unissense.pms.web.controller.business.version;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import tech.unissense.pms.business.version.domain.ProjectVersion;
|
||||
import tech.unissense.pms.business.version.service.IProjectVersionService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.common.core.controller.BaseController;
|
||||
import tech.unissense.pms.common.core.domain.AjaxResult;
|
||||
import tech.unissense.pms.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectVersion)表控制层
|
||||
* @Date 2025-03-20 14:58:03
|
||||
*/
|
||||
@Api(tags = "版本号")
|
||||
@RestController
|
||||
@RequestMapping("projectVersion")
|
||||
|
||||
public class ProjectVersionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IProjectVersionService projectVersionService;
|
||||
|
||||
@ApiOperation("列表查询")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProjectVersion projectVersion) {
|
||||
startPage();
|
||||
List<ProjectVersion> list = projectVersionService.queryAll(projectVersion);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ApiOperation("树形查询")
|
||||
@GetMapping("/tree")
|
||||
public AjaxResult tree(ProjectVersion projectVersion) {
|
||||
return AjaxResult.success(projectVersionService.treeList(projectVersion));
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID查详情")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(projectVersionService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增数据")
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult add(@RequestBody ProjectVersion projectVersion) {
|
||||
return toAjax(projectVersionService.insert(projectVersion));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody ProjectVersion projectVersion) {
|
||||
return toAjax(projectVersionService.update(projectVersion));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(projectVersionService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(projectVersionService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package tech.unissense.pms.business.demand.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (ProjectDemand)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-03-20 14:53:20
|
||||
*/
|
||||
@Data
|
||||
public class ProjectDemand implements Serializable {
|
||||
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
|
||||
private String title;
|
||||
/**
|
||||
* 版本id
|
||||
*/
|
||||
|
||||
private Integer versionId;
|
||||
|
||||
/**
|
||||
* 需求状态 0待排期 1:已计划 2:进行中 3:已完成 4:已关闭
|
||||
*/
|
||||
|
||||
private String demandStatus;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
|
||||
private Integer responsiblePerson;
|
||||
/**
|
||||
* 预估工时
|
||||
*/
|
||||
|
||||
private String estimatedWorkHours;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
|
||||
private Date endTime;
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
private String priority;
|
||||
private Integer projectId;
|
||||
|
||||
private String versionNumber;
|
||||
//负责人名称
|
||||
private String responsiblePersonName;
|
||||
private List<String> demandStatusList;
|
||||
/**
|
||||
* 需求状态
|
||||
*/
|
||||
public enum DemandStatus
|
||||
{
|
||||
/** 0待排期 */
|
||||
|
||||
DPQ("0","待排期"),
|
||||
/** 已计划 */
|
||||
YJH("1","已计划"),
|
||||
/** 进行中 */
|
||||
JXZ("2","进行中"),
|
||||
/** 已完成 */
|
||||
YWC("3","已完成"),
|
||||
/** 已关闭 */
|
||||
YGB("4","已关闭"),
|
||||
|
||||
;
|
||||
|
||||
private final String value;
|
||||
private final String remark;
|
||||
|
||||
DemandStatus(String value,String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
public static String getRemark(String value)
|
||||
{
|
||||
for (DemandStatus demandStatus : DemandStatus.values()) {
|
||||
if (demandStatus.value.equals(value)){
|
||||
return demandStatus.remark;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package tech.unissense.pms.business.demand.mapper;
|
||||
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectDemand)表数据库访问层
|
||||
* @Date 2025-03-20 14:53:19
|
||||
*/
|
||||
public interface ProjectDemandMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param projectDemand 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ProjectDemand> queryAll(ProjectDemand projectDemand);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectDemand queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectDemand projectDemand);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectDemand projectDemand);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
List<ProjectDemand> listByVersionIdList(List<Integer> versionIdList);
|
||||
|
||||
void scheduleUpdateDemandStatus();
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package tech.unissense.pms.business.demand.service;
|
||||
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectDemand)表服务接口
|
||||
* @Date 2025-03-20 14:53:20
|
||||
*/
|
||||
public interface IProjectDemandService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<ProjectDemand> queryAll(ProjectDemand projectDemand);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectDemand queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectDemand projectDemand);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectDemand projectDemand);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 根据versionId查询List
|
||||
*
|
||||
* @param versionIdList
|
||||
* @return tech.unissense.pms.business.demand.domain.ProjectDemand
|
||||
* @author ch
|
||||
* @date 2025/03/20 15:24
|
||||
*/
|
||||
List<ProjectDemand> listByVersionIdList(List<Integer> versionIdList);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package tech.unissense.pms.business.demand.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.springframework.cglib.core.Local;
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
import tech.unissense.pms.business.demand.mapper.ProjectDemandMapper;
|
||||
import tech.unissense.pms.business.demand.service.IProjectDemandService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.common.exception.ServiceException;
|
||||
import tech.unissense.pms.common.utils.DateUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectDemand)表服务实现类
|
||||
* @Date 2025-03-20 14:53:20
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ProjectDemandServiceImpl implements IProjectDemandService {
|
||||
|
||||
@Resource
|
||||
private ProjectDemandMapper projectDemandMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param projectDemand 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectDemand> queryAll(ProjectDemand projectDemand) {
|
||||
List<ProjectDemand> dataList = projectDemandMapper.queryAll(projectDemand);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDemand queryById(Integer id) {
|
||||
return projectDemandMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(ProjectDemand projectDemand) {
|
||||
if (projectDemand.getEndTime() == null) {
|
||||
//根据当前时间向上取整
|
||||
BigDecimal estimatedWorkHours = new BigDecimal(projectDemand.getEstimatedWorkHours());
|
||||
BigDecimal bigDecimal = estimatedWorkHours.setScale(0, RoundingMode.CEILING);
|
||||
LocalDate createDate = projectDemand.getCreateTime() == null ? LocalDate.now() :
|
||||
projectDemand.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
projectDemand.setEndTime(DateUtil.date(createDate.plusDays(bigDecimal.intValue())));
|
||||
}
|
||||
return projectDemandMapper.insert(projectDemand);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更改逻辑:1:已完成,已关闭状态发生变更必须校验结束时间在当前时间之后 2:定时任务修改状态为已完成
|
||||
*
|
||||
* @param projectDemand
|
||||
* @return int
|
||||
* @author ch
|
||||
* @date 2025/03/21 10:58
|
||||
*/
|
||||
@Override
|
||||
public int update(ProjectDemand projectDemand) {
|
||||
ProjectDemand existDemand = this.queryById(projectDemand.getId());
|
||||
//已完成或已关闭状态
|
||||
boolean statusFlag = ProjectDemand.DemandStatus.YWC.value().equals(existDemand.getDemandStatus())
|
||||
|| ProjectDemand.DemandStatus.YGB.value().equals(existDemand.getDemandStatus());
|
||||
// 当前状态发生变化,并且结束时间在当前时间之前
|
||||
boolean timeFlag = !existDemand.getDemandStatus().equals(projectDemand.getDemandStatus()) && DateUtils.getNowDate().before(projectDemand.getEndTime());
|
||||
if (statusFlag && timeFlag) {
|
||||
throw new ServiceException("结束时间不能早于当前时间");
|
||||
}
|
||||
|
||||
return projectDemandMapper.update(projectDemand);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return projectDemandMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return projectDemandMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectDemand> listByVersionIdList(List<Integer> versionIdList) {
|
||||
return projectDemandMapper.listByVersionIdList(versionIdList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package tech.unissense.pms.business.version.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (ProjectVersion)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-03-20 14:58:03
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class ProjectVersion implements Serializable {
|
||||
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Integer projectId;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String versionNumber;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
|
||||
private String versionDesc;
|
||||
/**
|
||||
* 发布日期
|
||||
*/
|
||||
|
||||
private Date releaseDate;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
private List<ProjectDemand> demandList;
|
||||
|
||||
private Integer userId;
|
||||
private List<String> demandStatusList;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package tech.unissense.pms.business.version.mapper;
|
||||
|
||||
import tech.unissense.pms.business.version.domain.ProjectVersion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectVersion)表数据库访问层
|
||||
* @Date 2025-03-20 14:58:03
|
||||
*/
|
||||
public interface ProjectVersionMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param projectVersion 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ProjectVersion> queryAll(ProjectVersion projectVersion);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectVersion queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectVersion projectVersion);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectVersion projectVersion);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package tech.unissense.pms.business.version.service;
|
||||
|
||||
import tech.unissense.pms.business.version.domain.ProjectVersion;
|
||||
import tech.unissense.pms.business.version.vo.VersionTreeVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectVersion)表服务接口
|
||||
* @Date 2025-03-20 14:58:03
|
||||
*/
|
||||
public interface IProjectVersionService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<ProjectVersion> queryAll(ProjectVersion projectVersion);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectVersion queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectVersion projectVersion);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectVersion projectVersion);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
List<VersionTreeVo> treeList(ProjectVersion projectVersion);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package tech.unissense.pms.business.version.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
import tech.unissense.pms.business.demand.service.IProjectDemandService;
|
||||
import tech.unissense.pms.business.version.domain.ProjectVersion;
|
||||
import tech.unissense.pms.business.version.mapper.ProjectVersionMapper;
|
||||
import tech.unissense.pms.business.version.service.IProjectVersionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.business.version.vo.VersionTreeVo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectVersion)表服务实现类
|
||||
* @Date 2025-03-20 14:58:04
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ProjectVersionServiceImpl implements IProjectVersionService {
|
||||
|
||||
@Resource
|
||||
private ProjectVersionMapper projectVersionMapper;
|
||||
|
||||
@Autowired
|
||||
private IProjectDemandService demandService;
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param projectVersion 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectVersion> queryAll(ProjectVersion projectVersion) {
|
||||
List<ProjectVersion> dataList = projectVersionMapper.queryAll(projectVersion);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectVersion queryById(Integer id) {
|
||||
return projectVersionMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(ProjectVersion projectVersion) {
|
||||
return projectVersionMapper.insert(projectVersion);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(ProjectVersion projectVersion) {
|
||||
return projectVersionMapper.update(projectVersion);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return projectVersionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return projectVersionMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VersionTreeVo> treeList(ProjectVersion projectVersion) {
|
||||
// 获取当前项目下的所有版本信息
|
||||
List<ProjectVersion> projectVersions = projectVersionMapper.queryAll(projectVersion);
|
||||
|
||||
// 构建需求查询参数(根据项目ID)
|
||||
ProjectDemand param = new ProjectDemand();
|
||||
param.setProjectId(projectVersion.getProjectId());
|
||||
if (projectVersion.getUserId() != null) {
|
||||
param.setResponsiblePerson(projectVersion.getUserId());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(projectVersion.getDemandStatusList())) {
|
||||
param.setDemandStatusList(projectVersion.getDemandStatusList());
|
||||
}
|
||||
List<ProjectDemand> allDemands = demandService.queryAll(param);
|
||||
// 过滤出未关联版本的根需求(versionId为null的需求)
|
||||
List<ProjectDemand> rootDemands = allDemands.stream()
|
||||
.filter(d -> d.getVersionId() == null)
|
||||
.collect(Collectors.toList());
|
||||
// 将根需求转换为树节点(类型为1表示需求节点)
|
||||
List<VersionTreeVo> versionTreeVoList = rootDemands.stream()
|
||||
.sorted(Comparator.comparing(ProjectDemand::getCreateTime))
|
||||
.map(item -> {
|
||||
VersionTreeVo node = new VersionTreeVo();
|
||||
node.setId(item.getId());
|
||||
node.setTitle(item.getTitle());
|
||||
node.setType("1");
|
||||
node.setChildrenList(Collections.emptyList());
|
||||
return node;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 按版本ID分组需求(versionId不为null的需求)
|
||||
// 用于快速查找每个版本关联的需求列表
|
||||
Map<Integer, List<ProjectDemand>> versionIdMap = allDemands.stream().filter(item -> item.getVersionId() != null)
|
||||
.collect(Collectors.groupingBy(ProjectDemand::getVersionId));
|
||||
|
||||
// 处理每个项目版本,构建版本节点
|
||||
for (ProjectVersion version : projectVersions) {
|
||||
VersionTreeVo node = new VersionTreeVo();
|
||||
node.setId(version.getId());
|
||||
node.setTitle(version.getVersionNumber());
|
||||
node.setType("2");
|
||||
// 转换关联需求为子节点(类型1)
|
||||
node.setChildrenList(
|
||||
versionIdMap.getOrDefault(version.getId(), Collections.emptyList())
|
||||
.stream().map(item -> {
|
||||
VersionTreeVo childNode = new VersionTreeVo();
|
||||
childNode.setId(item.getId());
|
||||
childNode.setTitle(item.getTitle());
|
||||
childNode.setType("1");
|
||||
return childNode;
|
||||
}).collect(Collectors.toList())
|
||||
);
|
||||
versionTreeVoList.add(node);
|
||||
}
|
||||
return versionTreeVoList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package tech.unissense.pms.business.version.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Copyright © 2025 紫光汇智信息技术有限公司 版权所有</br>
|
||||
* 官网地址: <a href="http://www.unissense.tech">紫光汇智信息技术有限公司</a>
|
||||
*
|
||||
* @ClassName VersionTreeVo
|
||||
* @Description 需求管理中树结构
|
||||
* @Author ch (创建者)
|
||||
* @Date 2025/3/21 9:23
|
||||
* @Version 1.0.0
|
||||
* <p>
|
||||
* 修改历史:
|
||||
* 2025-03-21 - ch - 创建
|
||||
*/
|
||||
@Data
|
||||
public class VersionTreeVo {
|
||||
|
||||
private Integer id;
|
||||
//标题
|
||||
private String title;
|
||||
//类型 0:版本 1:需求
|
||||
private String type;
|
||||
//子节点
|
||||
private List<VersionTreeVo> childrenList;
|
||||
|
||||
}
|
|
@ -46,12 +46,19 @@ public class WorkLogger extends BaseEntity {
|
|||
* 0 -正常; 1-补填
|
||||
*/
|
||||
private String state;
|
||||
/**
|
||||
* 需求Id
|
||||
*/
|
||||
private Integer demandId;
|
||||
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
private List<Integer> projectIdList;
|
||||
|
||||
private Integer examineId;
|
||||
private String projectName;
|
||||
private String title;
|
||||
private String versionNumber;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public interface IWorkLoggerService {
|
|||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
WorkLogger getInfo(WorkLogger workLogger);
|
||||
List<WorkLogger> getInfo(WorkLogger workLogger);
|
||||
|
||||
List<CalendarVo> calendar(WorkLogger workLogger);
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@ package tech.unissense.pms.business.work.logger.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.business.project.domain.Project;
|
||||
import tech.unissense.pms.business.project.service.IProjectService;
|
||||
import tech.unissense.pms.business.work.logger.domain.WorkLogger;
|
||||
import tech.unissense.pms.business.work.logger.mapper.WorkLoggerMapper;
|
||||
import tech.unissense.pms.business.work.logger.service.IWorkLoggerService;
|
||||
|
@ -31,6 +33,8 @@ import java.util.stream.Collectors;
|
|||
public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
||||
@Resource
|
||||
private WorkLoggerMapper workLoggerMapper;
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -92,10 +96,9 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public WorkLogger getInfo(WorkLogger workLogger) {
|
||||
public List<WorkLogger> getInfo(WorkLogger workLogger) {
|
||||
List<WorkLogger> list = this.workLoggerMapper.list(workLogger);
|
||||
|
||||
return CollUtil.isNotEmpty(list) ? list.get(0) : null;
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,224 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.unissense.pms.business.demand.mapper.ProjectDemandMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.demand.domain.ProjectDemand" id="ProjectDemandMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="versionId" column="version_id"/>
|
||||
<result property="demandStatus" column="demand_status"/>
|
||||
<result property="responsiblePerson" column="responsible_person"/>
|
||||
<result property="estimatedWorkHours" column="estimated_work_hours"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="priority" column="priority"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, title, version_id, demand_status, responsible_person, estimated_work_hours, create_time, end_time, priority,project_id
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="ProjectDemandMap">
|
||||
select
|
||||
t1.id, t1.title, t1.version_id, t1.demand_status, t1.responsible_person
|
||||
, t1.estimated_work_hours, t1.create_time, t1.end_time, t1.priority,t1.project_id
|
||||
,t2.version_number,t3.nick_name responsible_person_name
|
||||
from pms_project_demand t1
|
||||
left join pms_project_version t2 on t1.version_id = t2.id
|
||||
left join sys_user t3 on t1.responsible_person = t3.user_id
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and t1.id = #{id}
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
and t1.title like concat(#{title},'%')
|
||||
</if>
|
||||
<if test="versionId != null and versionId != ''">
|
||||
and t1.version_id = #{versionId}
|
||||
</if>
|
||||
<if test="demandStatus != null and demandStatus != ''">
|
||||
and t1.demand_status = #{demandStatus}
|
||||
</if>
|
||||
<if test="responsiblePerson != null and responsiblePerson != ''">
|
||||
and t1.responsible_person = #{responsiblePerson}
|
||||
</if>
|
||||
<if test="estimatedWorkHours != null and estimatedWorkHours != ''">
|
||||
and t1.estimated_work_hours = #{estimatedWorkHours}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and t1.create_time = #{createTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and t1.end_time = #{endTime}
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
and t1.priority = #{priority}
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and t1.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="responsiblePersonName != null and responsiblePersonName != ''">
|
||||
and t3.nick_name like concat(#{responsiblePersonName},"%")
|
||||
</if>
|
||||
<if test="demandStatusList!=null and demandStatusList.size>0">
|
||||
and t1.demand_status in
|
||||
<foreach collection="demandStatusList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="ProjectDemandMap">
|
||||
SELECT id,
|
||||
title,
|
||||
version_id,
|
||||
demand_status,
|
||||
responsible_person,
|
||||
estimated_work_hours,
|
||||
create_time,
|
||||
end_time,
|
||||
priority,
|
||||
project_id
|
||||
FROM pms_project_demand
|
||||
WHERE id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="listByVersionIdList" resultMap="ProjectDemandMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pms_project_demand
|
||||
where version_id in
|
||||
<foreach collection="list" close=")" open="(" item="versionId" separator=",">
|
||||
#{versionId}
|
||||
</foreach>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO pms_project_demand
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">
|
||||
title,/projectVersion/tree
|
||||
</if>
|
||||
<if test="versionId != null and versionId != ''">
|
||||
version_id,
|
||||
</if>
|
||||
<if test="demandStatus != null and demandStatus != ''">
|
||||
demand_status,
|
||||
</if>
|
||||
<if test="responsiblePerson != null and responsiblePerson != ''">
|
||||
responsible_person,
|
||||
</if>
|
||||
<if test="estimatedWorkHours != null and estimatedWorkHours != ''">
|
||||
estimated_work_hours,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
priority,
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
project_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">
|
||||
#{title},
|
||||
</if>
|
||||
<if test="versionId != null and versionId != ''">
|
||||
#{versionId},
|
||||
</if>
|
||||
<if test="demandStatus != null and demandStatus != ''">
|
||||
#{demandStatus},
|
||||
</if>
|
||||
<if test="responsiblePerson != null and responsiblePerson != ''">
|
||||
#{responsiblePerson},
|
||||
</if>
|
||||
<if test="estimatedWorkHours != null and estimatedWorkHours != ''">
|
||||
#{estimatedWorkHours},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime},
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
#{priority},
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
#{projectId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE pms_project_demand
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">
|
||||
title = #{title},
|
||||
</if>
|
||||
<if test="versionId != null and versionId != ''">
|
||||
version_id = #{versionId},
|
||||
</if>
|
||||
<if test="demandStatus != null and demandStatus != ''">
|
||||
demand_status = #{demandStatus},
|
||||
</if>
|
||||
<if test="responsiblePerson != null and responsiblePerson != ''">
|
||||
responsible_person = #{responsiblePerson},
|
||||
</if>
|
||||
<if test="estimatedWorkHours != null and estimatedWorkHours != ''">
|
||||
estimated_work_hours = #{estimatedWorkHours},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime},
|
||||
</if>
|
||||
<if test="priority != null and priority != ''">
|
||||
priority = #{priority},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="scheduleUpdateDemandStatus">
|
||||
update pms_project_demand
|
||||
set demand_status = '3'
|
||||
where end_time <![CDATA[<=]]> now()
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE
|
||||
FROM pms_project_demand
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from pms_project_demand where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.unissense.pms.business.version.mapper.ProjectVersionMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.version.domain.ProjectVersion" id="ProjectVersionMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="versionNumber" column="version_number"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="versionDesc" column="version_desc"/>
|
||||
<result property="releaseDate" column="release_date"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id,version_number, version_desc, release_date,create_time
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="ProjectVersionMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pms_project_version
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
and project_id = #{projectId}
|
||||
</if>
|
||||
<if test="versionNumber != null and versionNumber != ''">
|
||||
and version_number = #{versionNumber}
|
||||
</if>
|
||||
<if test="versionDesc != null and versionDesc != ''">
|
||||
and version_desc = #{versionDesc}
|
||||
</if>
|
||||
<if test="releaseDate != null">
|
||||
and release_date = #{releaseDate}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and (select version_id from pms_project_demand where responsible_person = #{userId})
|
||||
</if>
|
||||
<if test="demandStatusList!=null and demandStatusList.size>0">
|
||||
and (select version_id from pms_project_demand where demand_status in
|
||||
<foreach collection="demandStatusList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by create_time
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="ProjectVersionMap">
|
||||
SELECT id,
|
||||
version_number,
|
||||
version_desc,
|
||||
project_id,
|
||||
release_date,
|
||||
create_time
|
||||
FROM pms_project_version
|
||||
WHERE id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO pms_project_version
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="versionNumber != null and versionNumber != ''">
|
||||
version_number,
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
project_id,
|
||||
</if>
|
||||
<if test="versionDesc != null and versionDesc != ''">
|
||||
version_desc,
|
||||
</if>
|
||||
<if test="releaseDate != null">
|
||||
release_date,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="versionNumber != null and versionNumber != ''">
|
||||
#{versionNumber},
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
#{projectId},
|
||||
</if>
|
||||
<if test="versionDesc != null and versionDesc != ''">
|
||||
#{versionDesc},
|
||||
</if>
|
||||
<if test="releaseDate != null">
|
||||
#{releaseDate},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE pms_project_version
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="versionNumber != null and versionNumber != ''">
|
||||
version_number = #{versionNumber},
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
project_id= #{projectId},
|
||||
</if>
|
||||
<if test="versionDesc != null and versionDesc != ''">
|
||||
version_desc = #{versionDesc},
|
||||
</if>
|
||||
<if test="releaseDate != null">
|
||||
release_date = #{releaseDate},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE
|
||||
FROM pms_project_version
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from pms_project_version where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="demandId" column="demand_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
<sql id="base_query">
|
||||
select logger_id,
|
||||
|
@ -27,7 +28,8 @@
|
|||
create_by,
|
||||
update_by,
|
||||
update_time,
|
||||
create_time
|
||||
create_time,
|
||||
demand_id
|
||||
from pms_work_logger
|
||||
</sql>
|
||||
<!--查询单个-->
|
||||
|
@ -42,7 +44,8 @@
|
|||
create_by,
|
||||
update_by,
|
||||
update_time,
|
||||
create_time
|
||||
create_time,
|
||||
demand_id
|
||||
from pms_work_logger
|
||||
where logger_id = #{loggerId}
|
||||
</select>
|
||||
|
@ -50,9 +53,15 @@
|
|||
<!--查询指定行数据-->
|
||||
<select id="list" resultMap="WorkLoggerMap">
|
||||
select
|
||||
t1.logger_id, t1.logger_date, t1.project_id, t1.user_id, t1.work_time, t1.work_content, t1.state, t1.create_by, t1.update_by, t1.update_time,
|
||||
t1.create_time,t2.nick_name user_name
|
||||
from pms_work_logger t1 left join sys_user t2 on t1.user_id=t2.user_id
|
||||
t1.logger_id, t1.logger_date, t1.project_id, t1.user_id, t1.work_time, t1.work_content, t1.state, t1.create_by,
|
||||
t1.update_by, t1.update_time,
|
||||
t1.create_time,t1.demand_id,t2.nick_name user_name
|
||||
,t3.project_name,t4.title ,t5.version_number
|
||||
from pms_work_logger t1
|
||||
left join sys_user t2 on t1.user_id=t2.user_id
|
||||
inner join pms_project t3 on (t1.project_id=t3.project_id and t3.state=0)
|
||||
left join pms_project_demand t4 on t1.demand_id=t4.id
|
||||
left join pms_project_version t5 on t4.version_id=t5.id
|
||||
<where>
|
||||
<if test="loggerId != null">
|
||||
and t1.logger_id = #{loggerId}
|
||||
|
@ -153,18 +162,19 @@
|
|||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="loggerId" useGeneratedKeys="true">
|
||||
insert into pms_work_logger(logger_date, project_id, user_id, work_time, work_content, state, create_by,
|
||||
update_by, update_time, create_time)
|
||||
update_by, update_time, create_time, demand_id)
|
||||
values (#{loggerDate}, #{projectId}, #{userId}, #{workTime}, #{workContent}, #{state}, #{createBy}, #{updateBy},
|
||||
#{updateTime}, #{createTime})
|
||||
#{updateTime}, #{createTime}, #{demandId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="loggerId" useGeneratedKeys="true">
|
||||
insert into pms_work_logger(logger_date, project_id, user_id, work_time, work_content, state, create_by,
|
||||
update_by, update_time, create_time)
|
||||
update_by, update_time, create_time,demand_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.loggerDate}, #{entity.projectId}, #{entity.userId}, #{entity.workTime}, #{entity.workContent},
|
||||
#{entity.state}, #{entity.createBy}, #{entity.updateBy}, #{entity.updateTime}, #{entity.createTime})
|
||||
#{entity.state}, #{entity.createBy}, #{entity.updateBy}, #{entity.updateTime}, #{entity.createTime},
|
||||
#{entity.demandId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
@ -189,10 +199,14 @@
|
|||
create_time = values(create_time)
|
||||
</insert>
|
||||
<select id="calendar" resultMap="WorkLoggerMap">
|
||||
<include refid="base_query" />
|
||||
where project_id = #{projectId}
|
||||
<include refid="base_query"/>
|
||||
<where>
|
||||
<if test="projectId != null">
|
||||
project_id = #{projectId}
|
||||
</if>
|
||||
and logger_date between #{startDate} and #{endDate}
|
||||
and user_id=#{userId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="listUser" resultMap="WorkLoggerMap">
|
||||
select
|
||||
|
|
|
@ -163,7 +163,7 @@ public class Constants
|
|||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "tech.unissense.quartz.task" };
|
||||
public static final String[] JOB_WHITELIST_STR = { "tech.unissense.pms.quartz.task" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
<groupId>tech.unissense</groupId>
|
||||
<artifactId>pms-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.unissense</groupId>
|
||||
<artifactId>pms-business</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package tech.unissense.pms.quartz.task;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.unissense.pms.business.demand.mapper.ProjectDemandMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Copyright © 2025 紫光汇智信息技术有限公司 版权所有</br>
|
||||
* 官网地址: <a href="http://www.unissense.tech">紫光汇智信息技术有限公司</a>
|
||||
*
|
||||
* @ClassName DemandTask
|
||||
* @Description 类功能描述
|
||||
* @Author ch (创建者)
|
||||
* @Date 2025/3/21 11:27
|
||||
* @Version 1.0.0
|
||||
* <p>
|
||||
* 修改历史:
|
||||
* 2025-03-21 - ch - 创建
|
||||
*/
|
||||
@Component("demandTask")
|
||||
public class DemandTask {
|
||||
@Resource
|
||||
private ProjectDemandMapper mapper;
|
||||
|
||||
public void updateDemandStatus()
|
||||
{
|
||||
mapper.scheduleUpdateDemandStatus();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue