1 Commits

Author SHA1 Message Date
3e864a5770 Merge branch 'refs/heads/dev-2025-temporary' into storymuchexec_250108
# Conflicts:
#	src/main/java/com/sa/zentao/service/impl/ZtTaskServiceImpl.java
#	src/main/resources/mapper/ZtStoryMapper.xml
2025-12-30 09:28:18 +08:00
42 changed files with 357 additions and 1306 deletions

28
pom.xml
View File

@@ -18,17 +18,6 @@
<boot.version>3.3.0</boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.6.3</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
@@ -99,6 +88,13 @@
<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>
@@ -286,11 +282,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>

View File

@@ -15,24 +15,26 @@ 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("系统发生异常!应用: {}, 请求路径: {}, 异常类型: {}, 异常原因: {}",
application, request.getRequestURI(), e.getClass().getSimpleName(), e.getMessage(), e);
log.error("发生业务异常!原因: {}", e.getMessage());
log.error(application +"发生了异常 ,异常信息 {}",e);
return Result.fail(Code.FAIL);
}
@ExceptionHandler(BusinessException.class)
public Result bizExceptionHandler(BusinessException e, HttpServletRequest request) {
log.error("业务异常!应用: {}, 请求路径: {}, 异常原因: {}",
application, request.getRequestURI(), e.getMessage());
log.error("发生业务异常!原因: {}", e.getMessage());
log.error(application +"发生了异常 ,异常信息 {}",e);
if(e.code==null){
return Result.fail(e.value);
}else{
return Result.fail(e.code);
}
}
}

View File

@@ -17,6 +17,9 @@ 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");

View File

@@ -1,37 +0,0 @@
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 = "";
}

View File

@@ -160,9 +160,4 @@ 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));
}
}

View File

