Compare commits
9 Commits
d377efeaad
...
09b6736298
Author | SHA1 | Date | |
---|---|---|---|
09b6736298 | |||
a54e8dafb8 | |||
|
da387c04be | ||
|
9639d21c0e | ||
|
c229ed59b8 | ||
|
f57e949d65 | ||
|
1d588f4c2d | ||
|
ec2a30075d | ||
|
07601350bf |
|
@ -1,6 +1,8 @@
|
|||
package com.jsl.oa.controllers;
|
||||
|
||||
import com.jsl.oa.annotations.NeedPermission;
|
||||
import com.jsl.oa.model.dodata.ProjectChildDO;
|
||||
import com.jsl.oa.model.dodata.ProjectModuleDO;
|
||||
import com.jsl.oa.model.vodata.ProjectChildAddVO;
|
||||
import com.jsl.oa.model.vodata.ProjectEditVO;
|
||||
import com.jsl.oa.model.vodata.ProjectInfoVO;
|
||||
|
@ -365,7 +367,7 @@ public class ProjectController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 项目名查询子系统
|
||||
* 项目名查询所属所有子系统
|
||||
*
|
||||
* @param name
|
||||
* @param request
|
||||
|
@ -379,6 +381,29 @@ public class ProjectController {
|
|||
return projectService.projectChildGetName(name, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* id查询子系统
|
||||
*
|
||||
* @param id
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/project/child/get/id")
|
||||
public BaseResponse projectChildById(
|
||||
@RequestParam Integer id,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return projectService.projectChildGetById(id, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目和子系统名查询所属所有子模块
|
||||
*
|
||||
* @param projectName
|
||||
* @param childName
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/project/module/get/name")
|
||||
public BaseResponse projectModuleGetName(
|
||||
@RequestParam String projectName,
|
||||
|
@ -388,4 +413,40 @@ public class ProjectController {
|
|||
return projectService.projectModuleGetName(projectName, childName, request);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/project/module/get/id")
|
||||
public BaseResponse projectModuleGetName(
|
||||
@RequestParam Integer childId,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return projectService.projectModuleGetById(childId, request);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/project/module/edit")
|
||||
public BaseResponse projectModuleEdit(
|
||||
@RequestParam Long id,
|
||||
@RequestBody ProjectModuleDO projectModuleAddVO,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return projectService.projectModuleEdit(request, projectModuleAddVO, id);
|
||||
}
|
||||
|
||||
@PutMapping("/project/edit")
|
||||
public BaseResponse projectEdit(
|
||||
@RequestParam Long id,
|
||||
@RequestBody ProjectEditVO projectEditVO,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return projectService.projectEdit(request, projectEditVO, id);
|
||||
}
|
||||
|
||||
@PutMapping("/project/child/edit")
|
||||
public BaseResponse projectChildEdit(
|
||||
@RequestParam Long id,
|
||||
@RequestBody ProjectChildDO projectChildAddVO,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return projectService.projectChildEdit(request, projectChildAddVO, id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ReviewController {
|
|||
public BaseResponse addReview(@RequestBody @Validated ReviewAddVO reviewAddVO,
|
||||
@NotNull BindingResult bindingResult,
|
||||
HttpServletRequest request) {
|
||||
log.info("请求接口[POST]: /review/add");
|
||||
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultUtil.error(ErrorCode.REQUEST_BODY_ERROR);
|
||||
|
@ -83,7 +83,6 @@ public class ReviewController {
|
|||
public BaseResponse updateReview(@RequestBody @Validated ReviewUpdateResultVO reviewUpdateResultVOVO,
|
||||
@NotNull BindingResult bindingResult,
|
||||
HttpServletRequest request) {
|
||||
log.info("请求接口[PUT]: /review/updateReview");
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultUtil.error(ErrorCode.REQUEST_BODY_ERROR);
|
||||
|
@ -98,7 +97,7 @@ public class ReviewController {
|
|||
HttpServletRequest request,
|
||||
@RequestParam Integer page,
|
||||
@RequestParam Integer pageSize) {
|
||||
log.info("请求接口[GET]: /review/searchMyReview");
|
||||
|
||||
return reviewService.searchReview(content, request, page, pageSize);
|
||||
}
|
||||
|
||||
|
@ -108,7 +107,7 @@ public class ReviewController {
|
|||
HttpServletRequest request,
|
||||
@RequestParam Integer page,
|
||||
@RequestParam Integer pageSize) {
|
||||
log.info("请求接口[GET]: /review/searchReviewRecords");
|
||||
|
||||
return reviewService.searchReviewRecords(content, statue, request, page, pageSize);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,8 @@ import com.jsl.oa.model.dodata.ProjectChildDO;
|
|||
import com.jsl.oa.model.dodata.ProjectDO;
|
||||
import com.jsl.oa.model.dodata.ProjectModuleDO;
|
||||
import com.jsl.oa.model.dodata.info.ProjectShowDO;
|
||||
import com.jsl.oa.model.vodata.ProjectEditVO;
|
||||
import com.jsl.oa.model.vodata.ProjectInfoVO;
|
||||
import com.jsl.oa.model.vodata.ProjectChildAddVO;
|
||||
import com.jsl.oa.utils.Processing;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -41,15 +39,12 @@ public class ProjectDAO {
|
|||
projectMapper.projectWorkAdd(projectChildAddVO);
|
||||
}
|
||||
|
||||
public ProjectDO projectEdit(@NotNull ProjectEditVO projectEdit, Long projectId) {
|
||||
public ProjectDO projectEdit(@NotNull ProjectDO projectEdit) {
|
||||
log.info("\t> 执行 DAO 层 ProjectDAO.projectEdit 方法");
|
||||
log.info("\t\t> 从 MySQL 更新数据");
|
||||
ProjectDO projectDO = new ProjectDO();
|
||||
Processing.copyProperties(projectEdit, projectDO);
|
||||
projectDO.setId(projectId);
|
||||
projectMapper.projectEdit(projectDO);
|
||||
projectMapper.projectEdit(projectEdit);
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
return projectMapper.getProjectById(projectId);
|
||||
return projectMapper.getProjectById(projectEdit.getId());
|
||||
}
|
||||
|
||||
public boolean isExistProject(Long id) {
|
||||
|
|
|
@ -36,6 +36,8 @@ public interface ProjectMapper {
|
|||
+ "#{description},#{status},#{deadLine},#{cycle})")
|
||||
void projectModuleAdd(ProjectModuleAddVO projectModuleAddVO);
|
||||
|
||||
@Select("select project_id from organize_oa.oa_project_child where id=#{id}")
|
||||
Long getProjectIdBySysId(Long id);
|
||||
void projectEdit(ProjectDO projectEdit);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where id=#{id}")
|
||||
|
@ -84,7 +86,6 @@ public interface ProjectMapper {
|
|||
//@Select("select * from organize_oa.oa_project_work where status=1 and principal_id=#{userId}")
|
||||
List<ProjectDO> workget1(Long userId, Integer is);
|
||||
|
||||
|
||||
List<ProjectDO> tget(Integer id);
|
||||
|
||||
List<ProjectDO> tgetByIsfinish(List<String> isFinish);
|
||||
|
@ -168,4 +169,19 @@ public interface ProjectMapper {
|
|||
+ "and project_id = (select id from organize_oa.oa_project where name =#{projectName}))")
|
||||
List<ProjectModuleDO> getModuleByName(String projectName, String childName);
|
||||
|
||||
void projectModuleUpdate(ProjectModuleDO projectModuleDO);
|
||||
|
||||
void projectChildEdit(ProjectChildDO projectChildDO);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_child where project_id = #{id} "
|
||||
+ "and is_delete = 0")
|
||||
List<ProjectChildDO> getAllChildByProjectId(Integer id);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_modules where project_child_id = #{id} "
|
||||
+ "and is_delete = 0")
|
||||
List<ProjectModuleDO> getModuleByChildId(Integer id);
|
||||
|
||||
void projectModuleEdit(ProjectModuleDO projectModuleAddVO);
|
||||
|
||||
void projectChildEditAll(ProjectChildDO projectChildAddVO);
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@ import java.sql.Timestamp;
|
|||
@Accessors(chain = true)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ProjectModuleDO {
|
||||
private String name;
|
||||
private Long id;
|
||||
private Long projectChildId;
|
||||
private Long principalId;
|
||||
private Integer cycle;
|
||||
private Integer workLoad;
|
||||
private String description;
|
||||
private String name;
|
||||
private Integer isDelete;
|
||||
private String status;
|
||||
private Timestamp deadLine;
|
||||
|
|
|
@ -7,14 +7,14 @@ import java.sql.Timestamp;
|
|||
@Data
|
||||
public class ProjectEditVO {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long principalId;
|
||||
private String tags;
|
||||
private Long cycle;
|
||||
private String file;
|
||||
private String files;
|
||||
private String description;
|
||||
private Integer isFinish;
|
||||
private Integer status;
|
||||
private String status;
|
||||
private Long workLoad;
|
||||
private Timestamp beginTime;
|
||||
private Timestamp completeTime;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.jsl.oa.services;
|
||||
|
||||
import com.jsl.oa.model.dodata.ProjectChildDO;
|
||||
import com.jsl.oa.model.dodata.ProjectModuleDO;
|
||||
import com.jsl.oa.model.vodata.ProjectEditVO;
|
||||
import com.jsl.oa.model.vodata.ProjectInfoVO;
|
||||
import com.jsl.oa.model.vodata.ProjectChildAddVO;
|
||||
|
@ -71,9 +73,19 @@ public interface ProjectService {
|
|||
|
||||
BaseResponse projectGetName(String name, HttpServletRequest request);
|
||||
|
||||
|
||||
|
||||
BaseResponse projectModuleAdd(HttpServletRequest request, ProjectModuleAddVO projectModuleAddVO);
|
||||
|
||||
BaseResponse projectChildGetName(String name, HttpServletRequest request);
|
||||
|
||||
BaseResponse projectChildGetById(Integer id, HttpServletRequest request);
|
||||
|
||||
BaseResponse projectModuleGetName(String projectName, String childName, HttpServletRequest request);
|
||||
|
||||
BaseResponse projectModuleGetById(Integer id, HttpServletRequest request);
|
||||
|
||||
BaseResponse projectModuleEdit(HttpServletRequest request, ProjectModuleDO projectModuleAddVO, Long id);
|
||||
|
||||
BaseResponse projectChildEdit(HttpServletRequest request, ProjectChildDO projectChildAddVO, Long id);
|
||||
}
|
||||
|
|
|
@ -192,7 +192,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
// 添加消息
|
||||
// 1:上传文档 2:修改状态 3:修改负责人
|
||||
List<Long> uidList = projectMapper.getMemberByProjectId(pId);
|
||||
if (!uidList.isEmpty()) {
|
||||
for (Long uid : uidList) {
|
||||
if (uid != null) {
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(uid);
|
||||
messageAddVO.setSid(Processing.getAuthHeaderToUserId(request));
|
||||
|
@ -213,7 +215,8 @@ public class MessageServiceImpl implements MessageService {
|
|||
messageMapper.messageAdd(messageAddVO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 添加子系统变动消息
|
||||
*
|
||||
|
@ -234,7 +237,10 @@ public class MessageServiceImpl implements MessageService {
|
|||
String projectName = projectMapper.tgetProjectById(pId).getName();
|
||||
String senderName = userDAO.getUserById(Processing.getAuthHeaderToUserId(request)).getUsername();
|
||||
String systemName = projectMapper.getWorkById(systmeId).getName();
|
||||
String moddleName = projectMapper.getModuleById(moddleId).getName();
|
||||
String moddleName = null;
|
||||
if (moddleId != null) {
|
||||
moddleName = projectMapper.getModuleById(moddleId).getName();
|
||||
}
|
||||
// 添加消息
|
||||
// 1:删除模块 2:修改简介 3:修改周期
|
||||
if (type == 1) {
|
||||
|
@ -247,7 +253,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
messageMapper.messageAdd(messageAddVO);
|
||||
} else {
|
||||
List<Long> uidList = projectMapper.getMemberBySystemId(systmeId);
|
||||
if (!uidList.isEmpty()) {
|
||||
for (Long uid : uidList) {
|
||||
if (uid != null) {
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(uid);
|
||||
messageAddVO.setSid(Processing.getAuthHeaderToUserId(request));
|
||||
|
@ -265,6 +273,8 @@ public class MessageServiceImpl implements MessageService {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加成员填写日报消息
|
||||
|
@ -311,6 +321,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
List<ProjectModuleDO> projectWorkDOList1 = projectMapper.getProjectWorkByTime(sevenDaysLater);
|
||||
if (!projectWorkDOList1.isEmpty()) {
|
||||
for (ProjectModuleDO projectWorkDO : projectWorkDOList) {
|
||||
if (projectWorkDO.getPrincipalId() == null) {
|
||||
continue;
|
||||
}
|
||||
// 添加消息
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(projectWorkDO.getPrincipalId());
|
||||
|
@ -330,6 +343,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
}
|
||||
if (!projectWorkDOList.isEmpty()) {
|
||||
for (ProjectModuleDO projectWorkDO : projectWorkDOList) {
|
||||
if (projectWorkDO.getPrincipalId() == null) {
|
||||
continue;
|
||||
}
|
||||
// 添加消息
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(projectWorkDO.getPrincipalId());
|
||||
|
@ -352,6 +368,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
List<ProjectChildDO> projectChildDOList = projectMapper.getProjectChildByTime(sevenDaysLater);
|
||||
if (!projectChildDOList.isEmpty()) {
|
||||
for (ProjectChildDO projectChildDO : projectChildDOList) {
|
||||
if (projectChildDO.getPrincipalId() == null) {
|
||||
continue;
|
||||
}
|
||||
// 添加消息
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(projectChildDO.getPrincipalId());
|
||||
|
@ -368,6 +387,9 @@ public class MessageServiceImpl implements MessageService {
|
|||
List<ProjectChildDO> projectChildDOList1 = projectMapper.getProjectChildByTime(threeDaysLater);
|
||||
if (!projectChildDOList1.isEmpty()) {
|
||||
for (ProjectChildDO projectChildDO : projectChildDOList1) {
|
||||
if (projectChildDO.getPrincipalId() == null) {
|
||||
continue;
|
||||
}
|
||||
// 添加消息
|
||||
MessageAddVO messageAddVO = new MessageAddVO();
|
||||
messageAddVO.setUid(projectChildDO.getPrincipalId());
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.jsl.oa.model.vodata.ProjectDailyAddVO;
|
|||
import com.jsl.oa.model.vodata.ProjectDailyDataVO;
|
||||
import com.jsl.oa.model.vodata.ProjectDailyUpdateVO;
|
||||
import com.jsl.oa.model.vodata.ProjectDailyVO;
|
||||
import com.jsl.oa.services.MessageService;
|
||||
import com.jsl.oa.services.ProjectDailyService;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import com.jsl.oa.utils.ErrorCode;
|
||||
|
@ -45,6 +46,7 @@ public class ProjectDailyServiceImpl implements ProjectDailyService {
|
|||
private final UserDAO userDAO;
|
||||
private final ProjectDailyDAO projectDailyDAO;
|
||||
private final ProjectDailyMapper projectDailyMapper;
|
||||
private final MessageService messageService;
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.jsl.oa.annotations.NeedPermission;
|
||||
import com.jsl.oa.dao.ProjectDAO;
|
||||
import com.jsl.oa.dao.RoleDAO;
|
||||
|
@ -278,6 +279,21 @@ public class ProjectServiceImpl implements ProjectService {
|
|||
return ResultUtil.success(returnGetVOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse projectChildGetById(Integer id, HttpServletRequest request) {
|
||||
|
||||
List<ProjectChildDO> projectChildDOList = projectMapper.getAllChildByProjectId(id);
|
||||
|
||||
List<ReturnGetVO> returnGetVOList = new ArrayList<>();
|
||||
for (ProjectChildDO projectChildDO : projectChildDOList) {
|
||||
ReturnGetVO returnGetVO = new ReturnGetVO();
|
||||
Processing.copyProperties(projectChildDO, returnGetVO);
|
||||
returnGetVOList.add(returnGetVO);
|
||||
}
|
||||
|
||||
return ResultUtil.success(returnGetVOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse projectModuleGetName(String projectName, String childName, HttpServletRequest request) {
|
||||
List<ProjectModuleDO> projectModuleDOList = projectMapper.getModuleByName(projectName, childName);
|
||||
|
@ -290,6 +306,70 @@ public class ProjectServiceImpl implements ProjectService {
|
|||
return ResultUtil.success(returnGetVOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse projectModuleGetById(Integer id, HttpServletRequest request) {
|
||||
List<ProjectModuleDO> projectModuleDOList = projectMapper.getModuleByChildId(id);
|
||||
List<ReturnGetVO> returnGetVOList = new ArrayList<>();
|
||||
for (ProjectModuleDO projectModuleDO : projectModuleDOList) {
|
||||
ReturnGetVO returnGetVO = new ReturnGetVO();
|
||||
Processing.copyProperties(projectModuleDO, returnGetVO);
|
||||
returnGetVOList.add(returnGetVO);
|
||||
}
|
||||
return ResultUtil.success(returnGetVOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse projectModuleEdit(HttpServletRequest request, ProjectModuleDO projectModuleEditVO, Long id) {
|
||||
//判断是否是子系统负责人或项目负责人
|
||||
if (!Objects.equals(Processing.getAuthHeaderToUserId(request), projectMapper.getPirTdByModuleId(id))
|
||||
// 项目负责人
|
||||
&& !Objects.equals(Processing.getAuthHeaderToUserId(request),
|
||||
projectMapper.getPirIdbyId(projectMapper.getModuleById(id.intValue()).getProjectChildId()))) {
|
||||
return ResultUtil.error(ErrorCode.NOT_PERMISSION);
|
||||
} else {
|
||||
HashMap<String, Object> descriptionMap = new HashMap<>();
|
||||
descriptionMap.put("description", projectModuleEditVO.getDescription());
|
||||
projectModuleEditVO.setDescription(gson.toJson(descriptionMap));
|
||||
projectModuleEditVO.setId(id);
|
||||
projectMapper.projectModuleEdit(projectModuleEditVO);
|
||||
}
|
||||
|
||||
|
||||
return ResultUtil.success("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse projectChildEdit(HttpServletRequest request, ProjectChildDO projectChildAddVO, Long id) {
|
||||
//判断是否是项目负责人
|
||||
if (!Objects.equals(Processing.getAuthHeaderToUserId(request), projectMapper.getPirIdbyId(id))) {
|
||||
return ResultUtil.error(ErrorCode.NOT_PERMISSION);
|
||||
} else {
|
||||
JsonObject jsonObject = gson
|
||||
.fromJson(projectMapper.getProjectChildById(id.intValue()).getDescription(), JsonObject.class);
|
||||
//改动简介发送消息
|
||||
if (!Objects.equals(projectChildAddVO.getDescription(), "")
|
||||
&& !projectChildAddVO.getDescription()
|
||||
.equals(jsonObject.get("description").getAsString())) {
|
||||
messageService.messageAdd(projectMapper.getProjectIdBySysId(id)
|
||||
.intValue(), id.intValue(), null, 2, request);
|
||||
} // 改动周期或工作量发送消息
|
||||
if (projectChildAddVO.getCycle() != null || projectChildAddVO.getWorkLoad() != null) {
|
||||
messageService.messageAdd(projectMapper.getProjectIdBySysId(id)
|
||||
.intValue(), id.intValue(), null, 3, request);
|
||||
}
|
||||
|
||||
HashMap<String, Object> descriptionMap = new HashMap<>();
|
||||
descriptionMap.put("description", projectChildAddVO.getDescription());
|
||||
projectChildAddVO.setDescription(gson.toJson(descriptionMap));
|
||||
|
||||
projectChildAddVO.setId(id);
|
||||
projectMapper.projectChildEditAll(projectChildAddVO);
|
||||
}
|
||||
|
||||
|
||||
return ResultUtil.success("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse getModuleById(Integer id) {
|
||||
ProjectModuleDO projectWorkSimpleVO = projectMapper.getModuleById(id);
|
||||
|
@ -340,16 +420,32 @@ public class ProjectServiceImpl implements ProjectService {
|
|||
public BaseResponse projectEdit(HttpServletRequest request, @NotNull ProjectEditVO projectEdit, Long projectId) {
|
||||
|
||||
|
||||
//判断用户是否为老师 或者 项目负责人
|
||||
//判断用户是否为负责人 或者 项目负责人
|
||||
if (!Processing.checkUserIsPrincipal(request, roleDAO)
|
||||
|| !projectDAO.isPrincipalUser(Processing.getAuthHeaderToUserId(request), projectId)) {
|
||||
&& !projectDAO.isPrincipalUser(Processing.getAuthHeaderToUserId(request), projectId)) {
|
||||
return ResultUtil.error(ErrorCode.NOT_PERMISSION);
|
||||
}
|
||||
|
||||
//判断项目是否存在
|
||||
if (projectDAO.isExistProject(projectId)) {
|
||||
//更新数据
|
||||
return ResultUtil.success(projectDAO.projectEdit(projectEdit, projectId));
|
||||
HashMap<String, Object> descriptionMap = new HashMap<>();
|
||||
descriptionMap.put("description", projectEdit.getDescription());
|
||||
projectEdit.setDescription(gson.toJson(descriptionMap));
|
||||
|
||||
HashMap<String, Object> tagMap = new HashMap<>();
|
||||
tagMap.put("tags", projectEdit.getTags().split(","));
|
||||
projectEdit.setTags(gson.toJson(tagMap));
|
||||
|
||||
HashMap<String, Object> filesMap = new HashMap<>();
|
||||
filesMap.put("URI", projectEdit.getFiles());
|
||||
projectEdit.setFiles(gson.toJson(filesMap));
|
||||
|
||||
projectEdit.setId(projectId);
|
||||
ProjectDO projectEdit1 = new ProjectDO();
|
||||
|
||||
Processing.copyProperties(projectEdit, projectEdit1);
|
||||
projectDAO.projectEdit(projectEdit1);
|
||||
return ResultUtil.success(projectDAO.projectEdit(projectEdit1));
|
||||
} else {
|
||||
return ResultUtil.error(ErrorCode.PROJECT_NOT_EXIST);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.jsl.oa.model.vodata.ReviewAddVO;
|
|||
import com.jsl.oa.model.vodata.ReviewDataVO;
|
||||
import com.jsl.oa.model.vodata.ReviewUpdateResultVO;
|
||||
import com.jsl.oa.model.vodata.ReviewVO;
|
||||
import com.jsl.oa.services.MessageService;
|
||||
import com.jsl.oa.services.ReviewService;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import com.jsl.oa.utils.ErrorCode;
|
||||
|
@ -40,6 +41,8 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
private final UserMapper userMapper;
|
||||
private final ProjectMapper projectMapper;
|
||||
|
||||
private final MessageService messageService;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取用户未审核的数据(只包括管理项目下未审核的数据)
|
||||
|
@ -218,6 +221,7 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
//添加数据
|
||||
reviewDAO.addReview(reviewDO);
|
||||
|
||||
|
||||
return ResultUtil.success("申请成功");
|
||||
}
|
||||
|
||||
|
@ -235,11 +239,44 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
return ResultUtil.error(ErrorCode.REVIEW_NOT_EXIST);
|
||||
}
|
||||
|
||||
//修改对应项目负责人
|
||||
if (reviewUpdateResultVO.getResult() == ReviewConstants.APPROVED) {
|
||||
|
||||
//如果为子系统,则添加子系统负责人为申请人
|
||||
if (reviewDO.getCategory() == 0) {
|
||||
ProjectChildDO projectChildDO = projectMapper.
|
||||
getProjectChildById(Math.toIntExact(reviewDO.getProjectChildId()));
|
||||
if (projectChildDO == null) {
|
||||
return ResultUtil.error(ErrorCode.PROJECT_CHILD_NOT_EXIST);
|
||||
}
|
||||
projectChildDO.setPrincipalId(Long.valueOf(reviewDO.getSenderId()));
|
||||
projectMapper.projectChildEdit(projectChildDO);
|
||||
}
|
||||
//如果为子模块,则添加子模块负责人为申请人
|
||||
if (reviewDO.getCategory() == 1) {
|
||||
ProjectModuleDO projectModuleDO = projectMapper.
|
||||
getModuleById(Math.toIntExact(reviewDO.getProjectModuleId()));
|
||||
if (projectModuleDO == null) {
|
||||
return ResultUtil.error(ErrorCode.MODULE_NOT_EXIST);
|
||||
}
|
||||
projectModuleDO.setPrincipalId(Long.valueOf(reviewDO.getSenderId()));
|
||||
projectMapper.projectModuleUpdate(projectModuleDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//设置对应属性
|
||||
reviewDO.setReviewTime(new Date());
|
||||
reviewDO.setRecipientId(userId);
|
||||
reviewDO.setReviewResult(reviewUpdateResultVO.getResult());
|
||||
|
||||
//发送消息
|
||||
messageService.messageAdd(Math.toIntExact(reviewDO.getProjectId()),
|
||||
Math.toIntExact(reviewDO.getProjectChildId()),
|
||||
Math.toIntExact(reviewDO.getProjectModuleId()),
|
||||
Long.valueOf(reviewDO.getSenderId()),
|
||||
Long.valueOf(reviewUpdateResultVO.getResult()),
|
||||
request);
|
||||
//更新数据
|
||||
reviewDAO.updateReview(reviewDO);
|
||||
|
||||
|
|
|
@ -22,24 +22,21 @@
|
|||
<if test="cycle != null and cycle != ''">
|
||||
cycle = #{cycle},
|
||||
</if>
|
||||
<if test="file != null and file != ''">
|
||||
file = #{file},
|
||||
<if test="files != null and files != ''">
|
||||
files = #{files},
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''">
|
||||
<if test="beginTime != null ">
|
||||
begin_time = #{beginTime},
|
||||
</if>
|
||||
<if test="completeTime != null and completeTime != ''">
|
||||
<if test="completeTime != null ">
|
||||
complete_time = #{completeTime},
|
||||
</if>
|
||||
<if test="deadline != null and deadline != ''">
|
||||
<if test="deadline != null ">
|
||||
deadline = #{deadline},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="isFinish != null">
|
||||
is_finish = #{isFinish},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
is_delete = #{isDelete},
|
||||
</if>
|
||||
|
@ -47,6 +44,28 @@
|
|||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="projectChildEdit">
|
||||
update organize_oa.oa_project_child
|
||||
<set>
|
||||
<if test="principalId != null and principalId != ''">
|
||||
principal_id = #{principalId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="projectModuleUpdate">
|
||||
update organize_oa.oa_project_modules
|
||||
<set>
|
||||
<if test="principalId != null">
|
||||
principal_id = #{principalId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteProjectChild">
|
||||
update organize_oa.oa_project_child set is_delete=true where id=#{id1}
|
||||
</update>
|
||||
|
@ -55,6 +74,69 @@
|
|||
update organize_oa.oa_project_modules set is_delete=true where id=#{id1}
|
||||
</update>
|
||||
|
||||
<update id="projectModuleEdit">
|
||||
update organize_oa.oa_project_modules
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="principalId != null and principalId != ''">
|
||||
principal_id = #{principalId},
|
||||
</if>
|
||||
<if test="workLoad != null and workLoad != ''">
|
||||
work_load = #{workLoad},
|
||||
</if>
|
||||
<if test="cycle != null and cycle != ''">
|
||||
cycle = #{cycle},
|
||||
</if>
|
||||
<if test="completeTime != null ">
|
||||
complete_time = #{completeTime},
|
||||
</if>
|
||||
<if test="deadLine != null ">
|
||||
dead_line = #{deadLine},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="projectChildEditAll">
|
||||
update organize_oa.oa_project_child
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="principalId != null and principalId != ''">
|
||||
principal_id = #{principalId},
|
||||
</if>
|
||||
<if test="workLoad != null and workLoad != ''">
|
||||
work_load = #{workLoad},
|
||||
</if>
|
||||
<if test="cycle != null and cycle != ''">
|
||||
cycle = #{cycle},
|
||||
</if>
|
||||
<if test="completeTime != null ">
|
||||
complete_time = #{completeTime},
|
||||
</if>
|
||||
<if test="deadLine != null ">
|
||||
dead_line = #{deadLine},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getByTags" resultType="com.jsl.oa.model.dodata.ProjectDO">
|
||||
<if test="tags != null">
|
||||
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and
|
||||
|
|
Loading…
Reference in New Issue
Block a user