3 Commits

Author SHA1 Message Date
3e864a5770 Merge branch 'refs/heads/dev-2025-temporary' into storymuchexec_250108
# Conflicts:
#	src/main/java/com/sa/zentao/service/impl/ZtTaskServiceImpl.java
#	src/main/resources/mapper/ZtStoryMapper.xml
2025-12-30 09:28:18 +08:00
0f1c7b02fe 产品角色等 2025-12-25 14:02:41 +08:00
8f0c7a020c 产品角色等 2025-12-25 13:46:26 +08:00
5 changed files with 102 additions and 62 deletions

View File

@@ -13,6 +13,7 @@ public enum UserType {
UI(7, "UI工程师"),
XMJL(8, "项目经理"),
XMZL(9, "项目助理"),
CPJL(10, "产品经理"),
;
@EnumValue

View File

@@ -107,6 +107,14 @@ public class ZtProjectQo extends BaseQo {
private String spec;
private String bugType;
/**
* 测试人员
*/
private String testUser;
/**
* 产品人员
*/
private String productUser;
private String account;
//1 延期 2不延期

View File

@@ -518,7 +518,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
Date d = new Date();
Date d=new Date();
for (ZtTaskDTO task : list) {
ZtUser ztUser = userMap.get(task.getFinishedby());
if (ztUser != null) {
@@ -531,16 +531,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
if (task.getDeadline() != null) {
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
}
if (task.getFinishedDate() != null) {
if (task.getFinishedDate().getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
if(task.getFinishedDate()!=null){
if(task.getFinishedDate().getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
task.setDelayFlag(1);
} else {
}else{
task.setDelayFlag(2);
}
} else {
if (d.getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
}else{
if(d.getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
task.setDelayFlag(1);
} else {
}else{
task.setDelayFlag(2);
}
}
@@ -644,16 +644,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
ztTask.setEstimate(ztTask.getUseTime().floatValue());
ztTask.setLeft(ztTask.getUseTime().floatValue());
}
if (ztTask.getDeadline() == null) {
if(ztTask.getDeadline()==null){
throw new BusinessException("当前环境异常请联系管理员");
}
this.baseMapper.insert(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))) {
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))){
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
}
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))) {
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))){
ztStory.setTestPlanEndTime(ztTask.getDeadline());
}
this.storyService.updateById(ztStory);
@@ -703,7 +703,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
@Override
@Transactional
public void modifyTask(ZtTaskDTO dto) {
if (dto.getDeadline() == null || dto.getEstStarted() == null) {
if(dto.getDeadline()==null||dto.getEstStarted()==null){
throw new BusinessException("请录入开始结束日期");
}
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
@@ -850,7 +850,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
}
if (ObjectUtils.notEqual(oldExecution, newExecution)) {
if(ObjectUtils.notEqual(oldExecution,newExecution)){
//迭代切换了
this.kanbanlaneService.removeKanbanCell(oldExecution, ztTask.getId(), KanbanCellType.TASK);
//添加新的看板迭代
@@ -927,26 +927,26 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
actionService.addAction(ActionType.RW, ActionStatus.KS, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
RiskUserThreadLocal.get().getName(), "", null);
if ("done".equals(ztTask.getStatus())) {
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby()) ? RiskUserThreadLocal.get().getName() : ztTask.getFinishedby();
if("done".equals(ztTask.getStatus())){
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby())?RiskUserThreadLocal.get().getName():ztTask.getFinishedby();
//如果是测试任务 提交交付物
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, ztTask.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
}
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
//更新需求交付物
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztStory != null) {
if(ztStory!=null){
ztStory.setDeliverContent(ztTask.getDeliverContent());
this.storyService.updateById(ztStory);
}
}
}
if (!StringUtils.isEmpty(dto.getRemark())) {
if(!StringUtils.isEmpty(dto.getRemark())){
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
}
@@ -1030,15 +1030,21 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
//添加action
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
//如果是测试任务 提交交付物
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
//更新需求交付物
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if(ztStory!=null){
ztStory.setDeliverContent(ztTask.getDeliverContent());
this.storyService.updateById(ztStory);
}
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
}
}
if (!StringUtils.isEmpty(dto.getRemark())) {
if(!StringUtils.isEmpty(dto.getRemark())){
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
}
@@ -1071,7 +1077,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), finishBy, TaskType.transferType(type), false);
}
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(),ztTask.getFeedbackRemark());
}
}
@@ -1090,9 +1096,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
ztTask.setLastediteddate(new Date());
this.baseMapper.updateById(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1103,10 +1109,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1118,11 +1124,12 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
}
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
//添加action
@@ -1168,9 +1175,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
//添加action
actionService.addAction(ActionType.RW, ActionStatus.QX, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), ztTask.getProject(), ztTask.getExecution(),
RiskUserThreadLocal.get().getName(), dto.getDesc(), null);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1182,9 +1189,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1196,7 +1203,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
}
if (ztTask.getExecution() != null && ztTask.getExecution() != 0) {
@@ -1244,7 +1251,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
List<ZtTaskDTO> list = dto.getList();
long nullDeadlineCount = list.stream().filter(o -> o.getDeadline() == null || o.getEstStarted() == null).count();
if (nullDeadlineCount > 0) {
if(nullDeadlineCount>0){
throw new BusinessException("请录入开始结束日期");
}
@@ -1291,13 +1298,13 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
}
saveList.add(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getDevelPlanEndTime().getTime()
)) {
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getDevelPlanEndTime().getTime()
)){
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
}
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getTestPlanEndTime().getTime())) {
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getTestPlanEndTime().getTime())){
ztStory.setTestPlanEndTime(ztTask.getDeadline());
}
this.storyService.updateById(ztStory);
@@ -1312,7 +1319,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
taskSendZpMessage(ztTask.getId(), null, ztTask.getAssignedTo());
} else {
taskSendPsMessage(ztTask.getId(), ztProject.getPm(), ztTask.getOpenedby());
taskSendPsMessage(ztTask.getId(), ztProject.getPm(),ztTask.getOpenedby());
}
}