@@ -8,14 +8,11 @@ import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.write.metadata.WriteSheet;
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;
import com.sa.zentao.entity.ZtStoryFeedback;
import com.sa.zentao.entity.ZtStoryUser;
import com.sa.zentao.enums.StoryStageEnums;
import com.sa.zentao.enums.StoryStatusEnums;
import com.sa.zentao.enums.UserStoryEnums;
@@ -29,7 +26,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -72,7 +68,7 @@ public class ZtStoryController {
@RequestMapping(value = "/storyExport", method = RequestMethod.POST)
public void storyExport(@RequestBody ZtProjectQo qo, jakarta.servlet.ServletResponse response){
qo.setPageSize(ExportConstants.MAX_EXPORT_SIZE);
qo.setPageSize(1000000);
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());
@@ -83,12 +79,12 @@ public class ZtStoryController {
ZtStoryFeedback ztStoryFeedback = feedbackMap.get(ztStoryUserDTO.getFeedback());
if (ztStoryFeedback != null) {
String reName=ztStoryFeedback.getId()+ExportConstants.STRING_SEPARATOR+ztStoryFeedback.getSpec();
String reName=ztStoryFeedback.getId()+":"+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(" ", ExportConstants.URL_SPACE_ENCODE));
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
hyperlink.setHyperlinkData(hyperlinkData);
ztStoryUserDTO.setFeedbackSpecUrl(hyperlink );
@@ -97,12 +93,12 @@ public class ZtStoryController {
}
}
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
String reName = ztStoryUserDTO.getParent()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getParentName();
String reName = ztStoryUserDTO.getParent()+":"+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(" ", ExportConstants.URL_SPACE_ENCODE));
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
hyperlink.setHyperlinkData(hyperlinkData);
ztStoryUserDTO.setParentNameUrl(hyperlink);
@@ -111,12 +107,12 @@ public class ZtStoryController {
}
}
if(ztStoryUserDTO.getUserStory()!=null&&ztStoryUserDTO.getUserStory()!=0){
String reName=ztStoryUserDTO.getUserStory()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getUserStoryName();
String reName=ztStoryUserDTO.getUserStory()+":"+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(" ", ExportConstants.URL_SPACE_ENCODE));
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
hyperlink.setHyperlinkData(hyperlinkData);
ztStoryUserDTO.setUserStoryNameUrl(hyperlink);
@@ -124,12 +120,12 @@ public class ZtStoryController {
ztStoryUserDTO.setUserStoryNameUrl(null);
}
}
String reName=ztStoryUserDTO.getId()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getTitle();
String reName=ztStoryUserDTO.getId()+":"+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(" ", ExportConstants.URL_SPACE_ENCODE));
hyperlinkData.setAddress(reUrl.replace(" ", "%20"));
hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
hyperlink.setHyperlinkData(hyperlinkData);
ztStoryUserDTO.setStoryUrl(hyperlink);
@@ -138,7 +134,7 @@ public class ZtStoryController {
}
if(!StringUtils.isEmpty(ztStoryUserDTO.getReviewedbyName())){
ztStoryUserDTO.setReviewedbyName(ztStoryUserDTO.getReviewedbyName().replaceAll(ExportConstants.ID_SEPARATOR, ExportConstants.COMMA_REPLACE));
ztStoryUserDTO.setReviewedbyName(ztStoryUserDTO.getReviewedbyName().replaceAll(",",""));
}
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());
@@ -146,10 +142,10 @@ public class ZtStoryController {
ztStoryUserDTO.setYsFlagName(ztStoryUserDTO.getYsFlag()==1?"通过":"不通过");
}
if(!StringUtils.isEmpty(ztStoryUserDTO.getUserStoryName())){
ztStoryUserDTO.setUserStoryName(ztStoryUserDTO.getUserStoryId()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getUserStoryName());
ztStoryUserDTO.setUserStoryName(ztStoryUserDTO.getUserStoryId()+":"+ztStoryUserDTO.getUserStoryName());
}
if(ztStoryUserDTO.getParent()!=null&&ztStoryUserDTO.getParent()!=0){
ztStoryUserDTO.setParentName(ztStoryUserDTO.getParent()+ExportConstants.STRING_SEPARATOR+ztStoryUserDTO.getParentName());
ztStoryUserDTO.setParentName(ztStoryUserDTO.getParent()+":"+ztStoryUserDTO.getParentName());
}
}
@@ -160,7 +156,7 @@ public class ZtStoryController {
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.needHead(Boolean.TRUE).build();
WriteSheet writeSheet = EasyExcel.writerSheet(0, ExportConstants.SHEET_NAME)
WriteSheet writeSheet = EasyExcel.writerSheet(0, "sheet1")
.head(ZtStoryDTO.class)
.needHead(Boolean.TRUE).build();
@@ -186,27 +182,6 @@ public class ZtStoryController {
}
/**
* 测试提交验收
* @param qo
* @return
*/
@RequestMapping(value = "/testSubmitVerified", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result<ZtStoryDTO> testSubmitVerified(@RequestBody ZtStoryDTO qo){
ztStoryService.testSubmitVerified(qo);
return Result.success();
}
/**
* 产品验收通过
* @param qo
* @return
*/
@RequestMapping(value = "/storyProductUserYs", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result<ZtStoryDTO> storyProductUserYs(@RequestBody ZtStoryDTO qo){
ztStoryService.storyProductUserYs(qo);
return Result.success();
}
@RequestMapping(value = "/storyListByProject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result<ZtStoryDTO> storyListByProject(@RequestBody ZtProjectQo qo){
@@ -361,26 +336,6 @@ public class ZtStoryController {
List<ZtProject> list = ztStoryService.execListByProject(dto);
return Result.success(list);
}
/**
* 指派产品人
* @param dto
* @return
*/
@RequestMapping(value = "/assignedToProductUser", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result assignedToProductUser(@RequestBody @Validated ZtStoryDTO dto){
this.ztStoryService.assignedToProductUser(dto);
return Result.success();
}
/**
* 指派测试人
* @param dto
* @return
*/
@RequestMapping(value = "/assignedToTestUser", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result assignedToTestUser(@RequestBody @Validated ZtStoryDTO dto){
this.ztStoryService.assignedToTestUser(dto);
return Result.success();
}

View File

@@ -7,14 +7,10 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.conf.RiskUserThreadLocal;
import com.sa.zentao.dao.*;
import com.sa.zentao.entity.ZtStory;
import com.sa.zentao.entity.ZtStoryUser;
import com.sa.zentao.enums.ActionStatus;
import com.sa.zentao.enums.ActionType;
import com.sa.zentao.enums.UserStoryEnums;
import com.sa.zentao.qo.StoryQo;
import com.sa.zentao.qo.ZtProjectQo;
@@ -23,7 +19,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
@@ -61,17 +56,6 @@ public class ZtStoryUserController {
return Result.success();
}
/**
* 指派产品人
* @param dto
* @return
*/
@RequestMapping(value = "/assignedToProductUser", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result assignedToProductUser(@RequestBody @Validated ZtStoryUserDTO dto){
this.storyUserService.assignedToProductUser(dto);
return Result.success();
}
@RequestMapping(value = "/addStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result addStory(@RequestBody ZtStoryUserDTO dto){
@@ -140,7 +124,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::getProductUser
ZtStoryUser::getOpenedby,ZtStoryUser::getAssignedto,ZtStoryUser::getYsUser
);
List<ZtStoryUser> list = storyUserService.list(eq
);

View File

@@ -135,11 +135,11 @@ public class ZtUserController {
}
eq.in(ZtUser::getAccount,execution.stream().map(o->o.getAccount()).collect(Collectors.toList()));
}else{
this.userMapper.selectOne(new QueryWrapper<ZtUser>().lambda()
.eq(ZtUser::getAccount,RiskUserThreadLocal.get().getName()));
this.userMapper.selectOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount,RiskUserThreadLocal.get().getName()));
}
eq.eq(dto.getUserType()!=null,ZtUser::getUserType,dto.getUserType());
return Result.success(userService.list(eq));
return Result.success(userService.list(eq
));
}
@RequestMapping(value = "/storyReviewList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")

View File

@@ -3,33 +3,15 @@ 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;
}

View File

@@ -4,11 +4,7 @@ public enum Code {
SUCCESS(0, "成功"),
FAIL(-1, "失败"),
CFTJ(-2, "重复添加"),
PLEASELOGIN(401, "请登录"),
PARAM_ERROR(400, "参数错误"),
NOT_FOUND(404, "资源不存在"),
FORBIDDEN(403, "无权限访问"),
INTERNAL_ERROR(500, "系统内部错误");
PLEASELOGIN(401, "请登录");
private Integer code;
private String value;

View File

@@ -160,26 +160,4 @@ public class PerformanceDTO implements Serializable {
private BigDecimal professionalSkillEnhancementScore=BigDecimal.ZERO;
//问题管理得分
private BigDecimal developFeedbackStory=BigDecimal.valueOf(10);
/**
* 产品经理
*/
// 产品缺陷率
private BigDecimal productBugRate=BigDecimal.ZERO;
//项目准时率 需求发布准时率 研发需求/用户需求
private BigDecimal productProjectOnTimeRateScore=BigDecimal.ZERO;
//主动性责任感
private BigDecimal productResponsibilityScore=BigDecimal.valueOf(5);
//需求会议
private BigDecimal productMeetScore=BigDecimal.valueOf(10);
//问题响应
private BigDecimal productProblemResponse=BigDecimal.valueOf(15);
//需求准确性
private BigDecimal accurateDemand=BigDecimal.valueOf(20);;
//产品规划
private BigDecimal productPlanning=BigDecimal.valueOf(10);;
//本阶段计划发布数量
private BigDecimal productPlanStoryNum;
//本阶段准时发布研发数量
private BigDecimal productPlanStoryOnTimeNum;
}

View File

@@ -3,7 +3,6 @@ package com.sa.zentao.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.sa.zentao.enums.UserType;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -206,8 +205,6 @@ public class ZtProjectDTO<T> implements Serializable {
private String deleted;
private UserType userType;
private List<T> children;
private List<Integer> storyIds;

View File

@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.sa.zentao.entity.ZtStoryCase;
import com.sa.zentao.entity.ZtStoryreview;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -32,7 +31,6 @@ public class ZtStoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotNull(message = "请录入ID")
@ExcelProperty(value = "ID",index =0)
private Integer id;
@ExcelProperty(value = "研发需求名称",index =1)
@@ -50,8 +48,6 @@ public class ZtStoryDTO implements Serializable {
private Date planEndDate;
@ExcelProperty(value = "阶段",index =6)
private String stage;
@ExcelIgnore
private String stageName;
@ExcelProperty(value = "指派给",index =7)
private String assignedToName;
@@ -156,36 +152,8 @@ public class ZtStoryDTO implements Serializable {
private Integer frombug;
@ExcelIgnore
private Integer feedback;
/**
* 产品人
*/
@ExcelIgnore
private String productUser;
/**
* 产品人
*/
@ExcelIgnore
private String productUserName;
@ExcelIgnore
private String productUserColor;
/**
* 产品人
*/
@ExcelIgnore
private String testUser;
@ExcelIgnore
private String testUserColor;
/**
* 产品人
*/
@ExcelIgnore
private String testUserName;
/**
* 1是否内部验收 0不需要
*/
@ExcelIgnore
private Integer innerYsFlag;
@ExcelIgnore
private String keywords;
@@ -249,6 +217,7 @@ public class ZtStoryDTO implements Serializable {
private Date planYsDate;
@ExcelIgnore
private Date activateddate;
@ExcelIgnore

View File

@@ -2,25 +2,18 @@ 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>
@@ -32,14 +25,12 @@ import java.util.Set;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Slf4j
public class ZtStoryUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
// @TableId(value = "id", type = IdType.AUTO)
// @ExcelProperty
@NotNull(message = "ID不能为空")
@ExcelProperty(value = "ID",index =0)
private Integer id;
@@ -55,8 +46,6 @@ public class ZtStoryUserDTO implements Serializable {
*/
@ExcelProperty(value = "关联研发需求",index =4)
private String storyList;
@ExcelIgnore
private Set<ZtProject> execList;
@ExcelProperty(value = "状态",index =5)
private String status;
@@ -141,10 +130,6 @@ public class ZtStoryUserDTO implements Serializable {
@ExcelIgnore
private String color;
@ExcelIgnore
private String productUserName;
@ExcelIgnore
private String productUserColor;
@ExcelIgnore
private String stage;
@ExcelIgnore
@@ -162,7 +147,7 @@ public class ZtStoryUserDTO implements Serializable {
private String openedby;
@NotBlank(message = "指派??")
@ExcelIgnore
private String assignedto;
@ExcelIgnore
@@ -288,30 +273,4 @@ 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);
}
}
}

View File

@@ -212,8 +212,4 @@ public class ZtTaskDTO implements Serializable {
* 交付物
*/
private String deliverContent;
/**
* 1提交 0不提交
*/
private Integer innerYsFlag;
}

View File

@@ -190,12 +190,7 @@ public class ZtStory implements Serializable {
private Date developedDate;
//结束日期 测试结束
private Date endDate;
//内部验收时间
@TableField(exist = false)
private Date innerYsTime;
//测试提交验收时间
@TableField(exist = false)
private Date testSubmitYsTime;
private Integer project;
//1通过 2不通过
private Integer ysFlag;
@@ -228,16 +223,5 @@ public class ZtStory implements Serializable {
// private Date develDate;
// //测试完成时间
// private Date testedDate;
/**
* 内部验收标识 1需要内部验收 0不需要
*/
private Integer innerYsFlag;
/**
* 产品人员
*/
private String productUser;
/**
* 测试人员
*/
private String testUser;
}

View File

@@ -225,9 +225,4 @@ public class ZtStoryUser implements Serializable {
private String deliverRemark;
private String oldStatus;
/**
* 产品用户
*/
private String productUser;
}

View File

@@ -31,6 +31,5 @@ public class ZtStoryUserspec implements Serializable {
private String files;
private String storyBackground;
}

View File

@@ -62,12 +62,6 @@ public enum ActionStatus {
XGMM(101, "xgmm","修改密码"),
CZMM(102, "czmm","重置密码"),
CZINFO(103, "czmm","重置"),
//测试提交验收
TESTSUBMITYS(200, "testSubmitYs","测试提交验收"),
PRODUCTYS(201, "productYs","产品验收"),
ASSIGNTOPRODUCTUSER(202, "assignProductUser","指派产品人"),
ASSIGNTOTESTUSER(203, "assignTestUser","指派测试人"),
;
@EnumValue

View File

@@ -1,49 +0,0 @@
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;
}
}

View File

@@ -16,8 +16,6 @@ public enum StoryStageEnums {
developed(10, "developed","研发完毕"),
testing(5, "testing","测试中"),
tested(6, "tested","测试完毕"),
productWaitVerified(9, "productWaitVerified","产品验收中"),
productVerified(10, "productVerified","产品已验收"),
released(7, "released","已发布"),
verified(8, "verified","已验收"),
;

View File

@@ -10,7 +10,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -60,7 +59,4 @@ public interface ZtStoryMapper extends BaseMapper<ZtStory> {
* @return
*/
List<SearchDTO> searchAll(@Param("keyword") String keyword,@Param("pIds")List<Integer> pIds);
Map<String, Object> storyReleaseOnTimeByProducts(@Param("pIds") List<Integer> pids,
@Param("startTime") Date firstDayOfMonth,@Param("endTime") Date lastDayOfMonth);
}

View File

@@ -22,10 +22,6 @@ public class StoryQo extends BaseQo {
private Integer productId;
private String openedby;
private String status;
/**
* 用户产品
*/
private String productUser;
private List<Integer> productIds;
private List<String> statusList;

View File

@@ -37,6 +37,7 @@ public class ZtProjectQo extends BaseQo {
private String severity;
private String productName;
private Integer productId;
private List<Integer> productIds;
@@ -63,8 +64,6 @@ public class ZtProjectQo extends BaseQo {
private String status;
private List<String> statusList;
private List<String> stageList;
private String title;

View File

@@ -57,6 +57,4 @@ public interface IZtProductService extends IService<ZtProduct> {
List<ZtProduct> productListByProgramName(String programName);
PageInfo<ZtProjectDTO> getExecutionByProductId(ZtProjectQo qo);
}

View File

@@ -57,7 +57,7 @@ public interface IZtStoryService extends IService<ZtStory> {
void waitStory(Integer story);
void startStory(Integer story);
//开发完成
void develFinishStory(Integer story,String finishBy);
void finishStory(Integer story,String finishBy);
//测试完毕
void testedStory(Integer story,String finishBy);
//测试中
@@ -105,15 +105,4 @@ public interface IZtStoryService extends IService<ZtStory> {
List<ZtStory> getStoryListByDatePidsProject(List<Integer> pids, Integer id, Date firstDayOfMonth, Date lastDayOfMonth);
PageInfo<SearchDTO> searchByName(SearchQo qo);
void testSubmitVerified(ZtStoryDTO qo);
void storyProductUserYs(ZtStoryDTO qo);
Map<String, Object> storyReleaseOnTimeByProducts(@Param("pids") List<Integer> pids, @Param("startTime")Date firstDayOfMonth,
@Param("endTime")Date lastDayOfMonth);
void assignedToProductUser(ZtStoryDTO dto);
void assignedToTestUser(ZtStoryDTO dto);
}

View File

@@ -54,7 +54,4 @@ public interface IZtStoryUserService extends IService<ZtStoryUser> {
void confirmStory(ZtStoryUserDTO dto);
void needMeetOrDesign(ZtStoryUserDTO dto);
void assignedToProductUser(ZtStoryUserDTO dto);
}

View File

@@ -46,9 +46,7 @@ public class FestivalConfigServiceImpl extends ServiceImpl<FestivalConfigMapper,
List<FestivalConfig> festivalConfigs = this.baseMapper.selectList(new QueryWrapper<FestivalConfig>().lambda()
.eq(FestivalConfig::getYear,qo.getYear())
.eq(FestivalConfig::getName, qo.getName()).
List<FestivalConfig> festivalConfigs = this.baseMapper.selectList(new QueryWrapper<FestivalConfig>().lambda().eq(FestivalConfig::getName, qo.getName()).
eq(FestivalConfig::getDeleteFlag, DeleteFlagEnum.USED));
if(!CollectionUtils.isEmpty(festivalConfigs)){
throw new BusinessException("已存在");

View File

@@ -1,6 +1,5 @@
package com.sa.zentao.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.annotation.ExcelIgnore;
@@ -243,10 +242,7 @@ public class IZtCountService {
.map(o -> o.getId() + "").collect(Collectors.joining(",")));
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
.filter(o -> Arrays.asList("testing", "tested"
,StoryStageEnums.productWaitVerified.getValue()
,StoryStageEnums.productVerified.getValue()
).contains(o.getStage())).map(o -> o.getId() + "").collect(Collectors.joining(",")));
.filter(o -> Arrays.asList("testing", "tested").contains(o.getStage())).map(o -> o.getId() + "").collect(Collectors.joining(",")));
// developing 研发中 developed 研发完毕 testing 测试中 tested测试完毕
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
@@ -354,10 +350,7 @@ public class IZtCountService {
//0825 计划中和研发中合并
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
.filter(o -> Arrays.asList("wait","tested", "testing", "developed", "developing"
,StoryStageEnums.productWaitVerified.getValue()
,StoryStageEnums.productVerified.getValue()).contains(o.getStage()
)
.filter(o -> Arrays.asList("wait","tested", "testing", "developed", "developing").contains(o.getStage())
).map(o -> o.getId() + "").collect(Collectors.joining(",")));
result.setCswbCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
@@ -387,7 +380,7 @@ public class IZtCountService {
result = setFeedback(result, feedbacks);
} else if (userType == UserType.XMGLY || userType == UserType.XMZL||userType == UserType.CPJL) {
} else if (userType == UserType.XMGLY || userType == UserType.XMZL) {
List<ZtProduct> pList = this.productService.listByIds(pIds);
@@ -419,9 +412,7 @@ public class IZtCountService {
.map(o -> o.getId() + "").collect(Collectors.joining(",")));
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
.filter(o -> Arrays.asList("testing", "tested",StoryStageEnums.productVerified.getValue()
,StoryStageEnums.productWaitVerified.getValue()
).contains(o.getStage())).map(o -> o.getId() + "").collect(Collectors.joining(",")));
.filter(o -> Arrays.asList("testing", "tested").contains(o.getStage())).map(o -> o.getId() + "").collect(Collectors.joining(",")));
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
.filter(o -> Arrays.asList("developing", "developed").contains(o.getStage())).map(o -> o.getId() + "").collect(Collectors.joining(",")));
@@ -552,10 +543,6 @@ public class IZtCountService {
continue;
}
performanceDTO=JSON.parseObject(ztMonthScore.getScopeJson(),PerformanceDTO.class);
if (ztUser.getAccount().equals("weidongxia")) {
generatorCPJLExcel(qo, performanceDTO.getUserName(), performanceDTO, qo.getDate(), perList);
list.add(performanceDTO.getUserName() + "产品经理考核.xlsx");
} else
if (ztUser.getAccount().equals("liyuyan")) {
generatorXMZLExcel(performanceDTO.getUserName(), performanceDTO, qo.getDate());
list.add(performanceDTO.getUserName() + "项目助理考核.xlsx");
@@ -577,9 +564,6 @@ public class IZtCountService {
} else if (ztUser.getUserType() == UserType.XMJL || ztUser.getUserType() == UserType.XMGLY || ztUser.getUserType() == UserType.GSGC) {
generatorXMJLExcel(qo, performanceDTO.getUserName(), performanceDTO, qo.getDate(), perList);
list.add(performanceDTO.getUserName() + "项目经理考核.xlsx");
}else if (ztUser.getUserType() == UserType.CPJL ) {
generatorCPJLExcel(qo, performanceDTO.getUserName(), performanceDTO, qo.getDate(), perList);
list.add(performanceDTO.getUserName() + "产品经理考核.xlsx");
}
}
String dir = System.getProperty("user.dir") + "/";
@@ -741,11 +725,7 @@ public class IZtCountService {
for (ZtUser u : ztUsers) {
List<ItApproval> approvalList = this.taskService.itApprovalByUserName(u.getNickname(), firstDayOfMonth, lastDayOfMonth);
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")) {
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));
@@ -1187,69 +1167,6 @@ public class IZtCountService {
return dto;
}
PerformanceDTO buildCPJLScore(ZtUser u,Map<String, ZtUser> userMap,ZtProjectQo qo, List<ItApproval> approvalList, Date firstDayOfMonth, Date lastDayOfMonth, List<ZtTask> taskList, Date d,List<Integer> pids) {
/**
* 产品经理
*/
PerformanceDTO dto = new PerformanceDTO();
dto.setUserName(u.getNickname());
dto.setAccount(u.getAccount());
//项目准时率 Σ (当月上线准时上线的需求量) / Σ (当月规划上线的需求总量) * 100≥95%
// dto.setProjectOnTimeRate();
//产品缺陷率
// dto.setProductBugRate();
Map<String,Object> map=this.storyService.storyReleaseOnTimeByProducts(pids,firstDayOfMonth,lastDayOfMonth);
Integer planReleaseStoryNum = Integer.valueOf(map.getOrDefault("planReleaseStoryNum", 0).toString());
Integer storyOnTimeNum = Integer.valueOf(map.getOrDefault("onTimeNum", 0).toString());
dto.setProductPlanStoryNum(BigDecimal.valueOf(planReleaseStoryNum));
dto.setProductPlanStoryOnTimeNum(BigDecimal.valueOf(storyOnTimeNum));
int storyOnTimeRate = ObjectUtil.equal(planReleaseStoryNum, 0) ? 0 :
(BigDecimal.valueOf(storyOnTimeNum*100).divide(BigDecimal.valueOf(planReleaseStoryNum), 0, BigDecimal.ROUND_UP)).intValue();
int productProjectOnTimeRateScore=storyOnTimeRate==0?0: (storyOnTimeRate>=95)? 20:
(storyOnTimeRate>=90&&storyOnTimeRate<95)?(20-(95-storyOnTimeRate)):
((90-storyOnTimeRate)*2+5>20)? 0:(20-((90-storyOnTimeRate)*2+5));
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")
.ge(ZtBug::getOpeneddate,firstDayOfMonth)
.le(ZtBug::getOpeneddate,lastDayOfMonth)
.in(ZtBug::getProduct,pids));
allBugList = this.bugService.getNormalBugList(allBugList);
//开发分配工时
ZtCountQo ztCountQo = new ZtCountQo();
BeanUtils.copyProperties(qo, ztCountQo);
List<ZtProduct> ztProducts = this.productService.listByIds(pids);
List<PerformanceDTO> perList = this.programCount(ztCountQo,ztProducts.stream().map(o->o.getProgram()).collect(Collectors.toList()));
dto = buildTaskManage(dto, perList, userMap,firstDayOfMonth,lastDayOfMonth,pids);
//开发任务分配工时
BigDecimal allocationTime = dto.getAllocationTime();
double bugRate=(allocationTime.doubleValue()==0||allBugList.size()==0)?0:BigDecimal.valueOf(allBugList.size()*1000).divide(allocationTime,2,BigDecimal.ROUND_HALF_UP).doubleValue();
dto.setBugDensity(BigDecimal.valueOf(bugRate));
if(bugRate<=5){
dto.setBugScore(BigDecimal.valueOf(20));
}else{
// long deductBugScore = Math.min(seriousBug * 10L + slightBug * 3L, 20L);
// dto.setBugScore(BigDecimal.valueOf(20L-deductBugScore));
//严重10 分 轻微3分一个
int bugScore = 0;
for (ZtBug b : allBugList) {
bugScore += b.getSeverity() != 1 ? 3 : 10;
}
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.setSlightBug( BigDecimal.valueOf(allBugList.stream().filter(o -> Arrays.asList(4, 2, 3).contains(o.getSeverity())).count()));
return dto;
}
//满分30
private PerformanceDTO getMeetScore(ZtUser u, Date start, Date end, PerformanceDTO dto) {
List<Integer> pIds = this.projectService.authProductList();
@@ -1508,7 +1425,6 @@ 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);
@@ -2281,52 +2197,7 @@ public class IZtCountService {
writeXlsx(name, "templates/scope/项目经理考核.xlsx", name + "项目经理考核.xlsx", dataMap);
}
void generatorCPJLExcel(ZtCountQo qo, String name, PerformanceDTO performanceDTO, Date d, List<PerformanceDTO> perList) {
Map<String, ZtUser> userMap = userService.userMapByIds(null);
Map<String, String> dataMap = new HashMap<>();
dataMap.put("name", name);
dataMap.put("date", DateUtils.formatDate(d, "yyyy-MM"));
//产品规划
dataMap.put("productPlanning",performanceDTO.getProductPlanning()==null?"0":performanceDTO.getProductPlanning().toString());
//需求准确性
dataMap.put("accurateDemand", performanceDTO.getAccurateDemand()==null?"0": performanceDTO.getAccurateDemand().toString());
//项目准时率
dataMap.put("productProjectOnTimeRateScore",performanceDTO.getProductProjectOnTimeRateScore()==null?"0": performanceDTO.getProductProjectOnTimeRateScore().toString());
//线上Bug得分 缺陷
dataMap.put("bugScope", performanceDTO.getBugScore()==null?"0": performanceDTO.getBugScore().toString());
//开发分配工时
dataMap.put("allocationTime", performanceDTO.getBugScore()==null?"0": performanceDTO.getAllocationTime().toString());
//轻微
dataMap.put("slightBug", performanceDTO.getSlightBug()==null?"0": performanceDTO.getSlightBug().toString());
dataMap.put("seriousBug", performanceDTO.getSeriousBug()==null?"0": performanceDTO.getSeriousBug().toString());
//问题响应
dataMap.put("productProblemResponse", performanceDTO.getProductProblemResponse()==null?"0": performanceDTO.getProductProblemResponse().toString());
//会议管理
dataMap.put("productMeetScore", performanceDTO.getProductMeetScore()==null?"0": performanceDTO.getProductMeetScore().toString());
//主动性责任感
dataMap.put("productResponsibilityScore", performanceDTO.getProductResponsibilityScore()==null?"0": performanceDTO.getProductResponsibilityScore().toString());
dataMap.put("productPlanStoryNum", performanceDTO.getProductPlanStoryNum()==null?"0": performanceDTO.getProductPlanStoryNum().toString());
dataMap.put("productPlanStoryOnTimeNum", performanceDTO.getProductPlanStoryOnTimeNum()==null?"0": performanceDTO.getProductPlanStoryOnTimeNum().toString());
dataMap.put("allocationTime", performanceDTO.getAllocationTime()==null?"0": performanceDTO.getAllocationTime().toString());
dataMap.put("slightBug", performanceDTO.getSlightBug()==null?"0": performanceDTO.getSlightBug().toString());
dataMap.put("seriousBug", performanceDTO.getSeriousBug()==null?"0": performanceDTO.getSeriousBug().toString());
dataMap.put("bugDensity", performanceDTO.getBugDensity()==null?"0": performanceDTO.getBugDensity().toString());
dataMap.put("总分", devlopTotal(
dataMap.get("productPlanning"),
dataMap.get("accurateDemand"),
dataMap.get("productProjectOnTimeRateScore"),
dataMap.get("bugScope"),
dataMap.get("productProblemResponse"),
dataMap.get("productMeetScore"),
dataMap.get("productResponsibilityScore")
));
writeXlsx(name, "templates/scope/产品经理考核.xlsx", name + "产品经理考核.xlsx", dataMap);
}
private String versionPlanScore(ZtCountQo qo, List<PerformanceDTO> perList, Map<String, ZtUser> userMap) {
return "20";
// BigDecimal allocationTime =BigDecimal.ZERO;
@@ -2409,7 +2280,7 @@ public class IZtCountService {
//线上bug
List<ZtBug> bList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().in(ZtBug::getProject, projectIds)
.ge(ZtBug::getOpeneddate, firstDayOfMonth).le(ZtBug::getOpeneddate, lastDayOfMonth)
.in(ZtBug::getBugType, "prod","releaseBug")
.eq(ZtBug::getBugType, "prod")
);
if (CollectionUtils.isEmpty(bList)) {
result.setBugScore(BigDecimal.valueOf(20));
@@ -2432,9 +2303,9 @@ public class IZtCountService {
List<ZtBug> slightBugList = bList.stream().filter(o -> slights.contains(o.getSeverity())).collect(Collectors.toList());
result.setSlightBug(BigDecimal.valueOf(slightBugList.size()));
BigDecimal bugRate = BigDecimal.valueOf(bList.size()).divide(BigDecimalUtils.isZero(allocationTime) ? BigDecimal.valueOf(1) : allocationTime, 3, BigDecimal.ROUND_HALF_UP);
BigDecimal bugRate = BigDecimal.valueOf(bList.size()).divide(BigDecimalUtils.isZero(allocationTime) ? BigDecimal.valueOf(1) : allocationTime, 2, BigDecimal.ROUND_HALF_UP);
result.setBugDensity(bugRate);
int i = bugRate.multiply(BigDecimal.valueOf(1000)).intValue();
int i = bugRate.multiply(BigDecimal.valueOf(100)).intValue();
if (i <= 5) {
result.setBugScore(BigDecimal.valueOf(20));
return result;
@@ -2496,6 +2367,10 @@ public class IZtCountService {
}
private PerformanceDTO buildTaskManage(PerformanceDTO result, List<PerformanceDTO> perList, Map<String, ZtUser> userMap,Date startDate,Date endDate,List<Integer> pids) {
//多个项目组人员
List multipUser = this.getmultipleDepartProjectTeam(startDate, endDate);
//分配总工时
@@ -2713,9 +2588,7 @@ public class IZtCountService {
//获取测试需求
List<ZtStory> cswcStoryList = this.storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getProduct, pids)
.in(ZtStory::getAssignedTo, Arrays.asList(u.getAccount())).ge(ZtStory::getReleaseddate, firstDayOfMonth).le(ZtStory::getReleaseddate, lastDayOfMonth));
if (name.equals("weidongxia")) {
result = buildCPJLScore(u, userMap , qo,approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d,pids);
} else
if (name.equals("liyuyan")) {
result = buildXMZLScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d);
} else if ("liushengqing".equals(name)) {
@@ -2743,9 +2616,6 @@ public class IZtCountService {
result.setProfessionalSkillEnhancementScore(BigDecimal.valueOf(0));
} else if (u.getUserType() == UserType.XMZL) {
result = buildXMZLScore(u, approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d);
} else if (u.getUserType() == UserType.CPJL) {
//产品经理
result = buildCPJLScore(u, userMap , qo,approvalList, firstDayOfMonth, lastDayOfMonth, taskList, d,pids);
}
return result;

View File

@@ -7,9 +7,7 @@ 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;
@@ -19,7 +17,6 @@ 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;
@@ -40,7 +37,6 @@ import java.util.stream.Stream;
* @since 2024-07-09
*/
@Service
@Slf4j
public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtKanbanlane> implements IZtKanbanlaneService {
@Autowired
@@ -120,16 +116,6 @@ 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());
}
@@ -257,14 +243,14 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
this.kanbancellService.updateById(tokanbancell);
ActionType type= null;
if(KanbanCellType.STORY.getValue().equalsIgnoreCase(tabType)){
if("story".equalsIgnoreCase(tabType)){
type=ActionType.XQ;
//需求
// storyChange(qo);
//testing 测试中
}
if(KanbanCellType.BUG.getValue().equalsIgnoreCase(tabType)){
if("bug".equalsIgnoreCase(tabType)){
type=ActionType.BUG;
//bug
// bugChange(qo);
@@ -275,7 +261,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
//closed 关闭
}
if(KanbanCellType.TASK.getValue().equalsIgnoreCase(tabType)){
if("task".equalsIgnoreCase(tabType)){
type=ActionType.RW;
//task
// taskChange(qo);
@@ -287,7 +273,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
//完成有新任务回退到进行中
//
// if(KanbanColumnType.TASK_CANCEL.getValue().equalsIgnoreCase(statusType)){
// if("canceled".equalsIgnoreCase(statusType)){
// //取消
// }
@@ -317,15 +303,12 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
List<String> carIds = new ArrayList<>(Arrays.asList(cell.getCards().split(",")));
if(carIds.contains(bussId.toString())){
thisZtKanbancell=cell;
break;
continue;
}
}
List<String> carIds = new ArrayList<>(Arrays.asList(thisZtKanbancell.getCards().split(",")));
while (carIds.contains(bussId.toString())) {
carIds.remove(bussId.toString());
}
carIds.remove(bussId.toString());
if(CollectionUtils.isEmpty(carIds)){
thisZtKanbancell.setCards("");
@@ -334,13 +317,8 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
thisZtKanbancell.setCards(StringUtils.join(carIds,","));
}
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);
ZtKanbancell ztKanbanlane = this.baseMapper.getZtKanbanlane(type, toStatus, execId);
String cards = ztKanbanlane.getCards();
List l=StringUtils.isEmpty(cards)?new ArrayList<>():new ArrayList<>(Arrays.asList(cards.split(",")));
l.add(bussId.toString());
@@ -351,7 +329,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, KanbanCellType.STORY.getValue()));
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "story"));
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
@@ -404,7 +382,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, KanbanCellType.TASK.getValue()));
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "task"));
List<ZtKanbancolumnDTO> kanbancolumnList = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
@@ -430,13 +408,11 @@ 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, KanbanCellType.BUG.getValue()));
.eq(ZtKanbanlane::getExecution, id).eq(ZtKanbanlane::getType, "bug"));
List<ZtKanbancolumnDTO> ztKanbancolumnDTOS = this.kanbancolumnMapper.listByLaneIds(Arrays.asList(lane.getId()));
List<ZtKanbancolumnDTO> backlog = ztKanbancolumnDTOS.stream()
.filter(o -> o.getType().equals(KanbanColumnType.BUG_UNCONFIRMED.getValue()))
.collect(Collectors.toList());
List<ZtKanbancolumnDTO> backlog = ztKanbancolumnDTOS.stream().filter(o -> o.getType().equals("unconfirmed")).collect(Collectors.toList());
ZtKanbancolumnDTO ztKanbancolumnDTO = backlog.get(0);
ZtKanbancell kanbancell = this.kanbancellService.getOne(new QueryWrapper<ZtKanbancell>().lambda()

View File

@@ -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(",");

View File

@@ -1,7 +1,6 @@
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;
@@ -688,63 +687,4 @@ 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;
}
}

View File

@@ -260,6 +260,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
cell.setColumn(ztKanbancolumn.getId());
cell.setType(ztKanbanlane.getType());
kanbancellService.save(cell);
}
}
}
@@ -313,11 +314,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
public void projectClose(ZtProjectDTO dto) {
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
if (ztProject == null) {
throw new BusinessException("未查询到项目项目ID: " + dto.getId());
}
if ("closed".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("项目已关闭无法重复关闭项目ID: " + dto.getId());
if (ztProject == null || "closed".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("未查询到");
}
ztProject.setRealEnd(dto.getClosedDate());
ztProject.setLastEditedDate(new Date());
@@ -353,7 +351,6 @@ 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())) {
@@ -389,11 +386,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
@Override
public void projectDeleted(ZtProjectDTO dto) {
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
if (ztProject == null) {
throw new BusinessException("未查询到项目项目ID: " + dto.getId());
}
if ("1".equalsIgnoreCase(ztProject.getDeleted())) {
throw new BusinessException("项目已删除无法重复删除项目ID: " + dto.getId());
if (ztProject == null || "1".equalsIgnoreCase(ztProject.getDeleted())) {
throw new BusinessException("未查询到");
}
ztProject.setDeleted("1");
ztProject.setCanceledBy(RiskUserThreadLocal.get().getName());
@@ -428,11 +422,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
@Override
public void projectActivated(ZtProjectDTO dto) {
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
if (ztProject == null) {
throw new BusinessException("未查询到项目项目ID: " + dto.getId());
}
if (!"closed".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("项目未关闭,无法激活,当前状态: " + ztProject.getStatus() + "项目ID: " + dto.getId());
if (ztProject == null || !"closed".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("未查询到");
}
LambdaUpdateWrapper<ZtProject> updateWrapper = new UpdateWrapper<ZtProject>().lambda().set(ZtProject::getStatus, "doing")
.set(ZtProject::getRealEnd,null)
@@ -467,11 +458,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
@Override
public void projectSuspended(ZtProjectDTO dto) {
ZtProject ztProject = this.baseMapper.selectById(dto.getId());
if (ztProject == null) {
throw new BusinessException("未查询到项目项目ID: " + dto.getId());
}
if (!"wait".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("项目状态不是等待状态,无法挂起,当前状态: " + ztProject.getStatus() + "项目ID: " + dto.getId());
if (ztProject == null || !"wait".equalsIgnoreCase(ztProject.getStatus())) {
throw new BusinessException("未查询到");
}
ztProject.setStatus("suspended");
ztProject.setLastEditedBy(RiskUserThreadLocal.get().getName());
@@ -1953,9 +1941,9 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
List<ZtTask> allTaskList =this.taskService.taskListByEIdsAndDate(firstDayOfMonth,lastDayOfMonth,products.stream().map(o->o.getId()).collect(Collectors.toList()));
// if (CollectionUtils.isEmpty(allTaskList)) {
// return new PageInfo<>();
// }
if (CollectionUtils.isEmpty(allTaskList)) {
return new PageInfo<>();
}
List<ZtTeam> teams = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getType, "execution")

View File

@@ -112,7 +112,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
List<ZtStory> sList = this.storyService.list(new QueryWrapper<ZtStory>()
.lambda().eq(ZtStory::getStatus, "active")
.in(ZtStory::getId, list.stream().map(o -> o.getStory()).distinct().collect(Collectors.toList()))
.eq(ZtStory::getStage, StoryStageEnums.productVerified.getValue()));
.eq(ZtStory::getStage, StoryStageEnums.tested.getValue()));
if (!CollectionUtils.isEmpty(sList)) {
//没有被关联的需求 测试完成的
List<ZtReleaseDetails> releaseStoryList = this.releaseDetailsService.list(new QueryWrapper<ZtReleaseDetails>().lambda()
@@ -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);
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());
long notTested = ztStories.stream().filter(o -> !o.getStage().equals("tested")).count();
if(notTested>0){
throw new BusinessException("当前需求存在未测试完成的请检查");
}
//'active','resolved','closed'?
long count = bugs.stream().filter(o -> !Arrays.asList("resolved","closed").contains(o.getStatus())).count();
@@ -378,7 +378,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
throw new BusinessException("当前bug存在未完成请检查");
}
for (ZtStory st : ztStories) {
if (! StoryStageEnums.productVerified.getValue().equals(st.getStage())) {
if (!"tested".equals(st.getStage())) {
throw new BusinessException(st.getTitle() + " 当前需求无法发布,请检查");
}
this.storyService.releaseStory(st.getId());
@@ -391,6 +391,8 @@ 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,

View File

@@ -1,6 +1,5 @@
package com.sa.zentao.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -157,14 +156,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if (ztUser != null) {
d.setUserStoryCreateUser(ztUser.getNickname());
}
ztUser = userMap.get(d.getProductUser());
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());
@@ -817,8 +808,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
for (ZtStoryDTO d : list) {
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
d.setViews(rMap.get(d.getId()));
StoryStageEnums stageEnums = StoryStageEnums.transfer(d.getStage());
d.setStageName(stageEnums==null?null:stageEnums.getDesc());
List<ZtTask> ztTasks = taskCountMap.get(d.getId());
ZtStoryCaseDTO ztStoryCaseDTO = caseMap.get(d.getId());
if (ztStoryCaseDTO != null) {
@@ -860,14 +849,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if (ztUser != null) {
d.setYsUserName(ztUser.getNickname());
}
ztUser = userMap.get(d.getProductUser());
if (ztUser != null) {
d.setProductUserName(ztUser.getNickname());
}
ztUser = userMap.get(d.getTestUser());
if (ztUser != null) {
d.setTestUserName(ztUser.getNickname());
}
}
}
@@ -975,105 +956,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
return searchDTOPageInfo;
}
@Override
@Transactional
public void testSubmitVerified(ZtStoryDTO qo) {
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
if(ztStory==null){
throw new BusinessException("未查询到需求需求ID: " + qo.getId());
}
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
throw new BusinessException("需求状态不是激活状态,无法提交验收,当前状态: " + ztStory.getStatus() + "需求ID: " + qo.getId());
}
if(!StoryStageEnums.tested.getValue().equals(ztStory.getStage())){
throw new BusinessException("需求阶段不是测试完毕,无法提交验收,当前阶段: " + ztStory.getStage() + "需求ID: " + qo.getId());
}
if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
throw new BusinessException("无需内部验收不需要提交需求ID: " + qo.getId());
}
//产品验收中
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
ztStory.setTestSubmitYsTime(new Date());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
ztStory.setLastediteddate(new Date());
this.baseMapper.updateById(ztStory);
List<ZtProjectstory> ztProjectstories = this.projectstoryService.projectListByStory(Arrays.asList(ztStory.getId()), ProjectTypeEnums.execution);
//更改看板
if(!CollectionUtils.isEmpty(ztProjectstories)){
for(ZtProjectstory ztProjectstory:ztProjectstories){
kanbanlaneService.changeStatus(ztProjectstory.getProject(),ztStory.getId(),"story",StoryStageEnums.productWaitVerified.getValue());
}
}
actionService.addAction(ActionType.XQ, ActionStatus.TESTSUBMITYS, ztStory.getId(), ztStory.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), "", "");
}
@Override
public void storyProductUserYs(ZtStoryDTO qo) {
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
if(ztStory==null){
throw new BusinessException("未查询到需求需求ID: " + qo.getId());
}
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
throw new BusinessException("需求状态不是激活状态,无法验收,当前状态: " + ztStory.getStatus() + "需求ID: " + qo.getId());
}
if(!StoryStageEnums.productWaitVerified.getValue().equals(ztStory.getStage())){
throw new BusinessException("需求阶段不是待验收状态,无法验收,当前阶段: " + ztStory.getStage() + "需求ID: " + qo.getId());
}
//产品验收中
ztStory.setStage(StoryStageEnums.productVerified.getValue());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
ztStory.setLastediteddate(new Date());
ztStory.setInnerYsTime(new Date());
this.baseMapper.updateById(ztStory);
List<ZtProjectstory> ztProjectstories = this.projectstoryService.projectListByStory(Arrays.asList(ztStory.getId()), ProjectTypeEnums.execution);
//更改看板
if(!CollectionUtils.isEmpty(ztProjectstories)){
for(ZtProjectstory ztProjectstory:ztProjectstories){
kanbanlaneService.changeStatus(ztProjectstory.getProject(),ztStory.getId(),"story",StoryStageEnums.productVerified.getValue());
}
}
actionService.addAction(ActionType.XQ, ActionStatus.PRODUCTYS, ztStory.getId(), ztStory.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), "", "");
}
@Override
public Map<String, Object> storyReleaseOnTimeByProducts(List<Integer> pids, Date firstDayOfMonth, Date lastDayOfMonth) {
return this.baseMapper.storyReleaseOnTimeByProducts(pids,firstDayOfMonth,lastDayOfMonth);
}
@Override
public void assignedToProductUser(ZtStoryDTO dto) {
ZtStory ztStory = this.baseMapper.selectById(dto.getId());
if(ztStory==null){
throw new BusinessException("未查询到数据");
}
ztStory.setProductUser(dto.getAssignedTo());
ztStory.setLastediteddate(new Date());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
this.baseMapper.updateById(ztStory);
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOPRODUCTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), "", dto.getAssignedTo());
}
@Override
public void assignedToTestUser(ZtStoryDTO dto) {
ZtStory ztStory = this.baseMapper.selectById(dto.getId());
if(ztStory==null){
throw new BusinessException("未查询到数据");
}
ztStory.setTestUser(dto.getAssignedTo());
ztStory.setLastediteddate(new Date());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
this.baseMapper.updateById(ztStory);
actionService.addAction(ActionType.XQ, ActionStatus.ASSIGNTOTESTUSER, ztStory.getId(), ztStory.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), "", dto.getAssignedTo());
}
private List<SearchDTO> searchBug(SearchQo qo) {
return this.baseMapper.searchBug(qo.getKeyword());
}
@@ -1271,14 +1153,9 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
}
}
/**
* 开发完成
* @param id
* @param finishBy
*/
@Override
@Transactional
public void develFinishStory(Integer id, String finishBy) {
public void finishStory(Integer id, String finishBy) {
if (id == null || id == 0) {
return;
@@ -1330,7 +1207,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
throw new BusinessException("未查询到数据-需求");
}
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing",StoryStageEnums.productWaitVerified.getValue(),StoryStageEnums.productVerified.getValue()).contains(ztStory.getStage())) {
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing").contains(ztStory.getStage())) {
return;
}
@@ -1365,13 +1242,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
actionService.addAction(ActionType.XQ, ActionStatus.CSWC, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
RiskUserThreadLocal.get().getName(), null, "");
}
//不需要内部验收 产品已验收
if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
newStatus = StoryStageEnums.productVerified.getValue();
ztStory.setStage(newStatus);
ztStory.setInnerYsTime(new Date());
}
if (ztStory.getStartDate() == null) {
ztStory.setStartDate(new Date());
}
@@ -1383,7 +1253,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
for (Integer execId : execIds) {
if (execId != null) {
this.kanbanlaneService.changeStatus(execId, ztStory.getId(), "story", newStatus);
this.kanbanlaneService.changeStatus(execId, ztStory.getId(), "story", "tested");
if (!oldStatus.equalsIgnoreCase(newStatus) && ztStory.getProduct() != 0) {
ProductStoryStatus oldPStatus = null;
@@ -1400,6 +1270,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
}
//发布
@Override
@Transactional
@@ -1409,25 +1280,22 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
}
ZtStory ztStory = this.baseMapper.selectById(story);
if (ztStory == null) {
throw new BusinessException("未查询到数据-需求");
}
if (ztStory.getFeedback() != null && ztStory.getFeedback() != 0) {
this.storyFeedbackService.feedbackFinished(ztStory.getFeedback(), null);
}
if (ztStory == null) {
throw new BusinessException("未查询到数据-需求");
}
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested",
StoryStageEnums.productWaitVerified.getValue()
,StoryStageEnums.productVerified.getValue()).contains(ztStory.getStage())) {
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested").contains(ztStory.getStage())) {
return;
}
if ("closed".equals(ztStory.getStatus())) {
throw new BusinessException("当前已关闭");
}
if (!StoryStageEnums.productVerified.getValue().equals(ztStory.getStage())) {
if (!"tested".equals(ztStory.getStage())) {
throw new BusinessException("当前无法更改发布状态");
}
//这个需求被多少执行关联
@@ -1490,10 +1358,16 @@ 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|| story == 0) {
if(ztStory == null) {
return;
}
if (ztStory.getStatus().equals("closed")) {
if (ztStory != null && ztStory.getStatus().equals("closed")) {
return;
}
if (type != TaskType.test && type != TaskType.devel) {
// return;
}
if (story == null || story == 0) {
return;
}
if (cancelFlag && type == TaskType.devel) {
@@ -1523,7 +1397,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if (!CollectionUtils.isEmpty(testedList)) {
testedStory(story, finishBy);
} else {
this.develFinishStory(story, finishBy);
this.finishStory(story, finishBy);
}
}
@@ -1564,7 +1438,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
.eq(ZtTask::getType, TaskType.devel.getCode())
.in(ZtTask::getStatus, Arrays.asList("done")));
if (!CollectionUtils.isEmpty(develedList)) {
this.develFinishStory(story, finishBy);
this.finishStory(story, finishBy);
return;
}
return;
@@ -1612,7 +1486,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if (done < 1) {
} else {
this.develFinishStory(story, finishBy);
this.finishStory(story, finishBy);
}
}
} else {
@@ -2276,14 +2150,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if (ztUser != null) {
d.setYsUserName(ztUser.getNickname());
}
ztUser = userMap.get(d.getProductUser());
if (ztUser != null) {
d.setProductUserName(ztUser.getNickname());
}
ztUser = userMap.get(d.getTestUser());
if (ztUser != null) {
d.setTestUserName(ztUser.getNickname());
}
ZtStoryspec storyspec = this.storyspecService.getOne(new QueryWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory, d.getId()));
if (storyspec != null) {
@@ -2583,7 +2449,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
ProductStoryStatus oldPStatus = null;
if (status.equalsIgnoreCase("developing") || status.equalsIgnoreCase("testing")
|| status.equalsIgnoreCase("tested") || status.equalsIgnoreCase("developed")
|| status.equalsIgnoreCase(StoryStageEnums.productWaitVerified.getValue())|| status.equalsIgnoreCase(StoryStageEnums.productVerified.getValue())
) {
oldPStatus = ProductStoryStatus.JH;

View File

@@ -19,7 +19,10 @@ 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.*;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -78,9 +81,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
@Autowired
private VxService vxService;
@Autowired
private IZtProjectstoryService projectstoryService;
@Value("${file.backUrl}")
private String url;
@@ -92,7 +92,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
this.baseMapper.insert(s);
fileService.updateFile(dto.getFiles(), s.getId(), FileTypes.userStory);
ZtStoryUserspec spec = buildSpec(dto, s);
ZtStoryUserspec spec= buildSpec(dto,s);
storyUserspecService.save(spec);
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct() + "", null, null,
@@ -125,7 +125,6 @@ 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;
}
@@ -221,7 +220,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).last(" limit 1"));
ZtStoryUserspec spec = this.storyUserspecService.getOne(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id));
if (spec == null) {
spec = new ZtStoryUserspec();
spec.setStory(id);
@@ -230,7 +229,6 @@ 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);
@@ -238,11 +236,9 @@ 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())
);
}
@@ -250,42 +246,38 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
fileService.updateFile(dto.getFiles(), ztStory.getId(), FileTypes.userStory);
}
@Override
public Map<String, List<ZtStoryUserDTO>> getKanban(Integer productId) {
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)
.eq(ZtStoryUser::getProduct, productId).orderByDesc(ZtStoryUser::getId));
Map<String, List<ZtStoryUserDTO>> map = new HashMap<>();
Map<String, ZtUser> stringZtUserMap = this.userService.userMapByIds(null);
Map<String, ZtUser> stringZtUserMap = this.userService.userMapByIds(ztStoryUsers.stream().map(o -> o.getOpenedby()).collect(Collectors.toList()));
List<ZtStoryUserDTO> ztStoryUserDTOS = BeanCopyUtil.copyListProperties(ztStoryUsers, ZtStoryUserDTO::new, new BeanCopyUtilCallBack<ZtStoryUser, ZtStoryUserDTO>() {
@Override
public void callBack(ZtStoryUser t, ZtStoryUserDTO s) {
ZtUser ztUser = stringZtUserMap.get(t.getOpenedby());
if (ztUser != null) {
if(ztUser!=null){
s.setOpenedbyName(ztUser.getNickname());
s.setColor(ztUser.getColor());
}
ztUser = stringZtUserMap.get(t.getProductUser());
if (ztUser != null) {
s.setProductUserName(ztUser.getNickname());
s.setProductUserColor(ztUser.getColor());
}
}
});
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("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("designdoing", ztStoryUserDTOS.stream().filter(o -> "designdoing".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("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("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("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("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("confirmed",ztStoryUserDTOS.stream().filter(o->"confirmed".equals(o.getStatus())).collect(Collectors.toList()));
return map;
}
@@ -301,18 +293,18 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
}
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>();
}
if (qo.getProductId() != null && qo.getProductId() != 0) {
if(qo.getProductId()!=null&&qo.getProductId()!=0){
qo.setProductIds(Arrays.asList(qo.getProductId()));
} else {
}else{
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",
"waitcommunicate", "waitdesign", "designdoing", "designdone", "storyunconfirmed"));
"waitcommunicate","waitdesign","designdoing","designdone","storyunconfirmed"));
}
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
@@ -323,9 +315,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
Map<Integer, List<ZtStory>> storyMap = getStoryMap(list);
//story - exec
Map<Integer,List<ZtProject>> execMap= getExecMap(storyMap);
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
for (ZtStoryUserDTO d : list) {
@@ -369,82 +359,32 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
if (ztUser != null) {
d.setYsUserName(ztUser.getNickname());
}
ztUser = userMap.get(d.getProductUser());
if (ztUser != null) {
d.setProductUserName(ztUser.getNickname());
List<ZtStory> ztStories = storyUserMap.get(d.getId());
if (!CollectionUtils.isEmpty(ztStories)) {
d.setStoryList(ztStories.stream().map(o ->o.getId()+":"+o.getTitle()).collect(Collectors.joining(",")));
d.setSList(CollectionUtils.isEmpty(ztStories)?null:BeanCopyUtil.copyListProperties(ztStories,ZtStoryDTO::new));
}
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);
}
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.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);
}
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, // 分组keystory字段
// 分组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) {
@@ -471,8 +411,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
.eq(ZtStoryUser::getDeleted, "0")
.orderByDesc(ZtStoryUser::getId);
eq.select(ZtStoryUser::getId, ZtStoryUser::getTitle, ZtStoryUser::getProduct,
ZtStoryUser::getOpenedby, ZtStoryUser::getAssignedto
eq.select(ZtStoryUser::getId,ZtStoryUser::getTitle,ZtStoryUser::getProduct,
ZtStoryUser::getOpenedby,ZtStoryUser::getAssignedto
);
List<ZtStoryUser> ztStories = this.baseMapper.selectList(eq);
if (CollectionUtils.isEmpty(ztStories)) {
@@ -512,7 +452,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
actionStatus = ActionStatus.PSBTG;
}
if (dto.getRevieweResult() != 1) {
if (dto.getRevieweResult() != 1){
ZtUser u = this.userService.getByAccount(ztStory.getOpenedby());
if (u != null && !StringUtils.isEmpty(u.getEmail())) {
StringBuilder b = new StringBuilder();
@@ -537,6 +477,7 @@ 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());
@@ -577,6 +518,10 @@ 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;
}
@@ -604,11 +549,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
if (ztUser != null) {
dto.setYsUserName(ztUser.getNickname());
}
ztUser = userMap.get(dto.getProductUser());
if (ztUser != null) {
dto.setProductUserName(ztUser.getNickname());
}
Map<Integer, List<ZtStory>> storyUserMap = getStoryMap(Arrays.asList(dto));
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(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(",")));
@@ -661,9 +602,8 @@ 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);
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) {
@@ -673,19 +613,10 @@ 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)) {
@@ -707,11 +638,10 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
dto.setViews(rMap.get(d.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);
dto.setSpec(ztStoryUserspec.getSpec());
dto.setVerify(ztStoryUserspec.getVerify());
dto.setStoryBackground(ztStoryUserspec.getStoryBackground());
}
return dto;
@@ -764,6 +694,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
}
@Override
public void changeStatus(Integer id, UserStoryEnums status) {
ZtStoryUser storyUser = this.baseMapper.selectById(id);
@@ -786,24 +717,24 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
//需求已确认
this.sendDesigndoneMessage(storyUser.getId(), ztProduct.getPo());
this.sendDesigndoneMessage(storyUser.getId(),ztProduct.getPo());
}
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());
//交付物确认
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
List<ZtStory> storyList = this.storyService.list(new QueryWrapper<ZtStory>().lambda()
.ne(ZtStory::getStatus, "closed").in(ZtStory::getStage, StoryStageEnums.beforeStatus(7)).eq(ZtStory::getUserStory, id));
if (!CollectionUtils.isEmpty(storyList)) {
return;
if(!CollectionUtils.isEmpty(storyList)){
return ;
}
}
storyUser.setStatus(status.getCode());
@@ -879,7 +810,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
this.baseMapper.updateById(storyUser);
if (status == UserStoryEnums.CPYSJ) {
if(status==UserStoryEnums.CPYSJ){
//发送消息
}
@@ -936,19 +867,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
}
}
@Override
public void assignedToProductUser(ZtStoryUserDTO dto) {
ZtStoryUser ztStoryUser = this.baseMapper.selectById(dto.getId());
if (ztStoryUser == null) {
throw new BusinessException("未查询到数据");
}
ztStoryUser.setProductUser(dto.getAssignedto());
this.baseMapper.updateById(ztStoryUser);
actionService.addAction(ActionType.USERXQ, ActionStatus.ASSIGNTOPRODUCTUSER, ztStoryUser.getId(), ztStoryUser.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), "", "");
}
private Map<Integer, List<ZtStory>> getStoryMap(List<ZtStoryUserDTO> list) {
private Map<Integer, List<ZtStory>> getStoryUserMap(List<ZtStoryUserDTO> list) {
List<Integer> ids = list.stream().map(o -> o.getId()).collect(Collectors.toList());
List<ZtStory> list1 = storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getUserStory, ids));
@@ -986,19 +905,16 @@ 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 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 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());
private void sendConfirmMessage(Integer id,String account) {
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.sendConfirmMessage(id),new Date());
}
}

