Compare commits
46 Commits
Author | SHA1 | Date |
---|---|---|
|
9e0b7b3b7f | |
|
262218c161 | |
|
c03486036f | |
|
d010449773 | |
|
82778133aa | |
|
70954e2e95 | |
|
3cf0ba7d05 | |
|
b5f0c88db3 | |
|
86c262ed4d | |
|
f0e3ecc142 | |
|
b2da4c75df | |
|
ce64642460 | |
|
91658c71a7 | |
|
16ef200d39 | |
|
30c63b8c10 | |
|
db51747dc7 | |
|
a8692d640f | |
|
64ef5730bf | |
|
fe71d980b8 | |
|
7013bc82e6 | |
|
76b99571a4 | |
|
7702c20b66 | |
|
a02fdc81aa | |
|
37408313a3 | |
|
1154b11ab5 | |
|
4057e9abf7 | |
|
8c70789814 | |
|
0b0116ef6e | |
|
b527936b30 | |
|
e9e7fc15ad | |
|
b4764d6f8d | |
|
534dbf1a8d | |
|
134597b64d | |
|
fade049c9d | |
|
1c2fc2bcc0 | |
|
ab2844e5bd | |
|
fadadde6f1 | |
|
4075b24b8d | |
|
ccd5cf3deb | |
|
86015a72ff | |
|
4e74ff5200 | |
|
bd05550939 | |
|
e2884835f0 | |
|
d28f35e328 | |
|
f67aafa7ec | |
|
dc09c7f5e0 |
|
@ -0,0 +1,79 @@
|
|||
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.annotation.Log;
|
||||
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 tech.unissense.pms.common.enums.BusinessType;
|
||||
|
||||
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")
|
||||
@Log(title = "需求管理", businessType = BusinessType.INSERT)
|
||||
public AjaxResult add(@RequestBody ProjectDemand projectDemand) {
|
||||
return AjaxResult.success(projectDemandService.insert(projectDemand));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
@Log(title = "需求管理", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult edit(@RequestBody ProjectDemand projectDemand) {
|
||||
return toAjax(projectDemandService.update(projectDemand));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
@Log(title = "需求管理", businessType = BusinessType.DELETE)
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(projectDemandService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
@Log(title = "需求管理", businessType = BusinessType.DELETE)
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(projectDemandService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.config;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.service.ExamineConfigService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 考核配置表(ExamineConfig)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:17:37
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("examineConfig")
|
||||
public class ExamineConfigController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private ExamineConfigService examineConfigService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<ExamineConfig> queryById(@PathVariable("id") Integer id) {
|
||||
return ResponseEntity.ok(this.examineConfigService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineConfig 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ExamineConfig> add(ExamineConfig examineConfig) {
|
||||
return ResponseEntity.ok(this.examineConfigService.insert(examineConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param examineConfig 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<ExamineConfig> edit(ExamineConfig examineConfig) {
|
||||
return ResponseEntity.ok(this.examineConfigService.update(examineConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Integer id) {
|
||||
return ResponseEntity.ok(this.examineConfigService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.detail;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.enums.ReviewTypeEnum;
|
||||
import tech.unissense.pms.business.examine.config.service.ExamineConfigService;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDetailRequestDto;
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDto;
|
||||
import tech.unissense.pms.business.examine.detail.service.ExamineDetailService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
import tech.unissense.pms.business.examine.remark.service.IExamineRemarkService;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.service.ExamineUserService;
|
||||
import tech.unissense.pms.common.core.controller.BaseController;
|
||||
import tech.unissense.pms.common.core.domain.AjaxResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考核人员详情表(ExamineDetail)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("examine/detail")
|
||||
public class ExamineDetailController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private ExamineDetailService examineDetailService;
|
||||
@Autowired
|
||||
private ExamineUserService examineUserService;
|
||||
|
||||
@Autowired
|
||||
private ExamineConfigService configService;
|
||||
@Autowired
|
||||
private IExamineRemarkService examineRemarkService;
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<ExamineDetail> queryById(@PathVariable("id") Integer id) {
|
||||
return ResponseEntity.ok(this.examineDetailService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineDetail 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ExamineDetail> add(ExamineDetail examineDetail) {
|
||||
return ResponseEntity.ok(this.examineDetailService.insert(examineDetail));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public AjaxResult list(ExamineDetailRequestDto dto) {
|
||||
Assert.notNull(dto.getExamineTaskId(), "考核任务ID不能为空");
|
||||
// Assert.notNull(dto.getExamineId(), "考核ID不能为空");
|
||||
Assert.notEmpty(dto.getReviewType(), "任务类型不能为空");
|
||||
if (dto.getExamineId() == null) {
|
||||
Assert.notNull(dto.getUserId(), "用户ID不能为空");
|
||||
ExamineUser examineUser = examineUserService.queryByTaskIdAndUserId(dto.getExamineTaskId(), dto.getUserId());
|
||||
Assert.notNull(examineUser, "考核人员不存在");
|
||||
dto.setExamineId(examineUser.getId());
|
||||
}
|
||||
Assert.notNull(dto.getExamineId(), "考核ID不能为空");
|
||||
if (dto.getUserId()==null){
|
||||
ExamineUser examineUser = examineUserService.queryById(dto.getExamineId());
|
||||
dto.setUserId(examineUser.getUserId());
|
||||
}
|
||||
//查询配置
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setExamineTaskId(dto.getExamineTaskId());
|
||||
examineConfig.setReviewType(dto.getReviewType());
|
||||
List<ExamineConfig> configList = configService.list(examineConfig);
|
||||
if (ReviewTypeEnum.SELF.getType().equals(dto.getReviewType())) {
|
||||
//特殊处理 发展与协作需要个人展示,不打分
|
||||
ExamineConfig queryParams = new ExamineConfig();
|
||||
queryParams.setReviewCategory("发展与协作");
|
||||
queryParams.setExamineTaskId(dto.getExamineTaskId());
|
||||
configList.addAll(configService.list(queryParams));
|
||||
}
|
||||
return AjaxResult.success(examineDetailService.formatData(configList,dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineDetail 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping("/batch")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addBatch(@RequestBody ExamineDto examineDto) {
|
||||
Assert.notEmpty(examineDto.getExamineDetailList(), "考核详情不能为空");
|
||||
Assert.notNull(examineDto.getExamineId(), "考核ID不能为空");
|
||||
Assert.notNull(examineDto.getTaskId(), "考核任务ID不能为空");
|
||||
for (ExamineDetail examineDetail : examineDto.getExamineDetailList()) {
|
||||
examineDetail.setExamineId(examineDto.getExamineId());
|
||||
}
|
||||
if (ReviewTypeEnum.MANAGE.getType().equals(examineDto.getReviewType())) {
|
||||
Assert.notNull(examineDto.getManageScore(), "考核分数不能为空");
|
||||
//主管才需要计算分数
|
||||
Map<Integer, BigDecimal> scoreMap = examineDetailService.calculateScoreByDetail(examineDto.getTaskId()
|
||||
, examineDto.getExamineDetailList(), ReviewTypeEnum.MANAGE);
|
||||
BigDecimal bigDecimal = scoreMap.get(examineDto.getExamineId());
|
||||
if (examineDto.getManageScore().compareTo(bigDecimal) != 0) {
|
||||
return AjaxResult.error("总分与明细分数不一致");
|
||||
}
|
||||
} else {
|
||||
//非主管需要计算个人分数
|
||||
Map<Integer, BigDecimal> scoreMap = examineDetailService.calculateScoreByDetail(examineDto.getTaskId()
|
||||
, examineDto.getExamineDetailList(), ReviewTypeEnum.SELF);
|
||||
BigDecimal bigDecimal = scoreMap.get(examineDto.getExamineId());
|
||||
examineDto.setSelfScore(bigDecimal);
|
||||
//非主管需要保存个人自评
|
||||
List<ExamineRemark> examineRemarkList = examineDto.getExamineRemarkList();
|
||||
if (CollUtil.isNotEmpty(examineRemarkList)){
|
||||
for (ExamineRemark examineRemark : examineRemarkList) {
|
||||
examineRemark.setUserId(getUserId());
|
||||
examineRemark.setTaskId(examineDto.getTaskId());
|
||||
}
|
||||
examineRemarkService.saveBatch(examineRemarkList);
|
||||
}
|
||||
}
|
||||
|
||||
//保存detail详情
|
||||
this.examineDetailService.saveBatch(examineDto.getExamineDetailList());
|
||||
//保存总体评价
|
||||
examineUserService.access(examineDto);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param examineDetail 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<ExamineDetail> edit(ExamineDetail examineDetail) {
|
||||
return ResponseEntity.ok(this.examineDetailService.update(examineDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Integer id) {
|
||||
return ResponseEntity.ok(this.examineDetailService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.remark;
|
||||
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
import tech.unissense.pms.business.examine.remark.service.IExamineRemarkService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
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 (ExamineRemark)表控制层
|
||||
* @Date 2025-04-25 10:08:26
|
||||
*/
|
||||
@Api(tags = "考核评价")
|
||||
@RestController
|
||||
@RequestMapping("examine/remark")
|
||||
public class ExamineRemarkController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IExamineRemarkService examineRemarkService;
|
||||
|
||||
@ApiOperation("列表查询")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ExamineRemark examineRemark) {
|
||||
startPage();
|
||||
List<ExamineRemark> list = examineRemarkService.queryAll(examineRemark);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID查详情")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(examineRemarkService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增数据")
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult add(@RequestBody ExamineRemark examineRemark) {
|
||||
return toAjax(examineRemarkService.insert(examineRemark));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody ExamineRemark examineRemark) {
|
||||
return toAjax(examineRemarkService.update(examineRemark));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(examineRemarkService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(examineRemarkService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.task;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
import tech.unissense.pms.business.examine.task.dto.ConfigUpdateDto;
|
||||
import tech.unissense.pms.business.examine.task.service.TaskService;
|
||||
import tech.unissense.pms.business.project.domain.Project;
|
||||
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;
|
||||
|
||||
import static tech.unissense.pms.common.utils.PageUtils.startPage;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class TaskSetUpController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
// 新增任务
|
||||
@PostMapping("/add")
|
||||
public AjaxResult addTask(@RequestBody ExamineTask task) {
|
||||
return AjaxResult.success(taskService.addTask(task));
|
||||
}
|
||||
|
||||
// 分页查询+模糊查询
|
||||
@GetMapping("/get")
|
||||
public TableDataInfo getTasks(TaskQueryDto queryDto) {
|
||||
startPage();
|
||||
List<ExamineTask> tasks = taskService.getTasks(queryDto);
|
||||
return getDataTable(tasks);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult listTask(TaskQueryDto queryDto) {
|
||||
return success(taskService.listTask(queryDto));
|
||||
}
|
||||
|
||||
@GetMapping("/listSelf")
|
||||
public AjaxResult listTaskSelf(TaskQueryDto queryDto) {
|
||||
if (queryDto.getUserId() == null) {
|
||||
queryDto.setUserId(getUserId().intValue());
|
||||
}
|
||||
return success(taskService.listTaskSelf(queryDto));
|
||||
}
|
||||
|
||||
// 编辑任务
|
||||
@PutMapping("/update")
|
||||
public AjaxResult updateTask( @RequestBody ExamineTask updatedTask) {
|
||||
Integer id = updatedTask.getId();
|
||||
if (id == null) {
|
||||
return AjaxResult.error("任务 ID 不能为空");
|
||||
}
|
||||
return AjaxResult.success(taskService.updateTask(updatedTask));
|
||||
}
|
||||
|
||||
// 编辑任务
|
||||
@PutMapping("/config/update")
|
||||
public AjaxResult updateConfigTask(@RequestBody ConfigUpdateDto dto) {
|
||||
return AjaxResult.success(taskService.updateConfigTask(dto));
|
||||
}
|
||||
|
||||
// 删除任务
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteTask(@PathVariable Integer id) {
|
||||
taskService.deleteTask(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
//获取指标配置
|
||||
@GetMapping("/target/{id}")
|
||||
public AjaxResult getTarget(@PathVariable Integer id){
|
||||
return AjaxResult.success(taskService.getTarget(id));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.template;
|
||||
|
||||
import tech.unissense.pms.business.examine.template.domain.ExamineTemplate;
|
||||
import tech.unissense.pms.business.examine.template.service.IExamineTemplateService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
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 (ExamineTemplate)表控制层
|
||||
* @Date 2025-04-23 14:38:33
|
||||
*/
|
||||
@Api(tags = "")
|
||||
@RestController
|
||||
@RequestMapping("examine/template")
|
||||
public class ExamineTemplateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IExamineTemplateService examineTemplateService;
|
||||
|
||||
@ApiOperation("列表查询")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ExamineTemplate examineTemplate) {
|
||||
startPage();
|
||||
List<ExamineTemplate> list = examineTemplateService.queryAll(examineTemplate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID查详情")
|
||||
@GetMapping(value = "/list/{id}")
|
||||
public AjaxResult getConfigInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(examineTemplateService.listConfig(id));
|
||||
}
|
||||
@ApiOperation("根据ID查详情")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(examineTemplateService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增数据")
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult add(@RequestBody ExamineTemplate examineTemplate) {
|
||||
return toAjax(examineTemplateService.insert(examineTemplate));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody ExamineTemplate examineTemplate) {
|
||||
return toAjax(examineTemplateService.update(examineTemplate));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(examineTemplateService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(examineTemplateService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package tech.unissense.pms.web.controller.business.examine.user;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.service.ExamineUserService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.common.core.controller.BaseController;
|
||||
import tech.unissense.pms.common.core.page.TableDataInfo;
|
||||
import tech.unissense.pms.common.exception.ServiceException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("examine/user")
|
||||
public class ExamineUserController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private ExamineUserService examineUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<ExamineUser> queryById(@PathVariable("id") Integer id) {
|
||||
return ResponseEntity.ok(this.examineUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param examineUser
|
||||
* @return tech.unissense.pms.common.core.page.TableDataInfo
|
||||
* @author ch
|
||||
* @date 2025/01/02 10:36
|
||||
*/
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPermi('examine:manager:list')")
|
||||
public TableDataInfo queryPage(ExamineUser examineUser) {
|
||||
if (StrUtil.isNotEmpty(examineUser.getIsAsc())) {
|
||||
//判断参数是否合法
|
||||
if (!"ASC".equalsIgnoreCase(examineUser.getIsAsc()) && !"DESC".equalsIgnoreCase(examineUser.getIsAsc())) {
|
||||
throw new ServiceException("参数不合法");
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
return getDataTable(examineUserService.list(examineUser));
|
||||
}
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineUser 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ExamineUser> add(ExamineUser examineUser) {
|
||||
return ResponseEntity.ok(this.examineUserService.insert(examineUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param examineUser 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<ExamineUser> edit(ExamineUser examineUser) {
|
||||
return ResponseEntity.ok(this.examineUserService.update(examineUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Integer id) {
|
||||
return ResponseEntity.ok(this.examineUserService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -103,6 +103,13 @@ public class ProjectController extends BaseController {
|
|||
return success(teamService.personnelChanges(team));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/team/list")
|
||||
public AjaxResult teamList(ProjectTeam team) {
|
||||
return success(teamService.list(team));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
*/
|
||||
|
@ -137,8 +144,8 @@ public class ProjectController extends BaseController {
|
|||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@PostMapping("/executionInfo")
|
||||
public AjaxResult executionInfo(@RequestBody WorkLogger workLogger) {
|
||||
return success(service.executionInfo(workLogger));
|
||||
public AjaxResult executionInfo(@RequestBody ProjectQueryDto queryDto) {
|
||||
return success(service.executionInfo(queryDto));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package tech.unissense.pms.web.controller.business.project;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.business.project.domain.Project;
|
||||
import tech.unissense.pms.business.project.dto.ProjectQueryDto;
|
||||
import tech.unissense.pms.business.project.service.IProjectService;
|
||||
import tech.unissense.pms.business.projectFile.service.IProjectFileService;
|
||||
import tech.unissense.pms.business.projectteam.domain.ProjectTeam;
|
||||
import tech.unissense.pms.business.projectteam.service.IProjectTeamService;
|
||||
import tech.unissense.pms.common.annotation.Log;
|
||||
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 tech.unissense.pms.common.enums.BusinessType;
|
||||
import tech.unissense.pms.common.utils.uuid.IdUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/project/file")
|
||||
public class ProjectFileController extends BaseController {
|
||||
@Autowired
|
||||
private IProjectFileService service;
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@Log(title = "删除文件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Integer id) {
|
||||
return toAjax(service.deleteById(id));
|
||||
}
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@Log(title = "删除文件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult removeBatch(@PathVariable("ids") Integer[] ids) {
|
||||
service.batchRemove(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
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.annotation.Log;
|
||||
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 tech.unissense.pms.common.enums.BusinessType;
|
||||
|
||||
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")
|
||||
@Log(title = "版本管理", businessType = BusinessType.INSERT)
|
||||
public AjaxResult add(@RequestBody ProjectVersion projectVersion) {
|
||||
return toAjax(projectVersionService.insert(projectVersion));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑数据")
|
||||
@PutMapping("/update")
|
||||
@Log(title = "需求管理", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult edit(@RequestBody ProjectVersion projectVersion) {
|
||||
return toAjax(projectVersionService.update(projectVersion));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除数据")
|
||||
@DeleteMapping("/{id}")
|
||||
@Log(title = "需求管理", businessType = BusinessType.DELETE)
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(projectVersionService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
@Log(title = "需求管理", businessType = BusinessType.DELETE)
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(projectVersionService.batchRemove(ids));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package tech.unissense.pms.web.controller.business.work;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.business.project.domain.Project;
|
||||
|
@ -34,6 +35,7 @@ public class WorkHourController extends BaseController {
|
|||
@PostMapping("/add")
|
||||
@Log(title = "工作日志", businessType = BusinessType.INSERT)
|
||||
public AjaxResult addData(@RequestBody WorkLogger workLogger) {
|
||||
Assert.notNull(workLogger.getProjectId(), "项目不能为空");
|
||||
service.insert(workLogger);
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tech.unissense.pms.web.controller.common;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -85,6 +86,7 @@ public class CommonController
|
|||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("filePath", fileName.replace(Constants.RESOURCE_PREFIX, ""));
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
|
@ -106,6 +108,7 @@ public class CommonController
|
|||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> filePathList = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
|
@ -115,6 +118,7 @@ public class CommonController
|
|||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
filePathList.add(fileName.replace(Constants.RESOURCE_PREFIX, ""));
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
|
@ -122,6 +126,7 @@ public class CommonController
|
|||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("filePath", StringUtils.join(filePathList, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
|
|
|
@ -58,4 +58,6 @@ spring:
|
|||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
multi-statement-allow: true
|
||||
ruoyi:
|
||||
profile: /home/uploadPath/dev
|
|
@ -63,7 +63,7 @@ spring:
|
|||
multi-statement-allow: true
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.124.103
|
||||
host: 192.168.124.202
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
@ -81,4 +81,6 @@ spring:
|
|||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
max-wait: -1ms
|
||||
ruoyi:
|
||||
profile: /home/uploadPath/prod
|
|
@ -71,7 +71,7 @@ spring:
|
|||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.124.103
|
||||
host: 192.168.124.202
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.unissense</groupId>
|
||||
<artifactId>pms-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
package tech.unissense.pms.business.demand.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
|
||||
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;
|
||||
private Date queryDate;
|
||||
|
||||
|
||||
private List<ProjectFile> fileList;
|
||||
/**
|
||||
* 需求状态
|
||||
*/
|
||||
public enum DemandStatusEnum
|
||||
{
|
||||
/** 0待排期 */
|
||||
|
||||
DPQ("0","待排期"),
|
||||
/** 已计划 */
|
||||
YJH("1","已计划"),
|
||||
/** 进行中 */
|
||||
JXZ("2","进行中"),
|
||||
/** 已完成 */
|
||||
YWC("3","已完成"),
|
||||
/** 已关闭 */
|
||||
YGB("4","已关闭"),
|
||||
|
||||
;
|
||||
|
||||
private final String value;
|
||||
private final String remark;
|
||||
|
||||
DemandStatusEnum(String value, String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
public static String getRemark(String value)
|
||||
{
|
||||
for (DemandStatusEnum demandStatusEnum : DemandStatusEnum.values()) {
|
||||
if (demandStatusEnum.value.equals(value)){
|
||||
return demandStatusEnum.remark;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
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);
|
||||
int logicDeleteByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 通过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);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
ProjectDemand 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,159 @@
|
|||
package tech.unissense.pms.business.demand.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.business.project.domain.Project;
|
||||
import tech.unissense.pms.business.project.mapper.ProjectMapper;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.business.projectFile.service.IProjectFileService;
|
||||
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.ZoneId;
|
||||
import java.util.Collections;
|
||||
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;
|
||||
@Resource
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
@Autowired
|
||||
private IProjectFileService projectFileService;
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param projectDemand 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectDemand> queryAll(ProjectDemand projectDemand) {
|
||||
List<ProjectDemand> dataList = projectDemandMapper.queryAll(projectDemand);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDemand queryById(Integer id) {
|
||||
ProjectDemand projectDemand = projectDemandMapper.queryById(id);
|
||||
List<ProjectFile> projectFiles = projectFileService.listByIdAndType(Collections.singletonList(id), ProjectFile.FileTypeEnum.DEMAND.getValue());
|
||||
projectDemand.setFileList(projectFiles);
|
||||
return projectDemand;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ProjectDemand insert(ProjectDemand projectDemand) {
|
||||
verifyProjectState(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())));
|
||||
} else {
|
||||
if (DateUtils.getNowDate().after(projectDemand.getEndTime())) {
|
||||
throw new ServiceException("结束时间不能早于当前时间");
|
||||
}
|
||||
}
|
||||
int insert = projectDemandMapper.insert(projectDemand);
|
||||
List<ProjectFile> fileList = projectDemand.getFileList();
|
||||
if (CollUtil.isNotEmpty(fileList)){
|
||||
for (ProjectFile projectFile : fileList) {
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.DEMAND.getValue());
|
||||
projectFile.setDemandId(projectDemand.getId());
|
||||
projectFile.setProjectId(projectFile.getProjectId());
|
||||
}
|
||||
projectFileService.saveBatch(fileList);
|
||||
}
|
||||
|
||||
|
||||
return projectDemand;
|
||||
}
|
||||
|
||||
private void verifyProjectState(ProjectDemand projectDemand) {
|
||||
Project project = projectMapper.queryById(projectDemand.getProjectId());
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目不存在");
|
||||
}
|
||||
// if (Project.ProjectStateEnum.JXZ.value().equals(project.getProjectState())) {
|
||||
// throw new ServiceException("项目不处于进行中");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更改逻辑:1:已完成,已关闭状态发生变更必须校验结束时间在当前时间之后 2:定时任务修改状态为已完成
|
||||
*
|
||||
* @param projectDemand
|
||||
* @return int
|
||||
* @author ch
|
||||
* @date 2025/03/21 10:58
|
||||
*/
|
||||
@Override
|
||||
public int update(ProjectDemand projectDemand) {
|
||||
verifyProjectState(projectDemand);
|
||||
ProjectDemand existDemand = this.queryById(projectDemand.getId());
|
||||
//已完成或已关闭状态
|
||||
boolean statusFlag = ProjectDemand.DemandStatusEnum.YWC.value().equals(existDemand.getDemandStatus())
|
||||
|| ProjectDemand.DemandStatusEnum.YGB.value().equals(existDemand.getDemandStatus());
|
||||
// 当前状态发生变化,并且结束时间在当前时间之前
|
||||
boolean timeFlag = !existDemand.getDemandStatus().equals(projectDemand.getDemandStatus()) && DateUtils.getNowDate().after(projectDemand.getEndTime());
|
||||
if (statusFlag && timeFlag) {
|
||||
throw new ServiceException("结束时间不能早于当前时间");
|
||||
}
|
||||
|
||||
List<ProjectFile> fileList = projectDemand.getFileList();
|
||||
if (CollUtil.isNotEmpty(fileList)){
|
||||
for (ProjectFile projectFile : fileList) {
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.DEMAND.getValue());
|
||||
projectFile.setDemandId(projectDemand.getId());
|
||||
projectFile.setProjectId(projectFile.getProjectId());
|
||||
}
|
||||
projectFileService.saveBatch(fileList);
|
||||
}
|
||||
return projectDemandMapper.update(projectDemand);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return projectDemandMapper.logicDeleteByIds(new Integer[]{id});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return projectDemandMapper.logicDeleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectDemand> listByVersionIdList(List<Integer> versionIdList) {
|
||||
return projectDemandMapper.listByVersionIdList(versionIdList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package tech.unissense.pms.business.examine.config.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 考核配置表(ExamineConfig)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:17:38
|
||||
*/
|
||||
@Data
|
||||
public class ExamineConfig implements Serializable {
|
||||
private static final long serialVersionUID = 580184465217250056L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 评审类型 0:组长评审 1:个人评估 2:系统核算
|
||||
*/
|
||||
private String reviewType;
|
||||
/**
|
||||
* 评审类别
|
||||
*/
|
||||
private String reviewCategory;
|
||||
/**
|
||||
* 评审项
|
||||
*/
|
||||
private String reviewItem;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
/**
|
||||
* 考核id
|
||||
*/
|
||||
private Integer examineTaskId;
|
||||
private Integer sortNum;
|
||||
private Integer templateId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package tech.unissense.pms.business.examine.config.enums;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
* @ClassName : ReviewTypeEnum
|
||||
* @Description :
|
||||
* @DATE : Created in 17:36 2025/1/2
|
||||
* <pre> Copyright: Copyright(c) 2025 </pre>
|
||||
* <pre> Company : 紫光汇智信息技术有限公司 </pre>
|
||||
* Modification History:
|
||||
* Date Author Version Discription
|
||||
* --------------------------------------------------------------------------
|
||||
* 2025/1/2 ch 1.0 Why & What is modified: <修改原因描述> *
|
||||
*/
|
||||
@Getter
|
||||
public enum ReviewTypeEnum {
|
||||
|
||||
MANAGE("0","管理"),
|
||||
SELF("1","个人"),
|
||||
SYSTEM("2","系统核算"),
|
||||
ALL("-1","所有"),
|
||||
;
|
||||
private final String type;
|
||||
private final String remark;
|
||||
|
||||
|
||||
|
||||
ReviewTypeEnum(String type, String remark) {
|
||||
this.type = type;
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package tech.unissense.pms.business.examine.config.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核配置表(ExamineConfig)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:17:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineConfigMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineConfig queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param examineConfig 查询条件
|
||||
* @param pageable 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ExamineConfig> queryAllByLimit(ExamineConfig examineConfig, @Param("pageable") Pageable pageable);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param examineConfig 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(ExamineConfig examineConfig);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ExamineConfig examineConfig);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineConfig> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<ExamineConfig> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineConfig> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<ExamineConfig> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(ExamineConfig examineConfig);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
List<ExamineConfig> list(ExamineConfig examineConfig);
|
||||
|
||||
void deleteByTaskId(Integer taskId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package tech.unissense.pms.business.examine.config.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核配置表(ExamineConfig)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:17:39
|
||||
*/
|
||||
public interface ExamineConfigService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineConfig queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineConfig insert(ExamineConfig examineConfig);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineConfig update(ExamineConfig examineConfig);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
List<ExamineConfig> list(ExamineConfig examineConfig);
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package tech.unissense.pms.business.examine.config.service.impl;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.mapper.ExamineConfigMapper;
|
||||
import tech.unissense.pms.business.examine.config.service.ExamineConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核配置表(ExamineConfig)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:17:39
|
||||
*/
|
||||
@Service("examineConfigService")
|
||||
public class ExamineConfigServiceImpl implements ExamineConfigService {
|
||||
@Resource
|
||||
private ExamineConfigMapper examineConfigMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineConfig queryById(Integer id) {
|
||||
return this.examineConfigMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineConfig insert(ExamineConfig examineConfig) {
|
||||
this.examineConfigMapper.insert(examineConfig);
|
||||
return examineConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineConfig update(ExamineConfig examineConfig) {
|
||||
this.examineConfigMapper.update(examineConfig);
|
||||
return this.queryById(examineConfig.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineConfigMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineConfig> list(ExamineConfig examineConfig) {
|
||||
return examineConfigMapper.list(examineConfig);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package tech.unissense.pms.business.examine.detail.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员详情表(ExamineDetail)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:05
|
||||
*/
|
||||
@Data
|
||||
public class ExamineDetail implements Serializable {
|
||||
private static final long serialVersionUID = -30214803434515215L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 考核id
|
||||
*/
|
||||
private Integer examineId;
|
||||
private List<Integer> examineIdList;
|
||||
/**
|
||||
* 考核分数(原始分数)
|
||||
*/
|
||||
private Integer score;
|
||||
/**
|
||||
* 评价备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 考核标准id
|
||||
*/
|
||||
private Integer configId;
|
||||
|
||||
|
||||
private Integer userId;
|
||||
private Integer taskId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package tech.unissense.pms.business.examine.detail.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
* @ClassName : ExamineDetailRequestDto
|
||||
* @Description :
|
||||
* @DATE : Created in 14:46 2025/1/2
|
||||
* <pre> Copyright: Copyright(c) 2025 </pre>
|
||||
* <pre> Company : 紫光汇智信息技术有限公司 </pre>
|
||||
* Modification History:
|
||||
* Date Author Version Discription
|
||||
* --------------------------------------------------------------------------
|
||||
* 2025/1/2 ch 1.0 Why & What is modified: <修改原因描述> *
|
||||
*/
|
||||
@Data
|
||||
public class ExamineDetailRequestDto {
|
||||
private Integer examineTaskId;
|
||||
private Integer examineId;
|
||||
private Integer userId;
|
||||
private String reviewType;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package tech.unissense.pms.business.examine.detail.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
* @ClassName : ExamineDto
|
||||
* @Description :
|
||||
* @DATE : Created in 14:21 2025/1/2
|
||||
* <pre> Copyright: Copyright(c) 2025 </pre>
|
||||
* <pre> Company : 紫光汇智信息技术有限公司 </pre>
|
||||
* Modification History:
|
||||
* Date Author Version Discription
|
||||
* --------------------------------------------------------------------------
|
||||
* 2025/1/2 ch 1.0 Why & What is modified: <修改原因描述> *
|
||||
*/
|
||||
@Data
|
||||
public class ExamineDto {
|
||||
private List<ExamineDetail> examineDetailList;
|
||||
private List<ExamineRemark> examineRemarkList;
|
||||
private Integer examineId;
|
||||
private String judgeContent;
|
||||
/**
|
||||
* 个人自评
|
||||
*/
|
||||
private String selfJudgeContent;
|
||||
private BigDecimal manageScore;
|
||||
private BigDecimal selfScore;
|
||||
private Integer taskId;
|
||||
private String reviewType;
|
||||
/**
|
||||
* 主管评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatus;
|
||||
/**
|
||||
* 个人评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatusSelf;
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package tech.unissense.pms.business.examine.detail.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员详情表(ExamineDetail)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:05
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineDetailMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineDetail queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param examineDetail 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(ExamineDetail examineDetail);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ExamineDetail examineDetail);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineDetail> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<ExamineDetail> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineDetail> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<ExamineDetail> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(ExamineDetail examineDetail);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
List<ExamineDetail> list(ExamineDetail examineDetail);
|
||||
|
||||
void deleteByExamineId(List<Integer> collect);
|
||||
|
||||
List<ExamineDetail> listByExamineId(List<Integer> idList);
|
||||
|
||||
void deleteByTaskId(Integer taskId);
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package tech.unissense.pms.business.examine.detail.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.enums.ReviewTypeEnum;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDetailRequestDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考核人员详情表(ExamineDetail)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:05
|
||||
*/
|
||||
public interface ExamineDetailService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineDetail queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineDetail insert(ExamineDetail examineDetail);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineDetail update(ExamineDetail examineDetail);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
void insertBatch(List<ExamineDetail> list);
|
||||
|
||||
Map<String,Object> formatData(List<ExamineConfig> configList, ExamineDetailRequestDto dto);
|
||||
/**
|
||||
* 计算分数
|
||||
* @param taskId 任务id
|
||||
* @param examineIdList 考核id
|
||||
* @return
|
||||
*/
|
||||
Map<Integer,BigDecimal> calculateScoreByExamineId(Integer taskId, List<Integer> examineIdList, ReviewTypeEnum typeEnum);
|
||||
/**
|
||||
* 计算分数
|
||||
* @param taskId 任务id
|
||||
* @param examineIdList 考核id
|
||||
* @return
|
||||
*/
|
||||
Map<Integer,BigDecimal> calculateScoreByDetail(Integer taskId,List<ExamineDetail> examineList,ReviewTypeEnum typeEnum);
|
||||
|
||||
void saveBatch(List<ExamineDetail> examineDetailList);
|
||||
|
||||
|
||||
void deleteByExamineId( List<Integer> collect);
|
||||
void deleteByTaskId( Integer taskId);
|
||||
|
||||
List<ExamineDetail> listByExamineId(List<Integer> taskId);
|
||||
}
|
|
@ -0,0 +1,212 @@
|
|||
package tech.unissense.pms.business.examine.detail.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.enums.ReviewTypeEnum;
|
||||
import tech.unissense.pms.business.examine.config.mapper.ExamineConfigMapper;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDetailRequestDto;
|
||||
import tech.unissense.pms.business.examine.detail.mapper.ExamineDetailMapper;
|
||||
import tech.unissense.pms.business.examine.detail.service.ExamineDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.business.examine.detail.vo.ExamineConfigDetailVo;
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
import tech.unissense.pms.business.examine.remark.service.IExamineRemarkService;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
||||
import tech.unissense.pms.business.work.logger.service.IWorkLoggerService;
|
||||
import tech.unissense.pms.common.exception.ServiceException;
|
||||
import tech.unissense.pms.common.utils.bean.BeanUtils;
|
||||
import tech.unissense.pms.system.service.ISysDictDataService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 考核人员详情表(ExamineDetail)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:06
|
||||
*/
|
||||
@Service("examineDetailService")
|
||||
@Slf4j
|
||||
public class ExamineDetailServiceImpl implements ExamineDetailService {
|
||||
@Resource
|
||||
private ExamineDetailMapper examineDetailMapper;
|
||||
@Resource
|
||||
private ExamineConfigMapper configMapper;
|
||||
@Resource
|
||||
private ExamineUserMapper userMapper;
|
||||
@Autowired
|
||||
private IWorkLoggerService workLoggerService;
|
||||
@Autowired
|
||||
private ISysDictDataService sysDictDataService;
|
||||
@Autowired
|
||||
private ExamineTaskMapper examineTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private IExamineRemarkService examineRemarkService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineDetail queryById(Integer id) {
|
||||
return this.examineDetailMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineDetail insert(ExamineDetail examineDetail) {
|
||||
this.examineDetailMapper.insert(examineDetail);
|
||||
return examineDetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineDetail 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineDetail update(ExamineDetail examineDetail) {
|
||||
this.examineDetailMapper.update(examineDetail);
|
||||
return this.queryById(examineDetail.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineDetailMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertBatch(List<ExamineDetail> list) {
|
||||
examineDetailMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> formatData(List<ExamineConfig> configList, ExamineDetailRequestDto dto) {
|
||||
List<ExamineConfigDetailVo> examineConfigDetailVoList = new ArrayList<>();
|
||||
ExamineDetail examineDetail = new ExamineDetail();
|
||||
examineDetail.setExamineId(dto.getExamineId());
|
||||
List<ExamineDetail> list = examineDetailMapper.list(examineDetail);
|
||||
Map<Integer, ExamineDetail> scoreMap = list.stream().collect(Collectors.toMap(ExamineDetail::getConfigId
|
||||
, Function.identity(), (v1, v2) -> v1));
|
||||
for (ExamineConfig examineConfig : configList) {
|
||||
ExamineConfigDetailVo examineConfigDetailVo = new ExamineConfigDetailVo();
|
||||
BeanUtils.copyProperties(examineConfig, examineConfigDetailVo);
|
||||
ExamineDetail detail = scoreMap.get(examineConfig.getId());
|
||||
examineConfigDetailVo.setExamineId(dto.getExamineId());
|
||||
examineConfigDetailVo.setScore(detail == null ? 0 : detail.getScore());
|
||||
examineConfigDetailVo.setRemark(detail == null ? "" : detail.getRemark());
|
||||
examineConfigDetailVoList.add(examineConfigDetailVo);
|
||||
}
|
||||
examineConfigDetailVoList.sort(Comparator.comparing(ExamineConfigDetailVo::getSortNum));
|
||||
|
||||
|
||||
|
||||
Map<String,Object> result=new HashMap<>();
|
||||
result.put("examineConfigDetailVoList",examineConfigDetailVoList);
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setId(dto.getExamineId());
|
||||
List<ExamineUser> list1 = userMapper.list(examineUser);
|
||||
if (CollUtil.isEmpty(list1)){
|
||||
throw new ServiceException("未在考核任务中");
|
||||
}
|
||||
result.put("examineUser",list1.get(0));
|
||||
result.put("examineTask",examineTaskMapper.queryById(dto.getExamineTaskId()));
|
||||
ExamineRemark examineRemark = new ExamineRemark();
|
||||
examineRemark.setTaskId(dto.getExamineTaskId());
|
||||
examineRemark.setUserId(Long.valueOf(dto.getUserId()));
|
||||
List<ExamineRemark> examineRemarks = examineRemarkService.queryAll(examineRemark);
|
||||
result.put("remark",examineRemarks);
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, BigDecimal> calculateScoreByExamineId(Integer taskId, List<Integer> examineIdList, ReviewTypeEnum typeEnum) {
|
||||
ExamineDetail examineDetailQueryDto = new ExamineDetail();
|
||||
examineDetailQueryDto.setExamineIdList(examineIdList);
|
||||
List<ExamineDetail> list = examineDetailMapper.list(examineDetailQueryDto);
|
||||
return this.calculateScoreByDetail(taskId, list, typeEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, BigDecimal> calculateScoreByDetail(Integer taskId, List<ExamineDetail> examineList, ReviewTypeEnum typeEnum) {
|
||||
ExamineConfig examineConfigQueryDto = new ExamineConfig();
|
||||
examineConfigQueryDto.setExamineTaskId(taskId);
|
||||
if (!ReviewTypeEnum.ALL.getType().equals(typeEnum.getType())) {
|
||||
examineConfigQueryDto.setReviewType(typeEnum.getType());
|
||||
}
|
||||
List<ExamineConfig> configList = configMapper.list(examineConfigQueryDto);
|
||||
Map<Integer, ExamineConfig> configMap = configList.stream().collect(Collectors.toMap(ExamineConfig::getId, Function.identity()));
|
||||
Map<Integer, BigDecimal> scoreMap = new HashMap<>();
|
||||
for (ExamineDetail detail : examineList) {
|
||||
ExamineConfig examineConfig = configMap.get(detail.getConfigId());
|
||||
if (examineConfig == null) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal score = BigDecimal.valueOf(detail.getScore()).multiply(BigDecimal.TEN);
|
||||
BigDecimal weight = examineConfig.getWeight() == null ?
|
||||
BigDecimal.ZERO : examineConfig.getWeight().divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
|
||||
BigDecimal multiply = score.multiply(weight);
|
||||
scoreMap.compute(detail.getExamineId(), (k, v) -> {
|
||||
if (v == null) {
|
||||
return multiply;
|
||||
}
|
||||
return v.add(multiply);
|
||||
});
|
||||
}
|
||||
|
||||
return scoreMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<ExamineDetail> examineDetailList) {
|
||||
examineDetailMapper.insertOrUpdateBatch(examineDetailList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByExamineId(List<Integer> collect) {
|
||||
examineDetailMapper.deleteByExamineId(collect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaskId(Integer taskId) {
|
||||
examineDetailMapper.deleteByTaskId(taskId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<ExamineDetail> listByExamineId(List<Integer> idList) {
|
||||
return examineDetailMapper.listByExamineId(idList);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package tech.unissense.pms.business.examine.detail.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
* @ClassName : ExamineConfigDetailVo
|
||||
* @Description :
|
||||
* @DATE : Created in 14:59 2025/1/2
|
||||
* <pre> Copyright: Copyright(c) 2025 </pre>
|
||||
* <pre> Company : 紫光汇智信息技术有限公司 </pre>
|
||||
* Modification History:
|
||||
* Date Author Version Discription
|
||||
* --------------------------------------------------------------------------
|
||||
* 2025/1/2 ch 1.0 Why & What is modified: <修改原因描述> *
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ExamineConfigDetailVo extends ExamineConfig {
|
||||
|
||||
private Integer score;
|
||||
private Integer examineId;
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package tech.unissense.pms.business.examine.remark.domain;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* (ExamineRemark)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-04-25 10:08:26
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class ExamineRemark {
|
||||
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 考核任务id
|
||||
*/
|
||||
|
||||
private Integer taskId;
|
||||
/**
|
||||
* 考核人员id
|
||||
*/
|
||||
|
||||
private Long userId;
|
||||
/**
|
||||
* 评审大类
|
||||
*/
|
||||
|
||||
private String reviewCategory;
|
||||
/**
|
||||
* 个人自评
|
||||
*/
|
||||
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package tech.unissense.pms.business.examine.remark.mapper;
|
||||
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineRemark)表数据库访问层
|
||||
* @Date 2025-04-25 10:08:26
|
||||
*/
|
||||
public interface ExamineRemarkMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param examineRemark 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ExamineRemark> queryAll(ExamineRemark examineRemark);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ExamineRemark queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ExamineRemark examineRemark);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ExamineRemark examineRemark);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
void insertOrUpdateBatch(List<ExamineRemark> examineRemarkList);
|
||||
|
||||
void deleteByTaskId(Integer taskId);
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package tech.unissense.pms.business.examine.remark.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineRemark)表服务接口
|
||||
* @Date 2025-04-25 10:08:26
|
||||
*/
|
||||
public interface IExamineRemarkService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<ExamineRemark> queryAll(ExamineRemark examineRemark);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ExamineRemark queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ExamineRemark examineRemark);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ExamineRemark examineRemark);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
void saveBatch(List<ExamineRemark> examineRemarkList);
|
||||
|
||||
void deleteByTaskId(Integer id);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package tech.unissense.pms.business.examine.remark.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import tech.unissense.pms.business.examine.remark.domain.ExamineRemark;
|
||||
import tech.unissense.pms.business.examine.remark.mapper.ExamineRemarkMapper;
|
||||
import tech.unissense.pms.business.examine.remark.service.IExamineRemarkService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineRemark)表服务实现类
|
||||
* @Date 2025-04-25 10:08:26
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ExamineRemarkServiceImpl implements IExamineRemarkService {
|
||||
|
||||
@Resource
|
||||
private ExamineRemarkMapper examineRemarkMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param examineRemark 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExamineRemark> queryAll(ExamineRemark examineRemark) {
|
||||
List<ExamineRemark> dataList = examineRemarkMapper.queryAll(examineRemark);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamineRemark queryById(Integer id) {
|
||||
return examineRemarkMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(ExamineRemark examineRemark) {
|
||||
return examineRemarkMapper.insert(examineRemark);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(ExamineRemark examineRemark) {
|
||||
return examineRemarkMapper.update(examineRemark);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return examineRemarkMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return examineRemarkMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<ExamineRemark> examineRemarkList) {
|
||||
if (CollUtil.isEmpty(examineRemarkList)){
|
||||
return;
|
||||
}
|
||||
examineRemarkMapper.insertOrUpdateBatch(examineRemarkList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaskId(Integer taskId) {
|
||||
examineRemarkMapper.deleteByTaskId(taskId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package tech.unissense.pms.business.examine.task.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核任务表 (ExamineTask)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:29
|
||||
*/
|
||||
@Data
|
||||
public class ExamineTask implements Serializable {
|
||||
private static final long serialVersionUID = -72205614757391876L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 考核任务名
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
private Integer peopleNumber;
|
||||
|
||||
private String peopleNumberDetail;
|
||||
/**
|
||||
* 考核任务状态 0:进行中 2:已过期
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
private Date endTime;
|
||||
private Boolean taskEditFlag;
|
||||
|
||||
|
||||
private List<Integer> userIdList;
|
||||
|
||||
private Integer year;
|
||||
private Integer templateId;
|
||||
private String templateType;
|
||||
private String templateName;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package tech.unissense.pms.business.examine.task.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核任务表 (ExamineTask)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:29
|
||||
*/
|
||||
@Data
|
||||
public class ExamineTaskDto implements Serializable {
|
||||
private static final long serialVersionUID = -72205614757391876L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 考核任务名
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
private Integer peopleNumber;
|
||||
|
||||
private String peopleNumberDetail;
|
||||
/**
|
||||
* 考核任务状态 0:进行中 2:已过期
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
|
||||
private List<Integer> userIdList;
|
||||
|
||||
private Integer year;
|
||||
private Integer examineStatusSelf;
|
||||
private Integer examineId;
|
||||
private Boolean taskEditFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package tech.unissense.pms.business.examine.task.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.common.core.domain.BaseEntity;
|
||||
|
||||
@Data
|
||||
public class TaskQueryDto extends BaseEntity {
|
||||
private String taskName;
|
||||
|
||||
private Integer taskStatus;
|
||||
|
||||
private Integer year;
|
||||
private Integer userId;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package tech.unissense.pms.business.examine.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
* @ClassName : ConfigUpdateDto
|
||||
* @Description :
|
||||
* @DATE : Created in 14:27 2025/1/8
|
||||
* <pre> Copyright: Copyright(c) 2025 </pre>
|
||||
* <pre> Company : 紫光汇智信息技术有限公司 </pre>
|
||||
* Modification History:
|
||||
* Date Author Version Discription
|
||||
* --------------------------------------------------------------------------
|
||||
* 2025/1/8 ch 1.0 Why & What is modified: <修改原因描述> *
|
||||
*/
|
||||
@Data
|
||||
public class ConfigUpdateDto {
|
||||
private List<ExamineConfig> examineConfigList;
|
||||
private Integer taskId;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package tech.unissense.pms.business.examine.task.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTaskDto;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核任务表 (ExamineTask)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:28
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineTaskMapper {
|
||||
|
||||
void addTask(ExamineTask task);
|
||||
|
||||
List<ExamineTask> getTasks(TaskQueryDto queryDto);
|
||||
|
||||
void updateTask(ExamineTask updatedTask);
|
||||
|
||||
void deleteTask(Integer id);
|
||||
|
||||
List<ExamineTask> listTask(TaskQueryDto queryDto);
|
||||
|
||||
ExamineTask queryById(Integer taskId);
|
||||
|
||||
void updateTaskEditFlag(@Param("flag") boolean b, @Param("id") Integer taskId);
|
||||
|
||||
List<ExamineTaskDto> listTaskSelf(TaskQueryDto queryDto);
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package tech.unissense.pms.business.examine.task.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTaskDto;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
import tech.unissense.pms.business.examine.task.dto.ConfigUpdateDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TaskService {
|
||||
ExamineTask addTask(ExamineTask task);
|
||||
|
||||
List<ExamineTask> getTasks(TaskQueryDto queryDto);
|
||||
|
||||
ExamineTask updateTask(ExamineTask updatedTask);
|
||||
|
||||
void deleteTask(Integer id);
|
||||
|
||||
List<ExamineConfig> getTarget(Integer id);
|
||||
|
||||
Map<Integer,List<ExamineTask>> listTask(TaskQueryDto queryDto);
|
||||
Map<Integer,List<ExamineTaskDto>> listTaskSelf(TaskQueryDto queryDto);
|
||||
|
||||
List<ExamineConfig> updateConfigTask(ConfigUpdateDto dto);
|
||||
}
|
|
@ -0,0 +1,271 @@
|
|||
package tech.unissense.pms.business.examine.task.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.enums.ReviewTypeEnum;
|
||||
import tech.unissense.pms.business.examine.config.mapper.ExamineConfigMapper;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.service.ExamineDetailService;
|
||||
import tech.unissense.pms.business.examine.remark.service.IExamineRemarkService;
|
||||
import tech.unissense.pms.business.examine.remark.service.impl.ExamineRemarkServiceImpl;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTaskDto;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
import tech.unissense.pms.business.examine.task.dto.ConfigUpdateDto;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper;
|
||||
import tech.unissense.pms.business.examine.task.service.TaskService;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
||||
import tech.unissense.pms.business.examine.user.service.impl.ExamineUserServiceImpl;
|
||||
import tech.unissense.pms.common.annotation.DataScope;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class TaskServiceImpl implements TaskService {
|
||||
|
||||
@Autowired
|
||||
private ExamineTaskMapper examineTaskDao;
|
||||
|
||||
@Autowired
|
||||
private ExamineConfigMapper examineConfigMapper;
|
||||
|
||||
@Resource
|
||||
private ExamineUserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
private ExamineUserServiceImpl examineUserService;
|
||||
@Autowired
|
||||
private ExamineDetailService detailService;
|
||||
@Autowired
|
||||
private IExamineRemarkService examineRemarkService;
|
||||
|
||||
@Override
|
||||
public ExamineTask addTask(ExamineTask task) {
|
||||
Assert.notNull(task.getTemplateId(),"考核模板不能为空");
|
||||
task.setCreateTime(new Date());
|
||||
examineTaskDao.addTask(task);
|
||||
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setTemplateId(task.getTemplateId());
|
||||
List<ExamineConfig> list = examineConfigMapper.list(examineConfig);
|
||||
list.forEach(item -> {
|
||||
item.setExamineTaskId(task.getId());
|
||||
});
|
||||
examineConfigMapper.insertBatch(list);
|
||||
//生成考核人员信息
|
||||
List<Integer> userIdList = task.getUserIdList();
|
||||
Assert.notEmpty(userIdList, "考核人员不能为空");
|
||||
List<ExamineUser> userList = new ArrayList<>();
|
||||
for (Integer userId : userIdList) {
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(task.getId());
|
||||
examineUser.setUserId(userId);
|
||||
userList.add(examineUser);
|
||||
}
|
||||
userMapper.insertBatch(userList);
|
||||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineTask> getTasks(TaskQueryDto queryDto) {
|
||||
List<ExamineTask> tasks = examineTaskDao.getTasks(queryDto);
|
||||
|
||||
Date currentTime = new Date();
|
||||
|
||||
tasks.forEach(item -> {
|
||||
if (item.getEndTime() != null && item.getEndTime().before(currentTime)) {
|
||||
item.setTaskStatus(2);
|
||||
} else {
|
||||
item.setTaskStatus(0);
|
||||
}
|
||||
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(item.getId());
|
||||
List<ExamineUser> existingUsers = userMapper.list(examineUser);
|
||||
List<Integer> existingUserIds = existingUsers.stream()
|
||||
.map(ExamineUser::getUserId)
|
||||
.collect(Collectors.toList());
|
||||
item.setUserIdList(existingUserIds);
|
||||
});
|
||||
return tasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamineTask updateTask(ExamineTask updatedTask) {
|
||||
//如果模板变化 删除原有的指标项 重新生成
|
||||
ExamineTask examineTask = examineTaskDao.queryById(updatedTask.getId());
|
||||
if (!examineTask.getTemplateId().equals(updatedTask.getTemplateId())) {
|
||||
//对应考核指标详情删除
|
||||
detailService.deleteByTaskId(updatedTask.getId());
|
||||
//对应考核指标项删除
|
||||
examineConfigMapper.deleteByTaskId(updatedTask.getId());
|
||||
//重新生成考核指标项
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setTemplateId(updatedTask.getTemplateId());
|
||||
List<ExamineConfig> list = examineConfigMapper.list(examineConfig);
|
||||
list.forEach(item -> {
|
||||
item.setExamineTaskId(updatedTask.getId());
|
||||
});
|
||||
examineConfigMapper.insertBatch(list);
|
||||
|
||||
// 清空个人详情
|
||||
userMapper.clearUserByTaskId(updatedTask.getId());
|
||||
examineRemarkService.deleteByTaskId(updatedTask.getId());
|
||||
}
|
||||
examineTaskDao.updateTask(updatedTask);
|
||||
|
||||
List<Integer> userIdList = updatedTask.getUserIdList();
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(updatedTask.getId());
|
||||
List<ExamineUser> existingUsers = userMapper.list(examineUser);
|
||||
List<Integer> existingUserIds = existingUsers.stream()
|
||||
.map(ExamineUser::getUserId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 1. 删除与任务相关的已经不在 userIdList 中的用户记录
|
||||
existingUsers.stream()
|
||||
.filter(user -> !userIdList.contains(user.getUserId()))
|
||||
.forEach(user -> userMapper.deleteById(user.getId()));
|
||||
//删除对应考核指标详情
|
||||
List<Integer> examineIdList = existingUsers.stream().filter(user -> !userIdList.contains(user.getUserId())).map(ExamineUser::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(examineIdList)) {
|
||||
detailService.deleteByExamineId(examineIdList);
|
||||
}
|
||||
// 2. 添加新的用户记录(只插入那些不在现有用户中的用户)
|
||||
userIdList.stream()
|
||||
.filter(userId -> !existingUserIds.contains(userId))
|
||||
.forEach(userId -> {
|
||||
ExamineUser newExamineUser = new ExamineUser();
|
||||
newExamineUser.setTaskId(updatedTask.getId());
|
||||
newExamineUser.setUserId(userId);
|
||||
userMapper.insert(newExamineUser);
|
||||
});
|
||||
|
||||
return updatedTask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTask(Integer id) {
|
||||
examineTaskDao.deleteTask(id);
|
||||
examineUserService.deleteUserByTaskId(id);
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setExamineTaskId(id);
|
||||
List<ExamineConfig> list = examineConfigMapper.list(examineConfig);
|
||||
for (ExamineConfig config : list) {
|
||||
examineConfigMapper.deleteById(config.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineConfig> getTarget(Integer id) {
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setExamineTaskId(id);
|
||||
return examineConfigMapper.list(examineConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DataScope(deptAlias = "t3", userAlias = "t2")
|
||||
public Map<Integer, List<ExamineTask>> listTask(TaskQueryDto queryDto) {
|
||||
List<ExamineTask> examineTasks = examineTaskDao.listTask(queryDto);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
for (ExamineTask examineTask : examineTasks) {
|
||||
// 获取endTime那一天的最大时间
|
||||
LocalDateTime endTime = examineTask.getEndTime().toInstant().atZone(ZoneId.systemDefault())
|
||||
.toLocalDate().atTime(LocalTime.MAX);
|
||||
|
||||
// 比较当前时间与localDateTime
|
||||
if (now.isAfter(endTime)) {
|
||||
// 当前时间大于localDateTime,已过期
|
||||
examineTask.setTaskStatus(2);
|
||||
} else {
|
||||
// 当前时间小于localDateTime,进行中
|
||||
examineTask.setTaskStatus(0);
|
||||
}
|
||||
}
|
||||
return examineTasks.stream().collect(Collectors.groupingBy(ExamineTask::getTaskStatus));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, List<ExamineTaskDto>> listTaskSelf(TaskQueryDto queryDto) {
|
||||
List<ExamineTaskDto> examineTasks = examineTaskDao.listTaskSelf(queryDto);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
for (ExamineTaskDto examineTask : examineTasks) {
|
||||
// 获取endTime那一天的最大时间
|
||||
LocalDateTime endTime = examineTask.getEndTime().toInstant().atZone(ZoneId.systemDefault())
|
||||
.toLocalDate().atTime(LocalTime.MAX);
|
||||
|
||||
// 比较当前时间与localDateTime
|
||||
if (now.isAfter(endTime)) {
|
||||
// 当前时间大于localDateTime,已过期
|
||||
examineTask.setTaskStatus(2);
|
||||
} else {
|
||||
// 当前时间小于localDateTime,进行中
|
||||
examineTask.setTaskStatus(0);
|
||||
}
|
||||
}
|
||||
return examineTasks.stream().collect(Collectors.groupingBy(ExamineTaskDto::getTaskStatus));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineConfig> updateConfigTask(ConfigUpdateDto dto) {
|
||||
for (ExamineConfig examineConfig : dto.getExamineConfigList()) {
|
||||
if (examineConfig.getId() == null) {
|
||||
continue;
|
||||
}
|
||||
examineConfigMapper.update(examineConfig);
|
||||
}
|
||||
//重新计算分数 修改task
|
||||
examineTaskDao.updateTaskEditFlag(false, dto.getTaskId());
|
||||
CompletableFuture.runAsync(() -> {
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(dto.getTaskId());
|
||||
List<ExamineUser> list = userMapper.list(examineUser);
|
||||
List<ExamineUser> completeList = new ArrayList<>();
|
||||
List<Integer> idList = new ArrayList<>();
|
||||
for (ExamineUser user : list) {
|
||||
if (!"1".equals(user.getExamineStatus())) {
|
||||
continue;
|
||||
}
|
||||
idList.add(user.getId());
|
||||
completeList.add(user);
|
||||
}
|
||||
List<ExamineDetail> examineDetails = detailService.listByExamineId(idList);
|
||||
Map<Integer, BigDecimal> manageScoreMap = detailService.calculateScoreByDetail(dto.getTaskId(), examineDetails, ReviewTypeEnum.MANAGE);
|
||||
Map<Integer, BigDecimal> allScoreMap = detailService.calculateScoreByDetail(dto.getTaskId(), examineDetails, ReviewTypeEnum.ALL);
|
||||
for (ExamineUser user : completeList) {
|
||||
if ("1".equals(user.getExamineStatus())) {
|
||||
//计算管理人员分数
|
||||
BigDecimal manageScore = manageScoreMap.get(user.getId());
|
||||
user.setManageScore(manageScore);
|
||||
if ("1".equals(user.getExamineStatusSelf())) {
|
||||
//计算总分数
|
||||
BigDecimal allScore = allScoreMap.get(user.getId());
|
||||
user.setScore(allScore);
|
||||
}
|
||||
}
|
||||
}
|
||||
userMapper.insertOrUpdateBatch(completeList);
|
||||
examineTaskDao.updateTaskEditFlag(true, dto.getTaskId());
|
||||
}).exceptionally(e -> {
|
||||
log.error("update task edit flag error", e);
|
||||
examineTaskDao.updateTaskEditFlag(true, dto.getTaskId());
|
||||
return null;
|
||||
});
|
||||
return dto.getExamineConfigList();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package tech.unissense.pms.business.examine.template.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* (ExamineTemplate)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-04-25 09:58:26
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class ExamineTemplate {
|
||||
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
|
||||
private String templateName;
|
||||
/**
|
||||
* 0:年度 1:季度 2:月度
|
||||
*/
|
||||
|
||||
private String templateType;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
|
||||
private Integer createBy;
|
||||
private String createByName;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
|
||||
private Integer updateBy;
|
||||
private String updateByName;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package tech.unissense.pms.business.examine.template.mapper;
|
||||
|
||||
import tech.unissense.pms.business.examine.template.domain.ExamineTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineTemplate)表数据库访问层
|
||||
* @Date 2025-04-23 14:39:24
|
||||
*/
|
||||
public interface ExamineTemplateMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param examineTemplate 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ExamineTemplate> queryAll(ExamineTemplate examineTemplate);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ExamineTemplate queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ExamineTemplate examineTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ExamineTemplate examineTemplate);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package tech.unissense.pms.business.examine.template.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.template.domain.ExamineTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineTemplate)表服务接口
|
||||
* @Date 2025-04-23 14:38:33
|
||||
*/
|
||||
public interface IExamineTemplateService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<ExamineTemplate> queryAll(ExamineTemplate examineTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
List<ExamineConfig> listConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ExamineTemplate examineTemplate);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ExamineTemplate examineTemplate);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
ExamineTemplate queryById(Integer id);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package tech.unissense.pms.business.examine.template.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.service.ExamineConfigService;
|
||||
import tech.unissense.pms.business.examine.template.domain.ExamineTemplate;
|
||||
import tech.unissense.pms.business.examine.template.mapper.ExamineTemplateMapper;
|
||||
import tech.unissense.pms.business.examine.template.service.IExamineTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ExamineTemplate)表服务实现类
|
||||
* @Date 2025-04-23 14:38:34
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ExamineTemplateServiceImpl implements IExamineTemplateService {
|
||||
|
||||
@Resource
|
||||
private ExamineTemplateMapper examineTemplateMapper;
|
||||
|
||||
@Autowired
|
||||
private ExamineConfigService examineConfigService;
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param examineTemplate 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExamineTemplate> queryAll(ExamineTemplate examineTemplate) {
|
||||
List<ExamineTemplate> dataList = examineTemplateMapper.queryAll(examineTemplate);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineConfig> listConfig(Integer id) {
|
||||
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setTemplateId(id);
|
||||
return examineConfigService.list(examineConfig);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(ExamineTemplate examineTemplate) {
|
||||
return examineTemplateMapper.insert(examineTemplate);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(ExamineTemplate examineTemplate) {
|
||||
return examineTemplateMapper.update(examineTemplate);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return examineTemplateMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return examineTemplateMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamineTemplate queryById(Integer id) {
|
||||
return examineTemplateMapper.queryById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package tech.unissense.pms.business.examine.user.domain;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.*;
|
||||
import tech.unissense.pms.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:52
|
||||
*/
|
||||
@Data
|
||||
public class ExamineUser extends BaseEntity {
|
||||
private static final long serialVersionUID = -48380572616355554L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 考核任务名
|
||||
*/
|
||||
private Integer taskId;
|
||||
/**
|
||||
* 考核人
|
||||
*/
|
||||
private Integer userId;
|
||||
private String userName;
|
||||
/**
|
||||
* 考核分数(权重后分数)
|
||||
*/
|
||||
private BigDecimal score;
|
||||
/**
|
||||
* 总体评价
|
||||
*/
|
||||
private String judgeContent;
|
||||
/**
|
||||
* 个人自评
|
||||
*/
|
||||
private String selfJudgeContent;
|
||||
/**
|
||||
* 主管评分(权重计算后)
|
||||
*/
|
||||
private BigDecimal manageScore;
|
||||
private BigDecimal selfScore;
|
||||
/**
|
||||
* 个人评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatusSelf;
|
||||
/**
|
||||
* 主管评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatus;
|
||||
private Integer manageUserId;
|
||||
private String manageUserName;
|
||||
|
||||
private String deptId;
|
||||
|
||||
private String isAsc;
|
||||
private String sortFiled;
|
||||
@Setter(value = AccessLevel.NONE)
|
||||
@Getter(value = AccessLevel.NONE)
|
||||
private String orderBySql;
|
||||
|
||||
|
||||
private List<Integer> userIdList;
|
||||
|
||||
public String getOrderBySql() {
|
||||
//对排序字段的替换
|
||||
if (StrUtil.isEmpty(sortFiled)) {
|
||||
return null;
|
||||
} else if ("all".equalsIgnoreCase(sortFiled)) {
|
||||
//评分排序规则 总分->主管评分(需主管提交)->个人评分(需个人提交)
|
||||
return (StrUtil.format("order by IFNULL(score,if(examine_status=1,manage_score,if(examine_status_self=1,ifnull(self_score,-1),-1))) {}", StrUtil.isNotEmpty(isAsc) ? isAsc : ""));
|
||||
} else if ("manageScore".equalsIgnoreCase(sortFiled)) {
|
||||
return (StrUtil.format("order by ifnull(manage_score,-1) {}", StrUtil.isNotEmpty(isAsc) ? isAsc : ""));
|
||||
} else if ("selfScore".equalsIgnoreCase(sortFiled)) {
|
||||
return (StrUtil.format("order by ifnull(self_score,-1) {}", StrUtil.isNotEmpty(isAsc) ? isAsc : ""));
|
||||
}else if ("score".equalsIgnoreCase(sortFiled)) {
|
||||
return (StrUtil.format("order by ifnull(score,-1) {}", StrUtil.isNotEmpty(isAsc) ? isAsc : ""));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package tech.unissense.pms.business.examine.user.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:52
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineUserMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineUser queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param examineUser 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(ExamineUser examineUser);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ExamineUser examineUser);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineUser> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<ExamineUser> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<ExamineUser> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<ExamineUser> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(ExamineUser examineUser);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
List<ExamineUser> list(ExamineUser examineUser);
|
||||
|
||||
ExamineUser queryByTaskIdAndUserId(@Param("taskId") Integer examineTaskId,@Param("userId") Integer userId);
|
||||
|
||||
void deleteByIdList(List<Integer> idList);
|
||||
|
||||
void clearUserByTaskId(Integer id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package tech.unissense.pms.business.examine.user.service;
|
||||
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDto;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:53
|
||||
*/
|
||||
public interface ExamineUserService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineUser queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineUser insert(ExamineUser examineUser);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
ExamineUser update(ExamineUser examineUser);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
List<ExamineUser> list(ExamineUser examineUser);
|
||||
|
||||
void access(ExamineDto examineDto);
|
||||
|
||||
/**
|
||||
* 通过任务id和用户id查询
|
||||
* @param examineTaskId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
ExamineUser queryByTaskIdAndUserId(Integer examineTaskId, Integer userId);
|
||||
void deleteUserByTaskId(Integer taskId);
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
package tech.unissense.pms.business.examine.user.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.enums.ReviewTypeEnum;
|
||||
import tech.unissense.pms.business.examine.config.service.impl.ExamineConfigServiceImpl;
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.dto.ExamineDto;
|
||||
import tech.unissense.pms.business.examine.detail.service.ExamineDetailService;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
||||
import tech.unissense.pms.business.examine.user.service.ExamineUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.business.work.logger.service.IWorkLoggerService;
|
||||
import tech.unissense.pms.common.annotation.DataScope;
|
||||
import tech.unissense.pms.common.core.domain.entity.SysUser;
|
||||
import tech.unissense.pms.common.utils.SecurityUtils;
|
||||
import tech.unissense.pms.common.utils.StringUtils;
|
||||
import tech.unissense.pms.system.service.ISysDictDataService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2025-01-02 10:18:53
|
||||
*/
|
||||
@Service("examineUserService")
|
||||
public class ExamineUserServiceImpl implements ExamineUserService {
|
||||
@Resource
|
||||
private ExamineUserMapper examineUserMapper;
|
||||
@Autowired
|
||||
private ExamineDetailService detailService;
|
||||
@Autowired
|
||||
private ExamineConfigServiceImpl examineConfigService;
|
||||
@Resource
|
||||
private ExamineTaskMapper taskMapper;
|
||||
@Autowired
|
||||
private IWorkLoggerService workLoggerService;
|
||||
@Autowired
|
||||
private ISysDictDataService sysDictDataService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineUser queryById(Integer id) {
|
||||
return this.examineUserMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineUser insert(ExamineUser examineUser) {
|
||||
this.examineUserMapper.insert(examineUser);
|
||||
return examineUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param examineUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public ExamineUser update(ExamineUser examineUser) {
|
||||
this.examineUserMapper.update(examineUser);
|
||||
return this.queryById(examineUser.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineUserMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DataScope(deptAlias = "t2", userAlias = "t2")
|
||||
public List<ExamineUser> list(ExamineUser examineUser) {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
if (!user.getDeptId().equals(200L)) {
|
||||
String sqlPermission = StringUtils.format(
|
||||
" and ({}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) ))"
|
||||
, "t2", user.getDeptId(), user.getDeptId());
|
||||
|
||||
examineUser.setParams(new HashMap<String, Object>() {{
|
||||
put("dataScope", sqlPermission);
|
||||
}});
|
||||
}
|
||||
return examineUserMapper.list(examineUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void access(ExamineDto examineDto) {
|
||||
ExamineUser user = examineUserMapper.queryById(examineDto.getExamineId());
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setId(examineDto.getExamineId());
|
||||
examineUser.setJudgeContent(examineDto.getJudgeContent());
|
||||
examineUser.setSelfJudgeContent(examineDto.getSelfJudgeContent());
|
||||
examineUser.setExamineStatus(examineDto.getExamineStatus());
|
||||
examineUser.setExamineStatusSelf(examineDto.getExamineStatusSelf());
|
||||
examineUser.setManageScore(examineDto.getManageScore());
|
||||
examineUser.setSelfScore(examineDto.getSelfScore());
|
||||
String examineStatus = StrUtil.isNotEmpty(examineDto.getExamineStatus()) ? examineDto.getExamineStatus() : user.getExamineStatus();
|
||||
String examineStatusSelf = StrUtil.isNotEmpty(examineDto.getExamineStatusSelf()) ? examineDto.getExamineStatusSelf() : user.getExamineStatusSelf();
|
||||
if ("1".equals(examineStatus) && user.getManageUserId() == null) {
|
||||
examineUser.setManageUserId(SecurityUtils.getUserId().intValue());
|
||||
}
|
||||
//均已完成 计算总分数
|
||||
boolean flag = "1".equals(examineStatus) && "1".equals(examineStatusSelf);
|
||||
if (flag) {
|
||||
//保存系统核算分数
|
||||
detailService.insert(dealSystemBusinessAccount(examineDto.getExamineId(), examineDto.getTaskId()));
|
||||
Map<Integer, BigDecimal> scoreMap = detailService.calculateScoreByExamineId(examineDto.getTaskId()
|
||||
, Collections.singletonList(examineDto.getExamineId()), ReviewTypeEnum.ALL);
|
||||
examineUser.setScore(scoreMap.get(examineDto.getExamineId()));
|
||||
}
|
||||
examineUserMapper.update(examineUser);
|
||||
|
||||
}
|
||||
|
||||
private ExamineDetail dealSystemBusinessAccount(Integer examineId, Integer taskId) {
|
||||
ExamineTask examineTask = taskMapper.queryById(taskId);
|
||||
//如有系统核算才处理
|
||||
String workDay = sysDictDataService.selectDictLabel("pms_work_day", examineTask.getYear().toString());
|
||||
workDay = StrUtil.isNotEmpty(workDay) ? workDay : "251";
|
||||
BigDecimal configWorkDay = new BigDecimal(workDay);
|
||||
|
||||
Map<Integer, BigDecimal> workTimeByExamineDetail = workLoggerService.getWorkTimeByExamineDetail(Collections.singletonList(examineId));
|
||||
ExamineDetail examineDetail = new ExamineDetail();
|
||||
examineDetail.setExamineId(examineId);
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setExamineTaskId(taskId);
|
||||
examineConfig.setReviewType(ReviewTypeEnum.SYSTEM.getType());
|
||||
List<ExamineConfig> configList = examineConfigService.list(examineConfig);
|
||||
if (CollUtil.isEmpty(configList)) {
|
||||
examineDetail.setScore(0);
|
||||
return examineDetail;
|
||||
}
|
||||
examineDetail.setConfigId(configList.get(0).getId());
|
||||
BigDecimal bigDecimal = workTimeByExamineDetail.get(examineDetail.getExamineId());
|
||||
if (bigDecimal == null) {
|
||||
examineDetail.setScore(0);
|
||||
return examineDetail;
|
||||
}
|
||||
BigDecimal max = configWorkDay.multiply(new BigDecimal("0.9"));
|
||||
BigDecimal min = configWorkDay.multiply(new BigDecimal("0.8"));
|
||||
if (bigDecimal.compareTo(max) >= 0) {
|
||||
//比90%大 满分
|
||||
examineDetail.setScore(10);
|
||||
} else if (bigDecimal.compareTo(min) >= 0) {
|
||||
//比80%大 比90%小 6分
|
||||
examineDetail.setScore(6);
|
||||
} else {
|
||||
//比80%小 0分
|
||||
examineDetail.setScore(0);
|
||||
}
|
||||
return examineDetail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ExamineUser queryByTaskIdAndUserId(Integer examineTaskId, Integer userId) {
|
||||
return examineUserMapper.queryByTaskIdAndUserId(examineTaskId, userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserByTaskId(Integer taskId) {
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(taskId);
|
||||
List<ExamineUser> list = examineUserMapper.list(examineUser);
|
||||
List<Integer> idList = list.stream().map(ExamineUser::getId).collect(Collectors.toList());
|
||||
detailService.deleteByExamineId(idList);
|
||||
examineUserMapper.deleteByIdList(idList);
|
||||
// examineUserMapper.
|
||||
}
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
package tech.unissense.pms.business.project.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.demand.domain.ProjectDemand;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Project)实体类
|
||||
|
@ -56,7 +59,9 @@ public class Project extends BaseEntity {
|
|||
private String state;
|
||||
/**
|
||||
* 数据状态 0-待启动 1-进行中 2-已完成
|
||||
* 暂不展示
|
||||
*/
|
||||
@Deprecated
|
||||
private String dataState;
|
||||
/**
|
||||
* 项目状态 0-待启动 1-进行中 2-已完成
|
||||
|
@ -78,5 +83,49 @@ public class Project extends BaseEntity {
|
|||
|
||||
private Long queryUserId;
|
||||
|
||||
|
||||
private List<ProjectFile> fileList;
|
||||
/**
|
||||
* 需求状态
|
||||
*/
|
||||
public enum ProjectStateEnum
|
||||
{
|
||||
/** 0待排期 */
|
||||
|
||||
DPQ("0","待排期"),
|
||||
/** 已计划 */
|
||||
YJH("1","已计划"),
|
||||
/** 进行中 */
|
||||
JXZ("2","进行中"),
|
||||
/** 已完成 */
|
||||
YWC("3","已完成"),
|
||||
/** 已关闭 */
|
||||
YGB("4","已关闭"),
|
||||
|
||||
;
|
||||
|
||||
private final String value;
|
||||
private final String remark;
|
||||
|
||||
ProjectStateEnum(String value,String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
public static String getRemark(String value)
|
||||
{
|
||||
for (Project.ProjectStateEnum projectStateEnum : Project.ProjectStateEnum.values()) {
|
||||
if (projectStateEnum.value.equals(value)){
|
||||
return projectStateEnum.remark;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,4 +22,6 @@ public class ProjectQueryDto {
|
|||
private Integer projectId;
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
private Integer userId;
|
||||
private String projectState;
|
||||
}
|
||||
|
|
|
@ -60,10 +60,9 @@ public interface IProjectService {
|
|||
|
||||
List<Project> listProjectByUser(String createBy);
|
||||
|
||||
List<TeamStaticsVo> getTeamInfo(Integer projectId);
|
||||
|
||||
List<ProjectExecutionVo> executionInfo(WorkLogger workLogger);
|
||||
List<TeamStaticsVo> getTeamInfo(Integer projectId);
|
||||
|
||||
List<ProjectExecutionVo> executionInfo(ProjectQueryDto ProjectQueryDto);
|
||||
|
||||
ProjectWorkInfoVo workInfo(ProjectQueryDto project);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tech.unissense.pms.business.project.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -10,6 +11,8 @@ import tech.unissense.pms.business.project.mapper.ProjectMapper;
|
|||
import tech.unissense.pms.business.project.service.IProjectService;
|
||||
import tech.unissense.pms.business.project.vo.ProjectExecutionVo;
|
||||
import tech.unissense.pms.business.project.vo.ProjectWorkInfoVo;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.business.projectFile.service.IProjectFileService;
|
||||
import tech.unissense.pms.business.projectteam.domain.ProjectTeam;
|
||||
import tech.unissense.pms.business.projectteam.service.IProjectTeamService;
|
||||
import tech.unissense.pms.business.projectteam.vo.TeamStaticsVo;
|
||||
|
@ -55,6 +58,8 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
private static final ConcurrentHashMap<String, AtomicInteger> DAILY_SEQUENCE_MAP = new ConcurrentHashMap<>();
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@Autowired
|
||||
private IProjectFileService projectFileService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -64,7 +69,10 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
*/
|
||||
@Override
|
||||
public Project queryById(Integer projectId) {
|
||||
return this.projectMapper.queryById(projectId);
|
||||
Project project = this.projectMapper.queryById(projectId);
|
||||
List<ProjectFile> projectFiles = projectFileService.listByIdAndType(Collections.singletonList(projectId), ProjectFile.FileTypeEnum.PROJECT.getValue());
|
||||
project.setFileList(projectFiles);
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,6 +81,7 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
* @param project 筛选条件
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public List<Project> permissisonList(Project project) {
|
||||
dataPermissions(project);
|
||||
List<Project> list = this.projectMapper.list(project);
|
||||
|
@ -176,10 +185,13 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
}
|
||||
// 新增项目
|
||||
this.projectMapper.insert(project);
|
||||
// project.getProjectTeamList().forEach(item ->
|
||||
// item.setProjectId(project.getProjectId()));
|
||||
// // 新增项目人员
|
||||
// teamService.insertBatch(project.getProjectTeamList());
|
||||
for (ProjectFile projectFile : project.getFileList()) {
|
||||
projectFile.setProjectId(project.getProjectId());
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.PROJECT.getValue());
|
||||
}
|
||||
// 新增不需要修改
|
||||
projectFileService.saveBatch(project.getFileList());
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
|
@ -196,6 +208,12 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
throw new ServiceException(errorMsg);
|
||||
}
|
||||
this.projectMapper.update(project);
|
||||
// 项目文件不允许修改
|
||||
for (ProjectFile projectFile : project.getFileList()) {
|
||||
projectFile.setProjectId(project.getProjectId());
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.PROJECT.getValue());
|
||||
}
|
||||
projectFileService.saveBatch(project.getFileList());
|
||||
return this.queryById(project.getProjectId());
|
||||
}
|
||||
|
||||
|
@ -243,11 +261,14 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectExecutionVo> executionInfo(WorkLogger workLogger) {
|
||||
public List<ProjectExecutionVo> executionInfo(ProjectQueryDto queryDto) {
|
||||
|
||||
Project projectQueryDto = new Project();
|
||||
if (workLogger.getUserId() != null) {
|
||||
projectQueryDto.setQueryUserId(Long.valueOf(workLogger.getUserId()));
|
||||
if (queryDto.getUserId() != null) {
|
||||
projectQueryDto.setQueryUserId(Long.valueOf(queryDto.getUserId()));
|
||||
}
|
||||
if (queryDto.getProjectState() != null) {
|
||||
projectQueryDto.setProjectState(queryDto.getProjectState());
|
||||
}
|
||||
List<Project> projects = this.permissisonList(projectQueryDto);
|
||||
List<Integer> projectIdList = projects.stream()
|
||||
|
@ -259,9 +280,26 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
.map(item -> item.getProjectId() + "_" + item.getUserId())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
WorkLogger workLogger = new WorkLogger();
|
||||
workLogger.setProjectIdList(projectIdList);
|
||||
List<WorkLogger> allWorkLoggerList = workLoggerService.list(workLogger);
|
||||
Map<Integer, BigDecimal> workTimeAllMap = allWorkLoggerList.stream().filter(item -> StrUtil.isNotEmpty(item.getWorkTime())).collect(Collectors.groupingBy(WorkLogger::getProjectId, Collectors.reducing(BigDecimal.ZERO
|
||||
, item -> new BigDecimal(item.getWorkTime()), BigDecimal::add)));
|
||||
// BeanUtils.copyBeanProp(workLogger,queryDto);
|
||||
|
||||
Map<String, BigDecimal> workTimeMap = workLoggerService.list(workLogger).stream()
|
||||
List<WorkLogger> workLoggerList = allWorkLoggerList.stream()
|
||||
.filter(item -> {
|
||||
Date date = item.getLoggerDate();
|
||||
Integer userId = item.getUserId();
|
||||
boolean flag = (date != null && !date.before(queryDto.getStartDate()) && !date.after(queryDto.getEndDate()));
|
||||
if (queryDto.getUserId() != null) {
|
||||
flag = flag && queryDto.getUserId().equals(userId);
|
||||
}
|
||||
return flag;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<String, BigDecimal> workTimeMap = workLoggerList.stream()
|
||||
.filter(item -> teamSet.contains(item.getProjectId() + "_" + item.getUserId()))
|
||||
.collect(Collectors.toMap(
|
||||
item -> item.getProjectId() + "_"
|
||||
|
@ -269,8 +307,8 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
item -> new BigDecimal(item.getWorkTime()),
|
||||
BigDecimal::add));
|
||||
|
||||
LocalDate startDate = workLogger.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate endDate = workLogger.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate startDate = queryDto.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate endDate = queryDto.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
return projects.stream().map(project -> {
|
||||
List<BigDecimal> tempList = Stream.iterate(startDate, date -> date.plusDays(1))
|
||||
|
@ -290,6 +328,7 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
BeanUtils.copyBeanProp(vo, project);
|
||||
vo.setDetailList(tempList);
|
||||
vo.setAllWorkTime(tempList.stream().reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
vo.setAllDateWorkTime(workTimeAllMap.getOrDefault(project.getProjectId(), BigDecimal.ZERO));
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
@ -317,8 +356,8 @@ public class ProjectServiceImpl implements IProjectService {
|
|||
WorkLogger::getUserId,
|
||||
logger -> logger,
|
||||
(existing,
|
||||
replacement) -> existing.getCreateTime()
|
||||
.after(replacement.getCreateTime()) ? existing : replacement),
|
||||
replacement) -> existing.getCreateTime()
|
||||
.after(replacement.getCreateTime()) ? existing : replacement),
|
||||
map -> new ArrayList<>(map.values()))));
|
||||
|
||||
LocalDate startDate = projectQueryDto.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
|
|
@ -25,5 +25,6 @@ public class ProjectExecutionVo {
|
|||
private String projectState;
|
||||
private Integer budgetDate;
|
||||
private BigDecimal allWorkTime;
|
||||
private BigDecimal allDateWorkTime;
|
||||
private List<BigDecimal> detailList;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
package tech.unissense.pms.business.projectFile.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import tech.unissense.pms.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* (ProjectFile)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-04-21 17:40:56
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class ProjectFile {
|
||||
|
||||
|
||||
private Integer id;
|
||||
private Integer[] ids;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
|
||||
private Integer projectId;
|
||||
/**
|
||||
* 需求id
|
||||
*/
|
||||
|
||||
private Integer demandId;
|
||||
/**
|
||||
* 日志id
|
||||
*/
|
||||
|
||||
private Integer loggerId;
|
||||
/**
|
||||
* 附件类型 ( 0:项目附件 1:需求附件 2:日志附件)
|
||||
*/
|
||||
|
||||
private String fileType;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
|
||||
private String fileUrl;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
|
||||
private String fileNewName;
|
||||
/**
|
||||
* 上传文件名
|
||||
*/
|
||||
|
||||
private String fileName;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
|
||||
private Integer createBy;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
|
||||
private Integer updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
private Date createTime;
|
||||
|
||||
@Getter
|
||||
public enum FileTypeEnum {
|
||||
PROJECT("0", "项目附件"),
|
||||
DEMAND("1", "需求附件"),
|
||||
LOGGER("2", "日志附件");
|
||||
private final String value;
|
||||
private final String remark;
|
||||
|
||||
FileTypeEnum(String value, String remark) {
|
||||
this.value = value;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public static String getRemark(String value) {
|
||||
for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
|
||||
if (fileTypeEnum.value.equals(value)) {
|
||||
return fileTypeEnum.remark;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package tech.unissense.pms.business.projectFile.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectFile)表数据库访问层
|
||||
* @Date 2025-04-21 17:40:56
|
||||
*/
|
||||
public interface ProjectFileMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param projectFile 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ProjectFile> queryAll(ProjectFile projectFile);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectFile queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectFile projectFile);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectFile projectFile);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
void insertBatch(List<ProjectFile> addFileList);
|
||||
|
||||
void updateBatch(List<ProjectFile> updateFileList);
|
||||
|
||||
List<ProjectFile> listByIdAndType(@Param("relationIdList") List<Integer> id, @Param("type") String type);
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package tech.unissense.pms.business.projectFile.service;
|
||||
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectFile)表服务接口
|
||||
* @Date 2025-04-21 17:40:56
|
||||
*/
|
||||
public interface IProjectFileService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<ProjectFile> queryAll(ProjectFile projectFile);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
ProjectFile queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(ProjectFile projectFile);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(ProjectFile projectFile);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
void insertBatch(List<ProjectFile> addFileList);
|
||||
|
||||
void saveBatch(List<ProjectFile> updateFileList);
|
||||
|
||||
List<ProjectFile> listByIdAndType(List<Integer> projectId, String value);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package tech.unissense.pms.business.projectFile.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.business.projectFile.mapper.ProjectFileMapper;
|
||||
import tech.unissense.pms.business.projectFile.service.IProjectFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.common.config.RuoYiConfig;
|
||||
import tech.unissense.pms.common.utils.file.FileUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (ProjectFile)表服务实现类
|
||||
* @Date 2025-04-21 17:40:56
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ProjectFileServiceImpl implements IProjectFileService {
|
||||
|
||||
@Resource
|
||||
private ProjectFileMapper projectFileMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param projectFile 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectFile> queryAll(ProjectFile projectFile) {
|
||||
List<ProjectFile> dataList = projectFileMapper.queryAll(projectFile);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectFile queryById(Integer id) {
|
||||
return projectFileMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(ProjectFile projectFile) {
|
||||
return projectFileMapper.insert(projectFile);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(ProjectFile projectFile) {
|
||||
return projectFileMapper.update(projectFile);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
ProjectFile projectFile = projectFileMapper.queryById(id);
|
||||
try {
|
||||
FileUtils.deleteFile(RuoYiConfig.getProfile()+projectFile.getFilePath());
|
||||
// Path path = Paths.get(RuoYiConfig.getProfile() + projectFile.getFilePath());
|
||||
// Files.delete(path);
|
||||
} catch (Exception e) {
|
||||
log.error("删除文件失败,失败详情:{}", e.getStackTrace());
|
||||
}
|
||||
return projectFileMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
ProjectFile projectFile = new ProjectFile();
|
||||
projectFile.setIds(ids);
|
||||
List<ProjectFile> projectFiles = projectFileMapper.queryAll(projectFile);
|
||||
for (ProjectFile file : projectFiles) {
|
||||
try {
|
||||
FileUtils.deleteFile(RuoYiConfig.getProfile()+file.getFilePath());
|
||||
} catch (Exception e) {
|
||||
log.error("删除文件失败,失败详情:{}", e.getStackTrace());
|
||||
}
|
||||
}
|
||||
return projectFileMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertBatch(List<ProjectFile> addFileList) {
|
||||
projectFileMapper.insertBatch(addFileList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件目前只有删除和新增 没有修改
|
||||
*
|
||||
* @param fileList
|
||||
*/
|
||||
@Override
|
||||
public void saveBatch(List<ProjectFile> fileList) {
|
||||
List<ProjectFile> addFileList = new ArrayList<>();
|
||||
|
||||
for (ProjectFile projectFile : fileList) {
|
||||
//新增
|
||||
if (projectFile.getId() == null) {
|
||||
addFileList.add(projectFile);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(addFileList)) {
|
||||
projectFileMapper.insertBatch(addFileList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectFile> listByIdAndType(List<Integer> id, String type) {
|
||||
if (CollUtil.isEmpty(id)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return projectFileMapper.listByIdAndType(id, type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
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 Date queryDate;
|
||||
|
||||
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,143 @@
|
|||
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)
|
||||
List<ProjectDemand> allDemands = getProjectDemands(projectVersion);
|
||||
// 过滤出未关联版本的根需求(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("0");
|
||||
// 转换关联需求为子节点(类型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;
|
||||
}
|
||||
|
||||
private List<ProjectDemand> getProjectDemands(ProjectVersion projectVersion) {
|
||||
ProjectDemand param = new ProjectDemand();
|
||||
param.setProjectId(projectVersion.getProjectId());
|
||||
if (projectVersion.getUserId() != null) {
|
||||
param.setResponsiblePerson(projectVersion.getUserId());
|
||||
}
|
||||
if (projectVersion.getQueryDate() != null) {
|
||||
param.setQueryDate(projectVersion.getQueryDate());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(projectVersion.getDemandStatusList())) {
|
||||
param.setDemandStatusList(projectVersion.getDemandStatusList());
|
||||
}
|
||||
return demandService.queryAll(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
|
||||
|
||||
import lombok.Data;
|
||||
import tech.unissense.pms.business.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
|
@ -46,11 +47,22 @@ 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 Integer versionId;
|
||||
private String projectName;
|
||||
private String title;
|
||||
private String versionNumber;
|
||||
|
||||
private List<ProjectFile> fileList;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -82,5 +82,8 @@ public interface WorkLoggerMapper {
|
|||
List<WorkLogger> calendar(WorkLogger workLogger);
|
||||
|
||||
List<WorkLogger> listUser(WorkLogger workLogger);
|
||||
|
||||
List<WorkLogger> listWorkTimeByExamineDetail(@Param("examineIdList") List<Integer> collect);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@ import tech.unissense.pms.business.work.logger.domain.WorkLogger;
|
|||
import tech.unissense.pms.business.work.logger.vo.CalendarVo;
|
||||
import tech.unissense.pms.business.work.logger.vo.StaticsHourVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* (WorkLogger)表服务接口
|
||||
|
@ -56,7 +58,7 @@ public interface IWorkLoggerService {
|
|||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
WorkLogger getInfo(WorkLogger workLogger);
|
||||
List<WorkLogger> getInfo(WorkLogger workLogger);
|
||||
|
||||
List<CalendarVo> calendar(WorkLogger workLogger);
|
||||
|
||||
|
@ -68,4 +70,5 @@ public interface IWorkLoggerService {
|
|||
String getRemaining(WorkLogger workLogger);
|
||||
|
||||
|
||||
Map<Integer, BigDecimal> getWorkTimeByExamineDetail(List<Integer> collect);
|
||||
}
|
||||
|
|
|
@ -2,24 +2,28 @@ 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.projectFile.domain.ProjectFile;
|
||||
import tech.unissense.pms.business.projectFile.service.IProjectFileService;
|
||||
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;
|
||||
import tech.unissense.pms.business.work.logger.vo.CalendarVo;
|
||||
import tech.unissense.pms.business.work.logger.vo.StaticsHourVo;
|
||||
import tech.unissense.pms.common.utils.DateUtils;
|
||||
import tech.unissense.pms.common.utils.DictUtils;
|
||||
import tech.unissense.pms.common.utils.SecurityUtils;
|
||||
import java.util.Objects;
|
||||
import tech.unissense.pms.system.service.ISysConfigService;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -33,6 +37,13 @@ import java.util.stream.Collectors;
|
|||
public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
||||
@Resource
|
||||
private WorkLoggerMapper workLoggerMapper;
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
@Autowired
|
||||
private IProjectFileService fileService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -42,13 +53,16 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
*/
|
||||
@Override
|
||||
public WorkLogger queryById(Integer id) {
|
||||
return this.workLoggerMapper.queryById(id);
|
||||
WorkLogger workLogger = this.workLoggerMapper.queryById(id);
|
||||
List<ProjectFile> projectFiles = fileService.listByIdAndType(Collections.singletonList(id), ProjectFile.FileTypeEnum.LOGGER.getValue());
|
||||
workLogger.setFileList(projectFiles);
|
||||
return workLogger;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param workLogger 筛选条件
|
||||
* @param workLogger 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
|
@ -66,10 +80,31 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
*/
|
||||
@Override
|
||||
public WorkLogger insert(WorkLogger workLogger) {
|
||||
verifyMaxWorkTime(workLogger);
|
||||
this.workLoggerMapper.insert(workLogger);
|
||||
List<ProjectFile> fileList = workLogger.getFileList();
|
||||
if (CollUtil.isNotEmpty(fileList)) {
|
||||
for (ProjectFile projectFile : fileList) {
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.LOGGER.getValue());
|
||||
projectFile.setLoggerId(workLogger.getLoggerId());
|
||||
projectFile.setProjectId(workLogger.getProjectId());
|
||||
projectFile.setDemandId(workLogger.getDemandId());
|
||||
}
|
||||
fileService.saveBatch(fileList);
|
||||
}
|
||||
return workLogger;
|
||||
}
|
||||
|
||||
private void verifyMaxWorkTime(WorkLogger workLogger) {
|
||||
//当天剩余工时
|
||||
WorkLogger queryParam = new WorkLogger();
|
||||
queryParam.setLoggerDate(workLogger.getLoggerDate());
|
||||
String remaining = this.getRemaining(queryParam);
|
||||
if (new BigDecimal(remaining).compareTo(new BigDecimal(workLogger.getWorkTime())) < 0) {
|
||||
throw new RuntimeException("超出最大可填写工时");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
|
@ -79,6 +114,16 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
@Override
|
||||
public WorkLogger update(WorkLogger workLogger) {
|
||||
this.workLoggerMapper.update(workLogger);
|
||||
List<ProjectFile> fileList = workLogger.getFileList();
|
||||
if (CollUtil.isNotEmpty(fileList)) {
|
||||
for (ProjectFile projectFile : fileList) {
|
||||
projectFile.setFileType(ProjectFile.FileTypeEnum.LOGGER.getValue());
|
||||
projectFile.setLoggerId(workLogger.getLoggerId());
|
||||
projectFile.setProjectId(workLogger.getProjectId());
|
||||
projectFile.setDemandId(workLogger.getDemandId());
|
||||
}
|
||||
fileService.saveBatch(fileList);
|
||||
}
|
||||
return this.queryById(workLogger.getLoggerId());
|
||||
}
|
||||
|
||||
|
@ -94,10 +139,17 @@ 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;
|
||||
List<Integer> idList = list.stream().map(WorkLogger::getLoggerId).collect(Collectors.toList());
|
||||
List<ProjectFile> projectFiles = fileService.listByIdAndType(idList, ProjectFile.FileTypeEnum.LOGGER.getValue());
|
||||
Map<Integer, List<ProjectFile>> listMap = projectFiles.stream().collect(Collectors.groupingBy(ProjectFile::getLoggerId, Collectors.toList()));
|
||||
if (CollUtil.isNotEmpty(listMap)) {
|
||||
for (WorkLogger logger : list) {
|
||||
logger.setFileList(listMap.getOrDefault(logger.getLoggerId(), Collections.emptyList()));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,10 +157,10 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
List<WorkLogger> calendar = workLoggerMapper.calendar(workLogger);
|
||||
Map<String, WorkLogger> calendarMap = calendar.stream().collect(Collectors.toMap(
|
||||
item -> DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, item.getLoggerDate()), Function.identity(), (v1, v2) -> v1));
|
||||
|
||||
|
||||
LocalDate startDate = workLogger.getStartDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate endDate = workLogger.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
|
||||
List<CalendarVo> result = new ArrayList<>();
|
||||
for (LocalDate localDate = startDate; !localDate.isAfter(endDate); localDate = localDate.plusDays(1)) {
|
||||
CalendarVo calendarVo = new CalendarVo();
|
||||
|
@ -116,9 +168,10 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
WorkLogger temp = calendarMap.get(key);
|
||||
calendarVo.setDate(DateUtils.toDate(localDate));
|
||||
calendarVo.setState(temp != null ? temp.getState() : "-1");
|
||||
calendarVo.setWorkTime(temp != null ? temp.getWorkTime() : "0");
|
||||
result.add(calendarVo);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -185,7 +238,7 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
Map<String, BigDecimal> personWorkHourMap = workLoggers.stream()
|
||||
.collect(Collectors.toMap(
|
||||
WorkLogger::getCreateBy,
|
||||
item->new BigDecimal(item.getWorkTime()),
|
||||
item -> new BigDecimal(item.getWorkTime()),
|
||||
BigDecimal::add
|
||||
));
|
||||
|
||||
|
@ -204,7 +257,7 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
// 设置用户ID和当天的零点时间
|
||||
workLogger.setUserId(userId.intValue());
|
||||
if (workLogger.getLoggerDate()==null) {
|
||||
if (workLogger.getLoggerDate() == null) {
|
||||
workLogger.setLoggerDate(DateUtils.getNowDate());
|
||||
}
|
||||
workLogger.setLoggerDate(DateUtils.toDate(workLogger.getLoggerDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));
|
||||
|
@ -214,11 +267,18 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
|
||||
// 计算workTime之和
|
||||
BigDecimal totalWorkTime = list.stream()
|
||||
.map(item->new BigDecimal(item.getWorkTime())) // 假设WorkLogger有getWorkTime方法返回BigDecimal
|
||||
.map(item -> new BigDecimal(item.getWorkTime())) // 假设WorkLogger有getWorkTime方法返回BigDecimal
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
String configByKey = configService.selectConfigByKey("pms.work.dayTime");
|
||||
// String dictLabel = DictUtils.getDictLabel("work_logger", "day_work_time");
|
||||
// 返回总和的字符串表示
|
||||
return BigDecimal.ONE.subtract(totalWorkTime).toString();
|
||||
return new BigDecimal(configByKey).subtract(totalWorkTime).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, BigDecimal> getWorkTimeByExamineDetail(List<Integer> collect) {
|
||||
List<WorkLogger> workLoggers = workLoggerMapper.listWorkTimeByExamineDetail(collect);
|
||||
return workLoggers.stream().collect(Collectors.toMap(WorkLogger::getExamineId, item -> new BigDecimal(item.getWorkTime()), BigDecimal::add));
|
||||
}
|
||||
|
||||
// 泛型方法,用于生成统计工时的列表,适用于项目统计
|
||||
|
@ -227,7 +287,7 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
return items.stream()
|
||||
// 对每个项目项创建一个StaticsHourVo对象
|
||||
.map(item -> createStaticsHourVo(nameExtractor.apply(item), workDayMap.getOrDefault(idExtractor.apply(item), BigDecimal.ZERO)
|
||||
,idExtractor.apply(item)))
|
||||
, idExtractor.apply(item)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -235,12 +295,12 @@ public class WorkLoggerServiceImpl implements IWorkLoggerService {
|
|||
private List<StaticsHourVo> generateStaticsHourVoList(Map<String, BigDecimal> workDayMap) {
|
||||
return workDayMap.entrySet().stream()
|
||||
// 对每个用户创建一个StaticsHourVo对象
|
||||
.map(entry -> createStaticsHourVo(entry.getKey(), entry.getValue(),null))
|
||||
.map(entry -> createStaticsHourVo(entry.getKey(), entry.getValue(), null))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 创建StaticsHourVo对象,计算工时并格式化为字符串
|
||||
private StaticsHourVo createStaticsHourVo(String name, BigDecimal workTime,Integer projectId) {
|
||||
private StaticsHourVo createStaticsHourVo(String name, BigDecimal workTime, Integer projectId) {
|
||||
StaticsHourVo vo = new StaticsHourVo();
|
||||
vo.setProjectId(projectId);
|
||||
vo.setName(name);
|
||||
|
|
|
@ -2,6 +2,7 @@ package tech.unissense.pms.business.work.logger.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -22,4 +23,5 @@ public class CalendarVo {
|
|||
private Date date;
|
||||
|
||||
private String state;
|
||||
private String workTime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
<?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.examine.remark.mapper.ExamineRemarkMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.remark.domain.ExamineRemark" id="ExamineRemarkMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="reviewCategory" column="review_category"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_id, user_id, review_category, remark
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="ExamineRemarkMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pms_examine_remark
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
and review_category = #{reviewCategory}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="ExamineRemarkMap">
|
||||
SELECT id,
|
||||
task_id,
|
||||
user_id,
|
||||
review_category,
|
||||
remark
|
||||
FROM pms_examine_remark
|
||||
WHERE id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO pms_examine_remark
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
review_category,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
#{reviewCategory},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateBatch">
|
||||
insert into pms_examine_remark(task_id,user_id,review_category,remark)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.taskId}, #{entity.userId}, #{entity.reviewCategory}, #{entity.remark})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
remark = values(remark)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE pms_examine_remark
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">
|
||||
task_id = #{taskId},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
review_category = #{reviewCategory},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE
|
||||
FROM pms_examine_remark
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from pms_examine_remark where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteByTaskId">
|
||||
delete from pms_examine_remark where task_id=#{taskId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
|
@ -99,18 +99,18 @@
|
|||
and t1.state = #{state}
|
||||
</if>
|
||||
<if test="projectState != null and projectState != ''">
|
||||
<!-- and t1.project_state = #{projectState} -->
|
||||
<choose>
|
||||
<when test="projectState=='0'.toString()">
|
||||
and t1.start_date <![CDATA[ > ]]> sysdate()
|
||||
</when>
|
||||
<when test="projectState=='1'.toString()">
|
||||
and sysdate() between t1.start_date and t1.end_date
|
||||
</when>
|
||||
<when test="projectState=='2'.toString()">
|
||||
and t1.end_date <![CDATA[ < ]]> sysdate()
|
||||
</when>
|
||||
</choose>
|
||||
and t1.project_state = #{projectState}
|
||||
<!-- <choose>-->
|
||||
<!-- <when test="projectState=='0'.toString()">-->
|
||||
<!-- and t1.start_date <![CDATA[ > ]]> sysdate()-->
|
||||
<!-- </when>-->
|
||||
<!-- <when test="projectState=='1'.toString()">-->
|
||||
<!-- and sysdate() between t1.start_date and t1.end_date-->
|
||||
<!-- </when>-->
|
||||
<!-- <when test="projectState=='2'.toString()">-->
|
||||
<!-- and t1.end_date <![CDATA[ < ]]> sysdate()-->
|
||||
<!-- </when>-->
|
||||
<!-- </choose>-->
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and t1.create_by = #{createBy}
|
||||
|
|
|
@ -0,0 +1,233 @@
|
|||
<?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>
|
||||
state='0'
|
||||
<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>
|
||||
<if test="queryDate !=null">
|
||||
and #{queryDate} between t1.create_time and t1.end_time
|
||||
</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 state='0' and 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,
|
||||
</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=",">
|
||||
version_id = #{versionId},
|
||||
<if test="title != null and title != ''">
|
||||
title = #{title},
|
||||
</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>
|
||||
<update id="logicDeleteByIds">
|
||||
update pms_project_demand
|
||||
set state = 1
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</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,303 @@
|
|||
<?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.projectFile.mapper.ProjectFileMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.projectFile.domain.ProjectFile" id="ProjectFileMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="demandId" column="demand_id"/>
|
||||
<result property="loggerId" column="logger_id"/>
|
||||
<result property="fileType" column="file_type"/>
|
||||
<result property="fileUrl" column="file_url"/>
|
||||
<result property="fileNewName" column="file_new_name"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, demand_id, logger_id, file_type, file_url, file_new_name, file_name, create_by, update_by, update_time, create_time
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="ProjectFileMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pms_project_file
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="ids != null and ids.length>0">
|
||||
and id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
and project_id = #{projectId}
|
||||
</if>
|
||||
<if test="demandId != null">
|
||||
and demand_id = #{demandId}
|
||||
</if>
|
||||
<if test="loggerId != null">
|
||||
and logger_id = #{loggerId}
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
and file_type = #{fileType}
|
||||
</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">
|
||||
and file_url = #{fileUrl}
|
||||
</if>
|
||||
<if test="fileNewName != null and fileNewName != ''">
|
||||
and file_new_name = #{fileNewName}
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
and file_name = #{fileName}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="ProjectFileMap">
|
||||
SELECT id,
|
||||
project_id,
|
||||
demand_id,
|
||||
logger_id,
|
||||
file_type,
|
||||
file_url,
|
||||
file_new_name,
|
||||
file_name,
|
||||
create_by,
|
||||
update_by,
|
||||
update_time,
|
||||
create_time,
|
||||
file_path
|
||||
FROM pms_project_file
|
||||
WHERE id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="listByIdAndType" resultType="tech.unissense.pms.business.projectFile.domain.ProjectFile">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pms_project_file
|
||||
where file_type=#{type}
|
||||
<choose>
|
||||
<when test="type == '0'.toString()">
|
||||
and project_id in
|
||||
<foreach collection="relationIdList" item="relationId" separator="," open="(" close=")">
|
||||
#{relationId}
|
||||
</foreach>
|
||||
|
||||
</when>
|
||||
<when test="type == '1'.toString()">
|
||||
and demand_id in
|
||||
<foreach collection="relationIdList" item="relationId" separator="," open="(" close=")">
|
||||
#{relationId}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="type == '2'.toString()">
|
||||
and logger_id in
|
||||
<foreach collection="relationIdList" item="relationId" separator="," open="(" close=")">
|
||||
#{relationId}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO pms_project_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">
|
||||
project_id,
|
||||
</if>
|
||||
<if test="demandId != null">
|
||||
demand_id,
|
||||
</if>
|
||||
<if test="loggerId != null">
|
||||
logger_id,
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
file_type,
|
||||
</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">
|
||||
file_url,
|
||||
</if>
|
||||
<if test="fileNewName != null and fileNewName != ''">
|
||||
file_new_name,
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
file_name,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">
|
||||
#{projectId},
|
||||
</if>
|
||||
<if test="demandId != null">
|
||||
#{demandId},
|
||||
</if>
|
||||
<if test="loggerId != null">
|
||||
#{loggerId},
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
#{fileType},
|
||||
</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">
|
||||
#{fileUrl},
|
||||
</if>
|
||||
<if test="fileNewName != null and fileNewName != ''">
|
||||
#{fileNewName},
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
#{fileName},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO pms_project_file( project_id, demand_id, logger_id, file_type, file_url,file_path, file_new_name, file_name, create_by, create_time)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.projectId},#{item.demandId},#{item.loggerId},#{item.fileType},#{item.fileUrl},#{item.filePath},#{item.fileNewName},#{item.fileName},#{item.createBy},#{item.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE pms_project_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">
|
||||
project_id = #{projectId},
|
||||
</if>
|
||||
<if test="demandId != null">
|
||||
demand_id = #{demandId},
|
||||
</if>
|
||||
<if test="loggerId != null">
|
||||
logger_id = #{loggerId},
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
file_type = #{fileType},
|
||||
</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">
|
||||
file_url = #{fileUrl},
|
||||
</if>
|
||||
<if test="fileNewName != null and fileNewName != ''">
|
||||
file_new_name = #{fileNewName},
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
file_name = #{fileName},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateBatch">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
UPDATE pms_project_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="item.projectId != null">
|
||||
project_id = #{item.projectId},
|
||||
</if>
|
||||
<if test="item.demandId != null">
|
||||
demand_id = #{item.demandId},
|
||||
</if>
|
||||
<if test="item.loggerId != null">
|
||||
logger_id = #{item.loggerId},
|
||||
</if>
|
||||
<if test="item.fileType != null and item.fileType != ''">
|
||||
file_type = #{item.fileType},
|
||||
</if>
|
||||
<if test="item.fileUrl != null and item.fileUrl != ''">
|
||||
file_url = #{item.fileUrl},
|
||||
</if>
|
||||
<if test="item.fileNewName != null and item.fileNewName != ''">
|
||||
file_new_name = #{item.fileNewName},
|
||||
</if>
|
||||
<if test="item.fileName != null and item.fileName != ''">
|
||||
file_name = #{item.fileName},
|
||||
</if>
|
||||
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime},
|
||||
</if>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE
|
||||
FROM pms_project_file
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from pms_project_file 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 id in (select version_id from pms_project_demand where responsible_person = #{userId})
|
||||
</if>
|
||||
<if test="demandStatusList!=null and demandStatusList.size>0">
|
||||
and id in (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,t4.version_id
|
||||
from pms_work_logger t1
|
||||
left join sys_user t2 on t1.user_id=t2.user_id
|
||||
left join pms_project t3 on t1.project_id=t3.project_id
|
||||
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
|
||||
|
@ -254,6 +268,16 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="listWorkTimeByExamineDetail"
|
||||
resultType="tech.unissense.pms.business.work.logger.domain.WorkLogger">
|
||||
SELECT w.work_time, e.id
|
||||
FROM ( select sum(work_time) as work_time,user_id from pms_work_logger group by user_id) w
|
||||
JOIN pms_examine_user e ON w.user_id = e.user_id
|
||||
WHERE e.id IN
|
||||
<foreach collection="examineIdList" item="examineId" open="(" separator="," close=")">
|
||||
#{examineId}
|
||||
</foreach>
|
||||
</select>
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update pms_work_logger
|
||||
|
@ -288,6 +312,9 @@
|
|||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="demandId != null">
|
||||
demand_id = #{demandId},
|
||||
</if>
|
||||
</set>
|
||||
where logger_id = #{loggerId}
|
||||
</update>
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
<?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.examine.config.mapper.ExamineConfigMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.config.domain.ExamineConfig" id="ExamineConfigMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="reviewType" column="review_type" jdbcType="VARCHAR"/>
|
||||
<result property="reviewCategory" column="review_category" jdbcType="VARCHAR"/>
|
||||
<result property="reviewItem" column="review_item" jdbcType="VARCHAR"/>
|
||||
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
||||
<result property="weight" column="weight" jdbcType="NUMERIC"/>
|
||||
<result property="examineTaskId" column="examine_task_id" jdbcType="INTEGER"/>
|
||||
<result property="sortNum" column="sort_num" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_query">
|
||||
select id,
|
||||
review_type,
|
||||
review_category,
|
||||
review_item,
|
||||
remarks,
|
||||
weight,
|
||||
examine_task_id,
|
||||
sort_num
|
||||
from pms_examine_config
|
||||
</sql>
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ExamineConfigMap">
|
||||
<include refid="base_query"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="ExamineConfigMap">
|
||||
<include refid="base_query"/>
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="reviewType != null and reviewType != ''">
|
||||
and review_type = #{reviewType}
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
and review_category = #{reviewCategory}
|
||||
</if>
|
||||
<if test="reviewItem != null and reviewItem != ''">
|
||||
and review_item = #{reviewItem}
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
and remarks = #{remarks}
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
and weight = #{weight}
|
||||
</if>
|
||||
<if test="examineTaskId != null">
|
||||
and examine_task_id = #{examineTaskId}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from pms_examine_config
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="reviewType != null and reviewType != ''">
|
||||
and review_type = #{reviewType}
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
and review_category = #{reviewCategory}
|
||||
</if>
|
||||
<if test="reviewItem != null and reviewItem != ''">
|
||||
and review_item = #{reviewItem}
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
and remarks = #{remarks}
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
and weight = #{weight}
|
||||
</if>
|
||||
<if test="examineTaskId != null">
|
||||
and examine_task_id = #{examineTaskId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="list" resultMap="ExamineConfigMap">
|
||||
<include refid="base_query"/>
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="reviewType != null and reviewType != ''">
|
||||
and review_type = #{reviewType}
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
and review_category = #{reviewCategory}
|
||||
</if>
|
||||
<if test="reviewItem != null and reviewItem != ''">
|
||||
and review_item = #{reviewItem}
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
and remarks = #{remarks}
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
and weight = #{weight}
|
||||
</if>
|
||||
<if test="examineTaskId != null">
|
||||
and examine_task_id = #{examineTaskId}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and template_id = #{templateId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_config(review_type, review_category, review_item, remarks, weight, examine_task_id, sort_num,template_id)
|
||||
values (#{reviewType}, #{reviewCategory}, #{reviewItem}, #{remarks}, #{weight}, #{examineTaskId}, #{sortNum}, #{templateId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_config(review_type, review_category, review_item, remarks, weight, examine_task_id, sort_num,template_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.reviewType}, #{entity.reviewCategory}, #{entity.reviewItem}, #{entity.remarks}, #{entity.weight},
|
||||
#{entity.examineTaskId}, #{entity.sortNum},#{entity.templateId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_config(review_type, review_category, review_item, remarks, weight, examine_task_id, sort_num)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.reviewType}, #{entity.reviewCategory}, #{entity.reviewItem}, #{entity.remarks}, #{entity.weight},
|
||||
#{entity.examineTaskId}, #{entity.sortNum})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
review_type = values(review_type),
|
||||
review_category = values(review_category),
|
||||
review_item = values(review_item),
|
||||
remarks = values(remarks),
|
||||
weight = values(weight),
|
||||
examine_task_id = values(examine_task_id)
|
||||
sort_num = values(sort_num)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update pms_examine_config
|
||||
<set>
|
||||
<if test="reviewType != null and reviewType != ''">
|
||||
review_type = #{reviewType},
|
||||
</if>
|
||||
<if test="reviewCategory != null and reviewCategory != ''">
|
||||
review_category = #{reviewCategory},
|
||||
</if>
|
||||
<if test="reviewItem != null and reviewItem != ''">
|
||||
review_item = #{reviewItem},
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
remarks = #{remarks},
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
weight = #{weight},
|
||||
</if>
|
||||
<if test="examineTaskId != null">
|
||||
examine_task_id = #{examineTaskId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from pms_examine_config
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByTaskId">
|
||||
delete from pms_examine_config where examine_task_id = #{examineTaskId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
<?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.examine.detail.mapper.ExamineDetailMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.detail.domain.ExamineDetail" id="ExamineDetailMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="examineId" column="examine_id" jdbcType="INTEGER"/>
|
||||
<result property="score" column="score" jdbcType="INTEGER"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="configId" column="config_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_query">
|
||||
select id,
|
||||
examine_id,
|
||||
score,
|
||||
remark,
|
||||
config_id
|
||||
from pms_examine_detail
|
||||
</sql>
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ExamineDetailMap">
|
||||
<include refid="base_query"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="list" resultMap="ExamineDetailMap">
|
||||
<include refid="base_query"/>
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="examineId != null">
|
||||
and examine_id = #{examineId}
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and score = #{score}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
<if test="configId != null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
<if test="examineIdList != null and examineIdList.size>0">
|
||||
and examine_id in
|
||||
<foreach collection="examineIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from pms_examine_detail
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="examineId != null">
|
||||
and examine_id = #{examineId}
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and score = #{score}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
<if test="configId != null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="listByExamineId" resultMap="ExamineDetailMap">
|
||||
<include refid="base_query"/>
|
||||
where examine_id in
|
||||
<foreach collection="idList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_detail(examine_id, score, remark, config_id)
|
||||
values (#{examineId}, #{score}, #{remark}, #{configId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_detail(examine_id, score, remark, config_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.examineId}, #{entity.score}, #{entity.remark}, #{entity.configId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_detail(examine_id, score, remark, config_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.examineId}, #{entity.score}, #{entity.remark}, #{entity.configId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
score = values(score),
|
||||
remark = values(remark)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update pms_examine_detail
|
||||
<set>
|
||||
<if test="examineId != null">
|
||||
examine_id = #{examineId},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="configId != null">
|
||||
config_id = #{configId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from pms_examine_detail
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByExamineId">
|
||||
delete
|
||||
from pms_examine_detail
|
||||
where examine_id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteByTaskId">
|
||||
delete
|
||||
from pms_examine_detail where config_id in (select id from pms_examine_config where examine_task_id=#{taskId});
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<?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.examine.task.mapper.ExamineTaskMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.task.domain.ExamineTask" id="ExamineTaskMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
||||
<result property="peopleNumber" column="people_number" jdbcType="INTEGER"/>
|
||||
<result property="peopleNumberDetail" column="people_number_detail" jdbcType="VARCHAR"/>
|
||||
<result property="taskStatus" column="task_status" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="taskEditFlag" column="task_edit_flag" jdbcType="BOOLEAN"/>
|
||||
<result property="templateId" column="template_id" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增任务 -->
|
||||
<insert id="addTask" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO pms_examine_task (task_name, people_number, people_number_detail, task_status, create_time, end_time, year,template_id)
|
||||
VALUES (#{taskName}, #{peopleNumber}, #{peopleNumberDetail}, #{taskStatus}, #{createTime}, #{endTime}, #{year},#{templateId})
|
||||
</insert>
|
||||
|
||||
<select id="getTasks" resultMap="ExamineTaskMap">
|
||||
SELECT t1.*,t2.template_type,t2.template_name FROM pms_examine_task t1 left join pms_examine_template t2 on t1.template_id=t2.id
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''">
|
||||
AND t1.task_name LIKE CONCAT('%', #{taskName}, '%')
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
<choose>
|
||||
<when test="taskStatus == 2">
|
||||
AND t1.end_time < NOW()
|
||||
</when>
|
||||
<when test="taskStatus == 0">
|
||||
AND t1.end_time > CURRENT_TIMESTAMP
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="year != null">
|
||||
AND t1.year = #{year}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="listTask" resultMap="ExamineTaskMap">
|
||||
select distinct t1.id,t1.task_name, t1.people_number,t1.task_edit_flag, t1.people_number_detail, t1.task_status, t1.create_time, t1.end_time,t1.template_id
|
||||
from pms_examine_task t1
|
||||
left join pms_examine_user t2 on t1.id = t2.task_id
|
||||
left join sys_user t3 on t2.user_id = t3.user_id
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''">
|
||||
AND t1.task_name LIKE CONCAT('%', #{taskName}, '%')
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
<choose>
|
||||
<when test="taskStatus == 2">
|
||||
AND t1.end_time < NOW()
|
||||
</when>
|
||||
<when test="taskStatus == 0">
|
||||
AND t1.end_time > CURRENT_TIMESTAMP
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="year != null">
|
||||
AND t1.year = #{year}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</where>
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
<select id="queryById" resultMap="ExamineTaskMap">
|
||||
SELECT t1.*,t2.template_name,t2.template_type FROM pms_examine_task t1
|
||||
left join pms_examine_template t2 on t1.template_id=t2.id
|
||||
WHERE t1.id = #{id}
|
||||
</select>
|
||||
<select id="listTaskSelf" resultType="tech.unissense.pms.business.examine.task.domain.ExamineTaskDto">
|
||||
select t1.examine_status_self,t1.id as examine_id,
|
||||
t2.* from pms_examine_user t1
|
||||
left join pms_examine_task t2
|
||||
on t1.task_id=t2.id
|
||||
where user_id=#{userId}
|
||||
order by t2.create_time desc
|
||||
</select>
|
||||
|
||||
<update id="updateTask">
|
||||
UPDATE pms_examine_task
|
||||
<set>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="peopleNumber != null">people_number = #{peopleNumber},</if>
|
||||
<if test="peopleNumberDetail != null">people_number_detail = #{peopleNumberDetail},</if>
|
||||
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="year != null">year = #{year},</if>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateTaskEditFlag">
|
||||
update pms_examine_task
|
||||
set task_edit_flag=#{flag}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTask">
|
||||
DELETE FROM pms_examine_task
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
<?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.examine.template.mapper.ExamineTemplateMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.template.domain.ExamineTemplate" id="ExamineTemplateMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="templateName" column="template_name"/>
|
||||
<result property="templateType" column="template_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, template_name, template_type, create_by, update_by, update_time, create_time
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="ExamineTemplateMap">
|
||||
select
|
||||
t1.id, t1.template_name, t1.template_type, t1.create_by, t1.update_by, t1.update_time, t1.create_time,
|
||||
t2.nick_name as create_by_name,
|
||||
t3.nick_name as update_by_name
|
||||
from pms_examine_template t1
|
||||
left join sys_user t2 on t1.create_by=t2.user_id
|
||||
left join sys_user t3 on t1.update_by=t3.user_id
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and t1.id = #{id}
|
||||
</if>
|
||||
<if test="templateName != null and templateName != ''">
|
||||
and t1.template_name = #{templateName}
|
||||
</if>
|
||||
<if test="templateType != null and templateType != ''">
|
||||
and t1.template_type = #{templateType}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and t1.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and t1.update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and t1.update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and t1.create_time = #{createTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="ExamineTemplateMap">
|
||||
SELECT id,
|
||||
template_name,
|
||||
template_type,
|
||||
create_by,
|
||||
update_by,
|
||||
update_time,
|
||||
create_time
|
||||
FROM pms_examine_template
|
||||
WHERE id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO pms_examine_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">
|
||||
template_name,
|
||||
</if>
|
||||
<if test="templateType != null and templateType != ''">
|
||||
template_type,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">
|
||||
#{templateName},
|
||||
</if>
|
||||
<if test="templateType != null and templateType != ''">
|
||||
#{templateType},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE pms_examine_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">
|
||||
template_name = #{templateName},
|
||||
</if>
|
||||
<if test="templateType != null and templateType != ''">
|
||||
template_type = #{templateType},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE
|
||||
FROM pms_examine_template
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from pms_examine_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
<?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.examine.user.mapper.ExamineUserMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.user.domain.ExamineUser" id="ExamineUserMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="taskId" column="task_id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="score" column="score" jdbcType="NUMERIC"/>
|
||||
<result property="judgeContent" column="judge_content" jdbcType="VARCHAR"/>
|
||||
<result property="selfJudgeContent" column="self_judge_content" jdbcType="VARCHAR"/>
|
||||
<result property="manageScore" column="manage_score" jdbcType="NUMERIC"/>
|
||||
<result property="examineStatus" column="examine_status" jdbcType="VARCHAR"/>
|
||||
<result property="examineStatusSelf" column="examine_status_self" jdbcType="VARCHAR"/>
|
||||
<result property="manageUserId" column="manage_user_id" jdbcType="INTEGER"/>
|
||||
<result property="selfScore" column="self_score" jdbcType="NUMERIC"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_query">
|
||||
select id,
|
||||
task_id,
|
||||
user_id,
|
||||
score,
|
||||
judge_content,
|
||||
self_judge_content,
|
||||
manage_score,
|
||||
examine_status,
|
||||
examine_status_self,
|
||||
manage_user_id,
|
||||
self_score
|
||||
from pms_examine_user
|
||||
|
||||
</sql>
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ExamineUserMap">
|
||||
<include refid="base_query"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from pms_examine_user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and score = #{score}
|
||||
</if>
|
||||
<if test="judgeContent != null and judgeContent != ''">
|
||||
and judge_content = #{judgeContent}
|
||||
</if>
|
||||
<if test="manageScore != null">
|
||||
and manage_score = #{manageScore}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="list" resultType="ExamineUser">
|
||||
select t1.id,
|
||||
t1.task_id,
|
||||
t1.user_id,
|
||||
t1.score,
|
||||
t1.judge_content,
|
||||
t1.self_judge_content,
|
||||
t1.manage_score,
|
||||
t1.examine_status,
|
||||
t1.examine_status_self,
|
||||
t1.manage_user_id,
|
||||
t1.self_score,
|
||||
t2.nick_name as userName,
|
||||
t3.nick_name as manageUserName
|
||||
from pms_examine_user t1 left join sys_user t2 on t1.user_id = t2.user_id
|
||||
left join sys_user t3 on t1.manage_user_id = t3.user_id
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and t1.id = #{id}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
and t1.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and t1.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size>0">
|
||||
and t1.user_id in
|
||||
<foreach collection="userIdList" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and t1.score = #{score}
|
||||
</if>
|
||||
<if test="judgeContent != null and judgeContent != ''">
|
||||
and t1.judge_content = #{judgeContent}
|
||||
</if>
|
||||
<if test="manageScore != null">
|
||||
and t1.manage_score = #{manageScore}
|
||||
</if>
|
||||
<if test="examineStatus != null and examineStatus != ''">
|
||||
and t1.examine_status = #{examineStatus}
|
||||
</if>
|
||||
<if test="examineStatusSelf != null and examineStatusSelf != ''">
|
||||
and t1.examine_status_self = #{examineStatusSelf}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and t2.dept_id = #{deptId}
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
${orderBySql}
|
||||
</select>
|
||||
<select id="queryByTaskIdAndUserId" resultMap="ExamineUserMap">
|
||||
<include refid="base_query"/>
|
||||
where task_id = #{taskId} and user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_user(task_id, user_id, score, judge_content,self_judge_content, manage_score)
|
||||
values (#{taskId}, #{userId}, #{score}, #{judgeContent}, #{selfJudgeContent}, #{manageScore})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_user(task_id, user_id, score, judge_content, self_judge_content,manage_score)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskId}, #{entity.userId}, #{entity.score}, #{entity.judgeContent},#{entity.selfJudgeContent}, #{entity.manageScore})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into pms_examine_user(task_id, user_id, score, judge_content,self_judge_content, manage_score)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskId}, #{entity.userId}, #{entity.score}, #{entity.judgeContent}, #{entity.selfJudgeContent}, #{entity.manageScore})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
task_id = values(task_id),
|
||||
user_id = values(user_id),
|
||||
score = values(score),
|
||||
judge_content = values(judge_content),
|
||||
self_judge_content = values(self_judge_content),
|
||||
manage_score = values(manage_score)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update pms_examine_user
|
||||
<set>
|
||||
<if test="taskId != null">
|
||||
task_id = #{taskId},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score},
|
||||
</if>
|
||||
<if test="judgeContent != null and judgeContent != ''">
|
||||
judge_content = #{judgeContent},
|
||||
</if>
|
||||
<if test="selfJudgeContent != null and selfJudgeContent != ''">
|
||||
self_judge_content = #{selfJudgeContent},
|
||||
</if>
|
||||
<if test="manageScore != null">
|
||||
manage_score = #{manageScore},
|
||||
</if>
|
||||
<if test="selfScore != null">
|
||||
self_score = #{selfScore},
|
||||
</if>
|
||||
<if test="examineStatus != null and examineStatus != ''">
|
||||
examine_status = #{examineStatus},
|
||||
</if>
|
||||
<if test="examineStatusSelf != null and examineStatusSelf != ''">
|
||||
examine_status_self = #{examineStatusSelf},
|
||||
</if>
|
||||
<if test="manageUserId != null">
|
||||
manage_user_id = #{manageUserId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from pms_examine_user
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByIdList">
|
||||
delete
|
||||
from pms_examine_user
|
||||
where id in
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="clearUserByTaskId">
|
||||
update pms_examine_user
|
||||
set score=null,judge_content=null,manage_score=null,examine_status=0,examine_status_self=0,self_score=null
|
||||
where task_id=#{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -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" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
|
|
@ -14,7 +14,7 @@ import tech.unissense.pms.common.xss.Xss;
|
|||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysUser extends BaseEntity
|
||||
|
@ -89,6 +89,15 @@ public class SysUser extends BaseEntity
|
|||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
private List<Integer> userIdList;
|
||||
|
||||
public List<Integer> getUserIdList() {
|
||||
return userIdList;
|
||||
}
|
||||
|
||||
public void setUserIdList(List<Integer> userIdList) {
|
||||
this.userIdList = userIdList;
|
||||
}
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ public class FileUploadUtils
|
|||
/**
|
||||
* 默认大小 50M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024L;
|
||||
public static final long DEFAULT_MAX_SIZE = 100 * 1024 * 1024L;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -58,33 +58,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
|
||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
|
||||
u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size>0">
|
||||
AND u.user_id in
|
||||
<foreach collection="userIdList" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
AND u.nick_name like concat('%', #{nickName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||
ancestors) ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
|
|
Loading…
Reference in New Issue