问题反馈对接oa以及一堆bug
This commit is contained in:
63
pom.xml
63
pom.xml
@ -19,6 +19,69 @@
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf.tool</groupId>
|
||||
<artifactId>xmlworker</artifactId>
|
||||
<version>5.5.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-asian</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext7-core</artifactId>
|
||||
<version>7.1.16</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>html2pdf</artifactId>
|
||||
<version>3.0.4</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>pdfbox</artifactId>
|
||||
<version>2.0.33</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.jsoup</groupId>-->
|
||||
<!-- <artifactId>jsoup</artifactId>-->
|
||||
<!-- <version>1.13.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.itextpdf</groupId>-->
|
||||
<!-- <artifactId>itext7-core</artifactId>-->
|
||||
<!-- <version>7.1.9</version>-->
|
||||
<!-- <type>pom</type>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>5.2.2</version> <!-- 使用最新版本 -->
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
<version>1.5.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
|
@ -30,7 +30,8 @@ public class AfterRunner implements ApplicationRunner {
|
||||
@Autowired
|
||||
private com.sa.zentao.task.SpringTaskJob springTaskJob;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IZtYwTaskService ywTaskService;
|
||||
|
||||
|
||||
|
||||
@ -42,6 +43,7 @@ public class AfterRunner implements ApplicationRunner {
|
||||
springTaskJob.dkEveryDay();
|
||||
new Thread(new DevopsRunner()).start();
|
||||
|
||||
// ywTaskService.remindMail();;
|
||||
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class CodeGenerator {
|
||||
//自己的名字
|
||||
static String Author = "gqb";
|
||||
|
||||
public static String tableName = "zt_notice";
|
||||
public static String tableName = "zt_develop_feedback";
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
@ -54,7 +55,13 @@ public class ParamOutAspect {
|
||||
*/
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
String params = getRequestParams(request, joinPoint);
|
||||
String params ="";
|
||||
try {
|
||||
params=getRequestParams(request, joinPoint);
|
||||
}catch (Exception e){
|
||||
log.error("",e);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入参日志
|
||||
@ -69,10 +76,15 @@ public class ParamOutAspect {
|
||||
log.info("token : " + authorization);
|
||||
|
||||
String str =request.getRequestURI().replaceAll("/+$","");
|
||||
Object proceed=null;
|
||||
try {
|
||||
proceed = joinPoint.proceed();
|
||||
}catch (Exception e){
|
||||
log.error("",e);
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
Object proceed = joinPoint.proceed();
|
||||
|
||||
|
||||
|
||||
// if(ObjectUtils.isEmpty(result)){
|
||||
|
@ -10,16 +10,15 @@ import com.sa.zentao.entity.ZtFile;
|
||||
import com.sa.zentao.service.IZtFileService;
|
||||
import com.sa.zentao.utils.DateUtils;
|
||||
import com.sa.zentao.utils.UploadUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
@ -90,7 +89,7 @@ public class CommonsController {
|
||||
// 写入文件到服务器的指定目录
|
||||
java.nio.file.Files.write(path, bytes);
|
||||
ZtFile f=new ZtFile();
|
||||
f.setAddedby(RiskUserThreadLocal.get().getName());
|
||||
f.setAddedby(RiskUserThreadLocal.get()==null?null:RiskUserThreadLocal.get().getName());
|
||||
f.setAddeddate(new Date());
|
||||
f.setDeleted("0");
|
||||
f.setExtension(extension);
|
||||
@ -133,6 +132,49 @@ public class CommonsController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/downLoad")
|
||||
public void downLoad(UploadDTO file, HttpServletRequest request, HttpServletResponse response){
|
||||
|
||||
Integer id = file.getId();
|
||||
if(id==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
ZtFile zfFile = this.fileService.getById(id);
|
||||
if(zfFile==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
String pathname = zfFile.getPathname();
|
||||
|
||||
String substring = pathname.substring(pathname.lastIndexOf("/")+1, pathname.length());
|
||||
try {
|
||||
File f = new File(linuxFilePath+"/"+substring);
|
||||
// File f = new File("D:\\1.bmp");
|
||||
InputStream fis = new BufferedInputStream(new FileInputStream(linuxFilePath+"/"+substring));
|
||||
// InputStream fis = new BufferedInputStream(new FileInputStream("D:\\1.bmp"));
|
||||
byte[] buffer = new byte[fis.available()];
|
||||
|
||||
fis.read(buffer);
|
||||
fis.close();
|
||||
// 清空response
|
||||
response.reset();
|
||||
// 设置response的Header
|
||||
response.addHeader("Content-Disposition", "attachment;filename=" + new String(substring.getBytes()));
|
||||
response.addHeader("Content-Length", "" + f.length());
|
||||
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
|
||||
response.setContentType("application/octet-stream");
|
||||
toClient.write(buffer);
|
||||
toClient.flush();
|
||||
toClient.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String downLoad(String u){
|
||||
|
||||
String ext = u.substring(u.lastIndexOf(".") + 1).toLowerCase();
|
||||
|
@ -55,6 +55,13 @@ public class ZtBugController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/batchAddBug", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result batchAddBug(@RequestBody ZtBugDTO dto){
|
||||
bugService.batchAddBug(dto);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/editBug", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result editBug(@RequestBody ZtBugDTO dto){
|
||||
bugService.editBug(dto);
|
||||
|
@ -108,6 +108,18 @@ public class ZtCountController {
|
||||
);
|
||||
return Result.success(project) ;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/projectListAsc", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result projectListAsc(@RequestBody ZtCaseDTO dto){
|
||||
|
||||
List<ZtProject> project = projectService.list(new QueryWrapper<ZtProject>().lambda().eq(ZtProject::getType, "program")
|
||||
.eq(ZtProject::getStatus,"doing")
|
||||
.eq(ZtProject::getDeleted,"0")
|
||||
.orderByAsc(ZtProject::getId)
|
||||
);
|
||||
return Result.success(project) ;
|
||||
}
|
||||
|
||||
//项目 任务 需求 等统计 项目统计 24-12-13改为项目集统计
|
||||
@RequestMapping(value = "/projectInfoById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result projectInfoById(@RequestBody ZtCaseDTO dto){
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtDevelopFeedbackDTO;
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.qo.ZtFeedbackQo;
|
||||
import com.sa.zentao.qo.ZtMeetingQo;
|
||||
import com.sa.zentao.service.IZtDevelopFeedbackService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-develop-feedback")
|
||||
public class ZtDevelopFeedbackController {
|
||||
|
||||
@Autowired
|
||||
private IZtDevelopFeedbackService developFeedbackService;
|
||||
|
||||
@RequestMapping(value = "/pageList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> storyPageList(@RequestBody ZtFeedbackQo qo){
|
||||
|
||||
return Result.success(developFeedbackService.pageList(qo));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> add(@RequestBody ZtDevelopFeedbackDTO dto){
|
||||
developFeedbackService.add(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result modify(@RequestBody ZtDevelopFeedbackDTO dto){
|
||||
developFeedbackService.modify(dto);
|
||||
return Result.success();
|
||||
}
|
||||
@RequestMapping(value = "/myFeedbackList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result myFeedbackList(@RequestBody ZtFeedbackQo qo){
|
||||
List<ZtDevelopFeedbackDTO> list =developFeedbackService.myFeedbackList(qo);
|
||||
return Result.success(list);
|
||||
}
|
||||
@RequestMapping(value = "/getFeedbackById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result getFeedbackById(@RequestBody ZtFeedbackQo qo){
|
||||
ZtDevelopFeedbackDTO d =developFeedbackService.getFeedbackById(qo);
|
||||
return Result.success(d);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -6,8 +6,10 @@ import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtBugDTO;
|
||||
import com.sa.zentao.dao.ZtEffortDTO;
|
||||
import com.sa.zentao.entity.ZtEffort;
|
||||
import com.sa.zentao.entity.ZtUser;
|
||||
import com.sa.zentao.qo.EffortQo;
|
||||
import com.sa.zentao.service.IZtEffortService;
|
||||
import com.sa.zentao.service.IZtUserService;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -35,7 +37,8 @@ public class ZtEffortController {
|
||||
|
||||
@Autowired
|
||||
private IZtEffortService effortService;
|
||||
|
||||
@Autowired
|
||||
private IZtUserService userService;
|
||||
|
||||
@RequestMapping(value = "/batchAdd", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result batchAdd(@RequestBody ZtEffortDTO dto){
|
||||
@ -60,7 +63,18 @@ public class ZtEffortController {
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return Result.success();
|
||||
}
|
||||
return Result.success(BeanCopyUtil.copyListProperties(list,ZtEffortDTO::new));
|
||||
List<ZtEffortDTO> ztEffortDTOS = BeanCopyUtil.copyListProperties(list, ZtEffortDTO::new);
|
||||
if(!CollectionUtils.isEmpty(ztEffortDTOS)){
|
||||
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
for (ZtEffortDTO d:ztEffortDTOS){
|
||||
ZtUser ztUser = userMap.get(d.getAccount());
|
||||
if(ztUser!=null){
|
||||
d.setAccountName(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success(ztEffortDTOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.qo.ZtMeetingQo;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.IZtMeetingService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-meeting")
|
||||
public class ZtMeetingController {
|
||||
|
||||
@Autowired
|
||||
private IZtMeetingService meetingService;
|
||||
|
||||
@RequestMapping(value = "/pageList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> storyPageList(@RequestBody ZtMeetingQo qo){
|
||||
|
||||
return Result.success(meetingService.pageList(qo));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> add(@RequestBody ZtMeetingDTO dto){
|
||||
meetingService.add(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> modify(@RequestBody ZtMeetingDTO dto){
|
||||
meetingService.modify(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getMeetingById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtMeetingDTO> getMeetingById(@RequestBody ZtMeetingDTO dto){
|
||||
ZtMeetingDTO d = meetingService.getMeetingById(dto);
|
||||
return Result.success(d);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/downLoadById", method = RequestMethod.POST)
|
||||
public void downLoadById(@RequestBody ZtMeetingDTO dto, HttpServletResponse res, HttpServletRequest request){
|
||||
meetingService.downLoadById(dto,res,request);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -77,6 +77,7 @@ public class ZtModuleController {
|
||||
if("story".equalsIgnoreCase(qo.getType())){
|
||||
List<ZtModule> list = moduleService.list(new QueryWrapper<ZtModule>().lambda()
|
||||
.eq(ZtModule::getRoot, qo.getId()).eq(ZtModule::getType, qo.getType())
|
||||
.eq(ZtModule::getDeleted,"0")
|
||||
);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
@ -3,12 +3,15 @@ package com.sa.zentao.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtProductDTO;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.entity.ZtExecutionproject;
|
||||
import com.sa.zentao.entity.ZtProduct;
|
||||
import com.sa.zentao.entity.ZtProjectproduct;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.IZtExecutionprojectService;
|
||||
import com.sa.zentao.service.IZtProductService;
|
||||
import com.sa.zentao.service.IZtProjectproductService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -40,6 +43,9 @@ public class ZtProductController {
|
||||
@Autowired
|
||||
private IZtProjectproductService projectproductService;
|
||||
|
||||
@Autowired
|
||||
private IZtExecutionprojectService executionprojectService;
|
||||
|
||||
|
||||
|
||||
//项目集
|
||||
@ -110,5 +116,22 @@ public class ZtProductController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getProductByExecution", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result getProductByExecution(@RequestBody ZtProductDTO dto){
|
||||
|
||||
ZtExecutionproject executionproject = this.executionprojectService.getOne(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getExecution, dto.getId()));
|
||||
if(executionproject==null){
|
||||
throw new BusinessException("未查询到迭代");
|
||||
}
|
||||
|
||||
ZtProjectproduct project = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||
.eq(ZtProjectproduct::getProject, executionproject.getProject()));
|
||||
if(project==null){
|
||||
return Result.success();
|
||||
}
|
||||
ZtProduct product = ztProductService.getById(project.getProduct());
|
||||
return Result.success(product);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public class ZtProjectController {
|
||||
}
|
||||
|
||||
//项目列表
|
||||
@RequestMapping(value = "/typeProductList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
@RequestMapping(value = "/typeProjectList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<List<ZtProjectDTO>> typeProductList(@RequestBody ZtProjectQo qo){
|
||||
|
||||
return Result.success(ztProjectService.typeProductList(qo));
|
||||
@ -242,7 +242,7 @@ public class ZtProjectController {
|
||||
if(project==null){
|
||||
return Result.success(new ArrayList<ZtProjectDTO>());
|
||||
}
|
||||
List<ZtProject> list = ztProjectService.list(new QueryWrapper<ZtProject>().lambda().eq(ZtProject::getProject, project.getProject()));
|
||||
List<ZtProject> list = ztProjectService.list(new QueryWrapper<ZtProject>().lambda().ne(ZtProject::getStatus,"closed").eq(ZtProject::getProject, project.getProject()));
|
||||
|
||||
return Result.success(list);
|
||||
}
|
||||
|
@ -97,6 +97,13 @@ public class ZtStoryController {
|
||||
ztStoryService.addStory(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/batchAddStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result batchAddStory(@RequestBody ZtStoryDTO dto){
|
||||
ztStoryService.batchAddStory(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/editStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result editStory(@RequestBody ZtStoryDTO dto){
|
||||
ztStoryService.editStory(dto);
|
||||
@ -160,8 +167,8 @@ public class ZtStoryController {
|
||||
//切换执行
|
||||
@RequestMapping(value = "/changeExecution", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result changeExecution(@RequestBody ZtStoryDTO dto){
|
||||
// ztStoryService.changeExecution(dto);
|
||||
throw new BusinessException("弃用");
|
||||
ztStoryService.changeExecution(dto);
|
||||
return Result.success();
|
||||
}
|
||||
//切换指派
|
||||
@RequestMapping(value = "/changeAssignedTo", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
@ -185,6 +192,9 @@ public class ZtStoryController {
|
||||
}
|
||||
dto.setProjects(list.stream().map(o->o.getProject()).collect(Collectors.toList()));
|
||||
}
|
||||
if(CollectionUtils.isEmpty(dto.getProjects())){
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
List<ZtProject> list = ztStoryService.execListByProject(dto);
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.dao.ZtStoryFeedbackDTO;
|
||||
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||
import com.sa.zentao.entity.ZtStoryFeedback;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.IZtStoryFeedbackService;
|
||||
@ -43,6 +44,14 @@ public class ZtStoryFeedbackController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/approval", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result approval(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.approval(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/editFeedback", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result editFeedback(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.editFeedback(dto);
|
||||
@ -54,7 +63,11 @@ public class ZtStoryFeedbackController {
|
||||
storyFeedbackService.changeStatus(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/closedStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result closedStory(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.closedFeedback(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result list(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
@ -67,7 +80,7 @@ public class ZtStoryFeedbackController {
|
||||
|
||||
//指派
|
||||
@RequestMapping(value = "/assignedTo", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result assignedTo(@RequestBody ZtStoryDTO dto){
|
||||
public Result assignedTo(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.assignedTo(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
@ -43,6 +43,12 @@ public class ZtStoryUserController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/closedStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result closedStory(@RequestBody ZtStoryUserDTO dto){
|
||||
storyUserService.closedStory(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/addStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result addStory(@RequestBody ZtStoryUserDTO dto){
|
||||
@ -66,7 +72,9 @@ public class ZtStoryUserController {
|
||||
public Result storyList(@RequestBody StoryQo qo){
|
||||
|
||||
List<ZtStoryUser> list = storyUserService.list(new QueryWrapper<ZtStoryUser>()
|
||||
.lambda().eq(ZtStoryUser::getProduct,qo.getId()).in(ZtStoryUser::getStatus, "wait","active"));
|
||||
.lambda().eq(ZtStoryUser::getProduct,qo.getId()).in(ZtStoryUser::getStatus, "wait","active")
|
||||
.orderByDesc(ZtStoryUser::getId)
|
||||
);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@ -83,4 +91,17 @@ public class ZtStoryUserController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
//评审
|
||||
@RequestMapping(value = "/getUserStoryById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result getUserStoryById(@RequestBody ZtStoryDTO dto){
|
||||
ZtStoryUserDTO storyUserDTO = storyUserService.getUserStoryById(dto);
|
||||
return Result.success(storyUserDTO);
|
||||
}
|
||||
//添加备注
|
||||
@RequestMapping(value = "/addRemark", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result addRemark(@RequestBody ZtStoryDTO dto){
|
||||
storyUserService.addRemark(dto);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
@ -161,6 +161,7 @@ public class ZtTaskController {
|
||||
@RequestMapping(value = "/getTaskById", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result getTaskById(@RequestBody ZtTaskDTO dto){
|
||||
ZtTaskDTO task=ztTaskService.getTaskById(dto.getId());
|
||||
|
||||
return Result.success(task);
|
||||
|
||||
}
|
||||
@ -395,6 +396,12 @@ public class ZtTaskController {
|
||||
|
||||
|
||||
|
||||
List<ZtProjectstory> oldPStoryList = this.projectstoryService.prdList(oldStory.getId());
|
||||
|
||||
if(!CollectionUtils.isEmpty(oldPStoryList)&&oldPStoryList.size()>1){
|
||||
System.out.print(1);
|
||||
}
|
||||
|
||||
|
||||
//创建新的需求
|
||||
oldStory.setProduct(product);
|
||||
@ -410,8 +417,24 @@ public class ZtTaskController {
|
||||
});
|
||||
dto.setProject(project);
|
||||
this.projectService.projectSyncStory(dto);
|
||||
dto.setExcludeId(id1);
|
||||
this.projectService.executionSyncStory(dto);
|
||||
|
||||
for (ZtProjectstory st:oldPStoryList) {
|
||||
ZtProjectDTO pro = this.projectService.selectPrdById(st.getProject());
|
||||
if(pro!=null){
|
||||
//老的迭代
|
||||
List<ZtProject> newExec = this.projectService.list(new QueryWrapper<ZtProject>().lambda()
|
||||
.eq(ZtProject::getName, pro.getName()).eq(ZtProject::getType, "sprint"));
|
||||
if(!CollectionUtils.isEmpty(newExec)){
|
||||
ZtProject project1 = newExec.get(0);
|
||||
dto.setExcludeId(project1.getId());
|
||||
this.projectService.executionSyncStory(dto);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,12 +10,14 @@ import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.dao.ZtUserDTO;
|
||||
import com.sa.zentao.entity.ZtTeam;
|
||||
import com.sa.zentao.entity.ZtUser;
|
||||
import com.sa.zentao.enums.ActionStatus;
|
||||
import com.sa.zentao.enums.ActionType;
|
||||
import com.sa.zentao.mapper.ZtUserMapper;
|
||||
import com.sa.zentao.qo.ZtUserQo;
|
||||
import com.sa.zentao.service.IZtActionService;
|
||||
import com.sa.zentao.service.IZtTeamService;
|
||||
import com.sa.zentao.service.IZtUserService;
|
||||
import com.sa.zentao.utils.ChineseUtil;
|
||||
import com.sa.zentao.utils.JwtUtil;
|
||||
@ -35,7 +37,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -58,6 +62,10 @@ public class ZtUserController {
|
||||
@Autowired
|
||||
private ZtUserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
private IZtTeamService teamService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/allList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result allList(@RequestBody ZtUser user){
|
||||
List<ZtUserDTO> ztUserDTOS = userMapper.listAll(null);
|
||||
@ -78,6 +86,16 @@ public class ZtUserController {
|
||||
.or().like(ZtUser::getPinyin,dto.getName())
|
||||
;
|
||||
}
|
||||
if("execution".equals(dto.getType())){
|
||||
//迭代id
|
||||
Integer id = dto.getId();
|
||||
List<ZtTeam> execution = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getRoot, id).eq(ZtTeam::getType, "execution"));
|
||||
if(CollectionUtils.isEmpty(execution)){
|
||||
return Result.success(new ArrayList<>());
|
||||
}
|
||||
eq.in(ZtUser::getAccount,execution.stream().map(o->o.getAccount()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
return Result.success(userService.list(eq
|
||||
));
|
||||
}
|
||||
@ -138,6 +156,26 @@ public class ZtUserController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/updatePassword", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtUser> updatePassword(@RequestBody ZtUserDTO user){
|
||||
|
||||
ZtUser ztUser = userService.getOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, RiskUserThreadLocal.get().getName()));
|
||||
|
||||
if(!user.getPassword().equals(ztUser.getPassword())){
|
||||
throw new BusinessException("旧密码验证失败");
|
||||
}
|
||||
if(ztUser==null){
|
||||
throw new BusinessException("未查询到");
|
||||
}
|
||||
ztUser.setPassword(user.getNewPassword());
|
||||
|
||||
|
||||
this.userService.updateById(ztUser);
|
||||
this.actionService.addAction(ActionType.USER, ActionStatus.XGMM,ztUser.getId(),null,null,null, RiskUserThreadLocal.get().getName(),null,ztUser.getAccount());
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtUser> modify(@RequestBody ZtUserDTO user){
|
||||
|
||||
@ -165,16 +203,20 @@ public class ZtUserController {
|
||||
if(!CollectionUtils.isEmpty(user.getProductList())){
|
||||
ztUser.setProductIds(StringUtils.join(user.getProductList(),","));
|
||||
}
|
||||
|
||||
this.userService.update(new UpdateWrapper<ZtUser>().lambda()
|
||||
.set(ZtUser::getPassword,user.getPassword())
|
||||
.set(ZtUser::getUserType,user.getUserType())
|
||||
.set(ZtUser::getEmail,user.getEmail())
|
||||
.set(ZtUser::getProductIds,ztUser.getProductIds())
|
||||
.set(ZtUser::getColor,user.getColor())
|
||||
.set(ZtUser::getPhone,ztUser.getPhone())
|
||||
.eq(ZtUser::getId,ztUser.getId())
|
||||
);
|
||||
ztUser.setNickname(user.getNickname());
|
||||
ztUser.setColor(user.getColor());
|
||||
ztUser.setDeptName(user.getDeptName());
|
||||
this.userService.updateById(ztUser);
|
||||
// this.userService.update(new UpdateWrapper<ZtUser>().lambda()
|
||||
// .set(ZtUser::getPassword,user.getPassword())
|
||||
// .set(ZtUser::getUserType,user.getUserType())
|
||||
// .set(ZtUser::getEmail,user.getEmail())
|
||||
// .set(ZtUser::getProductIds,ztUser.getProductIds())
|
||||
// .set(ZtUser::getColor,user.getColor())
|
||||
// .set(ZtUser::getPhone,user.getPhone())
|
||||
// .set(ZtUser::getNickname,user.getNickname())
|
||||
// .eq(ZtUser::getId,ztUser.getId())
|
||||
// );
|
||||
this.actionService.addAction(ActionType.USER, ActionStatus.BJ,ztUser.getId(),null,null,null,RiskUserThreadLocal.get().getName(),null,user.getAccount());
|
||||
|
||||
return Result.success();
|
||||
|
58
src/main/java/com/sa/zentao/dao/PerformanceDTO.java
Normal file
58
src/main/java/com/sa/zentao/dao/PerformanceDTO.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.sa.zentao.dao;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PerformanceDTO implements Serializable {
|
||||
|
||||
@ExcelProperty(value = "姓名",index =0)
|
||||
private String userName;
|
||||
//任务总量
|
||||
@ExcelProperty(value = "账户",index =1)
|
||||
private String account;
|
||||
//需求总工时
|
||||
@ExcelProperty(value = "天数",index =2)
|
||||
private BigDecimal days;
|
||||
//实际产出工时
|
||||
@ExcelProperty(value = "可用工时",index =3)
|
||||
private BigDecimal totalTime;
|
||||
//可用工时 6*工作天数
|
||||
@ExcelProperty(value = "达标工时 ",index =4)
|
||||
//达标 考核工时
|
||||
private BigDecimal examineTime;
|
||||
//工作饱和度
|
||||
@ExcelProperty(value = "产出工时 ",index =5)
|
||||
private BigDecimal workTime;
|
||||
@ExcelProperty(value = "分配工时 ",index =6)
|
||||
private BigDecimal allocationTime;
|
||||
@ExcelProperty(value = "工作饱和率 ",index =7)
|
||||
private BigDecimal saturation;
|
||||
@ExcelProperty(value = "饱和率得分 ",index =8)
|
||||
private BigDecimal saturationScore;
|
||||
|
||||
@ExcelProperty(value = "延期任务 ",index =9)
|
||||
private BigDecimal delayTask;
|
||||
@ExcelProperty(value = "完成任务 ",index =10)
|
||||
private BigDecimal finishTask;
|
||||
@ExcelProperty(value = "完成准时率 ",index =11)
|
||||
private BigDecimal finishPunctuality;
|
||||
@ExcelProperty(value = "准时率得分 ",index =12)
|
||||
private BigDecimal punctualityScore;
|
||||
@ExcelProperty(value = "线上严重bug ",index =13)
|
||||
private BigDecimal seriousBug;
|
||||
//产出线上Bug
|
||||
@ExcelProperty(value = "线上普通bug ",index =14)
|
||||
private BigDecimal slightBug;
|
||||
//线上Bug得分
|
||||
@ExcelProperty(value = "线上Bug得分 ",index =15)
|
||||
private BigDecimal bugScore;
|
||||
//产出线上Bug
|
||||
@ExcelProperty(value = "总分 ",index =16)
|
||||
private BigDecimal score;
|
||||
}
|
@ -49,7 +49,7 @@ public class ProjectWorkTaskDTO implements Serializable {
|
||||
private float planTime;
|
||||
|
||||
@ExcelProperty(value = "剩余工时",index =11)
|
||||
private float balanceTime;
|
||||
private Float balanceTime;
|
||||
//状态
|
||||
@ExcelProperty(value = "状态",index =12)
|
||||
private String status;
|
||||
|
@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -34,6 +35,8 @@ public class ZtBugDTO implements Serializable {
|
||||
|
||||
private Integer product;
|
||||
|
||||
private String productName;
|
||||
|
||||
private Integer injection;
|
||||
|
||||
private Integer identify;
|
||||
@ -192,4 +195,6 @@ public class ZtBugDTO implements Serializable {
|
||||
private ZtTask ztTask;
|
||||
|
||||
private String files;
|
||||
|
||||
private List<ZtBugDTO> list;
|
||||
}
|
||||
|
72
src/main/java/com/sa/zentao/dao/ZtDevelopFeedbackDTO.java
Normal file
72
src/main/java/com/sa/zentao/dao/ZtDevelopFeedbackDTO.java
Normal file
@ -0,0 +1,72 @@
|
||||
package com.sa.zentao.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtDevelopFeedbackDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品
|
||||
*/
|
||||
private Integer productId;
|
||||
private String productName;
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 提出时间
|
||||
*/
|
||||
private Date proposeTime;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
*/
|
||||
private String assignedTo;
|
||||
private String assignedToName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 分析描述
|
||||
*/
|
||||
private String analysisRemark;
|
||||
|
||||
/**
|
||||
* 处理措施
|
||||
*/
|
||||
private String handleRemark;
|
||||
|
||||
private String createUser;
|
||||
private String createUserName;
|
||||
private Date createDate;
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
private String updateUser;
|
||||
private String updateUserName;
|
||||
|
||||
}
|
@ -41,7 +41,7 @@ public class ZtEffortDTO implements Serializable {
|
||||
private Integer execution;
|
||||
|
||||
private String account;
|
||||
|
||||
private String accountName;
|
||||
private String work;
|
||||
|
||||
private String vision;
|
||||
|
71
src/main/java/com/sa/zentao/dao/ZtMeetingDTO.java
Normal file
71
src/main/java/com/sa/zentao/dao/ZtMeetingDTO.java
Normal file
@ -0,0 +1,71 @@
|
||||
package com.sa.zentao.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sa.zentao.enums.MeetingTypeEnums;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtMeetingDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private Integer productId;
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 会议名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 会议类型 周会议/需求会议/临时会议
|
||||
*/
|
||||
private MeetingTypeEnums type;
|
||||
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private Date meetingDate;
|
||||
|
||||
/**
|
||||
* 用户,隔开
|
||||
*/
|
||||
private String users;
|
||||
private String usersName;
|
||||
/**
|
||||
* 会议内容
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private String createUserName;
|
||||
private Date createDate;
|
||||
|
||||
private String updateUser;
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
private String files;
|
||||
|
||||
private String address;
|
||||
}
|
@ -7,8 +7,10 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -93,19 +95,23 @@ public class ZtProductDTO implements Serializable {
|
||||
|
||||
@TableField("totalStories")
|
||||
private Integer totalStories;
|
||||
|
||||
//为解决
|
||||
@TableField("unresolvedBugs")
|
||||
private Integer unresolvedBugs;
|
||||
|
||||
//关闭
|
||||
@TableField("closedBugs")
|
||||
private Integer closedBugs;
|
||||
|
||||
//确认
|
||||
@TableField("fixedBugs")
|
||||
private Integer fixedBugs;
|
||||
|
||||
@TableField("totalBugs")
|
||||
private Integer totalBugs;
|
||||
|
||||
private BigDecimal finishBugRatio;
|
||||
|
||||
private BigDecimal finishTaskRatio;
|
||||
|
||||
private Integer plans;
|
||||
|
||||
private Integer releases;
|
||||
@ -114,13 +120,13 @@ public class ZtProductDTO implements Serializable {
|
||||
private String createdBy;
|
||||
|
||||
@TableField("createdDate")
|
||||
private LocalDateTime createdDate;
|
||||
private Date createdDate;
|
||||
|
||||
@TableField("createdVersion")
|
||||
private String createdVersion;
|
||||
|
||||
@TableField("closedDate")
|
||||
private LocalDate closedDate;
|
||||
private Date closedDate;
|
||||
|
||||
private Integer order;
|
||||
|
||||
@ -130,6 +136,8 @@ public class ZtProductDTO implements Serializable {
|
||||
|
||||
private String poValue;
|
||||
|
||||
private Integer yss;
|
||||
|
||||
private List<String> approvalList;
|
||||
|
||||
private List<String> authList;
|
||||
|
@ -62,4 +62,6 @@ public class ZtStoryCountDTO implements Serializable {
|
||||
private String feedbackClwCount;
|
||||
//延期的
|
||||
private String feedbackYqCount;
|
||||
//关闭的
|
||||
private String feedbackGbCount;
|
||||
}
|
||||
|
@ -33,9 +33,8 @@ public class ZtStoryDTO implements Serializable {
|
||||
private List<Integer> idList;
|
||||
|
||||
private String vision;
|
||||
|
||||
private Integer parent;
|
||||
|
||||
private String parentName;
|
||||
private Integer product;
|
||||
private Integer productId;
|
||||
|
||||
@ -49,7 +48,7 @@ public class ZtStoryDTO implements Serializable {
|
||||
private Integer branch;
|
||||
|
||||
private Integer module;
|
||||
|
||||
private String moduleName;
|
||||
private String plan;
|
||||
|
||||
private String source;
|
||||
@ -132,7 +131,7 @@ public class ZtStoryDTO implements Serializable {
|
||||
|
||||
@TableField("reviewedBy")
|
||||
private String reviewedby;
|
||||
|
||||
private String reviewedbyName;
|
||||
private String revieweUser;
|
||||
|
||||
private Integer revieweResult;
|
||||
@ -243,10 +242,15 @@ public class ZtStoryDTO implements Serializable {
|
||||
|
||||
private Integer userStory;
|
||||
|
||||
private String userStoryName;
|
||||
|
||||
private String ysRemark;
|
||||
//验收人
|
||||
private String ysUser;
|
||||
|
||||
//验收人
|
||||
private String ysUserName;
|
||||
|
||||
private Integer taskCount;
|
||||
|
||||
private Integer releaseFlag=0;
|
||||
|
@ -23,6 +23,8 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String vx;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ -75,6 +77,8 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
||||
private String closeRemark;
|
||||
|
||||
private Integer product;
|
||||
|
||||
private String productName;
|
||||
//预计完成时间
|
||||
private Date planFinishDate;
|
||||
|
||||
@ -84,4 +88,16 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
||||
private Date handDate;
|
||||
//关闭日期
|
||||
private Date closeDate;
|
||||
//来源 zentao weixin
|
||||
private String openSource;
|
||||
//业务id
|
||||
private String businessId;
|
||||
//1.通过 0不通过
|
||||
private Integer approval;
|
||||
|
||||
private String approvalRemark;
|
||||
|
||||
private String weixin;
|
||||
|
||||
private String urls;
|
||||
}
|
||||
|
@ -33,14 +33,18 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
|
||||
private Integer parent;
|
||||
|
||||
private String parentName;
|
||||
|
||||
private Integer product;
|
||||
|
||||
private String productName;
|
||||
|
||||
private Integer project;
|
||||
|
||||
private Integer branch;
|
||||
|
||||
private Integer module;
|
||||
|
||||
private String moduleName;
|
||||
private String plan;
|
||||
|
||||
private String source;
|
||||
@ -90,8 +94,10 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
@TableField("openedBy")
|
||||
private String openedby;
|
||||
|
||||
private String openedbyName;
|
||||
|
||||
@TableField("openedDate")
|
||||
private LocalDateTime openeddate;
|
||||
private Date openeddate;
|
||||
|
||||
@TableField("assignedTo")
|
||||
private String assignedto;
|
||||
@ -116,7 +122,7 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
|
||||
@TableField("reviewedBy")
|
||||
private String reviewedby;
|
||||
|
||||
private String reviewedbyName;
|
||||
@TableField("reviewedDate")
|
||||
private Date revieweddate;
|
||||
|
||||
@ -209,4 +215,6 @@ public class ZtStoryUserDTO implements Serializable {
|
||||
private String revieweUser;
|
||||
|
||||
private String files;
|
||||
|
||||
private String verify;
|
||||
}
|
||||
|
@ -189,4 +189,6 @@ public class ZtTaskDTO implements Serializable {
|
||||
private Integer finishedFlag=0;
|
||||
private String implementName;
|
||||
private Integer implementId;
|
||||
private Integer product;
|
||||
private String productName;
|
||||
}
|
||||
|
@ -34,11 +34,15 @@ public class ZtUserDTO implements Serializable {
|
||||
|
||||
private Integer dept;
|
||||
|
||||
private String deptName;
|
||||
|
||||
private String account;
|
||||
|
||||
@TableField("`password`")
|
||||
private String password;
|
||||
|
||||
|
||||
private String newPassword;
|
||||
private String role;
|
||||
|
||||
private String realname;
|
||||
|
@ -95,4 +95,6 @@ public class ZtYwTaskDTO implements Serializable {
|
||||
|
||||
private String copyToUser;
|
||||
private String copyMail;
|
||||
|
||||
private Integer level;
|
||||
}
|
||||
|
74
src/main/java/com/sa/zentao/entity/ZtDevelopFeedback.java
Normal file
74
src/main/java/com/sa/zentao/entity/ZtDevelopFeedback.java
Normal file
@ -0,0 +1,74 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.sql.Blob;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtDevelopFeedback implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品
|
||||
*/
|
||||
private Integer productId;
|
||||
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 提出时间
|
||||
*/
|
||||
private Date proposeTime;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
*/
|
||||
private String assignedTo;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 分析描述
|
||||
*/
|
||||
private String analysisRemark;
|
||||
|
||||
/**
|
||||
* 处理措施
|
||||
*/
|
||||
private String handleRemark;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
private String updateUser;
|
||||
|
||||
|
||||
}
|
68
src/main/java/com/sa/zentao/entity/ZtMeeting.java
Normal file
68
src/main/java/com/sa/zentao/entity/ZtMeeting.java
Normal file
@ -0,0 +1,68 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.sql.Blob;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.sa.zentao.enums.MeetingTypeEnums;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtMeeting implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private Integer productId;
|
||||
|
||||
/**
|
||||
* 会议名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 会议类型 周会议/需求会议/临时会议
|
||||
*/
|
||||
private MeetingTypeEnums type;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private Date meetingDate;
|
||||
|
||||
/**
|
||||
* 用户,隔开
|
||||
*/
|
||||
private String users;
|
||||
|
||||
/**
|
||||
* 会议内容
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
private String updateUser;
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
private String address;
|
||||
|
||||
}
|
@ -129,7 +129,7 @@ public class ZtProduct implements Serializable {
|
||||
private String createdVersion;
|
||||
|
||||
@TableField("closedDate")
|
||||
private LocalDate closedDate;
|
||||
private Date closedDate;
|
||||
|
||||
@TableField("`order`")
|
||||
private Integer order;
|
||||
@ -138,5 +138,6 @@ public class ZtProduct implements Serializable {
|
||||
|
||||
private String deleted;
|
||||
|
||||
private Integer yss;
|
||||
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class ZtStory implements Serializable {
|
||||
private Integer pri;
|
||||
|
||||
private Float estimate;
|
||||
//reviewing 评审中 active 激活 draft 草稿
|
||||
//reviewing 评审中 active 激活 draft 草稿 //finished 完成 验收完成
|
||||
private String status;
|
||||
|
||||
@TableField("subStatus")
|
||||
|
@ -64,7 +64,7 @@ public class ZtStoryFeedback implements Serializable {
|
||||
private String assignedTo;
|
||||
|
||||
private String spec;
|
||||
// wait doing finished closed
|
||||
// wait doing finished closed reviewing
|
||||
|
||||
private String status;
|
||||
|
||||
@ -86,4 +86,15 @@ public class ZtStoryFeedback implements Serializable {
|
||||
private Date handDate;
|
||||
//关闭日期
|
||||
private Date closeDate;
|
||||
private String closedBy;
|
||||
|
||||
// 来源 zentao weixin
|
||||
private String openSource;
|
||||
|
||||
|
||||
private String approvalRemark;
|
||||
|
||||
private String businessId;
|
||||
|
||||
private String weixin;
|
||||
}
|
||||
|
@ -196,4 +196,6 @@ public class ZtStoryUser implements Serializable {
|
||||
private String spec;
|
||||
|
||||
private String fileUrl;
|
||||
|
||||
private String verify;
|
||||
}
|
||||
|
@ -173,4 +173,6 @@ public class ZtTask implements Serializable {
|
||||
private String reviewingUser;
|
||||
|
||||
private Long deadlineTime;
|
||||
|
||||
private Integer product;
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public class ZtUser implements Serializable {
|
||||
|
||||
private Integer dept;
|
||||
|
||||
private String deptName;
|
||||
|
||||
private String account;
|
||||
|
||||
@TableField("`password`")
|
||||
@ -131,4 +133,5 @@ public class ZtUser implements Serializable {
|
||||
|
||||
private String color;
|
||||
|
||||
private String vx;
|
||||
}
|
||||
|
@ -96,4 +96,6 @@ public class ZtYwTask implements Serializable {
|
||||
private String result;
|
||||
private String copyToUser;
|
||||
private String copyMail;
|
||||
|
||||
private Integer level;
|
||||
}
|
||||
|
@ -17,19 +17,21 @@ public enum ActionStatus {
|
||||
WC(10, "finished","完成"),
|
||||
QX(11, "canceled","取消"),
|
||||
TJBZ(12, "commented","添加备注"),
|
||||
|
||||
PSTG(13, "reviewpassed","评审通过"),
|
||||
PSYDMQ(14, "reviewclarified","评审有待明确"),
|
||||
PSBTG(15, "reviewrejected","评审不通过"),
|
||||
YSTG(16, "ystg","验收通过"),
|
||||
YSBTG(17, "ysbtg","验收不通过"),
|
||||
FB(18, "fb","发布"),
|
||||
|
||||
FBCG(18, "fb","发布通过"),
|
||||
FBSB(30, "fb","发布不通过"),
|
||||
QR(19, "qr","确认"),
|
||||
KSCE(21, "tested","开始测试"),
|
||||
CSWC(20, "tested","测试完成"),
|
||||
|
||||
|
||||
LOGIN(100, "login","登录"),
|
||||
XGMM(101, "xgmm","修改密码"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
@ -7,11 +7,14 @@ public enum ActionType {
|
||||
XMJ(1, "program","项目集"),
|
||||
XM(2, "project","项目"),
|
||||
CP(3, "product","产品"),
|
||||
ZX(3, "execution","执行"),
|
||||
ZX(13, "execution","执行"),
|
||||
|
||||
XQ(4, "story","需求"),
|
||||
|
||||
FB(4, "release","发布"),
|
||||
MEET(24, "meeting","会议"),
|
||||
DEVLOPSFEEDBACK(25, "devopsfeedback","问题记录"),
|
||||
|
||||
FB(34, "release","发布"),
|
||||
|
||||
USERXQ(14, "user-story","用户需求"),
|
||||
|
||||
|
@ -10,7 +10,7 @@ public enum FileTypes {
|
||||
userStory("userStory", "用户需求"),
|
||||
feedbackStory("feedbackStory", "问题反馈"),
|
||||
ywTask("ywTask", "运维任务"),
|
||||
|
||||
meeting("meeting", "会议"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
30
src/main/java/com/sa/zentao/enums/MeetingTypeEnums.java
Normal file
30
src/main/java/com/sa/zentao/enums/MeetingTypeEnums.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.sa.zentao.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum MeetingTypeEnums {
|
||||
|
||||
week(1, "周会议"),
|
||||
story(2, "需求会议"),
|
||||
temporary(3, "临时会议"),
|
||||
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
private int code;
|
||||
private String value;
|
||||
|
||||
private MeetingTypeEnums(int code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.sa.zentao.dao.ZtDevelopFeedbackDTO;
|
||||
import com.sa.zentao.entity.ZtDevelopFeedback;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.qo.ZtFeedbackQo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
public interface ZtDevelopFeedbackMapper extends BaseMapper<ZtDevelopFeedback> {
|
||||
|
||||
List<ZtDevelopFeedbackDTO> pageList(@Param("qo") ZtFeedbackQo qo);
|
||||
|
||||
List<ZtDevelopFeedbackDTO> myFeedbackList(@Param("qo")ZtFeedbackQo qo);
|
||||
}
|
23
src/main/java/com/sa/zentao/mapper/ZtMeetingMapper.java
Normal file
23
src/main/java/com/sa/zentao/mapper/ZtMeetingMapper.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.entity.ZtMeeting;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.qo.ZtMeetingQo;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
public interface ZtMeetingMapper extends BaseMapper<ZtMeeting> {
|
||||
|
||||
List<ZtMeetingDTO> pageList(@Param("qo") ZtMeetingQo qo);
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.sa.zentao.dao.PerformanceDTO;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@ -8,6 +9,7 @@ import com.sa.zentao.qo.ZtProjectQo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -33,4 +35,8 @@ public interface ZtProjectMapper extends BaseMapper<ZtProject> {
|
||||
|
||||
@DS("slave")
|
||||
ZtProjectDTO selectPrdByName(@Param("name") String name);
|
||||
@DS("slave")
|
||||
ZtProjectDTO selectPrdById(@Param("id") Integer id);
|
||||
|
||||
List<PerformanceDTO> performanceCount(@Param("startDate") Date startDate,@Param("endDate") Date endDate);
|
||||
}
|
||||
|
@ -20,4 +20,6 @@ public interface ZtProjectstoryMapper extends BaseMapper<ZtProjectstory> {
|
||||
@DS("slave")
|
||||
List<ZtProjectstory> storyListPrd(@Param("id") Integer id);
|
||||
|
||||
@DS("slave")
|
||||
List<ZtProjectstory> prdList(@Param("id")Integer id);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.sa.zentao.qo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -15,4 +16,9 @@ public class BaseQo {
|
||||
private Date startDate;
|
||||
@ExcelIgnore
|
||||
private Date endDate;
|
||||
|
||||
@ExcelIgnore
|
||||
private String productName;
|
||||
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ public class StoryQo extends BaseQo {
|
||||
|
||||
private Integer productId;
|
||||
|
||||
private List<Integer> productIds;
|
||||
|
||||
private String ids;
|
||||
|
||||
private List<String> storyIds;
|
||||
|
32
src/main/java/com/sa/zentao/qo/ZtFeedbackQo.java
Normal file
32
src/main/java/com/sa/zentao/qo/ZtFeedbackQo.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.sa.zentao.qo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sa.zentao.enums.MeetingTypeEnums;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2024-06-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtFeedbackQo extends BaseQo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private MeetingTypeEnums type;
|
||||
private String title;
|
||||
|
||||
private Integer productId;
|
||||
|
||||
private String userName;
|
||||
}
|
33
src/main/java/com/sa/zentao/qo/ZtMeetingQo.java
Normal file
33
src/main/java/com/sa/zentao/qo/ZtMeetingQo.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.sa.zentao.qo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sa.zentao.enums.MeetingTypeEnums;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2024-06-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtMeetingQo extends BaseQo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private MeetingTypeEnums type;
|
||||
private String title;
|
||||
|
||||
private Integer productId;
|
||||
}
|
@ -30,6 +30,7 @@ public class ZtProjectQo extends BaseQo {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private String productName;
|
||||
|
||||
private Integer productId;
|
||||
|
||||
@ -69,7 +70,6 @@ public class ZtProjectQo extends BaseQo {
|
||||
|
||||
private String searchCode;
|
||||
private String searchValue;
|
||||
|
||||
private String orderName;
|
||||
private String orderSort;
|
||||
|
||||
@ -79,4 +79,6 @@ public class ZtProjectQo extends BaseQo {
|
||||
private String ids;
|
||||
|
||||
private List<String> objIds;
|
||||
|
||||
private List<Integer> projectList;
|
||||
}
|
||||
|
@ -34,4 +34,7 @@ public interface IZtBugService extends IService<ZtBug> {
|
||||
ZtBugDTO bugInfoById(Integer id);
|
||||
|
||||
void assignedTo(ZtBugQo qo);
|
||||
|
||||
void batchAddBug(ZtBugDTO dto);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.ZtDevelopFeedbackDTO;
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.entity.ZtDevelopFeedback;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.qo.ZtFeedbackQo;
|
||||
import com.sa.zentao.qo.ZtMeetingQo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
public interface IZtDevelopFeedbackService extends IService<ZtDevelopFeedback> {
|
||||
|
||||
PageInfo<ZtDevelopFeedbackDTO> pageList(ZtFeedbackQo qo);
|
||||
|
||||
void add(ZtDevelopFeedbackDTO dto);
|
||||
|
||||
void modify(ZtDevelopFeedbackDTO dto);
|
||||
|
||||
List<ZtDevelopFeedbackDTO> myFeedbackList(ZtFeedbackQo qo);
|
||||
|
||||
ZtDevelopFeedbackDTO getFeedbackById(ZtFeedbackQo qo);
|
||||
|
||||
}
|
32
src/main/java/com/sa/zentao/service/IZtMeetingService.java
Normal file
32
src/main/java/com/sa/zentao/service/IZtMeetingService.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.entity.ZtMeeting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.qo.ZtMeetingQo;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
public interface IZtMeetingService extends IService<ZtMeeting> {
|
||||
|
||||
PageInfo<ZtMeetingDTO> pageList(ZtMeetingQo qo);
|
||||
|
||||
void add(ZtMeetingDTO dto);
|
||||
|
||||
void modify(ZtMeetingDTO dto);
|
||||
|
||||
ZtMeetingDTO getMeetingById(ZtMeetingDTO dto);
|
||||
|
||||
void downLoadById(ZtMeetingDTO dto, HttpServletResponse res, HttpServletRequest request);
|
||||
}
|
@ -9,6 +9,7 @@ import com.sa.zentao.enums.ProductStoryStatus;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -37,4 +38,10 @@ public interface IZtProductService extends IService<ZtProduct> {
|
||||
void productDeleted(ZtProductDTO dto);
|
||||
|
||||
void productChangeStatus(Integer pId, ProductStoryStatus oldStatus, ProductStoryStatus newStatus);
|
||||
|
||||
List<ZtProduct> selectProductByName(String productName);
|
||||
|
||||
Map<Integer, ZtProduct> selectMapProduct();
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.PerformanceDTO;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.entity.ZtUser;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -70,6 +72,9 @@ public interface IZtProjectService extends IService<ZtProject> {
|
||||
|
||||
void executionSyncStory(ZtProjectDTO dto);
|
||||
|
||||
|
||||
//产品集权限
|
||||
List<Integer> authProductList();
|
||||
//产品集权限
|
||||
List<Integer> authList();
|
||||
//项目权限合集
|
||||
@ -102,4 +107,8 @@ public interface IZtProjectService extends IService<ZtProject> {
|
||||
List<ZtProject> execListByProject(Integer project);
|
||||
|
||||
void removeExecutionStory(Integer id,List<Integer> execList);
|
||||
|
||||
ZtProjectDTO selectPrdById(Integer project);
|
||||
|
||||
List<PerformanceDTO> performanceCount(Date startDate, Date endDate);
|
||||
}
|
||||
|
@ -23,4 +23,6 @@ public interface IZtProjectstoryService extends IService<ZtProjectstory> {
|
||||
List<ZtProjectstory> projectListByStory(List<Integer> storyIds, ProjectTypeEnums type);
|
||||
//一个项目只能关联一个story
|
||||
ZtProjectstory getProject(Integer storyId);
|
||||
|
||||
List<ZtProjectstory> prdList(Integer id);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public interface IZtStoryFeedbackService extends IService<ZtStoryFeedback> {
|
||||
|
||||
void changeStatus(ZtStoryFeedbackDTO dto);
|
||||
|
||||
void assignedTo(ZtStoryDTO dto);
|
||||
void assignedTo(ZtStoryFeedbackDTO dto);
|
||||
|
||||
void startHand(ZtStoryDTO dto);
|
||||
|
||||
@ -35,4 +35,8 @@ public interface IZtStoryFeedbackService extends IService<ZtStoryFeedback> {
|
||||
|
||||
PageInfo<ZtStoryFeedbackDTO> myFeedbackPageList(ZtProjectQo qo);
|
||||
|
||||
void closedFeedback(ZtStoryFeedbackDTO dto);
|
||||
|
||||
void approval(ZtStoryFeedbackDTO dto);
|
||||
|
||||
}
|
||||
|
@ -81,4 +81,6 @@ public interface IZtStoryService extends IService<ZtStory> {
|
||||
List<ZtStoryDTO> myStoryList(ZtProjectQo qo);
|
||||
|
||||
Map<Integer,List<ZtProject>> getExecutionMapByStory(List<ZtStoryDTO> list);
|
||||
|
||||
void batchAddStory(ZtStoryDTO dto);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.sa.zentao.service;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||
import com.sa.zentao.entity.ZtProduct;
|
||||
import com.sa.zentao.entity.ZtStoryUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.qo.StoryQo;
|
||||
@ -30,6 +31,11 @@ public interface IZtStoryUserService extends IService<ZtStoryUser> {
|
||||
|
||||
List<ZtStoryUserDTO> storyListByProductId(ZtProjectQo qo);
|
||||
|
||||
void userReview(ZtStoryDTO dto);
|
||||
ZtStoryUserDTO userReview(ZtStoryDTO dto);
|
||||
|
||||
ZtStoryUserDTO getUserStoryById(ZtStoryDTO dto);
|
||||
|
||||
void addRemark(ZtStoryDTO dto);
|
||||
|
||||
void closedStory(ZtStoryUserDTO dto);
|
||||
}
|
||||
|
@ -34,4 +34,6 @@ public interface IZtUserService extends IService<ZtUser> {
|
||||
ZtUser login(ZtUser user);
|
||||
|
||||
ZtUser selectPrdByName(String userName);
|
||||
|
||||
ZtUser getbyVxId(String vx);
|
||||
}
|
||||
|
@ -149,22 +149,78 @@ public class IZtCountService {
|
||||
private IZtProjectproductService projectproductService;
|
||||
@Autowired
|
||||
private IZtProductService productService;
|
||||
@Autowired
|
||||
private IZtStoryreviewService storyreviewService;
|
||||
|
||||
public ZtStoryCountDTO storyCount(ZtCaseDTO dto) {
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||
|
||||
|
||||
UserType userType = loginRiskUser.getUserType();
|
||||
ZtStoryCountDTO result = new ZtStoryCountDTO();
|
||||
if (userType == UserType.GSGC||loginRiskUser.getName().equals("admin")) {
|
||||
if (loginRiskUser.getName().equals("admin")||userType == UserType.GSGC) {
|
||||
List<Integer> integers = this.projectService.authProductList();
|
||||
List<ZtStoryUser> list =null;
|
||||
|
||||
if(!loginRiskUser.getName().equals("admin")){
|
||||
if(!CollectionUtils.isEmpty(integers)){
|
||||
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getProduct,integers).in(ZtStoryUser::getStatus, "active", "reviewing"));
|
||||
}else{
|
||||
list=new ArrayList<>();
|
||||
}
|
||||
}else{
|
||||
list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getStatus, "active", "reviewing"));
|
||||
}
|
||||
|
||||
List<ZtStory> ztStory = null;
|
||||
|
||||
|
||||
if(!loginRiskUser.getName().equals("admin")){
|
||||
if(!CollectionUtils.isEmpty(integers)){
|
||||
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getDeleted, "0")
|
||||
.in(ZtStory::getProduct,integers)
|
||||
.ne(ZtStory::getStatus, "closed")
|
||||
);
|
||||
}else{
|
||||
ztStory=new ArrayList<>();
|
||||
}
|
||||
}else{
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
ztStory=new ArrayList<>();
|
||||
}else{
|
||||
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getDeleted, "0")
|
||||
.ne(ZtStory::getStatus, "closed")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<ZtProduct> products = this.productService.list(new QueryWrapper<ZtProduct>().lambda().eq(ZtProduct::getStatus, "normal"));
|
||||
if(!CollectionUtils.isEmpty(products)){
|
||||
List<String> userStrList = products.stream().filter(o -> !StringUtils.isEmpty(o.getReviewer())).map(o->o.getReviewer()).collect(Collectors.toList());
|
||||
List<String> users=new ArrayList<>();
|
||||
for (String str:userStrList) {
|
||||
users.addAll(new ArrayList<>(Arrays.asList(str.split(","))));
|
||||
}
|
||||
if(users.contains(loginRiskUser.getName())){
|
||||
List<String> userStoryList = list.stream().filter(o -> "reviewing".equals(o.getStatus())).map(o -> o.getId() + "").collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(userStoryList)){
|
||||
result.setDpsCount("");
|
||||
}else{
|
||||
List<ZtStoryreview> userStory = this.storyreviewService.list(new QueryWrapper<ZtStoryreview>().lambda().eq(ZtStoryreview::getType, "userStory").in(ZtStoryreview::getStory, userStoryList));
|
||||
result.setDpsCount(userStory.stream().filter(o ->StringUtils.isEmpty(o.getResult())&&loginRiskUser.getName().equals(o.getReviewer()) ).map(o->o.getStory().toString()).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
}else{
|
||||
result.setDpsCount(list.stream().filter(o -> "reviewing".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
}else{
|
||||
result.setDpsCount(list.stream().filter(o -> "reviewing".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
|
||||
List<ZtStoryUser> list = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getStatus, "active", "reviewing"));
|
||||
|
||||
List<ZtStory> ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getDeleted, "0")
|
||||
.ne(ZtStory::getStatus, "closed")
|
||||
);
|
||||
result.setDpsCount(list.stream().filter(o -> "reviewing".equals(o.getStatus())).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setPstgCount(list.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("wait")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
@ -173,18 +229,35 @@ public class IZtCountService {
|
||||
|
||||
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("testing")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
// developing 研发中 developed 研发完毕 testing 测试中 tested测试完毕
|
||||
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("developing")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> !o.getStage().equals("verified") && !o.getStage().equals("verified"))
|
||||
.filter(o -> o.getPlanEndDate() != null && o.getPlanEndDate().getTime() < new Date().getTime())
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
.filter(o -> Arrays.asList("developing","developed","testing","tested").contains(o.getStage())
|
||||
).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(ztStory)){
|
||||
result.setYqCount(null);
|
||||
}else{
|
||||
//延期需求改成延期任务
|
||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
// result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
// .filter(o -> !o.getStage().equals("verified") && !o.getStage().equals("verified"))
|
||||
// .filter(o -> o.getPlanEndDate() != null && o.getPlanEndDate().getTime() < new Date().getTime())
|
||||
// .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
result.setCswbCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("tested"))
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setDysCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("released"))
|
||||
.filter(o -> o.getStage().equals("released")
|
||||
|| (o.getStage().equals("verified")&&o.getYsFlag()==2)
|
||||
)
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("verified"))
|
||||
@ -204,33 +277,59 @@ public class IZtCountService {
|
||||
//处理完的
|
||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
//延期的
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
} else if (userType == UserType.CP) {
|
||||
} else if (userType == UserType.CP ) {
|
||||
|
||||
List<Integer> integers = this.projectService.authList();
|
||||
List<ZtProduct> list =null;
|
||||
List<ZtStoryUser> storyUsers =null;
|
||||
if(CollectionUtils.isEmpty(integers)){
|
||||
list=new ArrayList<>();
|
||||
storyUsers=new ArrayList<>();
|
||||
}else{
|
||||
list = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, integers));
|
||||
storyUsers = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
||||
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
||||
.in(ZtStoryUser::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList()))
|
||||
// .eq(ZtStoryUser::getAssignedto,loginRiskUser.getName())
|
||||
.eq(ZtStoryUser::getOpenedby,loginRiskUser.getName())
|
||||
);
|
||||
}
|
||||
|
||||
List<ZtProduct> list = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, integers));
|
||||
|
||||
List<ZtStoryUser> storyUsers = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda()
|
||||
.in(ZtStoryUser::getStatus, "active", "reviewing")
|
||||
.in(ZtStoryUser::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList()))
|
||||
.eq(ZtStoryUser::getAssignedto,loginRiskUser.getName())
|
||||
);
|
||||
|
||||
|
||||
//产品看自己的需求
|
||||
List<ZtStory> ztStory =null;
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
ztStory=new ArrayList<>();
|
||||
result.setYqCount(null);
|
||||
}else{
|
||||
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getDeleted, "0")
|
||||
.ne(ZtStory::getStatus, "closed")
|
||||
.eq(ZtStory::getOpenedby,loginRiskUser.getName())
|
||||
.in(ZtStory::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList())));
|
||||
if(CollectionUtils.isEmpty(storyUsers)){
|
||||
ztStory=new ArrayList<>();
|
||||
}else{
|
||||
ztStory = storyService.list(new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getDeleted, "0")
|
||||
.ne(ZtStory::getStatus, "closed")
|
||||
.in(ZtStory::getUserStory,storyUsers.stream().map(o->o.getId()).collect(Collectors.toList()))
|
||||
.in(ZtStory::getProduct,list.stream().map(o->o.getId()).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(ztStory)){
|
||||
result.setYqCount(null);
|
||||
}else{
|
||||
//延期需求改成延期任务 TODO
|
||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result.setDpsCount(storyUsers.stream().filter(o -> "reviewing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
result.setPstgCount(storyUsers.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
@ -242,10 +341,6 @@ public class IZtCountService {
|
||||
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("developing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> !o.getStage().equals("verified") && !o.getStage().equals("verified"))
|
||||
.filter(o -> o.getPlanEndDate() != null && o.getPlanEndDate().getTime() < new Date().getTime())
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setCswbCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("tested"))
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
@ -275,8 +370,9 @@ public class IZtCountService {
|
||||
//处理完的
|
||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
//延期的
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime())
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime())
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
} else if (userType == UserType.XMGLY) {
|
||||
|
||||
@ -339,10 +435,23 @@ public class IZtCountService {
|
||||
result.setDysCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("released"))
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("verified"))
|
||||
.filter(o -> o.getYsFlag() == 2)
|
||||
.map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
// result.setYsNoCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
// .filter(o -> o.getStage().equals("verified"))
|
||||
// .filter(o -> o.getYsFlag() == 2)
|
||||
// .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
//延期需求改成延期任务 TODO
|
||||
|
||||
if(CollectionUtils.isEmpty(ztStory)){
|
||||
result.setYqCount(null);
|
||||
}else{
|
||||
List<ZtTask> tList = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.in(ZtTask::getStory, ztStory.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||
.notIn(ZtTask::getStatus,"pause","cancel","closed","done")
|
||||
.last(" and finishedDate > DATE_ADD(DATE_ADD(deadline,INTERVAL 1 day),INTERVAL -1 SECOND)"));
|
||||
result.setYqCount(tList.stream().map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
result.setYsYesCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||
.filter(o -> o.getStage().equals("verified"))
|
||||
.filter(o -> o.getYsFlag() == 1)
|
||||
@ -365,7 +474,9 @@ public class IZtCountService {
|
||||
//处理完的
|
||||
result.setFeedbackClwCount(feedbacks.stream().filter(o->"finished".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
//延期的
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
result.setFeedbackYqCount(feedbacks.stream().filter(o->!Arrays.asList("finished","closed").contains(o.getStatus())).filter(o->o.getPlanFinishDate()!=null&&o.getPlanFinishDate().getTime()<new Date().getTime()) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
|
||||
result.setFeedbackGbCount(feedbacks.stream().filter(o->"closed".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
|
||||
@ -419,6 +530,8 @@ public class IZtCountService {
|
||||
|
||||
List<ProjectWorkTaskDTO> workTasks= workTaskCounts(qo);
|
||||
|
||||
|
||||
List<PerformanceDTO> perList =performanceCount(qo);
|
||||
// excelWriter.write(workDetailsDTOS, 统计, accountInfo);
|
||||
// excelWriter.write(workDetailsDTOS1, 统计, tweetInfo);
|
||||
|
||||
@ -435,7 +548,7 @@ public class IZtCountService {
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream())
|
||||
. registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.needHead(Boolean.TRUE).build();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
||||
if(i==1){
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(i, "导出工作量")
|
||||
@ -450,12 +563,19 @@ public class IZtCountService {
|
||||
.needHead(Boolean.TRUE).build();
|
||||
excelWriter.write(workTasks, writeSheet);
|
||||
}
|
||||
else{
|
||||
else if(i==0){
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(i, "导出统计")
|
||||
.head(WorkDetailsDTO.class)
|
||||
.needHead(Boolean.TRUE).build();
|
||||
excelWriter.write(workDetailsDTOS1, writeSheet);
|
||||
}
|
||||
else if(i==3){
|
||||
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(i, "绩效")
|
||||
.head(PerformanceDTO.class)
|
||||
.needHead(Boolean.TRUE).build();
|
||||
excelWriter.write(perList, writeSheet);
|
||||
}
|
||||
|
||||
}
|
||||
excelWriter.finish();
|
||||
@ -475,6 +595,39 @@ public class IZtCountService {
|
||||
}
|
||||
}
|
||||
|
||||
private List<PerformanceDTO> performanceCount(ZtCountQo qo) {
|
||||
|
||||
Date d = qo.getDate();
|
||||
if(d==null){
|
||||
d=new Date();
|
||||
}
|
||||
Date firstDayOfMonth = DateUtils.getFirstDayOfMonth(d);
|
||||
Date lastDayOfMonth = DateUtils.getLastDayOfMonth(d);
|
||||
//产品集
|
||||
Integer project = qo.getProject();
|
||||
// if(qo.){
|
||||
//
|
||||
// }
|
||||
List<ZtProduct> productList = this.productService.list(new QueryWrapper<ZtProduct>().lambda().eq(ZtProduct::getProgram, project));
|
||||
if (CollectionUtils.isEmpty(productList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtProjectproduct> projectproducts = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||
.in(ZtProjectproduct::getProduct, productList.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
if (CollectionUtils.isEmpty(projectproducts)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtExecutionproject> list = executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||
.in(ZtExecutionproject::getProject, projectproducts.stream().map(o->o.getProject()).collect(Collectors.toList())));
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
// this.teamService.list(new QueryWrapper<>().lambda().eq());
|
||||
|
||||
return this.projectService.performanceCount(firstDayOfMonth,lastDayOfMonth);
|
||||
}
|
||||
|
||||
private List<ProjectWorkTaskDTO> workTaskCounts(ZtCountQo qo) {
|
||||
|
||||
Date d = qo.getDate();
|
||||
@ -511,12 +664,15 @@ public class IZtCountService {
|
||||
List<Integer> executionIds = ztProjects.stream().map(o -> o.getId()).collect(Collectors.toList());
|
||||
//所有任务
|
||||
List<ZtTask> taskList = this.taskService.list(new QueryWrapper<ZtTask>().lambda().in(ZtTask::getExecution, executionIds));
|
||||
// taskList=new ArrayList<>();
|
||||
// taskList.add(this.taskService.getById(1178));
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
taskList = taskList.stream()
|
||||
.filter(o ->
|
||||
( o.getFinishedDate()!=null&& (o.getFinishedDate().getTime() >= firstDayOfMonth.getTime() && o.getFinishedDate().getTime() <= lastDayOfMonth.getTime()))
|
||||
( o.getFinishedDate()!=null&& (o.getFinishedDate().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getFinishedDate().getTime() <= lastDayOfMonth.getTime()))
|
||||
||
|
||||
(o.getEstStarted()!=null&&o.getDeadline()!=null)&&
|
||||
(( o.getDeadline().getTime()<=lastDayOfMonth.getTime()&& o.getDeadline().getTime()>=firstDayOfMonth.getTime())
|
||||
@ -772,13 +928,29 @@ public class IZtCountService {
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
taskList = taskList.stream()
|
||||
.filter(o->o.getFinishedDate()!=null)
|
||||
.filter(o ->
|
||||
(o.getFinishedDate().getTime() >= firstDayOfMonth.getTime() && o.getFinishedDate().getTime() <= lastDayOfMonth.getTime())
|
||||
// taskList = taskList.stream()
|
||||
// .filter(o->o.getFinishedDate()!=null)
|
||||
// .filter(o ->
|
||||
// (o.getFinishedDate().getTime() >= firstDayOfMonth.getTime() && o.getFinishedDate().getTime() <= lastDayOfMonth.getTime())
|
||||
// || (o.getDeadline().getTime() >=firstDayOfMonth.getTime() && o.getDeadline().getTime() <= lastDayOfMonth.getTime())
|
||||
// || (o.getEstStarted().getTime()<=firstDayOfMonth.getTime() && o.getDeadline().getTime() > firstDayOfMonth.getTime())
|
||||
).collect(Collectors.toList());
|
||||
// ).collect(Collectors.toList());
|
||||
|
||||
taskList = taskList.stream()
|
||||
.filter(o ->
|
||||
( o.getFinishedDate()!=null&& (o.getFinishedDate().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getFinishedDate().getTime() <= lastDayOfMonth.getTime()))
|
||||
||
|
||||
(o.getEstStarted()!=null&&o.getDeadline()!=null)&&
|
||||
(( o.getDeadline().getTime()<=lastDayOfMonth.getTime()&& o.getDeadline().getTime()>=firstDayOfMonth.getTime())
|
||||
||
|
||||
( o.getEstStarted().getTime()<=lastDayOfMonth.getTime()&& o.getEstStarted().getTime()>=firstDayOfMonth.getTime()))
|
||||
|
||||
// || (o.getDeadline().getTime() >=firstDayOfMonth.getTime() && o.getDeadline().getTime() <= lastDayOfMonth.getTime())
|
||||
// || (o.getEstStarted().getTime()<=firstDayOfMonth.getTime() && o.getDeadline().getTime() > firstDayOfMonth.getTime())
|
||||
).filter(o->o.getStatus().equals("done"))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
List<ZtTeam> teamList = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getType, "execution")
|
||||
.in(ZtTeam::getRoot, ztProjects.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
|
@ -51,6 +51,8 @@ public class ZtActionServiceImpl extends ServiceImpl<ZtActionMapper, ZtAction> i
|
||||
private IZtProductService productService;
|
||||
@Autowired
|
||||
private IZtUserService userService;
|
||||
@Autowired
|
||||
private IZtReleaseService releaseService;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -145,6 +147,15 @@ public class ZtActionServiceImpl extends ServiceImpl<ZtActionMapper, ZtAction> i
|
||||
s.setActionValue("需求:"+story.getTitle()+"-"+s.getActionValue());
|
||||
}
|
||||
}
|
||||
|
||||
if(ActionType.FB.getValue().equals(t.getObjecttype())){
|
||||
ZtRelease release = releaseService.getById(t.getObjectid());
|
||||
if(release!=null){
|
||||
s.setActionValue("发布:"+release.getName()+"-"+s.getActionValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(ActionType.RW.getValue().equals(t.getObjecttype())){
|
||||
ZtTask task = taskService.getById(t.getObjectid());
|
||||
s.setActionValue("任务:"+task.getName()+"-"+s.getActionValue());
|
||||
|
@ -143,7 +143,18 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
||||
String[] split = qo.getIds().split(",");
|
||||
qo.setObjIds(new ArrayList<>(Arrays.asList(split)));
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(qo.getProductName())){
|
||||
List<ZtProduct> pList = this.productService.selectProductByName(qo.getProductName());
|
||||
if(!CollectionUtils.isEmpty(pList)){
|
||||
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
||||
.lambda().in(ZtProjectproduct::getProduct, pList.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new PageInfo<>();
|
||||
}else{
|
||||
qo.setProjectList(list.stream().map(o->o.getProject()).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<ZtBugDTO> result = this.baseMapper.myBugPageList(qo);
|
||||
if(!CollectionUtils.isEmpty(result)){
|
||||
@ -200,6 +211,13 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
||||
d.setZtStory(this.storyService.getById(tostory));
|
||||
}
|
||||
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
d.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
@ -219,6 +237,34 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchAddBug(ZtBugDTO dto) {
|
||||
|
||||
List<ZtBugDTO> list = dto.getList();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
throw new BusinessException("请检查数据");
|
||||
}
|
||||
List<ZtBug> saveBatch=new ArrayList();
|
||||
for (ZtBugDTO d:list) {
|
||||
ZtBug b=new ZtBug();
|
||||
BeanUtils.copyProperties(d,b);
|
||||
b.setOpeneddate(new Date());
|
||||
b.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
b.setStatus("active");
|
||||
saveBatch.add(b);
|
||||
}
|
||||
this.saveBatch(saveBatch);
|
||||
|
||||
if(dto.getExecution()!=null&&dto.getExecution()!=0){
|
||||
kanbanlaneService.addBug(dto.getExecution(), saveBatch);
|
||||
}
|
||||
|
||||
for (ZtBug ztBug:saveBatch) {
|
||||
this.actionService.addAction(ActionType.BUG, ActionStatus.XJ,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
||||
,RiskUserThreadLocal.get().getName(),ztBug.getSteps(),""
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@ -238,8 +284,11 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
||||
ztBug.setProject(projectstory.getProject());
|
||||
}
|
||||
}
|
||||
ZtStory story = storyService.getById(dto.getTostory());
|
||||
ztBug.setProduct(story.getProduct());
|
||||
if(dto.getTostory()!=null&&dto.getTostory()!=0){
|
||||
ZtStory story = storyService.getById(dto.getTostory());
|
||||
ztBug.setProduct(story.getProduct());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -318,7 +367,7 @@ public class ZtBugServiceImpl extends ServiceImpl<ZtBugMapper, ZtBug> implements
|
||||
//
|
||||
ztBug.setStatus("closed");
|
||||
this.actionService.addAction(ActionType.BUG, ActionStatus.GB,ztBug.getId(),ztBug.getProject()+"",ztBug.getProject(),ztBug.getExecution()
|
||||
,RiskUserThreadLocal.get().getName(),qo.getRemark(),""
|
||||
,RiskUserThreadLocal.get().getName(),qo.getDesc(),""
|
||||
);
|
||||
}
|
||||
//1.active 2.confire=1 3.解决进行中 不变 4 resolved 完成 5.测试中不变 6.测试完毕不变
|
||||
|
@ -0,0 +1,175 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.ZtDevelopFeedbackDTO;
|
||||
import com.sa.zentao.dao.ZtMeetingDTO;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.entity.ZtDevelopFeedback;
|
||||
import com.sa.zentao.entity.ZtProduct;
|
||||
import com.sa.zentao.entity.ZtUser;
|
||||
import com.sa.zentao.enums.ActionStatus;
|
||||
import com.sa.zentao.enums.ActionType;
|
||||
import com.sa.zentao.mapper.ZtDevelopFeedbackMapper;
|
||||
import com.sa.zentao.qo.ZtFeedbackQo;
|
||||
import com.sa.zentao.service.IZtActionService;
|
||||
import com.sa.zentao.service.IZtDevelopFeedbackService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.service.IZtProductService;
|
||||
import com.sa.zentao.service.IZtUserService;
|
||||
import lombok.Synchronized;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-02-05
|
||||
*/
|
||||
@Service
|
||||
public class ZtDevelopFeedbackServiceImpl extends ServiceImpl<ZtDevelopFeedbackMapper, ZtDevelopFeedback> implements IZtDevelopFeedbackService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IZtUserService userService;
|
||||
@Autowired
|
||||
private IZtProductService productService;
|
||||
@Autowired
|
||||
private IZtActionService actionService;
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<ZtDevelopFeedbackDTO> pageList(ZtFeedbackQo qo) {
|
||||
Page<ZtDevelopFeedbackDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
|
||||
List<ZtDevelopFeedbackDTO> list = this.baseMapper.pageList(qo);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||
for (ZtDevelopFeedbackDTO d:list) {
|
||||
String assignedTo = d.getAssignedTo();
|
||||
String createUser = d.getCreateUser();
|
||||
String updateUser = d.getUpdateUser();
|
||||
ZtUser ztUser = userMap.get(assignedTo);
|
||||
if(ztUser!=null){
|
||||
d.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(createUser);
|
||||
if(ztUser!=null){
|
||||
d.setCreateUserName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(updateUser);
|
||||
if(ztUser!=null){
|
||||
d.setUpdateUserName(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new PageInfo<ZtDevelopFeedbackDTO>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(ZtDevelopFeedbackDTO dto) {
|
||||
ZtDevelopFeedback ztDevelopFeedback = new ZtDevelopFeedback();
|
||||
BeanUtils.copyProperties(dto,ztDevelopFeedback);
|
||||
ztDevelopFeedback.setCreateDate(new Date());
|
||||
ztDevelopFeedback.setCreateUser(RiskUserThreadLocal.get().getName());
|
||||
ztDevelopFeedback.setUpdateUser(RiskUserThreadLocal.get().getName());
|
||||
ztDevelopFeedback.setUpdateDate(new Date());
|
||||
this.baseMapper.insert(ztDevelopFeedback);
|
||||
//添加action
|
||||
actionService.addAction(ActionType.DEVLOPSFEEDBACK, ActionStatus.XJ, ztDevelopFeedback.getId(), ztDevelopFeedback.getProductId() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify(ZtDevelopFeedbackDTO dto) {
|
||||
ZtDevelopFeedback ztDevelopFeedback = this.baseMapper.selectById(dto.getId());
|
||||
if(ztDevelopFeedback==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
if(ztDevelopFeedback.getCreateDate().getTime()<(System.currentTimeMillis()-1000*60*60*24)){
|
||||
throw new BusinessException("当前无法更改");
|
||||
}
|
||||
BeanUtils.copyProperties(dto,ztDevelopFeedback);
|
||||
this.baseMapper.updateById(ztDevelopFeedback);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZtDevelopFeedbackDTO> myFeedbackList(ZtFeedbackQo qo) {
|
||||
|
||||
qo.setUserName(RiskUserThreadLocal.get().getName());
|
||||
|
||||
List<ZtDevelopFeedbackDTO> list = this.baseMapper.myFeedbackList(qo);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||
for (ZtDevelopFeedbackDTO d:list) {
|
||||
String assignedTo = d.getAssignedTo();
|
||||
String createUser = d.getCreateUser();
|
||||
String updateUser = d.getUpdateUser();
|
||||
ZtUser ztUser = userMap.get(assignedTo);
|
||||
if(ztUser!=null){
|
||||
d.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(createUser);
|
||||
if(ztUser!=null){
|
||||
d.setCreateUserName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(updateUser);
|
||||
if(ztUser!=null){
|
||||
d.setUpdateUserName(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZtDevelopFeedbackDTO getFeedbackById(ZtFeedbackQo qo) {
|
||||
Integer id = qo.getId();
|
||||
if(id==null){
|
||||
throw new BusinessException("请检查数据");
|
||||
}
|
||||
ZtDevelopFeedback ztDevelopFeedback = this.baseMapper.selectById(qo.getId());
|
||||
if(ztDevelopFeedback==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
ZtDevelopFeedbackDTO d=new ZtDevelopFeedbackDTO();
|
||||
BeanUtils.copyProperties(ztDevelopFeedback,d);
|
||||
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||
String assignedTo = d.getAssignedTo();
|
||||
String createUser = d.getCreateUser();
|
||||
String updateUser = d.getUpdateUser();
|
||||
ZtUser ztUser = userMap.get(assignedTo);
|
||||
if(ztUser!=null){
|
||||
d.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(createUser);
|
||||
if(ztUser!=null){
|
||||
d.setCreateUserName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(updateUser);
|
||||
if(ztUser!=null){
|
||||
d.setUpdateUserName(ztUser.getNickname());
|
||||
}
|
||||
ZtProduct product = productService.getById(ztDevelopFeedback.getProductId());
|
||||
if(product!=null){
|
||||
d.setProductName(product.getName());
|
||||
}
|
||||
return d;
|
||||
}
|
||||
}
|
@ -136,8 +136,12 @@ public class ZtEffortServiceImpl extends ServiceImpl<ZtEffortMapper, ZtEffort> i
|
||||
List<ZtEffort> collect = ztEfforts.stream().filter(o -> DateUtils.formatDate(o.getDate(), "yyyy-MM-dd")
|
||||
.equals(s)).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isEmpty(collect)){
|
||||
map.put(s,"0");
|
||||
}else{
|
||||
map.put(s,collect.stream().map(o -> o.getConsumed()).reduce( (a, b) -> fAdd(a,b)).get()+"");
|
||||
}
|
||||
|
||||
map.put(s,collect.stream().map(o -> o.getConsumed()).reduce(0F, (a, b) -> fAdd(a,b))+"");
|
||||
|
||||
}
|
||||
|
||||
@ -147,6 +151,6 @@ public class ZtEffortServiceImpl extends ServiceImpl<ZtEffortMapper, ZtEffort> i
|
||||
private Float fAdd(Float a,Float b){
|
||||
BigDecimal f1 = BigDecimal.valueOf(a);
|
||||
BigDecimal f2 = BigDecimal.valueOf(b);
|
||||
return f1.add(f1).setScale(2,BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
return f1.add(f2).setScale(2,BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.DateUtils;
|
||||
import com.sa.zentao.utils.KanBanConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -64,6 +65,9 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
@Autowired
|
||||
private IZtUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IZtProductService productService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ZtKanbanlaneDTO> lookInfoByExec(ZtProjectQo qo) {
|
||||
@ -90,7 +94,7 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
List<ZtStoryDTO> ztStoryDTOS = BeanCopyUtil.copyListProperties(ztStories, ZtStoryDTO::new);
|
||||
List<ZtStoryspec> storySpecList = storyspecService.list(new QueryWrapper<ZtStoryspec>().lambda().in(ZtStoryspec::getStory, ids));
|
||||
if(!CollectionUtils.isEmpty(ztStories)){
|
||||
|
||||
ZtProduct product = this.productService.getById(ztStoryDTOS.get(0).getProduct());
|
||||
for (ZtStoryDTO st:ztStoryDTOS) {
|
||||
ZtUser ztUser = userMap.get(st.getAssignedTo());
|
||||
|
||||
@ -104,6 +108,9 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
st.setSpec(ztStoryspec.getSpec());
|
||||
st.setVerify(ztStoryspec.getVerify());
|
||||
}
|
||||
if(product!=null){
|
||||
st.setProductName(product.getName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -130,6 +137,26 @@ public class ZtKanbanlaneServiceImpl extends ServiceImpl<ZtKanbanlaneMapper, ZtK
|
||||
st.setColor(ztUser.getColor());
|
||||
st.setAssignedTo(ztUser.getNickname());
|
||||
}
|
||||
if(st.getDeadline()!=null){
|
||||
st.setDeadline(DateUtils.getDayLast(st.getDeadline()));
|
||||
}
|
||||
ztUser = userMap.get(st.getOpenedby());
|
||||
if(ztUser!=null){
|
||||
st.setOpenedby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(st.getFinishedby());
|
||||
if(ztUser!=null){
|
||||
st.setFinishedby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(st.getCanceledby());
|
||||
if(ztUser!=null){
|
||||
st.setCanceledby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(st.getClosedby());
|
||||
if(ztUser!=null){
|
||||
st.setClosedby(ztUser.getNickname());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
d.setList(ztTasks);
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,21 +8,15 @@ import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.ZtProductDTO;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.entity.ZtProduct;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
import com.sa.zentao.entity.ZtProjectproduct;
|
||||
import com.sa.zentao.entity.ZtUser;
|
||||
import com.sa.zentao.entity.*;
|
||||
import com.sa.zentao.enums.ActionStatus;
|
||||
import com.sa.zentao.enums.ActionType;
|
||||
import com.sa.zentao.enums.ProductStoryStatus;
|
||||
import com.sa.zentao.mapper.ZtProductMapper;
|
||||
import com.sa.zentao.mapper.ZtProjectMapper;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.IZtActionService;
|
||||
import com.sa.zentao.service.IZtProductService;
|
||||
import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.service.IZtProjectService;
|
||||
import com.sa.zentao.service.IZtUserService;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.BeanCopyUtilCallBack;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -32,8 +26,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -59,6 +55,15 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
||||
@Autowired
|
||||
private IZtUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IZtStoryService storyService;
|
||||
|
||||
@Autowired
|
||||
private IZtStoryUserService storyUserService;
|
||||
|
||||
@Autowired
|
||||
private IZtBugService bugService;
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<ZtProjectDTO> pageList(ZtProjectQo qo) {
|
||||
@ -131,14 +136,53 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
||||
List<String> userList = ztProjectDTOS.stream().map(o -> o.getPm()).collect(Collectors.toList());
|
||||
userList.addAll(result.stream().filter(o->!StringUtils.isEmpty(o.getPo())).map(o->o.getPo()).collect(Collectors.toList()));
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userList);
|
||||
|
||||
List<ZtStory> allStoryList = this.storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getProduct, result.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
List<ZtBug> allBugList = bugService.list(new QueryWrapper<ZtBug>().lambda()
|
||||
.ne(ZtBug::getStatus,"closed")
|
||||
.in(ZtBug::getProduct, result.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
|
||||
List<ZtStoryUser> allUserStoryList = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().in(ZtStoryUser::getProduct, result.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
|
||||
for (ZtProductDTO p:result ) {
|
||||
List<ZtStory> storyList = allStoryList.stream().filter(o->o.getProduct().equals(p.getId())).collect(Collectors.toList());
|
||||
List<ZtBug> bugList =allBugList.stream().filter(o->o.getProduct().equals(p.getId())).collect(Collectors.toList());
|
||||
List<ZtStoryUser> userStoryList = allUserStoryList.stream().filter(o->o.getProduct().equals(p.getId())).collect(Collectors.toList());
|
||||
if(!StringUtils.isEmpty(p.getPo())){
|
||||
ZtUser ztUser = userMap.get(p.getPo());
|
||||
if(ztUser!=null){
|
||||
p.setPoValue(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
List<ZtStory> fStoryList = storyList.stream().filter(o -> o.getProduct().intValue() == p.getId().intValue()).collect(Collectors.toList());
|
||||
p.setDraftStories(Long.valueOf(userStoryList.stream().filter(o->o.getStatus().equals("draft")).count()).intValue()
|
||||
);
|
||||
p.setReviewingStories(Long.valueOf(userStoryList.stream().filter(o->o.getStatus().equals("reviewing")).count()).intValue());
|
||||
|
||||
|
||||
p.setReleases(Long.valueOf(fStoryList.stream().filter(o->o.getStatus()
|
||||
.equals("active")&&o.getStage().equals("released")).count()).intValue());
|
||||
p.setActiveStories(Long.valueOf(fStoryList.stream().filter(o->o.getStatus()
|
||||
.equals("active")&&!o.getStage().equals("verified")).count()).intValue());
|
||||
p.setFinishedStories(Long.valueOf(fStoryList.stream().filter(o->o.getStatus().equals("active"))
|
||||
.filter(o->o.getStage().equals("tested")||o.getStage().equals("released")).count()).intValue());
|
||||
p.setFinishTaskRatio(fStoryList.size()==0?BigDecimal.ZERO:BigDecimal.valueOf(p.getFinishedStories()).divide(BigDecimal.valueOf(
|
||||
fStoryList.stream().filter(o->o.getStatus().equals("active")).filter(o->!o.getStage().equals("verified"))
|
||||
.collect(Collectors.toList()).size()
|
||||
),2,BigDecimal.ROUND_HALF_UP));
|
||||
p.setFinishTaskRatio(p.getFinishTaskRatio().multiply(BigDecimal.valueOf(100)));
|
||||
|
||||
p.setYss(Long.valueOf(fStoryList.stream().filter(o->o.getStage().equals("verified")).count()).intValue());
|
||||
//激活bug
|
||||
List<ZtBug> fBugList = bugList.stream().filter(o -> o.getProduct().intValue() == p.getId().intValue()).collect(Collectors.toList());
|
||||
|
||||
p.setFixedBugs(Long.valueOf(fBugList.stream().filter(o->o.getStatus().equals("active")).count()).intValue());
|
||||
long resolved = fBugList.stream().filter(o -> o.getStatus().equals("resolved")).count();
|
||||
|
||||
p.setFinishBugRatio(fBugList.size()==0?BigDecimal.ZERO:BigDecimal.valueOf(resolved).divide(BigDecimal.valueOf(
|
||||
fBugList.size()
|
||||
),2,BigDecimal.ROUND_HALF_UP));
|
||||
p.setFinishBugRatio(p.getFinishBugRatio().multiply(BigDecimal.valueOf(100)));
|
||||
}
|
||||
for (ZtProjectDTO d:ztProjectDTOS) {
|
||||
d.setChildren(result.stream().filter(o->o.getProgram().equals(d.getId())).collect(Collectors.toList()));
|
||||
@ -305,6 +349,23 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
||||
this.baseMapper.updateById(ztProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZtProduct> selectProductByName(String productName) {
|
||||
if(StringUtils.isEmpty(productName)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return this.baseMapper.selectList(new QueryWrapper<ZtProduct>().lambda().eq(ZtProduct::getName,productName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, ZtProduct> selectMapProduct() {
|
||||
List<ZtProduct> list = list();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
return list.stream().collect(Collectors.toMap(ZtProduct::getId,o->o));
|
||||
}
|
||||
|
||||
private Map<Integer, List<ZtProductDTO>> getChildrenMap(List<ZtProjectDTO> result) {
|
||||
|
||||
List<ZtProduct> ztProjects = this.baseMapper.selectList(
|
||||
|
@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.PerformanceDTO;
|
||||
import com.sa.zentao.dao.ZtProjectDTO;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.entity.*;
|
||||
@ -102,7 +103,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
BeanUtils.copyProperties(dto,ztProject);
|
||||
ztProject.setFirstEnd(ztProject.getEnd());
|
||||
ztProject.setRealBegan(ztProject.getBegin());
|
||||
ztProject.setDays(DateUtils.getbetweenDays(ztProject.getBegin(),ztProject.getEnd()));
|
||||
ztProject.setDays((dto.getDays()!=null&&dto.getDays()!=0)?dto.getDays():DateUtils.getbetweenDays(ztProject.getBegin(),ztProject.getEnd()));
|
||||
ztProject.setStatus("wait");
|
||||
ztProject.setPri("1");
|
||||
ztProject.setType(dto.getType());
|
||||
@ -129,12 +130,15 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
}
|
||||
|
||||
if("sprint".equalsIgnoreCase(ztProject.getType())){
|
||||
exection=ztProject.getId();
|
||||
type=ActionType.ZX;
|
||||
ztProject.setParent(dto.getProject());
|
||||
}
|
||||
|
||||
this.baseMapper.insert(ztProject);
|
||||
if("sprint".equalsIgnoreCase(ztProject.getType())){
|
||||
exection=ztProject.getId();
|
||||
}
|
||||
|
||||
if(ztProject.getParent()==null||ztProject.getParent()==0){
|
||||
ztProject.setPath(String.format(",%d,",ztProject.getId()));
|
||||
ztProject.setGrade(1);
|
||||
@ -834,6 +838,19 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
this.kanbanlaneService.addStory(excludeId,storyService.listByIds(storyIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> authProductList(){
|
||||
List<Integer> authList = authList();
|
||||
if(CollectionUtils.isEmpty(authList)){
|
||||
return authList;
|
||||
}
|
||||
List<ZtProduct> list = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, authList));
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return authList;
|
||||
}else{
|
||||
return list.stream().map(o->o.getId()).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> authList() {
|
||||
@ -861,7 +878,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
@Override
|
||||
public List<Integer> projectAuthList() {
|
||||
ZtUser user = userService.selectByName(RiskUserThreadLocal.get().getName());
|
||||
if(user.getAccount().equals("admin")||user.getUserType()== UserType.XMGLY){
|
||||
if(user.getAccount().equals("admin")){
|
||||
return this.baseMapper.selectList(new QueryWrapper<ZtProject>()
|
||||
.lambda().eq(ZtProject::getType,"project")).stream().map(o->o.getId()).collect(Collectors.toList());
|
||||
}
|
||||
@ -937,7 +954,9 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return this.baseMapper.selectList(new QueryWrapper<ZtProject>().lambda().in(ZtProject::getId,list.stream().map(o->o.getExecution()).collect(Collectors.toList())));
|
||||
return this.baseMapper.selectList(new QueryWrapper<ZtProject>().lambda()
|
||||
.ne(ZtProject::getStatus,"closed")
|
||||
.in(ZtProject::getId,list.stream().map(o->o.getExecution()).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1072,6 +1091,31 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
List<ZtUser> userList = this.userService.list();
|
||||
Map<String, ZtUser> uMap = userList.stream().collect(Collectors.toMap(ZtUser::getAccount, O -> O));
|
||||
|
||||
for (ZtTask t:list ) {
|
||||
if(t.getDeadline()!=null){
|
||||
t.setDeadline(DateUtils.getDayLast(t.getDeadline()));
|
||||
}
|
||||
ZtUser ztUser = uMap.get(t.getAssignedTo());
|
||||
// if(ztUser!=null){
|
||||
// t.setAssignedTo(ztUser.getNickname());
|
||||
// }
|
||||
ztUser = uMap.get(t.getOpenedby());
|
||||
if(ztUser!=null){
|
||||
t.setOpenedby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = uMap.get(t.getFinishedby());
|
||||
if(ztUser!=null){
|
||||
t.setFinishedby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = uMap.get(t.getCanceledby());
|
||||
if(ztUser!=null){
|
||||
t.setCanceledby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = uMap.get(t.getClosedby());
|
||||
if(ztUser!=null){
|
||||
t.setClosedby(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i =0;i<DateUtils.getDays(date);i++){
|
||||
Date d=DateUtils.dateAddDay(firstDayOfMonth,i);
|
||||
@ -1190,7 +1234,9 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
if(CollectionUtils.isEmpty(integers)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtProject> sprint = this.listByIds(integers);
|
||||
List<ZtProject> sprint = this.list(
|
||||
new QueryWrapper<ZtProject>().lambda().in(ZtProject::getId,integers).ne(ZtProject::getStatus,"closed")
|
||||
);
|
||||
|
||||
if(CollectionUtils.isEmpty(sprint)){
|
||||
return new ArrayList<>();
|
||||
@ -1274,6 +1320,16 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZtProjectDTO selectPrdById(Integer project) {
|
||||
return this.baseMapper.selectPrdById(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PerformanceDTO> performanceCount(Date startDate, Date endDate) {
|
||||
return this.baseMapper.performanceCount(startDate,endDate);
|
||||
}
|
||||
|
||||
|
||||
//修改项目集
|
||||
@Override
|
||||
@ -1696,7 +1752,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
for (String str:listAuth) {
|
||||
ids.add(Integer.valueOf(Arrays.asList(str.split(",")).stream().filter(o->!StringUtils.isEmpty(o)).collect(Collectors.toList()).get(0)));
|
||||
}
|
||||
Map<Integer, ZtProject> projectMap = getProjectMap(this.baseMapper.selectBatchIds(ids));
|
||||
Map<Integer, ZtProject> projectMap = getProjectMap(this.baseMapper.selectList(
|
||||
new QueryWrapper<ZtProject>().lambda().in(ZtProject::getId,ids).ne(ZtProject::getStatus,"closed")));
|
||||
List<ZtProjectDTO> ztProjectDTOS = BeanCopyUtil.copyListProperties(project, ZtProjectDTO::new);
|
||||
for (ZtProjectDTO p:ztProjectDTOS ) {
|
||||
ZtProject ztProject = projectMap.get(Integer.valueOf(Arrays.asList(p.getPath().split(",")).stream().filter(o -> !StringUtils.isEmpty(o)).collect(Collectors.toList()).get(0)));
|
||||
|
@ -56,4 +56,9 @@ public class ZtProjectstoryServiceImpl extends ServiceImpl<ZtProjectstoryMapper,
|
||||
public ZtProjectstory getProject(Integer storyId) {
|
||||
return this.baseMapper.selectOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory,storyId).eq(ZtProjectstory::getType,ProjectTypeEnums.project.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZtProjectstory> prdList(Integer id) {
|
||||
return this.baseMapper.prdList(id);
|
||||
}
|
||||
}
|
||||
|
@ -294,6 +294,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
}else{
|
||||
ztRelease.setStatus("released");
|
||||
}
|
||||
this.baseMapper.updateById(ztRelease);
|
||||
if(1==dto.getPushFlag()){
|
||||
//推送
|
||||
ZtNotice notice=new ZtNotice();
|
||||
@ -321,22 +322,32 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
throw new BusinessException("当前迭代无需求无法发布");
|
||||
}
|
||||
List<ZtStory> ztStories = storyService.listByIds(storyList);
|
||||
for (ZtStory st:ztStories) {
|
||||
if("active".equals(st.getStatus())&&"wait".equals(st.getStage())){
|
||||
continue;
|
||||
|
||||
ZtProduct product = this.productService.getById(ztRelease.getProduct());
|
||||
if(dto.getRevieweResult()==1){
|
||||
for (ZtStory st:ztStories) {
|
||||
if("active".equals(st.getStatus())&&"wait".equals(st.getStage())){
|
||||
continue;
|
||||
}
|
||||
if("closed".equals(st.getStatus())||"closed".equals(st.getStage())){
|
||||
continue;
|
||||
}
|
||||
if(!"tested".equals(st.getStage())){
|
||||
throw new BusinessException(st.getTitle()+" 当前需求无法发布,请检查");
|
||||
}
|
||||
this.storyService.releaseStory(st.getId());
|
||||
}
|
||||
if("closed".equals(st.getStatus())||"closed".equals(st.getStage())){
|
||||
continue;
|
||||
}
|
||||
if(!"tested".equals(st.getStage())){
|
||||
throw new BusinessException(st.getTitle()+" 当前需求无法发布,请检查");
|
||||
}
|
||||
this.storyService.releaseStory(st.getId());
|
||||
product.setReleases(product.getReleases()+ztStories.size());
|
||||
this.productService.updateById(product);
|
||||
|
||||
|
||||
}else{
|
||||
actionService.addAction(ActionType.FB, ActionStatus.FBSB, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
}
|
||||
|
||||
this.baseMapper.updateById(ztRelease);
|
||||
actionService.addAction(ActionType.FB, ActionStatus.FB, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -370,7 +381,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
|
||||
|
||||
for (ZtStoryDTO d : list) {
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
d.setAssignedToName(ztUser.getNickname());
|
||||
@ -451,6 +462,10 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getYsUser());
|
||||
if(ztUser!=null){
|
||||
d.setYsUserName(ztUser.getNickname());
|
||||
}
|
||||
// ZtProject ztProject = executionMapByStory.get(d.getId());
|
||||
// if(ztProject!=null){
|
||||
// d.setExecution(ztProject.getId());
|
||||
@ -483,6 +498,12 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
@Override
|
||||
@Transactional
|
||||
public void batchSyncStory(ZtReleaseQo qo) {
|
||||
ZtRelease ztRelease = this.baseMapper.selectById(qo.getId());
|
||||
//released 发不成功
|
||||
//close 发布失败
|
||||
if(Arrays.asList("released","closed").contains(ztRelease.getStatus())){
|
||||
throw new BusinessException("当前无法更新发布");
|
||||
}
|
||||
List<Integer> storyList = qo.getStoryList();
|
||||
List<ZtReleaseDetails> list = this.releaseDetailsService.list(new QueryWrapper<ZtReleaseDetails>().lambda()
|
||||
.eq(ZtReleaseDetails::getObjectType, "story")
|
||||
@ -504,7 +525,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
|
||||
releaseDetailsService.saveBatch(saveBatch);
|
||||
|
||||
ZtRelease ztRelease = this.baseMapper.selectById(qo.getId());
|
||||
|
||||
|
||||
actionService.addAction(ActionType.FB, ActionStatus.BJ, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
@ -104,21 +105,37 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
@Override
|
||||
@Transactional
|
||||
public void addFeedback(ZtStoryFeedbackDTO dto) {
|
||||
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||
String name=null;
|
||||
if(loginRiskUser!=null){
|
||||
name=loginRiskUser.getName();
|
||||
}
|
||||
ZtUser user= this.userService.getbyVxId(dto.getVx());
|
||||
if(user!=null){
|
||||
name=user.getAccount();
|
||||
}
|
||||
ZtStoryFeedback ztStoryFeedback = new ZtStoryFeedback();
|
||||
BeanUtils.copyProperties(dto,ztStoryFeedback);
|
||||
ztStoryFeedback.setOpenedBy(RiskUserThreadLocal.get().getName());
|
||||
ztStoryFeedback.setOpenedBy(name);
|
||||
ztStoryFeedback.setOpenedDate(new Date());
|
||||
ztStoryFeedback.setUpdateDate(new Date());
|
||||
ztStoryFeedback.setUpdateUser(RiskUserThreadLocal.get().getName());
|
||||
ztStoryFeedback.setStatus("wait");
|
||||
|
||||
ztStoryFeedback.setUpdateDate(new Date());
|
||||
ztStoryFeedback.setUpdateUser(name);
|
||||
if(ztStoryFeedback.getProduct()==null){
|
||||
ztStoryFeedback.setProduct(145);
|
||||
}
|
||||
if(!org.apache.commons.lang3.StringUtils.isEmpty(ztStoryFeedback.getOpenSource())&&"weixin".equals(ztStoryFeedback.getOpenSource())){
|
||||
ztStoryFeedback.setOpenSource("weixin");
|
||||
ztStoryFeedback.setStatus("reviewing");
|
||||
}else{
|
||||
ztStoryFeedback.setStatus("wait");
|
||||
}
|
||||
this.baseMapper.insert(ztStoryFeedback);
|
||||
|
||||
fileService.updateFile(dto.getFiles(),ztStoryFeedback.getId(), FileTypes.feedbackStory);
|
||||
|
||||
actionService.addAction(ActionType.WTFK, ActionStatus.XJ, dto.getId(), dto.getProduct()+"", null, null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getSpec(), "");
|
||||
RiskUserThreadLocal.get()==null?"admin":RiskUserThreadLocal.get().getName(), dto.getSpec(), "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -159,7 +176,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
|
||||
//指派
|
||||
@Override
|
||||
public void assignedTo(ZtStoryDTO dto) {
|
||||
public void assignedTo(ZtStoryFeedbackDTO dto) {
|
||||
ZtStoryFeedback ztStory = this.baseMapper.selectById(dto.getId());
|
||||
if (ztStory == null) {
|
||||
throw new BusinessException("未查询到");
|
||||
@ -169,10 +186,11 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
}
|
||||
ztStory.setAssignedTo(org.apache.commons.lang3.StringUtils.isEmpty(dto.getAssignedTo()) ? "" : dto.getAssignedTo());
|
||||
ztStory.setUpdateDate(new Date());
|
||||
ztStory.setPlanFinishDate(dto.getPlanFinishDate());
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
actionService.addAction(ActionType.WTFK, ActionStatus.FP, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedTo());
|
||||
RiskUserThreadLocal.get().getName(), "", ztStory.getAssignedTo());
|
||||
|
||||
}
|
||||
|
||||
@ -261,31 +279,36 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
|
||||
Page<ZtStoryDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda()
|
||||
.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||
.or().eq(ZtStoryFeedback::getOpenedBy, RiskUserThreadLocal.get().getName());
|
||||
if(!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSearchValue())){
|
||||
if("ALL".equals(qo.getSearchValue())){
|
||||
LambdaQueryWrapper<ZtStoryFeedback> query = new QueryWrapper<ZtStoryFeedback>().lambda();
|
||||
// .and(w->{
|
||||
// w.eq(ZtStoryFeedback::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||
// .or()
|
||||
// .eq(ZtStoryFeedback::getOpenedBy, RiskUserThreadLocal.get().getName()) ;}) ;
|
||||
|
||||
if(!org.apache.commons.lang3.StringUtils.isEmpty(qo.getSearchVal())){
|
||||
if("ALL".equals(qo.getSearchVal())){
|
||||
}
|
||||
if("ZGW".equals(qo.getSearchVal())){
|
||||
query.eq(ZtStoryFeedback::getAssignedTo,RiskUserThreadLocal.get().getName());
|
||||
}
|
||||
if("ZGW".equals(qo.getSearchValue())){
|
||||
query.eq(ZtStoryFeedback::getAssignedTo,RiskUserThreadLocal.get().getName());
|
||||
}
|
||||
if("WCJ".equals(qo.getSearchValue())){
|
||||
if("WCJ".equals(qo.getSearchVal())){
|
||||
query.eq(ZtStoryFeedback::getOpenedBy,RiskUserThreadLocal.get().getName());
|
||||
}
|
||||
if("YJJ".equals(qo.getSearchValue())){
|
||||
if("YJJ".equals(qo.getSearchVal())){
|
||||
query.eq(ZtStoryFeedback::getStatus,"finished");
|
||||
}
|
||||
if("YGB".equals(qo.getSearchValue())){
|
||||
if("YGB".equals(qo.getSearchVal())){
|
||||
query.eq(ZtStoryFeedback::getStatus, "closed");
|
||||
}
|
||||
|
||||
if("WGB".equals(qo.getSearchVal())){
|
||||
query.ne(ZtStoryFeedback::getStatus, "closed");
|
||||
}
|
||||
}else{
|
||||
query.ne(ZtStoryFeedback::getStatus, "closed");
|
||||
}
|
||||
|
||||
if(UserType.GSGC==RiskUserThreadLocal.get().getUserType()||"admin".equals(RiskUserThreadLocal.get().getName())){
|
||||
// UserType.GSGC==RiskUserThreadLocal.get().getUserType()||
|
||||
if("admin".equals(RiskUserThreadLocal.get().getName())){
|
||||
|
||||
}else {
|
||||
query.in(ZtStoryFeedback::getProduct, list.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
||||
@ -297,12 +320,81 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
query.in(ZtStoryFeedback::getId, new ArrayList<>(Arrays.asList(split)));
|
||||
}
|
||||
|
||||
List<ZtProduct> products = this.productService.selectProductByName(qo.getProductName());
|
||||
if(!CollectionUtils.isEmpty(products)){
|
||||
query.in(ZtStoryFeedback::getProduct,products.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||
}
|
||||
if(qo.getStartDate()!=null){
|
||||
query.gt(ZtStoryFeedback::getOpenedDate,qo.getStartDate());
|
||||
}
|
||||
if(qo.getEndDate()!=null){
|
||||
query.lt(ZtStoryFeedback::getOpenedDate,qo.getEndDate());
|
||||
}
|
||||
query.orderByDesc(ZtStoryFeedback::getId);
|
||||
|
||||
|
||||
|
||||
List<ZtStoryFeedback> listFeedback= this.baseMapper.selectList(
|
||||
query
|
||||
);
|
||||
return new PageInfo<ZtStoryFeedbackDTO>(BeanCopyUtil.copyListProperties(listFeedback,ZtStoryFeedbackDTO::new));
|
||||
|
||||
|
||||
List<ZtStoryFeedbackDTO> ztStoryFeedbackDTOS = BeanCopyUtil.copyListProperties(listFeedback, ZtStoryFeedbackDTO::new);
|
||||
if(!CollectionUtils.isEmpty(ztStoryFeedbackDTOS)){
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
Map<Integer,ZtProduct> pMap=this.productService.selectMapProduct();
|
||||
for (ZtStoryFeedbackDTO f:ztStoryFeedbackDTOS ) {
|
||||
ZtProduct ztProduct = pMap.get(f.getProduct());
|
||||
if(ztProduct!=null){
|
||||
f.setProductName(ztProduct.getName());
|
||||
}
|
||||
|
||||
ZtUser ztUser = userMap.get(f.getOpenedBy());
|
||||
if(ztUser!=null){
|
||||
f.setOpenedByName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(f.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
f.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return new PageInfo<>(ztStoryFeedbackDTOS);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closedFeedback(ZtStoryFeedbackDTO dto) {
|
||||
// ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
||||
// if(ztStoryFeedback==null){
|
||||
// throw new BusinessException("未查询到数据");
|
||||
// }
|
||||
// ztStoryFeedback.setStatus("closed");
|
||||
// ztStoryFeedback.setCloseRemark(dto.getCloseRemark());
|
||||
// ztStoryFeedback.setCloseDate(new Date());
|
||||
// ztStoryFeedback.setClosedBy(RiskUserThreadLocal.get().getName());
|
||||
// this.baseMapper.updateById(ztStoryFeedback);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approval(ZtStoryFeedbackDTO dto) {
|
||||
Integer approval = dto.getApproval();
|
||||
|
||||
|
||||
ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectOne(new QueryWrapper<ZtStoryFeedback>().lambda()
|
||||
.eq(ZtStoryFeedback::getBusinessId,dto.getBusinessId()));
|
||||
if(ztStoryFeedback!=null){
|
||||
if(approval==1){
|
||||
ztStoryFeedback.setStatus("wait");
|
||||
}else{
|
||||
ztStoryFeedback.setStatus("closed");
|
||||
ztStoryFeedback.setApprovalRemark(dto.getApprovalRemark());
|
||||
}
|
||||
this.baseMapper.updateById(ztStoryFeedback);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
private IZtBugService bugService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IZtModuleService moduleService;
|
||||
|
||||
@Autowired
|
||||
private IZtProjectproductService projectproductService;
|
||||
|
||||
@ -104,16 +107,15 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
userIds.addAll(list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList()));
|
||||
|
||||
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userIds);
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
|
||||
|
||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
||||
|
||||
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(list);
|
||||
|
||||
|
||||
for (ZtStoryDTO d : list) {
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||
d.setViews(rMap.get(d.getId()));
|
||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
@ -124,10 +126,27 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getYsUser());
|
||||
if(ztUser!=null){
|
||||
d.setYsUserName(ztUser.getNickname());
|
||||
}
|
||||
List<ZtProject> ztProjectList = executionMapByStory.get(d.getId());
|
||||
if(!CollectionUtils.isEmpty(ztProjectList)){
|
||||
// d.setExecution(ztProject.getId());
|
||||
d.setExecutionName(ztProjectList.stream().map(o->o.getName()).collect(Collectors.joining(",")));
|
||||
d.setExecutions(ztProjectList.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||
}
|
||||
if(!StringUtils.isEmpty(d.getReviewedby())){
|
||||
String[] split = d.getReviewedby().split(",");
|
||||
StringBuilder b=new StringBuilder();
|
||||
for (String s:split) {
|
||||
ZtUser u = userMap.get(s);
|
||||
if(u!=null){
|
||||
b.append(u.getNickname()+",");
|
||||
}
|
||||
|
||||
}
|
||||
d.setReviewedbyName(b.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,34 +187,9 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
public void addStory(ZtStoryDTO dto) {
|
||||
|
||||
|
||||
|
||||
|
||||
ZtStory s = new ZtStory();
|
||||
BeanUtils.copyProperties(dto, s);
|
||||
s.setVersion(1);
|
||||
s.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
s.setOpenedDate(new Date());
|
||||
if(!"draft".equals(dto.getStatus())){
|
||||
if(dto.getPsFlag()!=null&&dto.getPsFlag()){
|
||||
s.setStatus("active");
|
||||
}else{
|
||||
s.setStatus("reviewing");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
s.setStage("wait");
|
||||
ZtStory s = buildStory(dto);
|
||||
this.baseMapper.insert(s);
|
||||
|
||||
|
||||
|
||||
ZtStoryspec spec = new ZtStoryspec();
|
||||
spec.setStory(s.getId());
|
||||
spec.setVersion(1);
|
||||
spec.setTitle(s.getTitle());
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
ZtStoryspec spec = buildSpec(dto,s);
|
||||
storyspecService.save(spec);
|
||||
|
||||
fileService.updateFile(dto.getFiles(),s.getId(), FileTypes.story);
|
||||
@ -238,6 +232,106 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
|
||||
|
||||
if (s.getProduct() != null&&s.getProduct()!=0) {
|
||||
ZtProduct product = productService.getById(s.getProduct());
|
||||
if("draft".equals(dto.getStatus())){
|
||||
product.setDraftStories(product.getDraftStories()+1);
|
||||
}else{
|
||||
product.setReviewingStories(product.getReviewingStories() + 1);
|
||||
}
|
||||
|
||||
product.setTotalStories(product.getTotalStories() + 1);
|
||||
this.productService.updateById(product);
|
||||
}
|
||||
|
||||
List<Integer> executions = dto.getExecutions();
|
||||
if(!CollectionUtils.isEmpty(executions)){
|
||||
this.executionBindStory(s,executions);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private ZtStoryspec buildSpec(ZtStoryDTO dto, ZtStory s) {
|
||||
|
||||
ZtStoryspec spec = new ZtStoryspec();
|
||||
spec.setStory(s.getId());
|
||||
spec.setVersion(1);
|
||||
spec.setTitle(s.getTitle());
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
|
||||
return spec;
|
||||
}
|
||||
|
||||
private ZtStory buildStory(ZtStoryDTO dto) {
|
||||
ZtStory s = new ZtStory();
|
||||
BeanUtils.copyProperties(dto, s);
|
||||
s.setVersion(1);
|
||||
s.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
s.setOpenedDate(new Date());
|
||||
if(!"draft".equals(dto.getStatus())){
|
||||
if(dto.getPsFlag()!=null&&dto.getPsFlag()){
|
||||
s.setStatus("active");
|
||||
}else{
|
||||
s.setStatus("reviewing");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
s.setStage("wait");
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchAddStory(ZtStoryDTO dto) {
|
||||
ZtStory s = buildStory(dto);
|
||||
this.baseMapper.insert(s);
|
||||
ZtStoryspec spec = buildSpec(dto,s);
|
||||
storyspecService.save(spec);
|
||||
|
||||
fileService.updateFile(dto.getFiles(),s.getId(), FileTypes.story);
|
||||
|
||||
if(dto.getFeedbackId()!=null&&dto.getFeedbackId()!=0){
|
||||
ZtStoryFeedback storyFeedback = this.storyFeedbackService.getById(dto.getFeedbackId());
|
||||
if(!storyFeedback.getStatus().equals("wait")){
|
||||
throw new BusinessException("问题反馈已被处理");
|
||||
}
|
||||
storyFeedback.setStatus("doing");
|
||||
storyFeedback.setStoryId(s.getId());
|
||||
storyFeedback.setUpdateDate(new Date());
|
||||
storyFeedback.setUpdateUser(RiskUserThreadLocal.get().getName());
|
||||
this.storyFeedbackService.updateById(storyFeedback);
|
||||
}
|
||||
if(dto.getUserStory()!=null&&dto.getUserStory()!=0){
|
||||
ZtStoryUser storyUser = storyUserService.getById(dto.getUserStory());
|
||||
if(storyUser!=null&&"wait".equals(storyUser.getStatus())){
|
||||
storyUser.setStatus("active");
|
||||
storyUserService.updateById(storyUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.XJ, s.getId(), "", dto.getProduct(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getClosedreason(), "");
|
||||
|
||||
if (!CollectionUtils.isEmpty(dto.getUserViewId())) {
|
||||
for (String str : dto.getUserViewId()) {
|
||||
ZtStoryreview v = new ZtStoryreview();
|
||||
v.setStory(s.getId());
|
||||
v.setVersion(s.getVersion());
|
||||
v.setReviewer(str);
|
||||
v.setType("story");
|
||||
this.storyreviewService.save(v);
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.PS, s.getId(), s.getProduct() + "", s.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getClosedreason(), str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (s.getProduct() != null&&s.getProduct()!=0) {
|
||||
ZtProduct product = productService.getById(s.getProduct());
|
||||
@ -251,75 +345,14 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
this.productService.updateById(product);
|
||||
}
|
||||
|
||||
if (s.getProduct() == null) {
|
||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||
.eq(ZtProjectstory::getProject, s.getProject())
|
||||
);
|
||||
int order = 0;
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
ZtProjectstory ztProjectstory = list.get(list.size() - 1);
|
||||
order = ztProjectstory.getOrder() + 5;
|
||||
}
|
||||
ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||
ztProjectstory.setOrder(order);
|
||||
ztProjectstory.setStory(s.getId());
|
||||
ztProjectstory.setProject(s.getProject());
|
||||
this.projectstoryService.save(ztProjectstory);
|
||||
}
|
||||
|
||||
List<Integer> executions = dto.getExecutions();
|
||||
if(!CollectionUtils.isEmpty(executions)){
|
||||
// this.projectproductService.getOne(new QueryWrapper<>().lambda().eq());
|
||||
//拿执行的项目id
|
||||
// this.executionprojectService.getOne(new QueryWrapper<ZtExecutionproject>().lambda().eq())
|
||||
this.executionBindStory(s,executions);
|
||||
}
|
||||
|
||||
// 1.如果是产品 那么关联 项目 执行 2.如果是项目 关联执行
|
||||
// if(dto.getExecution()!=null&&dto.getExecution()!=0){
|
||||
// List<ZtProjectstory> syncList = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, s.getId())
|
||||
// .eq(ZtProjectstory::getExecution, dto.getExecution()));
|
||||
// if(CollectionUtils.isEmpty(syncList)){
|
||||
// if (s.getProduct() != null&&s.getProduct()!=0) {
|
||||
//
|
||||
// List<ZtExecutionproject> execlist = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||
// .eq(ZtExecutionproject::getExecution, dto.getExecution()));
|
||||
// if(CollectionUtils.isEmpty(execlist)){
|
||||
// List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
||||
// .lambda().eq(ZtProjectproduct::getProduct, s.getProduct()));
|
||||
// ZtProjectproduct ztProjectproduct = list.get(0);
|
||||
//
|
||||
//
|
||||
// ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||
// ztProjectstory.setOrder(1);
|
||||
// ztProjectstory.setStory(s.getId());
|
||||
// ztProjectstory.setProject(ztProjectproduct.getProject());
|
||||
// this.projectstoryService.save(ztProjectstory);
|
||||
// //添加执行
|
||||
// }else{
|
||||
//
|
||||
// ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||
// ztProjectstory.setOrder(1);
|
||||
// ztProjectstory.setStory(s.getId());
|
||||
// ztProjectstory.setProject(execlist.get(0).getProject());
|
||||
// this.projectstoryService.save(ztProjectstory);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ZtProjectDTO d=new ZtProjectDTO();
|
||||
// d.setExcludeId(dto.getExecution());
|
||||
// d.setStoryIds(new ArrayList<>(){{add(s.getId());}});
|
||||
// projectService.executionSyncStory(d);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void editStory(ZtStoryDTO dto) {
|
||||
@ -357,7 +390,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
}
|
||||
//取消关联
|
||||
executionUnBindStory(ztStory.getId(),execList);
|
||||
// executionUnBindStory(ztStory.getId(),execList);
|
||||
}
|
||||
|
||||
|
||||
@ -585,7 +618,21 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(CollectionUtils.isEmpty(closed)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return BeanCopyUtil.copyListProperties(closed,ZtStoryDTO::new);
|
||||
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(closed, ZtStoryDTO::new);
|
||||
if(!CollectionUtils.isEmpty(storyDTOList)){
|
||||
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(storyDTOList);
|
||||
for (ZtStoryDTO d:storyDTOList ) {
|
||||
List<ZtProject> ztProjectList = executionMapByStory.get(d.getId());
|
||||
if(!CollectionUtils.isEmpty(ztProjectList)){
|
||||
// d.setExecution(ztProject.getId());
|
||||
d.setExecutionName(ztProjectList.stream().map(o->o.getName()).collect(Collectors.joining(",")));
|
||||
d.setExecutions(ztProjectList.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return storyDTOList;
|
||||
}
|
||||
|
||||
|
||||
@ -612,7 +659,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
|
||||
|
||||
for (ZtStoryDTO d : list) {
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||
d.setViews(rMap.get(d.getId()));
|
||||
|
||||
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
||||
@ -631,6 +678,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getYsUser());
|
||||
if(ztUser!=null){
|
||||
d.setYsUserName(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -673,11 +724,13 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<ZtStoryDTO> execNoSyncProject(ZtProjectQo qo) {
|
||||
String execution = qo.getExecution();
|
||||
|
||||
List<ZtExecutionproject> execList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getExecution, execution));
|
||||
List<ZtExecutionproject> execList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||
.eq(ZtExecutionproject::getExecution, execution));
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(execList)){
|
||||
@ -805,11 +858,26 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(id==null||id==0){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZtStory ztStory = this.baseMapper.selectById(id);
|
||||
if(ztStory==null){
|
||||
throw new BusinessException("未查询到需求");
|
||||
}
|
||||
if(!Arrays.asList("wait","projected","developing").contains(ztStory.getStage())){
|
||||
|
||||
List<ZtTask> taskList = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, id)
|
||||
.in(ZtTask::getStatus, Arrays.asList("wait", "doing", "pause"))
|
||||
.eq(ZtTask::getType,"devel")
|
||||
);
|
||||
//任务没有做完
|
||||
if(!CollectionUtils.isEmpty(taskList)){
|
||||
return;
|
||||
}
|
||||
//developed 研发完毕 testing 测试中 tested测试完毕 released已发布 verified已验收 closed
|
||||
if( Arrays.asList("developed","tested","released","verified","closed").contains(ztStory.getStage())){
|
||||
return;
|
||||
}
|
||||
if("testing".equals(ztStory.getStage())){
|
||||
List<ZtTask> list = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, id)
|
||||
.in(ZtTask::getStatus, Arrays.asList("wait", "doing", "pause"))
|
||||
@ -828,20 +896,14 @@ 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, "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
List<ZtTask> list = taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, id)
|
||||
.in(ZtTask::getStatus, Arrays.asList("wait", "doing", "pause"))
|
||||
.eq(ZtTask::getType,"devel")
|
||||
);
|
||||
if(Arrays.asList("wait").contains(ztStory.getStage())){
|
||||
|
||||
if(Arrays.asList("wait").contains(ztStory.getStage())&&!CollectionUtils.isEmpty(taskList)){
|
||||
this.startStory(id);
|
||||
return ;
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ztStory.setStage("developed");
|
||||
this.baseMapper.updateById(ztStory);
|
||||
List<Integer> executionId = this.getExecutionId(ztStory);
|
||||
@ -884,7 +946,8 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
.in(ZtTask::getType,"test","devel")
|
||||
);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
if("developed".equals(ztStory.getStage())){
|
||||
|
||||
if(Arrays.asList("wait","projected","developing","developed").contains(ztStory.getStage())){
|
||||
this.testingStory(story);
|
||||
}
|
||||
return;
|
||||
@ -981,7 +1044,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
|
||||
}
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.FB, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), execIds.get(0),
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.FBCG, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), execIds.get(0),
|
||||
RiskUserThreadLocal.get().getName(), null, "");
|
||||
}
|
||||
|
||||
@ -1060,6 +1123,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if("closed".equals(ztStory.getStatus())){
|
||||
throw new BusinessException("当前已关闭");
|
||||
}
|
||||
ztStory.setStatus("active");
|
||||
List<Integer> execIds = getExecutionId(ztStory);
|
||||
if(CollectionUtils.isEmpty(execIds)&&!"closed".equalsIgnoreCase(dto.getStage())){
|
||||
throw new BusinessException("当前无迭代,不可以更改");
|
||||
@ -1087,7 +1151,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
if("released".equals(newStatus)&&ztStory.getEndDate()==null){
|
||||
ztStory.setEndDate(new Date());
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.FB, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.FBCG, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), null, "");
|
||||
}
|
||||
if("developing".equals(newStatus)&&ztStory.getStartDate()==null){
|
||||
@ -1095,6 +1159,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.KS, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), null, "");
|
||||
}
|
||||
if("verified".equals(newStatus)){
|
||||
ztStory.setStatus("finished");
|
||||
}
|
||||
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
for (Integer execId : execIds) {
|
||||
@ -1137,7 +1205,28 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
@Override
|
||||
@Transactional
|
||||
public void changeExecution(ZtStoryDTO dto) {
|
||||
// List<Integer> idList = dto.getIdList();
|
||||
|
||||
|
||||
|
||||
|
||||
List<Integer> idList = dto.getIdList();
|
||||
if(CollectionUtils.isEmpty(idList)){
|
||||
throw new BusinessException("请选择");
|
||||
}
|
||||
List<ZtStory> storyList = this.listByIds(idList);
|
||||
|
||||
|
||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||
.eq(ZtProjectstory::getProject, dto.getExecution()).in(ZtProjectstory::getStory, idList).eq(ZtProjectstory::getType,"execution"));
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
throw new BusinessException("需求 "+list.get(0).getStory()+" 已关联");
|
||||
}
|
||||
|
||||
for (ZtStory s:storyList) {
|
||||
executionBindStory(s,new ArrayList<>(Arrays.asList(dto.getExecution())));
|
||||
}
|
||||
|
||||
|
||||
// for (Integer i : idList) {
|
||||
// ZtStory ztStory = this.baseMapper.selectById(i);
|
||||
// if("closed".equals(ztStory.getStatus())){
|
||||
@ -1212,41 +1301,38 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
|
||||
//首页根据id查询的
|
||||
if(!StringUtils.isEmpty(qo.getIds())){
|
||||
// page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
String[] split = qo.getIds().split(",");
|
||||
List<String> ids =new ArrayList<>(Arrays.asList(split));
|
||||
list=this.baseMapper.storyPageListByIds(ids);
|
||||
}else{
|
||||
qo.setObjIds(ids);
|
||||
// list=this.baseMapper.storyPageListByIds(ids);
|
||||
}
|
||||
// else{
|
||||
if(UserType.KFZ==loginRiskUser.getUserType()||UserType.CS==loginRiskUser.getUserType()){
|
||||
|
||||
page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
qo.setKfz(1);
|
||||
list=this.baseMapper.projectStoryPageList(qo);
|
||||
}else if(UserType.GSGC==loginRiskUser.getUserType()){
|
||||
//全部
|
||||
page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
list=this.baseMapper.allStoryPageList(qo);
|
||||
}else{
|
||||
}
|
||||
// else if(UserType.GSGC==loginRiskUser.getUserType()){
|
||||
// //全部
|
||||
// page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
// list=this.baseMapper.allStoryPageList(qo);
|
||||
// }
|
||||
else{
|
||||
//自己有权限的 产品集
|
||||
List<Integer> integers = this.projectService.authList();
|
||||
List<Integer> integers = this.projectService.authProductList();
|
||||
|
||||
if(!CollectionUtils.isEmpty(integers)){
|
||||
List<ZtProduct> pList = this.productService.list(new QueryWrapper<ZtProduct>().lambda().in(ZtProduct::getProgram, integers));
|
||||
//所有的产品
|
||||
if(!CollectionUtils.isEmpty(pList)){
|
||||
qo.setProductIds(pList.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||
qo.setProductIds(integers);
|
||||
page= PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
list=this.baseMapper.myStoryPageList(qo);
|
||||
}else{
|
||||
list=new ArrayList<>();
|
||||
}
|
||||
|
||||
}else{
|
||||
list=new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1265,7 +1351,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
|
||||
|
||||
for (ZtStoryDTO d : list) {
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||
d.setViews(rMap.get(d.getId()));
|
||||
List<ZtProject> ztProjectList = execMap.get(d.getId());
|
||||
if(!CollectionUtils.isEmpty(ztProjectList)){
|
||||
@ -1280,6 +1366,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getYsUser());
|
||||
if(ztUser!=null){
|
||||
d.setYsUserName(ztUser.getNickname());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1350,6 +1440,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
ProductStoryStatus oldPStatus = getProductStatus(status);
|
||||
this.productService.productChangeStatus(ztStory.getProduct(), oldPStatus, ProductStoryStatus.GB);
|
||||
}
|
||||
this.closeTaskBug(ztStory.getId());
|
||||
|
||||
}
|
||||
|
||||
@ -1421,24 +1512,48 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
//验收
|
||||
@Override
|
||||
@Transactional
|
||||
public void storyYs(ZtStoryDTO dto) {
|
||||
ZtStory ztStory = this.baseMapper.selectById(dto.getId());
|
||||
if("closed".equals(ztStory.getStatus())){
|
||||
throw new BusinessException("当前已关闭");
|
||||
}
|
||||
|
||||
String stage = ztStory.getStage();
|
||||
if(!"verified".equals(stage)){
|
||||
ZtProduct product = this.productService.getById(ztStory.getProduct());
|
||||
|
||||
product.setYss(product.getYss()+1);
|
||||
product.setReleases(product.getReleases()-1);
|
||||
this.productService.updateById(product);
|
||||
}
|
||||
|
||||
//已发布
|
||||
Integer revieweResult = dto.getRevieweResult();
|
||||
ztStory.setStage("verified");
|
||||
ztStory.setYsFlag(revieweResult);
|
||||
ztStory.setYsRemark(dto.getDesc());
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
ActionStatus status;
|
||||
if(revieweResult==1){
|
||||
status=ActionStatus.YSTG;
|
||||
//如果研发需求验收完毕 那么用户需求也需要变更
|
||||
if(ztStory.getUserStory()!=null&&ztStory.getUserStory()!=0){
|
||||
List<ZtStory> storyList = this.baseMapper.selectList(new QueryWrapper<ZtStory>().lambda()
|
||||
.ne(ZtStory::getId,ztStory.getId())
|
||||
.in(ZtStory::getStage,"wait","projected","developing","developed","testing","tested","released")
|
||||
.eq(ZtStory::getUserStory, ztStory.getUserStory()));
|
||||
if(CollectionUtils.isEmpty(storyList)){
|
||||
ZtStoryUser ztStoryUser = this.storyUserService.getById(ztStory.getUserStory());
|
||||
ztStoryUser.setStatus("finished");
|
||||
this.storyUserService.updateById(ztStoryUser);
|
||||
}
|
||||
}
|
||||
ztStory.setStatus("finished");
|
||||
}else{
|
||||
status=ActionStatus.YSBTG;
|
||||
}
|
||||
|
||||
this.baseMapper.updateById(ztStory);
|
||||
//添加action
|
||||
actionService.addAction(ActionType.XQ, status, ztStory.getId(), ztStory.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getDesc(), ztStory.getAssignedTo());
|
||||
@ -1481,13 +1596,28 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
userIds.add(ztStory.getAssignedTo());
|
||||
userIds.add(ztStory.getOpenedby());
|
||||
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userIds);
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
|
||||
|
||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(Arrays.asList(d));
|
||||
|
||||
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
// d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
|
||||
|
||||
if(!StringUtils.isEmpty(d.getReviewedby())){
|
||||
String[] split = d.getReviewedby().split(",");
|
||||
StringBuilder b=new StringBuilder();
|
||||
for (String s:split) {
|
||||
ZtUser u = userMap.get(s);
|
||||
if(u!=null){
|
||||
b.append(u.getNickname()+",");
|
||||
}
|
||||
|
||||
}
|
||||
d.setReviewedbyName(b.toString());
|
||||
}
|
||||
|
||||
d.setViews(rMap.get(d.getId()));
|
||||
ZtUser ztUser = userMap.get(d.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
@ -1498,7 +1628,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
ztUser = userMap.get(d.getYsUser());
|
||||
if(ztUser!=null){
|
||||
d.setYsUserName(ztUser.getNickname());
|
||||
}
|
||||
ZtStoryspec storyspec = this.storyspecService.getOne(new QueryWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory, d.getId()));
|
||||
|
||||
if(storyspec!=null){
|
||||
@ -1507,6 +1640,31 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
d.setSpec(storyspec.getSpec());
|
||||
d.setVerify(storyspec.getVerify());
|
||||
}
|
||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, d.getId()).eq(ZtProjectstory::getType, ProjectTypeEnums.execution.getValue()));
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
d.setExecutions(list.stream().map(o->o.getProject()).collect(Collectors.toList()));
|
||||
}
|
||||
Integer userStory = d.getUserStory();
|
||||
if(userStory!=null&&userStory!=0){
|
||||
ZtStoryUser storyUser = this.storyUserService.getById(userStory);
|
||||
if(storyUser!=null){
|
||||
d.setUserStoryName(storyUser.getTitle());
|
||||
}
|
||||
}
|
||||
if(d.getParent()!=null&&d.getParent()!=0){
|
||||
ZtStory pStory = this.getById(d.getParent());
|
||||
if(pStory!=null){
|
||||
d.setParentName(pStory.getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
if(d.getModule()!=null&&d.getModule()!=0){
|
||||
ZtModule ztModule = this.moduleService.getById(d.getModule());
|
||||
if(ztModule!=null){
|
||||
d.setModuleName(ztModule.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
@ -1522,7 +1680,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
return this.projectService.listByIds(list.stream().map(o->o.getExecution()).collect(Collectors.toList()));
|
||||
|
||||
return this.projectService.list(new QueryWrapper<ZtProject>().lambda().in(ZtProject::getId,list.stream().map(o->o.getExecution()).collect(Collectors.toList()))
|
||||
.ne(ZtProject::getStatus,"closed").orderByDesc(ZtProject::getId)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1664,7 +1825,9 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtStory> ztStories = IZtStoryService.listByIds(list.stream().map(o -> o.getStory()).collect(Collectors.toList()));
|
||||
List<ZtStory> ztStories = IZtStoryService.list(
|
||||
new QueryWrapper<ZtStory>().lambda().in(ZtStory::getId,list.stream().map(o -> o.getStory()).collect(Collectors.toList()))
|
||||
.ne(ZtStory::getStatus,"closed"));
|
||||
|
||||
List<ZtStoryDTO> storyList = BeanCopyUtil.copyListProperties(ztStories, ZtStoryDTO::new);
|
||||
|
||||
|
@ -19,10 +19,7 @@ import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.Constant;
|
||||
import com.sa.zentao.utils.DateUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.CronExpression;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -61,6 +58,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
@Autowired
|
||||
private IZtFileService fileService;
|
||||
|
||||
@Autowired
|
||||
private IZtProjectService projectService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void addStory(ZtStoryUserDTO dto) {
|
||||
@ -92,7 +92,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
v.setReviewer(str);
|
||||
v.setType("userStory");
|
||||
this.storyreviewService.save(v);
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.PS, s.getId(), s.getProduct() + "", s.getProject(), null,
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.PS, s.getId(), s.getProduct() + "", s.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getClosedreason(), str);
|
||||
}
|
||||
|
||||
@ -107,6 +107,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
Integer id = dto.getId();
|
||||
ZtStoryUser ztStory = this.baseMapper.selectById(id);
|
||||
|
||||
String storyStatus = ztStory.getStatus();
|
||||
|
||||
|
||||
if(ztStory.getStatus().equals("closed")||ztStory.getStatus().equals("finished")){
|
||||
throw new BusinessException("当前状态无法更改");
|
||||
}
|
||||
@ -114,12 +117,24 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
if("closed".equals(ztStory.getStatus())){
|
||||
throw new BusinessException("当前已关闭");
|
||||
}
|
||||
String status = ztStory.getStatus();
|
||||
|
||||
|
||||
BeanUtils.copyProperties(dto, ztStory);
|
||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
ztStory.setLastediteddate(new Date());
|
||||
if("draft".equals(dto.getStatus())){
|
||||
ztStory.setStatus("reviewing");
|
||||
if(!"active".equals(storyStatus)){
|
||||
if("draft".equals(dto.getStatus())){
|
||||
ztStory.setStatus("draft");
|
||||
}else{
|
||||
if("draft".equals(status)){
|
||||
ztStory.setStatus("reviewing");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ztStory.setStatus("active");
|
||||
}
|
||||
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
fileService.updateFile(dto.getFiles(),ztStory.getId(), FileTypes.userStory);
|
||||
@ -131,7 +146,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
@Override
|
||||
public PageInfo<ZtStoryUserDTO> pageList(StoryQo qo) {
|
||||
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
|
||||
|
||||
qo.setUserName(RiskUserThreadLocal.get().getName());
|
||||
|
||||
@ -139,7 +154,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
String[] split = qo.getIds().split(",");
|
||||
qo.setStoryIds(new ArrayList<>(Arrays.asList(split)));
|
||||
}
|
||||
|
||||
List<Integer> integers = this.projectService.authProductList();
|
||||
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
qo.setProductIds(integers);
|
||||
List<ZtStoryUserDTO> list = this.baseMapper.pageList(qo);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
|
||||
@ -148,7 +165,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
userIds.addAll(list.stream().map(o -> o.getLasteditedby()).collect(Collectors.toList()));
|
||||
|
||||
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userIds);
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
|
||||
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
|
||||
|
||||
@ -156,18 +173,35 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
for (ZtStoryUserDTO d : list) {
|
||||
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", " "));
|
||||
if(!StringUtils.isEmpty(d.getReviewedby())){
|
||||
String[] split = d.getReviewedby().split(",");
|
||||
StringBuilder b=new StringBuilder();
|
||||
for (String s:split) {
|
||||
ZtUser u = userMap.get(s);
|
||||
if(u!=null){
|
||||
b.append(u.getNickname()+",");
|
||||
}
|
||||
|
||||
}
|
||||
d.setReviewedbyName(b.toString());
|
||||
}
|
||||
|
||||
d.setRevieweUser(d.getReviewedby().replaceAll(",", ""));
|
||||
d.setViews(rMap.get(d.getId()));
|
||||
|
||||
ZtUser ztUser = userMap.get(d.getOpenedby());
|
||||
if(ztUser!=null){
|
||||
d.setOpenedby(ztUser.getNickname());
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
ztUser = userMap.get(d.getLasteditedby());
|
||||
if(ztUser!=null){
|
||||
d.setLasteditedby(ztUser.getNickname());
|
||||
}
|
||||
ztUser = userMap.get(d.getOpenedby());
|
||||
if(ztUser!=null){
|
||||
d.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
List<ZtStory> ztStories = storyUserMap.get(d.getId());
|
||||
if(!CollectionUtils.isEmpty(ztStories)){
|
||||
d.setStoryList(ztStories.stream().map(o->o.getTitle()).collect(Collectors.joining(",")));
|
||||
@ -183,9 +217,12 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
@Transactional
|
||||
public void changeStatus(ZtStoryUserDTO dto) {
|
||||
ZtStoryUser ztStoryUser = this.baseMapper.selectById(dto.getId());
|
||||
if(ztStoryUser==null||ztStoryUser.getStatus().equals("closed")||ztStoryUser.getStatus().equals("finished")){
|
||||
throw new BusinessException("当前状态无法更改");
|
||||
if(!"closed".equals(dto.getStatus())){
|
||||
if(ztStoryUser==null||ztStoryUser.getStatus().equals("reviewing")||ztStoryUser.getStatus().equals("closed")||ztStoryUser.getStatus().equals("finished")){
|
||||
throw new BusinessException("当前状态无法更改");
|
||||
}
|
||||
}
|
||||
|
||||
ztStoryUser.setLastediteddate(new Date());
|
||||
ztStoryUser.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
ztStoryUser.setStatus(dto.getStatus());
|
||||
@ -210,7 +247,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userReview(ZtStoryDTO dto) {
|
||||
@Transactional
|
||||
public ZtStoryUserDTO userReview(ZtStoryDTO dto) {
|
||||
ZtStoryUser ztStory = this.baseMapper.selectById(dto.getId());
|
||||
if("closed".equals(ztStory.getStatus())){
|
||||
throw new BusinessException("当前已关闭");
|
||||
@ -231,7 +269,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
lambda.set(ZtStoryreview::getResult, "pass");
|
||||
actionStatus=ActionStatus.PSTG;
|
||||
} else if (dto.getRevieweResult() == 2) {
|
||||
lambda.set(ZtStoryreview::getResult, "reject");
|
||||
// lambda.set(ZtStoryreview::getResult, "reject");
|
||||
actionStatus=ActionStatus.PSYDMQ;
|
||||
} else {
|
||||
lambda.set(ZtStoryreview::getResult, "reject");
|
||||
@ -253,7 +291,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
//end
|
||||
List<ZtStoryreview> rejectList = list.stream().filter(o -> "reject".equalsIgnoreCase(o.getResult())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(rejectList)) {
|
||||
ztStory.setStatus("closed");
|
||||
|
||||
} else {
|
||||
ztStory.setStatus("active");
|
||||
ztStory.setStage("wait");
|
||||
@ -262,9 +300,12 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
);
|
||||
}
|
||||
}
|
||||
if (dto.getRevieweResult() == 2 || dto.getRevieweResult() == 0) {
|
||||
if (dto.getRevieweResult() == 0) {
|
||||
ztStory.setStatus("closed");
|
||||
ztStory.setStage("closed");
|
||||
ztStory.setClosedreason(dto.getClosedreason());
|
||||
}else if(dto.getRevieweResult() == 2 ){
|
||||
ztStory.setStatus("draft");
|
||||
}
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
@ -289,6 +330,101 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
// }
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IZtModuleService moduleService;
|
||||
@Override
|
||||
public ZtStoryUserDTO getUserStoryById(ZtStoryDTO d) {
|
||||
ZtStoryUser ztStoryUser = this.baseMapper.selectById(d.getId());
|
||||
ZtStoryUserDTO dto=new ZtStoryUserDTO();
|
||||
BeanUtils.copyProperties(ztStoryUser,dto);
|
||||
|
||||
if(ztStoryUser.getProduct()!=null&&ztStoryUser.getProduct()!=0){
|
||||
ZtProduct product = this.productService.getById(ztStoryUser.getProduct());
|
||||
dto.setProductName(product.getName());
|
||||
}
|
||||
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||
String openedby = dto.getOpenedby();
|
||||
ZtUser ztUser = userMap.get(openedby);
|
||||
if(ztUser!=null){
|
||||
dto.setOpenedbyName(ztUser.getNickname());
|
||||
}
|
||||
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(",")));
|
||||
}
|
||||
if(!StringUtils.isEmpty(dto.getReviewedby())){
|
||||
String[] split = dto.getReviewedby().split(",");
|
||||
StringBuilder b=new StringBuilder();
|
||||
for (String s:split) {
|
||||
|
||||
ZtUser u = userMap.get(s);
|
||||
if(u!=null){
|
||||
b.append(u.getNickname()+",");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(dto.getParent()!=null&&dto.getParent()!=0){
|
||||
ZtStoryUser pStory = this.getById(dto.getParent());
|
||||
if(pStory!=null){
|
||||
dto.setParentName(pStory.getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
if(dto.getModule()!=null&&dto.getModule()!=0){
|
||||
ZtModule ztModule = this.moduleService.getById(dto.getModule());
|
||||
if(ztModule!=null){
|
||||
dto.setModuleName(ztModule.getName());
|
||||
}
|
||||
}
|
||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(Arrays.asList(dto));
|
||||
|
||||
if(!StringUtils.isEmpty(d.getReviewedby())){
|
||||
String[] split = d.getReviewedby().split(",");
|
||||
StringBuilder b=new StringBuilder();
|
||||
for (String s:split) {
|
||||
ZtUser u = userMap.get(s);
|
||||
if(u!=null){
|
||||
b.append(u.getNickname()+",");
|
||||
}
|
||||
|
||||
}
|
||||
dto.setReviewedbyName(b.toString());
|
||||
}
|
||||
dto.setViews(rMap.get(d.getId()));
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRemark(ZtStoryDTO dto) {
|
||||
ZtStoryUser ztStory = this.baseMapper.selectById(dto.getId());
|
||||
if(ztStory==null){
|
||||
throw new BusinessException("未查询到");
|
||||
}
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.TJBZ, dto.getId(), ztStory.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getRemark(), "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closedStory(ZtStoryUserDTO dto) {
|
||||
String closedreason = dto.getClosedreason();
|
||||
ZtStoryUser ztStoryUser = this.baseMapper.selectById(dto.getId());
|
||||
if(ztStoryUser==null||ztStoryUser.getStatus().equals("closed")){
|
||||
throw new BusinessException("当前未查询到或已关闭");
|
||||
}
|
||||
ztStoryUser.setClosedreason(closedreason);
|
||||
ztStoryUser.setClosedby(RiskUserThreadLocal.get().getName());
|
||||
ztStoryUser.setCloseddate(new Date());
|
||||
ztStoryUser.setStatus("closed");
|
||||
this.baseMapper.updateById(ztStoryUser);
|
||||
|
||||
actionService.addAction(ActionType.XQ, ActionStatus.GB, dto.getId(), ztStoryUser.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(),"关闭原因:"+closedreason+"\r\n 关闭备注: " +dto.getRemark(), "");
|
||||
|
||||
}
|
||||
|
||||
private Map<Integer, List<ZtStory>> getStoryUserMap(List<ZtStoryUserDTO> list) {
|
||||
|
@ -9,16 +9,14 @@ import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.*;
|
||||
import com.sa.zentao.entity.*;
|
||||
import com.sa.zentao.enums.ActionStatus;
|
||||
import com.sa.zentao.enums.ActionType;
|
||||
import com.sa.zentao.enums.FileTypes;
|
||||
import com.sa.zentao.enums.UserType;
|
||||
import com.sa.zentao.enums.*;
|
||||
import com.sa.zentao.mapper.ZtTaskMapper;
|
||||
import com.sa.zentao.qo.KanbanQo;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.DateUtils;
|
||||
import com.sa.zentao.utils.KanBanConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -92,7 +90,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
task.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
|
||||
if(task.getDeadline()!=null){
|
||||
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
|
||||
actionService.addAction(ActionType.RW, ActionStatus.FP,ztTask.getId()
|
||||
,projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),ztTask.getExecution(),
|
||||
RiskUserThreadLocal.get().getName(),null,null);
|
||||
RiskUserThreadLocal.get().getName(),null,dto.getAssignedTo());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -209,13 +209,21 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
if(ztTask==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
|
||||
ZtTaskDTO dto=new ZtTaskDTO();
|
||||
BeanUtils.copyProperties(ztTask,dto);
|
||||
if(ztTask.getExecution()!=null&&ztTask.getExecution()!=0){
|
||||
ZtProject project = this.ztProjectService.getById(ztTask.getExecution());
|
||||
dto.setImplementId(project.getId());
|
||||
dto.setImplementName(project.getName());
|
||||
|
||||
}
|
||||
if(dto.getDeadline()!=null){
|
||||
dto.setDeadline(DateUtils.getDayLast(ztTask.getDeadline()));
|
||||
}
|
||||
ZtUser ztUser = userMap.get(ztTask.getAssignedTo());
|
||||
if(ztUser!=null){
|
||||
dto.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
return dto;
|
||||
@ -264,6 +272,19 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
String[] split = qo.getIds().split(",");
|
||||
qo.setObjIds(new ArrayList<>(Arrays.asList(split)));
|
||||
}
|
||||
if(!StringUtils.isEmpty(qo.getProductName())){
|
||||
List<ZtProduct> pList = this.productService.selectProductByName(qo.getProductName());
|
||||
if(!CollectionUtils.isEmpty(pList)){
|
||||
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
||||
.lambda().in(ZtProjectproduct::getProduct, pList.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new PageInfo<>();
|
||||
}else{
|
||||
qo.setProjectList(list.stream().map(o->o.getProject()).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<ZtTaskDTO> list = this.baseMapper.taskPageList(qo);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
@ -280,7 +301,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
if(ztUser!=null){
|
||||
task.setAssignedToName(ztUser.getNickname());
|
||||
}
|
||||
|
||||
if(task.getDeadline()!=null){
|
||||
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -304,6 +327,15 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
ztTask.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
ztTask.setOpeneddate(new Date());
|
||||
ztTask.setEstimate(dto.getLeft());
|
||||
Integer project = ztTask.getProject();
|
||||
ZtProjectproduct ztProjectproduct = this.projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||
.eq(ZtProjectproduct::getProject, project));
|
||||
if(ztProjectproduct!=null){
|
||||
ztTask.setProduct(ztProjectproduct.getProduct());
|
||||
}
|
||||
|
||||
|
||||
|
||||
//getExecution()执行
|
||||
//项目
|
||||
Integer story = ztTask.getStory();
|
||||
@ -520,7 +552,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
ztTask.setConsumed(dto.getConsumed()+ztTask.getConsumed());
|
||||
ztTask.setLeft(0f);
|
||||
ztTask.setLeft(ztTask.getEstimate()-ztTask.getConsumed());
|
||||
ztTask.setStatus("done");
|
||||
ztTask.setRealstarted(dto.getRealstarted());
|
||||
ztTask.setFinishedby(RiskUserThreadLocal.get().getName());
|
||||
@ -694,47 +726,72 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
@Override
|
||||
@Transactional
|
||||
public void batchAddTask(ZtTaskDTO dto) {
|
||||
throw new BusinessException("已弃用");
|
||||
// if(CollectionUtils.isEmpty(dto.getList())){
|
||||
// throw new BusinessException("请检查数据");
|
||||
// }
|
||||
// long count = dto.getList().stream().filter(o -> StringUtils.isEmpty(o.getName())).count();
|
||||
// if(count>0){
|
||||
// throw new BusinessException("请检查数据");
|
||||
// }
|
||||
//
|
||||
// Integer storyId = dto.getList().get(0).getStory();
|
||||
// ZtProjectstory projectstory = projectstoryService.getOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, storyId)
|
||||
// .ne(ZtProjectstory::getProject, 0)
|
||||
// );
|
||||
//
|
||||
//
|
||||
// List<ZtTaskDTO> list = dto.getList();
|
||||
// List<ZtTask> saveList =new ArrayList();
|
||||
// for (ZtTaskDTO d:list) {
|
||||
// ZtTask ztTask = new ZtTask();
|
||||
//
|
||||
// BeanUtils.copyProperties(d,ztTask);
|
||||
// ztTask.setProject(projectstory.getProject());
|
||||
// ztTask.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
// ztTask.setOpeneddate(new Date());
|
||||
// ztTask.setStatus("reviewing");
|
||||
// if(ztTask.getDeadline()!=null){
|
||||
// ztTask.setDeadlineTime(ztTask.getDeadline().getTime()/1000);
|
||||
// }
|
||||
// saveList.add(ztTask);
|
||||
// }
|
||||
// this.saveBatch(saveList);
|
||||
//
|
||||
// kanbanlaneService.addTask( list.get(0).getExecution(),saveList);
|
||||
// ZtStory story = storyService.getById(list.get(0).getStory());
|
||||
// for (ZtTask t:saveList) {
|
||||
//
|
||||
// ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, story.getProject()));
|
||||
//
|
||||
// actionService.addAction(ActionType.RW, ActionStatus.XJ,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
||||
// RiskUserThreadLocal.get().getName(),dto.getDesc(),null);
|
||||
// }
|
||||
if(CollectionUtils.isEmpty(dto.getList())){
|
||||
throw new BusinessException("请检查数据");
|
||||
}
|
||||
long count = dto.getList().stream().filter(o -> StringUtils.isEmpty(o.getName())).count();
|
||||
if(count>0){
|
||||
throw new BusinessException("请检查数据");
|
||||
}
|
||||
|
||||
|
||||
Integer storyId = dto.getList().get(0).getStory();
|
||||
ZtProjectstory projectstory = projectstoryService.getOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, storyId)
|
||||
.eq(ZtProjectstory::getType,ProjectTypeEnums.project.getValue())
|
||||
);
|
||||
|
||||
// //如果是开发人员 需要评审
|
||||
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||
|
||||
List<ZtTaskDTO> list = dto.getList();
|
||||
List<ZtTask> saveList =new ArrayList();
|
||||
for (ZtTaskDTO d:list) {
|
||||
if(d.getEstimate()==null){
|
||||
throw new BusinessException("请检查工时");
|
||||
}
|
||||
ZtTask ztTask = new ZtTask();
|
||||
|
||||
BeanUtils.copyProperties(d,ztTask);
|
||||
ztTask.setProject(projectstory.getProject());
|
||||
ztTask.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
ztTask.setOpeneddate(new Date());
|
||||
if(userType==UserType.KFZ){
|
||||
ZtProject ztProject = this.ztProjectService.getById(ztTask.getExecution());
|
||||
ztTask.setStatus("reviewing");
|
||||
ztTask.setReviewingUser(ztProject.getPm());
|
||||
}else{
|
||||
ztTask.setStatus("wait");
|
||||
ztTask.setReviewingUser(null);
|
||||
}
|
||||
ztTask.setLeft(ztTask.getEstimate());
|
||||
ztTask.setConsumed(0f);
|
||||
if(ztTask.getDeadline()!=null){
|
||||
ztTask.setDeadlineTime(ztTask.getDeadline().getTime()/1000);
|
||||
}
|
||||
Integer project = ztTask.getProject();
|
||||
ZtProjectproduct ztProjectproduct = this.projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||
.eq(ZtProjectproduct::getProject, project));
|
||||
if(ztProjectproduct!=null){
|
||||
ztTask.setProduct(ztProjectproduct.getProduct());
|
||||
}
|
||||
saveList.add(ztTask);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.saveBatch(saveList);
|
||||
|
||||
kanbanlaneService.addTask( list.get(0).getExecution(),saveList);
|
||||
ZtStory story = storyService.getById(list.get(0).getStory());
|
||||
ZtProjectstory projectStory = this.projectstoryService.getOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, story.getId()).eq(ZtProjectstory::getType, ProjectTypeEnums.project.getValue()));
|
||||
|
||||
for (ZtTask t:saveList) {
|
||||
|
||||
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, projectStory.getProject()));
|
||||
|
||||
actionService.addAction(ActionType.RW, ActionStatus.XJ,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
||||
RiskUserThreadLocal.get().getName(),dto.getDesc(),null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -205,6 +205,18 @@ public class ZtUserServiceImpl extends ServiceImpl<ZtUserMapper, ZtUser> impleme
|
||||
return this.baseMapper.selectPrdByName(userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZtUser getbyVxId(String vx) {
|
||||
if(StringUtils.isEmpty(vx)){
|
||||
return null;
|
||||
}
|
||||
List<ZtUser> ztUsers = this.baseMapper.selectList(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getVx, vx));
|
||||
if(CollectionUtils.isEmpty(ztUsers)){
|
||||
return null;
|
||||
}
|
||||
return ztUsers.get(0);
|
||||
}
|
||||
|
||||
public boolean sendSms(String phoneNumber, String verificationCode) {
|
||||
try {
|
||||
// 初始化腾讯云短信服务客户端
|
||||
|
@ -141,17 +141,20 @@ public class ZtYwTaskServiceImpl extends ServiceImpl<ZtYwTaskMapper, ZtYwTask> i
|
||||
String mail = t.getMail();
|
||||
if(t.getTaskRemindDate().getTime()<(System.currentTimeMillis()+1000)){
|
||||
try {
|
||||
String content ="<body contenteditable=\"true\" accesskey=\"q\" aria-label=\"正文\" style=\"padding: 2px 4px 0px;\"><div>${userName}:</div><div><div><br></div><div> 任务描述:${remark}。</div><div><br></div><div> 任务开始时间:${date1}。</div><div> 任务截止时间:${date2}。</div><div><br></div><div> 请及时开启和完成该项工作,并登录IT工作台提交交付物。</div><div><br></div><div> Best Regards.</div></div><div> </div></body>";
|
||||
String content="<body contenteditable=\"true\" accesskey=\"q\" aria-label=\"正文\" style=\"padding: 2px 4px 0px;\"><div>${userName}:</div><div><div><br></div><div> 任务名称:${name}。</div><div> 任务等级:${level}。</div><div> 任务描述:${remark}。</div><div><br></div><div> 任务开始时间:${date1}。</div><div> 任务截止时间:${date2}。</div><div><br></div><div> 请及时开启和完成该项工作,并登录IT工作台提交交付物。</div><div><br></div><div> Best Regards.</div></div><div> </div></body>\n";
|
||||
// String content ="<body contenteditable=\"true\" accesskey=\"q\" aria-label=\"正文\" style=\"padding: 2px 4px 0px;\"><div>${userName}:</div><div><div><br></div><div> 任务描述:${remark}。</div><div><br></div><div> 任务开始时间:${date1}。</div><div> 任务截止时间:${date2}。</div><div><br></div><div> 请及时开启和完成该项工作,并登录IT工作台提交交付物。</div><div><br></div><div> Best Regards.</div></div><div> </div></body>";
|
||||
|
||||
content=content.replace("${userName}",t.getBelongToUser());
|
||||
content= content.replace("${remark}",t.getRemark());
|
||||
content= content.replace("${date1}", DateUtils.formatDate(t.getTaskStartDate(),"yy-MM-dd"));
|
||||
content=content.replace("${date2}",DateUtils.formatDate(t.getTaskEndDate(),"yy-MM-dd"));
|
||||
content=content.replace("${level}",getLevelRemark(t.getLevel()));
|
||||
content=content.replace("${name}",t.getName());
|
||||
SendEmail.sendMessage("任务提醒:"+t.getName(),Arrays.asList(mail),
|
||||
StringUtils.isEmpty(t.getCopyMail())?null:Arrays.asList(t.getCopyMail()),
|
||||
content);
|
||||
}catch (Exception e){
|
||||
|
||||
log.error("",e);
|
||||
}
|
||||
}
|
||||
t.setTaskStatus(2);
|
||||
@ -160,6 +163,16 @@ public class ZtYwTaskServiceImpl extends ServiceImpl<ZtYwTaskMapper, ZtYwTask> i
|
||||
|
||||
}
|
||||
}
|
||||
public String getLevelRemark(Integer level){
|
||||
if(level==1){
|
||||
return "高";
|
||||
}else if(level==2){
|
||||
return "中";
|
||||
}else if(level==3){
|
||||
return "低";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZtYwTaskDTO> ywTaskService(ZtProjectQo qo) {
|
||||
|
@ -1,7 +1,23 @@
|
||||
package com.sa.zentao.utils;
|
||||
|
||||
import com.itextpdf.html2pdf.HtmlConverter;
|
||||
import com.itextpdf.io.IOException;
|
||||
import com.itextpdf.io.font.constants.StandardFonts;
|
||||
import com.itextpdf.kernel.pdf.PdfDocument;
|
||||
import com.itextpdf.kernel.pdf.PdfWriter;
|
||||
import com.itextpdf.layout.Document;
|
||||
import com.itextpdf.layout.element.Paragraph;
|
||||
import com.itextpdf.styledxmlparser.jsoup.Jsoup;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.text.PDFTextStripper;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
@ -27,4 +43,88 @@ public class BeanCopyUtil extends BeanUtils {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static void main(String[] args) {
|
||||
|
||||
// String htmlContent = "<h1>Hello, World!</h1><p>This is a paragraph.</p>";
|
||||
// String dest = "output.pdf"; // Destination PDF file
|
||||
//
|
||||
// try (PdfWriter writer = new PdfWriter(new FileOutputStream(dest));
|
||||
// PdfDocument pdf = new PdfDocument(writer)) {
|
||||
//
|
||||
// HtmlConverter.convertToPdf(htmlContent.getBytes(), pdf);
|
||||
// System.out.println("HTML content has been converted to PDF successfully.");
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
// PDDocument document = new PDDocument();
|
||||
// PDPage page = new PDPage();
|
||||
// document.addPage(page);
|
||||
//
|
||||
// PDPageContentStream contentStream = new PDPageContentStream(document, page);
|
||||
// contentStream.setFont(PDType1Font.HELVETICA, 12);
|
||||
// contentStream.beginText();
|
||||
// contentStream.newLineAtOffset(50, 700);
|
||||
//
|
||||
// String htmlContent = "<h1>Hello, World!</h1>";
|
||||
// PDHtmlTextStripper stripper = new PDHtmlTextStripper();
|
||||
// stripper.setStartPage(1);
|
||||
// stripper.setEndPage(2);
|
||||
// stripper.writeText(document, contentStream, htmlContent);
|
||||
//
|
||||
// contentStream.endText();
|
||||
// contentStream.close();
|
||||
|
||||
// 1、创建一个 PdfWriter ,参数为创建的路径
|
||||
// String dest = "F:\\禅道\\zentao\\zentao\\"+"output.pdf";
|
||||
// PdfWriter writer = new PdfWriter(dest);
|
||||
//
|
||||
// // 2、创建一个 PdfDocument,参数为PdfWriter
|
||||
// PdfDocument pdfDoc = new PdfDocument(writer);
|
||||
//
|
||||
// // 3、用PdfDocument创建一个空白 page
|
||||
// pdfDoc.addNewPage();
|
||||
//
|
||||
// // 4、创建一个 Document,参数为PdfDocument
|
||||
// Document document = new Document(pdfDoc);
|
||||
//
|
||||
//
|
||||
// String para1 = "段落1的内容";
|
||||
//
|
||||
// String para2 = "段落2的内容";
|
||||
//
|
||||
// // 创建段落 Paragraphs
|
||||
// Paragraph paragraph1 = new Paragraph(para1);
|
||||
// Paragraph paragraph2 = new Paragraph(para2);
|
||||
// Paragraph paragraph3 = new Paragraph("<h1>111111</h1>");
|
||||
// // 把段落添加到 document
|
||||
// document.add(paragraph1);
|
||||
// document.add(paragraph2);
|
||||
// document.add(paragraph3);
|
||||
// // 5、关闭 document,PdfDocument
|
||||
// document.close();
|
||||
// pdfDoc.close();
|
||||
// String html = "<html><body>标题<p>这是一段示例文本。</p></body></html>";
|
||||
// com.itextpdf.styledxmlparser.jsoup.nodes.Document doc = Jsoup.parse(html);
|
||||
//
|
||||
// String titleText = doc.select("h1").text();
|
||||
// String paragraphText = doc.select("p").text();
|
||||
//
|
||||
// String dest = "output.pdf";
|
||||
// try {
|
||||
// PdfWriter writer = new PdfWriter(dest);
|
||||
// PdfDocument pdf = new PdfDocument(writer);
|
||||
// Document document = new Document(pdf);
|
||||
//
|
||||
// document.add(new Paragraph("标题: " + titleText).setFont(StandardFonts.HELVETICA_BOLD));
|
||||
// document.add(new Paragraph("段落: " + paragraphText));
|
||||
//
|
||||
// document.close();
|
||||
// } catch (FileNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
72
src/main/java/com/sa/zentao/utils/MyXMLWorkerHelper.java
Normal file
72
src/main/java/com/sa/zentao/utils/MyXMLWorkerHelper.java
Normal file
@ -0,0 +1,72 @@
|
||||
package com.sa.zentao.utils;
|
||||
|
||||
import com.itextpdf.text.Font;
|
||||
import com.itextpdf.tool.xml.ElementList;
|
||||
import com.itextpdf.tool.xml.XMLWorker;
|
||||
import com.itextpdf.tool.xml.XMLWorkerFontProvider;
|
||||
import com.itextpdf.tool.xml.XMLWorkerHelper;
|
||||
import com.itextpdf.tool.xml.css.CssFile;
|
||||
import com.itextpdf.tool.xml.css.StyleAttrCSSResolver;
|
||||
import com.itextpdf.tool.xml.html.CssAppliers;
|
||||
import com.itextpdf.tool.xml.html.CssAppliersImpl;
|
||||
import com.itextpdf.tool.xml.html.Tags;
|
||||
import com.itextpdf.tool.xml.parser.XMLParser;
|
||||
import com.itextpdf.tool.xml.pipeline.css.CSSResolver;
|
||||
import com.itextpdf.tool.xml.pipeline.css.CssResolverPipeline;
|
||||
import com.itextpdf.tool.xml.pipeline.end.ElementHandlerPipeline;
|
||||
import com.itextpdf.tool.xml.pipeline.html.HtmlPipeline;
|
||||
import com.itextpdf.tool.xml.pipeline.html.HtmlPipelineContext;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MyXMLWorkerHelper {
|
||||
public static class MyFontsProvider extends XMLWorkerFontProvider {
|
||||
public MyFontsProvider() {
|
||||
super(null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Font getFont(final String fontname, String encoding, float size, final int style) {
|
||||
|
||||
String fntname = fontname;
|
||||
if (fntname == null) {
|
||||
fntname = "宋体";
|
||||
}
|
||||
return super.getFont(fntname, encoding, size, style);
|
||||
}
|
||||
}
|
||||
|
||||
public static ElementList parseToElementList(String html, String css) throws IOException {
|
||||
// CSS
|
||||
CSSResolver cssResolver = new StyleAttrCSSResolver();
|
||||
if (css != null) {
|
||||
CssFile cssFile = XMLWorkerHelper.getCSS(new ByteArrayInputStream(css.getBytes()));
|
||||
cssResolver.addCss(cssFile);
|
||||
}
|
||||
|
||||
// HTML
|
||||
MyFontsProvider fontProvider = new MyFontsProvider();
|
||||
CssAppliers cssAppliers = new CssAppliersImpl(fontProvider);
|
||||
HtmlPipelineContext htmlContext = new HtmlPipelineContext(cssAppliers);
|
||||
htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory());
|
||||
htmlContext.autoBookmark(false);
|
||||
|
||||
// Pipelines
|
||||
ElementList elements = new ElementList();
|
||||
ElementHandlerPipeline end = new ElementHandlerPipeline(elements, null);
|
||||
HtmlPipeline htmlPipeline = new HtmlPipeline(htmlContext, end);
|
||||
CssResolverPipeline cssPipeline = new CssResolverPipeline(cssResolver, htmlPipeline);
|
||||
|
||||
// XML Worker
|
||||
XMLWorker worker = new XMLWorker(cssPipeline, true);
|
||||
XMLParser p = new XMLParser(worker);
|
||||
//
|
||||
html = html.replace("<br>", "").replace("<img>", "").replace("<hr>", "").replace("<param>", "")
|
||||
.replace("<link>", "");
|
||||
p.parse(new ByteArrayInputStream(html.getBytes()));
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
}
|
@ -31,4 +31,5 @@ spring:
|
||||
|
||||
|
||||
file:
|
||||
baseUrl: http://192.168.3.200:8013
|
||||
baseUrl: http://192.168.3.200:8013
|
||||
meeting: /data/buildzentao/meeting.docx
|
@ -22,12 +22,12 @@ spring:
|
||||
strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
|
||||
datasource:
|
||||
master:
|
||||
# url: jdbc:mysql://192.168.1.161:3306/zentao?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
# username: devgps
|
||||
# password: dev@2021GPS
|
||||
url: jdbc:mysql://192.168.3.200:3306/zentao_dev?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: PX4fTAAsJ#T!1
|
||||
url: jdbc:mysql://192.168.1.161:3306/zentao?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
username: devgps
|
||||
password: dev@2021GPS
|
||||
# url: jdbc:mysql://192.168.3.200:3306/zentao_dev?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
# username: root
|
||||
# password: PX4fTAAsJ#T!1
|
||||
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
slave:
|
||||
@ -39,8 +39,8 @@ spring:
|
||||
|
||||
|
||||
file:
|
||||
baseUrl: http://127.0.0.1:8085
|
||||
|
||||
baseUrl: http://192.168.1.161:8085
|
||||
meeting: /data/buildzentao/meeting.docx
|
||||
|
||||
#spring:
|
||||
# datasource:
|
||||
|
@ -29,7 +29,7 @@ logging:
|
||||
mybatis:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
typeEnumsPackage: com.sa.zentao.enums
|
||||
|
||||
|
||||
|
||||
|
@ -139,9 +139,20 @@
|
||||
|
||||
<select id="myBugPageList" resultType="com.sa.zentao.dao.ZtBugDTO">
|
||||
|
||||
SELECT * from zt_bug
|
||||
SELECT s.*,pt.name productName from zt_bug s left join zt_product pt on s.product = pt.id
|
||||
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.productName != null and qo.productName != '' ">
|
||||
and pt.name like concat('%', #{qo.productName}, '%')
|
||||
</if>
|
||||
|
||||
|
||||
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||
and id in
|
||||
|
@ -224,6 +224,220 @@
|
||||
|
||||
SELECT * from zt_project WHERE `name` = #{name} and type = 'sprint'
|
||||
|
||||
</select>
|
||||
<select id="selectPrdById" resultType="com.sa.zentao.dao.ZtProjectDTO">
|
||||
SELECT * from zt_project WHERE id = #{id} and type = 'sprint'
|
||||
</select>
|
||||
<select id="performanceCount" resultType="com.sa.zentao.dao.PerformanceDTO">
|
||||
SELECT
|
||||
`姓名` as userName,
|
||||
account,
|
||||
`天数` as days,
|
||||
`可用工时` as totalTime,
|
||||
`达标工时` as examineTime,
|
||||
`产出工时` as workTime,
|
||||
`分配总工时` as allocationTime,
|
||||
`工作饱和率` as saturation,
|
||||
`饱和率得分` as saturationScore,
|
||||
`逾期任务` as delayTask,
|
||||
`完成任务` as finishTask,
|
||||
`完成准时率` as finishPunctuality,
|
||||
`准时率得分` as punctualityScore,
|
||||
`线上严重bug` as seriousBug,
|
||||
`线上普通bug` as slightBug,
|
||||
`线上bug得分` bugScore ,
|
||||
if(account in ('chenlu', 'yanyanjie'), `线上bug得分` + `准时率得分` + 50, `饱和率得分`+ `线上bug得分` + `准时率得分` + 25 ) AS `score`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`姓名`,
|
||||
account,
|
||||
`天数`,
|
||||
`可用工时`,
|
||||
`达标工时`,
|
||||
`产出工时`,
|
||||
`分配总工时`,
|
||||
`工作饱和率`,
|
||||
|
||||
IF
|
||||
(
|
||||
`饱和率得分` > 40,
|
||||
40,
|
||||
IF
|
||||
|
||||
( `饱和率得分` <![CDATA[ < ]]> 0, 0, `饱和率得分` )) AS `饱和率得分`,
|
||||
`逾期任务`,
|
||||
`完成任务`,
|
||||
`完成准时率`,
|
||||
`准时率得分`,
|
||||
`线上严重bug`,
|
||||
`线上普通bug`,
|
||||
IF
|
||||
( `线上bug得分` <![CDATA[ < ]]> 0, 0, `线上bug得分` ) AS `线上bug得分`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`姓名`,
|
||||
account,
|
||||
`天数`,
|
||||
`可用工时`,
|
||||
`达标工时`,
|
||||
`产出工时`,
|
||||
`分配总工时`,
|
||||
`工作饱和率`,
|
||||
|
||||
IF
|
||||
(
|
||||
`工作饱和率` <![CDATA[ < ]]> 0.70,
|
||||
0,
|
||||
IF
|
||||
( `工作饱和率` <![CDATA[ < ]]> 0.9 , 40 - ( 0.9 - `工作饱和率` ) * 100 * 1, 40 )) `饱和率得分`,
|
||||
`逾期任务`,
|
||||
`完成任务`,
|
||||
`完成准时率`,
|
||||
IF
|
||||
(
|
||||
`完成准时率` <![CDATA[ < ]]> 0.80,
|
||||
0,
|
||||
IF
|
||||
( `完成准时率` <![CDATA[ < ]]> 1 , 25 - (1 - `完成准时率`) * 100 * 1, 25 )) `准时率得分`,
|
||||
`线上严重bug`,
|
||||
`线上普通bug`,
|
||||
IF
|
||||
( account in ('chenlu', 'yanyanjie'), if(`线上严重bug` = 0 AND `线上普通bug` = 0, 20, 20 - `线上严重bug` * 20 - `线上普通bug` * 5 ), if(`线上严重bug` = 0 AND `线上普通bug` = 0, 10, 10 - `线上严重bug` * 10 - `线上普通bug` * 3 )) `线上bug得分`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
*,
|
||||
IFNULL( `_线上严重bug`, 0 ) `线上严重bug`,
|
||||
IFNULL( `_线上普通bug`, 0 ) `线上普通bug`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
gs.nickname `姓名`,
|
||||
gs.account,
|
||||
SUM(
|
||||
IF
|
||||
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 )) `天数`,
|
||||
SUM(
|
||||
IF
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 ))* 1 `测试bug数量`,
|
||||
SUM(
|
||||
IF
|
||||
( gs.`hour` <![CDATA[ > ]]> 0, 1, 0 ))* 0.3 `开发bug数量`,
|
||||
SUM( gs.`hour` ) `可用工时`,
|
||||
SUM( gs.`hour` ) * 0.75 `达标工时`,
|
||||
ROUND( SUM( tc.estimate ), 2 ) `分配总工时`,
|
||||
ROUND( SUM( tc.consumed ), 2 ) `产出工时`,
|
||||
ROUND( SUM( tc.estimate )/ (SUM( gs.`hour` )*0.75), 2 ) `工作饱和率`,
|
||||
SUM( tc.yuqi_count ) `逾期任务` ,
|
||||
SUM( tc.finish_count ) `完成任务`,
|
||||
(1 - ROUND( SUM( tc.yuqi_count )/ SUM( tc.finish_count ) , 2 )) `完成准时率`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
md.mydate,
|
||||
u.nickname,
|
||||
u.account,
|
||||
if( a.apply_days IS NULL , 8 ,
|
||||
if(a.apply_days <![CDATA[ < ]]> 480,
|
||||
|
||||
ROUND((8 * 60 - a.apply_days) / 60, 2),0)
|
||||
)
|
||||
`hour`
|
||||
FROM
|
||||
my_date md
|
||||
LEFT JOIN zt_holiday h ON md.mydate BETWEEN h.`begin`
|
||||
AND h.`end`
|
||||
LEFT JOIN zt_user u ON 1 = 1
|
||||
LEFT JOIN os_system.it_approval a ON a.NAME = u.nickname
|
||||
AND md.mydate BETWEEN date( a.`apply_time_start` )
|
||||
AND date( a.`apply_time_end` )
|
||||
WHERE
|
||||
( md.mydayofweek IN ( 2, 3, 4, 5, 6 ) OR h.type = 'working' )
|
||||
AND ( h.id IS NULL OR h.type = 'working' )
|
||||
-- AND ( u.dept IN ( 24 ) OR u.account = 'songzhiling' )
|
||||
AND u.deleted = '0'
|
||||
|
||||
AND md.mydate <![CDATA[ >= ]]> date( #{startDate } )
|
||||
AND md.mydate <![CDATA[ < ]]> date(#{endDate } )
|
||||
ORDER BY
|
||||
u.nickname,
|
||||
md.mydate
|
||||
) gs
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.finishedBy,
|
||||
SUM( t.estimate ) estimate,
|
||||
SUM( t.consumed ) consumed,
|
||||
date( t.finishedDate ) `date`,
|
||||
count( t.id ) `finish_count`,
|
||||
SUM(
|
||||
IF
|
||||
( DATEDIFF(t.finishedDate, t.deadline) > 3 , 1, 0 )) `yuqi_count`
|
||||
FROM
|
||||
zt_task t
|
||||
WHERE
|
||||
t.deleted = '0'
|
||||
-- and t.openedBy in ('wangyuhang', 'liyuyan')
|
||||
-- AND t.finishedBy = 'guoshangyu'
|
||||
AND date( t.openedDate ) <![CDATA[ < ]]> date(#{endDate } )
|
||||
AND date(t.finishedDate) BETWEEN date(#{startDate } )
|
||||
AND date(#{endDate } )
|
||||
GROUP BY
|
||||
t.finishedBy,
|
||||
date( t.finishedDate )
|
||||
) tc ON tc.finishedBy = gs.account
|
||||
AND tc.date = gs.mydate
|
||||
WHERE
|
||||
gs.nickname NOT IN ( '王宇航', '徐申靓', '刘圣清' )
|
||||
GROUP BY
|
||||
gs.nickname
|
||||
) gsu
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
account1,
|
||||
sum( `_bug数量` ) AS `_bug数量`,
|
||||
sum( `_线上严重bug` ) AS `_线上严重bug`,
|
||||
sum( `_线上普通bug` ) AS `_线上普通bug`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
IFNULL(zb.resolvedBy,zb.assignedTo) `account1`,
|
||||
count( zb.id ) `_bug数量`,
|
||||
count(
|
||||
IF
|
||||
( zb.severity = 1, 1, NULL )) `_线上严重bug`,
|
||||
count(
|
||||
IF
|
||||
( zb.severity = 2, 1, NULL )) `_线上普通bug`
|
||||
FROM
|
||||
zt_bug zb
|
||||
WHERE
|
||||
(
|
||||
zb.severity IN ( 2, 1 ))
|
||||
AND IFNULL( zb.deadline, zb.openedDate ) BETWEEN date(#{startDate } )
|
||||
AND date(#{endDate } )
|
||||
GROUP BY
|
||||
IFNULL(zb.resolvedBy,zb.assignedTo)
|
||||
) zbjs
|
||||
GROUP BY
|
||||
zbjs.account1
|
||||
) zbu ON gsu.account = zbu.account1
|
||||
GROUP BY
|
||||
gsu.account
|
||||
) gzu
|
||||
GROUP BY
|
||||
account
|
||||
) gaaa
|
||||
GROUP BY
|
||||
account
|
||||
) zzzzz where account in ('jiangheng', 'guoshangyu', 'jinliang','songzhiling', 'yumengcheng','zhoulinfang','zhouxueli','chenlu','yanyanjie','chenhaidong')
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -14,5 +14,9 @@
|
||||
SELECT * from zt_projectstory WHERE project = #{id}
|
||||
|
||||
</select>
|
||||
<select id="prdList" resultType="com.sa.zentao.entity.ZtProjectstory">
|
||||
|
||||
SELECT * from zt_projectstory WHERE story = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -98,8 +98,7 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =1
|
||||
and s.stage = 'verified' and s.ys_flag =1
|
||||
</if>
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
|
||||
and s.status = '11'
|
||||
@ -119,8 +118,9 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =0
|
||||
and ( s.stage = 'released'
|
||||
and s.ys_flag =0)
|
||||
or (s.stage = 'verified' and s.ys_flag =2)
|
||||
</if>
|
||||
|
||||
<if test="qo.id != null ">
|
||||
@ -174,12 +174,28 @@
|
||||
|
||||
|
||||
|
||||
select s.*,sp.spec ,sp.verify,sp.files from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story
|
||||
select s.*,sp.spec ,sp.verify,sp.files,pt.name productName from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story
|
||||
|
||||
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
||||
left join zt_projectstory pstory on s.id = pstory.story and pstory.execution =0
|
||||
left join zt_project pj on pstory.project = pj.id
|
||||
|
||||
left join zt_product pt on s.product = pt.id
|
||||
WHERE s.id = ps.story
|
||||
|
||||
|
||||
<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.productName != null and qo.productName != '' ">
|
||||
and pt.name like concat('%', #{qo.productName}, '%')
|
||||
</if>
|
||||
|
||||
<if test="qo.project != null ">
|
||||
and ps.project =#{qo.project}
|
||||
</if>
|
||||
@ -227,8 +243,7 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'DGB' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =1
|
||||
and s.stage = 'verified' and s.ys_flag =1
|
||||
</if>
|
||||
<if test="qo.searchVal == 'BGZ' ">
|
||||
and s.status = '11'
|
||||
@ -248,8 +263,10 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'DYS' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =0
|
||||
|
||||
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 == 'YWGB' ">
|
||||
and s.status ='closed'
|
||||
@ -310,6 +327,16 @@
|
||||
</if>
|
||||
|
||||
|
||||
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||
and s.id in
|
||||
<foreach collection="qo.objIds" item="id" index="index"
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
|
||||
|
||||
group by s.id
|
||||
|
||||
<choose>
|
||||
@ -408,8 +435,9 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'DYS' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =0
|
||||
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 == 'YWGB' ">
|
||||
and s.status ='closed'
|
||||
@ -436,7 +464,8 @@
|
||||
|
||||
</select>
|
||||
<select id="myStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
||||
select s.*,sp.spec ,sp.verify,sp.files from zt_story s left join zt_storyspec sp on s.id = sp.story
|
||||
select s.*,sp.spec ,sp.verify,sp.files ,pt.name productName from zt_story s left join zt_storyspec sp on s.id = sp.story
|
||||
left join zt_product pt on s.product = pt.id
|
||||
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
||||
WHERE 1=1
|
||||
|
||||
@ -446,8 +475,22 @@
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</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.productName != null and qo.productName != '' ">
|
||||
and pt.name like concat('%', #{qo.productName}, '%')
|
||||
</if>
|
||||
|
||||
<if test="qo.project != null ">
|
||||
and ps.project =#{qo.project}
|
||||
</if>
|
||||
@ -494,9 +537,9 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'DGB' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =1
|
||||
and s.stage = 'verified' and s.ys_flag =1
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'BGZ' ">
|
||||
and s.status = '11'
|
||||
</if>
|
||||
@ -515,14 +558,26 @@
|
||||
</if>
|
||||
|
||||
<if test="qo.searchVal == 'DYS' ">
|
||||
and s.stage = 'verified'
|
||||
and s.ys_flag =0
|
||||
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 == 'YWGB' ">
|
||||
and s.status ='closed'
|
||||
and closedBy =#{qo.userName}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||
and s.id in
|
||||
<foreach collection="qo.objIds" item="id" index="index"
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
|
||||
group by s.id
|
||||
|
||||
<choose>
|
||||
|
@ -70,7 +70,32 @@
|
||||
</resultMap>
|
||||
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryUserDTO">
|
||||
|
||||
SELECT * from zt_story_user s WHERE 1=1
|
||||
SELECT s.*,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">
|
||||
and s.product in
|
||||
<foreach collection="qo.productIds" item="id" index="index"
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</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.productName != null and qo.productName != '' ">
|
||||
and pt.name like concat('%', #{qo.productName}, '%')
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
|
||||
<if test="qo.searchVal == 'ALL' ">
|
||||
|
||||
|
@ -59,9 +59,28 @@
|
||||
</resultMap>
|
||||
<select id="taskPageList" resultType="com.sa.zentao.dao.ZtTaskDTO">
|
||||
|
||||
select * from zt_task s
|
||||
select s.*,pt.name productName from zt_task s left join zt_project project on s.project = project.id
|
||||
left join zt_product pt on s.product = pt.id
|
||||
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.projectList != null and qo.projectList.size() > 0">
|
||||
and s.project in
|
||||
<foreach collection="qo.projectList" item="id" index="index"
|
||||
open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||
and s.id in
|
||||
<foreach collection="qo.objIds" item="id" index="index"
|
||||
|
Reference in New Issue
Block a user