View File

@@ -1,6 +1,5 @@
package com.sa.zentao.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -232,7 +231,6 @@ 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());
}
}
@@ -520,7 +518,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
Date d = new Date();
Date d=new Date();
for (ZtTaskDTO task : list) {
ZtUser ztUser = userMap.get(task.getFinishedby());
if (ztUser != null) {
@@ -533,16 +531,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
if (task.getDeadline() != null) {
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
}
if (task.getFinishedDate() != null) {
if (task.getFinishedDate().getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
if(task.getFinishedDate()!=null){
if(task.getFinishedDate().getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
task.setDelayFlag(1);
} else {
}else{
task.setDelayFlag(2);
}
} else {
if (d.getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
}else{
if(d.getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
task.setDelayFlag(1);
} else {
}else{
task.setDelayFlag(2);
}
}
@@ -579,8 +577,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
if (story != null && story != 0) {
ZtStory ztStory = this.storyService.getById(story);
// wait 初始化 projected 已立项 developing 研发中 developed 研发完毕 testing 测试中 tested
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested", StoryStageEnums.productWaitVerified.getValue()
, StoryStageEnums.productVerified.getValue()).contains(ztStory.getStage())) {
if (!Arrays.asList("wait", "projected", "developing", "developed", "testing", "tested").contains(ztStory.getStage())) {
throw new BusinessException("当前状态无法添加任务");
}
if (ztStory.getStatus().equals("closed")) {
@@ -647,16 +644,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
ztTask.setEstimate(ztTask.getUseTime().floatValue());
ztTask.setLeft(ztTask.getUseTime().floatValue());
}
if (ztTask.getDeadline() == null) {
if(ztTask.getDeadline()==null){
throw new BusinessException("当前环境异常请联系管理员");
}
this.baseMapper.insert(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))) {
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))){
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
}
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))) {
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))){
ztStory.setTestPlanEndTime(ztTask.getDeadline());
}
this.storyService.updateById(ztStory);
@@ -706,7 +703,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
@Override
@Transactional
public void modifyTask(ZtTaskDTO dto) {
if (dto.getDeadline() == null || dto.getEstStarted() == null) {
if(dto.getDeadline()==null||dto.getEstStarted()==null){
throw new BusinessException("请录入开始结束日期");
}
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
@@ -853,7 +850,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
}
if (ObjectUtils.notEqual(oldExecution, newExecution)) {
if(ObjectUtils.notEqual(oldExecution,newExecution)){
//迭代切换了
this.kanbanlaneService.removeKanbanCell(oldExecution, ztTask.getId(), KanbanCellType.TASK);
//添加新的看板迭代
@@ -930,26 +927,26 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
actionService.addAction(ActionType.RW, ActionStatus.KS, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
RiskUserThreadLocal.get().getName(), "", null);
if ("done".equals(ztTask.getStatus())) {
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby()) ? RiskUserThreadLocal.get().getName() : ztTask.getFinishedby();
if("done".equals(ztTask.getStatus())){
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby())?RiskUserThreadLocal.get().getName():ztTask.getFinishedby();
//如果是测试任务 提交交付物
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, ztTask.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
}
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
//更新需求交付物
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztStory != null) {
if(ztStory!=null){
ztStory.setDeliverContent(ztTask.getDeliverContent());
this.storyService.updateById(ztStory);
}
}
}
if (!StringUtils.isEmpty(dto.getRemark())) {
if(!StringUtils.isEmpty(dto.getRemark())){
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
}
@@ -1033,22 +1030,21 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
//添加action
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
//如果是测试任务 提交交付物
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
//更新需求交付物
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztStory != null) {
ztStory.setDeliverContent(dto.getDeliverContent());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
ztStory.setLastediteddate(new Date());
if(ztStory!=null){
ztStory.setDeliverContent(ztTask.getDeliverContent());
this.storyService.updateById(ztStory);
}
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
}
}
if (!StringUtils.isEmpty(dto.getRemark())) {
if(!StringUtils.isEmpty(dto.getRemark())){
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
}
@@ -1081,13 +1077,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), finishBy, TaskType.transferType(type), false);
}
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(),ztTask.getFeedbackRemark());
}
// 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
@@ -1104,9 +1096,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
ztTask.setLastediteddate(new Date());
this.baseMapper.updateById(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1117,10 +1109,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1132,11 +1124,12 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
}
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
//添加action
@@ -1182,9 +1175,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
//添加action
actionService.addAction(ActionType.RW, ActionStatus.QX, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), ztTask.getProject(), ztTask.getExecution(),
RiskUserThreadLocal.get().getName(), dto.getDesc(), null);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1196,9 +1189,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
//查找最大时间那个
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
@@ -1210,7 +1203,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
.eq(ZtStory::getId, ztTask.getStory())
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
}
}
if (ztTask.getExecution() != null && ztTask.getExecution() != 0) {
@@ -1258,7 +1251,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
List<ZtTaskDTO> list = dto.getList();
long nullDeadlineCount = list.stream().filter(o -> o.getDeadline() == null || o.getEstStarted() == null).count();
if (nullDeadlineCount > 0) {
if(nullDeadlineCount>0){
throw new BusinessException("请录入开始结束日期");
}
@@ -1305,13 +1298,13 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
}
saveList.add(ztTask);
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getDevelPlanEndTime().getTime()
)) {
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getDevelPlanEndTime().getTime()
)){
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
}
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getTestPlanEndTime().getTime())) {
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getTestPlanEndTime().getTime())){
ztStory.setTestPlanEndTime(ztTask.getDeadline());
}
this.storyService.updateById(ztStory);
@@ -1326,7 +1319,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
taskSendZpMessage(ztTask.getId(), null, ztTask.getAssignedTo());
} else {
taskSendPsMessage(ztTask.getId(), ztProject.getPm(), ztTask.getOpenedby());
taskSendPsMessage(ztTask.getId(), ztProject.getPm(),ztTask.getOpenedby());
}
}

