用户需求任务
This commit is contained in:
@ -22,7 +22,7 @@ public class CodeGenerator {
|
|||||||
//自己的名字
|
//自己的名字
|
||||||
static String Author = "gqb";
|
static String Author = "gqb";
|
||||||
|
|
||||||
public static String tableName = "zt_develop_feedback";
|
public static String tableName = "zt_story_user_task";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -15,6 +15,7 @@ import com.sa.zentao.utils.UploadUtil;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -108,6 +109,24 @@ public class CommonsController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/copyFile")
|
||||||
|
public Result copyFile( UploadDTO file){
|
||||||
|
String files = file.getFiles();
|
||||||
|
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(files)){
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
String[] split = files.split(",");
|
||||||
|
List<ZtFile> ztFiles = this.fileService.listByIds(Arrays.asList(split));
|
||||||
|
for (ZtFile f:ztFiles) {
|
||||||
|
f.setId(null);
|
||||||
|
f.setObjecttype(null);
|
||||||
|
f.setObjectid(null);
|
||||||
|
}
|
||||||
|
this.fileService.saveBatch(ztFiles);
|
||||||
|
return Result.success(ztFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@ public class ZtBugController {
|
|||||||
|
|
||||||
@RequestMapping(value = "/bugById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
@RequestMapping(value = "/bugById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
public Result bugById(@RequestBody ZtBugQo qo){
|
public Result bugById(@RequestBody ZtBugQo qo){
|
||||||
return Result.success(bugService.getById(qo.getId()));
|
|
||||||
|
return Result.success(bugService.getBugById(qo.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/assignedTo", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
@RequestMapping(value = "/assignedTo", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
@ -8,6 +8,7 @@ import com.sa.zentao.dao.ZtProjectDTO;
|
|||||||
import com.sa.zentao.entity.ZtNotice;
|
import com.sa.zentao.entity.ZtNotice;
|
||||||
import com.sa.zentao.qo.ZtProjectQo;
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
import com.sa.zentao.service.IZtNoticeService;
|
import com.sa.zentao.service.IZtNoticeService;
|
||||||
|
import com.sa.zentao.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +39,9 @@ public class ZtNoticeController {
|
|||||||
public Result<PageInfo<ZtProjectDTO>> pageList(@RequestBody ZtProjectQo qo){
|
public Result<PageInfo<ZtProjectDTO>> pageList(@RequestBody ZtProjectQo qo){
|
||||||
|
|
||||||
List<ZtNotice> list = noticeService.list(new QueryWrapper<ZtNotice>().lambda()
|
List<ZtNotice> list = noticeService.list(new QueryWrapper<ZtNotice>().lambda()
|
||||||
.eq(ZtNotice::getFlag, 0).orderByDesc(ZtNotice::getId));
|
.eq(ZtNotice::getFlag, 0).orderByDesc(ZtNotice::getId)
|
||||||
|
.gt(ZtNotice::getLoseDate, DateUtils.dateSubDay(new Date(),15))
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
|
@ -143,4 +143,11 @@ public class ZtProductController {
|
|||||||
return Result.success(ztProductService.getAllBusinessSelect(dto));
|
return Result.success(ztProductService.getAllBusinessSelect(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "/searchObj", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result searchObj(@RequestBody ZtAllBusinessDTO dto){
|
||||||
|
|
||||||
|
return Result.success(ztProductService.searchObj(dto));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,13 @@ public class ZtProjectController {
|
|||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加项目集
|
||||||
|
@RequestMapping(value = "/getProjectById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result getProjectById(@RequestBody ZtProjectDTO dto){
|
||||||
|
ZtProjectDTO p =ztProjectService.getProjectById(dto);
|
||||||
|
return Result.success(p);
|
||||||
|
}
|
||||||
|
|
||||||
//修改执行
|
//修改执行
|
||||||
@RequestMapping(value = "/editImplement", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
@RequestMapping(value = "/editImplement", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
public Result editImplement(@RequestBody ZtProjectDTO dto){
|
public Result editImplement(@RequestBody ZtProjectDTO dto){
|
||||||
@ -278,6 +285,12 @@ public class ZtProjectController {
|
|||||||
return Result.success(this.ztProjectService.executionListByProduct(qo));
|
return Result.success(this.ztProjectService.executionListByProduct(qo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//搜索执行根据产品 和 项目
|
||||||
|
@RequestMapping(value = "/executionListNoClosedByProduct", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result executionListNoClosedByProduct(@RequestBody ZtProjectQo qo){
|
||||||
|
return Result.success(this.ztProjectService.executionListNoClosedByProduct(qo));
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/executionListByProject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
@RequestMapping(value = "/executionListByProject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
public Result executionListByProject(@RequestBody ZtProjectQo qo){
|
public Result executionListByProject(@RequestBody ZtProjectQo qo){
|
||||||
return Result.success(this.ztProjectService.executionListByProject(qo));
|
return Result.success(this.ztProjectService.executionListByProject(qo));
|
||||||
|
@ -111,7 +111,23 @@ public class ZtStoryUserController {
|
|||||||
List list = storyUserService.myWaitYsStory(dto);
|
List list = storyUserService.myWaitYsStory(dto);
|
||||||
return Result.success(CollectionUtils.isEmpty(list)?list:list.get(0));
|
return Result.success(CollectionUtils.isEmpty(list)?list:list.get(0));
|
||||||
}
|
}
|
||||||
|
//明确需求 以设计状态下去提交交付物 到待确认
|
||||||
|
@RequestMapping(value = "/improveStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result improveStory(@RequestBody ZtStoryUserDTO dto){
|
||||||
|
this.storyUserService.improveStory(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
//确认交付物按钮 待确认 到已确认
|
||||||
|
@RequestMapping(value = "/confirmStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result confirmStory(@RequestBody ZtStoryUserDTO dto){
|
||||||
|
this.storyUserService.confirmStory(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
//确认交付物按钮 待确认 到已确认
|
||||||
|
@RequestMapping(value = "/needMeetOrDesign", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result needMeetOrDesign(@RequestBody ZtStoryUserDTO dto){
|
||||||
|
this.storyUserService.needMeetOrDesign(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.sa.zentao.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sa.zentao.dao.Result;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserTaskDTO;
|
||||||
|
import com.sa.zentao.dao.ZtTaskDTO;
|
||||||
|
import com.sa.zentao.entity.ZtStoryUserTask;
|
||||||
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
|
import com.sa.zentao.service.IZtStoryUserTaskService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/zt-story-user-task")
|
||||||
|
public class ZtStoryUserTaskController {
|
||||||
|
@Autowired
|
||||||
|
private IZtStoryUserTaskService storyUserTaskService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/pageList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result<PageInfo<ZtStoryUserDTO>> pageList(@RequestBody ZtProjectQo qo){
|
||||||
|
|
||||||
|
return Result.success(storyUserTaskService.taskPageList(qo));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result add(@RequestBody ZtStoryUserTaskDTO dto){
|
||||||
|
storyUserTaskService.add(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result modify(@RequestBody ZtStoryUserTaskDTO dto){
|
||||||
|
storyUserTaskService.modify(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/closed", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result closed(@RequestBody ZtStoryUserTaskDTO dto){
|
||||||
|
storyUserTaskService.closed(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "/cancel", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result cancel(@RequestBody ZtStoryUserTaskDTO dto){
|
||||||
|
storyUserTaskService.cancel(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/getUserStoryTaskById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result getUserStoryTaskById(@RequestBody ZtProjectQo qo){
|
||||||
|
return Result.success(storyUserTaskService.getUserStoryTaskById(qo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/finishedTask", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result<PageInfo<ZtStoryUserDTO>> finishedTask(@RequestBody ZtStoryUserTaskDTO dto){
|
||||||
|
storyUserTaskService.finishedTask(dto);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -12,6 +12,7 @@ import com.sa.zentao.dao.*;
|
|||||||
import com.sa.zentao.entity.*;
|
import com.sa.zentao.entity.*;
|
||||||
import com.sa.zentao.qo.ZtProjectQo;
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
import com.sa.zentao.service.*;
|
import com.sa.zentao.service.*;
|
||||||
|
import com.sa.zentao.utils.BeanCopyUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -173,16 +174,22 @@ public class ZtTaskController {
|
|||||||
// 需求关联的迭代
|
// 需求关联的迭代
|
||||||
List<ZtTask> list = this.ztTaskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, dto.getStory()));
|
List<ZtTask> list = this.ztTaskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, dto.getStory()));
|
||||||
|
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
for (ZtTask t:list) {
|
List<ZtTaskDTO> ztTaskDTOS = BeanCopyUtil.copyListProperties(list, ZtTaskDTO::new);
|
||||||
|
|
||||||
|
for (ZtTaskDTO t:ztTaskDTOS) {
|
||||||
ZtUser ztUser = userMap.get(t.getAssignedTo());
|
ZtUser ztUser = userMap.get(t.getAssignedTo());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
t.setAssignedTo(ztUser.getNickname());
|
t.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Result.success(list);
|
return Result.success(ztTaskDTOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ public class UploadDTO implements Serializable {
|
|||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private MultipartFile file;
|
private MultipartFile file;
|
||||||
|
// 根据,隔开的字符串
|
||||||
|
private String files;
|
||||||
|
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
@ -29,4 +29,7 @@ public class ZtAllBusinessDTO implements Serializable {
|
|||||||
|
|
||||||
private Integer bugId;
|
private Integer bugId;
|
||||||
|
|
||||||
|
// story task bug userStory
|
||||||
|
private String searchType;
|
||||||
|
private String searchId;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public class ZtBugDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("closedBy")
|
@TableField("closedBy")
|
||||||
private String closedby;
|
private String closedby;
|
||||||
|
private String closedbyName;
|
||||||
@TableField("closedDate")
|
@TableField("closedDate")
|
||||||
private Date closeddate;
|
private Date closeddate;
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ public class ZtBugDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("lastEditedBy")
|
@TableField("lastEditedBy")
|
||||||
private String lasteditedby;
|
private String lasteditedby;
|
||||||
|
private String lasteditedbyName;
|
||||||
@TableField("lastEditedDate")
|
@TableField("lastEditedDate")
|
||||||
private Date lastediteddate;
|
private Date lastediteddate;
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class ZtProjectDTO<T> implements Serializable {
|
|||||||
|
|
||||||
@TableField("openedBy")
|
@TableField("openedBy")
|
||||||
private String openedBy;
|
private String openedBy;
|
||||||
|
private String openedByName;
|
||||||
@TableField("openedDate")
|
@TableField("openedDate")
|
||||||
private Date openedDate;
|
private Date openedDate;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public class ZtProjectDTO<T> implements Serializable {
|
|||||||
|
|
||||||
@TableField("PM")
|
@TableField("PM")
|
||||||
private String pm;
|
private String pm;
|
||||||
|
private String pmName;
|
||||||
@TableField("QD")
|
@TableField("QD")
|
||||||
private String qd;
|
private String qd;
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ public class ZtProjectDTO<T> implements Serializable {
|
|||||||
// private boolean hasChildren=false;
|
// private boolean hasChildren=false;
|
||||||
|
|
||||||
private List<Integer> productIds;
|
private List<Integer> productIds;
|
||||||
|
private Integer product;
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
private String productName;
|
private String productName;
|
||||||
//迭代id
|
//迭代id
|
||||||
|
@ -233,7 +233,7 @@ public class ZtStoryDTO implements Serializable {
|
|||||||
private Integer execution;
|
private Integer execution;
|
||||||
|
|
||||||
private List<Integer> executions;
|
private List<Integer> executions;
|
||||||
|
private List<ZtProjectDTO> executionList;
|
||||||
private Boolean psFlag;
|
private Boolean psFlag;
|
||||||
|
|
||||||
private String executionName;
|
private String executionName;
|
||||||
@ -258,4 +258,7 @@ public class ZtStoryDTO implements Serializable {
|
|||||||
private Integer releaseFlag=0;
|
private Integer releaseFlag=0;
|
||||||
|
|
||||||
private List<ZtBugDTO> bugList;
|
private List<ZtBugDTO> bugList;
|
||||||
|
|
||||||
|
|
||||||
|
private Date ysDate;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public class ZtStoryUserDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("closedBy")
|
@TableField("closedBy")
|
||||||
private String closedby;
|
private String closedby;
|
||||||
|
private String closedbyName;
|
||||||
@TableField("closedDate")
|
@TableField("closedDate")
|
||||||
private Date closeddate;
|
private Date closeddate;
|
||||||
|
|
||||||
@ -216,9 +216,21 @@ public class ZtStoryUserDTO implements Serializable {
|
|||||||
|
|
||||||
private List<ZtStoryDTO> sList;
|
private List<ZtStoryDTO> sList;
|
||||||
|
|
||||||
|
private List<ZtStoryUserTaskDTO> taskList;
|
||||||
|
|
||||||
private String revieweUser;
|
private String revieweUser;
|
||||||
|
|
||||||
private String files;
|
private String files;
|
||||||
|
|
||||||
private String verify;
|
private String verify;
|
||||||
|
|
||||||
|
private Date psDate;
|
||||||
|
|
||||||
|
private String ysRemark;
|
||||||
|
//交付
|
||||||
|
private String deliverRemark;
|
||||||
|
// 1 需要 2不需要
|
||||||
|
private Integer needDesign;
|
||||||
|
//1.需要 2.不需要
|
||||||
|
private Integer needImprove;
|
||||||
}
|
}
|
||||||
|
122
src/main/java/com/sa/zentao/dao/ZtStoryUserTaskDTO.java
Normal file
122
src/main/java/com/sa/zentao/dao/ZtStoryUserTaskDTO.java
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
package com.sa.zentao.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Blob;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class ZtStoryUserTaskDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
private ZtStoryUserTaskDTO info;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer userStoryId;
|
||||||
|
private String userStoryName;
|
||||||
|
private ZtStoryUserDTO storyUserInfo;
|
||||||
|
/**
|
||||||
|
* 明确 设计 设计 design 明确improve
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计工时
|
||||||
|
*/
|
||||||
|
private Float estimate;
|
||||||
|
|
||||||
|
private Float consumed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余
|
||||||
|
*/
|
||||||
|
private Float left;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派给
|
||||||
|
*/
|
||||||
|
private String assignedTo;
|
||||||
|
private String assignedToName;
|
||||||
|
/**
|
||||||
|
* 1 需要 2不需要
|
||||||
|
*/
|
||||||
|
private Integer needMeeting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1需要 2不需要
|
||||||
|
*/
|
||||||
|
private Integer needDesign;
|
||||||
|
|
||||||
|
private Integer product;
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField("estStarted")
|
||||||
|
private Date eststarted;
|
||||||
|
|
||||||
|
private Date deadline;
|
||||||
|
|
||||||
|
@TableField("realStarted")
|
||||||
|
private Date realstarted;
|
||||||
|
|
||||||
|
@TableField("finishedDate")
|
||||||
|
private Date finisheddate;
|
||||||
|
|
||||||
|
@TableField("finishedBy")
|
||||||
|
private String finishedby;
|
||||||
|
private String finishedbyName;
|
||||||
|
@TableField("canceledBy")
|
||||||
|
private String canceledby;
|
||||||
|
private String canceledbyName;
|
||||||
|
@TableField("canceledDate")
|
||||||
|
private Date canceleddate;
|
||||||
|
|
||||||
|
@TableField("closedBy")
|
||||||
|
private String closedby;
|
||||||
|
private String closedbyName;
|
||||||
|
@TableField("closedDate")
|
||||||
|
private Date closeddate;
|
||||||
|
|
||||||
|
private String closedRemark;
|
||||||
|
|
||||||
|
@TableField("openedBy")
|
||||||
|
private String openedby;
|
||||||
|
private String openedbyName;
|
||||||
|
|
||||||
|
@TableField("openedDate")
|
||||||
|
private Date openeddate;
|
||||||
|
|
||||||
|
private Integer pri;
|
||||||
|
|
||||||
|
private String lastEditedBy;
|
||||||
|
|
||||||
|
private String lastEditedByName;
|
||||||
|
private Date lastEditedDate;
|
||||||
|
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
@ -47,7 +47,7 @@ public class ZtTaskDTO implements Serializable {
|
|||||||
private Integer design;
|
private Integer design;
|
||||||
|
|
||||||
private Integer story;
|
private Integer story;
|
||||||
|
private String storyName;
|
||||||
@TableField("storyVersion")
|
@TableField("storyVersion")
|
||||||
private Integer storyversion;
|
private Integer storyversion;
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ public class ZtTaskDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("openedBy")
|
@TableField("openedBy")
|
||||||
private String openedby;
|
private String openedby;
|
||||||
|
private String openedbyName;
|
||||||
@TableField("openedDate")
|
@TableField("openedDate")
|
||||||
private Date openeddate;
|
private Date openeddate;
|
||||||
|
|
||||||
@ -120,13 +120,13 @@ public class ZtTaskDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("canceledBy")
|
@TableField("canceledBy")
|
||||||
private String canceledby;
|
private String canceledby;
|
||||||
|
private String canceledbyName;
|
||||||
@TableField("canceledDate")
|
@TableField("canceledDate")
|
||||||
private Date canceleddate;
|
private Date canceleddate;
|
||||||
|
|
||||||
@TableField("closedBy")
|
@TableField("closedBy")
|
||||||
private String closedby;
|
private String closedby;
|
||||||
|
private String closedbyName;
|
||||||
@TableField("closedDate")
|
@TableField("closedDate")
|
||||||
private Date closeddate;
|
private Date closeddate;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public class ZtEffort implements Serializable {
|
|||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
//task userStoryTask
|
||||||
@TableField("objectType")
|
@TableField("objectType")
|
||||||
private String objecttype;
|
private String objecttype;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.sa.zentao.entity;
|
package com.sa.zentao.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@ -194,9 +195,13 @@ public class ZtStory implements Serializable {
|
|||||||
|
|
||||||
private String ysRemark;
|
private String ysRemark;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Integer userStory;
|
private Integer userStory;
|
||||||
|
|
||||||
private String ysUser;
|
private String ysUser;
|
||||||
|
|
||||||
private Integer taskCount;
|
private Integer taskCount;
|
||||||
|
|
||||||
|
private Date ysDate;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,6 @@ public class ZtStoryFeedback implements Serializable {
|
|||||||
|
|
||||||
private String weixin;
|
private String weixin;
|
||||||
//1通过 2不通过
|
//1通过 2不通过
|
||||||
@TableField(exist = false)
|
|
||||||
private Integer ysFlag;
|
private Integer ysFlag;
|
||||||
|
|
||||||
private String dontHandSelect;
|
private String dontHandSelect;
|
||||||
|
@ -192,10 +192,14 @@ public class ZtStoryUser implements Serializable {
|
|||||||
* 1通过 2不通过
|
* 1通过 2不通过
|
||||||
*/
|
*/
|
||||||
private Integer ysFlag;
|
private Integer ysFlag;
|
||||||
|
private String ysRemark;
|
||||||
private String spec;
|
private String spec;
|
||||||
|
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
private String verify;
|
private String verify;
|
||||||
|
|
||||||
|
private Date psDate;
|
||||||
|
|
||||||
|
private String deliverRemark;
|
||||||
}
|
}
|
||||||
|
117
src/main/java/com/sa/zentao/entity/ZtStoryUserTask.java
Normal file
117
src/main/java/com/sa/zentao/entity/ZtStoryUserTask.java
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
package com.sa.zentao.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.sql.Blob;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class ZtStoryUserTask implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer userStoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计 design 明确improve
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计工时
|
||||||
|
*/
|
||||||
|
private Float estimate;
|
||||||
|
|
||||||
|
private Float consumed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余
|
||||||
|
*/
|
||||||
|
@TableField("`left`")
|
||||||
|
private Float left;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派给
|
||||||
|
*/
|
||||||
|
private String assignedTo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1 需要 2不需要
|
||||||
|
*/
|
||||||
|
private Integer needMeeting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1需要 2不需要
|
||||||
|
*/
|
||||||
|
private Integer needDesign;
|
||||||
|
|
||||||
|
private Integer product;
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
@TableField("`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField("estStarted")
|
||||||
|
private Date eststarted;
|
||||||
|
|
||||||
|
private Date deadline;
|
||||||
|
|
||||||
|
@TableField("realStarted")
|
||||||
|
private Date realstarted;
|
||||||
|
|
||||||
|
@TableField("finishedDate")
|
||||||
|
private Date finisheddate;
|
||||||
|
|
||||||
|
@TableField("finishedBy")
|
||||||
|
private String finishedby;
|
||||||
|
|
||||||
|
@TableField("canceledBy")
|
||||||
|
private String canceledby;
|
||||||
|
|
||||||
|
@TableField("canceledDate")
|
||||||
|
private Date canceleddate;
|
||||||
|
|
||||||
|
@TableField("closedBy")
|
||||||
|
private String closedby;
|
||||||
|
|
||||||
|
@TableField("closed_date")
|
||||||
|
private Date closeddate;
|
||||||
|
|
||||||
|
private String closedRemark;
|
||||||
|
|
||||||
|
@TableField("opened_by")
|
||||||
|
private String openedby;
|
||||||
|
|
||||||
|
@TableField("opened_date")
|
||||||
|
private Date openeddate;
|
||||||
|
@TableField("`pri`")
|
||||||
|
private Integer pri;
|
||||||
|
|
||||||
|
private String lastEditedBy;
|
||||||
|
|
||||||
|
private Date lastEditedDate;
|
||||||
|
//wait 未开始 doing 进行中 finished 完成 cancel取消 closed
|
||||||
|
@TableField("`status`")
|
||||||
|
private String status;
|
||||||
|
}
|
@ -30,9 +30,16 @@ public enum ActionStatus {
|
|||||||
CSWC(20, "tested","测试完成"),
|
CSWC(20, "tested","测试完成"),
|
||||||
KFWC(41, "developed","开发完成"),
|
KFWC(41, "developed","开发完成"),
|
||||||
|
|
||||||
|
ZTBG(41, "changeStatus","状态变更"),
|
||||||
|
MQXU(41, "mqxu","明确需求"),
|
||||||
|
|
||||||
TJYS(51, "verified","提交验收"),
|
TJYS(51, "verified","提交验收"),
|
||||||
|
|
||||||
|
KSCL(61, "startHand","开始处理"),
|
||||||
|
WXCL(62, "dontHand","无需处理"),
|
||||||
|
|
||||||
|
CLWC(65, "handFinished","处理完成"),
|
||||||
|
|
||||||
LOGIN(100, "login","登录"),
|
LOGIN(100, "login","登录"),
|
||||||
XGMM(101, "xgmm","修改密码"),
|
XGMM(101, "xgmm","修改密码"),
|
||||||
;
|
;
|
||||||
|
@ -22,6 +22,8 @@ public enum ActionType {
|
|||||||
|
|
||||||
RW(5, "task","任务"),
|
RW(5, "task","任务"),
|
||||||
|
|
||||||
|
STORYUSERTASK(21, "user-story-task","用户需求任务"),
|
||||||
|
|
||||||
BUG(6, "bug","BUG"),
|
BUG(6, "bug","BUG"),
|
||||||
|
|
||||||
LOGIN(7, "LOGIN","登录"),
|
LOGIN(7, "LOGIN","登录"),
|
||||||
|
@ -8,6 +8,8 @@ public enum FileTypes {
|
|||||||
story("story", "需求"),
|
story("story", "需求"),
|
||||||
bug("bug", "BUG"),
|
bug("bug", "BUG"),
|
||||||
userStory("userStory", "用户需求"),
|
userStory("userStory", "用户需求"),
|
||||||
|
userStoryTask("userStoryTask", "用户需求任务"),
|
||||||
|
userStoryTaskImprove("userStoryTaskImprove", "用户需求任务交付物"),
|
||||||
feedbackStory("feedbackStory", "问题反馈"),
|
feedbackStory("feedbackStory", "问题反馈"),
|
||||||
ywTask("ywTask", "运维任务"),
|
ywTask("ywTask", "运维任务"),
|
||||||
meeting("meeting", "会议"),
|
meeting("meeting", "会议"),
|
||||||
|
51
src/main/java/com/sa/zentao/enums/UserStoryEnums.java
Normal file
51
src/main/java/com/sa/zentao/enums/UserStoryEnums.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package com.sa.zentao.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
|
||||||
|
public enum UserStoryEnums {
|
||||||
|
|
||||||
|
DPS("reviewing", "待评审"),
|
||||||
|
CG("draft", "草稿"),
|
||||||
|
JH("active", "激活"),
|
||||||
|
UNCFM("unconfirmed", "产品确认中"),
|
||||||
|
DGT("waitcommunicate", "待沟通"),
|
||||||
|
|
||||||
|
DSJ("waitdesign","需求待设计"),
|
||||||
|
XXSJZ("designdoing","详细设计中"),
|
||||||
|
CPYSJ("designdone","产品已设计"),
|
||||||
|
//待确认
|
||||||
|
DQR("storyunconfirmed","需求待确认"),
|
||||||
|
CFM("confirmed","需求已确认"),
|
||||||
|
KFZ("developing","研发中"),
|
||||||
|
YWC("finished","已完成"),
|
||||||
|
CLOSED("closed","已关闭"),
|
||||||
|
;
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
private String code;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
private UserStoryEnums(String code, String value) {
|
||||||
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserStoryEnums transfer(String code){
|
||||||
|
UserStoryEnums[] values = values();
|
||||||
|
for (UserStoryEnums e:values) {
|
||||||
|
if(e.code.equals(code)){
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.sa.zentao.mapper;
|
||||||
|
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserTaskDTO;
|
||||||
|
import com.sa.zentao.entity.ZtStoryUserTask;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
public interface ZtStoryUserTaskMapper extends BaseMapper<ZtStoryUserTask> {
|
||||||
|
|
||||||
|
List<ZtStoryUserTaskDTO> pageList(@Param("qo") ZtProjectQo qo);
|
||||||
|
}
|
@ -14,13 +14,13 @@ public class StoryQo extends BaseQo {
|
|||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
|
private String assignedTo;
|
||||||
private String userName;
|
private String userName;
|
||||||
private String module;
|
private String module;
|
||||||
private String searchVal;
|
private String searchVal;
|
||||||
|
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
|
private String openedby;
|
||||||
|
private String status;
|
||||||
private List<Integer> productIds;
|
private List<Integer> productIds;
|
||||||
|
|
||||||
private String ids;
|
private String ids;
|
||||||
|
@ -30,6 +30,12 @@ public class ZtProjectQo extends BaseQo {
|
|||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String assignedTo;
|
||||||
|
|
||||||
|
private String severity;
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
@ -61,7 +67,7 @@ public class ZtProjectQo extends BaseQo {
|
|||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
private Integer module;
|
private Integer module;
|
||||||
|
private Integer moduleId;
|
||||||
private Date date;
|
private Date date;
|
||||||
|
|
||||||
private Integer kfz=0;
|
private Integer kfz=0;
|
||||||
@ -85,4 +91,16 @@ public class ZtProjectQo extends BaseQo {
|
|||||||
private List<Integer> storyIds;
|
private List<Integer> storyIds;
|
||||||
|
|
||||||
private Boolean needWeek=false;
|
private Boolean needWeek=false;
|
||||||
|
|
||||||
|
private String pri;
|
||||||
|
|
||||||
|
private String openedby;
|
||||||
|
|
||||||
|
private String stage;
|
||||||
|
|
||||||
|
private Date openEndDate;
|
||||||
|
private Date openStartDate;
|
||||||
|
//如果查询 execution 迭代里面加的
|
||||||
|
private String source;
|
||||||
|
private String spec;
|
||||||
}
|
}
|
||||||
|
@ -44,4 +44,6 @@ public interface IZtBugService extends IService<ZtBug> {
|
|||||||
void taskStoryAddBug(ZtBugDTO dto);
|
void taskStoryAddBug(ZtBugDTO dto);
|
||||||
|
|
||||||
List<ZtBugDTO> bugListByTaskStory(ZtBugDTO dto);
|
List<ZtBugDTO> bugListByTaskStory(ZtBugDTO dto);
|
||||||
|
|
||||||
|
ZtBugDTO getBugById(Integer id);
|
||||||
}
|
}
|
||||||
|
@ -49,4 +49,5 @@ public interface IZtProductService extends IService<ZtProduct> {
|
|||||||
|
|
||||||
Map<String,Object> getAllBusinessSelect(ZtAllBusinessDTO dto);
|
Map<String,Object> getAllBusinessSelect(ZtAllBusinessDTO dto);
|
||||||
|
|
||||||
|
Object searchObj(ZtAllBusinessDTO dto);
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,8 @@ public interface IZtProjectService extends IService<ZtProject> {
|
|||||||
|
|
||||||
void executionSyncStory(ZtProjectDTO dto);
|
void executionSyncStory(ZtProjectDTO dto);
|
||||||
|
|
||||||
|
//所有产品集
|
||||||
|
List<Integer> allAuthList();
|
||||||
|
|
||||||
//产品权限
|
//产品权限
|
||||||
List<Integer> authProductList();
|
List<Integer> authProductList();
|
||||||
@ -133,4 +135,8 @@ public interface IZtProjectService extends IService<ZtProject> {
|
|||||||
|
|
||||||
List<String> projectTeamById(ZtProjectQo qo);
|
List<String> projectTeamById(ZtProjectQo qo);
|
||||||
|
|
||||||
|
List<ZtProject> executionListNoClosedByProduct(ZtProjectQo qo);
|
||||||
|
|
||||||
|
ZtProjectDTO getProjectById(ZtProjectDTO dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,9 @@ public interface IZtStoryService extends IService<ZtStory> {
|
|||||||
//发布
|
//发布
|
||||||
void releaseStory(Integer story);
|
void releaseStory(Integer story);
|
||||||
|
|
||||||
|
void taskFinishChangeStatus(Integer story,String finishBy);
|
||||||
|
|
||||||
|
|
||||||
void changeStatus(ZtStoryDTO dto);
|
void changeStatus(ZtStoryDTO dto);
|
||||||
|
|
||||||
List<ZtStoryDTO> execNoSyncProject(ZtProjectQo qo);
|
List<ZtStoryDTO> execNoSyncProject(ZtProjectQo qo);
|
||||||
|
@ -6,6 +6,7 @@ import com.sa.zentao.dao.ZtStoryUserDTO;
|
|||||||
import com.sa.zentao.entity.ZtProduct;
|
import com.sa.zentao.entity.ZtProduct;
|
||||||
import com.sa.zentao.entity.ZtStoryUser;
|
import com.sa.zentao.entity.ZtStoryUser;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sa.zentao.enums.UserStoryEnums;
|
||||||
import com.sa.zentao.qo.StoryQo;
|
import com.sa.zentao.qo.StoryQo;
|
||||||
import com.sa.zentao.qo.ZtProjectQo;
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
|
|
||||||
@ -41,4 +42,11 @@ public interface IZtStoryUserService extends IService<ZtStoryUser> {
|
|||||||
|
|
||||||
List myWaitYsStory(ZtStoryDTO dto);
|
List myWaitYsStory(ZtStoryDTO dto);
|
||||||
|
|
||||||
|
void changeStatus(Integer id, UserStoryEnums status);
|
||||||
|
|
||||||
|
void improveStory(ZtStoryUserDTO dto);
|
||||||
|
|
||||||
|
void confirmStory(ZtStoryUserDTO dto);
|
||||||
|
|
||||||
|
void needMeetOrDesign(ZtStoryUserDTO dto);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.sa.zentao.service;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserTaskDTO;
|
||||||
|
import com.sa.zentao.entity.ZtStoryUser;
|
||||||
|
import com.sa.zentao.entity.ZtStoryUserTask;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
public interface IZtStoryUserTaskService extends IService<ZtStoryUserTask> {
|
||||||
|
|
||||||
|
PageInfo<ZtStoryUserTaskDTO> taskPageList(ZtProjectQo qo);
|
||||||
|
|
||||||
|
void add(ZtStoryUserTaskDTO dto);
|
||||||
|
|
||||||
|
void modify(ZtStoryUserTaskDTO dto);
|
||||||
|
|
||||||
|
void closed(ZtStoryUserTaskDTO dto);
|
||||||
|
|
||||||
|
void cancel(ZtStoryUserTaskDTO dto);
|
||||||
|
|
||||||
|
void finishedTask(ZtStoryUserTaskDTO dto);
|
||||||
|
|
||||||
|
ZtStoryUserTaskDTO getUserStoryTaskById(ZtProjectQo qo);
|
||||||
|
}
|
@ -84,8 +84,15 @@ public class IZtCountService {
|
|||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
|
||||||
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
|
|
||||||
|
if(CollectionUtils.isEmpty(pIds)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
List<ZtStory> storyList = storyService.list(new QueryWrapper<ZtStory>().lambda()
|
List<ZtStory> storyList = storyService.list(new QueryWrapper<ZtStory>().lambda()
|
||||||
.eq(ZtStory::getAssignedTo, name).ne(ZtStory::getStatus, "closed"));
|
.eq(ZtStory::getAssignedTo, name).ne(ZtStory::getStatus, "closed")
|
||||||
|
.in(ZtStory::getProduct,pIds)
|
||||||
|
);
|
||||||
List<ZtStory> storyCountList = storyList.stream().filter(o -> o.getAssignedTo().equals(name)).filter(o -> !o.getStage().equals("verified")).collect(Collectors.toList());
|
List<ZtStory> storyCountList = storyList.stream().filter(o -> o.getAssignedTo().equals(name)).filter(o -> !o.getStage().equals("verified")).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
@ -104,6 +111,7 @@ public class IZtCountService {
|
|||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
List<ZtBug> bugList = bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getAssignedTo, name)
|
List<ZtBug> bugList = bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getAssignedTo, name)
|
||||||
|
.in(ZtBug::getProduct,pIds)
|
||||||
.ne(ZtBug::getStatus, "closed")
|
.ne(ZtBug::getStatus, "closed")
|
||||||
);
|
);
|
||||||
long bugCount = bugList.stream().filter(o->o.getStatus().equals("active")).count();
|
long bugCount = bugList.stream().filter(o->o.getStatus().equals("active")).count();
|
||||||
@ -115,6 +123,7 @@ public class IZtCountService {
|
|||||||
if(userType==UserType.CS){
|
if(userType==UserType.CS){
|
||||||
List<ZtBug> myBugList = bugService.list(new QueryWrapper<ZtBug>().lambda()
|
List<ZtBug> myBugList = bugService.list(new QueryWrapper<ZtBug>().lambda()
|
||||||
.ne(ZtBug::getStatus, "closed")
|
.ne(ZtBug::getStatus, "closed")
|
||||||
|
.in(ZtBug::getProduct,pIds)
|
||||||
.and(e->e.eq(ZtBug::getAssignedTo, name).or().eq(ZtBug::getOpenedby, name))
|
.and(e->e.eq(ZtBug::getAssignedTo, name).or().eq(ZtBug::getOpenedby, name))
|
||||||
);
|
);
|
||||||
result.put("bugCount", myBugList.stream() .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.put("bugCount", myBugList.stream() .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
@ -122,12 +131,15 @@ public class IZtCountService {
|
|||||||
result.put("bugCount", bugList.stream().filter(o->o.getStatus().equals("active")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.put("bugCount", bugList.stream().filter(o->o.getStatus().equals("active")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.put("bugTimeOutCount", bugList.stream().filter(o -> o.getDeadline() != null && o.getDeadline().getTime() < date.getTime())
|
result.put("bugTimeOutCount", bugList.stream().filter(o -> o.getDeadline() != null &&DateUtils.getDayLast(o.getDeadline()).getTime() < date.getTime())
|
||||||
.filter(o -> "active".equalsIgnoreCase(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> "active".equalsIgnoreCase(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
List<ZtTask> taskList = taskService.list(new QueryWrapper<ZtTask>().lambda()
|
List<ZtTask> taskList = taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||||
.eq(ZtTask::getAssignedTo, name).ne(ZtTask::getStatus, "closed"));
|
.eq(ZtTask::getAssignedTo, name)
|
||||||
|
.in(ZtTask::getProduct,pIds)
|
||||||
|
.ne(ZtTask::getStatus, "closed"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -136,7 +148,7 @@ public class IZtCountService {
|
|||||||
// taskService.count(new QueryWrapper<ZtTask>().lambda()
|
// taskService.count(new QueryWrapper<ZtTask>().lambda()
|
||||||
// .eq(ZtTask::getAssignedTo, name).eq(ZtTask::getStatus, "done"));
|
// .eq(ZtTask::getAssignedTo, name).eq(ZtTask::getStatus, "done"));
|
||||||
|
|
||||||
result.put("taskCount", taskList.stream().filter(o->o.getStatus().equals("doing")||o.getStatus().equals("wait")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.put("taskCount", taskList.stream().filter(o->o.getStatus().equals("reviewing")||o.getStatus().equals("doing")||o.getStatus().equals("wait")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
result.put("taskTimeOutCount", taskList.stream().filter(o -> o.getDeadline() != null && DateUtils.getDayLast(o.getDeadline()).getTime() < date.getTime())
|
result.put("taskTimeOutCount", taskList.stream().filter(o -> o.getDeadline() != null && DateUtils.getDayLast(o.getDeadline()).getTime() < date.getTime())
|
||||||
.filter(o -> o.getStatus().equalsIgnoreCase("doing")||o.getStatus().equalsIgnoreCase("wait")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> o.getStatus().equalsIgnoreCase("doing")||o.getStatus().equalsIgnoreCase("wait")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
if (taskCount == 0 && bugCount == 0) {
|
if (taskCount == 0 && bugCount == 0) {
|
||||||
@ -147,9 +159,10 @@ public class IZtCountService {
|
|||||||
}
|
}
|
||||||
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>().lambda()
|
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>().lambda()
|
||||||
.ne(ZtStoryFeedback::getStatus, "closed")
|
.ne(ZtStoryFeedback::getStatus, "closed")
|
||||||
|
.in(ZtStoryFeedback::getProduct,pIds)
|
||||||
.eq(ZtStoryFeedback::getAssignedTo,RiskUserThreadLocal.get().getName())
|
.eq(ZtStoryFeedback::getAssignedTo,RiskUserThreadLocal.get().getName())
|
||||||
);
|
);
|
||||||
//处理中 问题
|
//处理中 问题 wait doing finished submitVerified 提交验收 closed reviewing verified
|
||||||
result.put("feedbackActive",feedbacks.stream().filter(o->"doing".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.put("feedbackActive",feedbacks.stream().filter(o->"doing".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
//处理完 问题
|
//处理完 问题
|
||||||
result.put("feedbackFinished",feedbacks.stream().filter(o->"finished".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.put("feedbackFinished",feedbacks.stream().filter(o->"finished".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
@ -172,40 +185,33 @@ public class IZtCountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//问题反馈 项目管理员看自己的 公司高层 产品看全部
|
||||||
public ZtStoryCountDTO storyCount(ZtCaseDTO dto) {
|
public ZtStoryCountDTO storyCount(ZtCaseDTO dto) {
|
||||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||||
|
|
||||||
UserType userType = loginRiskUser.getUserType();
|
UserType userType = loginRiskUser.getUserType();
|
||||||
ZtStoryCountDTO result = new ZtStoryCountDTO();
|
ZtStoryCountDTO result = new ZtStoryCountDTO();
|
||||||
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
if (loginRiskUser.getName().equals("admin")||userType == UserType.GSGC) {
|
if (loginRiskUser.getName().equals("admin")||userType == UserType.GSGC) {
|
||||||
List<Integer> integers = this.projectService.authProductList();
|
|
||||||
List<ZtStoryUser> list =null;
|
List<ZtStoryUser> list =null;
|
||||||
|
|
||||||
if(!loginRiskUser.getName().equals("admin")){
|
|
||||||
if(!CollectionUtils.isEmpty(integers)){
|
|
||||||
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getProduct,integers).in(ZtStoryUser::getStatus, "active", "reviewing"));
|
|
||||||
}else{
|
|
||||||
list=new ArrayList<>();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getStatus, "active", "reviewing"));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ZtStory> ztStory = null;
|
List<ZtStory> ztStory = null;
|
||||||
|
|
||||||
|
|
||||||
if(!loginRiskUser.getName().equals("admin")){
|
if(!loginRiskUser.getName().equals("admin")){
|
||||||
if(!CollectionUtils.isEmpty(integers)){
|
if(!CollectionUtils.isEmpty(pIds)){
|
||||||
|
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getProduct,pIds).in(ZtStoryUser::getStatus, "active", "reviewing"));
|
||||||
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||||
.lambda().eq(ZtStory::getDeleted, "0")
|
.lambda().eq(ZtStory::getDeleted, "0")
|
||||||
.in(ZtStory::getProduct,integers)
|
.in(ZtStory::getProduct,pIds)
|
||||||
.ne(ZtStory::getStatus, "closed")
|
.ne(ZtStory::getStatus, "closed")
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
|
list=new ArrayList<>();
|
||||||
ztStory=new ArrayList<>();
|
ztStory=new ArrayList<>();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getStatus, "active", "reviewing"));
|
||||||
|
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
ztStory=new ArrayList<>();
|
ztStory=new ArrayList<>();
|
||||||
}else{
|
}else{
|
||||||
@ -214,10 +220,10 @@ public class IZtCountService {
|
|||||||
.ne(ZtStory::getStatus, "closed")
|
.ne(ZtStory::getStatus, "closed")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ZtProduct> products = this.productService.list(new QueryWrapper<ZtProduct>().lambda().eq(ZtProduct::getStatus, "normal"));
|
|
||||||
|
List<ZtProduct> products = this.productService.list(new QueryWrapper<ZtProduct>().lambda().eq(ZtProduct::getStatus, "normal").in(ZtProduct::getId, pIds));
|
||||||
if(!CollectionUtils.isEmpty(products)){
|
if(!CollectionUtils.isEmpty(products)){
|
||||||
List<String> userStrList = products.stream().filter(o -> !StringUtils.isEmpty(o.getReviewer())).map(o->o.getReviewer()).collect(Collectors.toList());
|
List<String> userStrList = products.stream().filter(o -> !StringUtils.isEmpty(o.getReviewer())).map(o->o.getReviewer()).collect(Collectors.toList());
|
||||||
List<String> users=new ArrayList<>();
|
List<String> users=new ArrayList<>();
|
||||||
@ -262,8 +268,8 @@ public class IZtCountService {
|
|||||||
//延期需求改成延期任务
|
//延期需求改成延期任务
|
||||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
.notIn(ZtTask::getStatus,"pause","cancel","closed","done","reviewing")
|
||||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
.last(" and DATE(now()) > DATE(deadline) "));
|
||||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +283,7 @@ public class IZtCountService {
|
|||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
result.setDysCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setDysCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> o.getStage().equals("released")
|
.filter(o -> o.getStage().equals("released")
|
||||||
|| (o.getStage().equals("verified")&&o.getYsFlag()==2)
|
|
||||||
)
|
)
|
||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
@ -289,29 +295,21 @@ public class IZtCountService {
|
|||||||
.filter(o -> o.getYsFlag() == 1||o.getYsFlag() == 0)
|
.filter(o -> o.getYsFlag() == 1||o.getYsFlag() == 0)
|
||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>().lambda().ne(ZtStoryFeedback::getStatus, "closed"));
|
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>().lambda()
|
||||||
|
.in(ZtStoryFeedback::getProduct,pIds)
|
||||||
//问题反馈 未受理
|
.ne(ZtStoryFeedback::getStatus, "closed"));
|
||||||
result.setFeedbackWslCount(feedbacks.stream().filter(o->"wait".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理中的
|
|
||||||
result.setFeedbackClzCount(feedbacks.stream().filter(o->"doing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理完的
|
|
||||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//延期的
|
|
||||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
|
|
||||||
|
result= setFeedback(result,feedbacks);
|
||||||
} else if (userType == UserType.CP ) {
|
} else if (userType == UserType.CP ) {
|
||||||
|
|
||||||
List<Integer> integers = this.projectService.authList();
|
|
||||||
List<ZtProduct> list =null;
|
List<ZtProduct> list =null;
|
||||||
List<ZtStoryUser> storyUsers =null;
|
List<ZtStoryUser> storyUsers =null;
|
||||||
if(CollectionUtils.isEmpty(integers)){
|
if(CollectionUtils.isEmpty(pIds)){
|
||||||
list=new ArrayList<>();
|
list=new ArrayList<>();
|
||||||
storyUsers=new ArrayList<>();
|
storyUsers=new ArrayList<>();
|
||||||
}else{
|
}else{
|
||||||
list = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, integers));
|
list = this.productService.listByIds(pIds);
|
||||||
storyUsers = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
storyUsers =CollectionUtils.isEmpty(list)?new ArrayList<>(): this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
||||||
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
||||||
.in(ZtStoryUser::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList()))
|
.in(ZtStoryUser::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList()))
|
||||||
// .eq(ZtStoryUser::getAssignedto,loginRiskUser.getName())
|
// .eq(ZtStoryUser::getAssignedto,loginRiskUser.getName())
|
||||||
@ -344,8 +342,8 @@ public class IZtCountService {
|
|||||||
//延期需求改成延期任务 TODO
|
//延期需求改成延期任务 TODO
|
||||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
.notIn(ZtTask::getStatus,"pause","cancel","closed","done","reviewing")
|
||||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
.last(" and DATE(now()) > DATE(deadline) "));
|
||||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -382,27 +380,18 @@ public class IZtCountService {
|
|||||||
|
|
||||||
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>()
|
List<ZtStoryFeedback> feedbacks = this.storyFeedbackService.list(new QueryWrapper<ZtStoryFeedback>()
|
||||||
.lambda().ne(ZtStoryFeedback::getStatus, "closed")
|
.lambda().ne(ZtStoryFeedback::getStatus, "closed")
|
||||||
|
.in(ZtStoryFeedback::getProduct,pIds)
|
||||||
.eq(ZtStoryFeedback::getAssignedTo,loginRiskUser.getName()).or().eq(ZtStoryFeedback::getOpenedBy,loginRiskUser.getName())
|
.eq(ZtStoryFeedback::getAssignedTo,loginRiskUser.getName()).or().eq(ZtStoryFeedback::getOpenedBy,loginRiskUser.getName())
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//问题反馈 未受理
|
result= setFeedback(result,feedbacks);
|
||||||
result.setFeedbackWslCount(feedbacks.stream().filter(o->"wait".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理中的
|
|
||||||
result.setFeedbackClzCount(feedbacks.stream().filter(o->"doing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理完的
|
|
||||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//延期的
|
|
||||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime())
|
|
||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
|
|
||||||
} else if (userType == UserType.XMGLY) {
|
} else if (userType == UserType.XMGLY) {
|
||||||
|
|
||||||
|
|
||||||
List<Integer> integers = this.projectService.authList();
|
|
||||||
|
|
||||||
List<ZtProduct> pList = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, integers));
|
List<ZtProduct> pList = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, pIds));
|
||||||
|
|
||||||
List<ZtStoryUser> storyUsers = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
List<ZtStoryUser> storyUsers = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
||||||
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
||||||
@ -419,17 +408,9 @@ public class IZtCountService {
|
|||||||
// .or()
|
// .or()
|
||||||
// .in()
|
// .in()
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(integers)){
|
if(!CollectionUtils.isEmpty(pIds)){
|
||||||
//所有的产品
|
//所有的产品
|
||||||
if(!CollectionUtils.isEmpty(pList)){
|
eq.in(ZtStory::getProduct,pIds);
|
||||||
eq.in(ZtStory::getProduct,pList.stream().map(o->o.getId()).collect(Collectors.toList()));
|
|
||||||
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda()
|
|
||||||
.in(ZtProjectproduct::getProduct, pList.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
|
||||||
eq.or().in(ZtStory::getProject,list.stream().map(o->o.getProject()).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
ztStory=this.storyService.list(eq);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setDpsCount(storyUsers.stream().filter(o -> "reviewing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.setDpsCount(storyUsers.stream().filter(o -> "reviewing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
@ -441,10 +422,10 @@ public class IZtCountService {
|
|||||||
.filter(o -> o.getStage().equals("wait")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> o.getStage().equals("wait")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> o.getStage().equals("testing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> Arrays.asList("testing","tested").contains(o.getStage())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> o.getStage().equals("developing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> Arrays.asList("developing","developed").contains(o.getStage()) ) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> !o.getStage().equals("verified") && !o.getStage().equals("verified"))
|
.filter(o -> !o.getStage().equals("verified") && !o.getStage().equals("verified"))
|
||||||
.filter(o -> o.getPlanEndDate() != null && o.getPlanEndDate().getTime() < new Date().getTime())
|
.filter(o -> o.getPlanEndDate() != null && o.getPlanEndDate().getTime() < new Date().getTime())
|
||||||
@ -467,8 +448,9 @@ public class IZtCountService {
|
|||||||
}else{
|
}else{
|
||||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
.notIn(ZtTask::getStatus,"pause","cancel","closed","done","reviewing")
|
||||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
.last(" and DATE(now()) > DATE(deadline) "));
|
||||||
|
// .last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
||||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,6 +458,10 @@ public class IZtCountService {
|
|||||||
.filter(o -> o.getStage().equals("verified"))
|
.filter(o -> o.getStage().equals("verified"))
|
||||||
.filter(o -> o.getYsFlag() == 1)
|
.filter(o -> o.getYsFlag() == 1)
|
||||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
|
.filter(o -> o.getStage().equals("verified"))
|
||||||
|
.filter(o -> o.getYsFlag() == 2)
|
||||||
|
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
List<ZtBug> active = bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getStatus, "active"));
|
List<ZtBug> active = bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getStatus, "active"));
|
||||||
|
|
||||||
result.setBugCount(active.stream(). map(o->o.getId()+"").collect(Collectors.joining(",")));
|
result.setBugCount(active.stream(). map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
@ -486,17 +472,7 @@ public class IZtCountService {
|
|||||||
.in(ZtStoryFeedback::getProduct,pList.stream().map(o->o.getId()).collect(Collectors.toList()))
|
.in(ZtStoryFeedback::getProduct,pList.stream().map(o->o.getId()).collect(Collectors.toList()))
|
||||||
|
|
||||||
);
|
);
|
||||||
|
result= setFeedback(result,feedbacks);
|
||||||
//问题反馈 未受理
|
|
||||||
result.setFeedbackWslCount(feedbacks.stream().filter(o->"wait".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理中的
|
|
||||||
result.setFeedbackClzCount(feedbacks.stream().filter(o->"doing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//处理完的
|
|
||||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
//延期的
|
|
||||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
|
|
||||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -508,6 +484,21 @@ public class IZtCountService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ZtStoryCountDTO setFeedback(ZtStoryCountDTO result,List<ZtStoryFeedback> feedbacks) {
|
||||||
|
|
||||||
|
|
||||||
|
//问题反馈 未受理
|
||||||
|
result.setFeedbackWslCount(feedbacks.stream().filter(o->"wait".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
//处理中的 wait doing finished submitVerified 提交验收 closed reviewing verified 验收 dontHand 无需处理
|
||||||
|
result.setFeedbackClzCount(feedbacks.stream().filter(o->Arrays.asList("doing","finished","submitVerified").contains(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
//处理完的
|
||||||
|
result.setFeedbackClwCount(feedbacks.stream().filter(o->Arrays.asList("verified").contains(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
//延期的
|
||||||
|
result.setFeedbackYqCount(feedbacks.stream().filter(o->Arrays.asList("doing","wait").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZtExecutionprojectService executionprojectService;
|
private IZtExecutionprojectService executionprojectService;
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ public class ZtActionServiceImpl extends ServiceImpl<ZtActionMapper, ZtAction> i
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IZtStoryService storyService;
|
private IZtStoryService storyService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IZtStoryFeedbackService storyFeedbackService;
|
||||||
|
@Autowired
|
||||||
private IZtTaskService taskService;
|
private IZtTaskService taskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZtBugService bugService;
|
private IZtBugService bugService;
|
||||||
@ -148,12 +150,18 @@ public class ZtActionServiceImpl extends ServiceImpl<ZtActionMapper, ZtAction> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ActionType.WTFK.getValue().equals(t.getObjecttype())){
|
||||||
|
ZtStoryFeedback storyFeedback = storyFeedbackService.getById(t.getObjectid());
|
||||||
|
if(storyFeedback!=null){
|
||||||
|
s.setActionValue("问题反馈:"+storyFeedback.getSpec()+"-"+s.getActionValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(ActionType.FB.getValue().equals(t.getObjecttype())){
|
if(ActionType.FB.getValue().equals(t.getObjecttype())){
|
||||||
ZtRelease release = releaseService.getById(t.getObjectid());
|
ZtRelease release = releaseService.getById(t.getObjectid());
|
||||||
if(release!=null){
|
if(release!=null){
|
||||||
s.setActionValue("发布:"+release.getName()+"-"+s.getActionValue());
|
s.setActionValue("发布:"+release.getName()+"-"+s.getActionValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ActionType.RW.getValue().equals(t.getObjecttype())){
|
if(ActionType.RW.getValue().equals(t.getObjecttype())){
|
||||||
|
@ -22,6 +22,7 @@ import com.sa.zentao.qo.ZtProjectQo;
|
|||||||
import com.sa.zentao.service.*;
|
import com.sa.zentao.service.*;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.sa.zentao.utils.BeanCopyUtil;
|
import com.sa.zentao.utils.BeanCopyUtil;
|
||||||
|
import com.sa.zentao.utils.DateUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -86,9 +87,35 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<ZtBugDTO> bugPageList(ZtProjectQo qo) {
|
public PageInfo<ZtBugDTO> bugPageList(ZtProjectQo qo) {
|
||||||
|
|
||||||
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
|
|
||||||
Page<ZtBugDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtBugDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
qo.setUserName(RiskUserThreadLocal.get().getName());
|
qo.setUserName(RiskUserThreadLocal.get().getName());
|
||||||
List<ZtBugDTO> result = this.baseMapper.bugPageList(qo);
|
|
||||||
|
List<ZtBugDTO> result =null;
|
||||||
|
if(StringUtils.isEmpty(qo.getSource())){
|
||||||
|
|
||||||
|
if(CollectionUtils.isEmpty(pIds)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(qo.getIds())) {
|
||||||
|
String[] split = qo.getIds().split(",");
|
||||||
|
qo.setObjIds(new ArrayList<>(Arrays.asList(split)));
|
||||||
|
}else{
|
||||||
|
qo.setProductIds(pIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = this.baseMapper.bugPageList(qo);
|
||||||
|
}else if("execution".equals(qo.getSource())){
|
||||||
|
qo.setExecution(qo.getProject().toString());
|
||||||
|
qo.setProject(null);
|
||||||
|
result = this.baseMapper.bugPageList(qo);
|
||||||
|
}else if("project".equals(qo.getSource())){
|
||||||
|
result = this.baseMapper.bugPageList(qo);
|
||||||
|
}
|
||||||
|
long total = page.getTotal();
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(result)){
|
if(!CollectionUtils.isEmpty(result)){
|
||||||
List<String> fIds = result.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
|
List<String> fIds = result.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
|
||||||
fIds.addAll(result.stream().map(o->o.getAssignedTo()).collect(Collectors.toList()));
|
fIds.addAll(result.stream().map(o->o.getAssignedTo()).collect(Collectors.toList()));
|
||||||
@ -112,7 +139,9 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new PageInfo<ZtBugDTO>(result);
|
PageInfo<ZtBugDTO> ztBugDTOPageInfo = new PageInfo<>(result);
|
||||||
|
ztBugDTOPageInfo.setTotal(total);
|
||||||
|
return ztBugDTOPageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -225,21 +254,52 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
if(tostory!=null&&tostory!=0){
|
if(tostory!=null&&tostory!=0){
|
||||||
d.setZtStory(this.storyService.getById(tostory));
|
d.setZtStory(this.storyService.getById(tostory));
|
||||||
}
|
}
|
||||||
|
Integer productId = ztBug.getProduct();
|
||||||
|
if(productId!=null&&productId!=0){
|
||||||
|
ZtProduct product = this.productService.getById(productId);
|
||||||
|
d.setProductName(product==null?null:product.getName());
|
||||||
|
}
|
||||||
|
String lasteditedby = d.getLasteditedby();
|
||||||
|
|
||||||
|
String closedby = d.getClosedby();
|
||||||
|
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||||
if(ztUser!=null){
|
|
||||||
d.setAssignedToName(ztUser.getNickname());
|
|
||||||
}
|
|
||||||
ztUser = userMap.get(d.getOpenedby());
|
ztUser = userMap.get(d.getOpenedby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
d.setOpenedbyName(ztUser.getNickname());
|
d.setOpenedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(d.getYsUser());
|
ztUser = userMap.get(d.getAssignedTo());
|
||||||
|
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setAssignedToName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
ztUser = userMap.get(d.getResolvedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setResolvedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getYsUser());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
d.setYsUserName(ztUser.getNickname());
|
d.setYsUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
ztUser = userMap.get(d.getLasteditedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setLasteditedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getClosedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getLasteditedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setLasteditedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d.getDeadline() != null) {
|
||||||
|
d.setDeadline(DateUtils.getDayLast(d.getDeadline()));
|
||||||
|
}
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +315,7 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
|
|
||||||
if(!ztBug.getOpenedby().equals(loginRiskUser.getName())){
|
if(!ztBug.getOpenedby().equals(loginRiskUser.getName())){
|
||||||
if(!ztBug.getAssignedTo().equals(loginRiskUser.getName())){
|
if(!ztBug.getAssignedTo().equals(loginRiskUser.getName())){
|
||||||
if(loginRiskUser.getUserType()!=UserType.XMGLY||loginRiskUser.getUserType()!=UserType.GSGC){
|
if(loginRiskUser.getUserType()!=UserType.XMGLY&&loginRiskUser.getUserType()!=UserType.GSGC){
|
||||||
throw new BusinessException("当前无法指派请联系管理员");
|
throw new BusinessException("当前无法指派请联系管理员");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,11 +329,12 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
|
|
||||||
|
|
||||||
ztBug.setAssignedTo(qo.getAssignedTo());
|
ztBug.setAssignedTo(qo.getAssignedTo());
|
||||||
|
ztBug.setAssigneddate(new Date());
|
||||||
ztBug.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztBug.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
ztBug.setLastediteddate(new Date());
|
ztBug.setLastediteddate(new Date());
|
||||||
this.baseMapper.updateById(ztBug);
|
this.baseMapper.updateById(ztBug);
|
||||||
this.actionService.addAction(ActionType.BUG, ActionStatus.FP,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
this.actionService.addAction(ActionType.BUG, ActionStatus.FP,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
||||||
,RiskUserThreadLocal.get().getName(),ztBug.getSteps(),""
|
,RiskUserThreadLocal.get().getName(),null,qo.getAssignedTo()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,6 +505,11 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
return ztBugDTOS;
|
return ztBugDTOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZtBugDTO getBugById(Integer id) {
|
||||||
|
return this.bugInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -544,6 +610,8 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
if("closed".equalsIgnoreCase(qo.getStatus())){
|
if("closed".equalsIgnoreCase(qo.getStatus())){
|
||||||
//
|
//
|
||||||
ztBug.setStatus("closed");
|
ztBug.setStatus("closed");
|
||||||
|
ztBug.setClosedby(RiskUserThreadLocal.get().getName());
|
||||||
|
ztBug.setCloseddate(new Date());
|
||||||
this.actionService.addAction(ActionType.BUG, ActionStatus.GB,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
this.actionService.addAction(ActionType.BUG, ActionStatus.GB,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
||||||
,RiskUserThreadLocal.get().getName(),qo.getDesc(),""
|
,RiskUserThreadLocal.get().getName(),qo.getDesc(),""
|
||||||
);
|
);
|
||||||
@ -577,6 +645,9 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
|||||||
ztBug.setResolution(dto.getResolution());
|
ztBug.setResolution(dto.getResolution());
|
||||||
ztBug.setResolveddate(new Date());
|
ztBug.setResolveddate(new Date());
|
||||||
ztBug.setAssignedTo(dto.getAssignedTo());
|
ztBug.setAssignedTo(dto.getAssignedTo());
|
||||||
|
ztBug.setAssigneddate(new Date());
|
||||||
|
ztBug.setLastediteddate(ztBug.getResolveddate());
|
||||||
|
ztBug.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
this.baseMapper.updateById(ztBug);
|
this.baseMapper.updateById(ztBug);
|
||||||
if(ztBug.getExecution()!=null&&ztBug.getExecution()!=0) {
|
if(ztBug.getExecution()!=null&&ztBug.getExecution()!=0) {
|
||||||
kanbanlaneService.changeStatus(ztBug.getExecution(), ztBug.getId(), "bug", "fixed");
|
kanbanlaneService.changeStatus(ztBug.getExecution(), ztBug.getId(), "bug", "fixed");
|
||||||
|
@ -87,6 +87,9 @@ public class ZtEffortServiceImpl extends ServiceImpl<ZtEffortMapper, ZtEffort> i
|
|||||||
}
|
}
|
||||||
//剩余
|
//剩余
|
||||||
ztTask.setLeft(max.getLeft());
|
ztTask.setLeft(max.getLeft());
|
||||||
|
if(ztTask.getLeft()<0){
|
||||||
|
ztTask.setLeft(0f);
|
||||||
|
}
|
||||||
ztTask.setConsumed(ztTask.getConsumed()+f);
|
ztTask.setConsumed(ztTask.getConsumed()+f);
|
||||||
this.saveBatch(saveList);
|
this.saveBatch(saveList);
|
||||||
taskService.updateById(ztTask);
|
taskService.updateById(ztTask);
|
||||||
|
@ -2,10 +2,7 @@ package com.sa.zentao.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||||
import com.sa.zentao.dao.Result;
|
import com.sa.zentao.dao.*;
|
||||||
import com.sa.zentao.dao.ZtKanbancolumnDTO;
|
|
||||||
import com.sa.zentao.dao.ZtKanbanlaneDTO;
|
|
||||||
import com.sa.zentao.dao.ZtStoryDTO;
|
|
||||||
import com.sa.zentao.entity.*;
|
import com.sa.zentao.entity.*;
|
||||||
import com.sa.zentao.enums.ActionStatus;
|
import com.sa.zentao.enums.ActionStatus;
|
||||||
import com.sa.zentao.enums.ActionType;
|
import com.sa.zentao.enums.ActionType;
|
||||||
@ -113,7 +110,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
st.setExecutions(ztProjects.stream().map(o->o.getId()).collect(Collectors.toList()));
|
st.setExecutions(ztProjects.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setAssignedTo(ztUser.getNickname());
|
st.setAssignedToName(ztUser.getNickname());
|
||||||
st.setColor(ztUser.getColor());
|
st.setColor(ztUser.getColor());
|
||||||
}
|
}
|
||||||
List<ZtStoryspec> storyspecs = storySpecList.stream().filter(o -> o.getStory().intValue() == st.getId().intValue()).collect(Collectors.toList());
|
List<ZtStoryspec> storyspecs = storySpecList.stream().filter(o -> o.getStory().intValue() == st.getId().intValue()).collect(Collectors.toList());
|
||||||
@ -131,49 +128,54 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
d.setList(ztStoryDTOS);
|
d.setList(ztStoryDTOS);
|
||||||
}else if("bug".equalsIgnoreCase(d.getCardType())){
|
}else if("bug".equalsIgnoreCase(d.getCardType())){
|
||||||
List<ZtBug> ztBugs = bugService.listByIds(ids);
|
List<ZtBug> ztBugs = bugService.listByIds(ids);
|
||||||
|
List<ZtBugDTO> ztBugDTOS =new ArrayList<>();
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(ztBugs)){
|
if(!CollectionUtils.isEmpty(ztBugs)){
|
||||||
for (ZtBug st:ztBugs) {
|
ztBugDTOS=BeanCopyUtil.copyListProperties(ztBugs, ZtBugDTO::new);
|
||||||
|
for (ZtBugDTO st:ztBugDTOS) {
|
||||||
|
|
||||||
ZtUser ztUser = userMap.get(st.getAssignedTo());
|
ZtUser ztUser = userMap.get(st.getAssignedTo());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setColor(ztUser.getColor());
|
st.setColor(ztUser.getColor());
|
||||||
st.setAssignedTo(ztUser.getNickname());
|
st.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.setList(ztBugs);
|
d.setList(ztBugDTOS);
|
||||||
}else if("task".equalsIgnoreCase(d.getCardType())){
|
}else if("task".equalsIgnoreCase(d.getCardType())){
|
||||||
List<ZtTask> ztTasks = taskService.listByIds(ids);
|
List<ZtTask> ztTasks = taskService.listByIds(ids);
|
||||||
|
List<ZtTaskDTO> ztTaskDTOS =new ArrayList<>();
|
||||||
if(!CollectionUtils.isEmpty(ztTasks)){
|
if(!CollectionUtils.isEmpty(ztTasks)){
|
||||||
for (ZtTask st:ztTasks) {
|
ztTaskDTOS=BeanCopyUtil.copyListProperties(ztTasks,ZtTaskDTO::new);
|
||||||
|
for (ZtTaskDTO st:ztTaskDTOS) {
|
||||||
ZtUser ztUser = userMap.get(st.getAssignedTo());
|
ZtUser ztUser = userMap.get(st.getAssignedTo());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setColor(ztUser.getColor());
|
st.setColor(ztUser.getColor());
|
||||||
st.setAssignedTo(ztUser.getNickname());
|
st.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
if(st.getDeadline()!=null){
|
if(st.getDeadline()!=null){
|
||||||
st.setDeadline(DateUtils.getDayLast(st.getDeadline()));
|
st.setDeadline(DateUtils.getDayLast(st.getDeadline()));
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(st.getOpenedby());
|
ztUser = userMap.get(st.getOpenedby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setOpenedby(ztUser.getNickname());
|
st.setOpenedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(st.getFinishedby());
|
ztUser = userMap.get(st.getFinishedby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setFinishedby(ztUser.getNickname());
|
st.setFinishedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(st.getCanceledby());
|
ztUser = userMap.get(st.getCanceledby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setCanceledby(ztUser.getNickname());
|
st.setCanceledbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(st.getClosedby());
|
ztUser = userMap.get(st.getClosedby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
st.setClosedby(ztUser.getNickname());
|
st.setClosedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.setList(ztTasks);
|
d.setList(ztTaskDTOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,6 +550,21 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object searchObj(ZtAllBusinessDTO dto) {
|
||||||
|
Object result =null;
|
||||||
|
if("task".equals(dto.getSearchType())){
|
||||||
|
result=this.taskService.getById(dto.getSearchId());
|
||||||
|
}else if("story".equals(dto.getSearchType())){
|
||||||
|
result=this.storyService.getById(dto.getSearchId());
|
||||||
|
}else if("userStory".equals(dto.getSearchType())){
|
||||||
|
result=this.storyUserService.getById(dto.getSearchId());
|
||||||
|
}else if("bug".equals(dto.getSearchType())){
|
||||||
|
result=this.bugService.getById(dto.getSearchId());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private Map<Integer, List<ZtProductDTO>> getChildrenMap(List<ZtProjectDTO> result) {
|
private Map<Integer, List<ZtProductDTO>> getChildrenMap(List<ZtProjectDTO> result) {
|
||||||
|
|
||||||
List<ZtProduct> ztProjects = this.baseMapper.selectList(
|
List<ZtProduct> ztProjects = this.baseMapper.selectList(
|
||||||
|
@ -864,6 +864,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
this.kanbanlaneService.addStory(excludeId, storyService.listByIds(storyIds));
|
this.kanbanlaneService.addStory(excludeId, storyService.listByIds(storyIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> authProductList() {
|
public List<Integer> authProductList() {
|
||||||
List<Integer> authList = authList();
|
List<Integer> authList = authList();
|
||||||
@ -877,7 +879,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
return list.stream().map(o -> o.getId()).collect(Collectors.toList());
|
return list.stream().map(o -> o.getId()).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<Integer> allAuthList() {
|
||||||
|
return this.baseMapper.selectList(new QueryWrapper<ZtProject>()
|
||||||
|
.lambda().eq(ZtProject::getType, "program")).stream().map(o -> o.getId()).collect(Collectors.toList());
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> authList() {
|
public List<Integer> authList() {
|
||||||
ZtUser user = userService.selectByName(RiskUserThreadLocal.get().getName());
|
ZtUser user = userService.selectByName(RiskUserThreadLocal.get().getName());
|
||||||
@ -1003,6 +1009,55 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
}
|
}
|
||||||
return execution.stream().map(o -> o.getAccount()).collect(Collectors.toList());
|
return execution.stream().map(o -> o.getAccount()).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ZtProject> executionListNoClosedByProduct(ZtProjectQo qo) {
|
||||||
|
|
||||||
|
Integer productId = qo.getProductId();
|
||||||
|
Integer project = qo.getProject();
|
||||||
|
|
||||||
|
|
||||||
|
if(project!=null&&project!=0){
|
||||||
|
List<ZtExecutionproject> list = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getProject, project));
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
return this.listByIds(list.stream().map(o->o.getExecution()).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(productId!=null&&productId!=0){
|
||||||
|
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
||||||
|
.lambda().eq(ZtProjectproduct::getProduct, productId));
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
List<ZtExecutionproject> eList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().
|
||||||
|
in(ZtExecutionproject::getProject, list.stream().map(o->o.getProject()).collect(Collectors.toList())));
|
||||||
|
if(!CollectionUtils.isEmpty(eList)){
|
||||||
|
return this.list(new QueryWrapper<ZtProject>().lambda().in(ZtProject::getId,eList.stream().map(o->o.getExecution()).collect(Collectors.toList()))
|
||||||
|
.ne(ZtProject::getStatus,"closed").ne(ZtProject::getDeleted,"1")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZtProjectDTO getProjectById(ZtProjectDTO dto) {
|
||||||
|
ZtProject project = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(project==null){
|
||||||
|
throw new BusinessException("未查询到数据");
|
||||||
|
}
|
||||||
|
ZtProjectDTO d=new ZtProjectDTO();
|
||||||
|
BeanUtils.copyProperties(project,d);
|
||||||
|
|
||||||
|
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, dto.getId()));
|
||||||
|
|
||||||
|
d.setProduct(list.get(0).getProduct());
|
||||||
|
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void projectTeamUpdate(ZtProjectQo qo) {
|
public void projectTeamUpdate(ZtProjectQo qo) {
|
||||||
List<String> teamList = qo.getTeamList();
|
List<String> teamList = qo.getTeamList();
|
||||||
|
@ -137,8 +137,13 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
} else {
|
} else {
|
||||||
ztStoryFeedback.setStatus("wait");
|
ztStoryFeedback.setStatus("wait");
|
||||||
}
|
}
|
||||||
|
|
||||||
ztStoryFeedback.setFileUrl(dto.getUrls());
|
ztStoryFeedback.setFileUrl(dto.getUrls());
|
||||||
this.baseMapper.insert(ztStoryFeedback);
|
this.baseMapper.insert(ztStoryFeedback);
|
||||||
|
|
||||||
|
|
||||||
|
fileService.updateFile(dto.getFiles(),ztStoryFeedback.getId(), FileTypes.feedbackStory);
|
||||||
|
|
||||||
if (!org.apache.commons.lang3.StringUtils.isEmpty(dto.getUrls())) {
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(dto.getUrls())) {
|
||||||
JSONArray array = JSONArray.parseArray(dto.getUrls());
|
JSONArray array = JSONArray.parseArray(dto.getUrls());
|
||||||
if (array.size() > 0) {
|
if (array.size() > 0) {
|
||||||
@ -153,7 +158,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actionService.addAction(ActionType.WTFK, ActionStatus.XJ, dto.getId(), dto.getProduct() + "", null, null,
|
actionService.addAction(ActionType.WTFK, ActionStatus.XJ, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get() == null ? "admin" : RiskUserThreadLocal.get().getName(), "", "");
|
RiskUserThreadLocal.get() == null ? "admin" : RiskUserThreadLocal.get().getName(), "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,17 +256,14 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
@Override
|
@Override
|
||||||
public List<ZtStoryFeedbackDTO> ztStoryFeedbackDTO(ZtProjectQo qo) {
|
public List<ZtStoryFeedbackDTO> ztStoryFeedbackDTO(ZtProjectQo qo) {
|
||||||
|
|
||||||
List<Integer> authList = this.projectService.authList();
|
List<Integer> pList = this.projectService.authProductList();
|
||||||
if (CollectionUtils.isEmpty(authList)) {
|
if (CollectionUtils.isEmpty(pList)) {
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
List<ZtProduct> list = productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, authList));
|
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda()
|
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda()
|
||||||
.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
.and(o->o.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||||
.or().eq(ZtStoryFeedback::getOpenedBy, RiskUserThreadLocal.get().getName());
|
.or().eq(ZtStoryFeedback::getOpenedBy, RiskUserThreadLocal.get().getName()));
|
||||||
|
|
||||||
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSearchValue())) {
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSearchValue())) {
|
||||||
if ("ALL".equals(qo.getSearchValue())) {
|
if ("ALL".equals(qo.getSearchValue())) {
|
||||||
query.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName());
|
query.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName());
|
||||||
@ -283,10 +285,10 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
query.ne(ZtStoryFeedback::getStatus, "closed");
|
query.ne(ZtStoryFeedback::getStatus, "closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UserType.GSGC == RiskUserThreadLocal.get().getUserType() || "admin".equals(RiskUserThreadLocal.get().getName())) {
|
if ( "admin".equals(RiskUserThreadLocal.get().getName())) {
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
query.in(ZtStoryFeedback::getProduct, list.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
query.in(ZtStoryFeedback::getProduct, pList);
|
||||||
}
|
}
|
||||||
query.orderByDesc(ZtStoryFeedback::getId);
|
query.orderByDesc(ZtStoryFeedback::getId);
|
||||||
List<ZtStoryFeedback> closed = this.baseMapper.selectList(
|
List<ZtStoryFeedback> closed = this.baseMapper.selectList(
|
||||||
@ -303,6 +305,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
|
|
||||||
|
|
||||||
List<Integer> authList = this.projectService.authList();
|
List<Integer> authList = this.projectService.authList();
|
||||||
|
if (RiskUserThreadLocal.get().getUserType()==UserType.GSGC) {
|
||||||
|
authList = this.projectService.allAuthList();
|
||||||
|
}
|
||||||
if (CollectionUtils.isEmpty(authList)) {
|
if (CollectionUtils.isEmpty(authList)) {
|
||||||
return new PageInfo<ZtStoryFeedbackDTO>();
|
return new PageInfo<ZtStoryFeedbackDTO>();
|
||||||
}
|
}
|
||||||
@ -312,7 +317,39 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
Page<ZtStoryDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtStoryDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
|
List<ZtStoryFeedback> listFeedback = this.myPageList(qo,list);
|
||||||
|
long total = page.getTotal();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<ZtStoryFeedbackDTO> ztStoryFeedbackDTOS = BeanCopyUtil.copyListProperties(listFeedback, ZtStoryFeedbackDTO::new);
|
||||||
|
if (!CollectionUtils.isEmpty(ztStoryFeedbackDTOS)) {
|
||||||
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
Map<Integer, ZtProduct> pMap = this.productService.selectMapProduct();
|
||||||
|
for (ZtStoryFeedbackDTO f : ztStoryFeedbackDTOS) {
|
||||||
|
ZtProduct ztProduct = pMap.get(f.getProduct());
|
||||||
|
if (ztProduct != null) {
|
||||||
|
f.setProductName(ztProduct.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
ZtUser ztUser = userMap.get(f.getOpenedBy());
|
||||||
|
if (ztUser != null) {
|
||||||
|
f.setOpenedByName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(f.getAssignedTo());
|
||||||
|
if (ztUser != null) {
|
||||||
|
f.setAssignedToName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PageInfo<ZtStoryFeedbackDTO> pageResult = new PageInfo<>(ztStoryFeedbackDTOS);
|
||||||
|
pageResult.setTotal(total);
|
||||||
|
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ZtStoryFeedback> myPageList(ZtProjectQo qo,List<ZtProduct> list) {
|
||||||
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda();
|
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda();
|
||||||
// .and(w->{
|
// .and(w->{
|
||||||
// w.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
// w.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||||
@ -359,10 +396,26 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
query.in(ZtStoryFeedback::getProduct, products.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
query.in(ZtStoryFeedback::getProduct, products.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
if (qo.getStartDate() != null) {
|
if (qo.getStartDate() != null) {
|
||||||
query.gt(ZtStoryFeedback::getOpenedDate, qo.getStartDate());
|
query.ge(ZtStoryFeedback::getOpenedDate, qo.getStartDate());
|
||||||
}
|
}
|
||||||
if (qo.getEndDate() != null) {
|
if (qo.getEndDate() != null) {
|
||||||
query.lt(ZtStoryFeedback::getOpenedDate, qo.getEndDate());
|
query.le(ZtStoryFeedback::getOpenedDate, qo.getEndDate());
|
||||||
|
}
|
||||||
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getType())) {
|
||||||
|
query.eq(ZtStoryFeedback::getType, qo.getType());
|
||||||
|
}
|
||||||
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSpec())) {
|
||||||
|
query.eq(ZtStoryFeedback::getSpec, qo.getSpec());
|
||||||
|
}
|
||||||
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getStatus())) {
|
||||||
|
query.eq(ZtStoryFeedback::getStatus, qo.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getOpenedby())) {
|
||||||
|
query.eq(ZtStoryFeedback::getOpenedBy, qo.getOpenedby());
|
||||||
|
}
|
||||||
|
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSource())) {
|
||||||
|
query.eq(ZtStoryFeedback::getSource, qo.getSource());
|
||||||
}
|
}
|
||||||
query.orderByDesc(ZtStoryFeedback::getId);
|
query.orderByDesc(ZtStoryFeedback::getId);
|
||||||
|
|
||||||
@ -370,44 +423,20 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
List<ZtStoryFeedback> listFeedback = this.baseMapper.selectList(
|
List<ZtStoryFeedback> listFeedback = this.baseMapper.selectList(
|
||||||
query
|
query
|
||||||
);
|
);
|
||||||
|
return listFeedback;
|
||||||
|
|
||||||
List<ZtStoryFeedbackDTO> ztStoryFeedbackDTOS = BeanCopyUtil.copyListProperties(listFeedback, ZtStoryFeedbackDTO::new);
|
|
||||||
if (!CollectionUtils.isEmpty(ztStoryFeedbackDTOS)) {
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
|
||||||
Map<Integer, ZtProduct> pMap = this.productService.selectMapProduct();
|
|
||||||
for (ZtStoryFeedbackDTO f : ztStoryFeedbackDTOS) {
|
|
||||||
ZtProduct ztProduct = pMap.get(f.getProduct());
|
|
||||||
if (ztProduct != null) {
|
|
||||||
f.setProductName(ztProduct.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
ZtUser ztUser = userMap.get(f.getOpenedBy());
|
|
||||||
if (ztUser != null) {
|
|
||||||
f.setOpenedByName(ztUser.getNickname());
|
|
||||||
}
|
|
||||||
ztUser = userMap.get(f.getAssignedTo());
|
|
||||||
if (ztUser != null) {
|
|
||||||
f.setAssignedToName(ztUser.getNickname());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new PageInfo<>(ztStoryFeedbackDTOS);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closedFeedback(ZtStoryFeedbackDTO dto) {
|
public void closedFeedback(ZtStoryFeedbackDTO dto) {
|
||||||
// ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
||||||
// if(ztStoryFeedback==null){
|
if(ztStoryFeedback==null){
|
||||||
// throw new BusinessException("未查询到数据");
|
throw new BusinessException("未查询到数据");
|
||||||
// }
|
}
|
||||||
// ztStoryFeedback.setStatus("closed");
|
ztStoryFeedback.setStatus("closed");
|
||||||
// ztStoryFeedback.setCloseRemark(dto.getCloseRemark());
|
ztStoryFeedback.setCloseRemark(dto.getCloseRemark());
|
||||||
// ztStoryFeedback.setCloseDate(new Date());
|
ztStoryFeedback.setCloseDate(new Date());
|
||||||
// ztStoryFeedback.setClosedBy(RiskUserThreadLocal.get().getName());
|
ztStoryFeedback.setClosedBy(RiskUserThreadLocal.get().getName());
|
||||||
// this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,6 +483,10 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
if ("wait".equals(status)) {
|
if ("wait".equals(status)) {
|
||||||
ztStoryFeedback.setStatus("doing");
|
ztStoryFeedback.setStatus("doing");
|
||||||
this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
|
//添加action
|
||||||
|
actionService.addAction(ActionType.WTFK, ActionStatus.KSCL, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(), null, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -468,7 +501,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
if (ztStoryFeedback == null) {
|
if (ztStoryFeedback == null) {
|
||||||
throw new BusinessException("未查询到问题反馈");
|
throw new BusinessException("未查询到问题反馈");
|
||||||
}
|
}
|
||||||
|
if (Arrays.asList("closed", "finished", "submitVerified", "verified").contains(ztStoryFeedback.getStatus())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<ZtStory> list = this.storyService.list(new QueryWrapper<ZtStory>().lambda().eq(ZtStory::getFeedback, feedbackId));
|
List<ZtStory> list = this.storyService.list(new QueryWrapper<ZtStory>().lambda().eq(ZtStory::getFeedback, feedbackId));
|
||||||
|
|
||||||
@ -497,6 +532,10 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}
|
}
|
||||||
ztStoryFeedback.setStatus("finished");
|
ztStoryFeedback.setStatus("finished");
|
||||||
this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
|
//添加action
|
||||||
|
actionService.addAction(ActionType.WTFK, ActionStatus.CLWC, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(), null, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -554,6 +593,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}
|
}
|
||||||
ztStoryFeedback.setStatus("verified");
|
ztStoryFeedback.setStatus("verified");
|
||||||
this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
|
//添加action
|
||||||
|
actionService.addAction(ActionType.WTFK, ActionStatus.YSTG, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(), null, RiskUserThreadLocal.get().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -603,7 +645,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
ztStoryFeedback.setUpdateDate(new Date());
|
ztStoryFeedback.setUpdateDate(new Date());
|
||||||
ztStoryFeedback.setUpdateUser(RiskUserThreadLocal.get().getName());
|
ztStoryFeedback.setUpdateUser(RiskUserThreadLocal.get().getName());
|
||||||
this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
|
//添加action
|
||||||
|
actionService.addAction(ActionType.WTFK, ActionStatus.WXCL, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(), "处理结果: "+ dto.getDontHandSelect() +" 处理描述"+dto.getDontHandRemark() , null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -671,9 +715,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
if(!CollectionUtils.isEmpty(storyList)){
|
if(!CollectionUtils.isEmpty(storyList)){
|
||||||
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(storyList, ZtStoryDTO::new);
|
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(storyList, ZtStoryDTO::new);
|
||||||
for (ZtStoryDTO dto:storyDTOList ) {
|
for (ZtStoryDTO dto:storyDTOList ) {
|
||||||
ztUser = userMap.get(d.getAssignedTo());
|
ztUser = userMap.get(dto.getAssignedTo());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
d.setAssignedToName(ztUser.getNickname());
|
dto.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
ztUser = userMap.get(dto.getOpenedby());
|
ztUser = userMap.get(dto.getOpenedby());
|
||||||
@ -684,6 +728,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
dto.setYsUserName(ztUser.getNickname());
|
dto.setYsUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
d.setStoryList(storyDTOList);
|
d.setStoryList(storyDTOList);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.sa.zentao.qo.ZtProjectQo;
|
|||||||
import com.sa.zentao.service.*;
|
import com.sa.zentao.service.*;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.sa.zentao.utils.BeanCopyUtil;
|
import com.sa.zentao.utils.BeanCopyUtil;
|
||||||
|
import com.sa.zentao.utils.BeanCopyUtilCallBack;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -247,6 +248,19 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
|
|
||||||
List<Integer> executions = dto.getExecutions();
|
List<Integer> executions = dto.getExecutions();
|
||||||
if (!CollectionUtils.isEmpty(executions)) {
|
if (!CollectionUtils.isEmpty(executions)) {
|
||||||
|
|
||||||
|
// List<Integer> oldExecIds = pList.stream().map(o -> o.getProject()).collect(Collectors.toList());
|
||||||
|
//查找需求管理的项目 需求只会被项目关联一次
|
||||||
|
|
||||||
|
List<ZtExecutionproject> list = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().in(ZtExecutionproject::getExecution, executions));
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
Map<Integer, List<ZtExecutionproject>> map = list.stream().collect(Collectors.groupingBy(ZtExecutionproject::getProject));
|
||||||
|
if(map.keySet().size()>1){
|
||||||
|
throw new BusinessException("当前无法关联多个项目请检查");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.executionBindStory(s, executions);
|
this.executionBindStory(s, executions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,6 +281,15 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ZtStory buildStory(ZtStoryDTO dto) {
|
private ZtStory buildStory(ZtStoryDTO dto) {
|
||||||
|
if(dto.getUserStory()!=null&&dto.getUserStory()!=0){
|
||||||
|
ZtStoryUser ztStoryUser = this.storyUserService.getById(dto.getUserStory());
|
||||||
|
if(ztStoryUser==null){
|
||||||
|
throw new BusinessException("未查询到用户需求");
|
||||||
|
}
|
||||||
|
if(UserStoryEnums.transfer(ztStoryUser.getStatus())!=UserStoryEnums.CFM ){
|
||||||
|
throw new BusinessException("无法关联未确认的需求");
|
||||||
|
}
|
||||||
|
}
|
||||||
ZtStory s = new ZtStory();
|
ZtStory s = new ZtStory();
|
||||||
BeanUtils.copyProperties(dto, s);
|
BeanUtils.copyProperties(dto, s);
|
||||||
s.setVersion(1);
|
s.setVersion(1);
|
||||||
@ -426,6 +449,14 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
List<Integer> oldExecIds = pList.stream().map(o -> o.getProject()).collect(Collectors.toList());
|
List<Integer> oldExecIds = pList.stream().map(o -> o.getProject()).collect(Collectors.toList());
|
||||||
//查找需求管理的项目 需求只会被项目关联一次
|
//查找需求管理的项目 需求只会被项目关联一次
|
||||||
|
|
||||||
|
List<ZtExecutionproject> list = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().in(ZtExecutionproject::getExecution, executions));
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
Map<Integer, List<ZtExecutionproject>> map = list.stream().collect(Collectors.groupingBy(ZtExecutionproject::getProject));
|
||||||
|
if(map.keySet().size()>1){
|
||||||
|
throw new BusinessException("当前无法关联多个项目请检查");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
List execList = new ArrayList();
|
List execList = new ArrayList();
|
||||||
for (Integer exec : executions) {
|
for (Integer exec : executions) {
|
||||||
if (!oldExecIds.contains(exec)) {
|
if (!oldExecIds.contains(exec)) {
|
||||||
@ -681,23 +712,24 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
UserType userType = RiskUserThreadLocal.get().getUserType();
|
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||||
|
|
||||||
|
|
||||||
List<ZtStory> closed = this.baseMapper.selectList(new QueryWrapper<ZtStory>().lambda()
|
List<Integer> pAuth = this.projectService.authProductList();
|
||||||
|
if(CollectionUtils.isEmpty(pAuth)){
|
||||||
|
return Arrays.asList();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ZtStory> sList = this.baseMapper.selectList(new QueryWrapper<ZtStory>().lambda()
|
||||||
.ne(ZtStory::getStatus, "closed")
|
.ne(ZtStory::getStatus, "closed")
|
||||||
.eq(ZtStory::getAssignedTo, RiskUserThreadLocal.get().getName())
|
.in(ZtStory::getProduct,pAuth)
|
||||||
.or().eq(ZtStory::getOpenedby, RiskUserThreadLocal.get().getName())
|
.and(o-> o.eq(ZtStory::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||||
);
|
.or().eq(ZtStory::getOpenedby, RiskUserThreadLocal.get().getName()))
|
||||||
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(closed, ZtStoryDTO::new);
|
|
||||||
|
|
||||||
if (userType == UserType.CP) {
|
|
||||||
List<ZtStoryUser> uStory = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().ne(ZtStoryUser::getStatus, "closed")
|
|
||||||
.or().eq(ZtStoryUser::getOpenedby, RiskUserThreadLocal.get().getName())
|
|
||||||
);
|
);
|
||||||
if (!CollectionUtils.isEmpty(uStory)) {
|
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(sList, ZtStoryDTO::new,new BeanCopyUtilCallBack<ZtStory,ZtStoryDTO>() {
|
||||||
List<ZtStoryDTO> storyDTOList1 = BeanCopyUtil.copyListProperties(uStory, ZtStoryDTO::new);
|
@Override
|
||||||
storyDTOList.addAll(storyDTOList1);
|
public void callBack(ZtStory t, ZtStoryDTO s) {
|
||||||
|
s.setOpeneddate(t.getOpenedDate());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
if (!CollectionUtils.isEmpty(storyDTOList)) {
|
if (!CollectionUtils.isEmpty(storyDTOList)) {
|
||||||
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(storyDTOList);
|
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(storyDTOList);
|
||||||
for (ZtStoryDTO d : storyDTOList) {
|
for (ZtStoryDTO d : storyDTOList) {
|
||||||
@ -710,6 +742,18 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (userType == UserType.CP) {
|
||||||
|
List<ZtStoryUser> uStory = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().ne(ZtStoryUser::getStatus, "closed")
|
||||||
|
.in(ZtStoryUser::getProduct,pAuth)
|
||||||
|
.eq(ZtStoryUser::getOpenedby, RiskUserThreadLocal.get().getName())
|
||||||
|
);
|
||||||
|
if (!CollectionUtils.isEmpty(uStory)) {
|
||||||
|
List<ZtStoryDTO> storyDTOList1 = BeanCopyUtil.copyListProperties(uStory, ZtStoryDTO::new);
|
||||||
|
storyDTOList.addAll(storyDTOList1);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return storyDTOList;
|
return storyDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,11 +779,15 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
|
Map<Integer,List<ZtTask>> taskCountMap = getTaskCountMap(list);
|
||||||
|
|
||||||
for (ZtStoryDTO d : list) {
|
for (ZtStoryDTO d : list) {
|
||||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||||
d.setViews(rMap.get(d.getId()));
|
d.setViews(rMap.get(d.getId()));
|
||||||
|
List<ZtTask> ztTasks = taskCountMap.get(d.getId());
|
||||||
|
|
||||||
|
|
||||||
|
d.setTaskCount(ztTasks==null?0:ztTasks.size());
|
||||||
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
||||||
|
|
||||||
|
|
||||||
@ -767,6 +815,16 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
return new PageInfo<ZtStoryDTO>(list);
|
return new PageInfo<ZtStoryDTO>(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<Integer, List<ZtTask>> getTaskCountMap(List<ZtStoryDTO> list) {
|
||||||
|
|
||||||
|
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda().in(ZtTask::getStory, list.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||||
|
if(CollectionUtils.isEmpty(tList)){
|
||||||
|
return new HashMap<>();
|
||||||
|
}else{
|
||||||
|
return tList.stream().collect(Collectors.groupingBy(ZtTask::getStory));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//需求id 执行
|
//需求id 执行
|
||||||
public Map<Integer, List<ZtProject>> getExecutionMapByStory(List<ZtStoryDTO> list) {
|
public Map<Integer, List<ZtProject>> getExecutionMapByStory(List<ZtStoryDTO> list) {
|
||||||
List<ZtProjectstory> pStoryList = projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getType, ProjectTypeEnums.execution.getValue())
|
List<ZtProjectstory> pStoryList = projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getType, ProjectTypeEnums.execution.getValue())
|
||||||
@ -942,7 +1000,8 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
//任务没有做完 如果任务还没开始
|
//任务没有做完 如果任务还没开始
|
||||||
if (!CollectionUtils.isEmpty(taskList)) {
|
if (!CollectionUtils.isEmpty(taskList)) {
|
||||||
if (Arrays.asList("wait", "projected").contains(ztStory.getStage())) {
|
if (Arrays.asList("wait", "projected").contains(ztStory.getStage())) {
|
||||||
this.startStory(id);
|
|
||||||
|
this.taskFinishChangeStatus(id,null);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -972,7 +1031,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Arrays.asList("wait").contains(ztStory.getStage()) && !CollectionUtils.isEmpty(taskList)) {
|
if (Arrays.asList("wait").contains(ztStory.getStage()) && !CollectionUtils.isEmpty(taskList)) {
|
||||||
this.startStory(id);
|
this.taskFinishChangeStatus(id,null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1144,6 +1203,77 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
RiskUserThreadLocal.get().getName(), null, "");
|
RiskUserThreadLocal.get().getName(), null, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void taskFinishChangeStatus(Integer story, String finishBy) {
|
||||||
|
if(story==null||story==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ZtStory ztStory = this.baseMapper.selectById(story);
|
||||||
|
|
||||||
|
List<ZtTask> taskList = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, story)
|
||||||
|
.in(ZtTask::getStatus, Arrays.asList( "wait", "doing", "pause"))
|
||||||
|
.eq(ZtTask::getType, "devel"));
|
||||||
|
//如果开发有任务 并且状态需要变为开发中
|
||||||
|
if(!CollectionUtils.isEmpty(taskList)&&Arrays.asList( "wait", "projected", "developing").contains(ztStory.getStage())){
|
||||||
|
//如果测试已经开始 那么测试进行中
|
||||||
|
List<ZtTask> testList = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, story)
|
||||||
|
.in(ZtTask::getStatus, Arrays.asList( "doing", "done"))
|
||||||
|
.eq(ZtTask::getType, "test"));
|
||||||
|
if(!CollectionUtils.isEmpty(testList)){
|
||||||
|
//测试任务已经开始
|
||||||
|
this.testingStory(story);
|
||||||
|
}else{
|
||||||
|
this.startStory(story);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果开发中任务没有了
|
||||||
|
if(CollectionUtils.isEmpty(taskList)){
|
||||||
|
|
||||||
|
List<ZtTask> testList = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, story)
|
||||||
|
.in(ZtTask::getStatus, Arrays.asList( "wait", "doing", "pause","done"))
|
||||||
|
.eq(ZtTask::getType, "test"));
|
||||||
|
//如果测试中有任务
|
||||||
|
Long waitCount = testList.stream().filter(o -> Arrays.asList("wait").contains(o.getStatus())).count();
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(testList)&&waitCount.intValue()!=testList.size()){
|
||||||
|
Long doneCount = testList.stream().filter(o -> Arrays.asList("done").contains(o.getStatus())).count();
|
||||||
|
if(doneCount.intValue()==testList.size()){
|
||||||
|
testedStory(story,finishBy);
|
||||||
|
}else{
|
||||||
|
this.testingStory(story);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//如果开发任务没有了 并且测试还没开始
|
||||||
|
this.finishStory(story,finishBy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果有多个开发任务:
|
||||||
|
// 1、其中有一个开发进行中,并且所有测试任务未开始,则【开发进行中】
|
||||||
|
// 2、所有开发任务已完成,并且所有测试任务未开始,则【开发完成】
|
||||||
|
// 如果有多个测试任务:
|
||||||
|
// 1、其中有一个测试进行中,则【测试进行中】
|
||||||
|
// 2、所有测试任务已完成,但还有一些开发任务没有结束,则【测试进行中】
|
||||||
|
// 3、所有测试任务已完成,并且所有开发任务已完成,则【测试完成】
|
||||||
|
// ZtStory ztStory = this.baseMapper.selectById(story);
|
||||||
|
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
|
||||||
|
// if(Arrays.asList("wait","projected","developing","developed").contains(ztStory.getStage())){
|
||||||
|
// }else if(Arrays.asList("testing").contains(ztStory.getStage())){
|
||||||
|
// this.testedStory(story,finishBy);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// //开发完成
|
||||||
|
// void finishStory(Integer story,String finishBy);
|
||||||
|
// //测试完毕
|
||||||
|
// void testedStory(Integer story,String finishBy);
|
||||||
|
// //测试中
|
||||||
|
// void testingStory(Integer story);
|
||||||
|
// //发布
|
||||||
|
// void releaseStory(Integer story);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void testingStory(Integer story) {
|
public void testingStory(Integer story) {
|
||||||
@ -1406,6 +1536,13 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
List<String> ids = new ArrayList<>(Arrays.asList(split));
|
List<String> ids = new ArrayList<>(Arrays.asList(split));
|
||||||
qo.setObjIds(ids);
|
qo.setObjIds(ids);
|
||||||
// list=this.baseMapper.storyPageListByIds(ids);
|
// list=this.baseMapper.storyPageListByIds(ids);
|
||||||
|
}else{
|
||||||
|
//自己有权限的 产品集
|
||||||
|
List<Integer> integers = this.projectService.authProductList();
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(integers)) {
|
||||||
|
qo.setProductIds(integers);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// else{
|
// else{
|
||||||
if (UserType.KFZ == loginRiskUser.getUserType() || UserType.CS == loginRiskUser.getUserType()) {
|
if (UserType.KFZ == loginRiskUser.getUserType() || UserType.CS == loginRiskUser.getUserType()) {
|
||||||
@ -1413,25 +1550,11 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
qo.setKfz(1);
|
qo.setKfz(1);
|
||||||
list = this.baseMapper.projectStoryPageList(qo);
|
list = this.baseMapper.projectStoryPageList(qo);
|
||||||
}
|
}else{
|
||||||
// else if(UserType.GSGC==loginRiskUser.getUserType()){
|
|
||||||
// //全部
|
|
||||||
// page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
|
||||||
// list=this.baseMapper.allStoryPageList(qo);
|
|
||||||
// }
|
|
||||||
else {
|
|
||||||
//自己有权限的 产品集
|
|
||||||
List<Integer> integers = this.projectService.authProductList();
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(integers)) {
|
|
||||||
qo.setProductIds(integers);
|
|
||||||
page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
list = this.baseMapper.myStoryPageList(qo);
|
list = this.baseMapper.myStoryPageList(qo);
|
||||||
} else {
|
|
||||||
list = new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
@ -1452,6 +1575,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
||||||
if (!CollectionUtils.isEmpty(ztProjectList)) {
|
if (!CollectionUtils.isEmpty(ztProjectList)) {
|
||||||
d.setPlan(ztProjectList.stream().map(o -> o.getName()).collect(Collectors.joining(",")));
|
d.setPlan(ztProjectList.stream().map(o -> o.getName()).collect(Collectors.joining(",")));
|
||||||
|
d.setExecutionName(ztProjectList.stream().map(o -> o.getName()).collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
@ -1530,11 +1654,18 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
ztStory.setStatus("closed");
|
ztStory.setStatus("closed");
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
actionService.addAction(ActionType.XQ, ActionStatus.GB, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
actionService.addAction(ActionType.XQ, ActionStatus.GB, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), dto.getClosedreason(), "Done|draft");
|
RiskUserThreadLocal.get().getName(), dto.getClosedreason(), null);
|
||||||
if (ztStory.getProduct() != null && ztStory.getProduct().intValue() != 0) {
|
if (ztStory.getProduct() != null && ztStory.getProduct().intValue() != 0) {
|
||||||
ProductStoryStatus oldPStatus = getProductStatus(status);
|
ProductStoryStatus oldPStatus = getProductStatus(status);
|
||||||
this.productService.productChangeStatus(ztStory.getProduct(), oldPStatus, ProductStoryStatus.GB);
|
this.productService.productChangeStatus(ztStory.getProduct(), oldPStatus, ProductStoryStatus.GB);
|
||||||
}
|
}
|
||||||
|
List<ZtProjectstory> execList = this.projectstoryService.projectListByStory(Arrays.asList(ztStory.getId()),ProjectTypeEnums.execution);
|
||||||
|
if(!CollectionUtils.isEmpty(execList)){
|
||||||
|
for (ZtProjectstory s:execList ) {
|
||||||
|
this.kanbanlaneService.changeStatus(s.getProject(),ztStory.getId(),"story","closed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.closeTaskBug(ztStory.getId());
|
this.closeTaskBug(ztStory.getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1622,6 +1753,14 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
product.setYss(product.getYss() + 1);
|
product.setYss(product.getYss() + 1);
|
||||||
product.setReleases(product.getReleases() - 1);
|
product.setReleases(product.getReleases() - 1);
|
||||||
this.productService.updateById(product);
|
this.productService.updateById(product);
|
||||||
|
List<ZtProjectstory> pStory = this.projectstoryService.projectListByStory(Arrays.asList(ztStory.getId()), ProjectTypeEnums.execution);
|
||||||
|
if(CollectionUtils.isEmpty(pStory)){
|
||||||
|
throw new BusinessException("当前未配置迭代无法验收");
|
||||||
|
}
|
||||||
|
for (ZtProjectstory s:pStory ) {
|
||||||
|
this.kanbanlaneService.changeStatus(s.getProject(),s.getStory(),"story","verified");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//已发布
|
//已发布
|
||||||
@ -1649,12 +1788,15 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
} else {
|
} else {
|
||||||
status = ActionStatus.YSBTG;
|
status = ActionStatus.YSBTG;
|
||||||
}
|
}
|
||||||
|
ztStory.setYsDate(new Date());
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
|
|
||||||
if (revieweResult == 1 && ztStory.getFeedback() != null && ztStory.getFeedback() != 0) {
|
if (revieweResult == 1 && ztStory.getFeedback() != null && ztStory.getFeedback() != 0) {
|
||||||
this.storyFeedbackService.ysFeedback(ztStory.getFeedback());
|
this.storyFeedbackService.ysFeedback(ztStory.getFeedback());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//添加action
|
//添加action
|
||||||
actionService.addAction(ActionType.XQ, status, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
actionService.addAction(ActionType.XQ, status, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedTo());
|
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedTo());
|
||||||
@ -1714,6 +1856,25 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
d.setReviewedbyName(b.toString());
|
d.setReviewedbyName(b.toString());
|
||||||
}
|
}
|
||||||
|
List<ZtProjectstory> execStory = this.projectstoryService.projectListByStory(Arrays.asList(d.getId()),ProjectTypeEnums.execution);
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(execStory)){
|
||||||
|
List<ZtProject> ztProjects = this.projectService.listByIds(execStory.stream().map(o -> o.getProject()).collect(Collectors.toList()));
|
||||||
|
List<ZtProjectDTO> execInfoList = BeanCopyUtil.copyListProperties(ztProjects, ZtProjectDTO::new);
|
||||||
|
for (ZtProjectDTO execInfo:execInfoList) {
|
||||||
|
ZtUser ztUser = userMap.get(execInfo.getPm());
|
||||||
|
if(ztUser!=null){
|
||||||
|
execInfo.setPmName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(execInfo.getOpenedBy());
|
||||||
|
if(ztUser!=null){
|
||||||
|
execInfo.setOpenedByName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
d.setExecutionList(execInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
d.setViews(rMap.get(d.getId()));
|
d.setViews(rMap.get(d.getId()));
|
||||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||||
@ -1773,6 +1934,12 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
ztStoryUserDTO.setAssignedtoName(ztUser.getNickname());
|
ztStoryUserDTO.setAssignedtoName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ztUser = userMap.get(ztStoryUserDTO.getClosedby());
|
||||||
|
if (ztUser != null) {
|
||||||
|
ztStoryUserDTO.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
Integer parent = ztStoryUserDTO.getParent();
|
Integer parent = ztStoryUserDTO.getParent();
|
||||||
if(parent!=null&&parent!=0){
|
if(parent!=null&&parent!=0){
|
||||||
ZtStoryUser ztStoryUser = this.storyUserService.getById(parent);
|
ZtStoryUser ztStoryUser = this.storyUserService.getById(parent);
|
||||||
|
@ -14,6 +14,7 @@ import com.sa.zentao.entity.*;
|
|||||||
import com.sa.zentao.enums.ActionStatus;
|
import com.sa.zentao.enums.ActionStatus;
|
||||||
import com.sa.zentao.enums.ActionType;
|
import com.sa.zentao.enums.ActionType;
|
||||||
import com.sa.zentao.enums.FileTypes;
|
import com.sa.zentao.enums.FileTypes;
|
||||||
|
import com.sa.zentao.enums.UserStoryEnums;
|
||||||
import com.sa.zentao.mapper.ZtStoryUserMapper;
|
import com.sa.zentao.mapper.ZtStoryUserMapper;
|
||||||
import com.sa.zentao.qo.StoryQo;
|
import com.sa.zentao.qo.StoryQo;
|
||||||
import com.sa.zentao.qo.ZtProjectQo;
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
@ -62,6 +63,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IZtProjectService projectService;
|
private IZtProjectService projectService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtModuleService moduleService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void addStory(ZtStoryUserDTO dto) {
|
public void addStory(ZtStoryUserDTO dto) {
|
||||||
@ -80,7 +86,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
s.setStage("wait");
|
s.setStage("wait");
|
||||||
this.baseMapper.insert(s);
|
this.baseMapper.insert(s);
|
||||||
|
|
||||||
fileService.updateFile(dto.getFiles(),s.getId(), FileTypes.userStory);
|
fileService.updateFile(dto.getFiles(),s.getId(), FileTypes.userStoryTask);
|
||||||
|
|
||||||
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct()+"", null, null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct()+"", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), "", "");
|
RiskUserThreadLocal.get().getName(), "", "");
|
||||||
@ -138,7 +144,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
|
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
|
|
||||||
fileService.updateFile(dto.getFiles(),ztStory.getId(), FileTypes.userStory);
|
fileService.updateFile(dto.getFiles(),ztStory.getId(), FileTypes.userStoryTask);
|
||||||
|
|
||||||
actionService.addAction(ActionType.USERXQ, ActionStatus.BJ, dto.getId(), dto.getProduct() + "", dto.getProject(), null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.BJ, dto.getId(), dto.getProduct() + "", dto.getProject(), null,
|
||||||
RiskUserThreadLocal.get().getName(), dto.getRemark(), "");
|
RiskUserThreadLocal.get().getName(), dto.getRemark(), "");
|
||||||
@ -307,6 +313,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
}else if(dto.getRevieweResult() == 2 ){
|
}else if(dto.getRevieweResult() == 2 ){
|
||||||
ztStory.setStatus("draft");
|
ztStory.setStatus("draft");
|
||||||
}
|
}
|
||||||
|
ztStory.setYsRemark(dto.getDesc());
|
||||||
|
ztStory.setPsDate(new Date());
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
|
|
||||||
//添加action
|
//添加action
|
||||||
@ -333,8 +341,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IZtModuleService moduleService;
|
|
||||||
@Override
|
@Override
|
||||||
public ZtStoryUserDTO getUserStoryById(ZtStoryDTO d) {
|
public ZtStoryUserDTO getUserStoryById(ZtStoryDTO d) {
|
||||||
ZtStoryUser ztStoryUser = this.baseMapper.selectById(d.getId());
|
ZtStoryUser ztStoryUser = this.baseMapper.selectById(d.getId());
|
||||||
@ -415,6 +421,24 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
dto.setSList(storyDTOList);
|
dto.setSList(storyDTOList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<ZtStoryUserTask> tasks = this.storyUserTaskService.list(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getUserStoryId, dto.getId()));
|
||||||
|
if(!CollectionUtils.isEmpty(tasks)){
|
||||||
|
List<ZtStoryUserTaskDTO> ztStoryUserTaskDTOS = BeanCopyUtil.copyListProperties(tasks, ZtStoryUserTaskDTO::new);
|
||||||
|
for (ZtStoryUserTaskDTO t:ztStoryUserTaskDTOS) {
|
||||||
|
ztUser = userMap.get(t.getAssignedTo());
|
||||||
|
if(ztUser!=null){
|
||||||
|
t.setAssignedToName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(t.getOpenedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
t.setOpenedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dto.setTaskList(ztStoryUserTaskDTOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dto.setViews(rMap.get(d.getId()));
|
dto.setViews(rMap.get(d.getId()));
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
@ -443,7 +467,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
ztStoryUser.setStatus("closed");
|
ztStoryUser.setStatus("closed");
|
||||||
this.baseMapper.updateById(ztStoryUser);
|
this.baseMapper.updateById(ztStoryUser);
|
||||||
|
|
||||||
actionService.addAction(ActionType.XQ, ActionStatus.GB, dto.getId(), ztStoryUser.getProduct() + "", null, null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.GB, dto.getId(), ztStoryUser.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(),"关闭原因:"+closedreason+"\r\n 关闭备注: " +dto.getRemark(), "");
|
RiskUserThreadLocal.get().getName(),"关闭原因:"+closedreason+"\r\n 关闭备注: " +dto.getRemark(), "");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -465,6 +489,82 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
|
|
||||||
return released;
|
return released;
|
||||||
}
|
}
|
||||||
|
@Autowired
|
||||||
|
private IZtStoryUserTaskService storyUserTaskService;
|
||||||
|
@Override
|
||||||
|
public void changeStatus(Integer id, UserStoryEnums status) {
|
||||||
|
ZtStoryUser storyUser = this.baseMapper.selectById(id);
|
||||||
|
if(storyUser==null){
|
||||||
|
throw new BusinessException("请检查");
|
||||||
|
}
|
||||||
|
if(status==UserStoryEnums.UNCFM){
|
||||||
|
List<ZtStoryUserTask> list = storyUserTaskService.list(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getUserStoryId, id));
|
||||||
|
if(list.size()>1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(UserStoryEnums.CFM==status){
|
||||||
|
//需求已确认
|
||||||
|
}
|
||||||
|
String oldStatus = storyUser.getStatus();
|
||||||
|
|
||||||
|
storyUser.setStatus(status.getCode());
|
||||||
|
storyUser.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
|
storyUser.setLastediteddate(new Date());
|
||||||
|
UserStoryEnums userStoryEnums = UserStoryEnums.transfer(oldStatus);
|
||||||
|
|
||||||
|
actionService.addAction(ActionType.USERXQ, ActionStatus.ZTBG, id, storyUser.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(), userStoryEnums==null?"":userStoryEnums.getValue() +" 变更 "+status.getValue(), "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//明确需求 需要有交付物
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void improveStory(ZtStoryUserDTO dto) {
|
||||||
|
ZtStoryUser storyUser = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(UserStoryEnums.transfer(storyUser.getStatus())!=UserStoryEnums.CPYSJ ){
|
||||||
|
throw new BusinessException("当前无需明确");
|
||||||
|
}
|
||||||
|
//
|
||||||
|
fileService.updateFile(dto.getFiles(),dto.getId(), FileTypes.userStoryTaskImprove);
|
||||||
|
storyUser.setDeliverRemark(dto.getDeliverRemark());
|
||||||
|
this.baseMapper.updateById(storyUser);
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.DQR);
|
||||||
|
actionService.addAction(ActionType.USERXQ, ActionStatus.MQXU, storyUser.getId(), storyUser.getProduct() + "", null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),dto.getDeliverRemark(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void confirmStory(ZtStoryUserDTO dto) {
|
||||||
|
ZtStoryUser storyUser = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(UserStoryEnums.transfer(storyUser.getStatus())!=UserStoryEnums.DQR ){
|
||||||
|
throw new BusinessException("当前无需明确");
|
||||||
|
}
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.CFM);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void needMeetOrDesign(ZtStoryUserDTO dto) {
|
||||||
|
Integer needDesign = dto.getNeedDesign();
|
||||||
|
Integer needImprove = dto.getNeedImprove();
|
||||||
|
//需要设计
|
||||||
|
if(needDesign!=null&&needDesign!=0){
|
||||||
|
if(needDesign==1){
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.DSJ);
|
||||||
|
}else{
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.CFM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//需要会议
|
||||||
|
if(needImprove!=null&&needImprove!=0){
|
||||||
|
if(needImprove==1){
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.DSJ);
|
||||||
|
}else{
|
||||||
|
this.changeStatus(dto.getId(),UserStoryEnums.CFM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Map<Integer, List<ZtStory>> getStoryUserMap(List<ZtStoryUserDTO> list) {
|
private Map<Integer, List<ZtStory>> getStoryUserMap(List<ZtStoryUserDTO> list) {
|
||||||
List<Integer> ids = list.stream().map(o -> o.getId()).collect(Collectors.toList());
|
List<Integer> ids = list.stream().map(o -> o.getId()).collect(Collectors.toList());
|
||||||
|
@ -0,0 +1,328 @@
|
|||||||
|
package com.sa.zentao.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||||
|
import com.sa.zentao.dao.BusinessException;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||||
|
import com.sa.zentao.dao.ZtStoryUserTaskDTO;
|
||||||
|
import com.sa.zentao.dao.ZtTaskDTO;
|
||||||
|
import com.sa.zentao.entity.*;
|
||||||
|
import com.sa.zentao.enums.ActionStatus;
|
||||||
|
import com.sa.zentao.enums.ActionType;
|
||||||
|
import com.sa.zentao.enums.FileTypes;
|
||||||
|
import com.sa.zentao.enums.UserStoryEnums;
|
||||||
|
import com.sa.zentao.mapper.ZtStoryUserTaskMapper;
|
||||||
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
|
import com.sa.zentao.service.*;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.sa.zentao.utils.DateUtils;
|
||||||
|
import com.sa.zentao.utils.FloatUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author gqb
|
||||||
|
* @since 2025-03-25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ZtStoryUserTaskServiceImpl extends ServiceImpl<ZtStoryUserTaskMapper, ZtStoryUserTask> implements IZtStoryUserTaskService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtActionService actionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtStoryUserService storyUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtEffortService effortService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtProductService productService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtFileService fileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtProjectService projectService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<ZtStoryUserTaskDTO> taskPageList(ZtProjectQo qo) {
|
||||||
|
|
||||||
|
|
||||||
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
|
if(CollectionUtils.isEmpty(pIds)){
|
||||||
|
return new PageInfo<ZtStoryUserTaskDTO>();
|
||||||
|
}
|
||||||
|
qo.setProductIds(pIds);
|
||||||
|
qo.setUserName(RiskUserThreadLocal.get().getName());
|
||||||
|
|
||||||
|
Page<ZtStoryUserTaskDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
|
List<ZtStoryUserTaskDTO> list = this.baseMapper.pageList(qo);
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||||
|
for (ZtStoryUserTaskDTO d:list) {
|
||||||
|
ZtUser ztUser = userMap.get(d.getOpenedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setOpenedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getAssignedTo());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setAssignedToName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getClosedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getFinishedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setFinishedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getCanceledby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setCanceledbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(d.getLastEditedBy());
|
||||||
|
if(ztUser!=null){
|
||||||
|
d.setLastEditedByName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PageInfo<ZtStoryUserTaskDTO>(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public void add(ZtStoryUserTaskDTO dto) {
|
||||||
|
|
||||||
|
ZtStoryUser story = this.storyUserService.getById(dto.getUserStoryId());
|
||||||
|
if(story==null){
|
||||||
|
throw new BusinessException("未查询到用户需求");
|
||||||
|
}
|
||||||
|
String type = dto.getType();
|
||||||
|
|
||||||
|
//wait 未开始 doing 进行中 finished
|
||||||
|
List<ZtStoryUserTask> hisList = this.baseMapper.selectList(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getType, type)
|
||||||
|
.eq(ZtStoryUserTask::getUserStoryId, dto.getUserStoryId())
|
||||||
|
.in(ZtStoryUserTask::getStatus,"wait","doing","finished")
|
||||||
|
);
|
||||||
|
if(!CollectionUtils.isEmpty(hisList)&&hisList.size()>1){
|
||||||
|
throw new BusinessException("无法添加");
|
||||||
|
}
|
||||||
|
if(type.equals("design")){
|
||||||
|
//设计
|
||||||
|
this.storyUserService.changeStatus(dto.getUserStoryId(),UserStoryEnums.XXSJZ);
|
||||||
|
}else if(type.equals("improve")){
|
||||||
|
//明确
|
||||||
|
this.storyUserService.changeStatus(dto.getUserStoryId(),UserStoryEnums.UNCFM);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZtStoryUserTask task = new ZtStoryUserTask();
|
||||||
|
BeanUtils.copyProperties(dto,task);
|
||||||
|
task.setStatus("wait");
|
||||||
|
task.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||||
|
task.setOpeneddate(new Date());
|
||||||
|
task.setLeft(task.getConsumed());
|
||||||
|
task.setConsumed(0F);
|
||||||
|
this.baseMapper.insert(task);
|
||||||
|
//产品确认中
|
||||||
|
|
||||||
|
|
||||||
|
fileService.updateFile(dto.getFiles(),task.getId(), FileTypes.userStory);
|
||||||
|
actionService.addAction(ActionType.STORYUSERTASK, ActionStatus.XJ, task.getId()
|
||||||
|
, task.getProduct().toString(), null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),"", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void modify(ZtStoryUserTaskDTO dto) {
|
||||||
|
|
||||||
|
ZtStoryUserTask ztStoryUserTask = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(ztStoryUserTask==null){
|
||||||
|
throw new BusinessException("未查询到数据");
|
||||||
|
}
|
||||||
|
if(!Arrays.asList("wait","doing").contains(ztStoryUserTask.getStatus())){
|
||||||
|
throw new BusinessException("当前状态无法更改");
|
||||||
|
}
|
||||||
|
//wait 未开始 doing 进行中 finished
|
||||||
|
List<ZtStoryUserTask> hisList = this.baseMapper.selectList(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getType, dto.getType())
|
||||||
|
.eq(ZtStoryUserTask::getUserStoryId, dto.getUserStoryId())
|
||||||
|
.in(ZtStoryUserTask::getStatus,"wait","doing","finished")
|
||||||
|
.ne(ZtStoryUserTask::getId,dto.getId())
|
||||||
|
);
|
||||||
|
if(!CollectionUtils.isEmpty(hisList)&&hisList.size()>0){
|
||||||
|
throw new BusinessException("当前类型无法更改");
|
||||||
|
}
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(dto,ztStoryUserTask);
|
||||||
|
ztStoryUserTask.setLastEditedBy(RiskUserThreadLocal.get().getName());
|
||||||
|
ztStoryUserTask.setLastEditedDate(new Date());
|
||||||
|
this.baseMapper.updateById(ztStoryUserTask);
|
||||||
|
fileService.updateFile(dto.getFiles(),ztStoryUserTask.getId(), FileTypes.userStoryTask);
|
||||||
|
|
||||||
|
actionService.addAction(ActionType.STORYUSERTASK, ActionStatus.BJ, ztStoryUserTask.getId()
|
||||||
|
, ztStoryUserTask.getProduct().toString(), null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),"", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void closed(ZtStoryUserTaskDTO dto) {
|
||||||
|
ZtStoryUserTask ztStoryUserTask = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(ztStoryUserTask==null||ztStoryUserTask.getStatus().equals("closed")){
|
||||||
|
throw new BusinessException("当前无法关闭");
|
||||||
|
}
|
||||||
|
ztStoryUserTask.setStatus("closed");
|
||||||
|
ztStoryUserTask.setClosedby(RiskUserThreadLocal.get().getName());
|
||||||
|
ztStoryUserTask.setCloseddate(new Date());
|
||||||
|
ztStoryUserTask.setClosedRemark(dto.getClosedRemark());
|
||||||
|
this.baseMapper.updateById(ztStoryUserTask);
|
||||||
|
actionService.addAction(ActionType.STORYUSERTASK, ActionStatus.GB, ztStoryUserTask.getId()
|
||||||
|
, ztStoryUserTask.getProduct().toString(), null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),"", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void cancel(ZtStoryUserTaskDTO dto) {
|
||||||
|
|
||||||
|
ZtStoryUserTask ztStoryUserTask = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(ztStoryUserTask==null||ztStoryUserTask.getStatus().equals("closed")||ztStoryUserTask.getStatus().equals("finished")){
|
||||||
|
throw new BusinessException("当前无法取消");
|
||||||
|
}
|
||||||
|
ztStoryUserTask.setStatus("cancel");
|
||||||
|
ztStoryUserTask.setCanceledby(RiskUserThreadLocal.get().getName());
|
||||||
|
ztStoryUserTask.setCanceleddate(new Date());
|
||||||
|
this.baseMapper.updateById(ztStoryUserTask);
|
||||||
|
|
||||||
|
actionService.addAction(ActionType.STORYUSERTASK, ActionStatus.QX, ztStoryUserTask.getId()
|
||||||
|
, ztStoryUserTask.getProduct().toString(), null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),"", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void finishedTask(ZtStoryUserTaskDTO dto) {
|
||||||
|
ZtStoryUserTask ztStoryUserTask = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(ztStoryUserTask==null||ztStoryUserTask.getStatus().equals("closed")||ztStoryUserTask.getStatus().equals("cancel")){
|
||||||
|
throw new BusinessException("当前无法取消");
|
||||||
|
}
|
||||||
|
ztStoryUserTask.setStatus("finished");
|
||||||
|
// 设计 design 明确improve
|
||||||
|
if("improve".equals(ztStoryUserTask.getType())){
|
||||||
|
//需要会议
|
||||||
|
if((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==1)&&dto.getNeedDesign()==null){
|
||||||
|
//用户状态待沟通
|
||||||
|
this.storyUserService.changeStatus(ztStoryUserTask.getUserStoryId(), UserStoryEnums.DGT);
|
||||||
|
}else if ((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==2)&&(dto.getNeedDesign()!=null&&dto.getNeedDesign()==2)){
|
||||||
|
//用户状态待沟通
|
||||||
|
this.storyUserService.changeStatus(ztStoryUserTask.getUserStoryId(), UserStoryEnums.CFM);
|
||||||
|
}else if ((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==2)&&(dto.getNeedDesign()!=null&&dto.getNeedDesign()==1)){
|
||||||
|
//用户状态待沟通 需要详细设计
|
||||||
|
this.storyUserService.changeStatus(ztStoryUserTask.getUserStoryId(), UserStoryEnums.DSJ);
|
||||||
|
this.add(dto.getInfo());
|
||||||
|
}
|
||||||
|
}else if("design".equals(ztStoryUserTask.getType())){
|
||||||
|
this.storyUserService.changeStatus(ztStoryUserTask.getUserStoryId(), UserStoryEnums.CPYSJ);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
float v = FloatUtils.floatSub(ztStoryUserTask.getEstimate(), FloatUtils.floatSub(ztStoryUserTask.getEstimate(), ztStoryUserTask.getConsumed()));
|
||||||
|
ztStoryUserTask.setLeft(v<0?0:v);
|
||||||
|
ztStoryUserTask.setConsumed(FloatUtils.floatAdd(ztStoryUserTask.getConsumed(),dto.getConsumed()));
|
||||||
|
ztStoryUserTask.setLastEditedBy(RiskUserThreadLocal.get().getName());
|
||||||
|
ztStoryUserTask.setLastEditedDate(new Date());
|
||||||
|
ztStoryUserTask.setFinishedby(RiskUserThreadLocal.get().getName());
|
||||||
|
ztStoryUserTask.setFinisheddate(new Date());
|
||||||
|
|
||||||
|
this.baseMapper.updateById(ztStoryUserTask);
|
||||||
|
|
||||||
|
ZtEffort e=new ZtEffort();
|
||||||
|
e.setObjectid(ztStoryUserTask.getId());
|
||||||
|
e.setObjecttype("userStoryTask");
|
||||||
|
e.setConsumed(ztStoryUserTask.getConsumed());
|
||||||
|
e.setLeft(ztStoryUserTask.getLeft());
|
||||||
|
e.setAccount(RiskUserThreadLocal.get().getName());
|
||||||
|
e.setDate(new Date());
|
||||||
|
effortService.save(e);
|
||||||
|
|
||||||
|
|
||||||
|
actionService.addAction(ActionType.STORYUSERTASK, ActionStatus.WC, ztStoryUserTask.getId()
|
||||||
|
, ztStoryUserTask.getProduct().toString(), null, null,
|
||||||
|
RiskUserThreadLocal.get().getName(),"", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZtStoryUserTaskDTO getUserStoryTaskById(ZtProjectQo qo) {
|
||||||
|
|
||||||
|
ZtStoryUserTask ztStoryUserTask = this.baseMapper.selectById(qo.getId());
|
||||||
|
ZtStoryUserTaskDTO ztStoryUserTaskDTO = new ZtStoryUserTaskDTO();
|
||||||
|
BeanUtils.copyProperties(ztStoryUserTask,ztStoryUserTaskDTO);
|
||||||
|
|
||||||
|
if(ztStoryUserTask.getProduct()!=null&&ztStoryUserTask.getProduct()!=0){
|
||||||
|
ZtProduct ztProduct = this.productService.getById(ztStoryUserTask.getProduct());
|
||||||
|
ztStoryUserTaskDTO.setProductName(ztProduct.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
ZtStoryUser ztStoryUser = this.storyUserService.getById(ztStoryUserTask.getUserStoryId());
|
||||||
|
ZtStoryUserDTO ztStoryUserDTO = new ZtStoryUserDTO();
|
||||||
|
BeanUtils.copyProperties(ztStoryUser,ztStoryUserDTO);
|
||||||
|
ztStoryUserTaskDTO.setUserStoryName(ztStoryUser.getTitle());
|
||||||
|
ztStoryUserTaskDTO.setStoryUserInfo(ztStoryUserDTO);
|
||||||
|
|
||||||
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
ztStoryUserTaskDTO.setEststarted(DateUtils.getDayStartDate(ztStoryUserTaskDTO.getEststarted()));
|
||||||
|
ztStoryUserTaskDTO.setDeadline(DateUtils.getDayLast(ztStoryUserTaskDTO.getDeadline()));
|
||||||
|
|
||||||
|
ZtUser ztUser = userMap.get(ztStoryUserTaskDTO.getOpenedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setOpenedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztStoryUserTaskDTO.getAssignedTo());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setAssignedToName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztStoryUserTaskDTO.getClosedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztStoryUserTaskDTO.getFinishedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setFinishedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztStoryUserTaskDTO.getCanceledby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setCanceledbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztStoryUserTaskDTO.getLastEditedBy());
|
||||||
|
if(ztUser!=null){
|
||||||
|
ztStoryUserTaskDTO.setLastEditedByName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
return ztStoryUserTaskDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -177,9 +177,19 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ZtTaskDTO> myTaskList(ZtProjectQo qo) {
|
public List<ZtTaskDTO> myTaskList(ZtProjectQo qo) {
|
||||||
|
|
||||||
|
List<Integer> pList = this.ztProjectService.authProductList();
|
||||||
|
if(CollectionUtils.isEmpty(pList)){
|
||||||
|
return Arrays.asList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<ZtTask> closed = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
List<ZtTask> closed = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
||||||
.ne(ZtTask::getStatus, "closed").eq(ZtTask::getOpenedby, RiskUserThreadLocal.get().getName())
|
.in(ZtTask::getProduct, pList)
|
||||||
.or().eq(ZtTask::getAssignedTo, RiskUserThreadLocal.get().getName())
|
.notIn(ZtTask::getStatus, Arrays.asList("closed","cancel","done") )
|
||||||
|
.and(o->o.eq(ZtTask::getOpenedby, RiskUserThreadLocal.get().getName())
|
||||||
|
.or().eq(ZtTask::getAssignedTo, RiskUserThreadLocal.get().getName()))
|
||||||
|
|
||||||
.orderByDesc(ZtTask::getDeadline)
|
.orderByDesc(ZtTask::getDeadline)
|
||||||
.orderByDesc(ZtTask::getId)
|
.orderByDesc(ZtTask::getId)
|
||||||
);
|
);
|
||||||
@ -229,13 +239,40 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
dto.setImplementId(project.getId());
|
dto.setImplementId(project.getId());
|
||||||
dto.setImplementName(project.getName());
|
dto.setImplementName(project.getName());
|
||||||
}
|
}
|
||||||
|
Integer story = dto.getStory();
|
||||||
|
if(story!=null&&story!=0){
|
||||||
|
ZtStory ztStory = this.storyService.getById(story);
|
||||||
|
if(ztStory!=null){
|
||||||
|
dto.setStoryName(ztStory.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (dto.getDeadline() != null) {
|
if (dto.getDeadline() != null) {
|
||||||
dto.setDeadline(DateUtils.getDayLast(ztTask.getDeadline()));
|
dto.setDeadline(DateUtils.getDayLast(dto.getDeadline()));
|
||||||
}
|
}
|
||||||
ZtUser ztUser = userMap.get(ztTask.getAssignedTo());
|
ZtUser ztUser = userMap.get(ztTask.getAssignedTo());
|
||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
dto.setAssignedToName(ztUser.getNickname());
|
dto.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ztUser = userMap.get(ztTask.getOpenedby());
|
||||||
|
if (ztUser != null) {
|
||||||
|
dto.setOpenedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztTask.getFinishedby());
|
||||||
|
if (ztUser != null) {
|
||||||
|
dto.setFinishedbyName(ztUser.getNickname());
|
||||||
|
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(ztTask.getClosedby());
|
||||||
|
if (ztUser != null) {
|
||||||
|
dto.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
ztUser = userMap.get(ztTask.getCanceledby());
|
||||||
|
if (ztUser != null) {
|
||||||
|
dto.setCanceledbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
List<ZtBug> list = this.bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getTotask, id));
|
List<ZtBug> list = this.bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getTotask, id));
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
@ -250,17 +287,39 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
bug.setAssignedToName(ztUser.getNickname());
|
bug.setAssignedToName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
ztUser = userMap.get(bug.getYsUser());
|
|
||||||
|
|
||||||
|
ztUser = userMap.get(bug.getResolvedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
bug.setResolvedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(bug.getYsUser());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
bug.setYsUserName(ztUser.getNickname());
|
bug.setYsUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
ztUser = userMap.get(bug.getLasteditedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
bug.setLasteditedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(bug.getClosedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
bug.setClosedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(bug.getLasteditedby());
|
||||||
|
if(ztUser!=null){
|
||||||
|
bug.setLasteditedbyName(ztUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(bug.getDeadline()!=null){
|
||||||
|
bug.setDeadline(DateUtils.getDayLast(bug.getDeadline()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dto.setBugList(ztBugDTOS);
|
dto.setBugList(ztBugDTOS);
|
||||||
}else{
|
}else{
|
||||||
dto.setBugList(Arrays.asList());
|
dto.setBugList(Arrays.asList());
|
||||||
}
|
}
|
||||||
|
ZtProduct ztProduct = this.productService.getById(dto.getProduct());
|
||||||
|
dto.setProductName(ztProduct==null?null:ztProduct.getName());
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,11 +364,13 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
return new PageInfo<ZtTaskDTO>();
|
return new PageInfo<ZtTaskDTO>();
|
||||||
}
|
}
|
||||||
Page<ZtTaskDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtTaskDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
qo.setProjectIds(projectAuthList);
|
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(qo.getIds())) {
|
if (!StringUtils.isEmpty(qo.getIds())) {
|
||||||
String[] split = qo.getIds().split(",");
|
String[] split = qo.getIds().split(",");
|
||||||
qo.setObjIds(new ArrayList<>(Arrays.asList(split)));
|
qo.setObjIds(new ArrayList<>(Arrays.asList(split)));
|
||||||
|
}else{
|
||||||
|
qo.setProjectIds(projectAuthList);
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty(qo.getProductName())) {
|
if (!StringUtils.isEmpty(qo.getProductName())) {
|
||||||
List<ZtProduct> pList = this.productService.selectProductByName(qo.getProductName());
|
List<ZtProduct> pList = this.productService.selectProductByName(qo.getProductName());
|
||||||
@ -469,9 +530,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if (ztTask == null) {
|
if (ztTask == null) {
|
||||||
throw new BusinessException("未查询到数据");
|
throw new BusinessException("未查询到数据");
|
||||||
}
|
}
|
||||||
// if(!Arrays.asList("draft","reviewing").contains(ztTask.getStatus())){
|
//cancel取消 closed 关闭 done
|
||||||
// throw new BusinessException("当前无法编辑");
|
if(Arrays.asList("cancel","closed","done").contains(ztTask.getStatus())){
|
||||||
// }
|
throw new BusinessException("当前无法编辑");
|
||||||
|
}
|
||||||
String desc = ztTask.getDesc();
|
String desc = ztTask.getDesc();
|
||||||
String status = ztTask.getStatus();
|
String status = ztTask.getStatus();
|
||||||
BeanUtils.copyProperties(dto, ztTask, "left", "consumed");
|
BeanUtils.copyProperties(dto, ztTask, "left", "consumed");
|
||||||
@ -484,7 +546,11 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ztTask.setDeadlineTime(ztTask.getDeadline().getTime() / 1000);
|
ztTask.setDeadlineTime(ztTask.getDeadline().getTime() / 1000);
|
||||||
}
|
}
|
||||||
UserType userType = RiskUserThreadLocal.get().getUserType();
|
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||||
|
|
||||||
if (dto.getDraftFlag() != null && dto.getDraftFlag() == 1) {
|
if (dto.getDraftFlag() != null && dto.getDraftFlag() == 1) {
|
||||||
|
if(status.equals("wait")){
|
||||||
|
throw new BusinessException("开始后不可以存为草稿");
|
||||||
|
}
|
||||||
ztTask.setStatus("draft");
|
ztTask.setStatus("draft");
|
||||||
}else{
|
}else{
|
||||||
if(status.equals("draft")){
|
if(status.equals("draft")){
|
||||||
@ -498,8 +564,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ztTask.setStatus("wait");
|
ztTask.setStatus("wait");
|
||||||
ztTask.setReviewingUser(null);
|
ztTask.setReviewingUser(null);
|
||||||
}
|
}
|
||||||
}else if ((userType==UserType.XMGLY||userType==UserType.GSGC) &&status.equals("wait")){
|
}else if (status.equals("wait")){
|
||||||
ztTask.setStatus("wait");
|
ztTask.setStatus("wait");
|
||||||
|
}else if (status.equals("doing")){
|
||||||
|
ztTask.setStatus("doing");
|
||||||
}else{
|
}else{
|
||||||
ztTask.setStatus("reviewing");
|
ztTask.setStatus("reviewing");
|
||||||
ZtProject ztProject = this.ztProjectService.getById(ztTask.getExecution());
|
ZtProject ztProject = this.ztProjectService.getById(ztTask.getExecution());
|
||||||
@ -549,13 +617,21 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void startTask(ZtTaskDTO dto) {
|
public void startTask(ZtTaskDTO dto) {
|
||||||
|
|
||||||
if (dto.getLeft() < dto.getConsumed()) {
|
// if (dto.getLeft() < dto.getConsumed()) {
|
||||||
throw new BusinessException("工时填写错误");
|
// throw new BusinessException("工时填写错误");
|
||||||
}
|
// }
|
||||||
|
String name = RiskUserThreadLocal.get().getName();
|
||||||
|
|
||||||
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
|
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
|
||||||
|
if(StringUtils.isEmpty(ztTask.getAssignedTo())){
|
||||||
|
throw new BusinessException("未指派任务无法开始");
|
||||||
|
}
|
||||||
|
if(!ztTask.getAssignedTo().equals(name)){
|
||||||
|
throw new BusinessException("无法开始");
|
||||||
|
}
|
||||||
String status = ztTask.getStatus();
|
String status = ztTask.getStatus();
|
||||||
if (!"wait".equalsIgnoreCase(ztTask.getStatus())) {
|
if (!"wait".equalsIgnoreCase(ztTask.getStatus())) {
|
||||||
throw new BusinessException("未查询到数据");
|
throw new BusinessException("未查询到数据或者检查状态");
|
||||||
}
|
}
|
||||||
ztTask.setAssignedTo(dto.getAssignedTo());
|
ztTask.setAssignedTo(dto.getAssignedTo());
|
||||||
ztTask.setRealstarted(new Date());
|
ztTask.setRealstarted(new Date());
|
||||||
@ -571,6 +647,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ztTask.setLastediteddate(new Date());
|
ztTask.setLastediteddate(new Date());
|
||||||
ztTask.setConsumed(dto.getConsumed());
|
ztTask.setConsumed(dto.getConsumed());
|
||||||
ztTask.setLeft(dto.getLeft() - dto.getConsumed());
|
ztTask.setLeft(dto.getLeft() - dto.getConsumed());
|
||||||
|
if(ztTask.getLeft()<0){
|
||||||
|
ztTask.setLeft(0f);
|
||||||
|
}
|
||||||
this.baseMapper.updateById(ztTask);
|
this.baseMapper.updateById(ztTask);
|
||||||
if(ztTask.getFeedback()!=null&&ztTask.getFeedback()!=0){
|
if(ztTask.getFeedback()!=null&&ztTask.getFeedback()!=0){
|
||||||
if("doing".equals(ztTask.getStatus())){
|
if("doing".equals(ztTask.getStatus())){
|
||||||
@ -629,17 +708,17 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
//处理需求
|
//处理需求
|
||||||
|
|
||||||
if ("done".equals(ztTask.getStatus())) {
|
if ("done".equals(ztTask.getStatus())) {
|
||||||
this.storyService.finishStory(ztTask.getStory(),null);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
} else if ("doing".equals(ztTask.getStatus())) {
|
} else if ("doing".equals(ztTask.getStatus())) {
|
||||||
this.storyService.startStory(ztTask.getStory());
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("test".equals(ztTask.getType())) {
|
if ("test".equals(ztTask.getType())) {
|
||||||
//处理需求
|
//处理需求
|
||||||
if ("done".equals(ztTask.getStatus())) {
|
if ("done".equals(ztTask.getStatus())) {
|
||||||
this.storyService.testedStory(ztTask.getStory(),null);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
} else if ("doing".equals(ztTask.getStatus())) {
|
} else if ("doing".equals(ztTask.getStatus())) {
|
||||||
this.storyService.testingStory(ztTask.getStory());
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -655,10 +734,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
String type = ztTask.getType();
|
String type = ztTask.getType();
|
||||||
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
||||||
if ("test".equals(type)) {
|
if ("test".equals(type)) {
|
||||||
this.storyService.testedStory(ztTask.getStory(),null);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
} else if ("devel".equals(type)) {
|
} else if ("devel".equals(type)) {
|
||||||
//开发
|
//开发
|
||||||
this.storyService.finishStory(ztTask.getStory(),null);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -676,6 +755,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
}
|
}
|
||||||
ztTask.setConsumed(dto.getConsumed() + ztTask.getConsumed());
|
ztTask.setConsumed(dto.getConsumed() + ztTask.getConsumed());
|
||||||
ztTask.setLeft(ztTask.getEstimate() - ztTask.getConsumed());
|
ztTask.setLeft(ztTask.getEstimate() - ztTask.getConsumed());
|
||||||
|
if(ztTask.getLeft()<0){
|
||||||
|
ztTask.setLeft(0f);
|
||||||
|
}
|
||||||
ztTask.setStatus("done");
|
ztTask.setStatus("done");
|
||||||
if(ztTask.getFinishedFlag()!=null&&ztTask.getFinishedFlag()==1){
|
if(ztTask.getFinishedFlag()!=null&&ztTask.getFinishedFlag()==1){
|
||||||
ztTask.setFinishedby(ztTask.getAssignedTo());
|
ztTask.setFinishedby(ztTask.getAssignedTo());
|
||||||
@ -735,10 +817,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
String type = ztTask.getType();
|
String type = ztTask.getType();
|
||||||
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
||||||
if ("test".equals(type)) {
|
if ("test".equals(type)) {
|
||||||
this.storyService.testedStory(ztTask.getStory(),finishBy);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),finishBy);
|
||||||
} else if ("devel".equals(type)) {
|
} else if ("devel".equals(type)) {
|
||||||
//开发
|
//开发
|
||||||
this.storyService.finishStory(ztTask.getStory(),finishBy);
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(),finishBy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ztTask.getFeedback()!=null&&ztTask.getFeedback()!=0){
|
if(ztTask.getFeedback()!=null&&ztTask.getFeedback()!=0){
|
||||||
@ -797,6 +879,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ztTask.setStatus("cancel");
|
ztTask.setStatus("cancel");
|
||||||
ztTask.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztTask.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
ztTask.setLastediteddate(new Date());
|
ztTask.setLastediteddate(new Date());
|
||||||
|
ztTask.setCanceledby(RiskUserThreadLocal.get().getName());
|
||||||
|
ztTask.setCanceleddate(new Date());
|
||||||
|
ztTask.setClosedreason(dto.getDesc());
|
||||||
this.baseMapper.updateById(ztTask);
|
this.baseMapper.updateById(ztTask);
|
||||||
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
||||||
|
|
||||||
@ -818,6 +903,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
kanbanlaneService.changeStatus(qo);
|
kanbanlaneService.changeStatus(qo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
||||||
|
this.storyService.finishStory(ztTask.getStory(),null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
37
src/main/java/com/sa/zentao/utils/FloatUtils.java
Normal file
37
src/main/java/com/sa/zentao/utils/FloatUtils.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package com.sa.zentao.utils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class FloatUtils {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static float floatSub(Float a,Float b){
|
||||||
|
if(a==null){
|
||||||
|
a=0f;
|
||||||
|
}
|
||||||
|
if(b==null){
|
||||||
|
b=0f;
|
||||||
|
}
|
||||||
|
BigDecimal a1 = BigDecimal.valueOf(a);
|
||||||
|
|
||||||
|
BigDecimal a2 = BigDecimal.valueOf(b);
|
||||||
|
|
||||||
|
BigDecimal subtract = a1.subtract(a2);
|
||||||
|
return subtract.floatValue();
|
||||||
|
}
|
||||||
|
public static float floatAdd(Float a,Float b){
|
||||||
|
if(a==null){
|
||||||
|
a=0f;
|
||||||
|
}
|
||||||
|
if(b==null){
|
||||||
|
b=0f;
|
||||||
|
}
|
||||||
|
BigDecimal a1 = BigDecimal.valueOf(a);
|
||||||
|
|
||||||
|
BigDecimal a2 = BigDecimal.valueOf(b);
|
||||||
|
|
||||||
|
BigDecimal subtract = a1.add(a2);
|
||||||
|
return subtract.floatValue();
|
||||||
|
}
|
||||||
|
}
|
@ -37,6 +37,19 @@ public class KanBanConstant {
|
|||||||
put("tested","测试完毕");
|
put("tested","测试完毕");
|
||||||
put("closed","已关闭");
|
put("closed","已关闭");
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
put(1,new LinkedHashMap<>(){{
|
||||||
|
put("unconfirmed","待解决");
|
||||||
|
// put("confirmed","已确认");
|
||||||
|
// put("resolving","解决中");
|
||||||
|
// put("fixing","进行中");
|
||||||
|
put("fixed","完成");
|
||||||
|
// put("test","测试");
|
||||||
|
// put("testing","测试中");
|
||||||
|
// put("tested","测试完毕");
|
||||||
|
put("closed","已关闭");
|
||||||
|
}});
|
||||||
|
|
||||||
put(2,new LinkedHashMap<>(){{
|
put(2,new LinkedHashMap<>(){{
|
||||||
put("wait","未开始");
|
put("wait","未开始");
|
||||||
put("develop","开发");
|
put("develop","开发");
|
||||||
|
@ -74,10 +74,67 @@
|
|||||||
and project =#{qo.project}
|
and project =#{qo.project}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.id != null and qo.id != 0">
|
||||||
|
and id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.name != null and qo.name != ''">
|
||||||
|
and title like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.severity != null and qo.severity != ''">
|
||||||
|
and severity = #{qo.severity}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != ''">
|
||||||
|
and pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.type != null and qo.type != ''">
|
||||||
|
and `type` = #{qo.type}
|
||||||
|
</if>
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != ''">
|
||||||
|
and assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
<if test="qo.startDate !=null">
|
||||||
|
and openedDate <![CDATA[>=]]> #{qo.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.endDate !=null">
|
||||||
|
and openedDate <![CDATA[<=]]> #{qo.endDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != ''">
|
||||||
|
and openedby = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.openStartDate !=null">
|
||||||
|
and openedDate <![CDATA[>=]]> #{qo.openStartDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openEndDate !=null">
|
||||||
|
and openedDate <![CDATA[<=]]> #{qo.openEndDate}
|
||||||
|
</if>
|
||||||
<if test="qo.execution != null and qo.execution != '' ">
|
<if test="qo.execution != null and qo.execution != '' ">
|
||||||
and execution =#{qo.execution}
|
and execution =#{qo.execution}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.productIds != null and qo.productIds.size() > 0">
|
||||||
|
and product in
|
||||||
|
<foreach collection="qo.productIds" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||||
|
and id in
|
||||||
|
<foreach collection="qo.objIds" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
<if test="qo.searchVal == 'ALL' ">
|
<if test="qo.searchVal == 'ALL' ">
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
@ -139,7 +196,23 @@
|
|||||||
-- //研发需求变动
|
-- //研发需求变动
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<choose>
|
||||||
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
||||||
|
<choose>
|
||||||
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
||||||
|
order by ${qo.orderName} ${qo.orderSort}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
order by id desc
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -149,13 +222,47 @@
|
|||||||
SELECT s.*,pt.name productName from zt_bug s left join zt_product pt on s.product = pt.id
|
SELECT s.*,pt.name productName from zt_bug s left join zt_product pt on s.product = pt.id
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
|
||||||
|
<if test="qo.id != null and qo.id != 0">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.name != null and qo.name != ''">
|
||||||
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.severity != null and qo.severity != ''">
|
||||||
|
and s.severity = #{qo.severity}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != ''">
|
||||||
|
and pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.type != null and qo.type != ''">
|
||||||
|
and s.`type` = #{qo.type}
|
||||||
|
</if>
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != ''">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != ''">
|
||||||
|
and s.openedby = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.openStartDate !=null">
|
||||||
|
and s.openedDate <![CDATA[>=]]> #{qo.openStartDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openEndDate !=null">
|
||||||
|
and s.openedDate <![CDATA[<=]]> #{qo.openEndDate}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.startDate !=null">
|
<if test="qo.startDate !=null">
|
||||||
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
and s.deadline <![CDATA[>=]]> #{qo.startDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.endDate !=null">
|
<if test="qo.endDate !=null">
|
||||||
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
and s.deadline <![CDATA[<=]]> #{qo.endDate}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<if test="qo.productName != null and qo.productName != '' ">
|
<if test="qo.productName != null and qo.productName != '' ">
|
||||||
and pt.name like concat('%', #{qo.productName}, '%')
|
and pt.name like concat('%', #{qo.productName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -17,7 +17,21 @@
|
|||||||
SELECT * from zt_story_feedback s WHERE 1 = 1
|
SELECT * from zt_story_feedback s WHERE 1 = 1
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.type != null and qo.type != '' ">
|
||||||
|
and s.`type` = #{qo.type}
|
||||||
|
</if>
|
||||||
|
<if test="qo.spec != null and qo.spec != ''">
|
||||||
|
and s.spec like concat('%', #{qo.spec}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != ''">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != ''">
|
||||||
|
and s.opened_by = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
<if test="qo.source != null and qo.source != ''">
|
||||||
|
and s.source = #{qo.source}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.productId != null and qo.productId != ''">
|
<if test="qo.productId != null and qo.productId != ''">
|
||||||
and s.product = #{qo.productId}
|
and s.product = #{qo.productId}
|
||||||
@ -34,7 +48,12 @@
|
|||||||
and s.opened_by= #{qo.userName}
|
and s.opened_by= #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.startDate !=null">
|
||||||
|
and s.opened_date <![CDATA[>=]]> #{qo.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.endDate !=null">
|
||||||
|
and s.opened_date <![CDATA[<=]]> #{qo.endDate}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal == 'YJJ' ">
|
<if test="qo.searchVal == 'YJJ' ">
|
||||||
and s.status = 'finished'
|
and s.status = 'finished'
|
||||||
|
@ -123,23 +123,56 @@
|
|||||||
and s.ys_flag =0)
|
and s.ys_flag =0)
|
||||||
or (s.stage = 'verified' and s.ys_flag =2)
|
or (s.stage = 'verified' and s.ys_flag =2)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.name != null and qo.name != '' ">
|
||||||
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.id != null ">
|
<if test="qo.id != null ">
|
||||||
and s.id = #{qo.id}
|
and s.id = #{qo.id}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.title != null and qo.title != '' ">
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
and s.title = #{qo.title}
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.module != null and qo.module != '' ">
|
<if test="qo.module != null and qo.module != '' ">
|
||||||
and s.module = #{qo.module}
|
and s.module = #{qo.module}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
<if test="qo.pri != null and qo.pri != '' ">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != '' ">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.stage != null and qo.stage != '' ">
|
||||||
|
and s.stage = #{qo.stage}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != '' ">
|
||||||
|
and s.openedBy = #{qo.openedby}
|
||||||
|
</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.searchVal != null and qo.searchVal == 'YWGB' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
||||||
and s.status ='closed'
|
and s.status ='closed'
|
||||||
and closedBy =#{qo.userName}
|
and closedBy =#{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
||||||
|
and s.status ='closed'
|
||||||
|
and closedBy =#{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -185,14 +218,44 @@
|
|||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <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.pri != null and qo.pri != '' ">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != '' ">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.stage != null and qo.stage != '' ">
|
||||||
|
and s.stage = #{qo.stage}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != '' ">
|
||||||
|
and s.openedBy = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.startDate !=null">
|
<if test="qo.startDate !=null">
|
||||||
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.endDate !=null">
|
<if test="qo.endDate !=null">
|
||||||
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
<if test="qo.id != null ">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
<if test="qo.name != null and qo.name != '' ">
|
||||||
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.productName != null and qo.productName != '' ">
|
<if test="qo.productName != null and qo.productName != '' ">
|
||||||
and pt.name like concat('%', #{qo.productName}, '%')
|
and pt.name like concat('%', #{qo.productName}, '%')
|
||||||
@ -206,8 +269,8 @@
|
|||||||
and ps.project =#{qo.execution}
|
and ps.project =#{qo.execution}
|
||||||
and ps.type= 'execution'
|
and ps.type= 'execution'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.module != null ">
|
<if test="qo.moduleId != null ">
|
||||||
and s.module =#{qo.module}
|
and s.module =#{qo.moduleId}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'ALL' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'ALL' ">
|
||||||
|
|
||||||
@ -222,8 +285,10 @@
|
|||||||
<if test="qo.kfz == 1 ">
|
<if test="qo.kfz == 1 ">
|
||||||
<if test="qo.userName != null and qo.userName != '' ">
|
<if test="qo.userName != null and qo.userName != '' ">
|
||||||
|
|
||||||
and s.assignedTo = #{qo.userName}
|
and
|
||||||
|
(s.assignedTo = #{qo.userName}
|
||||||
or s.openedBy = #{qo.userName}
|
or s.openedBy = #{qo.userName}
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
@ -372,6 +437,41 @@
|
|||||||
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != '' ">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != '' ">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.stage != null and qo.stage != '' ">
|
||||||
|
and s.stage = #{qo.stage}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != '' ">
|
||||||
|
and s.openedBy = #{qo.openedby}
|
||||||
|
</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.name != null and qo.name != '' ">
|
||||||
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.id != null ">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
<if test="qo.project != null ">
|
<if test="qo.project != null ">
|
||||||
and ps.project =#{qo.project}
|
and ps.project =#{qo.project}
|
||||||
</if>
|
</if>
|
||||||
@ -473,6 +573,44 @@
|
|||||||
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != '' ">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != '' ">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.stage != null and qo.stage != '' ">
|
||||||
|
and s.stage = #{qo.stage}
|
||||||
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != '' ">
|
||||||
|
and s.openedBy = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
<if test="qo.name != null and qo.name != '' ">
|
||||||
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
|
</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.id != null ">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.productIds != null and qo.productIds.size() > 0">
|
<if test="qo.productIds != null and qo.productIds.size() > 0">
|
||||||
and s.product in
|
and s.product in
|
||||||
<foreach collection="qo.productIds" item="id" index="index"
|
<foreach collection="qo.productIds" item="id" index="index"
|
||||||
@ -518,8 +656,9 @@
|
|||||||
<if test="qo.searchVal != null and qo.searchVal == 'INDEX' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'INDEX' ">
|
||||||
<if test="qo.userName != null and qo.userName != '' ">
|
<if test="qo.userName != null and qo.userName != '' ">
|
||||||
|
|
||||||
and s.assignedTo = #{qo.userName}
|
and ( s.assignedTo = #{qo.userName}
|
||||||
or s.openedBy = #{qo.userName}
|
or s.openedBy = #{qo.userName}
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
|
@ -87,8 +87,12 @@
|
|||||||
<if test="qo.endDate !=null">
|
<if test="qo.endDate !=null">
|
||||||
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.openedby != null and qo.openedby != '' ">
|
||||||
|
and s.openedBy = #{qo.openedby}
|
||||||
|
</if>
|
||||||
|
<if test="qo.status != null and qo.status != '' ">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.productName != null and qo.productName != '' ">
|
<if test="qo.productName != null and qo.productName != '' ">
|
||||||
and pt.name like concat('%', #{qo.productName}, '%')
|
and pt.name like concat('%', #{qo.productName}, '%')
|
||||||
|
89
src/main/resources/mapper/ZtStoryUserTaskMapper.xml
Normal file
89
src/main/resources/mapper/ZtStoryUserTaskMapper.xml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?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="com.sa.zentao.mapper.ZtStoryUserTaskMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtStoryUserTask">
|
||||||
|
<result column="id" property="id" />
|
||||||
|
<result column="user_story_id" property="userStoryId" />
|
||||||
|
<result column="type" property="type" />
|
||||||
|
<result column="estimate" property="estimate" />
|
||||||
|
<result column="consumed" property="consumed" />
|
||||||
|
<result column="left" property="left" />
|
||||||
|
<result column="assigned_to" property="assignedTo" />
|
||||||
|
<result column="need_meeting" property="needMeeting" />
|
||||||
|
<result column="need_design" property="needDesign" />
|
||||||
|
<result column="product" property="product" />
|
||||||
|
<result column="name" property="name" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
<result column="estStarted" property="eststarted" />
|
||||||
|
<result column="deadline" property="deadline" />
|
||||||
|
<result column="realStarted" property="realstarted" />
|
||||||
|
<result column="finishedDate" property="finisheddate" />
|
||||||
|
<result column="finishedBy" property="finishedby" />
|
||||||
|
<result column="canceledBy" property="canceledby" />
|
||||||
|
<result column="canceledDate" property="canceleddate" />
|
||||||
|
<result column="closedBy" property="closedby" />
|
||||||
|
<result column="closedDate" property="closeddate" />
|
||||||
|
<result column="closed_remark" property="closedRemark" />
|
||||||
|
<result column="openedBy" property="openedby" />
|
||||||
|
<result column="openedDate" property="openeddate" />
|
||||||
|
<result column="pri" property="pri" />
|
||||||
|
</resultMap>
|
||||||
|
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryUserTaskDTO">
|
||||||
|
SELECT s.* from zt_story_user_task s,zt_product p WHERE s.product = p.id
|
||||||
|
<if test="qo.id != null and qo.id != 0">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.name != null and qo.name != ''">
|
||||||
|
and s.name like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.type != null and qo.type != ''">
|
||||||
|
and s.`type` = #{qo.type}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != ''">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != ''">
|
||||||
|
and s.assigned_to = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.status != null and qo.status != ''">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</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.searchVal == 'ALL' ">
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="qo.searchVal == 'WGB' ">
|
||||||
|
and s.status != 'closed'
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.searchVal == 'ZGW' ">
|
||||||
|
and s.assigned_to= #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.searchVal == 'YGB' ">
|
||||||
|
and s.status = 'closed'
|
||||||
|
</if>
|
||||||
|
<if test="qo.productIds != null and qo.productIds.size() > 0">
|
||||||
|
and s.product in
|
||||||
|
<foreach collection="qo.productIds" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -63,6 +63,31 @@
|
|||||||
left join zt_product pt on s.product = pt.id
|
left join zt_product pt on s.product = pt.id
|
||||||
where 1= 1
|
where 1= 1
|
||||||
|
|
||||||
|
|
||||||
|
<if test="qo.id != null and qo.id != 0">
|
||||||
|
and s.id = #{qo.id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.name != null and qo.name != ''">
|
||||||
|
and s.name like concat('%', #{qo.name}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.type != null and qo.type != ''">
|
||||||
|
and s.`type` = #{qo.type}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.pri != null and qo.pri != ''">
|
||||||
|
and s.pri = #{qo.pri}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.assignedTo != null and qo.assignedTo != ''">
|
||||||
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.status != null and qo.status != ''">
|
||||||
|
and s.status = #{qo.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.startDate !=null">
|
<if test="qo.startDate !=null">
|
||||||
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
||||||
</if>
|
</if>
|
||||||
|
Reference in New Issue
Block a user