|
|
@ -23,6 +23,7 @@ import com.spring.modules.sampleManagement.entity.BiAddress; |
|
|
import com.spring.modules.sift.entity.QuerySavedDetail; |
|
|
import com.spring.modules.sift.entity.QuerySavedDetail; |
|
|
import com.spring.modules.sift.utils.QueryCriteriaConstructorDefault; |
|
|
import com.spring.modules.sift.utils.QueryCriteriaConstructorDefault; |
|
|
import com.spring.modules.sift.vo.QuerySavedVo; |
|
|
import com.spring.modules.sift.vo.QuerySavedVo; |
|
|
|
|
|
import com.spring.modules.sys.dao.SysRoleDao; |
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
import com.spring.modules.sys.service.SysRoleService; |
|
|
import com.spring.modules.sys.service.SysRoleService; |
|
|
import com.spring.modules.sys.service.SysUserService; |
|
|
import com.spring.modules.sys.service.SysUserService; |
|
|
@ -50,6 +51,8 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
private SysUserService sysUserService; |
|
|
private SysUserService sysUserService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysRoleService sysRoleService; |
|
|
private SysRoleService sysRoleService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysRoleDao sysRoleDao; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageUtils projectInfoSearch(PlmProjectInfoData inData){ |
|
|
public PageUtils projectInfoSearch(PlmProjectInfoData inData){ |
|
|
@ -60,6 +63,8 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
// // 存在角色编码为1的 即存在超级管理员 |
|
|
// // 存在角色编码为1的 即存在超级管理员 |
|
|
// inData.setRoleId(1); |
|
|
// inData.setRoleId(1); |
|
|
// } |
|
|
// } |
|
|
|
|
|
String superFlag = sysRoleDao.getSuperFlag(inData.getUserId()); |
|
|
|
|
|
inData.setSuperFlag(superFlag); |
|
|
IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearch( |
|
|
IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearch( |
|
|
new Page<PlmProjectInfoData>(inData.getPage(), inData.getLimit()), inData); |
|
|
new Page<PlmProjectInfoData>(inData.getPage(), inData.getLimit()), inData); |
|
|
|
|
|
|
|
|
@ -175,15 +180,15 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
@Override |
|
|
@Override |
|
|
@Transactional |
|
|
@Transactional |
|
|
public String saveProjectInfo(PlmProjectInfoData inData){ |
|
|
public String saveProjectInfo(PlmProjectInfoData inData){ |
|
|
List<PlmProjectInfoData> list = projectDao.getProjectByName(inData.getSite(),inData.getProjectName()); |
|
|
|
|
|
if (!list.isEmpty()){ |
|
|
|
|
|
throw new RuntimeException("项目名称已存在!"); |
|
|
|
|
|
} |
|
|
|
|
|
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
List<PlmProjectTeam> plmProjectTeams = new ArrayList<>(); |
|
|
List<PlmProjectTeam> plmProjectTeams = new ArrayList<>(); |
|
|
List<PlmUserRoleData> userRoleList = new ArrayList<>(); |
|
|
List<PlmUserRoleData> userRoleList = new ArrayList<>(); |
|
|
String projectId = ""; |
|
|
String projectId = ""; |
|
|
if (inData.getId() == 0) { |
|
|
if (inData.getId() == 0) { |
|
|
|
|
|
List<PlmProjectInfoData> list = projectDao.getProjectByName(inData.getSite(),inData.getProjectName()); |
|
|
|
|
|
if (!list.isEmpty()){ |
|
|
|
|
|
throw new RuntimeException("项目名称已存在!"); |
|
|
|
|
|
} |
|
|
if (StringUtils.hasText(inData.getProjectId())) { |
|
|
if (StringUtils.hasText(inData.getProjectId())) { |
|
|
projectId = seqRuleService.getSeqNo(inData.getSite(),"XM",inData.getProjectId()); |
|
|
projectId = seqRuleService.getSeqNo(inData.getSite(),"XM",inData.getProjectId()); |
|
|
inData.setParentProjectNo(inData.getProjectId()); |
|
|
inData.setParentProjectNo(inData.getProjectId()); |
|
|
@ -430,11 +435,13 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
String orderClause = conditionMap.get("order"); |
|
|
String orderClause = conditionMap.get("order"); |
|
|
whereClause = (whereClause.isEmpty() ? "site = '" + data.getSite() + "'" : whereClause + " AND site = '" + data.getSite() + "'").trim(); |
|
|
whereClause = (whereClause.isEmpty() ? "site = '" + data.getSite() + "'" : whereClause + " AND site = '" + data.getSite() + "'").trim(); |
|
|
orderClause = orderClause.trim(); |
|
|
orderClause = orderClause.trim(); |
|
|
|
|
|
String superFlag = sysRoleDao.getSuperFlag(data.getUserId()); |
|
|
Map<String, String> params = new HashMap<>(); |
|
|
Map<String, String> params = new HashMap<>(); |
|
|
params.put("whereClause", whereClause); |
|
|
params.put("whereClause", whereClause); |
|
|
params.put("orderClause", orderClause); |
|
|
params.put("orderClause", orderClause); |
|
|
params.put("userName", data.getUserName()); |
|
|
params.put("userName", data.getUserName()); |
|
|
params.put("site", data.getSite()); |
|
|
params.put("site", data.getSite()); |
|
|
|
|
|
params.put("superFlag", superFlag); |
|
|
IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearchByAnyField(new Page<PlmProjectInfoData>(data.getNo(), data.getSize()), params); |
|
|
IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearchByAnyField(new Page<PlmProjectInfoData>(data.getNo(), data.getSize()), params); |
|
|
return new PageUtils(resultList); |
|
|
return new PageUtils(resultList); |
|
|
} |
|
|
} |
|
|
|