View File

@@ -22,8 +22,6 @@ public class KanBanConstant {
put("test","测试");
put("testing","进行中");
put("tested","完成");
put("productWaitVerified","产品验收中");
put("productVerified","产品已验收");
put("released","已发布");
put("verified","已验收");
put("closed","已关闭");
@@ -72,8 +70,6 @@ public class KanBanConstant {
put("story-test","test");
put("story-testing","test");
put("story-tested","test");
put("story-productWaitVerified","productWaitVerified");
put("story-productVerified","productVerified");
put("story-verified","verified");
put("story-released","released");
put("story-closed","closed");

View File

@@ -1,87 +0,0 @@
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();
}
}

View File

@@ -64,7 +64,7 @@
</resultMap>
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
select
select
s.id,
s.vision,
@@ -136,97 +136,76 @@
s.ys_user,
s.task_count,
s.ys_date,
s.inner_ys_flag,
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_user,
s.product_user
s.test_plan_end_time
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
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
where 1=1
and s.product = #{qo.productId}
<if test="qo.searchVal == 'ALL' ">
<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>
<if test="qo.searchVal == 'WGB' ">
and s.status != 'closed'
<if test="qo.searchVal == 'ALL' ">
</if>
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
and s.assignedTo= #{qo.userName}
</if>
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
and s.openedBy= #{qo.userName}
</if>
</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 == 'YWPS' ">
and v.reviewer = #{qo.userName}
and s.status ='reviewing'
and v.result = ''
</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>
<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' ">
and s.status = 'active'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YGB' ">
and s.status = 'closed'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
and s.openedBy= #{qo.userName}
</if>
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
and s.stage = 'verified' and s.ys_flag =1
</if>
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
and s.status = '11'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
and v.reviewer = #{qo.userName}
and s.status ='reviewing'
and v.result = ''
</if>
<if test="qo.searchVal != null and qo.searchVal == 'WZP' ">
and s.status = '11'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'JH' ">
and s.status = 'active'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'YGB' ">
and s.status = 'closed'
</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 == 'DGB' ">
and s.stage = 'verified' and s.ys_flag =1
</if>
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
and s.status = '11'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'WZP' ">
and s.status = '11'
</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 == 'WPS' ">
and s.reviewedBy like concat('%', #{qo.userName}, '%')
</if>
<if test="qo.searchVal != null and qo.searchVal == 'PSZ' ">
and s.status = 'reviewing'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'PSZ' ">
and s.status = 'reviewing'
</if>
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
and ( s.stage = 'released'
and s.ys_flag =0)
or (s.stage = 'verified' and s.ys_flag =2)
</if>
<if test="qo.name != null and qo.name != '' ">
and s.title like concat('%', #{qo.name}, '%')
</if>
@@ -235,24 +214,21 @@
</if>
<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 test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.id != null ">
and s.id = #{qo.id}
</if>
<if test="qo.title != null and qo.title != '' ">
and s.title like concat('%', #{qo.title}, '%')
</if>
<if test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.module != null and qo.module != '' ">
and s.module = #{qo.module}
</if>
<if test="qo.id != null ">
and s.id = #{qo.id}
</if>
<if test="qo.title != null and qo.title != '' ">
and s.title like concat('%', #{qo.title}, '%')
</if>
<if test="qo.module != null and qo.module != '' ">
and s.module = #{qo.module}
</if>
<if test="qo.assignedTo != null and qo.assignedTo != '' ">
and s.assignedTo = #{qo.assignedTo}
</if>
@@ -271,7 +247,6 @@
and s.openedBy = #{qo.openedby}
</if>
<if test="qo.startDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
@@ -295,22 +270,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
</if>
group by s.id
<choose>
<when test="qo.orderName != '' and qo.orderName != null ">
<choose>
<when test="qo.orderSort != '' and qo.orderSort != null ">
order by s.${qo.orderName} ${qo.orderSort}
order by s.${qo.orderName} ${qo.orderSort}
</when>
<otherwise>
order by s.id desc
@@ -321,7 +289,7 @@
order by s.id desc
</otherwise>
</choose>
-- order by id desc
-- order by id desc
</select>
<select id="projectStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
select s.id,
@@ -396,9 +364,6 @@
s.ys_date,
s.devel_plan_end_time,
s.test_plan_end_time,
s.inner_ys_flag,
s.product_user,
s.test_user,
pt.name productName
from zt_story s
@@ -408,6 +373,26 @@
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.pri != null and qo.pri != '' ">
and s.pri = #{qo.pri}
</if>
@@ -445,12 +430,6 @@
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.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
@@ -495,15 +474,7 @@
and s.status ='reviewing'
and v.result = ''
</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 == 'WCC' ">
and s.assignedTo = #{qo.userName}
</if>
<if test="qo.searchVal == 'JH' ">
and s.status = 'active'
@@ -531,9 +502,7 @@
<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'
@@ -552,49 +521,49 @@
<if test="qo.searchCode=='xmmc' and qo.searchValue != null and qo.searchValue != '' ">
and pj.name like concat('%', #{qo.searchValue}, '%')
</if>
-- 项目id
-- 项目id
<if test="qo.searchCode=='xmid' and qo.searchValue != null and qo.searchValue != '' ">
and pj.id =#{qo.searchValue}
and pj.id =#{qo.searchValue}
</if>
-- //需求名称
-- //需求名称
<if test="qo.searchCode=='xqmc' and qo.searchValue != null and qo.searchValue != '' ">
and s.title like concat('%', #{qo.searchValue}, '%')
and s.title like concat('%', #{qo.searchValue}, '%')
</if>
-- 需求id
-- 需求id
<if test="qo.searchCode=='xqid' and qo.searchValue != null and qo.searchValue != '' ">
and s.id =#{qo.searchValue}
and s.id =#{qo.searchValue}
</if>
-- 状态
-- 状态
<if test="qo.searchCode=='zt' and qo.searchValue != null and qo.searchValue != '' ">
and s.stage =#{qo.searchValue}
and s.stage =#{qo.searchValue}
</if>
-- 项目描述
-- 项目描述
<if test="qo.searchCode=='xmms' and qo.searchValue != null and qo.searchValue != '' ">
and sp.`spec` =#{qo.searchValue}
and sp.`spec` =#{qo.searchValue}
</if>
-- 负责人
-- 负责人
<if test="qo.searchCode=='fzr' and qo.searchValue != null and qo.searchValue != '' ">
and s.assignedTo =#{qo.searchValue}
and s.assignedTo =#{qo.searchValue}
</if>
<if test="qo.searchCode=='jhwc' and qo.searchValue != null and qo.searchValue != '' ">
and s.plan_end_date ${qo.searchValue}
and s.plan_end_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
and s.start_date ${qo.searchValue}
and s.start_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
and s.end_date ${qo.searchValue}
and s.end_date ${qo.searchValue}
</if>
<if test="qo.searchCode=='yscj' and qo.searchValue != null and qo.searchValue != '' ">
and s.openedBy = #{qo.searchValue}
and s.openedBy = #{qo.searchValue}
</if>
<if test="qo.searchCode=='ysgb' and qo.searchValue != null and qo.searchValue != '' ">
and s.closedBy = #{qo.searchValue}
and s.closedBy = #{qo.searchValue}
</if>
</if>
@@ -613,15 +582,8 @@
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>
</if>
group by s.id
@@ -649,6 +611,7 @@
</select>
<select id="allStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
select s.id,
s.vision,
s.parent,
@@ -1013,15 +976,8 @@
</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>
@@ -1102,15 +1058,8 @@
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>
</if>
group by s.id
<choose>
@@ -1367,28 +1316,4 @@
and (spc.spec like concat('%', #{keyword}, '%') or spc.verify like concat('%', #{keyword}, '%') or st.title like concat('%', #{keyword}, '%') ) order by id desc )
</select>
<select id="storyReleaseOnTimeByProducts" resultType="java.util.Map">
select (SELECT count(1) waitRelease from zt_story
WHERE plan_end_date >=#{startTime} and plan_end_date &lt;= #{endTime}
and status not in ('closed')
AND product in
<foreach collection="pIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>) planReleaseStoryNum,
(SELECT count(1) waitRelease from zt_story
WHERE plan_end_date >=#{startTime} and plan_end_date &lt;=#{endTime} and releasedDate >=#{startTime}
and releasedDate &lt;=#{endTime}
and status not in ('closed')
AND product in
<foreach collection="pIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
) onTimeNum
from dual;
</select>
</mapper>

View File

@@ -140,7 +140,7 @@
s.deliver_remark,
s.old_status,
s.ys_user,
s.product_user,
pt.name productName from zt_story_user s LEFT JOIN zt_product pt on s.product = pt.id WHERE 1=1
<if test="qo.productIds != null and qo.productIds.size() > 0">
@@ -188,9 +188,9 @@
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.productUser != null and qo.productUser != '' ">
and s.product_user like concat('%', #{qo.productUser}, '%')
</if>
<if test="qo.searchVal == 'ALL' ">
@@ -199,12 +199,10 @@
and s.status != 'closed'
</if>
<if test="qo.searchVal == 'WDCP' ">
and s.product_user = #{qo.userName}
</if>
<if test="qo.searchVal == 'WCJ' ">
and s.openedby= #{qo.userName}
</if>
<if test="qo.id != null ">
and s.id = #{qo.id}
</if>