新版绩效考核方案
This commit is contained in:
@ -22,7 +22,7 @@ public class CodeGenerator {
|
||||
//自己的名字
|
||||
static String Author = "gqb";
|
||||
|
||||
public static String tableName = "zt_computer_source";
|
||||
public static String tableName = "base_user_role";
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -76,10 +76,11 @@ public class LoginRiskUser implements Serializable {
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactTel;
|
||||
//用户属性
|
||||
private UserType userType;
|
||||
public int getRiskUserId(){
|
||||
public String getRiskUserId(){
|
||||
|
||||
return userId;
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -95,9 +95,17 @@ public class ParamOutAspect {
|
||||
// }
|
||||
// }
|
||||
|
||||
//17462126
|
||||
//17462126 proceed,proceed==null?null:proceed.toString().length()
|
||||
try {
|
||||
int length = proceed==null?null:proceed.toString().length(); //分页日志太多不打印
|
||||
if(length<59591){
|
||||
log.info("[AOP-LOG-END-返回 ]\n\t{} {} size=", proceed,proceed==null?null:proceed.toString().length());
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
|
||||
log.info("[AOP-LOG-END-返回 ]\n\t{} {} size=", proceed,proceed==null?null:proceed.toString().length());
|
||||
return proceed;
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,11 @@ public class RiskUserThreadLocal {
|
||||
if(loginRiskUser==null){
|
||||
return false;
|
||||
}
|
||||
if(loginRiskUser.getRiskUserId()==2){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
if("admin".equals(loginRiskUser.getAccount())){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
119
src/main/java/com/sa/zentao/controller/BaseMenuController.java
Normal file
119
src/main/java/com/sa/zentao/controller/BaseMenuController.java
Normal file
@ -0,0 +1,119 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.entity.BaseMenu;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
import com.sa.zentao.qo.BaseMenuQo;
|
||||
import com.sa.zentao.service.IBaseMenuService;
|
||||
import com.sa.zentao.service.IBaseRoleAuthorityService;
|
||||
import com.sa.zentao.service.IBaseRoleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/base-menu")
|
||||
public class BaseMenuController {
|
||||
|
||||
@Autowired
|
||||
private IBaseMenuService baseMenuService;
|
||||
|
||||
@Autowired
|
||||
private IBaseRoleAuthorityService baseRoleAuthorityService;
|
||||
|
||||
@Autowired
|
||||
private IBaseRoleService baseRoleService;
|
||||
|
||||
|
||||
@RequestMapping("/insertMenu")
|
||||
public Result insertMenu(@RequestBody BaseMenuQo vo){
|
||||
log.info("--- 新增菜单 param --{}", JSON.toJSONString(vo));
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
return Result.success(baseMenuService.saveMenu(vo,loginRiskUser));
|
||||
}
|
||||
@RequestMapping("/getInfoById")
|
||||
public Result<BaseMenu> getInfoById(@RequestParam("id") Integer id){
|
||||
log.info("--- 通过ID获取菜单信息 param --{}", id);
|
||||
return Result.success(baseMenuService.selectById(id));
|
||||
}
|
||||
@RequestMapping("/updateMenu")
|
||||
public Result updateMenu(@RequestBody BaseMenuQo vo){
|
||||
log.info("--- 修改菜单 param --{}", JSON.toJSONString(vo));
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
return Result.success(baseMenuService.saveMenu(vo, loginRiskUser));
|
||||
}
|
||||
|
||||
@RequestMapping("/deleteMenu")
|
||||
public Result deleteMenu(@RequestParam("id") Integer id){
|
||||
log.info("--- 删除菜单 param --{}", id);
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
return Result.success(baseMenuService.deleteMenu(id,loginRiskUser));
|
||||
}
|
||||
|
||||
@RequestMapping("/moveUp")
|
||||
public Result moveUp(@RequestParam("id") Integer id){
|
||||
log.info("--- 上移菜单 param --{}", id);
|
||||
return Result.success(baseMenuService.moveUp(id));
|
||||
}
|
||||
|
||||
@RequestMapping("/moveDown")
|
||||
public Result moveDown(@RequestParam("id") Integer id){
|
||||
log.info("--- 下移菜单 param --{}", id);
|
||||
return Result.success(baseMenuService.moveDown(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/menuTree")
|
||||
public Result menuTree(){
|
||||
log.info("--- Tree param --{}");
|
||||
List<BaseMenu> list = baseMenuService.list();
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
if(loginRiskUser==null){
|
||||
throw new BusinessException("未登录");
|
||||
}
|
||||
// if(loginRiskUser.getUserId()==1){
|
||||
// return Result.success(list);
|
||||
// }
|
||||
return Result.success(baseMenuService.menuTree(loginRiskUser));
|
||||
}
|
||||
|
||||
@GetMapping("/baseMenuTree")
|
||||
public Result baseMenuTree(){
|
||||
return Result.success(baseMenuService.baseMenuTree());
|
||||
}
|
||||
|
||||
@GetMapping("/roleMenuIds")
|
||||
public Result roleMenuIds(@RequestParam("roleId") Long roleId){
|
||||
log.info("--- Tree param --{}");
|
||||
List<BaseMenu> list = baseMenuService.list();
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
if(loginRiskUser==null){
|
||||
throw new BusinessException("未登录");
|
||||
}
|
||||
|
||||
List<BaseRoleAuthority> listAuth = baseRoleAuthorityService.list(new QueryWrapper<BaseRoleAuthority>().lambda().eq(BaseRoleAuthority::getRoleId, roleId));
|
||||
|
||||
|
||||
return Result.success(listAuth.stream().map(o->o.getMenuId()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
}
|
151
src/main/java/com/sa/zentao/controller/BaseRoleController.java
Normal file
151
src/main/java/com/sa/zentao/controller/BaseRoleController.java
Normal file
@ -0,0 +1,151 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.BaseRoleDTO;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.entity.BaseRole;
|
||||
import com.sa.zentao.qo.BaseRoleQo;
|
||||
import com.sa.zentao.service.IBaseRoleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.RestController;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/base-role")
|
||||
public class BaseRoleController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IBaseRoleService baseRoleService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result add(@RequestBody BaseRoleDTO baseRoleDTO) {
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
log.info("新增角色 --{},操作人--{}", JSON.toJSONString(baseRoleDTO), JSON.toJSONString(loginRiskUser));
|
||||
if (Objects.isNull(loginRiskUser)){
|
||||
throw new BusinessException("未登录");
|
||||
}
|
||||
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
jakarta.servlet.http.HttpServletRequest request = servletRequestAttributes.getRequest();
|
||||
|
||||
BaseRole oldName = baseRoleService.getOne(new QueryWrapper<BaseRole>().eq("name", baseRoleDTO.getName()));
|
||||
|
||||
if (oldName != null) {
|
||||
throw new BusinessException("重复");
|
||||
}
|
||||
|
||||
baseRoleService.add(baseRoleDTO);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
public Result delete(@RequestBody BaseRoleQo baseRoleVo) {
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
if (Objects.isNull(loginRiskUser)){
|
||||
throw new BusinessException("未登录");
|
||||
}
|
||||
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
|
||||
if (baseRoleVo.getRoleId()==null) {
|
||||
throw new BusinessException("当前不存在");
|
||||
}
|
||||
BaseRole baseRole = baseRoleService.getById(baseRoleVo.getRoleId());
|
||||
log.info("删除角色 --{},操作人--{}", JSON.toJSONString(baseRole), JSON.toJSONString(loginRiskUser));
|
||||
baseRoleService.delete(baseRole,baseRoleVo);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("modify")
|
||||
public Result modify(@RequestBody BaseRoleDTO baseRoleDTO) {
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
log.info("修改角色 --{},操作人--{}", JSON.toJSONString(baseRoleDTO), JSON.toJSONString(loginRiskUser));
|
||||
if (Objects.isNull(loginRiskUser)){
|
||||
throw new BusinessException("请登录");
|
||||
}
|
||||
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
|
||||
|
||||
BaseRole oldName = baseRoleService.getOne(new QueryWrapper<BaseRole>().eq("name", baseRoleDTO.getName()));
|
||||
|
||||
BaseRole baseRole = baseRoleService.getById(baseRoleDTO.getId());
|
||||
if (Objects.nonNull(oldName) && !Objects.equals(oldName.getId(),baseRole.getId())){
|
||||
throw new BusinessException("数据重复");
|
||||
}
|
||||
baseRoleService.modify(baseRoleDTO, baseRole);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@RequestMapping("/pageList")
|
||||
public Result<PageInfo<BaseRoleDTO>> pageList(@RequestBody BaseRoleQo vo){
|
||||
log.info("--- 用户列表 param --{}", JSON.toJSONString(vo));
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.risk.get();
|
||||
if (Objects.isNull(loginRiskUser)){
|
||||
throw new BusinessException("请登录");
|
||||
}
|
||||
PageInfo<BaseRoleDTO> list = baseRoleService.selectPageList(vo);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id查询对应信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getInfoById")
|
||||
public Result getInfoById(Integer id){
|
||||
log.info("--- 据角色id查询对应信息 param --{}", JSON.toJSONString(id));
|
||||
BaseRoleDTO baseRoleDTO = baseRoleService.getInfoById(id);
|
||||
return Result.success(baseRoleDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id查询对应信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getUserRoleIds")
|
||||
public Result getUserRoleIds(@RequestBody BaseRoleQo vo ){
|
||||
List<Integer> userRoles= baseRoleService.getUserRoleIds(vo.getAccount());
|
||||
return Result.success(userRoles);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base-user-role")
|
||||
public class BaseUserRoleController {
|
||||
|
||||
}
|
@ -20,6 +20,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -133,7 +134,9 @@ public class ZtCountController {
|
||||
public Result projectListAsc(@RequestBody ZtCaseDTO dto){
|
||||
|
||||
List<Integer> authList = this.projectService.authList();
|
||||
|
||||
if(CollectionUtils.isEmpty(authList)){
|
||||
return Result.success() ;
|
||||
}
|
||||
List<ZtProject> project = projectService.list(new QueryWrapper<ZtProject>().lambda().eq(ZtProject::getType, "program")
|
||||
.in(ZtProject::getId,authList)
|
||||
.eq(ZtProject::getStatus,"doing")
|
||||
|
@ -13,6 +13,7 @@ import com.sa.zentao.service.IZtKanbancolumnService;
|
||||
import com.sa.zentao.service.IZtKanbanlaneService;
|
||||
import com.sa.zentao.service.IZtProductService;
|
||||
import com.sa.zentao.service.IZtProjectService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -22,7 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -34,6 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-project")
|
||||
@Slf4j
|
||||
public class ZtProjectController {
|
||||
|
||||
@Autowired
|
||||
|
@ -105,14 +105,14 @@ public class ZtStoryFeedbackController {
|
||||
|
||||
//提交验收
|
||||
@RequestMapping(value = "/submitVerified", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result submitVerified(@RequestBody ZtStoryDTO dto){
|
||||
public Result submitVerified(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.submitVerified(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
//提交验收
|
||||
@RequestMapping(value = "/storyYs", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result storyYs(@RequestBody ZtStoryDTO dto){
|
||||
public Result storyYs(@RequestBody ZtStoryFeedbackDTO dto){
|
||||
storyFeedbackService.storyYs(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
@ -7,11 +7,13 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.Result;
|
||||
import com.sa.zentao.dao.ZtStoryDTO;
|
||||
import com.sa.zentao.dao.ZtStoryUserDTO;
|
||||
import com.sa.zentao.entity.ZtStory;
|
||||
import com.sa.zentao.entity.ZtStoryUser;
|
||||
import com.sa.zentao.enums.UserStoryEnums;
|
||||
import com.sa.zentao.qo.StoryQo;
|
||||
import com.sa.zentao.qo.ZtProjectQo;
|
||||
import com.sa.zentao.service.IZtStoryUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -34,6 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-story-user")
|
||||
@Slf4j
|
||||
public class ZtStoryUserController {
|
||||
|
||||
@Autowired
|
||||
@ -68,7 +72,11 @@ public class ZtStoryUserController {
|
||||
|
||||
@RequestMapping(value = "/pageList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result pageList(@RequestBody StoryQo qo){
|
||||
Long l = System.currentTimeMillis();
|
||||
Long l2 = System.currentTimeMillis();
|
||||
|
||||
PageInfo<ZtStoryUserDTO> p = storyUserService.pageList(qo);
|
||||
log.info("总耗时---------------------------------- {}",l2-l);
|
||||
return Result.success(p);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.sa.zentao.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-story-userspec")
|
||||
public class ZtStoryUserspecController {
|
||||
|
||||
}
|
@ -24,6 +24,7 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.sms.v20190711.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -49,6 +50,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zt-user")
|
||||
@Slf4j
|
||||
public class ZtUserController {
|
||||
|
||||
@Autowired
|
||||
@ -177,24 +179,8 @@ public class ZtUserController {
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtUser> add(@RequestBody ZtUserDTO user){
|
||||
|
||||
ZtUser login = userService.getOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, user.getAccount()));
|
||||
if(login!=null){
|
||||
throw new BusinessException("存在");
|
||||
}
|
||||
ZtUser ztUser = new ZtUser();
|
||||
BeanUtils.copyProperties(user,ztUser);
|
||||
List<String> productList = user.getProductList();
|
||||
if(!CollectionUtils.isEmpty(productList)){
|
||||
ztUser.setProductIds(StringUtils.join(productList,","));
|
||||
}
|
||||
|
||||
ztUser.setPinyin(ChineseUtil.getFirst(ztUser.getNickname()));
|
||||
if(!StringUtils.isEmpty(ztUser.getVx())){
|
||||
ztUser.setVx(CryptoUtils.aesEncryptForFront(ztUser.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
this.userService.save(ztUser);
|
||||
this.actionService.addAction(ActionType.USER, ActionStatus.XJ,ztUser.getId(),null,null,null, RiskUserThreadLocal.get().getName(),null,ztUser.getAccount());
|
||||
userService.addUser(user);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
@ -234,53 +220,24 @@ public class ZtUserController {
|
||||
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtUser> modify(@RequestBody ZtUserDTO user){
|
||||
|
||||
ZtUser ztUser = userService.getById(user.getId());
|
||||
userService.modifyUser(user);
|
||||
|
||||
if(ztUser==null){
|
||||
throw new BusinessException("不存在");
|
||||
}
|
||||
List<ZtUser> list = userService.list(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, user.getAccount())
|
||||
.ne(ZtUser::getId, user.getId())
|
||||
);
|
||||
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
throw new BusinessException("请检查用户");
|
||||
}
|
||||
if(!ztUser.getNickname().equals(user.getNickname())){
|
||||
ztUser.setPinyin(ChineseUtil.getFirst(ztUser.getNickname()));
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(user.getVx())){
|
||||
ztUser.setVx(CryptoUtils.aesEncryptForFront(user.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
ztUser.setAccount(user.getAccount());
|
||||
|
||||
ztUser.setPassword(user.getPassword());
|
||||
ztUser.setUserType(user.getUserType());
|
||||
ztUser.setEmail(user.getEmail());
|
||||
ztUser.setPhone(user.getPhone());
|
||||
if(!CollectionUtils.isEmpty(user.getProductList())){
|
||||
ztUser.setProductIds(StringUtils.join(user.getProductList(),","));
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/updateVx", method = RequestMethod.GET, produces = "application/json; charset=UTF-8")
|
||||
public Result<ZtUser> updateVx(){
|
||||
List<ZtUser> list = this.userService.list();
|
||||
for (ZtUser u:list) {
|
||||
if(!StringUtils.isEmpty(u.getVx())){
|
||||
u.setVx(CryptoUtils.aesEncryptForFront(u.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
}
|
||||
userService.saveOrUpdateBatch(list);
|
||||
log.info("",list);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
71
src/main/java/com/sa/zentao/dao/BaseMenuDTO.java
Normal file
71
src/main/java/com/sa/zentao/dao/BaseMenuDTO.java
Normal file
@ -0,0 +1,71 @@
|
||||
package com.sa.zentao.dao;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jiangheng
|
||||
* @CreateDate in 2021/5/28 16:10
|
||||
*/
|
||||
@Data
|
||||
public class BaseMenuDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
private Integer isSys;
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 级别 1父菜单 2子菜单 3按钮
|
||||
*/
|
||||
private Integer level;
|
||||
private Integer menuType;
|
||||
|
||||
private List<BaseMenuDTO> menuList;
|
||||
|
||||
public void add(BaseMenuDTO t) {
|
||||
if (menuList == null) {
|
||||
menuList = new ArrayList<>();
|
||||
}
|
||||
menuList.add(t);
|
||||
}
|
||||
}
|
79
src/main/java/com/sa/zentao/dao/BaseRoleDTO.java
Normal file
79
src/main/java/com/sa/zentao/dao/BaseRoleDTO.java
Normal file
@ -0,0 +1,79 @@
|
||||
package com.sa.zentao.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Data
|
||||
public class BaseRoleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private Integer roleType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 1删除 0有效
|
||||
*/
|
||||
private Integer deleteFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
|
||||
// private List<ListMenuDTO> listMenu;
|
||||
|
||||
|
||||
/**
|
||||
* 全选菜单id
|
||||
*/
|
||||
private String allPickMenuIds;
|
||||
|
||||
/**
|
||||
* 半选菜单id
|
||||
*/
|
||||
private String halfPickMenuIds;
|
||||
|
||||
private Integer menuType;
|
||||
|
||||
}
|
@ -23,6 +23,16 @@ public class PerformanceDTO implements Serializable {
|
||||
// 小时
|
||||
@ExcelIgnore
|
||||
private BigDecimal approvalDays;
|
||||
//发布验收绩效
|
||||
@ExcelIgnore
|
||||
private BigDecimal releaseScore=BigDecimal.ZERO;
|
||||
//会议绩效
|
||||
@ExcelIgnore
|
||||
private BigDecimal meetScore=BigDecimal.ZERO;
|
||||
|
||||
//拆分任务工时
|
||||
@ExcelIgnore
|
||||
private BigDecimal splitTimeScore=BigDecimal.ZERO;
|
||||
//实际产出工时
|
||||
@ExcelProperty(value = "可用工时",index =3)
|
||||
private BigDecimal totalTime;
|
||||
@ -47,15 +57,20 @@ public class PerformanceDTO implements Serializable {
|
||||
@ExcelProperty(value = "完成准时率 ",index =11)
|
||||
private BigDecimal finishPunctuality;
|
||||
@ExcelProperty(value = "准时率得分 ",index =12)
|
||||
private BigDecimal punctualityScore;
|
||||
private BigDecimal punctualityScore=BigDecimal.ZERO;
|
||||
@ExcelProperty(value = "线上严重bug ",index =13)
|
||||
private BigDecimal seriousBug;
|
||||
//缺陷检出率
|
||||
@ExcelIgnore
|
||||
private BigDecimal bugFindScore;
|
||||
//产出线上Bug
|
||||
@ExcelProperty(value = "线上普通bug ",index =14)
|
||||
private BigDecimal slightBug;
|
||||
@ExcelIgnore
|
||||
private BigDecimal bugCount=BigDecimal.ZERO;
|
||||
//线上Bug得分
|
||||
@ExcelProperty(value = "线上Bug得分 ",index =15)
|
||||
private BigDecimal bugScore;
|
||||
private BigDecimal bugScore=BigDecimal.ZERO;
|
||||
//产出线上Bug
|
||||
@ExcelProperty(value = "总分 ",index =16)
|
||||
private BigDecimal score;
|
||||
|
@ -100,5 +100,6 @@ public class ZtComputerSourceDTO implements Serializable {
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
private String code;
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,8 @@ public class ZtMeetingDTO implements Serializable {
|
||||
|
||||
private String title;
|
||||
|
||||
private Integer userStory;
|
||||
|
||||
private String userStoryName;
|
||||
|
||||
private String storyIds;
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ public class ZtReleaseDTO implements Serializable {
|
||||
private String assignedToName;
|
||||
|
||||
private Date releaseDate;
|
||||
//真实发布时间
|
||||
private Date realReleaseDate;
|
||||
|
||||
private String noticeTitle;
|
||||
|
||||
|
@ -141,7 +141,7 @@ public class ZtStoryDTO implements Serializable {
|
||||
|
||||
@TableField("releasedDate")
|
||||
private Date releaseddate;
|
||||
|
||||
private Date planYsDate;
|
||||
@TableField("closedBy")
|
||||
private String closedby;
|
||||
|
||||
|
@ -116,4 +116,8 @@ public class ZtStoryFeedbackDTO implements Serializable {
|
||||
//1通过 2不通过
|
||||
private Integer ysFlag;
|
||||
|
||||
private String desc;
|
||||
// 1通过 2不通过
|
||||
private Integer revieweResult;
|
||||
|
||||
}
|
||||
|
@ -130,7 +130,12 @@ public class ZtUserDTO implements Serializable {
|
||||
|
||||
private String userTypeValue;
|
||||
|
||||
private String roleTypeValue;
|
||||
|
||||
private List<String> productList;
|
||||
|
||||
private List<Integer> roleList;
|
||||
|
||||
private String productIds;
|
||||
private String productNames;
|
||||
|
||||
|
70
src/main/java/com/sa/zentao/entity/BaseMenu.java
Normal file
70
src/main/java/com/sa/zentao/entity/BaseMenu.java
Normal file
@ -0,0 +1,70 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Data
|
||||
public class BaseMenu implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
private Integer isSys;
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 级别 1父菜单 2子菜单 3按钮
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
// 1菜单 2.按钮
|
||||
private Integer menuType;
|
||||
}
|
64
src/main/java/com/sa/zentao/entity/BaseRole.java
Normal file
64
src/main/java/com/sa/zentao/entity/BaseRole.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Data
|
||||
public class BaseRole implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private Integer roleType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 1删除 0有效
|
||||
*/
|
||||
private Integer deleteFlag;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
|
||||
}
|
57
src/main/java/com/sa/zentao/entity/BaseRoleAuthority.java
Normal file
57
src/main/java/com/sa/zentao/entity/BaseRoleAuthority.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sa.zentao.enums.PickEnum;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
@Data
|
||||
public class BaseRoleAuthority implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 菜单id
|
||||
*/
|
||||
private Integer menuId;
|
||||
|
||||
/**
|
||||
* 1、全选 2、半选
|
||||
*/
|
||||
private PickEnum type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
41
src/main/java/com/sa/zentao/entity/BaseUserRole.java
Normal file
41
src/main/java/com/sa/zentao/entity/BaseUserRole.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BaseUserRole implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 门店用户
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -41,7 +43,7 @@ public class ZtActionrecent implements Serializable {
|
||||
|
||||
private String action;
|
||||
|
||||
private LocalDateTime date;
|
||||
private Date date;
|
||||
|
||||
private String comment;
|
||||
|
||||
|
@ -194,13 +194,12 @@ public class ZtBug implements Serializable {
|
||||
|
||||
private String fileUrl;
|
||||
|
||||
|
||||
// dev prod
|
||||
private String bugType;
|
||||
|
||||
private String ysUser;
|
||||
//1 通过 2不通过
|
||||
private Integer ysFlag;
|
||||
private String ysRemark;
|
||||
@TableField(exist = false)
|
||||
private Integer releaseFlag;
|
||||
}
|
||||
|
@ -101,5 +101,5 @@ public class ZtComputerSource implements Serializable {
|
||||
|
||||
private Date updateDate;
|
||||
|
||||
|
||||
private String code;
|
||||
}
|
||||
|
@ -66,6 +66,8 @@ public class ZtMeeting implements Serializable {
|
||||
private String address;
|
||||
private String title;
|
||||
|
||||
private Integer userStory;
|
||||
// private Integer userStory;
|
||||
|
||||
private String storyIds;
|
||||
|
||||
}
|
||||
|
@ -80,7 +80,9 @@ public class ZtRelease implements Serializable {
|
||||
private String executions;
|
||||
@TableField("`level`")
|
||||
private String level;
|
||||
|
||||
//真实发布时间
|
||||
@TableField(exist = false)
|
||||
private Date realReleaseDate;
|
||||
private String danger;
|
||||
|
||||
private String assignedTo;
|
||||
|
@ -70,7 +70,7 @@ public class ZtStoryFeedback implements Serializable {
|
||||
|
||||
private String spec;
|
||||
|
||||
// wait doing finished submitVerified 提交验收 closed reviewing verified 验收 dontHand 无需处理
|
||||
// wait doing finished submitVerified 提交验收 closed reviewing verified 验收 dontHand 无需处理 (查询用noVerified 验收不通过)
|
||||
private String status;
|
||||
|
||||
|
||||
|
35
src/main/java/com/sa/zentao/entity/ZtStoryUserspec.java
Normal file
35
src/main/java/com/sa/zentao/entity/ZtStoryUserspec.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.sa.zentao.entity;
|
||||
|
||||
import java.sql.Blob;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ZtStoryUserspec implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer story;
|
||||
|
||||
private Integer version;
|
||||
|
||||
private String title;
|
||||
|
||||
private String spec;
|
||||
|
||||
private String verify;
|
||||
|
||||
private String files;
|
||||
|
||||
|
||||
}
|
@ -12,7 +12,7 @@ public enum ActionStatus {
|
||||
SC(6, "deleted","删除"),
|
||||
JH(7, "activated","激活"),
|
||||
GQ(8, "suspended","挂起"),
|
||||
PS(9, "submitreview","提交评审人"),
|
||||
PS(9, "submitreview","提交至评审"),
|
||||
CX(9, "recalled","撤销评审"),
|
||||
WC(10, "finished","完成"),
|
||||
QX(11, "canceled","取消"),
|
||||
|
31
src/main/java/com/sa/zentao/enums/BaseMenuLevelEnum.java
Normal file
31
src/main/java/com/sa/zentao/enums/BaseMenuLevelEnum.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.sa.zentao.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
/**
|
||||
* @author jiangheng
|
||||
* @CreateDate in 2021/5/28 15:14
|
||||
*/
|
||||
public enum BaseMenuLevelEnum {
|
||||
|
||||
PARENT_MENU(1, "父菜单"),
|
||||
CHILD_MENU(2,"二级子菜单"),
|
||||
BUTTON(2,"按钮");
|
||||
|
||||
@EnumValue//标记数据库存的值是code
|
||||
private int code;
|
||||
private String value;
|
||||
|
||||
BaseMenuLevelEnum(int code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
30
src/main/java/com/sa/zentao/enums/PickEnum.java
Normal file
30
src/main/java/com/sa/zentao/enums/PickEnum.java
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by Fernflower decompiler)
|
||||
//
|
||||
|
||||
package com.sa.zentao.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum PickEnum {
|
||||
ALL_PICK(1, "全选"),
|
||||
HALF_PICK(2, "半选");
|
||||
|
||||
@EnumValue
|
||||
private int code;
|
||||
private String value;
|
||||
|
||||
private PickEnum(int code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ public enum UserStoryEnums {
|
||||
DPS("reviewing", "待评审",0),
|
||||
CG("draft", "草稿",1),
|
||||
JH("active", "激活",2),
|
||||
UNCFM("unconfirmed", "产品确认中",3),
|
||||
UNCFM("unconfirmed", "需求明确中",3),
|
||||
DGT("waitcommunicate", "待沟通",4),
|
||||
|
||||
DSJ("waitdesign","需求待设计",5),
|
||||
|
@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum UserType {
|
||||
|
||||
CP(1,"产品"),
|
||||
CP(1,"需求"),
|
||||
XMGLY(2, "项目管理员"),
|
||||
KFZ(3, "开发者"),
|
||||
GSGC(4, "公司高层"),
|
||||
CS(5, "测试人员"),
|
||||
YW(6, "运维"),
|
||||
UI(7, "UI工程师"),
|
||||
XMJL(8, "项目经理"),
|
||||
XMZL(9, "项目助理"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
30
src/main/java/com/sa/zentao/mapper/BaseMenuMapper.java
Normal file
30
src/main/java/com/sa/zentao/mapper/BaseMenuMapper.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.entity.BaseMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
public interface BaseMenuMapper extends BaseMapper<BaseMenu> {
|
||||
|
||||
List<BaseMenu> findAll();
|
||||
|
||||
void deleteWithChild(Integer id);
|
||||
|
||||
List<BaseMenu> selectMenuByParentId(@Param("parentId") Integer parentId);
|
||||
|
||||
List<BaseMenu> queryListByLoginUser(@Param("riskUserId") String riskUserId);
|
||||
|
||||
List<Integer> findMenuIds(Integer id);
|
||||
|
||||
List<BaseMenu> queryAllList();
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
import com.sa.zentao.enums.PickEnum;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
public interface BaseRoleAuthorityMapper extends BaseMapper<BaseRoleAuthority> {
|
||||
|
||||
Integer deleteByRoleId(@Param("roleId") Integer roleId);
|
||||
|
||||
void deleteRoleAndMenu(@Param("roleIds") List<Integer> roleIds, @Param("menuIds") List<Integer> menuIds);
|
||||
|
||||
String findMenuIdById(@Param("roleId") Integer id, @Param("pickEnum") PickEnum pickEnum);
|
||||
}
|
24
src/main/java/com/sa/zentao/mapper/BaseRoleMapper.java
Normal file
24
src/main/java/com/sa/zentao/mapper/BaseRoleMapper.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.dao.BaseRoleDTO;
|
||||
import com.sa.zentao.entity.BaseRole;
|
||||
import com.sa.zentao.qo.BaseRoleQo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
public interface BaseRoleMapper extends BaseMapper<BaseRole> {
|
||||
|
||||
List<BaseRoleDTO> selectRoleByVo(@Param("vo") BaseRoleQo vo);
|
||||
|
||||
BaseRoleDTO findRoleById(@Param("id") Integer id);
|
||||
}
|
20
src/main/java/com/sa/zentao/mapper/BaseUserRoleMapper.java
Normal file
20
src/main/java/com/sa/zentao/mapper/BaseUserRoleMapper.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sa.zentao.entity.BaseUserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface BaseUserRoleMapper extends BaseMapper<BaseUserRole> {
|
||||
|
||||
void insertUserRole(@Param("id") Long id, @Param("roleId") String[] roleId);
|
||||
|
||||
String getRoleIdsById(@Param("id") Long id);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.sa.zentao.mapper;
|
||||
|
||||
import com.sa.zentao.entity.ZtStoryUserspec;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-15
|
||||
*/
|
||||
public interface ZtStoryUserspecMapper extends BaseMapper<ZtStoryUserspec> {
|
||||
|
||||
}
|
58
src/main/java/com/sa/zentao/qo/BaseMenuQo.java
Normal file
58
src/main/java/com/sa/zentao/qo/BaseMenuQo.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.sa.zentao.qo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author jiangheng
|
||||
* @CreateDate in 2021/5/28 15:21
|
||||
*/
|
||||
@Data
|
||||
public class BaseMenuQo extends BaseQo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
private Integer isSys;
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 级别 1父菜单 2子菜单 3按钮
|
||||
*/
|
||||
private Integer level;
|
||||
// 1菜单 2.按钮
|
||||
private Integer menuType;
|
||||
}
|
60
src/main/java/com/sa/zentao/qo/BaseRoleQo.java
Normal file
60
src/main/java/com/sa/zentao/qo/BaseRoleQo.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.sa.zentao.qo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BaseRoleQo implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Integer currentPage = 1;
|
||||
@ExcelIgnore
|
||||
private Integer pageSize = 20;
|
||||
@ExcelIgnore
|
||||
private Date startDate;
|
||||
@ExcelIgnore
|
||||
private Date endDate;
|
||||
|
||||
private Integer userId;
|
||||
private String account;
|
||||
private Integer roleId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private Integer roleType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 1删除 0有效
|
||||
*/
|
||||
private Integer deleteFlag;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
}
|
36
src/main/java/com/sa/zentao/service/IBaseMenuService.java
Normal file
36
src/main/java/com/sa/zentao/service/IBaseMenuService.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.dao.BaseMenuDTO;
|
||||
import com.sa.zentao.entity.BaseMenu;
|
||||
import com.sa.zentao.qo.BaseMenuQo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
public interface IBaseMenuService extends IService<BaseMenu> {
|
||||
|
||||
String saveMenu(BaseMenuQo vo, LoginRiskUser loginRiskUser);
|
||||
|
||||
BaseMenu selectById(Integer id);
|
||||
|
||||
String deleteMenu(Integer id, LoginRiskUser loginRiskUser);
|
||||
|
||||
String moveUp(Integer id);
|
||||
|
||||
String moveDown(Integer id);
|
||||
|
||||
List<BaseMenu> queryListByLoginUser(String riskUserId);
|
||||
|
||||
List<BaseMenuDTO> menuTree(LoginRiskUser loginRiskUser);
|
||||
|
||||
List<BaseMenuDTO> baseMenuTree();
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
public interface IBaseRoleAuthorityService extends IService<BaseRoleAuthority> {
|
||||
|
||||
Integer deleteByRoleId(Integer roleId);
|
||||
|
||||
}
|
35
src/main/java/com/sa/zentao/service/IBaseRoleService.java
Normal file
35
src/main/java/com/sa/zentao/service/IBaseRoleService.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.BaseRoleDTO;
|
||||
import com.sa.zentao.entity.BaseRole;
|
||||
import com.sa.zentao.qo.BaseRoleQo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
public interface IBaseRoleService extends IService<BaseRole> {
|
||||
|
||||
void modify(BaseRoleDTO baseRoleDTO, BaseRole baseRole);
|
||||
|
||||
void add(BaseRoleDTO baseRoleDTO);
|
||||
|
||||
PageInfo<BaseRoleDTO> selectPageList(BaseRoleQo vo);
|
||||
|
||||
BaseRoleDTO getInfoById(Integer id);
|
||||
|
||||
void delete(BaseRole baseRole, BaseRoleQo baseRoleVo);
|
||||
|
||||
List<Integer> getUserRoleIds(String account);
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.sa.zentao.entity.BaseUserRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
public interface IBaseUserRoleService extends IService<BaseUserRole> {
|
||||
|
||||
void addUserRole(String account, List<Integer> roleList);
|
||||
|
||||
void modifyUserRole(String account, List<Integer> roleList);
|
||||
}
|
@ -45,11 +45,11 @@ public interface IZtStoryFeedbackService extends IService<ZtStoryFeedback> {
|
||||
|
||||
void feedbackFinished(Integer feedbackId);
|
||||
|
||||
void submitVerified(ZtStoryDTO dto);
|
||||
void submitVerified(ZtStoryFeedbackDTO dto);
|
||||
|
||||
void ysFeedback(Integer feedbackId);
|
||||
|
||||
void storyYs(ZtStoryDTO dto);
|
||||
void storyYs(ZtStoryFeedbackDTO dto);
|
||||
|
||||
void dontHand(ZtStoryFeedbackDTO dto);
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.sa.zentao.service;
|
||||
|
||||
import com.sa.zentao.entity.ZtStoryUserspec;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-15
|
||||
*/
|
||||
public interface IZtStoryUserspecService extends IService<ZtStoryUserspec> {
|
||||
|
||||
}
|
@ -58,4 +58,12 @@ public interface IZtTaskService extends IService<ZtTask> {
|
||||
|
||||
List<ItApproval> itApprovalByUserName(String s, Date firstDayOfMonth, Date lastDayOfMonth);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param firstDayOfMonth 开始
|
||||
* @param lastDayOfMonth 结束
|
||||
* @param eIds 迭代
|
||||
* @return
|
||||
*/
|
||||
List<ZtTask> taskListByEIdsAndDate(Date firstDayOfMonth, Date lastDayOfMonth, List<Integer> eIds);
|
||||
}
|
||||
|
@ -51,4 +51,8 @@ public interface IZtUserService extends IService<ZtUser> {
|
||||
BaseDepartment getDepart(Integer departId);
|
||||
|
||||
ZtUser getByAccount(String openedby);
|
||||
|
||||
void addUser(ZtUserDTO user);
|
||||
|
||||
void modifyUser(ZtUserDTO user);
|
||||
}
|
||||
|
@ -0,0 +1,209 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.conf.LoginRiskUser;
|
||||
import com.sa.zentao.dao.BaseMenuDTO;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.entity.BaseMenu;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
import com.sa.zentao.entity.BaseUserRole;
|
||||
import com.sa.zentao.enums.BaseMenuLevelEnum;
|
||||
import com.sa.zentao.mapper.BaseMenuMapper;
|
||||
import com.sa.zentao.mapper.BaseRoleAuthorityMapper;
|
||||
import com.sa.zentao.mapper.BaseUserRoleMapper;
|
||||
import com.sa.zentao.qo.BaseMenuQo;
|
||||
import com.sa.zentao.service.IBaseMenuService;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.TreeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Service
|
||||
public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> implements IBaseMenuService {
|
||||
|
||||
@Autowired
|
||||
private BaseMenuMapper baseMenuMapper;
|
||||
@Autowired
|
||||
private BaseUserRoleMapper baseUserRoleMapper;
|
||||
@Autowired
|
||||
private BaseRoleAuthorityMapper baseRoleAuthorityMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public String saveMenu(BaseMenuQo vo, LoginRiskUser loginRiskUser) {
|
||||
//按钮
|
||||
if (2 == vo.getMenuType()){
|
||||
Boolean result = checkAction(vo.getId(),vo.getAction());
|
||||
if (!result){
|
||||
throw new BusinessException("菜单路径重复");
|
||||
}
|
||||
}
|
||||
BaseMenu bm = new BaseMenu();
|
||||
bm.setParentId(vo.getParentId());
|
||||
bm.setAction(vo.getAction());
|
||||
bm.setIcon(vo.getIcon());
|
||||
bm.setName(vo.getName());
|
||||
bm.setCreateTime(new Date());
|
||||
bm.setUpdateTime(new Date());
|
||||
bm.setIsSys(vo.getIsSys());
|
||||
bm.setMenuType(vo.getMenuType());
|
||||
if (Objects.isNull(vo.getParentId())){
|
||||
bm.setLevel(1);
|
||||
}else if (Objects.nonNull(vo.getParentId()) ){
|
||||
BaseMenu baseMenu = this.baseMenuMapper.selectById(vo.getParentId());
|
||||
bm.setLevel(baseMenu.getLevel()+1);
|
||||
}
|
||||
|
||||
if (Objects.isNull(vo.getId())){
|
||||
|
||||
List<BaseMenu> baseMenus = baseMenuMapper.findAll();
|
||||
Integer max = CollectionUtils.isEmpty(baseMenus)?1:baseMenus.stream().map(BaseMenu::getSort).max(Integer::compareTo).get();
|
||||
bm.setSort(max + 1);
|
||||
this.baseMenuMapper.insert(bm);
|
||||
|
||||
List<BaseUserRole> baseUserRoleList = baseUserRoleMapper.selectList(new QueryWrapper<BaseUserRole>().eq("user_id",loginRiskUser.getRiskUserId()));
|
||||
for (BaseUserRole baseUserRole : baseUserRoleList) {
|
||||
BaseRoleAuthority bra = new BaseRoleAuthority();
|
||||
bra.setMenuId(bm.getId());
|
||||
bra.setRoleId(baseUserRole.getRoleId());
|
||||
baseRoleAuthorityMapper.insert(bra);
|
||||
}
|
||||
return "新增成功";
|
||||
}else {
|
||||
bm.setId(vo.getId());
|
||||
bm.setSort(vo.getSort());
|
||||
bm.setUpdateTime(new Date());
|
||||
this.baseMenuMapper.updateById(bm);
|
||||
return "修改成功";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseMenu selectById(Integer id) {
|
||||
return this.baseMenuMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deleteMenu(Integer id, LoginRiskUser loginRiskUser) {
|
||||
//this.baseMenuMapper.deleteWithChild(id);
|
||||
List<Integer> menuIds = baseMenuMapper.findMenuIds(id);
|
||||
if (!CollectionUtils.isEmpty(menuIds)){
|
||||
this.baseMenuMapper.deleteBatchIds(menuIds);
|
||||
}
|
||||
List<BaseUserRole> baseUserRoleList = baseUserRoleMapper.selectList(new QueryWrapper<BaseUserRole>().eq("user_id",loginRiskUser.getRiskUserId()));
|
||||
List<Integer> roleIds = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(baseUserRoleList)){
|
||||
roleIds = baseUserRoleList.stream().map(o -> o.getRoleId()).collect(Collectors.toList());
|
||||
}
|
||||
this.baseRoleAuthorityMapper.deleteRoleAndMenu(roleIds,menuIds);
|
||||
|
||||
return "删除成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String moveUp(Integer id) {
|
||||
BaseMenu baseMenu = baseMenuMapper.selectById(id);
|
||||
if (Objects.nonNull(baseMenu)){
|
||||
List<BaseMenu> list = baseMenuMapper.selectMenuByParentId(baseMenu.getParentId());
|
||||
list.sort(((o1, o2) -> o1.getSort().compareTo(o2.getSort())));
|
||||
int index = list.lastIndexOf(baseMenu);
|
||||
if (index > 0){
|
||||
BaseMenu preMenu = list.get(index - 1);
|
||||
Integer preSort = preMenu.getSort();
|
||||
preMenu.setSort(baseMenu.getSort());
|
||||
baseMenuMapper.updateById(preMenu);
|
||||
baseMenu.setSort(preSort);
|
||||
baseMenuMapper.updateById(baseMenu);
|
||||
}
|
||||
}
|
||||
return "上移成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String moveDown(Integer id) {
|
||||
BaseMenu baseMenu = baseMenuMapper.selectById(id);
|
||||
if(Objects.nonNull(baseMenu)){
|
||||
List<BaseMenu> list = baseMenuMapper.selectMenuByParentId(baseMenu.getParentId());
|
||||
list.sort((o1, o2) -> o2.getSort().compareTo(o1.getSort()));
|
||||
int index = list.lastIndexOf(baseMenu);
|
||||
if(index > 0){
|
||||
BaseMenu preMenu = list.get(index - 1);
|
||||
Integer preSort = preMenu.getSort();
|
||||
preMenu.setSort(baseMenu.getSort());
|
||||
baseMenuMapper.updateById(preMenu);
|
||||
baseMenu.setSort(preSort);
|
||||
baseMenuMapper.updateById(baseMenu);
|
||||
}
|
||||
}
|
||||
return "下移成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseMenu> queryListByLoginUser(String riskUserId) {
|
||||
|
||||
return this.baseMenuMapper.queryListByLoginUser(riskUserId);
|
||||
}
|
||||
|
||||
|
||||
private Boolean checkAction(Integer id, String action) {
|
||||
if (StringUtils.isEmpty(action) || Objects.equals(action,"#")){
|
||||
return true;
|
||||
}
|
||||
|
||||
List<BaseMenu> baseMenus = new ArrayList<>();
|
||||
if (Objects.nonNull(id)){
|
||||
baseMenus = baseMenuMapper.selectList(new QueryWrapper<BaseMenu>().lambda().eq(BaseMenu::getAction, action).notIn(BaseMenu::getId, id));
|
||||
}else {
|
||||
baseMenus = baseMenuMapper.selectList(new QueryWrapper<BaseMenu>().lambda().eq(BaseMenu::getAction, action));
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(baseMenus)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前登录用户来获取页面权限、数据权限
|
||||
* @param loginRiskUser
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMenuDTO> menuTree(LoginRiskUser loginRiskUser) {
|
||||
List<BaseMenu> baseMenuList = new ArrayList<>();
|
||||
baseMenuList = this.queryListByLoginUser(loginRiskUser.getRiskUserId()).stream().sorted(Comparator.comparing(BaseMenu::getSort)).collect(Collectors.toList());
|
||||
|
||||
List<BaseMenuDTO> baseMenuDTOS = TreeUtils.buildByRecursive(BeanCopyUtil.copyListProperties(baseMenuList, BaseMenuDTO::new), null);
|
||||
return baseMenuDTOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有菜单及权限
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMenuDTO> baseMenuTree() {
|
||||
List<BaseMenu> baseMenuList = this.queryAllList().stream().sorted(Comparator.comparing(BaseMenu::getSort)).collect(Collectors.toList());
|
||||
List<BaseMenuDTO> baseMenuDTOS = TreeUtils.buildByRecursive(BeanCopyUtil.copyListProperties(baseMenuList, BaseMenuDTO::new), null);
|
||||
return baseMenuDTOS;
|
||||
}
|
||||
|
||||
public List<BaseMenu> queryAllList(){
|
||||
return this.baseMenuMapper.queryAllList();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
import com.sa.zentao.mapper.BaseRoleAuthorityMapper;
|
||||
import com.sa.zentao.service.IBaseRoleAuthorityService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
@Service
|
||||
public class BaseRoleAuthorityServiceImpl extends ServiceImpl<BaseRoleAuthorityMapper, BaseRoleAuthority> implements IBaseRoleAuthorityService {
|
||||
|
||||
@Override
|
||||
public Integer deleteByRoleId(Integer roleId) {
|
||||
|
||||
return this.baseMapper.deleteByRoleId(roleId);
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.dao.BaseRoleDTO;
|
||||
import com.sa.zentao.dao.BusinessException;
|
||||
import com.sa.zentao.entity.BaseRole;
|
||||
import com.sa.zentao.entity.BaseRoleAuthority;
|
||||
import com.sa.zentao.entity.BaseUserRole;
|
||||
import com.sa.zentao.enums.PickEnum;
|
||||
import com.sa.zentao.mapper.BaseRoleAuthorityMapper;
|
||||
import com.sa.zentao.mapper.BaseRoleMapper;
|
||||
import com.sa.zentao.mapper.BaseUserRoleMapper;
|
||||
import com.sa.zentao.qo.BaseRoleQo;
|
||||
import com.sa.zentao.service.IBaseRoleAuthorityService;
|
||||
import com.sa.zentao.service.IBaseRoleService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jobob
|
||||
* @since 2021-05-28
|
||||
*/
|
||||
@Service
|
||||
public class BaseRoleServiceImpl extends ServiceImpl<BaseRoleMapper, BaseRole> implements IBaseRoleService {
|
||||
|
||||
@Autowired
|
||||
private IBaseRoleAuthorityService baseRoleAuthorityService;
|
||||
@Autowired
|
||||
private BaseUserRoleMapper baseUserRoleMapper;
|
||||
@Autowired
|
||||
private BaseRoleMapper baseRoleMapper;
|
||||
@Autowired
|
||||
private BaseRoleAuthorityMapper baseRoleAuthorityMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void modify(BaseRoleDTO baseRoleDTO, BaseRole baseRole) {
|
||||
baseRole.setName(baseRoleDTO.getName());
|
||||
baseRole.setRemark(baseRoleDTO.getRemark());
|
||||
baseRole.setUpdateTime(new Date());
|
||||
this.baseMapper.updateById(baseRole);
|
||||
|
||||
baseRoleAuthorityService.deleteByRoleId(baseRole.getId());
|
||||
|
||||
batchSaveAndUpdate(baseRoleDTO, baseRole.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(BaseRoleDTO baseRoleDTO) {
|
||||
BaseRole baseRole = new BaseRole();
|
||||
|
||||
BeanUtils.copyProperties(baseRoleDTO, baseRole);
|
||||
this.baseMapper.insert(baseRole);
|
||||
|
||||
batchSaveAndUpdate(baseRoleDTO, baseRole.getId());
|
||||
}
|
||||
|
||||
private void batchSaveAndUpdate(BaseRoleDTO baseRoleDTO, Integer roleId){
|
||||
List<BaseRoleAuthority> baseRoleAuthority = new ArrayList<BaseRoleAuthority>();
|
||||
if (!StringUtils.isEmpty(baseRoleDTO.getAllPickMenuIds())) {
|
||||
Arrays.stream(baseRoleDTO.getAllPickMenuIds().split(",")).forEach(a ->{
|
||||
BaseRoleAuthority auth = new BaseRoleAuthority();
|
||||
auth.setCreateTime(new Date());
|
||||
auth.setMenuId(Integer.valueOf(a));
|
||||
auth.setRoleId(roleId);
|
||||
auth.setUpdateTime(new Date());
|
||||
auth.setType(PickEnum.ALL_PICK);
|
||||
baseRoleAuthority.add(auth);
|
||||
});
|
||||
}
|
||||
if (!StringUtils.isEmpty(baseRoleDTO.getHalfPickMenuIds())) {
|
||||
Arrays.stream(baseRoleDTO.getHalfPickMenuIds().split(",")).forEach(a -> {
|
||||
BaseRoleAuthority auth = new BaseRoleAuthority();
|
||||
auth.setCreateTime(new Date());
|
||||
auth.setMenuId(Integer.valueOf(a));
|
||||
auth.setRoleId(roleId);
|
||||
auth.setUpdateTime(new Date());
|
||||
auth.setType(PickEnum.HALF_PICK);
|
||||
baseRoleAuthority.add(auth);
|
||||
});
|
||||
}
|
||||
baseRoleAuthorityService.saveBatch(baseRoleAuthority);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BaseRoleDTO> selectPageList(BaseRoleQo vo) {
|
||||
Page page = PageHelper.startPage(vo.getCurrentPage(),vo.getPageSize());
|
||||
List<BaseRoleDTO> baseRoleDTOList = baseRoleMapper.selectRoleByVo(vo);
|
||||
// baseRoleDTOList=baseRoleDTOList.stream().filter(o->!o.getName().equalsIgnoreCase("系统管理员")).collect(Collectors.toList());
|
||||
return new PageInfo<>(baseRoleDTOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseRoleDTO getInfoById(Integer id) {
|
||||
if (Objects.isNull(id)){
|
||||
throw new BusinessException("id不能为空");
|
||||
}
|
||||
BaseRoleDTO baseRoleDTO = baseRoleMapper.findRoleById(id);
|
||||
String menuIds = baseRoleAuthorityMapper.findMenuIdById(id, PickEnum.ALL_PICK);
|
||||
baseRoleDTO.setAllPickMenuIds(menuIds);
|
||||
|
||||
return baseRoleDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BaseRole baseRole, BaseRoleQo baseRoleVo) {
|
||||
//删除角色
|
||||
this.removeById(baseRoleVo.getRoleId());
|
||||
|
||||
//删除角色权限
|
||||
baseRoleAuthorityService.deleteByRoleId(baseRoleVo.getRoleId());
|
||||
//删除角色数据权限
|
||||
// baseRoleAccountService.deleteByRoleId(baseRoleVo.getRoleId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getUserRoleIds(String account) {
|
||||
// LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||
// if(loginRiskUser==null){
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
List<BaseUserRole> baseUserRoles = this.baseUserRoleMapper.selectList(new QueryWrapper<BaseUserRole>()
|
||||
.lambda().eq(BaseUserRole::getUserId, account));
|
||||
if(CollectionUtils.isEmpty(baseUserRoles)){
|
||||
return new ArrayList<>();
|
||||
}else{
|
||||
return baseUserRoles.stream().map(o->o.getRoleId()).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sa.zentao.entity.BaseRole;
|
||||
import com.sa.zentao.entity.BaseUserRole;
|
||||
import com.sa.zentao.mapper.BaseUserRoleMapper;
|
||||
import com.sa.zentao.service.IBaseRoleService;
|
||||
import com.sa.zentao.service.IBaseUserRoleService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
@Service
|
||||
public class BaseUserRoleServiceImpl extends ServiceImpl<BaseUserRoleMapper, BaseUserRole> implements IBaseUserRoleService {
|
||||
|
||||
@Autowired
|
||||
private IBaseRoleService baseRoleService;
|
||||
|
||||
@Override
|
||||
public void addUserRole(String account, List<Integer> roleList) {
|
||||
|
||||
List<BaseRole> baseRoles = this.baseRoleService.listByIds(roleList);
|
||||
|
||||
List saveList=new ArrayList();
|
||||
for (Integer roleId:roleList) {
|
||||
BaseUserRole r=new BaseUserRole();
|
||||
r.setCreateTime(new Date());
|
||||
r.setUpdateTime(new Date());
|
||||
r.setRoleId(roleId);
|
||||
r.setUserId(account);
|
||||
saveList.add(r);
|
||||
}
|
||||
this.saveBatch(saveList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void modifyUserRole(String account, List<Integer> roleList) {
|
||||
this.remove(new QueryWrapper<BaseUserRole>().lambda().eq(BaseUserRole::getUserId,account));
|
||||
|
||||
if(!CollectionUtils.isEmpty(roleList)){
|
||||
List saveList=new ArrayList();
|
||||
for (Integer roleId:roleList) {
|
||||
BaseUserRole r=new BaseUserRole();
|
||||
r.setCreateTime(new Date());
|
||||
r.setUpdateTime(new Date());
|
||||
r.setRoleId(roleId);
|
||||
r.setUserId(account);
|
||||
saveList.add(r);
|
||||
}
|
||||
this.saveBatch(saveList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -85,6 +85,8 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
Map<String, ZtUser> userMap = userService.userMapByIds(null);
|
||||
Map<Integer, ZtProduct> map = getProductMap();
|
||||
Map<Integer,ZtStoryUser> sMap=getUserStoryMap(list);
|
||||
|
||||
for (ZtMeetingDTO d:list) {
|
||||
StringBuilder b=new StringBuilder();
|
||||
if(!StringUtils.isEmpty(d.getUsers())){
|
||||
@ -97,6 +99,19 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
}
|
||||
d.setUsersName(b.toString());
|
||||
}
|
||||
StringBuilder storyStr=new StringBuilder();
|
||||
if(!StringUtils.isEmpty( d.getStoryIds())){
|
||||
String[] split = d.getStoryIds().split(",");
|
||||
for (String s:split) {
|
||||
ZtStoryUser storyUser= sMap.get(Integer.valueOf(s));
|
||||
if(storyUser!=null){
|
||||
storyStr.append(storyUser.getTitle()).append(",");
|
||||
}
|
||||
}
|
||||
int i = storyStr.lastIndexOf(",");
|
||||
storyStr.replace(i,i+1,"");
|
||||
d.setUserStoryName(storyStr.toString());
|
||||
}
|
||||
ZtProduct ztProduct = map.get(d.getProductId());
|
||||
if(ztProduct!=null){
|
||||
d.setProductName(ztProduct.getName());
|
||||
@ -106,6 +121,19 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
return new PageInfo<ZtMeetingDTO>(list);
|
||||
}
|
||||
|
||||
private Map<Integer, ZtStoryUser> getUserStoryMap(List<ZtMeetingDTO> list) {
|
||||
List<ZtMeetingDTO> storyMeetList = list.stream().filter(o -> !StringUtils.isEmpty(o.getStoryIds())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(storyMeetList)){
|
||||
List sIds =new ArrayList();
|
||||
for (ZtMeetingDTO d:storyMeetList) {
|
||||
sIds.addAll(Arrays.asList(d.getStoryIds().split(",")));
|
||||
}
|
||||
List<ZtStoryUser> storyUsers = this.storyUserService.listByIds(sIds);
|
||||
return storyUsers.stream().collect(Collectors.toMap(ZtStoryUser::getId,o->o));
|
||||
}
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
private Map<Integer, ZtProduct> getProductMap() {
|
||||
List<ZtProduct> list = productService.list();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
@ -172,11 +200,9 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
ZtMeetingDTO ztMeetingDTO = new ZtMeetingDTO();
|
||||
|
||||
BeanUtils.copyProperties(ztMeeting,ztMeetingDTO);
|
||||
if(ztMeetingDTO.getUserStory()!=null&&ztMeetingDTO.getUserStory()!=0){
|
||||
ZtStoryUser storyUser = this.storyUserService.getById(ztMeetingDTO.getUserStory());
|
||||
if(storyUser!=null){
|
||||
ztMeetingDTO.setUserStoryName(storyUser.getTitle());
|
||||
}
|
||||
if(!StringUtils.isEmpty(ztMeeting.getStoryIds())){
|
||||
List<ZtStoryUser> storyUsers = this.storyUserService.listByIds(Arrays.asList(ztMeeting.getStoryIds().split(",")));
|
||||
ztMeetingDTO.setUserStoryName(storyUsers.stream().map(o->o.getTitle()).collect(Collectors.joining(",")));
|
||||
|
||||
}
|
||||
if(ztMeetingDTO.getProductId()!=null){
|
||||
@ -215,7 +241,7 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
|
||||
String pfdStr="<h1 style=\"line-height: 70px;font-size: 41px\">{meetType}记录 {titleDate} </h1>\n" +
|
||||
"\n" +
|
||||
"<div style=\"line-height: 50px;font-family: 宋体;\">会议名称: {name} </div>\n" +
|
||||
"<div style=\"line-height: 50px;font-family: 宋体;\">会议主题: {name} </div>\n" +
|
||||
"<div style=\"line-height: 50px;font-family: 宋体;\">会议时间: {meetingDate} </div>\n" +
|
||||
"<div style=\"line-height: 50px;font-family: 宋体\">会议地点: {address} </div>\n" +
|
||||
"<div style=\"line-height: 50px;font-family: 宋体\">参会人员: {usersName} </div>\n" +
|
||||
@ -226,7 +252,7 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
// 替换内容集合
|
||||
Map<String, String> textMap = new LinkedHashMap<>();
|
||||
textMap.put("titleDate", DateUtils.formatDate(ztMeeting.getMeetingDate(),"yyyy-MM-dd"));
|
||||
textMap.put("name", ztMeeting.getName());
|
||||
textMap.put("name", ztMeeting.getTitle());
|
||||
|
||||
pfdStr=pfdStr.replace("{meetType}",ztMeeting.getType().getValue());
|
||||
pfdStr=pfdStr.replace("{titleDate}",DateUtils.formatDate(ztMeeting.getMeetingDate(),"yyyy-MM-dd "));
|
||||
@ -329,9 +355,4 @@ public class ZtMeetingServiceImpl extends ServiceImpl<ZtMeetingMapper, ZtMeeting
|
||||
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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.*;
|
||||
import com.sa.zentao.entity.*;
|
||||
@ -17,10 +18,7 @@ import com.sa.zentao.mapper.ZtProjectMapper;
|
||||
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 com.sa.zentao.utils.KanBanConstant;
|
||||
import com.sa.zentao.utils.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -886,6 +884,11 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
}
|
||||
@Override
|
||||
public List<Integer> authList() {
|
||||
LoginRiskUser loginRiskUser = RiskUserThreadLocal.get();
|
||||
if(loginRiskUser==null){
|
||||
throw new BusinessException("请登录");
|
||||
}
|
||||
|
||||
ZtUser user = userService.selectByName(RiskUserThreadLocal.get().getName());
|
||||
if (user.getAccount().equals("admin")) {
|
||||
return this.baseMapper.selectList(new QueryWrapper<ZtProject>()
|
||||
@ -1473,20 +1476,24 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
//产品集
|
||||
String execution = qo.getExecution();
|
||||
|
||||
List<ZtTeam> teams = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getType, "execution")
|
||||
.eq(ZtTeam::getRoot, execution));
|
||||
if(CollectionUtils.isEmpty(teams)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.notIn(ZtTask::getStatus,"cancel","closed","reviewing" ,"draft")
|
||||
.ge(ZtTask::getEstStarted, firstDayOfMonth)
|
||||
.le(ZtTask::getEstStarted, lastDayOfMonth)
|
||||
.eq(ZtTask::getExecution, execution));
|
||||
.le(ZtTask::getEstStarted, lastDayOfMonth).in(ZtTask::getAssignedTo,teams.stream().map(o->o.getAccount()).collect(Collectors.toList())));
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<ZtEffort> effList = this.effortService.list(new QueryWrapper<ZtEffort>().lambda()
|
||||
.in(ZtEffort::getObjectid, list.stream().map(o -> o.getId()).collect(Collectors.toList())));
|
||||
|
||||
List<ZtTeam> teams = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getType, "execution")
|
||||
.eq(ZtTeam::getRoot, execution));
|
||||
|
||||
|
||||
List<String> accountIds = teams.stream().map(o -> o.getAccount()).distinct().collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(accountIds)) {
|
||||
@ -1774,12 +1781,15 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
Date date = qo.getDate()==null?new Date():qo.getDate();
|
||||
|
||||
Date firstDayOfMonth = DateUtils.getFirstDayOfMonth(date);
|
||||
Date lastDayOfMonth = new Date(DateUtils.getLastDayOfMonth(date).getTime() + 1000 * 2);
|
||||
Date lastDayOfMonth = DateUtils.getLastDayOfMonth(date);
|
||||
//产品集
|
||||
Integer project = qo.getProject();
|
||||
List<ZtProduct> products =null;
|
||||
if(project==null||project==0){
|
||||
List<Integer> productIds = authProductList();
|
||||
if(CollectionUtils.isEmpty(productIds)){
|
||||
return new PageInfo();
|
||||
}
|
||||
products=this.productService.listByIds(productIds);
|
||||
}else{
|
||||
//产品
|
||||
@ -1801,12 +1811,20 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
if (CollectionUtils.isEmpty(execList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<ZtProject> ztProjects = this.listByIds(execList.stream().map(o -> o.getExecution()).collect(Collectors.toList()));
|
||||
|
||||
ztProjects = ztProjects.stream().filter(o -> (o.getBegin().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getBegin().getTime() <= lastDayOfMonth.getTime()) || (
|
||||
o.getEnd().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getEnd().getTime() <= lastDayOfMonth.getTime()
|
||||
)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ztProjects)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
List<ZtTask> list =this.taskService.taskListByEIdsAndDate(firstDayOfMonth,lastDayOfMonth,execList.stream().map(o -> o.getExecution())
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.between(ZtTask::getEstStarted, firstDayOfMonth, lastDayOfMonth)
|
||||
.in(ZtTask::getExecution, execList.stream().map(o -> o.getExecution())
|
||||
.collect(Collectors.toList())));
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
@ -1821,27 +1839,10 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
if (CollectionUtils.isEmpty(execList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
// 时间 T1 T2
|
||||
// 任务 T3 T4
|
||||
List<ZtProject> ztProjects = this.listByIds(execList.stream().map(o -> o.getExecution()).collect(Collectors.toList()));
|
||||
if (CollectionUtils.isEmpty(ztProjects)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
// 查询日期范围内的迭代
|
||||
List<Integer> execFilterList = ztProjects.stream().filter(o -> (o.getBegin().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getBegin().getTime() <= lastDayOfMonth.getTime()) || (
|
||||
o.getEnd().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getEnd().getTime() <= lastDayOfMonth.getTime()
|
||||
)
|
||||
|
||||
)
|
||||
.map(o -> o.getId()).collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(execFilterList)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
List<ZtTeam> teams = this.teamService.list(new QueryWrapper<ZtTeam>().lambda().eq(ZtTeam::getType, "execution")
|
||||
.in(ZtTeam::getRoot, execFilterList));
|
||||
.in(ZtTeam::getRoot, ztProjects.stream().map(o -> o.getId())
|
||||
.collect(Collectors.toList())));
|
||||
|
||||
List<String> accountIds = teams.stream().map(o -> o.getAccount()).distinct().collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(accountIds)) {
|
||||
@ -1855,23 +1856,12 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
}
|
||||
|
||||
List result =new ArrayList();
|
||||
List<String> closeStatus = Arrays.asList("closed", "cancel");
|
||||
|
||||
|
||||
for (String account :accountIds) {
|
||||
|
||||
List<ZtTask> taskList = list.stream().filter(o->account.equals(o.getAssignedTo()))
|
||||
.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()))
|
||||
).filter(o->o.getStatus().equals("done"))
|
||||
.collect(Collectors.toList());
|
||||
List<ZtTask> taskList = list.stream().filter(o->account.equals(o.getAssignedTo())).filter(o-> !closeStatus.contains(o.getStatus())).collect(Collectors.toList());
|
||||
|
||||
var d=new WorkDetailsDTO();
|
||||
ZtUser ztUser = uMap.get(account);
|
||||
@ -1887,45 +1877,36 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
}
|
||||
d.setQjTime(BigDecimal.valueOf(applyTime));
|
||||
//可用工时
|
||||
d.setHaveTime(BigDecimal.valueOf(DateUtils.getWorkDaysInCurrentMonth(date) * 6).subtract(applyTime<1?BigDecimal.ZERO:d.getQjTime()));
|
||||
//工作饱和度
|
||||
d.setSaturation(d.getWorkTime().compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:d.getWorkTime().divide(d.getHaveTime(),2,BigDecimal.ROUND_HALF_UP));
|
||||
// 任务总量
|
||||
List<ZtTask> taskCountList = list.stream().filter(o->account.equals(o.getAssignedTo()))
|
||||
.filter(o ->
|
||||
( o.getFinishedDate()!=null&& (o.getFinishedDate().getTime() >= firstDayOfMonth.getTime()
|
||||
&& o.getFinishedDate().getTime() <= lastDayOfMonth.getTime()))
|
||||
||
|
||||
(o.getEstStarted()!=null&&o.getDeadline()!=null)&&
|
||||
(( DateUtils.getDayLast(o.getDeadline()).getTime()<=lastDayOfMonth.getTime()&& DateUtils.getDayLast(o.getDeadline()).getTime()>=firstDayOfMonth.getTime())
|
||||
||
|
||||
( o.getEstStarted().getTime()<=lastDayOfMonth.getTime()&& o.getEstStarted().getTime()>=firstDayOfMonth.getTime()))
|
||||
).filter(o->!o.getStatus().equals("closed"))
|
||||
.collect(Collectors.toList());
|
||||
d.setTaskCount(BigDecimal.valueOf(taskCountList.size()));
|
||||
BigDecimal haveTime = BigDecimal.valueOf(DateUtils.getWorkDaysInCurrentMonth(date) * 6).subtract(applyTime < 1 ? BigDecimal.ZERO : d.getQjTime());
|
||||
d.setHaveTime(haveTime.intValue()<0?BigDecimal.ZERO:haveTime);
|
||||
|
||||
List<ZtTask> delayList = list.stream().filter(o->account.equals(o.getAssignedTo()))
|
||||
.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()))
|
||||
)
|
||||
.filter(o->
|
||||
//工作饱和度
|
||||
d.setSaturation(BigDecimalUtils.isZero(d.getHaveTime())?BigDecimal.valueOf(1):d.getWorkTime().compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:d.getStoryTotalTime().divide(d.getHaveTime(),2,BigDecimal.ROUND_HALF_UP));
|
||||
// 任务总量
|
||||
d.setTaskCount(BigDecimal.valueOf(taskList.size()));
|
||||
|
||||
List<ZtTask> delayList = taskList.stream().filter(o->
|
||||
((o.getFinishedDate()!=null &&DateUtils.getDayLast(o.getFinishedDate()).getTime()>DateUtils.getDayLast(o.getDeadline()).getTime()) ) //实际完成大于预计完成 延期
|
||||
||o.getFinishedDate()==null &&lastDayOfMonth.getTime()>DateUtils.getDayLast(o.getDeadline()).getTime()
|
||||
)
|
||||
.filter(o->!o.getStatus().equals("closed"))
|
||||
.collect(Collectors.toList());
|
||||
).collect(Collectors.toList());
|
||||
//任务延期量
|
||||
d.setTaskDelayCount(BigDecimal.valueOf(delayList.size()));
|
||||
if(ztUser.getUserType()==UserType.CS||ztUser.getUserType()==UserType.KFZ){
|
||||
BigDecimal finishAllTime = BigDecimal.valueOf(floatBatchAdd(taskList.stream().map(o->o.getEstimate()).collect(Collectors.toList())));
|
||||
List<ZtTask> onTimeTask = taskList.stream().filter(o -> o.getFinishedDate() != null
|
||||
&& o.getFinishedDate().getTime() <= DateUtils.getDayLast(o.getDeadline()).getTime()).collect(Collectors.toList());
|
||||
BigDecimal onTime=BigDecimal.valueOf(floatBatchAdd(onTimeTask.stream().map(o->o.getEstimate())
|
||||
.collect(Collectors.toList())));
|
||||
//准时完成率
|
||||
BigDecimal onTimeFinishRate = BigDecimalUtils.isZero(finishAllTime) ? finishAllTime : onTime.divide(finishAllTime, 2, BigDecimal.ROUND_HALF_UP);
|
||||
d.setTaskFinishOnTimeRate(onTimeFinishRate.multiply(BigDecimal.valueOf(100)) );
|
||||
}else{
|
||||
d.setTaskFinishOnTimeRate(delayList.size()==0?BigDecimal.valueOf(100):BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(delayList.size()).divide(d.getTaskCount(),2,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100))));
|
||||
}
|
||||
//任务及时完成率
|
||||
d.setTaskFinishOnTimeRate(delayList.size()==0?BigDecimal.valueOf(100):BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(delayList.size()).divide(d.getTaskCount(),2,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100))));
|
||||
|
||||
List<ZtBug> bugList = this.bugService.list(new QueryWrapper<ZtBug>().lambda().in(ZtBug::getProduct, products.stream().map(o -> o.getId()).collect(Collectors.toList()))
|
||||
.eq(ZtBug::getBugType,"prod")
|
||||
.between(ZtBug::getOpeneddate, firstDayOfMonth, lastDayOfMonth).eq(ZtBug::getResolvedby, account));
|
||||
|
||||
d.setBugCount(BigDecimal.valueOf(bugList.size()));
|
||||
@ -2017,7 +1998,9 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
@Override
|
||||
public List<ZtProjectDTO> parentList(ZtProjectDTO dto) {
|
||||
List<Integer> pIds = authList();
|
||||
|
||||
if(CollectionUtils.isEmpty(pIds)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtProject> ztProjects = this.baseMapper.selectList(new QueryWrapper<ZtProject>().lambda()
|
||||
.eq(ZtProject::getType, "program")
|
||||
.eq(ZtProject::getDeleted, "0")
|
||||
@ -2565,6 +2548,9 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
||||
private Float floatBatchAdd(List<Float> list) {
|
||||
BigDecimal f = BigDecimal.ZERO;
|
||||
for (Float i : list) {
|
||||
if(i==null){
|
||||
continue;
|
||||
}
|
||||
f = f.add(BigDecimal.valueOf(i));
|
||||
}
|
||||
f = f.setScale(1, BigDecimal.ROUND_HALF_UP);
|
||||
|
@ -320,6 +320,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
} else {
|
||||
ztRelease.setStatus("released");
|
||||
}
|
||||
ztRelease.setRealReleaseDate(new Date());
|
||||
this.baseMapper.updateById(ztRelease);
|
||||
if (1 == dto.getPushFlag()) {
|
||||
//推送
|
||||
@ -380,63 +381,10 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
this.bugService.updateById(b);
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(ztStories)){
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
List<String> mailTo =new ArrayList<>();
|
||||
StringBuilder b=new StringBuilder();
|
||||
b.append("<table data-editing-info=\"{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"middle"}\" style=\"box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;\">" +
|
||||
"<tbody style=\"border: none\">" +
|
||||
"<tr style=\"\n" +
|
||||
" border: none !important;\n" +
|
||||
"\"><td style=\"width: 157.638px;height: 33.993px;border: none !important;border-width: 1px;border-style: solid;border-color: rgb(171, 171, 171);vertical-align: middle;box-sizing: border-box;padding: 4px 8px; border: none !important\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">编号</span></div></td><td style=\"width: 524.769px; height: 33.993px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); vertical-align: middle; box-sizing: border-box; padding: 4px 8px;border: none !important\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">标题</span></div></td><td style=\"width: 202.274px; height: 33.993px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); vertical-align: middle; box-sizing: border-box; padding: 4px 8px; border: none !important\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">验收人</span></div></td></tr>"
|
||||
);
|
||||
for (ZtStory s:ztStories) {
|
||||
ZtUser ztUser = userMap.get(s.getYsUser());
|
||||
if(ztUser!=null&&!StringUtils.isEmpty(ztUser.getEmail())){
|
||||
// String str="<div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\">需求编号: {id} 需求名称 : {name} 验收人 : {userName}<br><br></div>";
|
||||
// str=str.replace("{id}",s.getId().toString());
|
||||
// str= str.replace("{name}",s.getTitle());
|
||||
// str= str.replace("{userName}",ztUser.getNickname());
|
||||
sendMail(ztStories);
|
||||
|
||||
//{userName} {title} {id}
|
||||
String str= "<tr><td style=\"width: 157.638px; height: 82.4866px; padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{id}</span></div></td><td style=\"width: 524.769px; height: 82.4866px; padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{title}</span></div></td><td style=\"width: 202.274px; height: 82.4866px; padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{userName}</span></div></td></tr>" ;
|
||||
str=str.replace("{userName}",ztUser.getNickname());
|
||||
str=str.replace("{title}",s.getTitle());
|
||||
str=str.replace("{id}",s.getId().toString());
|
||||
b.append(str);
|
||||
mailTo.add(ztUser.getEmail());
|
||||
}
|
||||
|
||||
}
|
||||
b.append( "</tbody>" );
|
||||
b.append( "</table>");
|
||||
if(!CollectionUtils.isEmpty(mailTo)){
|
||||
SendEmail.sendMessage("需求发布提醒:",mailTo,
|
||||
null,
|
||||
b.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if(!StringUtils.isEmpty(ysUser)){
|
||||
// ZtUser ztUser = this.userService.selectByName(ysUser);
|
||||
// if(ztUser!=null&&!StringUtils.isEmpty(ztUser.getEmail())){
|
||||
// try {
|
||||
// StringBuilder b=new StringBuilder();
|
||||
// b.append("<div>尊敬的{userName}:</div>");
|
||||
// b.append("<div>您的需求 \"{id} {name}\"、\"{id} {name}\" 已发布,请及时登录系统验收。</div>");
|
||||
// String str = b.toString();
|
||||
// str= str.replace("{userName}",ztUser.getNickname());
|
||||
// str=str.replace("{id}",ztStory.getId().toString());
|
||||
// str=str.replace("{name}",ztStory.getTitle());
|
||||
// SendEmail.sendMail(ztUser.getEmail(),str,"需求发布提醒");
|
||||
// }catch (Exception e){
|
||||
// log.error("",e);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
} else {
|
||||
actionService.addAction(ActionType.FB, ActionStatus.FBSB, ztRelease.getId(), ztRelease.getProduct() + "", ztRelease.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
@ -445,6 +393,47 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
||||
|
||||
}
|
||||
|
||||
private void sendMail(List<ZtStory> ztStories) {
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
Set<String> mailTo =new HashSet<>();
|
||||
StringBuilder b=new StringBuilder();
|
||||
b.append("<div style=\"text-align: left; text-indent: 0px; font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">Dear all:</span></div>");
|
||||
String title="{date} {productName}进行了系统迭代升级,请大家登录\"IT服务台\"及时完成需求验收。";
|
||||
title=title.replace("{date}",DateUtils.formatDate(new Date(),"yyyy-MM-dd"));
|
||||
ZtProduct ztProduct = this.productService.getById(ztStories.get(0).getProduct());
|
||||
|
||||
title=title.replace("{productName}",ztProduct==null?"":ztProduct.getName());
|
||||
b.append("<div style=\"text-align: left; text-indent: 0px; font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\"><br></span></div>");
|
||||
|
||||
b.append(title);
|
||||
|
||||
b.append("<div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\"><br></span></div>");
|
||||
b.append("<table id=\"table_0\" data-editing-info=\"{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"middle"}\" style=\"box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;\">");
|
||||
b.append("<tbody>" +
|
||||
"<tr><td style=\"width: 78.25px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">需求编号</span></div></td><td style=\"width: 996.266px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\">研发需求名称</div></td><td style=\"width: 108.266px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\">验收人</div></td>" +
|
||||
"</tr>" );
|
||||
for (ZtStory s:ztStories) {
|
||||
ZtUser ztUser = userMap.get(s.getYsUser());
|
||||
if(ztUser!=null&&!StringUtils.isEmpty(ztUser.getEmail())){
|
||||
String str= "<tr><td style=\"width: 78.25px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{id}</span></div></td><td style=\"width: 996.266px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{title}</span></div></td><td style=\"width: 108.266px; height: 31.8118px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); padding: 4px 8px; vertical-align: middle; box-sizing: border-box;\"><div style=\"font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"line-height: 1.6;\">{nickName}</span></div></td>" +
|
||||
"</tr>";
|
||||
str=str.replace("{nickName}",ztUser.getNickname());
|
||||
str=str.replace("{title}",s.getTitle());
|
||||
str=str.replace("{id}",s.getId().toString());
|
||||
b.append(str);
|
||||
mailTo.add(ztUser.getEmail());
|
||||
}
|
||||
|
||||
}
|
||||
b.append( "</tbody>");
|
||||
b.append( "</table>");
|
||||
if(!CollectionUtils.isEmpty(mailTo)){
|
||||
SendEmail.sendMessage("需求发布提醒:",mailTo.stream().collect(Collectors.toList()),
|
||||
null,
|
||||
b.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execMenu(ZtReleaseQo qo) {
|
||||
|
||||
@ -486,6 +475,15 @@ 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());
|
||||
}
|
||||
Date releaseddate = d.getReleaseddate();
|
||||
if(releaseddate!=null){
|
||||
d.setPlanYsDate(DateUtils.dateAddDay(releaseddate,14));
|
||||
}
|
||||
|
||||
// List<ZtProject> ztProject = executionMapByStory.get(d.getId());
|
||||
// if(ztProject!=null){
|
||||
// d.setExecution(ztProject.getId());
|
||||
|
@ -146,6 +146,10 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
} else {
|
||||
ztStoryFeedback.setStatus("wait");
|
||||
}
|
||||
ZtProduct product = this.productService.getById(ztStoryFeedback.getProduct());
|
||||
if(product!=null){
|
||||
ztStoryFeedback.setAssignedTo(product.getPo());
|
||||
}
|
||||
|
||||
ztStoryFeedback.setFileUrl(dto.getUrls());
|
||||
this.baseMapper.insert(ztStoryFeedback);
|
||||
@ -412,7 +416,14 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
query.eq(ZtStoryFeedback::getSpec, qo.getSpec());
|
||||
}
|
||||
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getStatus())) {
|
||||
query.eq(ZtStoryFeedback::getStatus, qo.getStatus());
|
||||
if(qo.getStatus().equals("noVerified")){
|
||||
query.eq(ZtStoryFeedback::getYsFlag,2);
|
||||
}else if(qo.getStatus().equals("wait")){
|
||||
query.eq(ZtStoryFeedback::getStatus, qo.getStatus());
|
||||
query.in(ZtStoryFeedback::getYsFlag, null,0);
|
||||
}else{
|
||||
query.eq(ZtStoryFeedback::getStatus, qo.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isEmpty(qo.getOpenedby())) {
|
||||
@ -545,14 +556,16 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitVerified(ZtStoryDTO dto) {
|
||||
public void submitVerified(ZtStoryFeedbackDTO dto) {
|
||||
ZtStoryFeedback ztStoryFeedback = this.baseMapper.selectById(dto.getId());
|
||||
if(ztStoryFeedback==null){
|
||||
throw new BusinessException("未查询到数据");
|
||||
}
|
||||
if(!ztStoryFeedback.getStatus().equals("finished")){
|
||||
if(ztStoryFeedback.getStatus().equals("submitVerified")||ztStoryFeedback.getStatus().equals("verified")||ztStoryFeedback.getStatus().equals("closed")){
|
||||
throw new BusinessException("当前状态无法提交");
|
||||
}
|
||||
ztStoryFeedback.setDontHandRemark(dto.getDontHandRemark());
|
||||
ztStoryFeedback.setDontHandSelect(dto.getDontHandSelect());
|
||||
ztStoryFeedback.setStatus("submitVerified");
|
||||
this.baseMapper.updateById(ztStoryFeedback);
|
||||
|
||||
@ -613,7 +626,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void storyYs(ZtStoryDTO dto) {
|
||||
public void storyYs(ZtStoryFeedbackDTO dto) {
|
||||
|
||||
|
||||
ZtStoryFeedback ztStory = this.baseMapper.selectById(dto.getId());
|
||||
@ -634,6 +647,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
ztStory.setStatus("verified");
|
||||
ztStory.setYsFlag(1);
|
||||
}else{
|
||||
ztStory.setApprovalRemark(dto.getApprovalRemark());
|
||||
ztStory.setStatus("wait");
|
||||
ztStory.setYsFlag(2);
|
||||
}
|
||||
@ -660,7 +674,7 @@ public class ZtStoryFeedbackServiceImpl extends ServiceImpl<ZtStoryFeedbackMappe
|
||||
this.baseMapper.updateById(ztStoryFeedback);
|
||||
//添加action
|
||||
actionService.addAction(ActionType.WTFK, ActionStatus.WXCL, ztStoryFeedback.getId(), ztStoryFeedback.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), "处理结果: "+ dto.getDontHandSelect() +" 处理描述"+dto.getDontHandRemark() , null);
|
||||
RiskUserThreadLocal.get().getName(), "处理结果: "+ dto.getDontHandSelect() +" <p>处理描述: </p>"+dto.getDontHandRemark() , null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1251,6 +1251,10 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
@Override
|
||||
public void taskFinishChangeStatus(Integer story, String finishBy,TaskType type,Boolean cancelFlag) {
|
||||
ZtStory ztStory = this.getById(story);
|
||||
if(ztStory!=null&&ztStory.getStatus().equals("closed")){
|
||||
return;
|
||||
}
|
||||
if(type!=TaskType.test&&type!=TaskType.devel){
|
||||
return;
|
||||
}
|
||||
@ -1847,6 +1851,7 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
|
||||
this.closeTaskBug(ztStory.getId());
|
||||
if(ztStory.getUserStory()!=null&&ztStory.getUserStory()!=0){
|
||||
//研发需求关闭去验收用户需求
|
||||
storyUserService.storyFinishedChangeStatus(ztStory.getUserStory(),UserStoryEnums.YWC);
|
||||
// storyUserService.storyFinishedChangeStatus(ztStory.getUserStory(),UserStoryEnums.CFM);
|
||||
}
|
||||
@ -2178,6 +2183,12 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
}
|
||||
d.setBugList(ztBugDTOS);
|
||||
}
|
||||
List<ZtStoryspec> specList = this.storyspecService.list(new QueryWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory, d.getId()));
|
||||
if(!CollectionUtils.isEmpty(specList)){
|
||||
ZtStoryspec ztStoryspec = specList.get(0);
|
||||
d.setSpec(ztStoryspec.getSpec());
|
||||
d.setVerify(ztStoryspec.getVerify());
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
@ -2287,7 +2298,8 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
||||
public List<ZtStoryDTO> storyListByProductId(ZtProjectQo qo) {
|
||||
LambdaQueryWrapper<ZtStory> eq = new QueryWrapper<ZtStory>()
|
||||
.lambda().eq(ZtStory::getProduct, qo.getProductId())
|
||||
.eq(ZtStory::getDeleted, "0");
|
||||
.eq(ZtStory::getDeleted, "0")
|
||||
.orderByDesc(ZtStory::getId);
|
||||
if (qo.getProject() != null) {
|
||||
List<ZtTask> list = taskService.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.eq(ZtTask::getExecution, qo.getProject()));
|
||||
|
@ -22,6 +22,7 @@ import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.SendEmail;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -41,6 +42,7 @@ import java.util.stream.Collectors;
|
||||
* @since 2024-10-21
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtStoryUser> implements IZtStoryUserService {
|
||||
|
||||
@Autowired
|
||||
@ -68,27 +70,21 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
@Autowired
|
||||
private IZtModuleService moduleService;
|
||||
|
||||
@Autowired
|
||||
private IZtStoryUserspecService storyUserspecService;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void addStory(ZtStoryUserDTO dto) {
|
||||
|
||||
|
||||
ZtStoryUser s = new ZtStoryUser();
|
||||
BeanUtils.copyProperties(dto, s);
|
||||
s.setOpeneddate(new Date());
|
||||
s.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
s.setVersion(1);
|
||||
s.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
s.setLastediteddate(new Date());
|
||||
if (!"draft".equals(dto.getStatus())) {
|
||||
s.setStatus("reviewing");
|
||||
}
|
||||
s.setStage("wait");
|
||||
ZtStoryUser s = buildZtStoryUser(dto);
|
||||
this.baseMapper.insert(s);
|
||||
|
||||
fileService.updateFile(dto.getFiles(), s.getId(), FileTypes.userStory);
|
||||
|
||||
ZtStoryUserspec spec= buildSpec(dto,s);
|
||||
storyUserspecService.save(spec);
|
||||
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.XJ, s.getId(), dto.getProduct() + "", null, null,
|
||||
RiskUserThreadLocal.get().getName(), "", "");
|
||||
|
||||
@ -111,6 +107,34 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
}
|
||||
|
||||
private ZtStoryUserspec buildSpec(ZtStoryUserDTO dto, ZtStoryUser s) {
|
||||
ZtStoryUserspec spec = new ZtStoryUserspec();
|
||||
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 ZtStoryUser buildZtStoryUser(ZtStoryUserDTO dto) {
|
||||
ZtStoryUser s = new ZtStoryUser();
|
||||
BeanUtils.copyProperties(dto, s);
|
||||
s.setOpeneddate(new Date());
|
||||
s.setOpenedby(RiskUserThreadLocal.get().getName());
|
||||
s.setVersion(1);
|
||||
s.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
s.setLastediteddate(new Date());
|
||||
if (!"draft".equals(dto.getStatus())) {
|
||||
s.setStatus("reviewing");
|
||||
}
|
||||
s.setStage("wait");
|
||||
s.setSpec(null);
|
||||
s.setVerify(null);
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void editStory(ZtStoryUserDTO dto) {
|
||||
@ -130,6 +154,10 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
String status = ztStory.getStatus();
|
||||
|
||||
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.BJ, dto.getId(), dto.getProduct() + "", dto.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getRemark(), "");
|
||||
|
||||
|
||||
BeanUtils.copyProperties(dto, ztStory, "status");
|
||||
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||
ztStory.setLastediteddate(new Date());
|
||||
@ -160,7 +188,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
List<ZtStoryreview> userStory = this.storyreviewService.list(new QueryWrapper<ZtStoryreview>().lambda().eq(ZtStoryreview::getStory, ztStory.getId())
|
||||
.eq(ZtStoryreview::getType, "userStory"));
|
||||
if (!CollectionUtils.isEmpty(userStory)) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
|
||||
for (int i = 0; i < userStory.size(); i++) {
|
||||
@ -168,27 +195,47 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
ZtUser ztUser = userMap.get(v.getReviewer());
|
||||
if (ztUser != null) {
|
||||
b.append(ztUser.getNickname());
|
||||
}
|
||||
if (i != (userStory.size() - 1)) {
|
||||
b.append(",");
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.PS, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", ztUser.getAccount());
|
||||
}
|
||||
|
||||
}
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.PS, ztStory.getId(), ztStory.getProduct() + "", ztStory.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), "", b.toString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ztStory.setSpec(null);
|
||||
ztStory.setVerify(null);
|
||||
this.baseMapper.updateById(ztStory);
|
||||
|
||||
ZtStoryUserspec spec = this.storyUserspecService.getOne(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id));
|
||||
if (spec == null) {
|
||||
spec = new ZtStoryUserspec();
|
||||
spec.setStory(id);
|
||||
spec.setVersion(1);
|
||||
spec.setTitle(ztStory.getTitle());
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
storyUserspecService.save(spec);
|
||||
} else {
|
||||
spec.setVersion(1);
|
||||
spec.setTitle(ztStory.getTitle());
|
||||
spec.setSpec(dto.getSpec());
|
||||
spec.setVerify(dto.getVerify());
|
||||
spec.setFiles(dto.getFileUrl());
|
||||
storyUserspecService.update(new UpdateWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, id)
|
||||
.set(ZtStoryUserspec::getSpec, dto.getSpec())
|
||||
.set(ZtStoryUserspec::getVerify, dto.getVerify())
|
||||
.set(ZtStoryUserspec::getFiles, dto.getFileUrl())
|
||||
);
|
||||
}
|
||||
|
||||
fileService.updateFile(dto.getFiles(), ztStory.getId(), FileTypes.userStory);
|
||||
|
||||
actionService.addAction(ActionType.USERXQ, ActionStatus.BJ, dto.getId(), dto.getProduct() + "", dto.getProject(), null,
|
||||
RiskUserThreadLocal.get().getName(), dto.getRemark(), "");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -202,21 +249,36 @@ 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();
|
||||
long l = System.currentTimeMillis();
|
||||
|
||||
List<Integer> pIds = this.projectService.authProductList();
|
||||
long l2 = System.currentTimeMillis();
|
||||
log.info("耗时---------------------------------- {}",l2-l);
|
||||
if(CollectionUtils.isEmpty(pIds)&&CollectionUtils.isEmpty(qo.getStoryIds())){
|
||||
return new PageInfo<ZtStoryUserDTO>();
|
||||
}
|
||||
|
||||
qo.setProductIds(pIds);
|
||||
l = System.currentTimeMillis();
|
||||
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||
qo.setProductIds(integers);
|
||||
List<ZtStoryUserDTO> list = this.baseMapper.pageList(qo);
|
||||
l2 = System.currentTimeMillis();
|
||||
log.info("耗时----------------------------------2222 {}",l2-l);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
|
||||
|
||||
List<String> userIds = list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
|
||||
userIds.addAll(list.stream().map(o -> o.getLasteditedby()).collect(Collectors.toList()));
|
||||
|
||||
|
||||
l = System.currentTimeMillis();
|
||||
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
||||
l2 = System.currentTimeMillis();
|
||||
log.info("耗时---------------------------------- {}",l2-l);
|
||||
|
||||
l = System.currentTimeMillis();
|
||||
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
|
||||
|
||||
l2 = System.currentTimeMillis();
|
||||
log.info("耗时---------------------------------- {}",l2-l);
|
||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
||||
for (ZtStoryUserDTO d : list) {
|
||||
|
||||
@ -283,7 +345,9 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
public List<ZtStoryUserDTO> storyListByProductId(ZtProjectQo qo) {
|
||||
LambdaQueryWrapper<ZtStoryUser> eq = new QueryWrapper<ZtStoryUser>()
|
||||
.lambda().eq(ZtStoryUser::getProduct, qo.getProductId())
|
||||
.eq(ZtStoryUser::getDeleted, "0");
|
||||
.eq(ZtStoryUser::getDeleted, "0")
|
||||
|
||||
.orderByDesc(ZtStoryUser::getId);
|
||||
|
||||
List<ZtStoryUser> ztStories = this.baseMapper.selectList(eq);
|
||||
if (CollectionUtils.isEmpty(ztStories)) {
|
||||
@ -339,16 +403,24 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
ZtUser u = this.userService.getByAccount(ztStory.getOpenedby());
|
||||
if (u != null && !StringUtils.isEmpty(u.getEmail())) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>你好: {userName}</b></span></p>");
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b> 您的需求评审没有通过,请及时处理:</b></span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>需求编号: </b></span><span style=\"font-family: 等线; font-size: 14.6667px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 1.6;\"><b>{storyId}</b></span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>需求名称: </b></span><span style=\"font-family: 等线; font-size: 14.6667px; color: rgb(0, 0, 0); line-height: 1.6;\"><b>{storyName}</b></span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 115%;\">谢谢。</span></p>");
|
||||
b.append("<div><br></div>");
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 14.6667px;\">您好:{userName}</span></p>");
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt; font-family: "Microsoft YaHei UI", Tahoma;\"><span style=\"font-family: 等线; font-size: 11pt; line-height: 1.6;\"><br></span></p>");
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt; font-family: "Microsoft YaHei UI", Tahoma;\"><span style=\"font-family: 等线; font-size: 11pt; line-height: 1.6;\"> 您的需求评审没有通过,请及时处理。</span></p>");
|
||||
b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt; font-family: "Microsoft YaHei UI", Tahoma;\"><span style=\"font-family: 等线; font-size: 11pt; line-height: 1.6;\"><br></span></p>");
|
||||
b.append("<p style=\"text-indent: 0pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt; font-family: "Microsoft YaHei UI", Tahoma;\"><span style=\"font-family: 等线; font-size: 11pt; line-height: 1.6;\"> 需求编号: </span><span style=\"font-family: 等线; font-size: 14.6667px; line-height: 1.6;\">{storyId}</span></p>");
|
||||
b.append("<p style=\"text-indent: 0pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt; font-family: "Microsoft YaHei UI", Tahoma;\"><span style=\"font-family: 等线; font-size: 11pt; line-height: 1.6;\"> 需求名称: </span><span style=\"font-family: 等线; font-size: 14.6667px; line-height: 1.6;\">{storyName}</span></p>");
|
||||
|
||||
// b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>你好: {userName}</b></span></p>");
|
||||
// b.append("<p style=\"line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>您的需求评审没有通过,请及时处理:</b></span></p>");
|
||||
// b.append("<p style=\"text-indent: 0pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>需求编号: </b></span><span style=\"font-family: 等线; font-size: 14.6667px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 1.6;\"><b>{storyId}</b></span></p>");
|
||||
// b.append("<p style=\"text-indent: 0pt; line-height: 1.38; margin: 0cm 0cm 0.0001pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"><b>需求名称: </b></span><span style=\"font-family: 等线; font-size: 14.6667px; color: rgb(0, 0, 0); line-height: 1.6;\"><b>{storyName}</b></span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 1.6;\"> </span></p>");
|
||||
// b.append("<p style=\"text-indent: 11pt; line-height: 1.38; margin: 0cm 0cm 8pt 18pt;\"><span style=\"font-family: 等线; font-size: 11pt; color: rgb(0, 0, 0); line-height: 115%;\">谢谢。</span></p>");
|
||||
String str = b.toString();
|
||||
|
||||
|
||||
@ -531,6 +603,13 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
||||
|
||||
dto.setViews(rMap.get(d.getId()));
|
||||
|
||||
List<ZtStoryUserspec> specList = this.storyUserspecService.list(new QueryWrapper<ZtStoryUserspec>().lambda().eq(ZtStoryUserspec::getStory, dto.getId()));
|
||||
if(!CollectionUtils.isEmpty(specList)){
|
||||
ZtStoryUserspec ztStoryUserspec = specList.get(0);
|
||||
dto.setSpec(ztStoryUserspec.getSpec());
|
||||
dto.setVerify(ztStoryUserspec.getVerify());
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ public class ZtStoryUserTaskServiceImpl extends ServiceImpl<ZtStoryUserTaskMapp
|
||||
// 设计 design 明确improve
|
||||
if("improve".equals(ztStoryUserTask.getType())){
|
||||
//需要会议
|
||||
if((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==1)&&dto.getNeedDesign()==null){
|
||||
if((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==1)&&(dto.getNeedDesign()==null||dto.getNeedDesign()==2)){
|
||||
//用户状态待沟通
|
||||
this.storyUserService.changeStatus(ztStoryUserTask.getUserStoryId(), UserStoryEnums.DGT);
|
||||
}else if ((dto.getNeedMeeting()!=null&&dto.getNeedMeeting()==2)&&(dto.getNeedDesign()!=null&&dto.getNeedDesign()==2)){
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.sa.zentao.service.impl;
|
||||
|
||||
import com.sa.zentao.entity.ZtStoryUserspec;
|
||||
import com.sa.zentao.mapper.ZtStoryUserspecMapper;
|
||||
import com.sa.zentao.service.IZtStoryUserspecService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author gqb
|
||||
* @since 2025-04-15
|
||||
*/
|
||||
@Service
|
||||
public class ZtStoryUserspecServiceImpl extends ServiceImpl<ZtStoryUserspecMapper, ZtStoryUserspec> implements IZtStoryUserspecService {
|
||||
|
||||
}
|
@ -311,6 +311,23 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
return this.baseMapper.itApprovalByUserName(s, firstDayOfMonth, lastDayOfMonth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZtTask> taskListByEIdsAndDate(Date firstDayOfMonth, Date lastDayOfMonth, List<Integer> eIds) {
|
||||
if(CollectionUtils.isEmpty(eIds)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(firstDayOfMonth==null||lastDayOfMonth==null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<ZtTask> taskList = this.list(new QueryWrapper<ZtTask>().lambda()
|
||||
.and(o->o.between(ZtTask::getDeadline, firstDayOfMonth,lastDayOfMonth)
|
||||
.or()
|
||||
.between(ZtTask::getFinishedDate, firstDayOfMonth,lastDayOfMonth)
|
||||
)
|
||||
.in(ZtTask::getExecution, eIds));
|
||||
return taskList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<ZtTaskDTO> myTaskPageList(ZtProjectQo qo) {
|
||||
@ -750,9 +767,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
}
|
||||
ztTask.setConsumed(dto.getConsumed() + ztTask.getConsumed());
|
||||
ztTask.setLeft(ztTask.getEstimate() - ztTask.getConsumed());
|
||||
if(ztTask.getLeft()<0){
|
||||
ztTask.setLeft(0f);
|
||||
}
|
||||
ztTask.setLeft(0f);
|
||||
ztTask.setStatus("done");
|
||||
if(ztTask.getFinishedFlag()!=null&&ztTask.getFinishedFlag()==1){
|
||||
ztTask.setFinishedby(ztTask.getAssignedTo());
|
||||
|
@ -7,10 +7,7 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||
import com.sa.zentao.dao.*;
|
||||
import com.sa.zentao.entity.VerificationCode;
|
||||
import com.sa.zentao.entity.ZtProduct;
|
||||
import com.sa.zentao.entity.ZtProject;
|
||||
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.mapper.ZtUserMapper;
|
||||
@ -18,6 +15,7 @@ import com.sa.zentao.qo.ZtUserQo;
|
||||
import com.sa.zentao.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sa.zentao.utils.BeanCopyUtil;
|
||||
import com.sa.zentao.utils.ChineseUtil;
|
||||
import com.sa.zentao.utils.CryptoUtils;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
@ -25,6 +23,7 @@ import com.tencentcloudapi.sms.v20190711.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -61,6 +60,10 @@ public class ZtUserServiceImpl extends ServiceImpl<ZtUserMapper, ZtUser> impleme
|
||||
@Autowired
|
||||
private IZtActionService actionService;
|
||||
|
||||
@Autowired
|
||||
private IBaseUserRoleService userRoleService;
|
||||
@Autowired
|
||||
private IBaseRoleService baseRoleService;
|
||||
|
||||
|
||||
@Override
|
||||
@ -76,25 +79,63 @@ public class ZtUserServiceImpl extends ServiceImpl<ZtUserMapper, ZtUser> impleme
|
||||
List<ZtUserDTO> ztUserDTOS = BeanCopyUtil.copyListProperties(list, ZtUserDTO::new);
|
||||
PageInfo<ZtUserDTO> ztUserDTOPageInfo = new PageInfo<>(ztUserDTOS);
|
||||
ztUserDTOPageInfo.setTotal(page.getTotal());
|
||||
for (ZtUserDTO dto:ztUserDTOS) {
|
||||
if(!StringUtils.isEmpty(dto.getVx())){
|
||||
dto.setVx(CryptoUtils.aesDecryptForFront(dto.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(ztUserDTOS)){
|
||||
Map<String,List<BaseRole>> roleMap= getUserRoleMap(ztUserDTOS);
|
||||
|
||||
if(dto.getUserType()!=null){
|
||||
dto.setUserTypeValue(dto.getUserType().getValue());
|
||||
}
|
||||
if(!StringUtils.isEmpty(dto.getProductIds())){
|
||||
String[] split = dto.getProductIds().split(",");
|
||||
List<ZtProject> ztProjects = projectService.listByIds(Arrays.asList(split));
|
||||
dto.setProductNames(ztProjects.stream().map(o->o.getName()).collect(Collectors.joining(",")));
|
||||
for (ZtUserDTO dto:ztUserDTOS) {
|
||||
if(!StringUtils.isEmpty(dto.getVx())){
|
||||
dto.setVx(CryptoUtils.aesDecryptForFront(dto.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
if(dto.getUserType()!=null){
|
||||
dto.setUserTypeValue(dto.getUserType().getValue());
|
||||
}
|
||||
if(!StringUtils.isEmpty(dto.getProductIds())){
|
||||
String[] split = dto.getProductIds().split(",");
|
||||
List<ZtProject> ztProjects = projectService.listByIds(Arrays.asList(split));
|
||||
dto.setProductNames(ztProjects.stream().map(o->o.getName()).collect(Collectors.joining(",")));
|
||||
}
|
||||
List<BaseRole> baseUserRoles = roleMap.get(dto.getAccount());
|
||||
if(!CollectionUtils.isEmpty(baseUserRoles)){
|
||||
dto.setRoleTypeValue(baseUserRoles.stream().map(o->o.getName()).collect(Collectors.joining(",")));
|
||||
dto.setRoleList(baseUserRoles.stream().map(o->o.getId()).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ztUserDTOPageInfo;
|
||||
}
|
||||
|
||||
private Map<String, List<BaseRole>> getUserRoleMap(List<ZtUserDTO> ztUserDTOS) {
|
||||
List<BaseUserRole> uRoleList = this.userRoleService.list(new QueryWrapper<BaseUserRole>().lambda().in(BaseUserRole::getUserId,
|
||||
ztUserDTOS.stream().map(o -> o.getAccount()).collect(Collectors.toList())));
|
||||
|
||||
if(CollectionUtils.isEmpty(uRoleList)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
List<BaseRole> baseRoles = this.baseRoleService.listByIds(uRoleList.stream().map(o -> o.getRoleId()).collect(Collectors.toList()));
|
||||
Map<Integer, BaseRole> rMap = baseRoles.stream().collect(Collectors.toMap(BaseRole::getId, o -> o));
|
||||
Map<String,List<BaseRole>> result=new HashMap<>();
|
||||
for (BaseUserRole baseUserRole:uRoleList) {
|
||||
|
||||
String userId = baseUserRole.getUserId();
|
||||
List<BaseRole> exitsList = result.get(userId);
|
||||
if(CollectionUtils.isEmpty(exitsList)){
|
||||
exitsList=new ArrayList<>();
|
||||
}
|
||||
BaseRole baseRole = rMap.get(baseUserRole.getRoleId());
|
||||
if(baseRole==null){
|
||||
continue;
|
||||
}
|
||||
exitsList.add(baseRole);
|
||||
result.put(userId,exitsList);
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZtUser selectByName(String name) {
|
||||
ZtUser ztUser = this.baseMapper.selectOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, name));
|
||||
@ -300,6 +341,86 @@ public class ZtUserServiceImpl extends ServiceImpl<ZtUserMapper, ZtUser> impleme
|
||||
return this.baseMapper.selectOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, openedby));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUser(ZtUserDTO user) {
|
||||
ZtUser login = this.getOne(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, user.getAccount()));
|
||||
if(login!=null){
|
||||
throw new BusinessException("存在");
|
||||
}
|
||||
ZtUser ztUser = new ZtUser();
|
||||
BeanUtils.copyProperties(user,ztUser);
|
||||
List<String> productList = user.getProductList();
|
||||
if(!CollectionUtils.isEmpty(productList)){
|
||||
ztUser.setProductIds(StringUtils.join(productList,","));
|
||||
}
|
||||
|
||||
ztUser.setPinyin(ChineseUtil.getFirst(ztUser.getNickname()));
|
||||
if(!StringUtils.isEmpty(ztUser.getVx())){
|
||||
ztUser.setVx(CryptoUtils.aesEncryptForFront(ztUser.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
this.save(ztUser);
|
||||
|
||||
List<Integer> roleList = user.getRoleList();
|
||||
if(!CollectionUtils.isEmpty(roleList)){
|
||||
userRoleService.addUserRole(ztUser.getAccount(),roleList);
|
||||
}
|
||||
this.actionService.addAction(ActionType.USER, ActionStatus.XJ,ztUser.getId(),null,null,null, RiskUserThreadLocal.get().getName(),null,ztUser.getAccount());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void modifyUser(ZtUserDTO user) {
|
||||
ZtUser ztUser = getById(user.getId());
|
||||
|
||||
if(ztUser==null){
|
||||
throw new BusinessException("不存在");
|
||||
}
|
||||
List<ZtUser> list = list(new QueryWrapper<ZtUser>().lambda().eq(ZtUser::getAccount, user.getAccount())
|
||||
.ne(ZtUser::getId, user.getId())
|
||||
);
|
||||
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
throw new BusinessException("请检查用户");
|
||||
}
|
||||
if(!ztUser.getNickname().equals(user.getNickname())){
|
||||
ztUser.setPinyin(ChineseUtil.getFirst(ztUser.getNickname()));
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(user.getVx())){
|
||||
ztUser.setVx(CryptoUtils.aesEncryptForFront(user.getVx(), CryptoUtils.KEY_DES));
|
||||
}
|
||||
|
||||
ztUser.setAccount(user.getAccount());
|
||||
|
||||
ztUser.setPassword(user.getPassword());
|
||||
ztUser.setUserType(user.getUserType());
|
||||
ztUser.setEmail(user.getEmail());
|
||||
ztUser.setPhone(user.getPhone());
|
||||
if(!CollectionUtils.isEmpty(user.getProductList())){
|
||||
ztUser.setProductIds(StringUtils.join(user.getProductList(),","));
|
||||
}
|
||||
ztUser.setNickname(user.getNickname());
|
||||
ztUser.setColor(user.getColor());
|
||||
ztUser.setDeptName(user.getDeptName());
|
||||
this.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())
|
||||
// );
|
||||
userRoleService.modifyUserRole(ztUser.getAccount(),user.getRoleList());
|
||||
|
||||
this.actionService.addAction(ActionType.USER, ActionStatus.BJ,ztUser.getId(),null,null,null,RiskUserThreadLocal.get().getName(),null,user.getAccount());
|
||||
|
||||
}
|
||||
|
||||
public boolean sendSms(String phoneNumber, String verificationCode) {
|
||||
try {
|
||||
// 初始化腾讯云短信服务客户端
|
||||
|
21
src/main/java/com/sa/zentao/utils/BigDecimalUtils.java
Normal file
21
src/main/java/com/sa/zentao/utils/BigDecimalUtils.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.sa.zentao.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class BigDecimalUtils {
|
||||
|
||||
|
||||
public static boolean isZero(BigDecimal v){
|
||||
if(v==null){
|
||||
return true;
|
||||
}
|
||||
|
||||
int i = v.compareTo(BigDecimal.ZERO);
|
||||
if(i==0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class DateUtils {
|
||||
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
@ -88,13 +89,20 @@ public class DateUtils {
|
||||
if(smdate==null||bdate==null){
|
||||
return 0;
|
||||
}
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(smdate);
|
||||
long time1 = cal.getTimeInMillis();
|
||||
cal.setTime(bdate);
|
||||
long time2 = cal.getTimeInMillis();
|
||||
long between_days = (time2 - time1) / 86400000L;
|
||||
return Integer.parseInt(String.valueOf(between_days));
|
||||
// log.info("smdate = {} , bdate = {} ,getYear = {} getMonth = {} getDay ={} ",
|
||||
// DateUtils.formatDate(smdate), DateUtils.formatDate(bdate),smdate.getYear(),smdate.getMonth(),smdate.getDay());
|
||||
LocalDate date1 = smdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate date2 = bdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
// LocalDate date1 = LocalDate.of(smdate.getYear(), smdate.getMonth(), smdate.getDay());
|
||||
// LocalDate date2 = LocalDate.of(bdate.getYear(), bdate.getMonth(), bdate.getDay());
|
||||
return (int)ChronoUnit.DAYS.between(date1, date2);
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.setTime(smdate);
|
||||
// long time1 = cal.getTimeInMillis();
|
||||
// cal.setTime(bdate);
|
||||
// long time2 = cal.getTimeInMillis();
|
||||
// long between_days = (time2 - time1) / 86400000L;
|
||||
// return Integer.parseInt(String.valueOf(between_days));
|
||||
}
|
||||
|
||||
public static int secondBetween(Date smdate, Date bdate) {
|
||||
@ -115,10 +123,12 @@ public class DateUtils {
|
||||
|
||||
public static String formatDate(Date smdate) {
|
||||
//todo s Index 14 out of bounds for length 13
|
||||
return smdate == null ? "" : sdf.format(smdate);
|
||||
synchronized (Object.class){
|
||||
return smdate == null ? "" : sdf.format(smdate);
|
||||
}
|
||||
}
|
||||
public static Date parseDate(String smdate, String f) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(f);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(f);
|
||||
try {
|
||||
return sdf.parse(smdate);
|
||||
} catch (ParseException e) {
|
||||
@ -509,25 +519,25 @@ public class DateUtils {
|
||||
}
|
||||
|
||||
public static int getAge(Date birthDay){
|
||||
Calendar cal = Calendar.getInstance();
|
||||
if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
|
||||
throw new IllegalArgumentException(
|
||||
"The birthDay is before Now.It's unbelievable!");
|
||||
}
|
||||
int yearNow = cal.get(Calendar.YEAR); //当前年份
|
||||
int monthNow = cal.get(Calendar.MONTH); //当前月份
|
||||
int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
|
||||
cal.setTime(birthDay);
|
||||
int yearBirth = cal.get(Calendar.YEAR);
|
||||
int monthBirth = cal.get(Calendar.MONTH);
|
||||
int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
|
||||
int age = yearNow - yearBirth; //计算整岁数
|
||||
if (monthNow <= monthBirth) {
|
||||
if (monthNow == monthBirth) {
|
||||
if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
|
||||
}else{
|
||||
age--;//当前月份在生日之前,年龄减一
|
||||
} } return age;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
|
||||
throw new IllegalArgumentException(
|
||||
"The birthDay is before Now.It's unbelievable!");
|
||||
}
|
||||
int yearNow = cal.get(Calendar.YEAR); //当前年份
|
||||
int monthNow = cal.get(Calendar.MONTH); //当前月份
|
||||
int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
|
||||
cal.setTime(birthDay);
|
||||
int yearBirth = cal.get(Calendar.YEAR);
|
||||
int monthBirth = cal.get(Calendar.MONTH);
|
||||
int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
|
||||
int age = yearNow - yearBirth; //计算整岁数
|
||||
if (monthNow <= monthBirth) {
|
||||
if (monthNow == monthBirth) {
|
||||
if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
|
||||
}else{
|
||||
age--;//当前月份在生日之前,年龄减一
|
||||
} } return age;
|
||||
}
|
||||
public static Date parse(String date, String format){
|
||||
SimpleDateFormat f=new SimpleDateFormat(format);
|
||||
|
@ -115,7 +115,12 @@ public class ExcelUtil {
|
||||
}
|
||||
// 不同数据类型处理
|
||||
CellType fromCellType = fromCell.getCellType();
|
||||
toCell.setCellType(fromCellType);
|
||||
try {
|
||||
toCell.setCellType(fromCellType);
|
||||
}catch (Exception e){
|
||||
toCell.setCellType(CellType.STRING);
|
||||
}
|
||||
|
||||
if (fromCellType == CellType.NUMERIC) {
|
||||
if (DateUtil.isCellDateFormatted(fromCell)) {
|
||||
toCell.setCellValue(fromCell.getDateCellValue());
|
||||
|
@ -135,8 +135,10 @@ public class SendEmail {
|
||||
|
||||
System.out.println("邮件发送成功!");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("",e);
|
||||
throw new BusinessException("邮件发送失败");
|
||||
}catch (MessagingException e) {
|
||||
log.error("",e);
|
||||
throw new BusinessException("邮件发送失败");
|
||||
}
|
||||
}
|
||||
|
51
src/main/java/com/sa/zentao/utils/TreeUtils.java
Normal file
51
src/main/java/com/sa/zentao/utils/TreeUtils.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.sa.zentao.utils;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import com.sa.zentao.dao.BaseMenuDTO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @athor wangyuhang
|
||||
*/
|
||||
public class TreeUtils {
|
||||
|
||||
/**
|
||||
* 使用递归方法建树
|
||||
*
|
||||
* @param treeNodes
|
||||
* @return
|
||||
*/
|
||||
public static List<BaseMenuDTO> buildByRecursive(List<BaseMenuDTO> treeNodes, Object root) {
|
||||
List<BaseMenuDTO> trees = new ArrayList<>();
|
||||
treeNodes = treeNodes.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
for (BaseMenuDTO treeNode : treeNodes) {
|
||||
if (Objects.equals(root, treeNode.getParentId())) {
|
||||
trees.add(findChildren(treeNode, treeNodes));
|
||||
}
|
||||
}
|
||||
return trees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找子节点
|
||||
*
|
||||
* @param treeNodes
|
||||
* @return
|
||||
*/
|
||||
public static BaseMenuDTO findChildren(BaseMenuDTO treeNode, List<BaseMenuDTO> treeNodes) {
|
||||
for (BaseMenuDTO it : treeNodes) {
|
||||
if (treeNode.getId().equals(it.getParentId())) {
|
||||
treeNode.add(findChildren(it, treeNodes));
|
||||
}
|
||||
}
|
||||
return treeNode;
|
||||
}
|
||||
}
|
49
src/main/resources/mapper/BaseMenuMapper.xml
Normal file
49
src/main/resources/mapper/BaseMenuMapper.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.BaseMenuMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.BaseMenu">
|
||||
<result column="id" property="id"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="action" property="action"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="is_sys" property="isSys"/>
|
||||
<result column="icon" property="icon"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="level" property="level"/>
|
||||
</resultMap>
|
||||
<select id="findAll" resultType="com.sa.zentao.entity.BaseMenu">
|
||||
select * from base_menu
|
||||
</select>
|
||||
<delete id="deleteWithChild">
|
||||
delete from base_menu where id=#{id} or parent_id=#{id}
|
||||
</delete>
|
||||
<select id="findMenuIds" resultType="Integer">
|
||||
select id from base_menu where id=#{id} or parent_id=#{id}
|
||||
</select>
|
||||
<select id="selectMenuByParentId" resultMap="BaseResultMap">
|
||||
select * from base_menu
|
||||
<where>
|
||||
<if test="parentId != null">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="parentId == null">
|
||||
and parent_id is null
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryListByLoginUser" resultMap="BaseResultMap">
|
||||
SELECT m.* from base_menu m,base_role_authority ra,base_role r,base_user_role ur
|
||||
WHERE m.id=ra.menu_id and ra.role_id=r.id and r.id=ur.role_id
|
||||
and ur.user_id=#{riskUserId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAllList" resultMap="BaseResultMap">
|
||||
SELECT m.* from base_menu m
|
||||
</select>
|
||||
|
||||
</mapper>
|
45
src/main/resources/mapper/BaseRoleAuthorityMapper.xml
Normal file
45
src/main/resources/mapper/BaseRoleAuthorityMapper.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?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.BaseRoleAuthorityMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.BaseRoleAuthority">
|
||||
<result column="id" property="id" />
|
||||
<result column="role_id" property="roleId" />
|
||||
<result column="menu_id" property="menuId" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="type" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE from base_role_authority where role_id =#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleAndMenu">
|
||||
delete from base_role_authority where 1=1
|
||||
<if test="roleIds.size()>0">
|
||||
and role_id in
|
||||
<foreach collection="roleIds" item="item" index="index"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="menuIds.size()>0">
|
||||
and menu_id in
|
||||
<foreach collection="menuIds" item="item" index="index"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
<select id="findMenuIdById" resultType="string">
|
||||
select GROUP_CONCAT(bra.menu_id) from base_role_authority bra
|
||||
<where>
|
||||
bra.type = #{pickEnum.code}
|
||||
<if test="roleId != null">
|
||||
and bra.role_id = #{roleId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
26
src/main/resources/mapper/BaseRoleMapper.xml
Normal file
26
src/main/resources/mapper/BaseRoleMapper.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?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.BaseRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.BaseRole">
|
||||
<result column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="role_type" property="roleType" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="delete_flag" property="deleteFlag" />
|
||||
<result column="create_user" property="createUser" />
|
||||
<result column="update_user" property="updateUser" />
|
||||
</resultMap>
|
||||
<select id="selectRoleByVo" resultType="com.sa.zentao.dao.BaseRoleDTO">
|
||||
select * from base_role
|
||||
<where>
|
||||
<if test="vo.name != null and vo.name != ''">
|
||||
and name like '%${vo.name}%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findRoleById" resultType="com.sa.zentao.dao.BaseRoleDTO">
|
||||
select * from base_role where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
12
src/main/resources/mapper/BaseUserRoleMapper.xml
Normal file
12
src/main/resources/mapper/BaseUserRoleMapper.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?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.BaseUserRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.BaseUserRole">
|
||||
<result column="id" property="id" />
|
||||
<result column="role_id" property="roleId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -17,8 +17,8 @@
|
||||
<select id="pageList" resultType="com.sa.zentao.dao.ZtMeetingDTO">
|
||||
|
||||
|
||||
SELECT m.*,us.title userStoryName from zt_meeting m left join zt_product p on p.id = m.product_id
|
||||
left join zt_story_user us on m.user_story = us.id
|
||||
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 ">
|
||||
|
@ -24,7 +24,17 @@
|
||||
and s.spec like concat('%', #{qo.spec}, '%')
|
||||
</if>
|
||||
<if test="qo.status != null and qo.status != ''">
|
||||
and s.status = #{qo.status}
|
||||
<choose>
|
||||
<when test="qo.status == 'noVerified'">
|
||||
AND ys_flag=2
|
||||
</when>
|
||||
<when test="qo.status == 'wait'">
|
||||
AND and s.status = #{qo.status} and ys_flag in (null,0)
|
||||
</when>
|
||||
<otherwise>
|
||||
and s.status = #{qo.status}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="qo.openedby != null and qo.openedby != ''">
|
||||
and s.opened_by = #{qo.openedby}
|
||||
|
13
src/main/resources/mapper/ZtStoryUserspecMapper.xml
Normal file
13
src/main/resources/mapper/ZtStoryUserspecMapper.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?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.ZtStoryUserspecMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtStoryUserspec">
|
||||
<result column="story" property="story" />
|
||||
<result column="version" property="version" />
|
||||
<result column="title" property="title" />
|
||||
<result column="spec" property="spec" />
|
||||
<result column="verify" property="verify" />
|
||||
<result column="files" property="files" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
BIN
src/main/resources/templates/scope/UI工程师.xlsx
Normal file
BIN
src/main/resources/templates/scope/UI工程师.xlsx
Normal file
Binary file not shown.
BIN
src/main/resources/templates/scope/开发工程师.xlsx
Normal file
BIN
src/main/resources/templates/scope/开发工程师.xlsx
Normal file
Binary file not shown.
BIN
src/main/resources/templates/scope/测试工程师.xlsx
Normal file
BIN
src/main/resources/templates/scope/测试工程师.xlsx
Normal file
Binary file not shown.
BIN
src/main/resources/templates/scope/项目助理考核.xlsx
Normal file
BIN
src/main/resources/templates/scope/项目助理考核.xlsx
Normal file
Binary file not shown.
BIN
src/main/resources/templates/scope/项目经理考核.xlsx
Normal file
BIN
src/main/resources/templates/scope/项目经理考核.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user