Compare commits
4 Commits
21f522cd1a
...
dev-2025
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b8d440ff3 | |||
| 7c379ea877 | |||
| 5eb21276a9 | |||
| 3d815dc9e8 |
17
pom.xml
17
pom.xml
@@ -99,13 +99,6 @@
|
|||||||
<version>1.5.2</version>
|
<version>1.5.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>easyexcel</artifactId>
|
|
||||||
<version>3.0.5</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tencentcloudapi</groupId>
|
<groupId>com.tencentcloudapi</groupId>
|
||||||
@@ -293,11 +286,11 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.apache.commons</groupId>
|
<!-- <groupId>org.apache.commons</groupId>-->
|
||||||
<artifactId>commons-pool2</artifactId>
|
<!-- <artifactId>commons-pool2</artifactId>-->
|
||||||
<version>2.8.1</version>
|
<!-- <version>2.8.1</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -15,26 +15,24 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class GlobalExceptionHandler {
|
public class GlobalExceptionHandler {
|
||||||
|
|
||||||
@Value("spring.application.name")
|
@Value("${spring.application.name}")
|
||||||
private String application;
|
private String application;
|
||||||
|
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler(Exception.class)
|
||||||
public Result bizExceptionHandler(Exception e, HttpServletRequest request) {
|
public Result bizExceptionHandler(Exception e, HttpServletRequest request) {
|
||||||
log.error("发生业务异常!原因是: {}", e.getMessage());
|
log.error("系统发生异常!应用: {}, 请求路径: {}, 异常类型: {}, 异常原因: {}",
|
||||||
log.error(application +"发生了异常 ,异常信息 ,{}",e);
|
application, request.getRequestURI(), e.getClass().getSimpleName(), e.getMessage(), e);
|
||||||
return Result.fail(Code.FAIL);
|
return Result.fail(Code.FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(BusinessException.class)
|
@ExceptionHandler(BusinessException.class)
|
||||||
public Result bizExceptionHandler(BusinessException e, HttpServletRequest request) {
|
public Result bizExceptionHandler(BusinessException e, HttpServletRequest request) {
|
||||||
log.error("发生业务异常!原因是: {}", e.getMessage());
|
log.error("业务异常!应用: {}, 请求路径: {}, 异常原因: {}",
|
||||||
log.error(application +"发生了异常 ,异常信息 ,{}",e);
|
application, request.getRequestURI(), e.getMessage());
|
||||||
if(e.code==null){
|
if(e.code==null){
|
||||||
return Result.fail(e.value);
|
return Result.fail(e.value);
|
||||||
}else{
|
}else{
|
||||||
return Result.fail(e.code);
|
return Result.fail(e.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
for (int i =0;i<200;i++){
|
|
||||||
log.info("win");
|
|
||||||
}
|
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os.toLowerCase().startsWith("win")) { //如果是Windows系统
|
if (os.toLowerCase().startsWith("win")) { //如果是Windows系统
|
||||||
log.info("win");
|
log.info("win");
|
||||||
|
|||||||
37
src/main/java/com/sa/zentao/constants/ExportConstants.java
Normal file
37
src/main/java/com/sa/zentao/constants/ExportConstants.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.sa.zentao.constants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出相关常量
|
||||||
|
*/
|
||||||
|
public class ExportConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出最大记录数
|
||||||
|
*/
|
||||||
|
public static final int MAX_EXPORT_SIZE = 1000000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel sheet 名称
|
||||||
|
*/
|
||||||
|
public static final String SHEET_NAME = "sheet1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL 编码空格
|
||||||
|
*/
|
||||||
|
public static final String URL_SPACE_ENCODE = "%20";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串分隔符
|
||||||
|
*/
|
||||||
|
public static final String STRING_SEPARATOR = ":";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID 分隔符
|
||||||
|
*/
|
||||||
|
public static final String ID_SEPARATOR = ",";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逗号替换为空字符串
|
||||||
|
*/
|
||||||
|
public static final String COMMA_REPLACE = "";
|
||||||
|
}
|
||||||
@@ -160,4 +160,9 @@ public class ZtProductController {
|
|||||||
public Result projectTeamById(@RequestBody ZtProjectQo qo){
|
public Result projectTeamById(@RequestBody ZtProjectQo qo){
|
||||||
return Result.success(this.ztProductService.productTeamByPid(qo));
|
return Result.success(this.ztProductService.productTeamByPid(qo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/getExecutionByProductId", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result getExecutionByProductId(@RequestBody ZtProjectQo qo){
|
||||||
|
return Result.success(ztProductService.getExecutionByProductId(qo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sa.zentao.constants.ExportConstants;
|
||||||
import com.sa.zentao.dao.*;
|
import com.sa.zentao.dao.*;
|
||||||
import com.sa.zentao.entity.ZtProject;
|
import com.sa.zentao.entity.ZtProject;
|
||||||
import com.sa.zentao.entity.ZtProjectproduct;
|
import com.sa.zentao.entity.ZtProjectproduct;
|
||||||
@@ -71,7 +72,7 @@ public class ZtStoryController {
|
|||||||
|
|
||||||
@RequestMapping(value = "/storyExport", method = RequestMethod.POST)
|
@RequestMapping(value = "/storyExport", method = RequestMethod.POST)
|
||||||
public void storyExport(@RequestBody ZtProjectQo qo, jakarta.servlet.ServletResponse response){
|
public void storyExport(@RequestBody ZtProjectQo qo, jakarta.servlet.ServletResponse response){
|
||||||
qo.setPageSize(1000000);
|
qo.setPageSize(ExportConstants.MAX_EXPORT_SIZE);
|
||||||
PageInfo<ZtStoryDTO> p = ztStoryService.pageList(qo);
|
PageInfo<ZtStoryDTO> p = ztStoryService.pageList(qo);
|
||||||
List<ZtStoryDTO> list = p.getList();
|
List<ZtStoryDTO> list = p.getList();
|
||||||
List<Integer> feedbackIds = list.stream().filter(o -> o.getFeedback() != null && o.getFeedback() != 0).map(o -> o.getFeedback()).collect(Collectors.toList());
|
List<Integer> feedbackIds = list.stream().filter(o -> o.getFeedback() != null && o.getFeedback() != 0).map(o -> o.getFeedback()).collect(Collectors.toList());
|
||||||
@@ -82,12 +83,12 @@ public class ZtStoryController {
|
|||||||
|
|
||||||
ZtStoryFeedback ztStoryFeedback = feedbackMap.get(ztStoryUserDTO.getFeedback());
|
ZtStoryFeedback ztStoryFeedback = feedbackMap.get(ztStoryUserDTO.getFeedback());
|
||||||
if (ztStoryFeedback != null) {
|
if (ztStoryFeedback != null) {
|
||||||
String reName=ztStoryFeedback.getId()+":"+ztStoryFeedback.getSpec();
|
String reName=ztStoryFeedback.getId()+ExportConstants.STRING_SEPARATOR+ztStoryFeedback.getSpec();
|
||||||
String reUrl = url+"/#/product-feedback-info/"+ztStoryFeedback.getId();
|
String reUrl = url+"/#/product-feedback-info/"+ztStoryFeedback.getId();
|
||||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||||
try {
|
try {
|
||||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||||
hyperlink.setHyperlinkData(hyperlinkData);
|
hyperlink.setHyperlinkData(hyperlinkData);
|
||||||
ztStoryUserDTO.setFeedbackSpecUrl(hyperlink );
|
ztStoryUserDTO.setFeedbackSpecUrl(hyperlink );
|
||||||
@@ -96,12 +97,12 @@ public class ZtStoryController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
|
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
|
||||||
String reName = ztStoryUserDTO.getParent()+":"+ztStoryUserDTO.getParentName();
|
String reName = ztStoryUserDTO.getParent()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getParentName();
|
||||||
String reUrl = url+"/#/product-story-info/"+ztStoryUserDTO.getParent();
|
String reUrl = url+"/#/product-story-info/"+ztStoryUserDTO.getParent();
|
||||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||||
try {
|
try {
|
||||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||||
hyperlink.setHyperlinkData(hyperlinkData);
|
hyperlink.setHyperlinkData(hyperlinkData);
|
||||||
ztStoryUserDTO.setParentNameUrl(hyperlink);
|
ztStoryUserDTO.setParentNameUrl(hyperlink);
|
||||||
@@ -110,12 +111,12 @@ public class ZtStoryController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ztStoryUserDTO.getUserStory()!=null&&ztStoryUserDTO.getUserStory()!=0){
|
if(ztStoryUserDTO.getUserStory()!=null&&ztStoryUserDTO.getUserStory()!=0){
|
||||||
String reName=ztStoryUserDTO.getUserStory()+":"+ztStoryUserDTO.getUserStoryName();
|
String reName=ztStoryUserDTO.getUserStory()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getUserStoryName();
|
||||||
String reUrl = url+"/#/product-user-story-info/"+ztStoryUserDTO.getUserStory();
|
String reUrl = url+"/#/product-user-story-info/"+ztStoryUserDTO.getUserStory();
|
||||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||||
try {
|
try {
|
||||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||||
hyperlink.setHyperlinkData(hyperlinkData);
|
hyperlink.setHyperlinkData(hyperlinkData);
|
||||||
ztStoryUserDTO.setUserStoryNameUrl(hyperlink);
|
ztStoryUserDTO.setUserStoryNameUrl(hyperlink);
|
||||||
@@ -123,12 +124,12 @@ public class ZtStoryController {
|
|||||||
ztStoryUserDTO.setUserStoryNameUrl(null);
|
ztStoryUserDTO.setUserStoryNameUrl(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String reName=ztStoryUserDTO.getId()+":"+ztStoryUserDTO.getTitle();
|
String reName=ztStoryUserDTO.getId()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getTitle();
|
||||||
String reUrl = url+"/#/product-story-info/"+ztStoryUserDTO.getId();
|
String reUrl = url+"/#/product-story-info/"+ztStoryUserDTO.getId();
|
||||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||||
try {
|
try {
|
||||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||||
hyperlink.setHyperlinkData(hyperlinkData);
|
hyperlink.setHyperlinkData(hyperlinkData);
|
||||||
ztStoryUserDTO.setStoryUrl(hyperlink);
|
ztStoryUserDTO.setStoryUrl(hyperlink);
|
||||||
@@ -137,7 +138,7 @@ public class ZtStoryController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(ztStoryUserDTO.getReviewedbyName())){
|
if(!StringUtils.isEmpty(ztStoryUserDTO.getReviewedbyName())){
|
||||||
ztStoryUserDTO.setReviewedbyName(ztStoryUserDTO.getReviewedbyName().replaceAll(",",""));
|
ztStoryUserDTO.setReviewedbyName(ztStoryUserDTO.getReviewedbyName().replaceAll(ExportConstants.ID_SEPARATOR, ExportConstants.COMMA_REPLACE));
|
||||||
}
|
}
|
||||||
ztStoryUserDTO.setStatus(StoryStatusEnums.transfer(ztStoryUserDTO.getStatus())==null?null:StoryStatusEnums.transfer(ztStoryUserDTO.getStatus()).getDesc());
|
ztStoryUserDTO.setStatus(StoryStatusEnums.transfer(ztStoryUserDTO.getStatus())==null?null:StoryStatusEnums.transfer(ztStoryUserDTO.getStatus()).getDesc());
|
||||||
ztStoryUserDTO.setStage(StoryStageEnums.transfer(ztStoryUserDTO.getStage())==null?null:StoryStageEnums.transfer(ztStoryUserDTO.getStage()).getDesc());
|
ztStoryUserDTO.setStage(StoryStageEnums.transfer(ztStoryUserDTO.getStage())==null?null:StoryStageEnums.transfer(ztStoryUserDTO.getStage()).getDesc());
|
||||||
@@ -145,10 +146,10 @@ public class ZtStoryController {
|
|||||||
ztStoryUserDTO.setYsFlagName(ztStoryUserDTO.getYsFlag()==1?"通过":"不通过");
|
ztStoryUserDTO.setYsFlagName(ztStoryUserDTO.getYsFlag()==1?"通过":"不通过");
|
||||||
}
|
}
|
||||||
if(!StringUtils.isEmpty(ztStoryUserDTO.getUserStoryName())){
|
if(!StringUtils.isEmpty(ztStoryUserDTO.getUserStoryName())){
|
||||||
ztStoryUserDTO.setUserStoryName(ztStoryUserDTO.getUserStoryId()+":"+ztStoryUserDTO.getUserStoryName());
|
ztStoryUserDTO.setUserStoryName(ztStoryUserDTO.getUserStoryId()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getUserStoryName());
|
||||||
}
|
}
|
||||||
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
|
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
|
||||||
ztStoryUserDTO.setParentName(ztStoryUserDTO.getParent()+":"+ztStoryUserDTO.getParentName());
|
ztStoryUserDTO.setParentName(ztStoryUserDTO.getParent()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getParentName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ public class ZtStoryController {
|
|||||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
.needHead(Boolean.TRUE).build();
|
.needHead(Boolean.TRUE).build();
|
||||||
|
|
||||||
WriteSheet writeSheet = EasyExcel.writerSheet(0, "sheet1")
|
WriteSheet writeSheet = EasyExcel.writerSheet(0, ExportConstants.SHEET_NAME)
|
||||||
.head(ZtStoryDTO.class)
|
.head(ZtStoryDTO.class)
|
||||||
.needHead(Boolean.TRUE).build();
|
.needHead(Boolean.TRUE).build();
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class ZtStoryUserController {
|
|||||||
eq.in(ZtStoryUser::getStatus, UserStoryEnums.JH.getCode(),UserStoryEnums.CFM.getCode(),UserStoryEnums.KFZ.getCode());
|
eq.in(ZtStoryUser::getStatus, UserStoryEnums.JH.getCode(),UserStoryEnums.CFM.getCode(),UserStoryEnums.KFZ.getCode());
|
||||||
}
|
}
|
||||||
eq.select(ZtStoryUser::getId,ZtStoryUser::getTitle,ZtStoryUser::getProduct,
|
eq.select(ZtStoryUser::getId,ZtStoryUser::getTitle,ZtStoryUser::getProduct,
|
||||||
ZtStoryUser::getOpenedby,ZtStoryUser::getAssignedto,ZtStoryUser::getYsUser
|
ZtStoryUser::getOpenedby,ZtStoryUser::getAssignedto,ZtStoryUser::getYsUser,ZtStoryUser::getProductUser
|
||||||
);
|
);
|
||||||
List<ZtStoryUser> list = storyUserService.list(eq
|
List<ZtStoryUser> list = storyUserService.list(eq
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,15 +3,33 @@ package com.sa.zentao.dao;
|
|||||||
|
|
||||||
public class BusinessException extends RuntimeException {
|
public class BusinessException extends RuntimeException {
|
||||||
|
|
||||||
|
|
||||||
public BusinessException(Code code){
|
public BusinessException(Code code){
|
||||||
super(code.getValue());
|
super(code.getValue());
|
||||||
this.code=code;
|
this.code=code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BusinessException(String value){
|
public BusinessException(String value){
|
||||||
super(value);
|
super(value);
|
||||||
this.value=value;
|
this.value=value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BusinessException(Code code, String message){
|
||||||
|
super(message);
|
||||||
|
this.code=code;
|
||||||
|
this.value=message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(String value, Throwable cause){
|
||||||
|
super(value, cause);
|
||||||
|
this.value=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(Code code, String message, Throwable cause){
|
||||||
|
super(message, cause);
|
||||||
|
this.code=code;
|
||||||
|
this.value=message;
|
||||||
|
}
|
||||||
|
|
||||||
public String value;
|
public String value;
|
||||||
public Code code;
|
public Code code;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ public enum Code {
|
|||||||
SUCCESS(0, "成功"),
|
SUCCESS(0, "成功"),
|
||||||
FAIL(-1, "失败"),
|
FAIL(-1, "失败"),
|
||||||
CFTJ(-2, "重复添加"),
|
CFTJ(-2, "重复添加"),
|
||||||
PLEASELOGIN(401, "请登录");
|
PLEASELOGIN(401, "请登录"),
|
||||||
|
PARAM_ERROR(400, "参数错误"),
|
||||||
|
NOT_FOUND(404, "资源不存在"),
|
||||||
|
FORBIDDEN(403, "无权限访问"),
|
||||||
|
INTERNAL_ERROR(500, "系统内部错误");
|
||||||
|
|
||||||
private Integer code;
|
private Integer code;
|
||||||
private String value;
|
private String value;
|
||||||
|
|||||||
@@ -166,11 +166,15 @@ public class ZtStoryDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String productUserName;
|
private String productUserName;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String productUserColor;
|
||||||
/**
|
/**
|
||||||
* 产品人
|
* 产品人
|
||||||
*/
|
*/
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String testUser;
|
private String testUser;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String testUserColor;
|
||||||
/**
|
/**
|
||||||
* 产品人
|
* 产品人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,21 +2,25 @@ package com.sa.zentao.dao;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.metadata.data.HyperlinkData;
|
||||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.sa.zentao.entity.ZtProject;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -28,6 +32,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Slf4j
|
||||||
public class ZtStoryUserDTO implements Serializable {
|
public class ZtStoryUserDTO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -50,6 +55,8 @@ public class ZtStoryUserDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "关联研发需求",index =4)
|
@ExcelProperty(value = "关联研发需求",index =4)
|
||||||
private String storyList;
|
private String storyList;
|
||||||
|
@ExcelIgnore
|
||||||
|
private Set<ZtProject> execList;
|
||||||
@ExcelProperty(value = "状态",index =5)
|
@ExcelProperty(value = "状态",index =5)
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@@ -281,10 +288,30 @@ public class ZtStoryUserDTO implements Serializable {
|
|||||||
//1.需要 2.不需要
|
//1.需要 2.不需要
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private Integer needImprove;
|
private Integer needImprove;
|
||||||
|
/**
|
||||||
|
* 需求背景
|
||||||
|
*/
|
||||||
|
@ExcelIgnore
|
||||||
|
private String storyBackground;
|
||||||
/**
|
/**
|
||||||
* 产品用户
|
* 产品用户
|
||||||
*/
|
*/
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String productUser;
|
private String productUser;
|
||||||
|
|
||||||
|
public void setLinkUrl(String baseUrl) {
|
||||||
|
String reName = this.getTitle();
|
||||||
|
String reUrl = baseUrl + "/#/product-user-story-info/" + this.getId();
|
||||||
|
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||||
|
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||||
|
try {
|
||||||
|
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
||||||
|
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||||
|
hyperlink.setHyperlinkData(hyperlinkData);
|
||||||
|
this.setUrl(hyperlink);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
this.setUrl(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,4 +229,5 @@ public class ZtStoryUser implements Serializable {
|
|||||||
* 产品用户
|
* 产品用户
|
||||||
*/
|
*/
|
||||||
private String productUser;
|
private String productUser;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,5 +31,6 @@ public class ZtStoryUserspec implements Serializable {
|
|||||||
|
|
||||||
private String files;
|
private String files;
|
||||||
|
|
||||||
|
private String storyBackground;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
49
src/main/java/com/sa/zentao/enums/KanbanColumnType.java
Normal file
49
src/main/java/com/sa/zentao/enums/KanbanColumnType.java
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package com.sa.zentao.enums;
|
||||||
|
|
||||||
|
public enum KanbanColumnType {
|
||||||
|
|
||||||
|
// 需求看板列类型
|
||||||
|
STORY_BACKLOG("backlog", "待办"),
|
||||||
|
STORY_DEVELOPING("developing", "研发中"),
|
||||||
|
STORY_DEVELOPED("developed", "研发完毕"),
|
||||||
|
STORY_TESTING("testing", "测试中"),
|
||||||
|
STORY_TESTED("tested", "测试完毕"),
|
||||||
|
STORY_RELEASED("released", "已发布"),
|
||||||
|
STORY_VERIFIED("verified", "已验收"),
|
||||||
|
STORY_CLOSED("closed", "已关闭"),
|
||||||
|
|
||||||
|
// Bug看板列类型
|
||||||
|
BUG_UNCONFIRMED("unconfirmed", "未确认"),
|
||||||
|
BUG_CONFIRMED("confirmed", "已确认"),
|
||||||
|
BUG_RESOLVED("resolved", "已解决"),
|
||||||
|
BUG_CLOSED("closed", "已关闭"),
|
||||||
|
|
||||||
|
// 任务看板列类型
|
||||||
|
TASK_WAIT("wait", "等待"),
|
||||||
|
TASK_DEVELOPING("developing", "进行中"),
|
||||||
|
TASK_DEVELOPED("developed", "已完成"),
|
||||||
|
TASK_CANCEL("cancel", "已取消"),
|
||||||
|
TASK_CLOSED("closed", "已关闭"),
|
||||||
|
|
||||||
|
// 通用列类型
|
||||||
|
WAIT("wait", "等待"),
|
||||||
|
DOING("doing", "进行中"),
|
||||||
|
DONE("done", "已完成"),
|
||||||
|
CLOSED("closed", "已关闭");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
private KanbanColumnType(String value, String desc) {
|
||||||
|
this.value = value;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return this.desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,11 +37,6 @@ public class ZtProjectQo extends BaseQo {
|
|||||||
private String severity;
|
private String severity;
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
/**
|
|
||||||
* 产品人
|
|
||||||
*/
|
|
||||||
private String productUser;
|
|
||||||
private String testUser;
|
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
|
|
||||||
private List<Integer> productIds;
|
private List<Integer> productIds;
|
||||||
@@ -68,6 +63,8 @@ public class ZtProjectQo extends BaseQo {
|
|||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private List<String> statusList;
|
||||||
|
|
||||||
private List<String> stageList;
|
private List<String> stageList;
|
||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ public interface IZtProductService extends IService<ZtProduct> {
|
|||||||
|
|
||||||
List<ZtProduct> productListByProgramName(String programName);
|
List<ZtProduct> productListByProgramName(String programName);
|
||||||
|
|
||||||
|
PageInfo<ZtProjectDTO> getExecutionByProductId(ZtProjectQo qo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ public class FestivalConfigServiceImpl extends ServiceImpl<FestivalConfigMapper,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<FestivalConfig> festivalConfigs = this.baseMapper.selectList(new QueryWrapper<FestivalConfig>().lambda().eq(FestivalConfig::getName, qo.getName()).
|
List<FestivalConfig> festivalConfigs = this.baseMapper.selectList(new QueryWrapper<FestivalConfig>().lambda()
|
||||||
|
.eq(FestivalConfig::getYear,qo.getYear())
|
||||||
|
.eq(FestivalConfig::getName, qo.getName()).
|
||||||
eq(FestivalConfig::getDeleteFlag, DeleteFlagEnum.USED));
|
eq(FestivalConfig::getDeleteFlag, DeleteFlagEnum.USED));
|
||||||
if(!CollectionUtils.isEmpty(festivalConfigs)){
|
if(!CollectionUtils.isEmpty(festivalConfigs)){
|
||||||
throw new BusinessException("已存在");
|
throw new BusinessException("已存在");
|
||||||
|
|||||||
@@ -741,7 +741,11 @@ public class IZtCountService {
|
|||||||
for (ZtUser u : ztUsers) {
|
for (ZtUser u : ztUsers) {
|
||||||
|
|
||||||
List<ItApproval> approvalList = this.taskService.itApprovalByUserName(u.getNickname(), firstDayOfMonth, lastDayOfMonth);
|
List<ItApproval> approvalList = this.taskService.itApprovalByUserName(u.getNickname(), firstDayOfMonth, lastDayOfMonth);
|
||||||
if (u.getAccount().equals("liyuyan")) {
|
if (u.getAccount().equals("weidongxia")||u.getUserType() == UserType.CPJL) {
|
||||||
|
ZtProjectQo ztProjectQo =new ZtProjectQo();
|
||||||
|
ztProjectQo.setDate(qo.getDate());
|
||||||
|
result.add(buildCPJLScore(u, userMap , ztProjectQo,approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d,pids));
|
||||||
|
}else if (u.getAccount().equals("liyuyan")) {
|
||||||
result.add(buildXMZLScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d));
|
result.add(buildXMZLScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d));
|
||||||
} else if ("liushengqing".equals(u.getAccount())) {
|
} else if ("liushengqing".equals(u.getAccount())) {
|
||||||
result.add(buildUiScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d));
|
result.add(buildUiScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d));
|
||||||
@@ -1209,7 +1213,6 @@ public class IZtCountService {
|
|||||||
dto.setProductProjectOnTimeRateScore(BigDecimal.valueOf(productProjectOnTimeRateScore));
|
dto.setProductProjectOnTimeRateScore(BigDecimal.valueOf(productProjectOnTimeRateScore));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<ZtBug> allBugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().select(SFunctionColums.bugColumes())
|
List<ZtBug> allBugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().select(SFunctionColums.bugColumes())
|
||||||
.eq(ZtBug::getOpenedby, u.getAccount())
|
.eq(ZtBug::getOpenedby, u.getAccount())
|
||||||
.in(ZtBug::getBugType,"releaseBug","prod")
|
.in(ZtBug::getBugType,"releaseBug","prod")
|
||||||
@@ -1239,6 +1242,7 @@ public class IZtCountService {
|
|||||||
}
|
}
|
||||||
dto.setBugScore(bugScore>20?BigDecimal.ZERO:BigDecimal.valueOf((20 - bugScore)));
|
dto.setBugScore(bugScore>20?BigDecimal.ZERO:BigDecimal.valueOf((20 - bugScore)));
|
||||||
}
|
}
|
||||||
|
dto.setProductBugRate(dto.getBugScore());
|
||||||
//线上重大
|
//线上重大
|
||||||
dto.setSeriousBug(BigDecimal.valueOf(allBugList.stream().filter(o -> Arrays.asList(1).contains(o.getSeverity())).count()));
|
dto.setSeriousBug(BigDecimal.valueOf(allBugList.stream().filter(o -> Arrays.asList(1).contains(o.getSeverity())).count()));
|
||||||
//线上轻微
|
//线上轻微
|
||||||
@@ -1504,6 +1508,7 @@ public class IZtCountService {
|
|||||||
Date thisDay = new Date();
|
Date thisDay = new Date();
|
||||||
thisDay.setMonth(date.getMonth());
|
thisDay.setMonth(date.getMonth());
|
||||||
thisDay.setDate(date.getDate());
|
thisDay.setDate(date.getDate());
|
||||||
|
thisDay.setYear(date.getYear());
|
||||||
thisDay.setHours(17);
|
thisDay.setHours(17);
|
||||||
thisDay.setMinutes(30);
|
thisDay.setMinutes(30);
|
||||||
thisDay.setSeconds(0);
|
thisDay.setSeconds(0);
|
||||||
@@ -2287,7 +2292,7 @@ public class IZtCountService {
|
|||||||
//需求准确性
|
//需求准确性
|
||||||
dataMap.put("accurateDemand", performanceDTO.getAccurateDemand()==null?"0": performanceDTO.getAccurateDemand().toString());
|
dataMap.put("accurateDemand", performanceDTO.getAccurateDemand()==null?"0": performanceDTO.getAccurateDemand().toString());
|
||||||
//项目准时率
|
//项目准时率
|
||||||
dataMap.put("productProjectOnTimeRateScore",performanceDTO.getProductProjectOnTimeRateScore()==null?"0": performanceDTO.getProductProjectOnTimeRateScore().multiply(BigDecimal.valueOf(100)).toString());
|
dataMap.put("productProjectOnTimeRateScore",performanceDTO.getProductProjectOnTimeRateScore()==null?"0": performanceDTO.getProductProjectOnTimeRateScore().toString());
|
||||||
//线上Bug得分 缺陷
|
//线上Bug得分 缺陷
|
||||||
dataMap.put("bugScope", performanceDTO.getBugScore()==null?"0": performanceDTO.getBugScore().toString());
|
dataMap.put("bugScope", performanceDTO.getBugScore()==null?"0": performanceDTO.getBugScore().toString());
|
||||||
//开发分配工时
|
//开发分配工时
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ 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.KanbanCellType;
|
import com.sa.zentao.enums.KanbanCellType;
|
||||||
|
import com.sa.zentao.enums.KanbanColumnType;
|
||||||
import com.sa.zentao.enums.ProjectTypeEnums;
|
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||||
|
import com.sa.zentao.utils.KanbanStageMapping;
|
||||||
import com.sa.zentao.mapper.ZtKanbancolumnMapper;
|
import com.sa.zentao.mapper.ZtKanbancolumnMapper;
|
||||||
import com.sa.zentao.mapper.ZtKanbanlaneMapper;
|
import com.sa.zentao.mapper.ZtKanbanlaneMapper;
|
||||||
import com.sa.zentao.qo.KanbanQo;
|
import com.sa.zentao.qo.KanbanQo;
|
||||||
@@ -17,6 +19,7 @@ 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 com.sa.zentao.utils.DateUtils;
|
||||||
import com.sa.zentao.utils.KanBanConstant;
|
import com.sa.zentao.utils.KanBanConstant;
|
||||||
|
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;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -37,6 +40,7 @@ import java.util.stream.Stream;
|
|||||||
* @since 2024-07-09
|
* @since 2024-07-09
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtKanbanlane> implements IZtKanbanlaneService {
|
public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtKanbanlane> implements IZtKanbanlaneService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -116,6 +120,16 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
st.setAssignedToName(ztUser.getNickname());
|
st.setAssignedToName(ztUser.getNickname());
|
||||||
st.setColor(ztUser.getColor());
|
st.setColor(ztUser.getColor());
|
||||||
}
|
}
|
||||||
|
ztUser = userMap.get(st.getProductUser());
|
||||||
|
if(ztUser!=null){
|
||||||
|
st.setProductUserName(ztUser.getNickname());
|
||||||
|
st.setProductUserColor(ztUser.getColor());
|
||||||
|
}
|
||||||
|
ztUser = userMap.get(st.getTestUser());
|
||||||
|
if(ztUser!=null){
|
||||||
|
st.setTestUserName(ztUser.getNickname());
|
||||||
|
st.setTestUserColor(ztUser.getColor());
|
||||||
|
}
|
||||||
if(product!=null){
|
if(product!=null){
|
||||||
st.setProductName(product.getName());
|
st.setProductName(product.getName());
|
||||||
}
|
}
|
||||||
@@ -243,14 +257,14 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
this.kanbancellService.updateById(tokanbancell);
|
this.kanbancellService.updateById(tokanbancell);
|
||||||
|
|
||||||
ActionType type= null;
|
ActionType type= null;
|
||||||
if("story".equalsIgnoreCase(tabType)){
|
if(KanbanCellType.STORY.getValue().equalsIgnoreCase(tabType)){
|
||||||
type=ActionType.XQ;
|
type=ActionType.XQ;
|
||||||
//需求
|
//需求
|
||||||
// storyChange(qo);
|
// storyChange(qo);
|
||||||
|
|
||||||
//testing 测试中
|
//testing 测试中
|
||||||
}
|
}
|
||||||
if("bug".equalsIgnoreCase(tabType)){
|
if(KanbanCellType.BUG.getValue().equalsIgnoreCase(tabType)){
|
||||||
type=ActionType.BUG;
|
type=ActionType.BUG;
|
||||||
//bug
|
//bug
|
||||||
// bugChange(qo);
|
// bugChange(qo);
|
||||||
@@ -261,7 +275,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
//closed 关闭
|
//closed 关闭
|
||||||
|
|
||||||
}
|
}
|
||||||
if("task".equalsIgnoreCase(tabType)){
|
if(KanbanCellType.TASK.getValue().equalsIgnoreCase(tabType)){
|
||||||
type=ActionType.RW;
|
type=ActionType.RW;
|
||||||
//task
|
//task
|
||||||
// taskChange(qo);
|
// taskChange(qo);
|
||||||
@@ -273,7 +287,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
//完成有新任务回退到进行中
|
//完成有新任务回退到进行中
|
||||||
|
|
||||||
//
|
//
|
||||||
// if("canceled".equalsIgnoreCase(statusType)){
|
// if(KanbanColumnType.TASK_CANCEL.getValue().equalsIgnoreCase(statusType)){
|
||||||
// //取消
|
// //取消
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -303,12 +317,15 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
List<String> carIds = new ArrayList<>(Arrays.asList(cell.getCards().split(",")));
|
List<String> carIds = new ArrayList<>(Arrays.asList(cell.getCards().split(",")));
|
||||||
if(carIds.contains(bussId.toString())){
|
if(carIds.contains(bussId.toString())){
|
||||||
thisZtKanbancell=cell;
|
thisZtKanbancell=cell;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> carIds = new ArrayList<>(Arrays.asList(thisZtKanbancell.getCards().split(",")));
|
List<String> carIds = new ArrayList<>(Arrays.asList(thisZtKanbancell.getCards().split(",")));
|
||||||
carIds.remove(bussId.toString());
|
while (carIds.contains(bussId.toString())) {
|
||||||
|
carIds.remove(bussId.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(CollectionUtils.isEmpty(carIds)){
|
if(CollectionUtils.isEmpty(carIds)){
|
||||||
thisZtKanbancell.setCards("");
|
thisZtKanbancell.setCards("");
|
||||||
@@ -317,8 +334,13 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
thisZtKanbancell.setCards(StringUtils.join(carIds,","));
|
thisZtKanbancell.setCards(StringUtils.join(carIds,","));
|
||||||
|
|
||||||
}
|
}
|
||||||
this.kanbancellService.updateById(thisZtKanbancell);
|
|
||||||
ZtKanbancell ztKanbanlane = this.baseMapper.getZtKanbanlane(type, toStatus, execId);
|
ZtKanbancell ztKanbanlane = this.baseMapper.getZtKanbanlane(type, toStatus, execId);
|
||||||
|
if(ztKanbanlane==null){
|
||||||
|
log.info("看板未获取到execId={} bussId={} type={} toStatus={}", execId, bussId, type, toStatus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.kanbancellService.updateById(thisZtKanbancell);
|
||||||
String cards = ztKanbanlane.getCards();
|
String cards = ztKanbanlane.getCards();
|
||||||
List l=StringUtils.isEmpty(cards)?new ArrayList<>():new ArrayList<>(Arrays.asList(cards.split(",")));
|
List l=StringUtils.isEmpty(cards)?new ArrayList<>():new ArrayList<>(Arrays.asList(cards.split(",")));
|
||||||
l.add(bussId.toString());
|
l.add(bussId.toString());
|
||||||
@@ -329,7 +351,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
@Override
|
@Override
|
||||||
public void addStory(Integer id, List<ZtStory> ztStories) {
|
public void addStory(Integer id, List<ZtStory> ztStories) {
|
||||||
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
||||||
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "story"));
|
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, KanbanCellType.STORY.getValue()));
|
||||||
|
|
||||||
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
||||||
|
|
||||||
@@ -382,7 +404,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
public void addTask(Integer id, List<ZtTask> asList) {
|
public void addTask(Integer id, List<ZtTask> asList) {
|
||||||
|
|
||||||
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
||||||
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "task"));
|
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, KanbanCellType.TASK.getValue()));
|
||||||
|
|
||||||
List<ZtKanbancolumnDTO> kanbancolumnList = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
List<ZtKanbancolumnDTO> kanbancolumnList = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
||||||
|
|
||||||
@@ -408,11 +430,13 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
|||||||
@Override
|
@Override
|
||||||
public void addBug(Integer id, List<ZtBug> asList) {
|
public void addBug(Integer id, List<ZtBug> asList) {
|
||||||
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
ZtKanbanlane lane = this.baseMapper.selectOne(new QueryWrapper<ZtKanbanlane>().lambda()
|
||||||
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "bug"));
|
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, KanbanCellType.BUG.getValue()));
|
||||||
|
|
||||||
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
|
||||||
|
|
||||||
List<ZtKanbancolumnDTO> backlog = ztKanbancolumnDTOS.stream().filter(o -> o.getType().equals("unconfirmed")).collect(Collectors.toList());
|
List<ZtKanbancolumnDTO> backlog = ztKanbancolumnDTOS.stream()
|
||||||
|
.filter(o -> o.getType().equals(KanbanColumnType.BUG_UNCONFIRMED.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
ZtKanbancolumnDTO ztKanbancolumnDTO = backlog.get(0);
|
ZtKanbancolumnDTO ztKanbancolumnDTO = backlog.get(0);
|
||||||
|
|
||||||
ZtKanbancell kanbancell = this.kanbancellService.getOne(new QueryWrapper<ZtKanbancell>().lambda()
|
ZtKanbancell kanbancell = this.kanbancellService.getOne(new QueryWrapper<ZtKanbancell>().lambda()
|
||||||
|
|||||||
@@ -88,17 +88,17 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
|||||||
Map<Integer,ZtStoryUser> sMap=getUserStoryMap(list);
|
Map<Integer,ZtStoryUser> sMap=getUserStoryMap(list);
|
||||||
|
|
||||||
for (ZtMeetingDTO d:list) {
|
for (ZtMeetingDTO d:list) {
|
||||||
StringBuilder b=new StringBuilder();
|
// StringBuilder b=new StringBuilder();
|
||||||
if(!StringUtils.isEmpty(d.getUsers())){
|
// if(!StringUtils.isEmpty(d.getUsers())){
|
||||||
String[] split = d.getUsers().split(",");
|
// String[] split = d.getUsers().split(",");
|
||||||
for (String s:split) {
|
// for (String s:split) {
|
||||||
ZtUser ztUser = userMap.get(s);
|
// ZtUser ztUser = userMap.get(s);
|
||||||
if(ztUser!=null){
|
// if(ztUser!=null){
|
||||||
b.append(ztUser.getNickname()).append(",");
|
// b.append(ztUser.getNickname()).append(",");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
d.setUsersName(b.toString());
|
// d.setUsersName(b.toString());
|
||||||
}
|
// }
|
||||||
StringBuilder storyStr=new StringBuilder();
|
StringBuilder storyStr=new StringBuilder();
|
||||||
if(!StringUtils.isEmpty( d.getStoryIds())){
|
if(!StringUtils.isEmpty( d.getStoryIds())){
|
||||||
String[] split = d.getStoryIds().split(",");
|
String[] split = d.getStoryIds().split(",");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.sa.zentao.service.impl;
|
package com.sa.zentao.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@@ -687,4 +688,63 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
|||||||
|
|
||||||
return ztProjectDTOS.stream().collect(Collectors.groupingBy(ZtProductDTO::getProgram));
|
return ztProjectDTOS.stream().collect(Collectors.groupingBy(ZtProductDTO::getProgram));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<ZtProjectDTO> getExecutionByProductId(ZtProjectQo qo) {
|
||||||
|
Integer productId = qo.getProductId();
|
||||||
|
if (productId == null || productId == 0) {
|
||||||
|
throw new BusinessException("产品ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询产品关联的项目
|
||||||
|
List<ZtProjectproduct> projectproductlist = this.projectproductService.list(
|
||||||
|
new QueryWrapper<ZtProjectproduct>().lambda()
|
||||||
|
.eq(ZtProjectproduct::getProduct, productId)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(projectproductlist)) {
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取项目ID列表
|
||||||
|
List<Integer> projectIds = projectproductlist.stream()
|
||||||
|
.map(ZtProjectproduct::getProject)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 查询项目关联的迭代
|
||||||
|
List<ZtExecutionproject> executionprojectList = this.executionprojectService.list(
|
||||||
|
new QueryWrapper<ZtExecutionproject>().lambda()
|
||||||
|
.in(ZtExecutionproject::getProject, projectIds)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(executionprojectList)) {
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取迭代ID列表
|
||||||
|
List<Integer> executionIds = executionprojectList.stream()
|
||||||
|
.map(ZtExecutionproject::getExecution)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 分页查询迭代,按ID倒序排列
|
||||||
|
com.github.pagehelper.Page<ZtProjectDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
|
LambdaQueryWrapper<ZtProject> queryWrapper = new QueryWrapper<ZtProject>().lambda()
|
||||||
|
.in(ZtProject::getId, executionIds);
|
||||||
|
|
||||||
|
// 添加名称搜索
|
||||||
|
if (!StringUtils.isEmpty(qo.getName())) {
|
||||||
|
queryWrapper.like(ZtProject::getName, qo.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
queryWrapper.orderByDesc(ZtProject::getId);
|
||||||
|
|
||||||
|
List<ZtProject> executionList = this.projectService.list(queryWrapper);
|
||||||
|
|
||||||
|
// 转换为DTO
|
||||||
|
List<ZtProjectDTO> dtoList = BeanCopyUtil.copyListProperties(executionList, ZtProjectDTO::new);
|
||||||
|
|
||||||
|
PageInfo<ZtProjectDTO> ztProjectDTOPageInfo = new PageInfo<>(dtoList);
|
||||||
|
ztProjectDTOPageInfo.setTotal(page.getTotal());
|
||||||
|
return ztProjectDTOPageInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,8 +313,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
public void projectClose(ZtProjectDTO dto) {
|
public void projectClose(ZtProjectDTO dto) {
|
||||||
|
|
||||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||||
if (ztProject == null || "closed".equalsIgnoreCase(ztProject.getStatus())) {
|
if (ztProject == null) {
|
||||||
throw new BusinessException("未查询到");
|
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||||
|
}
|
||||||
|
if ("closed".equalsIgnoreCase(ztProject.getStatus())) {
|
||||||
|
throw new BusinessException("项目已关闭,无法重复关闭,项目ID: " + dto.getId());
|
||||||
}
|
}
|
||||||
ztProject.setRealEnd(dto.getClosedDate());
|
ztProject.setRealEnd(dto.getClosedDate());
|
||||||
ztProject.setLastEditedDate(new Date());
|
ztProject.setLastEditedDate(new Date());
|
||||||
@@ -350,6 +353,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public void projectStart(ZtProjectDTO dto) {
|
public void projectStart(ZtProjectDTO dto) {
|
||||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||||
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
||||||
@@ -385,8 +389,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
@Override
|
@Override
|
||||||
public void projectDeleted(ZtProjectDTO dto) {
|
public void projectDeleted(ZtProjectDTO dto) {
|
||||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||||
if (ztProject == null || "1".equalsIgnoreCase(ztProject.getDeleted())) {
|
if (ztProject == null) {
|
||||||
throw new BusinessException("未查询到");
|
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||||
|
}
|
||||||
|
if ("1".equalsIgnoreCase(ztProject.getDeleted())) {
|
||||||
|
throw new BusinessException("项目已删除,无法重复删除,项目ID: " + dto.getId());
|
||||||
}
|
}
|
||||||
ztProject.setDeleted("1");
|
ztProject.setDeleted("1");
|
||||||
ztProject.setCanceledBy(RiskUserThreadLocal.get().getName());
|
ztProject.setCanceledBy(RiskUserThreadLocal.get().getName());
|
||||||
@@ -421,8 +428,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
@Override
|
@Override
|
||||||
public void projectActivated(ZtProjectDTO dto) {
|
public void projectActivated(ZtProjectDTO dto) {
|
||||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||||
if (ztProject == null || !"closed".equalsIgnoreCase(ztProject.getStatus())) {
|
if (ztProject == null) {
|
||||||
throw new BusinessException("未查询到");
|
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||||
|
}
|
||||||
|
if (!"closed".equalsIgnoreCase(ztProject.getStatus())) {
|
||||||
|
throw new BusinessException("项目未关闭,无法激活,当前状态: " + ztProject.getStatus() + ",项目ID: " + dto.getId());
|
||||||
}
|
}
|
||||||
LambdaUpdateWrapper<ZtProject> updateWrapper = new UpdateWrapper<ZtProject>().lambda().set(ZtProject::getStatus, "doing")
|
LambdaUpdateWrapper<ZtProject> updateWrapper = new UpdateWrapper<ZtProject>().lambda().set(ZtProject::getStatus, "doing")
|
||||||
.set(ZtProject::getRealEnd,null)
|
.set(ZtProject::getRealEnd,null)
|
||||||
@@ -457,8 +467,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
@Override
|
@Override
|
||||||
public void projectSuspended(ZtProjectDTO dto) {
|
public void projectSuspended(ZtProjectDTO dto) {
|
||||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||||
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
if (ztProject == null) {
|
||||||
throw new BusinessException("未查询到");
|
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||||
|
}
|
||||||
|
if (!"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
||||||
|
throw new BusinessException("项目状态不是等待状态,无法挂起,当前状态: " + ztProject.getStatus() + ",项目ID: " + dto.getId());
|
||||||
}
|
}
|
||||||
ztProject.setStatus("suspended");
|
ztProject.setStatus("suspended");
|
||||||
ztProject.setLastEditedBy(RiskUserThreadLocal.get().getName());
|
ztProject.setLastEditedBy(RiskUserThreadLocal.get().getName());
|
||||||
|
|||||||
@@ -368,9 +368,9 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
List<ZtStory> ztStories = CollectionUtils.isEmpty(storyList)?new ArrayList<>():storyService.listByIds(storyList);
|
List<ZtStory> ztStories = CollectionUtils.isEmpty(storyList)?new ArrayList<>():storyService.listByIds(storyList);
|
||||||
|
|
||||||
List<ZtBug> bugs =CollectionUtils.isEmpty(bugList)?new ArrayList<>(): bugService.listByIds(bugList);
|
List<ZtBug> bugs =CollectionUtils.isEmpty(bugList)?new ArrayList<>(): bugService.listByIds(bugList);
|
||||||
long notTested = ztStories.stream().filter(o -> !o.getStage().equals(StoryStageEnums.productVerified.getValue())).count();
|
List<ZtStory> notProductYsList = ztStories.stream().filter(o -> !o.getStage().equals(StoryStageEnums.productVerified.getValue())).toList();
|
||||||
if(notTested>0){
|
if(!CollectionUtils.isEmpty(notProductYsList)){
|
||||||
throw new BusinessException("当前需求存在未测试完成的请检查");
|
throw new BusinessException("当前需求存在未产品验收的需求请检查 id="+notProductYsList.get(0).getId()+" name="+notProductYsList.get(0).getTitle());
|
||||||
}
|
}
|
||||||
//'active','resolved','closed'?
|
//'active','resolved','closed'?
|
||||||
long count = bugs.stream().filter(o -> !Arrays.asList("resolved","closed").contains(o.getStatus())).count();
|
long count = bugs.stream().filter(o -> !Arrays.asList("resolved","closed").contains(o.getStatus())).count();
|
||||||
@@ -391,8 +391,6 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(ztStories)){
|
if(!CollectionUtils.isEmpty(ztStories)){
|
||||||
sendReleaseMail(ztStories);
|
sendReleaseMail(ztStories);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
actionService.addAction(ActionType.FB, ActionStatus.FBSB, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
actionService.addAction(ActionType.FB, ActionStatus.FBSB, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
d.setProductUserName(ztUser.getNickname());
|
d.setProductUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
ztUser = userMap.get(d.getTestUser());
|
||||||
|
if (ztUser != null) {
|
||||||
|
d.setTestUserName(ztUser.getNickname());
|
||||||
|
}
|
||||||
List<ZtProject> ztProjectList = executionMapByStory.get(d.getId());
|
List<ZtProject> ztProjectList = executionMapByStory.get(d.getId());
|
||||||
if (!CollectionUtils.isEmpty(ztProjectList)) {
|
if (!CollectionUtils.isEmpty(ztProjectList)) {
|
||||||
// d.setExecution(ztProject.getId());
|
// d.setExecution(ztProject.getId());
|
||||||
@@ -976,16 +980,16 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
public void testSubmitVerified(ZtStoryDTO qo) {
|
public void testSubmitVerified(ZtStoryDTO qo) {
|
||||||
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
||||||
if(ztStory==null){
|
if(ztStory==null){
|
||||||
throw new BusinessException("未查询到需求");
|
throw new BusinessException("未查询到需求,需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
|
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
|
||||||
throw new BusinessException("需求状态不对");
|
throw new BusinessException("需求状态不是激活状态,无法提交验收,当前状态: " + ztStory.getStatus() + ",需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
if(!StoryStageEnums.tested.getValue().equals(ztStory.getStage())){
|
if(!StoryStageEnums.tested.getValue().equals(ztStory.getStage())){
|
||||||
throw new BusinessException("需求状态不对");
|
throw new BusinessException("需求阶段不是测试完毕,无法提交验收,当前阶段: " + ztStory.getStage() + ",需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
if(ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
|
if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
|
||||||
throw new BusinessException("无需内部验收,不需要提交");
|
throw new BusinessException("无需内部验收,不需要提交,需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
//产品验收中
|
//产品验收中
|
||||||
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
|
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
|
||||||
@@ -1010,16 +1014,16 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
public void storyProductUserYs(ZtStoryDTO qo) {
|
public void storyProductUserYs(ZtStoryDTO qo) {
|
||||||
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
||||||
if(ztStory==null){
|
if(ztStory==null){
|
||||||
throw new BusinessException("未查询到需求");
|
throw new BusinessException("未查询到需求,需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
|
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
|
||||||
throw new BusinessException("需求状态不对");
|
throw new BusinessException("需求状态不是激活状态,无法验收,当前状态: " + ztStory.getStatus() + ",需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
if(!StoryStageEnums.productWaitVerified.getValue().equals(ztStory.getStage())){
|
if(!StoryStageEnums.productWaitVerified.getValue().equals(ztStory.getStage())){
|
||||||
throw new BusinessException("需求状态不对");
|
throw new BusinessException("需求阶段不是待验收状态,无法验收,当前阶段: " + ztStory.getStage() + ",需求ID: " + qo.getId());
|
||||||
}
|
}
|
||||||
//产品验收中
|
//产品验收中
|
||||||
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
|
ztStory.setStage(StoryStageEnums.productVerified.getValue());
|
||||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
ztStory.setLastediteddate(new Date());
|
ztStory.setLastediteddate(new Date());
|
||||||
ztStory.setInnerYsTime(new Date());
|
ztStory.setInnerYsTime(new Date());
|
||||||
@@ -1053,7 +1057,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOPRODUCTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOPRODUCTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), "", "");
|
RiskUserThreadLocal.get().getName(), "", dto.getAssignedTo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1067,7 +1071,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOTESTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOTESTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), "", "");
|
RiskUserThreadLocal.get().getName(), "", dto.getAssignedTo());
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SearchDTO> searchBug(SearchQo qo) {
|
private List<SearchDTO> searchBug(SearchQo qo) {
|
||||||
@@ -1486,16 +1490,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
@Override
|
@Override
|
||||||
public void taskFinishChangeStatus(Integer story, String finishBy, TaskType type, Boolean cancelFlag) {
|
public void taskFinishChangeStatus(Integer story, String finishBy, TaskType type, Boolean cancelFlag) {
|
||||||
ZtStory ztStory = this.getById(story);
|
ZtStory ztStory = this.getById(story);
|
||||||
if(ztStory == null) {
|
if(ztStory == null|| story == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ztStory != null && ztStory.getStatus().equals("closed")) {
|
if (ztStory.getStatus().equals("closed")) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (type != TaskType.test && type != TaskType.devel) {
|
|
||||||
// return;
|
|
||||||
}
|
|
||||||
if (story == null || story == 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cancelFlag && type == TaskType.devel) {
|
if (cancelFlag && type == TaskType.devel) {
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ import com.sa.zentao.qo.StoryQo;
|
|||||||
import com.sa.zentao.qo.ZtProjectQo;
|
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.*;
|
||||||
import com.sa.zentao.utils.BeanCopyUtilCallBack;
|
|
||||||
import com.sa.zentao.utils.SendEmail;
|
|
||||||
import com.sa.zentao.utils.VxMessageUtils;
|
|
||||||
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;
|
||||||
@@ -81,6 +78,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
@Autowired
|
@Autowired
|
||||||
private VxService vxService;
|
private VxService vxService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtProjectstoryService projectstoryService;
|
||||||
|
|
||||||
@Value("${file.backUrl}")
|
@Value("${file.backUrl}")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
this.baseMapper.insert(s);
|
this.baseMapper.insert(s);
|
||||||
fileService.updateFile(dto.getFiles(), s.getId(), FileTypes.userStory);
|
fileService.updateFile(dto.getFiles(), s.getId(), FileTypes.userStory);
|
||||||
|
|
||||||
ZtStoryUserspec spec= buildSpec(dto,s);
|
ZtStoryUserspec spec = buildSpec(dto, s);
|
||||||
storyUserspecService.save(spec);
|
storyUserspecService.save(spec);
|
||||||
|
|
||||||
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct() + "", null, null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct() + "", null, null,
|
||||||
@@ -125,6 +125,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
spec.setSpec(dto.getSpec());
|
spec.setSpec(dto.getSpec());
|
||||||
spec.setVerify(dto.getVerify());
|
spec.setVerify(dto.getVerify());
|
||||||
spec.setFiles(dto.getFileUrl());
|
spec.setFiles(dto.getFileUrl());
|
||||||
|
spec.setStoryBackground(dto.getStoryBackground());
|
||||||
return spec;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +221,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
ztStory.setVerify(null);
|
ztStory.setVerify(null);
|
||||||
this.baseMapper.updateById(ztStory);
|
this.baseMapper.updateById(ztStory);
|
||||||
|
|
||||||
ZtStoryUserspec spec = this.storyUserspecService.getOne(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id));
|
ZtStoryUserspec spec = this.storyUserspecService.getOne(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id).last(" limit 1"));
|
||||||
if (spec == null) {
|
if (spec == null) {
|
||||||
spec = new ZtStoryUserspec();
|
spec = new ZtStoryUserspec();
|
||||||
spec.setStory(id);
|
spec.setStory(id);
|
||||||
@@ -229,6 +230,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
spec.setSpec(dto.getSpec());
|
spec.setSpec(dto.getSpec());
|
||||||
spec.setVerify(dto.getVerify());
|
spec.setVerify(dto.getVerify());
|
||||||
spec.setFiles(dto.getFileUrl());
|
spec.setFiles(dto.getFileUrl());
|
||||||
|
spec.setStoryBackground(dto.getStoryBackground());
|
||||||
storyUserspecService.save(spec);
|
storyUserspecService.save(spec);
|
||||||
} else {
|
} else {
|
||||||
spec.setVersion(1);
|
spec.setVersion(1);
|
||||||
@@ -236,9 +238,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
spec.setSpec(dto.getSpec());
|
spec.setSpec(dto.getSpec());
|
||||||
spec.setVerify(dto.getVerify());
|
spec.setVerify(dto.getVerify());
|
||||||
spec.setFiles(dto.getFileUrl());
|
spec.setFiles(dto.getFileUrl());
|
||||||
|
spec.setStoryBackground(dto.getStoryBackground());
|
||||||
storyUserspecService.update(new UpdateWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id)
|
storyUserspecService.update(new UpdateWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id)
|
||||||
.set(ZtStoryUserspec::getSpec, dto.getSpec())
|
.set(ZtStoryUserspec::getSpec, dto.getSpec())
|
||||||
.set(ZtStoryUserspec::getVerify, dto.getVerify())
|
.set(ZtStoryUserspec::getVerify, dto.getVerify())
|
||||||
|
.set(ZtStoryUserspec::getStoryBackground, dto.getStoryBackground())
|
||||||
.set(ZtStoryUserspec::getFiles, dto.getFileUrl())
|
.set(ZtStoryUserspec::getFiles, dto.getFileUrl())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -246,13 +250,12 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
fileService.updateFile(dto.getFiles(), ztStory.getId(), FileTypes.userStory);
|
fileService.updateFile(dto.getFiles(), ztStory.getId(), FileTypes.userStory);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<ZtStoryUserDTO>> getKanban(Integer productId) {
|
public Map<String, List<ZtStoryUserDTO>> getKanban(Integer productId) {
|
||||||
List<ZtStoryUser> ztStoryUsers = this.baseMapper.selectList(new QueryWrapper<ZtStoryUser>()
|
List<ZtStoryUser> ztStoryUsers = this.baseMapper.selectList(new QueryWrapper<ZtStoryUser>()
|
||||||
.lambda().select(ZtStoryUser::getId,ZtStoryUser::getPri,ZtStoryUser::getTitle,ZtStoryUser::getStage,ZtStoryUser::getStatus,ZtStoryUser::getOpenedby,ZtStoryUser::getOpeneddate,ZtStoryUser::getLastediteddate,ZtStoryUser::getProductUser)
|
.lambda().select(ZtStoryUser::getId, ZtStoryUser::getPri, ZtStoryUser::getTitle, ZtStoryUser::getStage, ZtStoryUser::getStatus, ZtStoryUser::getOpenedby, ZtStoryUser::getOpeneddate, ZtStoryUser::getLastediteddate, ZtStoryUser::getProductUser)
|
||||||
.eq(ZtStoryUser::getProduct, productId).orderByDesc(ZtStoryUser::getId));
|
.eq(ZtStoryUser::getProduct, productId).orderByDesc(ZtStoryUser::getId));
|
||||||
Map<String, List<ZtStoryUserDTO>> map = new HashMap<>();
|
Map<String, List<ZtStoryUserDTO>> map = new HashMap<>();
|
||||||
Map<String, ZtUser> stringZtUserMap = this.userService.userMapByIds(null);
|
Map<String, ZtUser> stringZtUserMap = this.userService.userMapByIds(null);
|
||||||
@@ -261,12 +264,12 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
@Override
|
@Override
|
||||||
public void callBack(ZtStoryUser t, ZtStoryUserDTO s) {
|
public void callBack(ZtStoryUser t, ZtStoryUserDTO s) {
|
||||||
ZtUser ztUser = stringZtUserMap.get(t.getOpenedby());
|
ZtUser ztUser = stringZtUserMap.get(t.getOpenedby());
|
||||||
if(ztUser!=null){
|
if (ztUser != null) {
|
||||||
s.setOpenedbyName(ztUser.getNickname());
|
s.setOpenedbyName(ztUser.getNickname());
|
||||||
s.setColor(ztUser.getColor());
|
s.setColor(ztUser.getColor());
|
||||||
}
|
}
|
||||||
ztUser = stringZtUserMap.get(t.getProductUser());
|
ztUser = stringZtUserMap.get(t.getProductUser());
|
||||||
if(ztUser!=null){
|
if (ztUser != null) {
|
||||||
s.setProductUserName(ztUser.getNickname());
|
s.setProductUserName(ztUser.getNickname());
|
||||||
s.setProductUserColor(ztUser.getColor());
|
s.setProductUserColor(ztUser.getColor());
|
||||||
}
|
}
|
||||||
@@ -274,15 +277,15 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
map.put("active",ztStoryUserDTOS.stream().filter(o->"active".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("active", ztStoryUserDTOS.stream().filter(o -> "active".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("unconfirmed",ztStoryUserDTOS.stream().filter(o->"unconfirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("unconfirmed", ztStoryUserDTOS.stream().filter(o -> "unconfirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("waitcommunicate",ztStoryUserDTOS.stream().filter(o->"waitcommunicate".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("waitcommunicate", ztStoryUserDTOS.stream().filter(o -> "waitcommunicate".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("waitdesign",ztStoryUserDTOS.stream().filter(o->"waitdesign".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("waitdesign", ztStoryUserDTOS.stream().filter(o -> "waitdesign".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("designdoing",ztStoryUserDTOS.stream().filter(o->"designdoing".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("designdoing", ztStoryUserDTOS.stream().filter(o -> "designdoing".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
|
|
||||||
map.put("designdone",ztStoryUserDTOS.stream().filter(o->"designdone".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("designdone", ztStoryUserDTOS.stream().filter(o -> "designdone".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("storyunconfirmed",ztStoryUserDTOS.stream().filter(o->"storyunconfirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("storyunconfirmed", ztStoryUserDTOS.stream().filter(o -> "storyunconfirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
map.put("confirmed",ztStoryUserDTOS.stream().filter(o->"confirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
map.put("confirmed", ztStoryUserDTOS.stream().filter(o -> "confirmed".equals(o.getStatus())).collect(Collectors.toList()));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,18 +301,18 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Integer> pIds = this.projectService.authProductList();
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
if(CollectionUtils.isEmpty(pIds)&&CollectionUtils.isEmpty(qo.getStoryIds())){
|
if (CollectionUtils.isEmpty(pIds) && CollectionUtils.isEmpty(qo.getStoryIds())) {
|
||||||
return new PageInfo<ZtStoryUserDTO>();
|
return new PageInfo<ZtStoryUserDTO>();
|
||||||
}
|
}
|
||||||
if(qo.getProductId()!=null&&qo.getProductId()!=0){
|
if (qo.getProductId() != null && qo.getProductId() != 0) {
|
||||||
qo.setProductIds(Arrays.asList(qo.getProductId()));
|
qo.setProductIds(Arrays.asList(qo.getProductId()));
|
||||||
}else{
|
} else {
|
||||||
qo.setProductIds(pIds);
|
qo.setProductIds(pIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(qo.getStatusList())&&qo.getStatusList().contains("unconfirmed")) {
|
if (!CollectionUtils.isEmpty(qo.getStatusList()) && qo.getStatusList().contains("unconfirmed")) {
|
||||||
qo.getStatusList().addAll(Arrays.asList("unconfirmed",
|
qo.getStatusList().addAll(Arrays.asList("unconfirmed",
|
||||||
"waitcommunicate","waitdesign","designdoing","designdone","storyunconfirmed"));
|
"waitcommunicate", "waitdesign", "designdoing", "designdone", "storyunconfirmed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
@@ -320,7 +323,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
|
Map<Integer, List<ZtStory>> storyMap = getStoryMap(list);
|
||||||
|
//story - exec
|
||||||
|
Map<Integer,List<ZtProject>> execMap= getExecMap(storyMap);
|
||||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
||||||
for (ZtStoryUserDTO d : list) {
|
for (ZtStoryUserDTO d : list) {
|
||||||
|
|
||||||
@@ -369,31 +374,77 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
d.setProductUserName(ztUser.getNickname());
|
d.setProductUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ZtStory> ztStories = storyUserMap.get(d.getId());
|
List<ZtStory> ztStories = storyMap.get(d.getId());
|
||||||
if (!CollectionUtils.isEmpty(ztStories)) {
|
if (!CollectionUtils.isEmpty(ztStories)) {
|
||||||
d.setStoryList(ztStories.stream().map(o ->o.getId()+":"+o.getTitle()).collect(Collectors.joining(",")));
|
for (ZtStory story:ztStories){
|
||||||
d.setSList(CollectionUtils.isEmpty(ztStories)?null:BeanCopyUtil.copyListProperties(ztStories,ZtStoryDTO::new));
|
List<ZtProject> execList = execMap.get(story.getId());
|
||||||
}
|
if(!CollectionUtils.isEmpty(execList)){
|
||||||
|
if(CollectionUtils.isEmpty(d.getExecList())){
|
||||||
|
d.setExecList(new HashSet<>());
|
||||||
String reName = d.getTitle();
|
}
|
||||||
String reUrl = url+"/#/product-user-story-info/"+d.getId();
|
d.getExecList().addAll(execList);
|
||||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
}
|
||||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
|
||||||
try {
|
|
||||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
|
||||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
|
||||||
hyperlink.setHyperlinkData(hyperlinkData);
|
|
||||||
d.setUrl(hyperlink );
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(), e);
|
|
||||||
d.setUrl(null );
|
|
||||||
}
|
}
|
||||||
|
d.setStoryList(ztStories.stream().map(o -> o.getId() + ":" + o.getTitle()).collect(Collectors.joining(",")));
|
||||||
|
d.setSList(CollectionUtils.isEmpty(ztStories) ? null : BeanCopyUtil.copyListProperties(ztStories, ZtStoryDTO::new));
|
||||||
|
}
|
||||||
|
d.setLinkUrl(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new PageInfo<ZtStoryUserDTO>(list);
|
return new PageInfo<ZtStoryUserDTO>(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<Integer, List<ZtProject>> getExecMap(Map<Integer, List<ZtStory>> storyMap) {
|
||||||
|
if(storyMap==null||storyMap.isEmpty()){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
// 收集到指定类型的列表(比如ArrayList),还可扩展去重、排序等
|
||||||
|
List<ZtStory> storyList = storyMap.values()
|
||||||
|
.stream()
|
||||||
|
.filter(list -> list != null)
|
||||||
|
.flatMap(List::stream)
|
||||||
|
// 自定义收集器:指定ArrayList,还可加.distinct()去重
|
||||||
|
.collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
if(CollectionUtils.isEmpty(storyList)){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
|
.eq(ZtProjectstory::getType,ProjectTypeEnums.execution.getValue())
|
||||||
|
.in(ZtProjectstory::getStory, storyList.stream().map(o -> o.getId()).collect(Collectors.toUnmodifiableList())));
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
List<ZtProject> ztExecList = this.projectService.listByIds(list.stream().map(o -> o.getProject()).collect(Collectors.toUnmodifiableList()));
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
// 第一步:先构建 projectId -> ZtProject 的映射(方便快速查找)
|
||||||
|
Map<Integer, ZtProject> projectIdToProjectMap = ztExecList.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
ZtProject::getId, // key:项目ID
|
||||||
|
project -> project, // value:项目对象
|
||||||
|
(existing, replacement) -> existing // 处理重复projectId的情况,保留原有值
|
||||||
|
));
|
||||||
|
|
||||||
|
// 第二步:按story分组,收集对应的ZtProject列表
|
||||||
|
Map<Integer, List<ZtProject>> storyToProjectsMap = list.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
ZtProjectstory::getStory, // 分组key:story字段
|
||||||
|
// 分组value:将每个ZtProjectstory对应的project转换成ZtProject,并收集为列表
|
||||||
|
Collectors.mapping(
|
||||||
|
projectStory -> projectIdToProjectMap.get(projectStory.getProject()),
|
||||||
|
// 过滤掉null(防止projectId不存在的情况),并收集为List
|
||||||
|
Collectors.filtering(
|
||||||
|
project -> project != null,
|
||||||
|
Collectors.toList()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
// 最终返回这个Map(你可以根据需要调整返回逻辑)
|
||||||
|
return storyToProjectsMap;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void changeStatus(ZtStoryUserDTO dto) {
|
public void changeStatus(ZtStoryUserDTO dto) {
|
||||||
@@ -420,8 +471,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
.eq(ZtStoryUser::getDeleted, "0")
|
.eq(ZtStoryUser::getDeleted, "0")
|
||||||
|
|
||||||
.orderByDesc(ZtStoryUser::getId);
|
.orderByDesc(ZtStoryUser::getId);
|
||||||
eq.select(ZtStoryUser::getId,ZtStoryUser::getTitle,ZtStoryUser::getProduct,
|
eq.select(ZtStoryUser::getId, ZtStoryUser::getTitle, ZtStoryUser::getProduct,
|
||||||
ZtStoryUser::getOpenedby,ZtStoryUser::getAssignedto
|
ZtStoryUser::getOpenedby, ZtStoryUser::getAssignedto
|
||||||
);
|
);
|
||||||
List<ZtStoryUser> ztStories = this.baseMapper.selectList(eq);
|
List<ZtStoryUser> ztStories = this.baseMapper.selectList(eq);
|
||||||
if (CollectionUtils.isEmpty(ztStories)) {
|
if (CollectionUtils.isEmpty(ztStories)) {
|
||||||
@@ -461,7 +512,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
actionStatus = ActionStatus.PSBTG;
|
actionStatus = ActionStatus.PSBTG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dto.getRevieweResult() != 1){
|
if (dto.getRevieweResult() != 1) {
|
||||||
ZtUser u = this.userService.getByAccount(ztStory.getOpenedby());
|
ZtUser u = this.userService.getByAccount(ztStory.getOpenedby());
|
||||||
if (u != null && !StringUtils.isEmpty(u.getEmail())) {
|
if (u != null && !StringUtils.isEmpty(u.getEmail())) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
@@ -486,7 +537,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lambda.set(ZtStoryreview::getReviewdate, new Date());
|
lambda.set(ZtStoryreview::getReviewdate, new Date());
|
||||||
lambda.eq(ZtStoryreview::getStory, ztStory.getId());
|
lambda.eq(ZtStoryreview::getStory, ztStory.getId());
|
||||||
lambda.eq(ZtStoryreview::getReviewer, RiskUserThreadLocal.get().getName());
|
lambda.eq(ZtStoryreview::getReviewer, RiskUserThreadLocal.get().getName());
|
||||||
@@ -527,10 +577,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
//添加action
|
//添加action
|
||||||
actionService.addAction(ActionType.USERXQ, actionStatus, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
actionService.addAction(ActionType.USERXQ, actionStatus, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||||
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedto());
|
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedto());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,7 +608,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
dto.setProductUserName(ztUser.getNickname());
|
dto.setProductUserName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(Arrays.asList(dto));
|
Map<Integer, List<ZtStory>> storyUserMap = getStoryMap(Arrays.asList(dto));
|
||||||
List<ZtStory> ztStories = storyUserMap.get(d.getId());
|
List<ZtStory> ztStories = storyUserMap.get(d.getId());
|
||||||
if (!CollectionUtils.isEmpty(ztStories)) {
|
if (!CollectionUtils.isEmpty(ztStories)) {
|
||||||
dto.setStoryList(ztStories.stream().map(o -> o.getTitle()).collect(Collectors.joining(",")));
|
dto.setStoryList(ztStories.stream().map(o -> o.getTitle()).collect(Collectors.joining(",")));
|
||||||
@@ -615,8 +661,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
List<ZtStory> list = this.storyService.list(new QueryWrapper<ZtStory>().lambda().eq(ZtStory::getUserStory, dto.getId()));
|
List<ZtStory> list = this.storyService.list(new QueryWrapper<ZtStory>().lambda().eq(ZtStory::getUserStory, dto.getId()));
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(list, ZtStoryDTO::new);
|
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(list, ZtStoryDTO::new);
|
||||||
if (!CollectionUtils.isEmpty(storyDTOList)) {
|
Map<Integer,List<ZtProject>> execMap= getExecMap(list.stream().collect(Collectors.groupingBy(ZtStory::getId)));
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(storyDTOList)) {
|
||||||
for (ZtStoryDTO storyDTO : storyDTOList) {
|
for (ZtStoryDTO storyDTO : storyDTOList) {
|
||||||
ztUser = userMap.get(storyDTO.getAssignedTo());
|
ztUser = userMap.get(storyDTO.getAssignedTo());
|
||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
@@ -626,10 +673,19 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
if (ztUser != null) {
|
if (ztUser != null) {
|
||||||
storyDTO.setOpenedbyName(ztUser.getNickname());
|
storyDTO.setOpenedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
|
List<ZtProject> execList = execMap.get(storyDTO.getId());
|
||||||
|
if(!CollectionUtils.isEmpty(execList)){
|
||||||
|
if(CollectionUtils.isEmpty(dto.getExecList())){
|
||||||
|
dto.setExecList(new HashSet<>());
|
||||||
|
}
|
||||||
|
dto.getExecList().addAll(execList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.setSList(storyDTOList);
|
dto.setSList(storyDTOList);
|
||||||
}
|
}
|
||||||
|
//story - exec
|
||||||
|
|
||||||
}
|
}
|
||||||
List<ZtStoryUserTask> tasks = this.storyUserTaskService.list(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getUserStoryId, dto.getId()));
|
List<ZtStoryUserTask> tasks = this.storyUserTaskService.list(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getUserStoryId, dto.getId()));
|
||||||
if (!CollectionUtils.isEmpty(tasks)) {
|
if (!CollectionUtils.isEmpty(tasks)) {
|
||||||
@@ -651,10 +707,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
dto.setViews(rMap.get(d.getId()));
|
dto.setViews(rMap.get(d.getId()));
|
||||||
|
|
||||||
List<ZtStoryUserspec> specList = this.storyUserspecService.list(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, dto.getId()));
|
List<ZtStoryUserspec> specList = this.storyUserspecService.list(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, dto.getId()));
|
||||||
if(!CollectionUtils.isEmpty(specList)){
|
if (!CollectionUtils.isEmpty(specList)) {
|
||||||
ZtStoryUserspec ztStoryUserspec = specList.get(0);
|
ZtStoryUserspec ztStoryUserspec = specList.get(0);
|
||||||
dto.setSpec(ztStoryUserspec.getSpec());
|
dto.setSpec(ztStoryUserspec.getSpec());
|
||||||
dto.setVerify(ztStoryUserspec.getVerify());
|
dto.setVerify(ztStoryUserspec.getVerify());
|
||||||
|
dto.setStoryBackground(ztStoryUserspec.getStoryBackground());
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
@@ -707,7 +764,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeStatus(Integer id, UserStoryEnums status) {
|
public void changeStatus(Integer id, UserStoryEnums status) {
|
||||||
ZtStoryUser storyUser = this.baseMapper.selectById(id);
|
ZtStoryUser storyUser = this.baseMapper.selectById(id);
|
||||||
@@ -730,24 +786,24 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
|
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
|
||||||
|
|
||||||
//需求已确认
|
//需求已确认
|
||||||
this.sendDesigndoneMessage(storyUser.getId(),ztProduct.getPo());
|
this.sendDesigndoneMessage(storyUser.getId(), ztProduct.getPo());
|
||||||
}
|
}
|
||||||
if (UserStoryEnums.DQR == status) {
|
if (UserStoryEnums.DQR == status) {
|
||||||
//提交交付物发送给创建人
|
//提交交付物发送给创建人
|
||||||
this.sendSubmitMessage(storyUser.getId(),storyUser.getOpenedby());
|
this.sendSubmitMessage(storyUser.getId(), storyUser.getOpenedby());
|
||||||
}
|
}
|
||||||
if (UserStoryEnums.CFM == status&&oldStatus.equals("storyunconfirmed")) {
|
if (UserStoryEnums.CFM == status && oldStatus.equals("storyunconfirmed")) {
|
||||||
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
|
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
|
||||||
//交付物确认
|
//交付物确认
|
||||||
this.sendConfirmMessage(storyUser.getId(),ztProduct.getPo());
|
this.sendConfirmMessage(storyUser.getId(), ztProduct.getPo());
|
||||||
}
|
}
|
||||||
if(UserStoryEnums.RELEASED == status){
|
if (UserStoryEnums.RELEASED == status) {
|
||||||
//如果研发需求已经全部发布,那么就发布
|
//如果研发需求已经全部发布,那么就发布
|
||||||
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
|
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
|
||||||
List<ZtStory> storyList = this.storyService.list(new QueryWrapper<ZtStory>().lambda()
|
List<ZtStory> storyList = this.storyService.list(new QueryWrapper<ZtStory>().lambda()
|
||||||
.ne(ZtStory::getStatus, "closed").in(ZtStory::getStage, StoryStageEnums.beforeStatus(7)).eq(ZtStory::getUserStory, id));
|
.ne(ZtStory::getStatus, "closed").in(ZtStory::getStage, StoryStageEnums.beforeStatus(7)).eq(ZtStory::getUserStory, id));
|
||||||
if(!CollectionUtils.isEmpty(storyList)){
|
if (!CollectionUtils.isEmpty(storyList)) {
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storyUser.setStatus(status.getCode());
|
storyUser.setStatus(status.getCode());
|
||||||
@@ -823,7 +879,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
|
|
||||||
this.baseMapper.updateById(storyUser);
|
this.baseMapper.updateById(storyUser);
|
||||||
|
|
||||||
if(status==UserStoryEnums.CPYSJ){
|
if (status == UserStoryEnums.CPYSJ) {
|
||||||
//发送消息
|
//发送消息
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,7 +939,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
@Override
|
@Override
|
||||||
public void assignedToProductUser(ZtStoryUserDTO dto) {
|
public void assignedToProductUser(ZtStoryUserDTO dto) {
|
||||||
ZtStoryUser ztStoryUser = this.baseMapper.selectById(dto.getId());
|
ZtStoryUser ztStoryUser = this.baseMapper.selectById(dto.getId());
|
||||||
if(ztStoryUser==null){
|
if (ztStoryUser == null) {
|
||||||
throw new BusinessException("未查询到数据");
|
throw new BusinessException("未查询到数据");
|
||||||
}
|
}
|
||||||
ztStoryUser.setProductUser(dto.getAssignedto());
|
ztStoryUser.setProductUser(dto.getAssignedto());
|
||||||
@@ -892,7 +948,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
RiskUserThreadLocal.get().getName(), "", "");
|
RiskUserThreadLocal.get().getName(), "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Integer, List<ZtStory>> getStoryUserMap(List<ZtStoryUserDTO> list) {
|
private Map<Integer, List<ZtStory>> getStoryMap(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());
|
||||||
|
|
||||||
List<ZtStory> list1 = storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getUserStory, ids));
|
List<ZtStory> list1 = storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getUserStory, ids));
|
||||||
@@ -930,16 +986,19 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//发送消息给微信 产品已经设计
|
//发送消息给微信 产品已经设计
|
||||||
private void sendDesigndoneMessage(Integer id,String account) {
|
private void sendDesigndoneMessage(Integer id, String account) {
|
||||||
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.designdoneMessage(id),new Date());
|
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.designdoneMessage(id), new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
//发送消息给微信 提交交付物
|
//发送消息给微信 提交交付物
|
||||||
private void sendSubmitMessage(Integer id,String account) {
|
private void sendSubmitMessage(Integer id, String account) {
|
||||||
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.submitMessage(id),new Date());
|
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.submitMessage(id), new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
//确认交付物
|
//确认交付物
|
||||||
private void sendConfirmMessage(Integer id,String account) {
|
private void sendConfirmMessage(Integer id, String account) {
|
||||||
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.sendConfirmMessage(id),new Date());
|
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.sendConfirmMessage(id), new Date());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ZtStory ztStory = this.storyService.getById(story);
|
ZtStory ztStory = this.storyService.getById(story);
|
||||||
if (ztStory != null) {
|
if (ztStory != null) {
|
||||||
dto.setStoryName(ztStory.getTitle());
|
dto.setStoryName(ztStory.getTitle());
|
||||||
|
dto.setInnerYsFlag(ztStory.getInnerYsFlag());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,8 +579,8 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if (story != null && story != 0) {
|
if (story != null && story != 0) {
|
||||||
ZtStory ztStory = this.storyService.getById(story);
|
ZtStory ztStory = this.storyService.getById(story);
|
||||||
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
|
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
|
||||||
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested",StoryStageEnums.productWaitVerified.getValue()
|
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested", StoryStageEnums.productWaitVerified.getValue()
|
||||||
,StoryStageEnums.productVerified.getValue()).contains(ztStory.getStage())) {
|
, StoryStageEnums.productVerified.getValue()).contains(ztStory.getStage())) {
|
||||||
throw new BusinessException("当前状态无法添加任务");
|
throw new BusinessException("当前状态无法添加任务");
|
||||||
}
|
}
|
||||||
if (ztStory.getStatus().equals("closed")) {
|
if (ztStory.getStatus().equals("closed")) {
|
||||||
@@ -1037,7 +1038,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
||||||
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
||||||
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
||||||
if(ztStory!=null){
|
if (ztStory != null) {
|
||||||
ztStory.setDeliverContent(dto.getDeliverContent());
|
ztStory.setDeliverContent(dto.getDeliverContent());
|
||||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
ztStory.setLastediteddate(new Date());
|
ztStory.setLastediteddate(new Date());
|
||||||
@@ -1082,11 +1083,11 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
|
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
|
||||||
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
|
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
|
||||||
}
|
}
|
||||||
if(ztTask.getStory()!=null&&ztTask.getStory()!=0&& ObjectUtil.equal(dto.getInnerYsFlag(),1)){
|
// if (ztTask.getStory() != null && ztTask.getStory() != 0 && ObjectUtil.equal(dto.getInnerYsFlag(), 1)) {
|
||||||
ZtStoryDTO qo=new ZtStoryDTO();
|
// ZtStoryDTO qo = new ZtStoryDTO();
|
||||||
qo.setId(ztTask.getStory());
|
// qo.setId(ztTask.getStory());
|
||||||
this.storyService.testSubmitVerified(qo);
|
// this.storyService.testSubmitVerified(qo);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
87
src/main/java/com/sa/zentao/utils/KanbanStageMapping.java
Normal file
87
src/main/java/com/sa/zentao/utils/KanbanStageMapping.java
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
package com.sa.zentao.utils;
|
||||||
|
|
||||||
|
import com.sa.zentao.enums.KanbanColumnType;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 看板阶段映射工具类
|
||||||
|
* 用于将业务阶段映射到看板列类型
|
||||||
|
*/
|
||||||
|
public class KanbanStageMapping {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求阶段到看板列的映射
|
||||||
|
*/
|
||||||
|
private static final Map<String, KanbanColumnType> STORY_STAGE_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务状态到看板列的映射
|
||||||
|
*/
|
||||||
|
private static final Map<String, KanbanColumnType> TASK_STATUS_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
// 初始化需求阶段映射
|
||||||
|
STORY_STAGE_MAP.put("closed", KanbanColumnType.STORY_CLOSED);
|
||||||
|
STORY_STAGE_MAP.put("wait", KanbanColumnType.STORY_BACKLOG);
|
||||||
|
STORY_STAGE_MAP.put("projected", KanbanColumnType.STORY_BACKLOG);
|
||||||
|
STORY_STAGE_MAP.put("developing", KanbanColumnType.STORY_DEVELOPING);
|
||||||
|
STORY_STAGE_MAP.put("developed", KanbanColumnType.STORY_DEVELOPED);
|
||||||
|
STORY_STAGE_MAP.put("testing", KanbanColumnType.STORY_TESTING);
|
||||||
|
STORY_STAGE_MAP.put("tested", KanbanColumnType.STORY_TESTED);
|
||||||
|
STORY_STAGE_MAP.put("released", KanbanColumnType.STORY_RELEASED);
|
||||||
|
STORY_STAGE_MAP.put("verified", KanbanColumnType.STORY_VERIFIED);
|
||||||
|
|
||||||
|
// 初始化任务状态映射
|
||||||
|
TASK_STATUS_MAP.put("wait", KanbanColumnType.TASK_WAIT);
|
||||||
|
TASK_STATUS_MAP.put("reviewing", KanbanColumnType.TASK_WAIT);
|
||||||
|
TASK_STATUS_MAP.put("draft", KanbanColumnType.TASK_WAIT);
|
||||||
|
TASK_STATUS_MAP.put("doing", KanbanColumnType.TASK_DEVELOPING);
|
||||||
|
TASK_STATUS_MAP.put("done", KanbanColumnType.TASK_DEVELOPED);
|
||||||
|
TASK_STATUS_MAP.put("cancel", KanbanColumnType.TASK_CANCEL);
|
||||||
|
TASK_STATUS_MAP.put("closed", KanbanColumnType.TASK_CLOSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据需求阶段获取看板列类型
|
||||||
|
*
|
||||||
|
* @param stage 需求阶段
|
||||||
|
* @return 看板列类型
|
||||||
|
*/
|
||||||
|
public static KanbanColumnType getStoryColumnByStage(String stage) {
|
||||||
|
return STORY_STAGE_MAP.getOrDefault(stage, KanbanColumnType.STORY_BACKLOG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务状态获取看板列类型
|
||||||
|
*
|
||||||
|
* @param status 任务状态
|
||||||
|
* @return 看板列类型
|
||||||
|
*/
|
||||||
|
public static KanbanColumnType getTaskColumnByStatus(String status) {
|
||||||
|
return TASK_STATUS_MAP.getOrDefault(status, KanbanColumnType.TASK_WAIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取需求阶段对应的看板列值
|
||||||
|
*
|
||||||
|
* @param stage 需求阶段
|
||||||
|
* @return 看板列值
|
||||||
|
*/
|
||||||
|
public static String getStoryColumnValue(String stage) {
|
||||||
|
KanbanColumnType columnType = getStoryColumnByStage(stage);
|
||||||
|
return columnType.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务状态对应的看板列值
|
||||||
|
*
|
||||||
|
* @param status 任务状态
|
||||||
|
* @return 看板列值
|
||||||
|
*/
|
||||||
|
public static String getTaskColumnValue(String status) {
|
||||||
|
KanbanColumnType columnType = getTaskColumnByStatus(status);
|
||||||
|
return columnType.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
||||||
|
|
||||||
select
|
select
|
||||||
|
|
||||||
s.id,
|
s.id,
|
||||||
s.vision,
|
s.vision,
|
||||||
@@ -137,81 +137,96 @@
|
|||||||
s.task_count,
|
s.task_count,
|
||||||
s.ys_date,
|
s.ys_date,
|
||||||
s.inner_ys_flag,
|
s.inner_ys_flag,
|
||||||
s.product_user,
|
|
||||||
su.title userStoryName,
|
su.title userStoryName,
|
||||||
su.id userStoryId,
|
su.id userStoryId,
|
||||||
ps.title parentName,
|
ps.title parentName,
|
||||||
su.openedDate userStoryCreateTime,
|
su.openedDate userStoryCreateTime,
|
||||||
su.openedBy userStoryCreateUser,
|
su.openedBy userStoryCreateUser,
|
||||||
s.devel_plan_end_time,
|
s.devel_plan_end_time,
|
||||||
s.test_plan_end_time
|
s.test_plan_end_time,
|
||||||
|
s.test_user,
|
||||||
|
s.product_user
|
||||||
|
|
||||||
from zt_story s
|
from zt_story s
|
||||||
left join zt_story_user su on s.user_story = su.id
|
left join zt_story_user su on s.user_story = su.id
|
||||||
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
|
||||||
left join zt_story ps on s.parent = ps.id
|
left join zt_story ps on s.parent = ps.id
|
||||||
where 1=1
|
|
||||||
and s.product = #{qo.productId}
|
|
||||||
<if test="qo.searchVal == 'ALL' ">
|
|
||||||
|
|
||||||
</if>
|
<if test="qo.execution != null and qo.execution != '' ">
|
||||||
<if test="qo.searchVal == 'WGB' ">
|
left join zt_projectstory pstory on s.id = pstory.story and pstory.type = 'execution'
|
||||||
and s.status != 'closed'
|
</if>
|
||||||
|
where 1=1
|
||||||
|
and s.product = #{qo.productId}
|
||||||
|
<if test="qo.execution != null and qo.execution != '' ">
|
||||||
|
and pstory.project = #{qo.execution }
|
||||||
|
</if>
|
||||||
|
|
||||||
</if>
|
<if test="qo.searchVal == 'ALL' ">
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
|
||||||
and s.assignedTo= #{qo.userName}
|
|
||||||
</if>
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
|
||||||
and s.product_user= #{qo.userName}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
</if>
|
||||||
and s.openedBy= #{qo.userName}
|
<if test="qo.searchVal == 'WGB' ">
|
||||||
</if>
|
and s.status != 'closed'
|
||||||
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
||||||
|
and s.product_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WCS' ">
|
||||||
and v.reviewer = #{qo.userName}
|
and s.test_user = #{qo.userName}
|
||||||
and s.status ='reviewing'
|
</if>
|
||||||
and v.result = ''
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
||||||
</if>
|
and s.assignedTo= #{qo.userName}
|
||||||
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
||||||
|
and s.product_user= #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'JH' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
||||||
and s.status = 'active'
|
and s.openedBy= #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'YGB' ">
|
|
||||||
and s.status = 'closed'
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
||||||
and s.stage = 'verified' and s.ys_flag =1
|
and v.reviewer = #{qo.userName}
|
||||||
</if>
|
and s.status ='reviewing'
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
|
and v.result = ''
|
||||||
and s.status = '11'
|
</if>
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WZP' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'JH' ">
|
||||||
and s.status = '11'
|
and s.status = 'active'
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'YGB' ">
|
||||||
|
and s.status = 'closed'
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WYS' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
|
||||||
and s.ys_user = #{qo.userName}
|
and s.stage = 'verified' and s.ys_flag =1
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
|
||||||
|
and s.status = '11'
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WPS' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WZP' ">
|
||||||
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
and s.status = '11'
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WYS' ">
|
||||||
|
and s.ys_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WPS' ">
|
||||||
|
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'PSZ' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'PSZ' ">
|
||||||
and s.status = 'reviewing'
|
and s.status = 'reviewing'
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
|
||||||
and ( s.stage = 'released'
|
and ( s.stage = 'released'
|
||||||
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 != '' ">
|
<if test="qo.name != null and qo.name != '' ">
|
||||||
and s.title like concat('%', #{qo.name}, '%')
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -220,24 +235,24 @@
|
|||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.testUser != null and qo.testUser != '' ">
|
<if test="qo.testUser != null and qo.testUser != '' ">
|
||||||
and s.test_user like concat('%', #{qo.testUser}, '%')
|
and s.test_user like concat('%', #{qo.testUser}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.productUser != null and qo.productUser != '' ">
|
<if test="qo.productUser != null and qo.productUser != '' ">
|
||||||
and s.product_user like concat('%', #{qo.productUser}, '%')
|
and s.product_user like concat('%', #{qo.productUser}, '%')
|
||||||
</if>
|
</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 like concat('%', #{qo.title}, '%')
|
and s.title like concat('%', #{qo.title}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.productUser != null and qo.productUser != '' ">
|
<if test="qo.productUser != null and qo.productUser != '' ">
|
||||||
and s.product_user like concat('%', #{qo.productUser}, '%')
|
and s.product_user like concat('%', #{qo.productUser}, '%')
|
||||||
</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 != '' ">
|
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
|
||||||
and s.assignedTo = #{qo.assignedTo}
|
and s.assignedTo = #{qo.assignedTo}
|
||||||
</if>
|
</if>
|
||||||
@@ -256,6 +271,7 @@
|
|||||||
and s.openedBy = #{qo.openedby}
|
and s.openedBy = #{qo.openedby}
|
||||||
</if>
|
</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>
|
||||||
@@ -279,17 +295,22 @@
|
|||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.statusList != null and qo.statusList.size() > 0">
|
||||||
group by s.id
|
and s.status in
|
||||||
|
<foreach collection="qo.statusList" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
group by s.id
|
||||||
|
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
<when test="qo.orderName != '' and qo.orderName != null ">
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
||||||
order by s.${qo.orderName} ${qo.orderSort}
|
order by s.${qo.orderName} ${qo.orderSort}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by s.id desc
|
order by s.id desc
|
||||||
@@ -300,7 +321,7 @@
|
|||||||
order by s.id desc
|
order by s.id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
-- order by id desc
|
-- order by id desc
|
||||||
</select>
|
</select>
|
||||||
<select id="projectStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
<select id="projectStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
||||||
select s.id,
|
select s.id,
|
||||||
@@ -381,38 +402,12 @@
|
|||||||
pt.name productName
|
pt.name productName
|
||||||
from zt_story s
|
from zt_story s
|
||||||
|
|
||||||
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
|
||||||
left join zt_projectstory pstory on s.id = pstory.story and pstory.`type` = 'project'
|
left join zt_projectstory pstory on s.id = pstory.story and pstory.`type` = 'project'
|
||||||
left join zt_project pj on pstory.project = pj.id
|
left join zt_project pj on pstory.project = pj.id
|
||||||
left join zt_product pt on s.product = pt.id
|
left join zt_product pt on s.product = pt.id
|
||||||
left join zt_projectstory ps on s.id = ps.story
|
left join zt_projectstory ps on s.id = ps.story
|
||||||
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.startDate !=null">-->
|
|
||||||
<!-- and s.openedDate <![CDATA[>=]]> #{qo.startDate}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- <if test="qo.endDate !=null">-->
|
|
||||||
<!-- and s.openedDate <![CDATA[<=]]> #{qo.endDate}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<if test="qo.testUser != null and qo.testUser != '' ">
|
|
||||||
and s.test_user like concat('%', #{qo.testUser}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="qo.productUser != null and qo.productUser != '' ">
|
|
||||||
and s.product_user like concat('%', #{qo.productUser}, '%')
|
|
||||||
</if>
|
|
||||||
<!-- <if test="qo.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 != '' ">
|
<if test="qo.pri != null and qo.pri != '' ">
|
||||||
and s.pri = #{qo.pri}
|
and s.pri = #{qo.pri}
|
||||||
</if>
|
</if>
|
||||||
@@ -424,7 +419,7 @@
|
|||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WYS' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WYS' ">
|
||||||
and s.ys_user = #{qo.userName}
|
and s.ys_user = #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.stage != null and qo.stage != '' ">
|
<if test="qo.stage != null and qo.stage != '' ">
|
||||||
@@ -449,47 +444,48 @@
|
|||||||
<if test="qo.name != null and qo.name != '' ">
|
<if test="qo.name != null and qo.name != '' ">
|
||||||
and s.title like concat('%', #{qo.name}, '%')
|
and s.title like concat('%', #{qo.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.testUser != null and qo.testUser != '' ">
|
||||||
|
and s.test_user like concat('%', #{qo.testUser}, '%')
|
||||||
|
</if>
|
||||||
<if test="qo.productUser != null and qo.productUser != '' ">
|
<if test="qo.productUser != null and qo.productUser != '' ">
|
||||||
and s.product_user like concat('%', #{qo.productUser}, '%')
|
and s.product_user like concat('%', #{qo.productUser}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.testUser != null and qo.testUser != '' ">
|
|
||||||
and s.assignedTo like concat('%', #{qo.testUser}, '%')
|
|
||||||
</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>
|
||||||
|
|
||||||
<if test="qo.project != null ">
|
<if test="qo.project != null ">
|
||||||
and ps.project =#{qo.project}
|
and ps.project =#{qo.project}
|
||||||
and ps.type= 'project'
|
and ps.type= 'project'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.execution != null ">
|
<if test="qo.execution != null ">
|
||||||
and ps.project =#{qo.execution}
|
and ps.project =#{qo.execution}
|
||||||
and ps.type= 'execution'
|
and ps.type= 'execution'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.moduleId != null ">
|
<if test="qo.moduleId != null ">
|
||||||
and s.module =#{qo.moduleId}
|
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' ">
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
||||||
and s.status !='closed'
|
and s.status !='closed'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
||||||
and s.assignedTo = #{qo.userName}
|
and s.assignedTo = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.kfz == 1 ">
|
||||||
|
<if test="qo.userName != null and qo.userName != '' ">
|
||||||
|
|
||||||
|
and
|
||||||
|
(s.assignedTo = #{qo.userName}
|
||||||
|
or s.openedBy = #{qo.userName}
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.kfz == 1 ">
|
</if>
|
||||||
<if test="qo.userName != null and qo.userName != '' ">
|
|
||||||
|
|
||||||
and
|
|
||||||
(s.assignedTo = #{qo.userName}
|
|
||||||
or s.openedBy = #{qo.userName}
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
||||||
and s.openedBy = #{qo.userName}
|
and s.openedBy = #{qo.userName}
|
||||||
@@ -502,6 +498,9 @@
|
|||||||
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
||||||
and s.product_user = #{qo.userName}
|
and s.product_user = #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WCS' ">
|
||||||
|
and s.test_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WCC' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WCC' ">
|
||||||
and s.assignedTo = #{qo.userName}
|
and s.assignedTo = #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
@@ -521,7 +520,7 @@
|
|||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal == 'WZP' ">
|
<if test="qo.searchVal == 'WZP' ">
|
||||||
and s.status = '11'
|
and s.status = '11'
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal == 'WPS' ">
|
<if test="qo.searchVal == 'WPS' ">
|
||||||
@@ -532,10 +531,12 @@
|
|||||||
<if test="qo.searchVal == 'PSZ' ">
|
<if test="qo.searchVal == 'PSZ' ">
|
||||||
and s.status = 'reviewing'
|
and s.status = 'reviewing'
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.searchVal == 'WYS' ">
|
||||||
|
and s.ys_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
<if test="qo.searchVal == 'DYS' ">
|
<if test="qo.searchVal == 'DYS' ">
|
||||||
|
|
||||||
and ( s.stage = 'released'
|
and ( s.stage = 'released'
|
||||||
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>
|
||||||
@@ -547,53 +548,53 @@
|
|||||||
|
|
||||||
<if test="qo.searchCode != null and qo.searchCode != '' ">
|
<if test="qo.searchCode != null and qo.searchCode != '' ">
|
||||||
|
|
||||||
-- //项目名称
|
-- //项目名称
|
||||||
<if test="qo.searchCode=='xmmc' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='xmmc' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and pj.name like concat('%', #{qo.searchValue}, '%')
|
and pj.name like concat('%', #{qo.searchValue}, '%')
|
||||||
</if>
|
</if>
|
||||||
-- 项目id
|
-- 项目id
|
||||||
<if test="qo.searchCode=='xmid' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='xmid' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and pj.id =#{qo.searchValue}
|
and pj.id =#{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
-- //需求名称
|
-- //需求名称
|
||||||
<if test="qo.searchCode=='xqmc' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='xqmc' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.title like concat('%', #{qo.searchValue}, '%')
|
and s.title like concat('%', #{qo.searchValue}, '%')
|
||||||
</if>
|
</if>
|
||||||
-- 需求id
|
-- 需求id
|
||||||
<if test="qo.searchCode=='xqid' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='xqid' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.id =#{qo.searchValue}
|
and s.id =#{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
-- 状态
|
-- 状态
|
||||||
<if test="qo.searchCode=='zt' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='zt' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.stage =#{qo.searchValue}
|
and s.stage =#{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
-- 项目描述
|
-- 项目描述
|
||||||
<if test="qo.searchCode=='xmms' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='xmms' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and sp.`spec` =#{qo.searchValue}
|
and sp.`spec` =#{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
-- 负责人
|
-- 负责人
|
||||||
|
|
||||||
<if test="qo.searchCode=='fzr' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='fzr' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.assignedTo =#{qo.searchValue}
|
and s.assignedTo =#{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchCode=='jhwc' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='jhwc' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.plan_end_date ${qo.searchValue}
|
and s.plan_end_date ${qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.start_date ${qo.searchValue}
|
and s.start_date ${qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.end_date ${qo.searchValue}
|
and s.end_date ${qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchCode=='yscj' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='yscj' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.openedBy = #{qo.searchValue}
|
and s.openedBy = #{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchCode=='ysgb' and qo.searchValue != null and qo.searchValue != '' ">
|
<if test="qo.searchCode=='ysgb' and qo.searchValue != null and qo.searchValue != '' ">
|
||||||
and s.closedBy = #{qo.searchValue}
|
and s.closedBy = #{qo.searchValue}
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
@@ -612,7 +613,13 @@
|
|||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="qo.statusList != null and qo.statusList.size() > 0">
|
||||||
|
and s.status in
|
||||||
|
<foreach collection="qo.statusList" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
@@ -622,7 +629,7 @@
|
|||||||
<when test="qo.orderName != '' and qo.orderName != null ">
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
||||||
order by s.${qo.orderName} ${qo.orderSort}
|
order by s.${qo.orderName} ${qo.orderSort}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by s.id desc
|
order by s.id desc
|
||||||
@@ -642,7 +649,6 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="allStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
<select id="allStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
||||||
|
|
||||||
|
|
||||||
select s.id,
|
select s.id,
|
||||||
s.vision,
|
s.vision,
|
||||||
s.parent,
|
s.parent,
|
||||||
@@ -1007,8 +1013,15 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
||||||
and s.status !='closed'
|
and s.status !='closed'
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WDCP' ">
|
||||||
|
and s.product_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
<if test="qo.searchVal != null and qo.searchVal == 'WCS' ">
|
||||||
|
and s.test_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
||||||
and s.assignedTo = #{qo.userName}
|
and s.assignedTo = #{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
@@ -1089,8 +1102,15 @@
|
|||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
|
<if test="qo.statusList != null and qo.statusList.size() > 0">
|
||||||
|
and s.status in
|
||||||
|
<foreach collection="qo.statusList" item="id" index="index"
|
||||||
|
open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
group by s.id
|
group by s.id
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
@@ -1350,14 +1370,17 @@
|
|||||||
|
|
||||||
<select id="storyReleaseOnTimeByProducts" resultType="java.util.Map">
|
<select id="storyReleaseOnTimeByProducts" resultType="java.util.Map">
|
||||||
select (SELECT count(1) waitRelease from zt_story
|
select (SELECT count(1) waitRelease from zt_story
|
||||||
WHERE plan_end_date >=#{startTime} and plan_end_date <= #{endTime} AND product in
|
WHERE plan_end_date >=#{startTime} and plan_end_date <= #{endTime}
|
||||||
|
and status not in ('closed')
|
||||||
|
AND product in
|
||||||
<foreach collection="pIds" item="id" index="index"
|
<foreach collection="pIds" item="id" index="index"
|
||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>) planReleaseStoryNum,
|
</foreach>) planReleaseStoryNum,
|
||||||
(SELECT count(1) waitRelease from zt_story
|
(SELECT count(1) waitRelease from zt_story
|
||||||
WHERE plan_end_date >=#{startTime} and plan_end_date <=#{endTime} and releasedDate >=#{startTime}
|
WHERE plan_end_date >=#{startTime} and plan_end_date <=#{endTime} and releasedDate >=#{startTime}
|
||||||
and releasedDate <=#{endTime}
|
and releasedDate <=#{endTime}
|
||||||
|
and status not in ('closed')
|
||||||
AND product in
|
AND product in
|
||||||
<foreach collection="pIds" item="id" index="index"
|
<foreach collection="pIds" item="id" index="index"
|
||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
|
|||||||
Reference in New Issue
Block a user