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>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
@@ -293,11 +286,11 @@
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-pool2</artifactId>-->
|
||||
<!-- <version>2.8.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -15,26 +15,24 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@Value("spring.application.name")
|
||||
@Value("${spring.application.name}")
|
||||
private String application;
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Result bizExceptionHandler(Exception e, HttpServletRequest request) {
|
||||
log.error("发生业务异常!原因是: {}", e.getMessage());
|
||||
log.error(application +"发生了异常 ,异常信息 ,{}",e);
|
||||
log.error("系统发生异常!应用: {}, 请求路径: {}, 异常类型: {}, 异常原因: {}",
|
||||
application, request.getRequestURI(), e.getClass().getSimpleName(), e.getMessage(), e);
|
||||
return Result.fail(Code.FAIL);
|
||||
}
|
||||
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public Result bizExceptionHandler(BusinessException e, HttpServletRequest request) {
|
||||
log.error("发生业务异常!原因是: {}", e.getMessage());
|
||||
log.error(application +"发生了异常 ,异常信息 ,{}",e);
|
||||
log.error("业务异常!应用: {}, 请求路径: {}, 异常原因: {}",
|
||||
application, request.getRequestURI(), e.getMessage());
|
||||
if(e.code==null){
|
||||
return Result.fail(e.value);
|
||||
}else{
|
||||
return Result.fail(e.code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
for (int i =0;i<200;i++){
|
||||
log.info("win");
|
||||
}
|
||||
String os = System.getProperty("os.name");
|
||||
if (os.toLowerCase().startsWith("win")) { //如果是Windows系统
|
||||
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){
|
||||
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.update.UpdateWrapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.constants.ExportConstants;
|
||||
import com.sa.zentao.dao.*;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
import com.sa.zentao.entity.ZtProjectproduct;
|
||||
@@ -71,7 +72,7 @@ public class ZtStoryController {
|
||||
|
||||
@RequestMapping(value = "/storyExport", method = RequestMethod.POST)
|
||||
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);
|
||||
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());
|
||||
@@ -82,12 +83,12 @@ public class ZtStoryController {
|
||||
|
||||
ZtStoryFeedback ztStoryFeedback = feedbackMap.get(ztStoryUserDTO.getFeedback());
|
||||
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();
|
||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||
try {
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||
hyperlink.setHyperlinkData(hyperlinkData);
|
||||
ztStoryUserDTO.setFeedbackSpecUrl(hyperlink );
|
||||
@@ -96,12 +97,12 @@ public class ZtStoryController {
|
||||
}
|
||||
}
|
||||
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();
|
||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||
try {
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||
hyperlink.setHyperlinkData(hyperlinkData);
|
||||
ztStoryUserDTO.setParentNameUrl(hyperlink);
|
||||
@@ -110,12 +111,12 @@ public class ZtStoryController {
|
||||
}
|
||||
}
|
||||
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();
|
||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||
try {
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||
hyperlink.setHyperlinkData(hyperlinkData);
|
||||
ztStoryUserDTO.setUserStoryNameUrl(hyperlink);
|
||||
@@ -123,12 +124,12 @@ public class ZtStoryController {
|
||||
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();
|
||||
WriteCellData<String> hyperlink = new WriteCellData<>(reName);
|
||||
HyperlinkData hyperlinkData = new HyperlinkData();
|
||||
try {
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
|
||||
hyperlinkData.setAddress(reUrl.replace(" ", ExportConstants.URL_SPACE_ENCODE));
|
||||
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
|
||||
hyperlink.setHyperlinkData(hyperlinkData);
|
||||
ztStoryUserDTO.setStoryUrl(hyperlink);
|
||||
@@ -137,7 +138,7 @@ public class ZtStoryController {
|
||||
}
|
||||
|
||||
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.setStage(StoryStageEnums.transfer(ztStoryUserDTO.getStage())==null?null:StoryStageEnums.transfer(ztStoryUserDTO.getStage()).getDesc());
|
||||
@@ -145,10 +146,10 @@ public class ZtStoryController {
|
||||
ztStoryUserDTO.setYsFlagName(ztStoryUserDTO.getYsFlag()==1?"通过":"不通过");
|
||||
}
|
||||
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){
|
||||
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())
|
||||
.needHead(Boolean.TRUE).build();
|
||||
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(0, "sheet1")
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(0, ExportConstants.SHEET_NAME)
|
||||
.head(ZtStoryDTO.class)
|
||||
.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.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
|
||||
);
|
||||
|
||||
@@ -3,15 +3,33 @@ package com.sa.zentao.dao;
|
||||
|
||||
public class BusinessException extends RuntimeException {
|
||||
|
||||
|
||||
public BusinessException(Code code){
|
||||
super(code.getValue());
|
||||
this.code=code;
|
||||
}
|
||||
|
||||
public BusinessException(String value){
|
||||
super(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 Code code;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ public enum Code {
|
||||
SUCCESS(0, "成功"),
|
||||
FAIL(-1, "失败"),
|
||||
CFTJ(-2, "重复添加"),
|
||||
PLEASELOGIN(401, "请登录");
|
||||
PLEASELOGIN(401, "请登录"),
|
||||
PARAM_ERROR(400, "参数错误"),
|
||||
NOT_FOUND(404, "资源不存在"),
|
||||
FORBIDDEN(403, "无权限访问"),
|
||||
INTERNAL_ERROR(500, "系统内部错误");
|
||||
|
||||
private Integer code;
|
||||
private String value;
|
||||
|
||||
@@ -166,11 +166,15 @@ public class ZtStoryDTO implements Serializable {
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String productUserName;
|
||||
@ExcelIgnore
|
||||
private String productUserColor;
|
||||
/**
|
||||
* 产品人
|
||||
*/
|
||||
@ExcelIgnore
|
||||
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.ExcelProperty;
|
||||
import com.alibaba.excel.metadata.data.HyperlinkData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -28,6 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Slf4j
|
||||
public class ZtStoryUserDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -50,6 +55,8 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "关联研发需求",index =4)
|
||||
private String storyList;
|
||||
@ExcelIgnore
|
||||
private Set<ZtProject> execList;
|
||||
@ExcelProperty(value = "状态",index =5)
|
||||
private String status;
|
||||
|
||||
@@ -281,10 +288,30 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
//1.需要 2.不需要
|
||||
@ExcelIgnore
|
||||
private Integer needImprove;
|
||||
|
||||
/**
|
||||
* 需求背景
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String storyBackground;
|
||||
/**
|
||||
* 产品用户
|
||||
*/
|
||||
@ExcelIgnore
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
@@ -31,5 +31,6 @@ public class ZtStoryUserspec implements Serializable {
|
||||
|
||||
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 productName;
|
||||
/**
|
||||
* 产品人
|
||||
*/
|
||||
private String productUser;
|
||||
private String testUser;
|
||||
private Integer productId;
|
||||
|
||||
private List<Integer> productIds;
|
||||
@@ -68,6 +63,8 @@ public class ZtProjectQo extends BaseQo {
|
||||
|
||||
private String status;
|
||||
|
||||
private List<String> statusList;
|
||||
|
||||
private List<String> stageList;
|
||||
|
||||
private String title;
|
||||
|
||||
@@ -57,4 +57,6 @@ public interface IZtProductService extends IService<ZtProduct> {
|
||||
|
||||
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));
|
||||
if(!CollectionUtils.isEmpty(festivalConfigs)){
|
||||
throw new BusinessException("已存在");
|
||||
|
||||
@@ -741,7 +741,11 @@ public class IZtCountService {
|
||||
for (ZtUser u : ztUsers) {
|
||||
|
||||
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));
|
||||
} else if ("liushengqing".equals(u.getAccount())) {
|
||||
result.add(buildUiScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d));
|
||||
@@ -1209,7 +1213,6 @@ public class IZtCountService {
|
||||
dto.setProductProjectOnTimeRateScore(BigDecimal.valueOf(productProjectOnTimeRateScore));
|
||||
|
||||
|
||||
|
||||
List<ZtBug> allBugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().select(SFunctionColums.bugColumes())
|
||||
.eq(ZtBug::getOpenedby, u.getAccount())
|
||||
.in(ZtBug::getBugType,"releaseBug","prod")
|
||||
@@ -1239,6 +1242,7 @@ public class IZtCountService {
|
||||
}
|
||||
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()));
|
||||
//线上轻微
|
||||
@@ -1504,6 +1508,7 @@ public class IZtCountService {
|
||||
Date thisDay = new Date();
|
||||
thisDay.setMonth(date.getMonth());
|
||||
thisDay.setDate(date.getDate());
|
||||
thisDay.setYear(date.getYear());
|
||||
thisDay.setHours(17);
|
||||
thisDay.setMinutes(30);
|
||||
thisDay.setSeconds(0);
|
||||
@@ -2287,7 +2292,7 @@ public class IZtCountService {
|
||||
//需求准确性
|
||||
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得分 缺陷
|
||||
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.ActionType;
|
||||
import com.sa.zentao.enums.KanbanCellType;
|
||||
import com.sa.zentao.enums.KanbanColumnType;
|
||||
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||
import com.sa.zentao.utils.KanbanStageMapping;
|
||||
import com.sa.zentao.mapper.ZtKanbancolumnMapper;
|
||||
import com.sa.zentao.mapper.ZtKanbanlaneMapper;
|
||||
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.DateUtils;
|
||||
import com.sa.zentao.utils.KanBanConstant;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -37,6 +40,7 @@ import java.util.stream.Stream;
|
||||
* @since 2024-07-09
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtKanbanlane> implements IZtKanbanlaneService {
|
||||
|
||||
@Autowired
|
||||
@@ -116,6 +120,16 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
st.setAssignedToName(ztUser.getNickname());
|
||||
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){
|
||||
st.setProductName(product.getName());
|
||||
}
|
||||
@@ -243,14 +257,14 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
this.kanbancellService.updateById(tokanbancell);
|
||||
|
||||
ActionType type= null;
|
||||
if("story".equalsIgnoreCase(tabType)){
|
||||
if(KanbanCellType.STORY.getValue().equalsIgnoreCase(tabType)){
|
||||
type=ActionType.XQ;
|
||||
//需求
|
||||
// storyChange(qo);
|
||||
|
||||
//testing 测试中
|
||||
}
|
||||
if("bug".equalsIgnoreCase(tabType)){
|
||||
if(KanbanCellType.BUG.getValue().equalsIgnoreCase(tabType)){
|
||||
type=ActionType.BUG;
|
||||
//bug
|
||||
// bugChange(qo);
|
||||
@@ -261,7 +275,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
//closed 关闭
|
||||
|
||||
}
|
||||
if("task".equalsIgnoreCase(tabType)){
|
||||
if(KanbanCellType.TASK.getValue().equalsIgnoreCase(tabType)){
|
||||
type=ActionType.RW;
|
||||
//task
|
||||
// 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(",")));
|
||||
if(carIds.contains(bussId.toString())){
|
||||
thisZtKanbancell=cell;
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> carIds = new ArrayList<>(Arrays.asList(thisZtKanbancell.getCards().split(",")));
|
||||
while (carIds.contains(bussId.toString())) {
|
||||
carIds.remove(bussId.toString());
|
||||
}
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(carIds)){
|
||||
thisZtKanbancell.setCards("");
|
||||
@@ -317,8 +334,13 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
thisZtKanbancell.setCards(StringUtils.join(carIds,","));
|
||||
|
||||
}
|
||||
this.kanbancellService.updateById(thisZtKanbancell);
|
||||
|
||||
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();
|
||||
List l=StringUtils.isEmpty(cards)?new ArrayList<>():new ArrayList<>(Arrays.asList(cards.split(",")));
|
||||
l.add(bussId.toString());
|
||||
@@ -329,7 +351,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
@Override
|
||||
public void addStory(Integer id, List<ZtStory> ztStories) {
|
||||
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()));
|
||||
|
||||
@@ -382,7 +404,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
public void addTask(Integer id, List<ZtTask> asList) {
|
||||
|
||||
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()));
|
||||
|
||||
@@ -408,11 +430,13 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
@Override
|
||||
public void addBug(Integer id, List<ZtBug> asList) {
|
||||
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> 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);
|
||||
|
||||
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);
|
||||
|
||||
for (ZtMeetingDTO d:list) {
|
||||
StringBuilder b=new StringBuilder();
|
||||
if(!StringUtils.isEmpty(d.getUsers())){
|
||||
String[] split = d.getUsers().split(",");
|
||||
for (String s:split) {
|
||||
ZtUser ztUser = userMap.get(s);
|
||||
if(ztUser!=null){
|
||||
b.append(ztUser.getNickname()).append(",");
|
||||
}
|
||||
}
|
||||
d.setUsersName(b.toString());
|
||||
}
|
||||
// StringBuilder b=new StringBuilder();
|
||||
// if(!StringUtils.isEmpty(d.getUsers())){
|
||||
// String[] split = d.getUsers().split(",");
|
||||
// for (String s:split) {
|
||||
// ZtUser ztUser = userMap.get(s);
|
||||
// if(ztUser!=null){
|
||||
// b.append(ztUser.getNickname()).append(",");
|
||||
// }
|
||||
// }
|
||||
// d.setUsersName(b.toString());
|
||||
// }
|
||||
StringBuilder storyStr=new StringBuilder();
|
||||
if(!StringUtils.isEmpty( d.getStoryIds())){
|
||||
String[] split = d.getStoryIds().split(",");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@@ -687,4 +688,63 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
||||
|
||||
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) {
|
||||
|
||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||
if (ztProject == null || "closed".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
throw new BusinessException("未查询到");
|
||||
if (ztProject == null) {
|
||||
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||
}
|
||||
if ("closed".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
throw new BusinessException("项目已关闭,无法重复关闭,项目ID: " + dto.getId());
|
||||
}
|
||||
ztProject.setRealEnd(dto.getClosedDate());
|
||||
ztProject.setLastEditedDate(new Date());
|
||||
@@ -350,6 +353,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void projectStart(ZtProjectDTO dto) {
|
||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
@@ -385,8 +389,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
@Override
|
||||
public void projectDeleted(ZtProjectDTO dto) {
|
||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||
if (ztProject == null || "1".equalsIgnoreCase(ztProject.getDeleted())) {
|
||||
throw new BusinessException("未查询到");
|
||||
if (ztProject == null) {
|
||||
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||
}
|
||||
if ("1".equalsIgnoreCase(ztProject.getDeleted())) {
|
||||
throw new BusinessException("项目已删除,无法重复删除,项目ID: " + dto.getId());
|
||||
}
|
||||
ztProject.setDeleted("1");
|
||||
ztProject.setCanceledBy(RiskUserThreadLocal.get().getName());
|
||||
@@ -421,8 +428,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
@Override
|
||||
public void projectActivated(ZtProjectDTO dto) {
|
||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||
if (ztProject == null || !"closed".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
throw new BusinessException("未查询到");
|
||||
if (ztProject == null) {
|
||||
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")
|
||||
.set(ZtProject::getRealEnd,null)
|
||||
@@ -457,8 +467,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
@Override
|
||||
public void projectSuspended(ZtProjectDTO dto) {
|
||||
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
|
||||
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
throw new BusinessException("未查询到");
|
||||
if (ztProject == null) {
|
||||
throw new BusinessException("未查询到项目,项目ID: " + dto.getId());
|
||||
}
|
||||
if (!"wait".equalsIgnoreCase(ztProject.getStatus())) {
|
||||
throw new BusinessException("项目状态不是等待状态,无法挂起,当前状态: " + ztProject.getStatus() + ",项目ID: " + dto.getId());
|
||||
}
|
||||
ztProject.setStatus("suspended");
|
||||
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<ZtBug> bugs =CollectionUtils.isEmpty(bugList)?new ArrayList<>(): bugService.listByIds(bugList);
|
||||
long notTested = ztStories.stream().filter(o -> !o.getStage().equals(StoryStageEnums.productVerified.getValue())).count();
|
||||
if(notTested>0){
|
||||
throw new BusinessException("当前需求存在未测试完成的请检查");
|
||||
List<ZtStory> notProductYsList = ztStories.stream().filter(o -> !o.getStage().equals(StoryStageEnums.productVerified.getValue())).toList();
|
||||
if(!CollectionUtils.isEmpty(notProductYsList)){
|
||||
throw new BusinessException("当前需求存在未产品验收的需求请检查 id="+notProductYsList.get(0).getId()+" name="+notProductYsList.get(0).getTitle());
|
||||
}
|
||||
//'active','resolved','closed'?
|
||||
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)){
|
||||
sendReleaseMail(ztStories);
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
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) {
|
||||
d.setProductUserName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getTestUser());
|
||||
if (ztUser != null) {
|
||||
d.setTestUserName(ztUser.getNickname());
|
||||
}
|
||||
List<ZtProject> ztProjectList = executionMapByStory.get(d.getId());
|
||||
if (!CollectionUtils.isEmpty(ztProjectList)) {
|
||||
// d.setExecution(ztProject.getId());
|
||||
@@ -976,16 +980,16 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
public void testSubmitVerified(ZtStoryDTO qo) {
|
||||
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
||||
if(ztStory==null){
|
||||
throw new BusinessException("未查询到需求");
|
||||
throw new BusinessException("未查询到需求,需求ID: " + qo.getId());
|
||||
}
|
||||
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())){
|
||||
throw new BusinessException("需求状态不对");
|
||||
throw new BusinessException("需求阶段不是测试完毕,无法提交验收,当前阶段: " + ztStory.getStage() + ",需求ID: " + qo.getId());
|
||||
}
|
||||
if(ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
|
||||
throw new BusinessException("无需内部验收,不需要提交");
|
||||
if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
|
||||
throw new BusinessException("无需内部验收,不需要提交,需求ID: " + qo.getId());
|
||||
}
|
||||
//产品验收中
|
||||
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
|
||||
@@ -1010,16 +1014,16 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
public void storyProductUserYs(ZtStoryDTO qo) {
|
||||
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
|
||||
if(ztStory==null){
|
||||
throw new BusinessException("未查询到需求");
|
||||
throw new BusinessException("未查询到需求,需求ID: " + qo.getId());
|
||||
}
|
||||
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())){
|
||||
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.setLastediteddate(new Date());
|
||||
ztStory.setInnerYsTime(new Date());
|
||||
@@ -1053,7 +1057,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
this.baseMapper.updateById(ztStory);
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOPRODUCTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
RiskUserThreadLocal.get().getName(), "", dto.getAssignedTo());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1067,7 +1071,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
this.baseMapper.updateById(ztStory);
|
||||
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) {
|
||||
@@ -1486,16 +1490,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
@Override
|
||||
public void taskFinishChangeStatus(Integer story, String finishBy, TaskType type, Boolean cancelFlag) {
|
||||
ZtStory ztStory = this.getById(story);
|
||||
if(ztStory == null) {
|
||||
if(ztStory == null|| story == 0) {
|
||||
return;
|
||||
}
|
||||
if (ztStory != null && ztStory.getStatus().equals("closed")) {
|
||||
return;
|
||||
}
|
||||
if (type != TaskType.test && type != TaskType.devel) {
|
||||
// return;
|
||||
}
|
||||
if (story == null || story == 0) {
|
||||
if (ztStory.getStatus().equals("closed")) {
|
||||
return;
|
||||
}
|
||||
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.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.BeanCopyUtilCallBack;
|
||||
import com.sa.zentao.utils.SendEmail;
|
||||
import com.sa.zentao.utils.VxMessageUtils;
|
||||
import com.sa.zentao.utils.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -81,6 +78,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
@Autowired
|
||||
private VxService vxService;
|
||||
|
||||
@Autowired
|
||||
private IZtProjectstoryService projectstoryService;
|
||||
|
||||
@Value("${file.backUrl}")
|
||||
private String url;
|
||||
|
||||
@@ -125,6 +125,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
spec.setStoryBackground(dto.getStoryBackground());
|
||||
return spec;
|
||||
}
|
||||
|
||||
@@ -220,7 +221,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
ztStory.setVerify(null);
|
||||
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) {
|
||||
spec = new ZtStoryUserspec();
|
||||
spec.setStory(id);
|
||||
@@ -229,6 +230,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
spec.setStoryBackground(dto.getStoryBackground());
|
||||
storyUserspecService.save(spec);
|
||||
} else {
|
||||
spec.setVersion(1);
|
||||
@@ -236,9 +238,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
spec.setStoryBackground(dto.getStoryBackground());
|
||||
storyUserspecService.update(new UpdateWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id)
|
||||
.set(ZtStoryUserspec::getSpec, dto.getSpec())
|
||||
.set(ZtStoryUserspec::getVerify, dto.getVerify())
|
||||
.set(ZtStoryUserspec::getStoryBackground, dto.getStoryBackground())
|
||||
.set(ZtStoryUserspec::getFiles, dto.getFileUrl())
|
||||
);
|
||||
}
|
||||
@@ -246,7 +250,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
fileService.updateFile(dto.getFiles(), ztStory.getId(), FileTypes.userStory);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -320,7 +323,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
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);
|
||||
for (ZtStoryUserDTO d : list) {
|
||||
|
||||
@@ -369,31 +374,77 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
d.setProductUserName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
List<ZtStory> ztStories = storyUserMap.get(d.getId());
|
||||
List<ZtStory> ztStories = storyMap.get(d.getId());
|
||||
if (!CollectionUtils.isEmpty(ztStories)) {
|
||||
for (ZtStory story:ztStories){
|
||||
List<ZtProject> execList = execMap.get(story.getId());
|
||||
if(!CollectionUtils.isEmpty(execList)){
|
||||
if(CollectionUtils.isEmpty(d.getExecList())){
|
||||
d.setExecList(new HashSet<>());
|
||||
}
|
||||
d.getExecList().addAll(execList);
|
||||
}
|
||||
}
|
||||
d.setStoryList(ztStories.stream().map(o -> o.getId() + ":" + o.getTitle()).collect(Collectors.joining(",")));
|
||||
d.setSList(CollectionUtils.isEmpty(ztStories) ? null : BeanCopyUtil.copyListProperties(ztStories, ZtStoryDTO::new));
|
||||
}
|
||||
|
||||
|
||||
String reName = d.getTitle();
|
||||
String reUrl = url+"/#/product-user-story-info/"+d.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);
|
||||
d.setUrl(hyperlink );
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
d.setUrl(null );
|
||||
}
|
||||
d.setLinkUrl(url);
|
||||
}
|
||||
}
|
||||
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
|
||||
@Transactional
|
||||
public void changeStatus(ZtStoryUserDTO dto) {
|
||||
@@ -486,7 +537,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
}
|
||||
|
||||
|
||||
|
||||
lambda.set(ZtStoryreview::getReviewdate, new Date());
|
||||
lambda.eq(ZtStoryreview::getStory, ztStory.getId());
|
||||
lambda.eq(ZtStoryreview::getReviewer, RiskUserThreadLocal.get().getName());
|
||||
@@ -527,10 +577,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
//添加action
|
||||
actionService.addAction(ActionType.USERXQ, actionStatus, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedto());
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -562,7 +608,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
if (ztUser != null) {
|
||||
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());
|
||||
if (!CollectionUtils.isEmpty(ztStories)) {
|
||||
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()));
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
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) {
|
||||
ztUser = userMap.get(storyDTO.getAssignedTo());
|
||||
if (ztUser != null) {
|
||||
@@ -626,10 +673,19 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
if (ztUser != null) {
|
||||
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);
|
||||
}
|
||||
//story - exec
|
||||
|
||||
}
|
||||
List<ZtStoryUserTask> tasks = this.storyUserTaskService.list(new QueryWrapper<ZtStoryUserTask>().lambda().eq(ZtStoryUserTask::getUserStoryId, dto.getId()));
|
||||
if (!CollectionUtils.isEmpty(tasks)) {
|
||||
@@ -655,6 +711,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
ZtStoryUserspec ztStoryUserspec = specList.get(0);
|
||||
dto.setSpec(ztStoryUserspec.getSpec());
|
||||
dto.setVerify(ztStoryUserspec.getVerify());
|
||||
dto.setStoryBackground(ztStoryUserspec.getStoryBackground());
|
||||
}
|
||||
|
||||
return dto;
|
||||
@@ -707,7 +764,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void changeStatus(Integer id, UserStoryEnums status) {
|
||||
ZtStoryUser storyUser = this.baseMapper.selectById(id);
|
||||
@@ -892,7 +948,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
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<ZtStory> list1 = storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getUserStory, ids));
|
||||
@@ -930,14 +986,17 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//发送消息给微信 产品已经设计
|
||||
private void sendDesigndoneMessage(Integer id, String account) {
|
||||
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.designdoneMessage(id), new Date());
|
||||
}
|
||||
|
||||
//发送消息给微信 提交交付物
|
||||
private void sendSubmitMessage(Integer id, String account) {
|
||||
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.submitMessage(id), new Date());
|
||||
}
|
||||
|
||||
//确认交付物
|
||||
private void sendConfirmMessage(Integer id, String account) {
|
||||
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);
|
||||
if (ztStory != null) {
|
||||
dto.setStoryName(ztStory.getTitle());
|
||||
dto.setInnerYsFlag(ztStory.getInnerYsFlag());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,11 +1083,11 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
|
||||
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
|
||||
}
|
||||
if(ztTask.getStory()!=null&&ztTask.getStory()!=0&& ObjectUtil.equal(dto.getInnerYsFlag(),1)){
|
||||
ZtStoryDTO qo=new ZtStoryDTO();
|
||||
qo.setId(ztTask.getStory());
|
||||
this.storyService.testSubmitVerified(qo);
|
||||
}
|
||||
// if (ztTask.getStory() != null && ztTask.getStory() != 0 && ObjectUtil.equal(dto.getInnerYsFlag(), 1)) {
|
||||
// ZtStoryDTO qo = new ZtStoryDTO();
|
||||
// qo.setId(ztTask.getStory());
|
||||
// this.storyService.testSubmitVerified(qo);
|
||||
// }
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@@ -137,27 +137,42 @@
|
||||
s.task_count,
|
||||
s.ys_date,
|
||||
s.inner_ys_flag,
|
||||
s.product_user,
|
||||
su.title userStoryName,
|
||||
su.id userStoryId,
|
||||
ps.title parentName,
|
||||
su.openedDate userStoryCreateTime,
|
||||
su.openedBy userStoryCreateUser,
|
||||
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
|
||||
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_story ps on s.parent = ps.id
|
||||
|
||||
<if test="qo.execution != null and qo.execution != '' ">
|
||||
left join zt_projectstory pstory on s.id = pstory.story and pstory.type = 'execution'
|
||||
</if>
|
||||
where 1=1
|
||||
and s.product = #{qo.productId}
|
||||
<if test="qo.execution != null and qo.execution != '' ">
|
||||
and pstory.project = #{qo.execution }
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'ALL' ">
|
||||
|
||||
</if>
|
||||
<if test="qo.searchVal == 'WGB' ">
|
||||
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 == 'WCS' ">
|
||||
and s.test_user = #{qo.userName}
|
||||
</if>
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
||||
and s.assignedTo= #{qo.userName}
|
||||
@@ -256,6 +271,7 @@
|
||||
and s.openedBy = #{qo.openedby}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="qo.startDate !=null">
|
||||
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
||||
</if>
|
||||
@@ -279,9 +295,14 @@
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</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>
|
||||
group by s.id
|
||||
|
||||
|
||||
@@ -387,32 +408,6 @@
|
||||
left join zt_product pt on s.product = pt.id
|
||||
left join zt_projectstory ps on s.id = ps.story
|
||||
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 != '' ">
|
||||
and s.pri = #{qo.pri}
|
||||
</if>
|
||||
@@ -449,12 +444,13 @@
|
||||
<if test="qo.name != null and qo.name != '' ">
|
||||
and s.title like concat('%', #{qo.name}, '%')
|
||||
</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.testUser != null and qo.testUser != '' ">
|
||||
and s.assignedTo like concat('%', #{qo.testUser}, '%')
|
||||
</if>
|
||||
<if test="qo.productName != null and qo.productName != '' ">
|
||||
and pt.name like concat('%', #{qo.productName}, '%')
|
||||
</if>
|
||||
@@ -502,6 +498,9 @@
|
||||
<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 == 'WCC' ">
|
||||
and s.assignedTo = #{qo.userName}
|
||||
</if>
|
||||
@@ -532,7 +531,9 @@
|
||||
<if test="qo.searchVal == 'PSZ' ">
|
||||
and s.status = 'reviewing'
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'WYS' ">
|
||||
and s.ys_user = #{qo.userName}
|
||||
</if>
|
||||
<if test="qo.searchVal == 'DYS' ">
|
||||
|
||||
and ( s.stage = 'released'
|
||||
@@ -612,7 +613,13 @@
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</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>
|
||||
|
||||
|
||||
@@ -642,7 +649,6 @@
|
||||
</select>
|
||||
<select id="allStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
||||
|
||||
|
||||
select s.id,
|
||||
s.vision,
|
||||
s.parent,
|
||||
@@ -1007,8 +1013,15 @@
|
||||
</if>
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
||||
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 == 'WCS' ">
|
||||
and s.test_user = #{qo.userName}
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
||||
and s.assignedTo = #{qo.userName}
|
||||
</if>
|
||||
@@ -1089,8 +1102,15 @@
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</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>
|
||||
|
||||
group by s.id
|
||||
|
||||
<choose>
|
||||
@@ -1350,7 +1370,9 @@
|
||||
|
||||
<select id="storyReleaseOnTimeByProducts" resultType="java.util.Map">
|
||||
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"
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
@@ -1358,6 +1380,7 @@
|
||||
(SELECT count(1) waitRelease from zt_story
|
||||
WHERE plan_end_date >=#{startTime} and plan_end_date <=#{endTime} and releasedDate >=#{startTime}
|
||||
and releasedDate <=#{endTime}
|
||||
and status not in ('closed')
|
||||
AND product in
|
||||
<foreach collection="pIds" item="id" index="index"
|
||||
open="(" close=")" separator=",">
|
||||
|
||||
Reference in New Issue
Block a user