bug优化
This commit is contained in:
@ -8,6 +8,7 @@ import com.sa.zentao.dao.Result;
|
|||||||
import com.sa.zentao.dao.UploadDTO;
|
import com.sa.zentao.dao.UploadDTO;
|
||||||
import com.sa.zentao.entity.ZtFile;
|
import com.sa.zentao.entity.ZtFile;
|
||||||
import com.sa.zentao.service.IZtFileService;
|
import com.sa.zentao.service.IZtFileService;
|
||||||
|
import com.sa.zentao.service.VxService;
|
||||||
import com.sa.zentao.utils.DateUtils;
|
import com.sa.zentao.utils.DateUtils;
|
||||||
import com.sa.zentao.utils.UploadUtil;
|
import com.sa.zentao.utils.UploadUtil;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@ -105,6 +106,9 @@ public class CommonsController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/removeFile")
|
@PostMapping("/removeFile")
|
||||||
public Result removeFile( UploadDTO file){
|
public Result removeFile( UploadDTO file){
|
||||||
ZtFile ztFile = this.fileService.getById(file.getId());
|
ZtFile ztFile = this.fileService.getById(file.getId());
|
||||||
@ -125,11 +129,18 @@ public class CommonsController {
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
VxService vxxervice;
|
||||||
|
|
||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
public Result<String> upload(){
|
public Result<String> upload(){
|
||||||
downLoad("http://192.168.1.161:8088/file-download-1.html");
|
downLoad("http://192.168.1.161:8088/file-download-1.html");
|
||||||
|
|
||||||
|
vxxervice.sendMessageToVx("GuoQiBing","测试消息",new Date());
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/downLoad")
|
@PostMapping("/downLoad")
|
||||||
@ -175,72 +186,77 @@ public class CommonsController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String downLoad(String u){
|
public ZtFile downLoad(String u){
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
String path=null;
|
||||||
|
if (os.toLowerCase().startsWith("win")) { //如果是Windows系统
|
||||||
|
log.info("win");
|
||||||
|
path=windowsFilePath ;
|
||||||
|
}else{ //linux和mac系统
|
||||||
|
log.info("linux");
|
||||||
|
path=linuxFilePath+"/";
|
||||||
|
}
|
||||||
|
int i = u.lastIndexOf("?");
|
||||||
|
int i2 = u.lastIndexOf("/");
|
||||||
|
String uname = u.substring(i2+1, i);
|
||||||
|
downloadByIO(u,path,uname);
|
||||||
|
|
||||||
|
|
||||||
String ext = u.substring(u.lastIndexOf(".") + 1).toLowerCase();
|
String ext = u.substring(u.lastIndexOf(".") + 1).toLowerCase();
|
||||||
StringBuffer buffername = new StringBuffer(u.substring(u.lastIndexOf("/")+1));
|
StringBuffer buffername = new StringBuffer(u.substring(u.lastIndexOf("/")+1));
|
||||||
|
ZtFile f=new ZtFile();
|
||||||
|
f.setAddedby(RiskUserThreadLocal.get()==null?null:RiskUserThreadLocal.get().getName());
|
||||||
|
f.setAddeddate(new Date());
|
||||||
|
f.setDeleted("0");
|
||||||
|
f.setExtension(uname.substring(uname.lastIndexOf(".")+1, uname.length()));
|
||||||
|
f.setTitle(uname);
|
||||||
|
f.setSize(0);
|
||||||
|
f.setPathname(baseUrl+"/zentao/img/"+uname);
|
||||||
|
fileService.save(f);
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
URL url = null;
|
public static void downloadByIO(String url, String saveDir, String fileName) {
|
||||||
|
BufferedOutputStream bos = null;
|
||||||
|
InputStream is = null;
|
||||||
try {
|
try {
|
||||||
url = new URL(u);
|
byte[] buff = new byte[8192];
|
||||||
InputStream inputStream = url.openStream();
|
is = new URL(url).openStream();
|
||||||
|
File file = new File(saveDir, fileName);
|
||||||
// byte[] buffer = new byte[1024];
|
file.getParentFile().mkdirs();
|
||||||
// int len;
|
bos = new BufferedOutputStream(new FileOutputStream(file));
|
||||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
int count = 0;
|
||||||
// while ((len = inputStream.read(buffer)) != -1) {
|
while ((count = is.read(buff)) != -1) {
|
||||||
// outStream.write(buffer, 0, len);
|
bos.write(buff, 0, count);
|
||||||
// }
|
|
||||||
|
|
||||||
// byte[] buffer = new byte[1024];
|
|
||||||
// int len;
|
|
||||||
// String path="/data/"+"202407/03103347085011a0";
|
|
||||||
// FileInputStream fileInputStream = new FileInputStream(path);
|
|
||||||
// while ((len = fileInputStream.read(buffer)) != -1) {
|
|
||||||
// outStream.write(buffer, 0, len);
|
|
||||||
// }
|
|
||||||
// fileInputStream.close();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取文件名
|
|
||||||
String fName = "1.png";
|
|
||||||
fName=fName.substring(fName.lastIndexOf("."),fName.length());
|
|
||||||
fName= DateUtils.formatDate(new Date(),"yyyyMMddHHmmss")+UUID.randomUUID().toString().replaceAll("-","")+fName;
|
|
||||||
// 获取文件的字节
|
|
||||||
byte[] bytes = outStream.toByteArray();
|
|
||||||
String p ="";
|
|
||||||
String os = System.getProperty("os.name");
|
|
||||||
if (os.toLowerCase().startsWith("win")) { //如果是Windows系统
|
|
||||||
log.info("win");
|
|
||||||
os=windowsFilePath +"\\";
|
|
||||||
}else{ //linux和mac系统
|
|
||||||
log.info("linux");
|
|
||||||
os=linuxFilePath+"/";
|
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
// 使用文件名在服务器端创建文件
|
|
||||||
java.nio.file.Path path = java.nio.file.Paths.get(os + fName);
|
|
||||||
|
|
||||||
// 写入文件到服务器的指定目录
|
|
||||||
java.nio.file.Files.write(path, bytes);
|
|
||||||
|
|
||||||
String fileAbsolutePath =baseUrl+"/zentao/img/"+fName;
|
|
||||||
|
|
||||||
System.out.print(fileAbsolutePath);
|
|
||||||
|
|
||||||
|
|
||||||
outStream.close();
|
|
||||||
inputStream.close();
|
|
||||||
return fileAbsolutePath;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (is != null) {
|
||||||
|
try {
|
||||||
|
is.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
try {
|
||||||
|
bos.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String u ="http://file-gk.sinoassist.com:38888/group1/M00/95/9E/wKgDd2etgTmAcL-gABfjLU1YfoI166.jpg?date=2025-02-13";
|
||||||
|
int i = u.lastIndexOf("?");
|
||||||
|
int i2 = u.lastIndexOf("/");
|
||||||
|
String substring = u.substring(i2+1, i);
|
||||||
|
String uname="wKgDd2etgTmAcL-gABfjLU1YfoI166.jpg";
|
||||||
|
String substring1 = uname.substring(uname.lastIndexOf(".")+1, uname.length());
|
||||||
|
System.out.print(substring1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,12 @@ public class ZtProductController {
|
|||||||
public Result<PageInfo<ZtProjectDTO>> productList(@RequestBody ZtProjectQo qo){
|
public Result<PageInfo<ZtProjectDTO>> productList(@RequestBody ZtProjectQo qo){
|
||||||
return Result.success(ztProductService.productList(qo));
|
return Result.success(ztProductService.productList(qo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/myProductList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result<PageInfo<ZtProjectDTO>> myProductList(@RequestBody ZtProjectQo qo){
|
||||||
|
return Result.success(ztProductService.myProductList(qo));
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/productListByProductId", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
@RequestMapping(value = "/productListByProductId", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
public Result<PageInfo<ZtProjectDTO>> productListByProductId(@RequestBody ZtProjectQo qo){
|
public Result<PageInfo<ZtProjectDTO>> productListByProductId(@RequestBody ZtProjectQo qo){
|
||||||
return Result.success(ztProductService.productListByProductId
|
return Result.success(ztProductService.productListByProductId
|
||||||
|
@ -324,4 +324,15 @@ public class ZtProjectController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//迭代列表根据项目
|
||||||
|
@RequestMapping(value = "/projectProductByExecution", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||||
|
public Result projectProductByExecution(@RequestBody ZtProjectQo qo){
|
||||||
|
|
||||||
|
ZtProjectDTO p = this.ztProjectService.projectProductByExecution(qo.getExecution());
|
||||||
|
return Result.success(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,9 @@ public class ZtUserController {
|
|||||||
LambdaQueryWrapper<ZtUser> eq = new QueryWrapper<ZtUser>()
|
LambdaQueryWrapper<ZtUser> eq = new QueryWrapper<ZtUser>()
|
||||||
.lambda().eq(ZtUser::getDeleted, "0");
|
.lambda().eq(ZtUser::getDeleted, "0");
|
||||||
if(!StringUtils.isEmpty(dto.getName())){
|
if(!StringUtils.isEmpty(dto.getName())){
|
||||||
eq.like(ZtUser::getAccount,dto.getName())
|
eq.and(e->e.like(ZtUser::getAccount,dto.getName())
|
||||||
.or().like(ZtUser::getNickname,dto.getName())
|
.or().like(ZtUser::getNickname,dto.getName())
|
||||||
.or().like(ZtUser::getPinyin,dto.getName())
|
.or().like(ZtUser::getPinyin,dto.getName()))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if("execution".equals(dto.getType())){
|
if("execution".equals(dto.getType())){
|
||||||
|
@ -215,8 +215,9 @@ public class ZtProjectDTO<T> implements Serializable {
|
|||||||
|
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
private String productName;
|
private String productName;
|
||||||
|
//迭代id
|
||||||
private Integer excludeId;
|
private Integer excludeId;
|
||||||
|
private String executionName;
|
||||||
private List<String> teamList;
|
private List<String> teamList;
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class ZtReleaseDTO implements Serializable {
|
|||||||
|
|
||||||
@TableField("createdBy")
|
@TableField("createdBy")
|
||||||
private String createdby;
|
private String createdby;
|
||||||
|
private String createdbyName;
|
||||||
@TableField("createdDate")
|
@TableField("createdDate")
|
||||||
private Date createddate;
|
private Date createddate;
|
||||||
|
|
||||||
@ -97,5 +97,7 @@ public class ZtReleaseDTO implements Serializable {
|
|||||||
|
|
||||||
private String releaseFailRemark;
|
private String releaseFailRemark;
|
||||||
|
|
||||||
|
private String releaseUser;
|
||||||
|
|
||||||
private List<ZtReleaseDetailsDTO> details;
|
private List<ZtReleaseDetailsDTO> details;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,8 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String files;
|
private String files;
|
||||||
|
|
||||||
|
private String urls;
|
||||||
|
|
||||||
private String openedBy;
|
private String openedBy;
|
||||||
|
|
||||||
private String openedByName;
|
private String openedByName;
|
||||||
@ -99,5 +101,4 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
|||||||
|
|
||||||
private String weixin;
|
private String weixin;
|
||||||
|
|
||||||
private String urls;
|
|
||||||
}
|
}
|
||||||
|
66
src/main/java/com/sa/zentao/entity/BaseSalaryToVxError.java
Normal file
66
src/main/java/com/sa/zentao/entity/BaseSalaryToVxError.java
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
package com.sa.zentao.entity;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
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 2023-03-03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class BaseSalaryToVxError implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 员工id
|
||||||
|
*/
|
||||||
|
private String staffNo;
|
||||||
|
/**
|
||||||
|
* 员工name
|
||||||
|
*/
|
||||||
|
private String staffName;
|
||||||
|
/**
|
||||||
|
* 错误时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date quitDate;
|
||||||
|
/**
|
||||||
|
* 错误时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat("yyyy-MM-dd")
|
||||||
|
private Date inquireDate;
|
||||||
|
/**
|
||||||
|
* 异常code
|
||||||
|
*/
|
||||||
|
private String errorCode;
|
||||||
|
/**
|
||||||
|
* 异常原因
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
/**
|
||||||
|
* 重试次数
|
||||||
|
*/
|
||||||
|
private Integer againCount;
|
||||||
|
/**
|
||||||
|
* 0正常 1.删除
|
||||||
|
*/
|
||||||
|
private Integer deleteFlag;
|
||||||
|
|
||||||
|
}
|
@ -92,4 +92,6 @@ public class ZtRelease implements Serializable {
|
|||||||
private String failRemark;
|
private String failRemark;
|
||||||
|
|
||||||
private String releaseFailRemark;
|
private String releaseFailRemark;
|
||||||
|
|
||||||
|
private String releaseUser;
|
||||||
}
|
}
|
||||||
|
@ -44,4 +44,5 @@ public interface IZtProductService extends IService<ZtProduct> {
|
|||||||
Map<Integer, ZtProduct> selectMapProduct();
|
Map<Integer, ZtProduct> selectMapProduct();
|
||||||
|
|
||||||
|
|
||||||
|
List<ZtProductDTO> myProductList(ZtProjectQo qo);
|
||||||
}
|
}
|
||||||
|
@ -111,4 +111,6 @@ public interface IZtProjectService extends IService<ZtProject> {
|
|||||||
ZtProjectDTO selectPrdById(Integer project);
|
ZtProjectDTO selectPrdById(Integer project);
|
||||||
|
|
||||||
List<PerformanceDTO> performanceCount(Date startDate, Date endDate);
|
List<PerformanceDTO> performanceCount(Date startDate, Date endDate);
|
||||||
|
|
||||||
|
ZtProjectDTO projectProductByExecution(String execution);
|
||||||
}
|
}
|
||||||
|
82
src/main/java/com/sa/zentao/service/VxService.java
Normal file
82
src/main/java/com/sa/zentao/service/VxService.java
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
package com.sa.zentao.service;
|
||||||
|
|
||||||
|
import com.alibaba.excel.util.StringUtils;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.sa.zentao.conf.SpringUtil;
|
||||||
|
import com.sa.zentao.utils.HttpRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class VxService {
|
||||||
|
|
||||||
|
@Value("${vx.corpid}")
|
||||||
|
private static String corpid;
|
||||||
|
|
||||||
|
@Value("${vx.dkcorpsecret}")
|
||||||
|
private static String dkcorpsecret="1MWQxoL8QtypfdnKJqdo3pGdZDAmdhqTF_MaWm3rVjs";
|
||||||
|
|
||||||
|
@Value("${vx.salaryCorpsecretApp}")
|
||||||
|
private static String salaryCorpsecretApp;
|
||||||
|
|
||||||
|
|
||||||
|
public void sendMessageToVx(String vxId, String text, Date date) {
|
||||||
|
Environment bean = SpringUtil.getBean(Environment.class);
|
||||||
|
|
||||||
|
|
||||||
|
if (corpid == null) {
|
||||||
|
corpid = bean.getProperty("vx.corpid");
|
||||||
|
dkcorpsecret = bean.getProperty("vx.dkcorpsecret");
|
||||||
|
salaryCorpsecretApp = bean.getProperty("vx.salaryCorpsecretApp");
|
||||||
|
}
|
||||||
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + corpid + "&corpsecret=" + salaryCorpsecretApp;
|
||||||
|
try {
|
||||||
|
String data = HttpRequest.sendGet(url, null);
|
||||||
|
JSONObject object = JSON.parseObject(data);
|
||||||
|
String access_token = object.getString("access_token");
|
||||||
|
|
||||||
|
url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + access_token;
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("touser", vxId);
|
||||||
|
map.put("agentid", 3010185);
|
||||||
|
map.put("safe", 0);
|
||||||
|
map.put("enable_id_trans", 0);
|
||||||
|
map.put("enable_duplicate_check", 0);
|
||||||
|
map.put("msgtype","text");
|
||||||
|
Map<String, Object> texts = new HashMap<String, Object>();
|
||||||
|
texts.put("content", text);
|
||||||
|
map.put("text", texts);
|
||||||
|
log.info("调用微信start==",JSON.toJSONString(map));
|
||||||
|
String s = JSONPost(url, map);
|
||||||
|
log.info("调用微信end==",s);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String JSONPost(String url, Map<String, Object> map) {
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
HttpHeaders requestHeaders = new HttpHeaders();
|
||||||
|
// 重点是配置请求头内容类型为:"application/json"
|
||||||
|
requestHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
HttpEntity<Map<String, Object>> r = new HttpEntity<>(map, requestHeaders);
|
||||||
|
|
||||||
|
// 请求服务端添加玩家
|
||||||
|
return restTemplate.postForObject(url, r, String.class);
|
||||||
|
}
|
||||||
|
}
|
@ -58,6 +58,18 @@ public class IZtCountService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IZtCronDevopsService cronDevopsService;
|
private IZtCronDevopsService cronDevopsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtProjectproductService projectproductService;
|
||||||
|
@Autowired
|
||||||
|
private IZtProductService productService;
|
||||||
|
@Autowired
|
||||||
|
private IZtStoryreviewService storyreviewService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtReleaseService releaseService;
|
||||||
|
@Autowired
|
||||||
|
private IZtReleaseDetailsService releaseDetailsService;
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Object> todayWorkCount(ZtCaseDTO dto) {
|
public Map<String, Object> todayWorkCount(ZtCaseDTO dto) {
|
||||||
String name = RiskUserThreadLocal.get().getName();
|
String name = RiskUserThreadLocal.get().getName();
|
||||||
@ -94,8 +106,17 @@ public class IZtCountService {
|
|||||||
long resolvedBugCount = bugService.count(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getAssignedTo, name)
|
long resolvedBugCount = bugService.count(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getAssignedTo, name)
|
||||||
.eq(ZtBug::getStatus, "resolved")
|
.eq(ZtBug::getStatus, "resolved")
|
||||||
);
|
);
|
||||||
|
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||||
|
if(userType==UserType.CS){
|
||||||
|
List<ZtBug> myBugList = bugService.list(new QueryWrapper<ZtBug>().lambda()
|
||||||
|
.ne(ZtBug::getStatus, "closed")
|
||||||
|
.and(e->e.eq(ZtBug::getAssignedTo, name).or().eq(ZtBug::getOpenedby, name))
|
||||||
|
);
|
||||||
|
result.put("bugCount", myBugList.stream() .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
}else{
|
||||||
|
result.put("bugCount", bugList.stream().filter(o->o.getStatus().equals("active")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
|
||||||
result.put("bugCount", bugList.stream().filter(o->o.getStatus().equals("active")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
result.put("bugTimeOutCount", bugList.stream().filter(o -> o.getDeadline() != null && o.getDeadline().getTime() < date.getTime())
|
result.put("bugTimeOutCount", bugList.stream().filter(o -> o.getDeadline() != null && o.getDeadline().getTime() < date.getTime())
|
||||||
.filter(o -> "active".equalsIgnoreCase(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> "active".equalsIgnoreCase(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
@ -145,12 +166,7 @@ public class IZtCountService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IZtProjectproductService projectproductService;
|
|
||||||
@Autowired
|
|
||||||
private IZtProductService productService;
|
|
||||||
@Autowired
|
|
||||||
private IZtStoryreviewService storyreviewService;
|
|
||||||
|
|
||||||
public ZtStoryCountDTO storyCount(ZtCaseDTO dto) {
|
public ZtStoryCountDTO storyCount(ZtCaseDTO dto) {
|
||||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||||
@ -231,7 +247,7 @@ public class IZtCountService {
|
|||||||
.filter(o -> o.getStage().equals("testing")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> o.getStage().equals("testing")).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
// developing 研发中 developed 研发完毕 testing 测试中 tested测试完毕
|
// developing 研发中 developed 研发完毕 testing 测试中 tested测试完毕
|
||||||
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> Arrays.asList("developing","developed","testing","tested").contains(o.getStage())
|
.filter(o -> Arrays.asList("developing").contains(o.getStage())
|
||||||
).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
).map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
|
|
||||||
@ -420,9 +436,6 @@ public class IZtCountService {
|
|||||||
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setTestingCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> o.getStage().equals("testing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> o.getStage().equals("testing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
|
|
||||||
result.setDpsCount(ztStory.stream().filter(o -> "reviewing".equals(o.getStatus())) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
result.setPstgCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
|
||||||
.filter(o -> o.getStage().equals("wait")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
|
||||||
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setJxzCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
.filter(o -> o.getStage().equals("developing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
.filter(o -> o.getStage().equals("developing")) .map(o->o.getId()+"").collect(Collectors.joining(",")));
|
||||||
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
result.setYqCount(ztStory.stream().filter(o -> "active".equals(o.getStatus()))
|
||||||
@ -519,10 +532,10 @@ public class IZtCountService {
|
|||||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
// ExcelWriter excelWriter = EasyExcel.write(os).build();
|
// ExcelWriter excelWriter = EasyExcel.write(os).build();
|
||||||
|
|
||||||
WriteSheet 统计 = EasyExcel.writerSheet("统计").
|
// WriteSheet 统计 = EasyExcel.writerSheet("统计").
|
||||||
registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
// registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
.needHead(Boolean.TRUE)
|
// .needHead(Boolean.TRUE)
|
||||||
.build();
|
// .build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1001,31 +1014,34 @@ public class IZtCountService {
|
|||||||
//项目列表
|
//项目列表
|
||||||
List<ZtProjectproduct> projectList = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda()
|
List<ZtProjectproduct> projectList = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||||
.in(ZtProjectproduct::getProduct, products.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
.in(ZtProjectproduct::getProduct, products.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||||
if(CollectionUtils.isEmpty(projectList)){
|
// if(CollectionUtils.isEmpty(projectList)){
|
||||||
return zeroMap(map,objMap);
|
// return zeroMap(map,objMap);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
List<ZtRelease> releases = this.releaseService.list(new QueryWrapper<ZtRelease>().lambda()
|
||||||
|
.eq(ZtRelease::getStatus,"released")
|
||||||
|
.in(ZtRelease::getProject, projectList.stream().map(o -> o.getProject()).collect(Collectors.toList())));
|
||||||
|
|
||||||
|
|
||||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
|
||||||
.in(ZtProjectstory::getProject, projectList.stream().map(o->o.getProject()).collect(Collectors.toList())));
|
|
||||||
|
|
||||||
|
List<ZtStory> ztStories = this.storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getProduct,
|
||||||
if(CollectionUtils.isEmpty(list)){
|
products.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||||
return zeroMap(map,objMap);
|
|
||||||
}
|
|
||||||
List<ZtStory> ztStories = this.storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getId,
|
|
||||||
list.stream().map(o -> o.getStory()).collect(Collectors.toList())).ne(ZtStory::getStatus,"closed"));
|
|
||||||
if(CollectionUtils.isEmpty(ztStories)){
|
if(CollectionUtils.isEmpty(ztStories)){
|
||||||
return zeroMap(map,objMap);
|
return zeroMap(map,objMap);
|
||||||
}
|
}
|
||||||
long count = ztStories.stream().filter(o -> !"closed".equals(o.getStatus())).count();
|
long count = ztStories.stream().count();
|
||||||
long finish = ztStories.stream().filter(o -> "verified".equals(o.getStage()) && o.getYsFlag() == 1).count();
|
long finish = ztStories.stream().filter(o -> "verified".equals(o.getStage())
|
||||||
|
||("closed".equals(o.getStage()))
|
||||||
|
).count();
|
||||||
|
|
||||||
objMap.put("count",count);
|
objMap.put("count",count);
|
||||||
objMap.put("finish",finish);
|
objMap.put("finish",finish);
|
||||||
objMap.put("balance",count-finish);
|
objMap.put("balance",count-finish);
|
||||||
map.put("story",objMap);
|
map.put("story",objMap);
|
||||||
|
|
||||||
|
if(CollectionUtils.isEmpty(projectList)){
|
||||||
|
return zeroTaskMap(map,objMap);
|
||||||
|
}
|
||||||
//项目成员 项目迭代下所有人员 projectList 项目列表
|
//项目成员 项目迭代下所有人员 projectList 项目列表
|
||||||
List<ZtExecutionproject> exexList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
List<ZtExecutionproject> exexList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||||
.in(ZtExecutionproject::getProject, projectList.stream().map(o -> o.getProject()).collect(Collectors.toList())));
|
.in(ZtExecutionproject::getProject, projectList.stream().map(o -> o.getProject()).collect(Collectors.toList())));
|
||||||
@ -1056,23 +1072,32 @@ public class IZtCountService {
|
|||||||
|
|
||||||
objMap.put("wait",taskList.stream().filter(o->"wait".equals(o.getStatus())).count());
|
objMap.put("wait",taskList.stream().filter(o->"wait".equals(o.getStatus())).count());
|
||||||
objMap.put("process",taskList.stream().filter(o->"doing".equals(o.getStatus())).count());
|
objMap.put("process",taskList.stream().filter(o->"doing".equals(o.getStatus())).count());
|
||||||
objMap.put("finish",taskList.stream().filter(o->"done".equals(o.getStatus())).count());
|
objMap.put("finish",taskList.stream().filter(o->"done".equals(o.getStatus())||"closed".equals(o.getStatus())).count());
|
||||||
objMap.put("totalCount",taskList.size());
|
objMap.put("totalCount",taskList.size());
|
||||||
map.put("task",objMap);
|
map.put("task",objMap);
|
||||||
|
|
||||||
List<ZtBug> bugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getProject, id));
|
List<ZtBug> bugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().in(ZtBug::getProduct, products.stream().map(o->o.getId()).collect(Collectors.toList())));
|
||||||
|
|
||||||
|
|
||||||
objMap=new HashMap<>();
|
objMap=new HashMap<>();
|
||||||
objMap.put("totalBug",bugList.stream().filter(o->!o.getStatus().equals("closed")).count());
|
objMap.put("totalBug",bugList.stream().count());
|
||||||
objMap.put("solve",bugList.stream().filter(o->o.getStatus().equals("resolved")).count());
|
objMap.put("solve",bugList.stream().filter(o->o.getStatus().equals("resolved")||o.getStatus().equals("closed")).count());
|
||||||
objMap.put("noSolve",bugList.stream().filter(o->o.getStatus().equals("active")).count());
|
objMap.put("noSolve",bugList.stream().filter(o->o.getStatus().equals("active")).count());
|
||||||
map.put("bug",objMap);
|
map.put("bug",objMap);
|
||||||
|
|
||||||
objMap=new HashMap<>();
|
objMap=new HashMap<>();
|
||||||
objMap.put("online",ztStories.stream().filter(o->o.getStage().equals("released")||o.getStage().equals("verified")).count());
|
//查发布
|
||||||
objMap.put("ysAll",ztStories.stream().filter(o->o.getStage().equals("verified")).count());
|
if(!CollectionUtils.isEmpty(releases)){
|
||||||
objMap.put("ysNo",ztStories.stream().filter(o->o.getStage().equals("verified")&&o.getYsFlag()==2).count());
|
long relaese= this.releaseDetailsService.count(new QueryWrapper<ZtReleaseDetails>().lambda()
|
||||||
|
.in(ZtReleaseDetails::getReleaseId, releases.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||||
|
.eq(ZtReleaseDetails::getObjectType, "story"));
|
||||||
|
objMap.put("online",relaese);
|
||||||
|
}else{
|
||||||
|
objMap.put("online",0);
|
||||||
|
}
|
||||||
|
|
||||||
|
objMap.put("ysAll",ztStories.stream().filter(o->o.getYsFlag()!=null&&o.getYsFlag().intValue()!=0).count());
|
||||||
|
objMap.put("ysNo",ztStories.stream().filter(o->o.getYsFlag()!=null&&o.getYsFlag().intValue()==2).count());
|
||||||
map.put("ys",objMap);
|
map.put("ys",objMap);
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
@ -188,7 +188,7 @@ public class ZtCronDevopsServiceImpl extends ServiceImpl<ZtCronDevopsMapper, ZtC
|
|||||||
|
|
||||||
if(!CollectionUtils.isEmpty(result)){
|
if(!CollectionUtils.isEmpty(result)){
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(result.stream().map(o -> o.getCreateUser()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
|
|
||||||
for (ZtCronDevopsDTO dto:result) {
|
for (ZtCronDevopsDTO dto:result) {
|
||||||
|
@ -135,7 +135,7 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
|||||||
ztProjectDTOS=ztProjectDTOS.stream().filter(o->o.getStatus().equals("doing")).collect(Collectors.toList());
|
ztProjectDTOS=ztProjectDTOS.stream().filter(o->o.getStatus().equals("doing")).collect(Collectors.toList());
|
||||||
List<String> userList = ztProjectDTOS.stream().map(o -> o.getPm()).collect(Collectors.toList());
|
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()));
|
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);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
List<ZtStory> allStoryList = this.storyService.list(new QueryWrapper<ZtStory>().lambda().in(ZtStory::getProduct, result.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
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()
|
List<ZtBug> allBugList = bugService.list(new QueryWrapper<ZtBug>().lambda()
|
||||||
@ -166,7 +166,7 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
|||||||
.equals("active")&&!o.getStage().equals("verified")).count()).intValue());
|
.equals("active")&&!o.getStage().equals("verified")).count()).intValue());
|
||||||
p.setFinishedStories(Long.valueOf(fStoryList.stream().filter(o->o.getStatus().equals("active"))
|
p.setFinishedStories(Long.valueOf(fStoryList.stream().filter(o->o.getStatus().equals("active"))
|
||||||
.filter(o->o.getStage().equals("tested")||o.getStage().equals("released")).count()).intValue());
|
.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(
|
p.setFinishTaskRatio((fStoryList.size()==0||p.getFinishedStories()==0)?BigDecimal.ZERO:BigDecimal.valueOf(p.getFinishedStories()).divide(BigDecimal.valueOf(
|
||||||
fStoryList.stream().filter(o->o.getStatus().equals("active")).filter(o->!o.getStage().equals("verified"))
|
fStoryList.stream().filter(o->o.getStatus().equals("active")).filter(o->!o.getStage().equals("verified"))
|
||||||
.collect(Collectors.toList()).size()
|
.collect(Collectors.toList()).size()
|
||||||
),2,BigDecimal.ROUND_HALF_UP));
|
),2,BigDecimal.ROUND_HALF_UP));
|
||||||
@ -366,6 +366,31 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
|
|||||||
return list.stream().collect(Collectors.toMap(ZtProduct::getId,o->o));
|
return list.stream().collect(Collectors.toMap(ZtProduct::getId,o->o));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ZtProductDTO> myProductList(ZtProjectQo qo) {
|
||||||
|
List<Integer> authList = this.ztProjectService.authProductList();
|
||||||
|
if(CollectionUtils.isEmpty(authList)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<ZtProduct> ztProducts = this.baseMapper.selectList(new QueryWrapper<ZtProduct>()
|
||||||
|
.lambda().eq(ZtProduct::getDeleted,"0")
|
||||||
|
.notIn(ZtProduct::getStatus, Arrays.asList("closed"))
|
||||||
|
.in(ZtProduct::getId,authList)
|
||||||
|
);
|
||||||
|
if(CollectionUtils.isEmpty(ztProducts)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}else{
|
||||||
|
List<ZtProductDTO> ztProductDTOS = BeanCopyUtil.copyListProperties(ztProducts, ZtProductDTO::new);
|
||||||
|
|
||||||
|
for (ZtProductDTO p:ztProductDTOS) {
|
||||||
|
ZtProject ztProject = this.projectMapper.selectById(p.getProgram());
|
||||||
|
|
||||||
|
p.setName(ztProject.getName()+"/"+p.getName());
|
||||||
|
}
|
||||||
|
return ztProductDTOS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Map<Integer, List<ZtProductDTO>> getChildrenMap(List<ZtProjectDTO> result) {
|
private Map<Integer, List<ZtProductDTO>> getChildrenMap(List<ZtProjectDTO> result) {
|
||||||
|
|
||||||
List<ZtProduct> ztProjects = this.baseMapper.selectList(
|
List<ZtProduct> ztProjects = this.baseMapper.selectList(
|
||||||
|
@ -672,7 +672,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
List<ZtProject> pList = this.baseMapper.selectBatchIds(list.stream().map(o -> o.getExecution()).collect(Collectors.toList()));
|
List<ZtProject> pList = this.baseMapper.selectBatchIds(list.stream().map(o -> o.getExecution()).collect(Collectors.toList()));
|
||||||
List<ZtProjectDTO> result = BeanCopyUtil.copyListProperties(pList, ZtProjectDTO::new);
|
List<ZtProjectDTO> result = BeanCopyUtil.copyListProperties(pList, ZtProjectDTO::new);
|
||||||
Map<Integer, List<ZtProject>> projectMap =null;
|
Map<Integer, List<ZtProject>> projectMap =null;
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(result.stream().map(o -> o.getPm()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
projectMap=new HashMap<>();
|
projectMap=new HashMap<>();
|
||||||
@ -908,7 +908,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
public List<Integer> execAuthList() {
|
public List<Integer> execAuthList() {
|
||||||
|
|
||||||
ZtUser user = userService.selectByName(RiskUserThreadLocal.get().getName());
|
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>()
|
return this.baseMapper.selectList(new QueryWrapper<ZtProject>()
|
||||||
.lambda().eq(ZtProject::getType,"sprint")).stream().map(o->o.getId()).collect(Collectors.toList());
|
.lambda().eq(ZtProject::getType,"sprint")).stream().map(o->o.getId()).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@ -1330,6 +1330,34 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
return this.baseMapper.performanceCount(startDate,endDate);
|
return this.baseMapper.performanceCount(startDate,endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZtProjectDTO projectProductByExecution(String execution) {
|
||||||
|
if(StringUtils.isEmpty(execution)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ZtExecutionproject executionproject = this.executionprojectService.getOne(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||||
|
.eq(ZtExecutionproject::getExecution, execution));
|
||||||
|
Integer project = executionproject.getProject();
|
||||||
|
ZtProjectproduct ztProjectproduct = this.projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda()
|
||||||
|
.eq(ZtProjectproduct::getProject, project));
|
||||||
|
ZtProject exec = this.baseMapper.selectById(execution);
|
||||||
|
|
||||||
|
ZtProject pj = this.baseMapper.selectById(project);
|
||||||
|
|
||||||
|
ZtProduct product = this.productService.getById(ztProjectproduct.getProduct());
|
||||||
|
|
||||||
|
ZtProjectDTO dto=new ZtProjectDTO();
|
||||||
|
dto.setExcludeId(exec.getId());
|
||||||
|
dto.setExecutionName(exec.getName());
|
||||||
|
|
||||||
|
dto.setProject(pj.getId());
|
||||||
|
dto.setProjectName(pj.getName());
|
||||||
|
|
||||||
|
dto.setProductName(product.getName());
|
||||||
|
dto.setProductId(product.getId());
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//修改项目集
|
//修改项目集
|
||||||
@Override
|
@Override
|
||||||
@ -1441,7 +1469,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
|
|
||||||
if(!CollectionUtils.isEmpty(result)){
|
if(!CollectionUtils.isEmpty(result)){
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(result.stream().map(o->o.getPm()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
|
|
||||||
Map<Integer,List<ZtProjectDTO>> m= getChildrenMap(result,qo);
|
Map<Integer,List<ZtProjectDTO>> m= getChildrenMap(result,qo);
|
||||||
@ -1498,7 +1526,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
List<ZtProjectDTO> result = this.baseMapper.implementPageList(qo);
|
List<ZtProjectDTO> result = this.baseMapper.implementPageList(qo);
|
||||||
if(!CollectionUtils.isEmpty(result)){
|
if(!CollectionUtils.isEmpty(result)){
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(result.stream().map(o -> o.getPm()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
List<ZtExecutionproject> list = executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
List<ZtExecutionproject> list = executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||||
.in(ZtExecutionproject::
|
.in(ZtExecutionproject::
|
||||||
@ -1583,7 +1611,7 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
|
|
||||||
Map<Integer, ZtProduct> pMap = listProduct.stream().collect(Collectors.toMap(ZtProduct::getId, o -> o));
|
Map<Integer, ZtProduct> pMap = listProduct.stream().collect(Collectors.toMap(ZtProduct::getId, o -> o));
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(result.stream().map(o -> o.getPm()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
for (ZtProjectDTO d:result) {
|
for (ZtProjectDTO d:result) {
|
||||||
String pm = d.getPm();
|
String pm = d.getPm();
|
||||||
ZtUser ztUser = userMap.get(pm);
|
ZtUser ztUser = userMap.get(pm);
|
||||||
|
@ -212,7 +212,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
}
|
}
|
||||||
ztUser = userMap.get(dto.getCreatedby());
|
ztUser = userMap.get(dto.getCreatedby());
|
||||||
if(ztUser!=null){
|
if(ztUser!=null){
|
||||||
dto.setCreatedby(ztUser.getNickname());
|
dto.setCreatedbyName(ztUser.getNickname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.sa.zentao.service.impl;
|
package com.sa.zentao.service.impl;
|
||||||
|
|
||||||
import ch.qos.logback.core.util.StringUtil;
|
import ch.qos.logback.core.util.StringUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
@ -8,13 +9,11 @@ import com.github.pagehelper.PageHelper;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.sa.zentao.conf.LoginRiskUser;
|
import com.sa.zentao.conf.LoginRiskUser;
|
||||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||||
|
import com.sa.zentao.controller.CommonsController;
|
||||||
import com.sa.zentao.dao.BusinessException;
|
import com.sa.zentao.dao.BusinessException;
|
||||||
import com.sa.zentao.dao.ZtStoryDTO;
|
import com.sa.zentao.dao.ZtStoryDTO;
|
||||||
import com.sa.zentao.dao.ZtStoryFeedbackDTO;
|
import com.sa.zentao.dao.ZtStoryFeedbackDTO;
|
||||||
import com.sa.zentao.entity.ZtProduct;
|
import com.sa.zentao.entity.*;
|
||||||
import com.sa.zentao.entity.ZtStory;
|
|
||||||
import com.sa.zentao.entity.ZtStoryFeedback;
|
|
||||||
import com.sa.zentao.entity.ZtUser;
|
|
||||||
import com.sa.zentao.enums.ActionStatus;
|
import com.sa.zentao.enums.ActionStatus;
|
||||||
import com.sa.zentao.enums.ActionType;
|
import com.sa.zentao.enums.ActionType;
|
||||||
import com.sa.zentao.enums.FileTypes;
|
import com.sa.zentao.enums.FileTypes;
|
||||||
@ -102,6 +101,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
return ztStories.stream().collect(Collectors.toMap(ZtStory::getId,o->o));
|
return ztStories.stream().collect(Collectors.toMap(ZtStory::getId,o->o));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CommonsController commonsController;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void addFeedback(ZtStoryFeedbackDTO dto) {
|
public void addFeedback(ZtStoryFeedbackDTO dto) {
|
||||||
@ -130,9 +132,21 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}else{
|
}else{
|
||||||
ztStoryFeedback.setStatus("wait");
|
ztStoryFeedback.setStatus("wait");
|
||||||
}
|
}
|
||||||
|
ztStoryFeedback.setFileUrl(dto.getUrls());
|
||||||
this.baseMapper.insert(ztStoryFeedback);
|
this.baseMapper.insert(ztStoryFeedback);
|
||||||
|
if(!org.apache.commons.lang3.StringUtils.isEmpty(dto.getUrls())){
|
||||||
|
JSONArray array = JSONArray.parseArray(dto.getUrls());
|
||||||
|
if(array.size()>0){
|
||||||
|
List<String> list=new ArrayList<>();
|
||||||
|
for (int i =0;i<array.size();i++){
|
||||||
|
String o = array.getString(0);
|
||||||
|
ZtFile ztFile = commonsController.downLoad(o);
|
||||||
|
list.add(ztFile.getId().toString());
|
||||||
|
}
|
||||||
|
|
||||||
fileService.updateFile(dto.getFiles(),ztStoryFeedback.getId(), FileTypes.feedbackStory);
|
fileService.updateFile(list.stream().collect(Collectors.joining(",")), ztStoryFeedback.getId(), FileTypes.feedbackStory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
actionService.addAction(ActionType.WTFK, ActionStatus.XJ, dto.getId(), dto.getProduct()+"", null, null,
|
actionService.addAction(ActionType.WTFK, ActionStatus.XJ, dto.getId(), dto.getProduct()+"", null, null,
|
||||||
RiskUserThreadLocal.get()==null?"admin":RiskUserThreadLocal.get().getName(), dto.getSpec(), "");
|
RiskUserThreadLocal.get()==null?"admin":RiskUserThreadLocal.get().getName(), dto.getSpec(), "");
|
||||||
@ -153,6 +167,9 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
RiskUserThreadLocal.get().getName(), null, "");
|
RiskUserThreadLocal.get().getName(), null, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VxService vxService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeStatus(ZtStoryFeedbackDTO dto) {
|
public void changeStatus(ZtStoryFeedbackDTO dto) {
|
||||||
ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
||||||
@ -166,6 +183,18 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
|||||||
}else{
|
}else{
|
||||||
ztStoryFeedback.setCloseDate(new Date());
|
ztStoryFeedback.setCloseDate(new Date());
|
||||||
}
|
}
|
||||||
|
if(!org.apache.commons.lang3.StringUtils.isEmpty(ztStoryFeedback.getOpenSource())&&ztStoryFeedback.getOpenSource().equals("weixin")){
|
||||||
|
StringBuilder b=new StringBuilder();
|
||||||
|
b.append(ztStoryFeedback.getName()).append(" 的问题");
|
||||||
|
if("finished".equals(dto.getStatus())){
|
||||||
|
//完成
|
||||||
|
b.append("已解决");
|
||||||
|
}else{
|
||||||
|
//关闭
|
||||||
|
b.append("已关闭");
|
||||||
|
}
|
||||||
|
vxService.sendMessageToVx(ztStoryFeedback.getWeixin(),b.toString(),new Date());
|
||||||
|
}
|
||||||
|
|
||||||
this.baseMapper.updateById(ztStoryFeedback);
|
this.baseMapper.updateById(ztStoryFeedback);
|
||||||
if(!StringUtils.isEmpty(dto.getCloseRemark())){
|
if(!StringUtils.isEmpty(dto.getCloseRemark())){
|
||||||
|
@ -167,7 +167,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(list1.stream().map(o -> o.getReviewer()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
List<ZtStoryreviewDTO> ztStoryreviewDTOS = BeanCopyUtil.copyListProperties(list1, ZtStoryreviewDTO::new);
|
List<ZtStoryreviewDTO> ztStoryreviewDTOS = BeanCopyUtil.copyListProperties(list1, ZtStoryreviewDTO::new);
|
||||||
for (ZtStoryreviewDTO view:ztStoryreviewDTOS) {
|
for (ZtStoryreviewDTO view:ztStoryreviewDTOS) {
|
||||||
ZtUser ztUser = userMap.get(view.getReviewer());
|
ZtUser ztUser = userMap.get(view.getReviewer());
|
||||||
@ -209,9 +209,12 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
ZtStoryUser storyUser = storyUserService.getById(dto.getUserStory());
|
ZtStoryUser storyUser = storyUserService.getById(dto.getUserStory());
|
||||||
if(storyUser!=null&&"wait".equals(storyUser.getStatus())){
|
if(storyUser!=null&&"wait".equals(storyUser.getStatus())){
|
||||||
storyUser.setStatus("active");
|
storyUser.setStatus("active");
|
||||||
storyUserService.updateById(storyUser);
|
}else if(storyUser!=null&&"active".equals(storyUser.getStatus())){
|
||||||
|
if(storyUser.getStatus().equals("active")&&storyUser.getStage().equals("wait")){
|
||||||
|
storyUser.setStage("projected");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
storyUserService.updateById(storyUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
actionService.addAction(ActionType.XQ, ActionStatus.XJ, s.getId(), "", dto.getProduct(), null,
|
actionService.addAction(ActionType.XQ, ActionStatus.XJ, s.getId(), "", dto.getProduct(), null,
|
||||||
@ -609,16 +612,26 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ZtStoryDTO> myStoryList(ZtProjectQo qo) {
|
public List<ZtStoryDTO> myStoryList(ZtProjectQo qo) {
|
||||||
|
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||||
|
|
||||||
|
|
||||||
List<ZtStory> closed = this.baseMapper.selectList(new QueryWrapper<ZtStory>().lambda()
|
List<ZtStory> closed = this.baseMapper.selectList(new QueryWrapper<ZtStory>().lambda()
|
||||||
.ne(ZtStory::getStatus, "closed")
|
.ne(ZtStory::getStatus, "closed")
|
||||||
.eq(ZtStory::getAssignedTo, RiskUserThreadLocal.get().getName())
|
.eq(ZtStory::getAssignedTo, RiskUserThreadLocal.get().getName())
|
||||||
.or().eq(ZtStory::getOpenedby, RiskUserThreadLocal.get().getName())
|
.or().eq(ZtStory::getOpenedby, RiskUserThreadLocal.get().getName())
|
||||||
);
|
);
|
||||||
if(CollectionUtils.isEmpty(closed)){
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(closed, ZtStoryDTO::new);
|
List<ZtStoryDTO> storyDTOList = BeanCopyUtil.copyListProperties(closed, ZtStoryDTO::new);
|
||||||
|
|
||||||
|
if(userType==UserType.CP){
|
||||||
|
List<ZtStoryUser> uStory = this.storyUserService.list(new QueryWrapper<ZtStoryUser>().lambda().ne(ZtStoryUser::getStatus, "closed")
|
||||||
|
.or().eq(ZtStoryUser::getOpenedby, RiskUserThreadLocal.get().getName())
|
||||||
|
);
|
||||||
|
if(!CollectionUtils.isEmpty(uStory)){
|
||||||
|
List<ZtStoryDTO> storyDTOList1 = BeanCopyUtil.copyListProperties(uStory, ZtStoryDTO::new);
|
||||||
|
storyDTOList.addAll(storyDTOList1);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
if(!CollectionUtils.isEmpty(storyDTOList)){
|
if(!CollectionUtils.isEmpty(storyDTOList)){
|
||||||
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(storyDTOList);
|
Map<Integer, List<ZtProject>> executionMapByStory = getExecutionMapByStory(storyDTOList);
|
||||||
for (ZtStoryDTO d:storyDTOList ) {
|
for (ZtStoryDTO d:storyDTOList ) {
|
||||||
@ -631,7 +644,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return storyDTOList;
|
return storyDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -655,7 +667,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
userIds.addAll(list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList()));
|
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);
|
||||||
|
|
||||||
|
|
||||||
for (ZtStoryDTO d : list) {
|
for (ZtStoryDTO d : list) {
|
||||||
@ -1347,7 +1359,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
userIds.addAll(list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList()));
|
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);
|
||||||
|
|
||||||
|
|
||||||
for (ZtStoryDTO d : list) {
|
for (ZtStoryDTO d : list) {
|
||||||
|
@ -453,7 +453,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(list1.stream().map(o -> o.getReviewer()).collect(Collectors.toList()));
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
List<ZtStoryreviewDTO> ztStoryreviewDTOS = BeanCopyUtil.copyListProperties(list1, ZtStoryreviewDTO::new);
|
List<ZtStoryreviewDTO> ztStoryreviewDTOS = BeanCopyUtil.copyListProperties(list1, ZtStoryreviewDTO::new);
|
||||||
for (ZtStoryreviewDTO view:ztStoryreviewDTOS) {
|
for (ZtStoryreviewDTO view:ztStoryreviewDTOS) {
|
||||||
ZtUser ztUser = userMap.get(view.getReviewer());
|
ZtUser ztUser = userMap.get(view.getReviewer());
|
||||||
|
@ -78,7 +78,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
||||||
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userIds);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
for (ZtTaskDTO task:list) {
|
for (ZtTaskDTO task:list) {
|
||||||
ZtUser ztUser = userMap.get(task.getFinishedby());
|
ZtUser ztUser = userMap.get(task.getFinishedby());
|
||||||
@ -290,7 +290,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
||||||
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
||||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(userIds);
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||||
|
|
||||||
for (ZtTaskDTO task:list) {
|
for (ZtTaskDTO task:list) {
|
||||||
ZtUser ztUser = userMap.get(task.getFinishedby());
|
ZtUser ztUser = userMap.get(task.getFinishedby());
|
||||||
@ -327,12 +327,8 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
ztTask.setOpenedby(RiskUserThreadLocal.get().getName());
|
ztTask.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||||
ztTask.setOpeneddate(new Date());
|
ztTask.setOpeneddate(new Date());
|
||||||
ztTask.setEstimate(dto.getLeft());
|
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -353,6 +349,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
List<ZtExecutionproject> execList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getExecution, ztTask.getExecution()));
|
List<ZtExecutionproject> execList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getExecution, ztTask.getExecution()));
|
||||||
ztTask.setProject(execList.get(0).getExecution());
|
ztTask.setProject(execList.get(0).getExecution());
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
Integer execution = dto.getExecution();
|
||||||
|
//迭代
|
||||||
|
ZtExecutionproject executionproject = this.executionprojectService.getOne(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getExecution, execution));
|
||||||
|
|
||||||
|
Integer project = executionproject.getProject();
|
||||||
|
|
||||||
|
ZtProjectproduct projectproduct = this.projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, project));
|
||||||
|
ztTask.setProduct(projectproduct.getProduct());
|
||||||
|
ztTask.setProject(project);
|
||||||
}
|
}
|
||||||
//如果是开发人员 需要评审
|
//如果是开发人员 需要评审
|
||||||
UserType userType = RiskUserThreadLocal.get().getUserType();
|
UserType userType = RiskUserThreadLocal.get().getUserType();
|
||||||
@ -369,6 +375,12 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(ztTask.getDeadline()!=null){
|
if(ztTask.getDeadline()!=null){
|
||||||
ztTask.setDeadlineTime(ztTask.getDeadline().getTime()/1000);
|
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());
|
||||||
|
}
|
||||||
this.baseMapper.insert(ztTask);
|
this.baseMapper.insert(ztTask);
|
||||||
|
|
||||||
fileService.updateFile(dto.getFiles(),ztTask.getId(), FileTypes.task);
|
fileService.updateFile(dto.getFiles(),ztTask.getId(), FileTypes.task);
|
||||||
@ -820,7 +832,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(dto.getApprovalStatus()==1){
|
if(dto.getApprovalStatus()==1){
|
||||||
actionService.addAction(ActionType.RW, ActionStatus.PSTG,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
actionService.addAction(ActionType.RW, ActionStatus.PSTG,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
||||||
RiskUserThreadLocal.get().getName(),dto.getApprovalRemark(),null);
|
RiskUserThreadLocal.get().getName(),dto.getApprovalRemark(),null);
|
||||||
}else if(dto.getApprovalStatus()==2){
|
}else{
|
||||||
actionService.addAction(ActionType.RW, ActionStatus.PSBTG,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
actionService.addAction(ActionType.RW, ActionStatus.PSBTG,t.getId(),projectproduct==null?null:projectproduct.getProduct().toString(),projectproduct==null?null:projectproduct.getProject(),t.getExecution(),
|
||||||
RiskUserThreadLocal.get().getName(),dto.getApprovalRemark(),null);
|
RiskUserThreadLocal.get().getName(),dto.getApprovalRemark(),null);
|
||||||
}
|
}
|
||||||
|
115
src/main/java/com/sa/zentao/utils/HttpRequest.java
Normal file
115
src/main/java/com/sa/zentao/utils/HttpRequest.java
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
//
|
||||||
|
// Source code recreated from a .class file by IntelliJ IDEA
|
||||||
|
// (powered by FernFlower decompiler)
|
||||||
|
//
|
||||||
|
|
||||||
|
package com.sa.zentao.utils;
|
||||||
|
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.ParseException;
|
||||||
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClientBuilder;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class HttpRequest {
|
||||||
|
private static final CloseableHttpClient httpclient;
|
||||||
|
public static final String CHARSET = "UTF-8";
|
||||||
|
|
||||||
|
public HttpRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sendGet(String url, Map<String, Object> params) throws ParseException, IOException {
|
||||||
|
return sendGet(url, params, "UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sendPost(String url, Map<String, Object> params) throws ParseException, IOException {
|
||||||
|
return sendPost(url, params, "UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sendGet(String url, Map<String, Object> params, String charset) throws ParseException, IOException {
|
||||||
|
if (params != null && !params.isEmpty()) {
|
||||||
|
List<NameValuePair> pairs = new ArrayList(params.size());
|
||||||
|
Iterator var4 = params.keySet().iterator();
|
||||||
|
|
||||||
|
while(var4.hasNext()) {
|
||||||
|
String key = (String)var4.next();
|
||||||
|
pairs.add(new BasicNameValuePair(key, params.get(key).toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
url = url + "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs), charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpGet httpGet = new HttpGet(url);
|
||||||
|
CloseableHttpResponse response = httpclient.execute(httpGet);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
if (statusCode != 200) {
|
||||||
|
httpGet.abort();
|
||||||
|
throw new RuntimeException("HttpClient,error status code :" + statusCode);
|
||||||
|
} else {
|
||||||
|
HttpEntity entity = response.getEntity();
|
||||||
|
String result = null;
|
||||||
|
if (entity != null) {
|
||||||
|
result = EntityUtils.toString(entity, "utf-8");
|
||||||
|
EntityUtils.consume(entity);
|
||||||
|
response.close();
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sendPost(String url, Map<String, Object> params, String charset) throws IOException {
|
||||||
|
List<NameValuePair> pairs = null;
|
||||||
|
if (params != null && !params.isEmpty()) {
|
||||||
|
pairs = new ArrayList(params.size());
|
||||||
|
Iterator var4 = params.keySet().iterator();
|
||||||
|
|
||||||
|
while(var4.hasNext()) {
|
||||||
|
String key = (String)var4.next();
|
||||||
|
pairs.add(new BasicNameValuePair(key, params.get(key).toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
if (pairs != null && pairs.size() > 0) {
|
||||||
|
httpPost.setEntity(new UrlEncodedFormEntity(pairs, charset));
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseableHttpResponse response = httpclient.execute(httpPost);
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
if (statusCode != 200) {
|
||||||
|
httpPost.abort();
|
||||||
|
throw new RuntimeException("HttpClient,error status code :" + statusCode);
|
||||||
|
} else {
|
||||||
|
HttpEntity entity = response.getEntity();
|
||||||
|
String result = null;
|
||||||
|
if (entity != null) {
|
||||||
|
result = EntityUtils.toString(entity, "utf-8");
|
||||||
|
EntityUtils.consume(entity);
|
||||||
|
response.close();
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
RequestConfig config = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(3000).build();
|
||||||
|
httpclient = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
|
||||||
|
}
|
||||||
|
}
|
@ -32,4 +32,15 @@ spring:
|
|||||||
|
|
||||||
file:
|
file:
|
||||||
baseUrl: http://192.168.3.200:8013
|
baseUrl: http://192.168.3.200:8013
|
||||||
meeting: /data/buildzentao/meeting.docx
|
meeting: /data/buildzentao/meeting.docx
|
||||||
|
|
||||||
|
vx:
|
||||||
|
token: vTniTyOG4csBmAnMr
|
||||||
|
encodingAesKey : gCmhw7vKLcZwsDszILPNSEqyjgRKODemkYmRFdfelmk
|
||||||
|
receiveid: wwa7cc4743271d6055
|
||||||
|
corpid: wwa7cc4743271d6055
|
||||||
|
corpsecret: qQNdRmtanymbshPOLgWTgB-TzX9QmNpVCpOx5suJ2xA
|
||||||
|
dkCorpsecret: 1MWQxoL8QtypfdnKJqdo3pGdZDAmdhqTF_MaWm3rVjs
|
||||||
|
salaryCorpsecretApp: ib0GyrjV573QdczASCeB-QmCsp0t_QpjsbnQwKBr-Os
|
||||||
|
salaryCorpsecretAppUrl: https://qyapi.weixin.qq.com/cgi-bin/message/send
|
||||||
|
dkcorpsecret: 1MWQxoL8QtypfdnKJqdo3pGdZDAmdhqTF_MaWm3rVjs
|
@ -51,4 +51,14 @@ file:
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#file:
|
#file:
|
||||||
# baseUrl: http://127.0.0.1:8085
|
# baseUrl: http://127.0.0.1:8085
|
||||||
|
vx:
|
||||||
|
token: vTniTyOG4csBmAnMr
|
||||||
|
encodingAesKey : gCmhw7vKLcZwsDszILPNSEqyjgRKODemkYmRFdfelmk
|
||||||
|
receiveid: wwa7cc4743271d6055
|
||||||
|
corpid: wwa7cc4743271d6055
|
||||||
|
corpsecret: qQNdRmtanymbshPOLgWTgB-TzX9QmNpVCpOx5suJ2xA
|
||||||
|
dkCorpsecret: 1MWQxoL8QtypfdnKJqdo3pGdZDAmdhqTF_MaWm3rVjs
|
||||||
|
salaryCorpsecretApp: ib0GyrjV573QdczASCeB-QmCsp0t_QpjsbnQwKBr-Os
|
||||||
|
salaryCorpsecretAppUrl: https://qyapi.weixin.qq.com/cgi-bin/message/send
|
||||||
|
dkcorpsecret: 1MWQxoL8QtypfdnKJqdo3pGdZDAmdhqTF_MaWm3rVjs
|
@ -155,7 +155,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
<if test="qo.objIds != null and qo.objIds.size() > 0">
|
||||||
and id in
|
and s.id in
|
||||||
<foreach collection="qo.objIds" item="id" index="index"
|
<foreach collection="qo.objIds" item="id" index="index"
|
||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
@ -165,7 +165,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<if test="qo.projectIds != null and qo.projectIds.size() > 0">
|
<if test="qo.projectIds != null and qo.projectIds.size() > 0">
|
||||||
and project in
|
and s.project in
|
||||||
<foreach collection="qo.projectIds" item="id" index="index"
|
<foreach collection="qo.projectIds" item="id" index="index"
|
||||||
open="(" close=")" separator=",">
|
open="(" close=")" separator=",">
|
||||||
#{id}
|
#{id}
|
||||||
@ -177,38 +177,38 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'WGB' ">
|
<if test="qo.searchVal == 'WGB' ">
|
||||||
-- 未关闭
|
-- 未关闭
|
||||||
and status !='closed'
|
and s.status !='closed'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'YWCJ' ">
|
<if test="qo.searchVal == 'YWCJ' ">
|
||||||
-- 由我创建
|
-- 由我创建
|
||||||
and openedBy =#{qo.userName}
|
and s.openedBy =#{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'ZPGW' ">
|
<if test="qo.searchVal == 'ZPGW' ">
|
||||||
-- 指派给我
|
-- 指派给我
|
||||||
and assignedTo =#{qo.userName}
|
and s.assignedTo =#{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'YWJJ' ">
|
<if test="qo.searchVal == 'YWJJ' ">
|
||||||
-- 由我解决
|
-- 由我解决
|
||||||
and resolvedBy =#{qo.userName}
|
and resolvedBy =#{qo.userName}
|
||||||
and status= 'resolved'
|
and s.status= 'resolved'
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'YWZP' ">
|
<if test="qo.searchVal == 'YWZP' ">
|
||||||
-- 由我指派
|
-- 由我指派
|
||||||
and openedBy =#{qo.userName}
|
and s.openedBy =#{qo.userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="qo.searchVal == 'WJJ' ">
|
<if test="qo.searchVal == 'WJJ' ">
|
||||||
-- //未解决
|
-- //未解决
|
||||||
and status= 'active'
|
and s.status= 'active'
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal == 'WQR' ">
|
<if test="qo.searchVal == 'WQR' ">
|
||||||
-- //未确认
|
-- //未确认
|
||||||
and confirmed= 0
|
and s.confirmed= 0
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="qo.searchVal == 'WZP' ">
|
<if test="qo.searchVal == 'WZP' ">
|
||||||
-- //未指派
|
-- //未指派
|
||||||
and assignedTo is null
|
and s.assignedTo is null
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
49
src/main/resources/mapper/ZtDevelopFeedbackMapper.xml
Normal file
49
src/main/resources/mapper/ZtDevelopFeedbackMapper.xml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.sa.zentao.mapper.ZtDevelopFeedbackMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtDevelopFeedback">
|
||||||
|
<result column="id" property="id" />
|
||||||
|
<result column="product_id" property="productId" />
|
||||||
|
<result column="level" property="level" />
|
||||||
|
<result column="propose_time" property="proposeTime" />
|
||||||
|
<result column="assigned_to" property="assignedTo" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
<result column="analysis_remark" property="analysisRemark" />
|
||||||
|
<result column="handle_remark" property="handleRemark" />
|
||||||
|
<result column="create_user" property="createUser" />
|
||||||
|
<result column="create_date" property="createDate" />
|
||||||
|
<result column="update_date" property="updateDate" />
|
||||||
|
<result column="update_user" property="updateUser" />
|
||||||
|
</resultMap>
|
||||||
|
<select id="pageList" resultType="com.sa.zentao.dao.ZtDevelopFeedbackDTO">
|
||||||
|
|
||||||
|
SELECT fb.*,p.`name` as productName from zt_develop_feedback fb,zt_product p WHERE 1=1 and fb.product_id = p.id
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and p.name like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.startDate!=null ">
|
||||||
|
and fb.create_date <![CDATA[>=]]> #{qo.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.endDate!=null ">
|
||||||
|
and fb.create_date <![CDATA[<=]]> #{qo.endDate}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="qo.productId != null ">
|
||||||
|
and p.id =#{qo.productId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
|
<select id="myFeedbackList" resultType="com.sa.zentao.dao.ZtDevelopFeedbackDTO">
|
||||||
|
SELECT fb.*,p.`name` as productName from zt_develop_feedback fb,zt_product p WHERE 1=1 and fb.product_id = p.id
|
||||||
|
|
||||||
|
<if test="qo.userName != null and qo.userName != '' ">
|
||||||
|
and fb.create_user = #{qo.userName}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
order by fb.id desc
|
||||||
|
limit 10
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
42
src/main/resources/mapper/ZtMeetingMapper.xml
Normal file
42
src/main/resources/mapper/ZtMeetingMapper.xml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.sa.zentao.mapper.ZtMeetingMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtMeeting">
|
||||||
|
<result column="id" property="id" />
|
||||||
|
<result column="product_id" property="productId" />
|
||||||
|
<result column="name" property="name" />
|
||||||
|
<result column="type" property="type" />
|
||||||
|
<result column="meeting_date" property="meetingDate" />
|
||||||
|
<result column="users" property="users" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
<result column="create_user" property="createUser" />
|
||||||
|
<result column="create_date" property="createDate" />
|
||||||
|
<result column="update_user" property="updateUser" />
|
||||||
|
<result column="update_date" property="updateDate" />
|
||||||
|
</resultMap>
|
||||||
|
<select id="pageList" resultType="com.sa.zentao.dao.ZtMeetingDTO">
|
||||||
|
|
||||||
|
|
||||||
|
SELECT m.* from zt_meeting m left join zt_product p on p.id = m.product_id
|
||||||
|
|
||||||
|
WHERE 1=1
|
||||||
|
|
||||||
|
<if test="qo.productId != null ">
|
||||||
|
and m.product_id =#{qo.productId}
|
||||||
|
</if>
|
||||||
|
<if test="qo.type != null ">
|
||||||
|
and m.type =#{qo.type.code}
|
||||||
|
</if>
|
||||||
|
<if test="qo.title != null and qo.title != '' ">
|
||||||
|
and p.name like concat('%', #{qo.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="qo.startDate!=null ">
|
||||||
|
and m.meeting_date <![CDATA[>=]]> #{qo.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="qo.endDate!=null ">
|
||||||
|
and m.meeting_date <![CDATA[<=]]> #{qo.endDate}
|
||||||
|
</if>
|
||||||
|
order by m.id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Reference in New Issue
Block a user