View File

@@ -213,6 +213,13 @@
and s.title like concat('%', #{qo.title}, '%')
</if>
<if test="qo.testUser != null and qo.testUser != '' ">
and s.test_user like concat('%', #{qo.testUser}, '%')
</if>
<if test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.id != null ">
and s.id = #{qo.id}
</if>
@@ -374,6 +381,18 @@
<!-- <if test="qo.endDate !=null">-->
<!-- and s.openedDate <![CDATA[<=]]> #{qo.endDate}-->
<!-- </if>-->
<!-- <if test="qo.startDate !=null">-->
<!-- and s.openedDate <![CDATA[>=]]> #{qo.startDate}-->
<!-- </if>-->
<!-- <if test="qo.endDate !=null">-->
<!-- and s.openedDate <![CDATA[<=]]> #{qo.endDate}-->
<!-- </if>-->
<if test="qo.testUser != null and qo.testUser != '' ">
and s.test_user like concat('%', #{qo.testUser}, '%')
</if>
<if test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.pri != null and qo.pri != '' ">
and s.pri = #{qo.pri}
</if>
@@ -502,49 +521,49 @@
<if test="qo.searchCode=='xmmc' and qo.searchValue != null and qo.searchValue != '' ">
and pj.name like concat('%', #{qo.searchValue}, '%')
</if>
-- 项目id
-- 项目id
<if test="qo.searchCode=='xmid' and qo.searchValue != null and qo.searchValue != '' ">
and pj.id =#{qo.searchValue}
and pj.id =#{qo.searchValue}
</if>
-- //需求名称
-- //需求名称
<if test="qo.searchCode=='xqmc' and qo.searchValue != null and qo.searchValue != '' ">
and s.title like concat('%', #{qo.searchValue}, '%')
and s.title like concat('%', #{qo.searchValue}, '%')
</if>
-- 需求id
-- 需求id
<if test="qo.searchCode=='xqid' and qo.searchValue != null and qo.searchValue != '' ">
and s.id =#{qo.searchValue}
and s.id =#{qo.searchValue}
</if>
-- 状态
-- 状态
<if test="qo.searchCode=='zt' and qo.searchValue != null and qo.searchValue != '' ">
and s.stage =#{qo.searchValue}
and s.stage =#{qo.searchValue}
</if>
-- 项目描述
-- 项目描述
<if test="qo.searchCode=='xmms' and qo.searchValue != null and qo.searchValue != '' ">
and sp.`spec` =#{qo.searchValue}
and sp.`spec` =#{qo.searchValue}
</if>
-- 负责人
-- 负责人
<if test="qo.searchCode=='fzr' and qo.searchValue != null and qo.searchValue != '' ">
and s.assignedTo =#{qo.searchValue}
and s.assignedTo =#{qo.searchValue}
</if>
<if test="qo.searchCode=='jhwc' and qo.searchValue != null and qo.searchValue != '' ">
and s.plan_end_date ${qo.searchValue}
and s.plan_end_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
and s.start_date ${qo.searchValue}
and s.start_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
and s.end_date ${qo.searchValue}
and s.end_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='yscj' and qo.searchValue != null and qo.searchValue != '' ">
and s.openedBy = #{qo.searchValue}
and s.openedBy = #{qo.searchValue}
</if>
<if test="qo.searchCode=='ysgb' and qo.searchValue != null and qo.searchValue != '' ">
and s.closedBy = #{qo.searchValue}
and s.closedBy = #{qo.searchValue}
</if>
</if>
@@ -879,7 +898,12 @@
WHERE 1=1
<if test="qo.testUser != null and qo.testUser != '' ">
and s.test_user like concat('%', #{qo.testUser}, '%')
</if>
<if test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.pri != null and qo.pri != '' ">
and s.pri = #{qo.pri}