按钮权限优化
This commit is contained in:
parent
adca2c007d
commit
2c4ce9d768
@ -1,6 +1,10 @@
|
||||
package com.zhgd.magic;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUserDataScope;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IProjectService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserDataScopeService;
|
||||
import com.zhgd.xmgl.security.SecurityUser;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -21,6 +25,14 @@ public class MagicInterceptor implements SQLInterceptor {
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IEngineeringService engineeringService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISystemUserDataScopeService systemUserDataScopeService;
|
||||
|
||||
@Override
|
||||
public void preHandle(BoundSql boundSql, RequestEntity requestEntity) {
|
||||
dataScopeFilterByProject(boundSql);
|
||||
@ -52,6 +64,21 @@ public class MagicInterceptor implements SQLInterceptor {
|
||||
sql = sql.replace("#project", "project_sn in ('" + projectSn + "')");
|
||||
}
|
||||
}
|
||||
} else if (user.getAccountType() == 3) {
|
||||
if (sql.contains("#project")) {
|
||||
List<String> scopeIds = systemUserDataScopeService.list(Wrappers.<SystemUserDataScope>lambdaQuery().eq(SystemUserDataScope::getUserId, user.getUserId()))
|
||||
.stream().map(u -> u.getRelevanceId()).collect(Collectors.toList());
|
||||
List<String> engineeringSns = scopeIds.size() > 0 ? scopeIds : engineeringService.getSnListByEnterprise(user.getSn());
|
||||
if (engineeringSns.size() == 0) {
|
||||
engineeringSns.add("0");
|
||||
}
|
||||
String engineeringSn = engineeringSns.stream().collect(Collectors.joining("','"));
|
||||
if (sql.contains("#projectalias")) {
|
||||
sql = sql.replace("#projectalias", "a.engineering_sn in ('"+ engineeringSn +"')");
|
||||
} else {
|
||||
sql = sql.replace("#project", "engineering_sn in ('" + engineeringSn + "')");
|
||||
}
|
||||
}
|
||||
} else if (user.getAccountType() == 4){
|
||||
if (sql.contains("#project")) {
|
||||
if (sql.contains("#projectalias")) {
|
||||
|
||||
@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -227,7 +228,7 @@ public class EntProjectSubItemController {
|
||||
@OperLog(operModul = "分部分项管理", operType = "导入", operDesc = "甘特图mpp文件导入")
|
||||
@ApiOperation(value = "甘特图mpp文件导入", notes = "甘特图mpp文件导入", httpMethod="POST")
|
||||
@PostMapping("/importMpp")
|
||||
public Result<Object> importMpp(MultipartFile file) {
|
||||
return Result.success(projectSubItemService.importMpp(file));
|
||||
public Result<Object> importMpp(MultipartFile file, HttpServletRequest request) {
|
||||
return Result.success(projectSubItemService.importMpp(file, request.getParameter("engineeringSn")));
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.modules.safety.dto.InvestmentPaymentDetailDto;
|
||||
import com.zhgd.xmgl.modules.safety.entity.InvestmentPaymentDetail;
|
||||
import com.zhgd.xmgl.modules.safety.service.IInvestmentPaymentDetailService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -54,10 +55,10 @@ public class GovInvestmentPaymentDetailController {
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<InvestmentPaymentDetail>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
public Result<IPage<InvestmentPaymentDetailDto>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<InvestmentPaymentDetail> queryWrapper = QueryGenerator.initPageQueryWrapper(InvestmentPaymentDetail.class, map);
|
||||
Page<InvestmentPaymentDetail> page = PageUtil.getPage(map);
|
||||
IPage<InvestmentPaymentDetail> pageList = investmentPaymentDetailService.page(page, queryWrapper);
|
||||
IPage<InvestmentPaymentDetailDto> pageList = investmentPaymentDetailService.pageList(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
|
||||
@ -141,6 +141,56 @@ public class GovProjectNodePlanController {
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectNodePlan
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目全景计划管理", operType = "修改", operDesc = "编辑项目全景计划信息")
|
||||
@ApiOperation(value = "编辑项目全景计划信息", notes = "编辑项目全景计划信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<ProjectNodePlan> edit(@RequestBody ProjectNodePlan projectNodePlan) {
|
||||
Result<ProjectNodePlan> result = new Result<ProjectNodePlan>();
|
||||
ProjectNodePlan projectNodePlanEntity = projectNodePlanService.getById(projectNodePlan.getId());
|
||||
if (projectNodePlanEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = projectNodePlanService.updateById(projectNodePlan);
|
||||
if (ok) {
|
||||
result.success("修改成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目全景计划管理", operType = "删除", operDesc = "删除项目全景计划信息")
|
||||
@ApiOperation(value = "删除项目全景计划信息", notes = "删除项目全景计划信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目全景计划ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<ProjectNodePlan> delete(@RequestBody ProjectNodePlan projectNodePlan) {
|
||||
Result<ProjectNodePlan> result = new Result<ProjectNodePlan>();
|
||||
ProjectNodePlan projectNodePlanEntity = projectNodePlanService.getById(projectNodePlan.getId());
|
||||
if (projectNodePlanEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = projectNodePlanService.removeById(projectNodePlan.getId());
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller.government;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
@ -163,4 +165,24 @@ public class GovProjectSubItemController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
* @param projectSubItem
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "分部分项管理", operType = "列表查询", operDesc = "审核信息")
|
||||
@ApiOperation(value = " 审核信息", notes = "审核信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "分部分项ID", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "approvalStatus", value = "审核状态(0:未审核;1:已审核通过;2:审核驳回)", paramType = "body", required = true, dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/examine")
|
||||
public Result<Object> examine(@RequestBody ProjectSubItem projectSubItem) {
|
||||
LambdaUpdateWrapper<ProjectSubItem> wrapper = Wrappers.<ProjectSubItem>lambdaUpdate();
|
||||
wrapper.set(ProjectSubItem::getApprovalStatus, projectSubItem.getApprovalStatus());
|
||||
wrapper.eq(ProjectSubItem::getId, projectSubItem.getId());
|
||||
return Result.success(projectSubItemService.update(wrapper));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,12 +3,15 @@ package com.zhgd.xmgl.modules.basicdata.controller.government;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.safety.entity.ProjectQuantity;
|
||||
import com.zhgd.xmgl.modules.safety.service.IProjectQuantityService;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
@ -56,6 +59,9 @@ public class ProjectQuantityController {
|
||||
@Autowired
|
||||
private IProjectQuantityService projectQuantityService;
|
||||
|
||||
@Autowired
|
||||
private IEngineeringService engineeringService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -252,7 +258,7 @@ public class ProjectQuantityController {
|
||||
List<ProjectQuantity> listProjectQuantitys = ExcelImportUtil.importExcel(file.getInputStream(), ProjectQuantity.class, params);
|
||||
for (ProjectQuantity projectQuantityExcel : listProjectQuantitys) {
|
||||
projectQuantityExcel.setEngineeringSn(request.getParameter("engineeringSn"));
|
||||
projectQuantityExcel.setProjectSn(request.getParameter("projectSn"));
|
||||
projectQuantityExcel.setProjectSn(engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, projectQuantityExcel.getEngineeringSn())).getProjectSn());
|
||||
projectQuantityExcel.setCreateTime(new Date());
|
||||
projectQuantityService.save(projectQuantityExcel);
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -200,7 +201,7 @@ public class ProjectSubItemController {
|
||||
@OperLog(operModul = "分部分项管理", operType = "导入", operDesc = "甘特图mpp文件导入")
|
||||
@ApiOperation(value = "甘特图mpp文件导入", notes = "甘特图mpp文件导入", httpMethod="POST")
|
||||
@PostMapping("/importMpp")
|
||||
public Result<Object> importMpp(MultipartFile file) {
|
||||
return Result.success(projectSubItemService.importMpp(file));
|
||||
public Result<Object> importMpp(MultipartFile file, HttpServletRequest request) {
|
||||
return Result.success(projectSubItemService.importMpp(file, request.getParameter("engineeringSn")));
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,13 +11,11 @@ import com.zhgd.mybatis.Aes;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.*;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.EnterpriseMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.ProjectMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseMainLicenseService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseMainService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.*;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import com.zhgd.xmgl.util.CommonUtil;
|
||||
import com.zhgd.xmgl.util.ParamEnum;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -42,6 +40,12 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
@Autowired
|
||||
private ISystemRoleService systemRoleService;
|
||||
|
||||
@Autowired
|
||||
private ISystemUserRoleService systemUserRoleService;
|
||||
|
||||
@Autowired
|
||||
private IEnterpriseMainService enterpriseMainService;
|
||||
|
||||
@ -99,7 +103,7 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||
systemUser.setPassword(Aes.encrypt(enterpriseVo.getPassword()));
|
||||
systemUser.setShowPassword(enterpriseVo.getPassword());
|
||||
systemUser.setRealName(enterpriseVo.getRealName());
|
||||
systemUser.setIsManager(true);
|
||||
systemUser.setIsManager(false);
|
||||
systemUser.setState(enterpriseVo.getState());
|
||||
systemUser.setUserTel(enterpriseVo.getPhone());
|
||||
systemUser.setSn(enterpriseVo.getEnterpriseSn());
|
||||
@ -107,6 +111,17 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||
systemUser.setEmail(enterpriseVo.getEmail());
|
||||
systemUser.setCreateTime(new Date());
|
||||
systemUserService.save(systemUser);
|
||||
for (ParamEnum.EngineeringMain type : ParamEnum.EngineeringMain.values()) {
|
||||
if (type.getValue().equals(enterpriseVo.getEnterpriseMains().get(0).getMainType())) {
|
||||
SystemRole role = systemRoleService.getOne(Wrappers.<SystemRole>lambdaQuery().eq(SystemRole::getRoleCode, type.name()));
|
||||
if (role != null) {
|
||||
SystemUserRole systemUserRole = new SystemUserRole();
|
||||
systemUserRole.setUserId(systemUser.getUserId());
|
||||
systemUserRole.setRoleId(role.getRoleId());
|
||||
systemUserRoleService.save(systemUserRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (EnterpriseMain enterpriseMain : enterpriseVo.getEnterpriseMains()) {
|
||||
enterpriseMain.setEnterpriseSn(enterpriseVo.getEnterpriseSn());
|
||||
enterpriseMainService.save(enterpriseMain);
|
||||
|
||||
@ -77,4 +77,10 @@ public class InspectQuestionExamine implements Serializable {
|
||||
@Excel(name = "审核意见", width = 15)
|
||||
@ApiModelProperty(value = "审核意见")
|
||||
private String suggest;
|
||||
/**
|
||||
* 措施建议
|
||||
*/
|
||||
@Excel(name = "措施建议", width = 15)
|
||||
@ApiModelProperty(value = "措施建议")
|
||||
private String recommend;
|
||||
}
|
||||
|
||||
@ -163,9 +163,9 @@ public class ProjectSubItem implements Serializable {
|
||||
private String engineeringSn;
|
||||
|
||||
/**
|
||||
* 审核状态(0:未审核通过;1:已审核通过)
|
||||
* 审核状态(0:未审核;1:已审核通过;2:审核驳回)
|
||||
*/
|
||||
@Excel(name = "审核状态(0:未审核通过;1:已审核通过)", width = 15)
|
||||
@ApiModelProperty(value = "审核状态(0:未审核通过;1:已审核通过)")
|
||||
@Excel(name = "审核状态(0:未审核;1:已审核通过;2:审核驳回)", width = 15)
|
||||
@ApiModelProperty(value = "审核状态(0:未审核;1:已审核通过;2:审核驳回)")
|
||||
private Integer approvalStatus;
|
||||
}
|
||||
|
||||
@ -36,5 +36,5 @@ public interface IProjectSubItemService extends IService<ProjectSubItem> {
|
||||
|
||||
boolean delete(Long id);
|
||||
|
||||
boolean importMpp(MultipartFile file);
|
||||
boolean importMpp(MultipartFile file, String engineeringSn);
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ public class InvestmentPaymentDetailServiceImpl extends ServiceImpl<InvestmentPa
|
||||
|
||||
@Override
|
||||
public Page<InvestmentPaymentDetailDto> pageList(Page page, QueryWrapper<InvestmentPaymentDetail> wrapper) {
|
||||
wrapper.eq("parent_id", 0);
|
||||
wrapper.lambda().eq(InvestmentPaymentDetail::getParentId, 0);
|
||||
Page<InvestmentPaymentDetailDto> pageList = PageUtil.copyProperties(baseMapper.selectPage(page, wrapper), InvestmentPaymentDetailDto.class);
|
||||
List<InvestmentPaymentDetailDto> records = pageList.getRecords();
|
||||
List<Long> ids = records.stream().map(r -> r.getId()).collect(Collectors.toList());
|
||||
|
||||
@ -12,6 +12,7 @@ import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.handler.exception.CustomException;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringPageDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectPageDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IFileDetailService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IProjectService;
|
||||
@ -113,6 +114,9 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
|
||||
@Override
|
||||
public boolean updateInfo(ProjectSubItem projectSubItem) {
|
||||
if (projectSubItem.getApprovalStatus() == 2) {
|
||||
projectSubItem.setApprovalStatus(0);
|
||||
}
|
||||
// 计算完成比率
|
||||
if (projectSubItem.getParentId() != null && !projectSubItem.getParentId().equals(0L)) {
|
||||
this.updateById(projectSubItem);
|
||||
@ -144,10 +148,10 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean importMpp(MultipartFile file) {
|
||||
public boolean importMpp(MultipartFile file, String engineeringSn) {
|
||||
SecurityUser user = SecurityUtil.getUser();
|
||||
this.remove(Wrappers.<ProjectSubItem>lambdaQuery().eq(ProjectSubItem::getProjectSn, user.getSn()));
|
||||
Collection<ProjectSubItem> projectSubItems = analysisMpp(file, user.getSn(), user.getUserId());
|
||||
this.remove(Wrappers.<ProjectSubItem>lambdaQuery().eq(ProjectSubItem::getEngineeringSn, engineeringSn));
|
||||
Collection<ProjectSubItem> projectSubItems = analysisMpp(file, engineeringSn, user.getUserId());
|
||||
if (CollUtil.isNotEmpty(projectSubItems)) {
|
||||
return this.saveBatch(projectSubItems);
|
||||
}
|
||||
@ -200,7 +204,7 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
* @param createUserId 上传用户
|
||||
* @return
|
||||
*/
|
||||
private Collection<ProjectSubItem> analysisMpp(MultipartFile mppFile, String projectSn, String createUserId) {
|
||||
private Collection<ProjectSubItem> analysisMpp(MultipartFile mppFile, String engineeringSn, String createUserId) {
|
||||
List<ProjectSubItem> projectSubItems = new LinkedList<>();
|
||||
Set<String> userNameSet = new LinkedHashSet<>();
|
||||
// <mpp唯一id, 甘特图任务节点>
|
||||
@ -215,7 +219,7 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
// 递归拿到对应的数据, 跳过第0级无用数据
|
||||
List<Task> childTasks = pf.getChildTasks();
|
||||
if (CollUtil.isNotEmpty(childTasks)) {
|
||||
structureTaskDataList(projectSubItems, userNameSet, childTasks.get(0).getChildTasks(), uniqueIdProjectSubItemMap, projectSubItemPredecessorList, 0L, projectSn);
|
||||
structureTaskDataList(projectSubItems, userNameSet, childTasks.get(0).getChildTasks(), uniqueIdProjectSubItemMap, projectSubItemPredecessorList, 0L, engineeringSn);
|
||||
Map<Long, ProjectSubItem> ProjectSubItemMap = projectSubItems.stream().collect(Collectors.toMap(ProjectSubItem::getId, Function.identity()));
|
||||
// 赋值前置任务
|
||||
if (CollUtil.isNotEmpty(projectSubItemPredecessorList)) {
|
||||
@ -245,7 +249,7 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
* @param parentId 父级id
|
||||
* @param projectSn 项目sn
|
||||
*/
|
||||
private void structureTaskDataList(List<ProjectSubItem> progressTaskList, Set<String> userNameSet, List<Task> tasks, Map<Long, ProjectSubItem> uniqueIdProgressTaskMap, List<ProjectSubItemPredecessorDTO> progressTaskPredecessorList, Long parentId, String projectSn) {
|
||||
private void structureTaskDataList(List<ProjectSubItem> progressTaskList, Set<String> userNameSet, List<Task> tasks, Map<Long, ProjectSubItem> uniqueIdProgressTaskMap, List<ProjectSubItemPredecessorDTO> progressTaskPredecessorList, Long parentId, String engineeringSn) {
|
||||
if (CollectionUtils.isEmpty(tasks)) {
|
||||
return;
|
||||
}
|
||||
@ -305,8 +309,8 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
projectSubItem.setCommander(dutyUserName);
|
||||
userNameSet.add(dutyUserName);
|
||||
|
||||
projectSubItem.setProjectSn(projectSn);
|
||||
|
||||
projectSubItem.setProjectSn(engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, engineeringSn)).getProjectSn());
|
||||
projectSubItem.setEngineeringSn(engineeringSn);
|
||||
// TODO 前置任务列表
|
||||
List<Relation> predecessors = task.getPredecessors();
|
||||
if (CollUtil.isNotEmpty(predecessors)) {
|
||||
@ -316,7 +320,7 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
|
||||
// 唯一id对应任务
|
||||
uniqueIdProgressTaskMap.put(Long.valueOf(task.getUniqueID()), projectSubItem);
|
||||
progressTaskList.add(projectSubItem);
|
||||
structureTaskDataList(progressTaskList, userNameSet, task.getChildTasks(), uniqueIdProgressTaskMap, progressTaskPredecessorList, projectSubItem.getId(), projectSn);
|
||||
structureTaskDataList(progressTaskList, userNameSet, task.getChildTasks(), uniqueIdProgressTaskMap, progressTaskPredecessorList, projectSubItem.getId(), engineeringSn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user