1、需求列表返回值新增项目、阶段、机台、工位的编码
2、调整批量更新权限设置参数逻辑
This commit is contained in:
@@ -99,11 +99,21 @@ public class SpdmDemandVo extends BaseEntity {
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String projectCode;
|
||||
|
||||
/**
|
||||
* 阶段id
|
||||
*/
|
||||
private String phaseId;
|
||||
|
||||
/**
|
||||
* 阶段编号
|
||||
*/
|
||||
private String phaseCode;
|
||||
|
||||
/**
|
||||
* 阶段名称
|
||||
*/
|
||||
@@ -119,6 +129,11 @@ public class SpdmDemandVo extends BaseEntity {
|
||||
*/
|
||||
private String machineName;
|
||||
|
||||
/**
|
||||
* 机台编号
|
||||
*/
|
||||
private String machineCode;
|
||||
|
||||
/**
|
||||
* 工位id
|
||||
*/
|
||||
@@ -129,6 +144,11 @@ public class SpdmDemandVo extends BaseEntity {
|
||||
*/
|
||||
private String workspaceName;
|
||||
|
||||
/**
|
||||
* 工位编号
|
||||
*/
|
||||
private String workspaceCode;
|
||||
|
||||
private String demandType;
|
||||
|
||||
private String simType;
|
||||
|
||||
@@ -659,15 +659,19 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
spdmDemandVo.setProgress(CollectionUtils.isEmpty(eachTaskList) ? 0 : eachTaskList.stream().mapToInt(SpdmTaskVo::getProgress).sum() / eachTaskList.size());
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getProjectId())) {
|
||||
spdmDemandVo.setProjectName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getProjectId())) ? nodeMap.get(spdmDemandVo.getProjectId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setProjectCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getProjectId())) ? nodeMap.get(spdmDemandVo.getProjectId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getPhaseId())) {
|
||||
spdmDemandVo.setPhaseName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getPhaseId())) ? nodeMap.get(spdmDemandVo.getPhaseId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setPhaseCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getPhaseId())) ? nodeMap.get(spdmDemandVo.getPhaseCode()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getMachineId())) {
|
||||
spdmDemandVo.setMachineName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getMachineId())) ? nodeMap.get(spdmDemandVo.getMachineId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setMachineCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getMachineId())) ? nodeMap.get(spdmDemandVo.getMachineId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getWorkspaceId())) {
|
||||
spdmDemandVo.setWorkspaceName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getWorkspaceId())) ? nodeMap.get(spdmDemandVo.getWorkspaceId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setWorkspaceCode((CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getWorkspaceId())) ? nodeMap.get(spdmDemandVo.getWorkspaceId()).get(0).getNodeCode() : ""));
|
||||
}
|
||||
eachDemandMemberList = demandMemberMap.get(spdmDemandVo.getUuid());
|
||||
if (CollectionUtils.isEmpty(eachDemandMemberList)) {
|
||||
@@ -1916,15 +1920,19 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
spdmDemandVo.setProgress(CollectionUtils.isEmpty(eachTaskList) ? 0 : eachTaskList.stream().mapToInt(SpdmTaskVo::getProgress).sum() / eachTaskList.size());
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getProjectId())) {
|
||||
spdmDemandVo.setProjectName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getProjectId())) ? nodeMap.get(spdmDemandVo.getProjectId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setProjectCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getProjectId())) ? nodeMap.get(spdmDemandVo.getProjectId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getPhaseId())) {
|
||||
spdmDemandVo.setPhaseName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getPhaseId())) ? nodeMap.get(spdmDemandVo.getPhaseId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setPhaseCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getPhaseId())) ? nodeMap.get(spdmDemandVo.getPhaseId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getMachineId())) {
|
||||
spdmDemandVo.setMachineName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getMachineId())) ? nodeMap.get(spdmDemandVo.getMachineId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setMachineCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getMachineId())) ? nodeMap.get(spdmDemandVo.getMachineId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmDemandVo.getWorkspaceId())) {
|
||||
spdmDemandVo.setWorkspaceName(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getWorkspaceId())) ? nodeMap.get(spdmDemandVo.getWorkspaceId()).get(0).getNodeName() : "");
|
||||
spdmDemandVo.setWorkspaceCode(CollectionUtils.isNotEmpty(nodeMap.get(spdmDemandVo.getWorkspaceId())) ? nodeMap.get(spdmDemandVo.getWorkspaceId()).get(0).getNodeCode() : "");
|
||||
}
|
||||
eachDemandMemberList = demandMemberMap.get(spdmDemandVo.getUuid());
|
||||
if (CollectionUtils.isEmpty(eachDemandMemberList)) {
|
||||
|
||||
@@ -717,14 +717,20 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 批量更新权限
|
||||
if (CollectionUtils.isNotEmpty(updatePermissionList)) {
|
||||
List<BatchUpdatePermissionReq.FilePermissionItem> filePermissions = new ArrayList<>();
|
||||
for (UpdatePermissionReq updatePermissionReq : updatePermissionList) {
|
||||
Map<String, List<UpdatePermissionReq>> permissionMap = updatePermissionList.stream().collect(Collectors.groupingBy(UpdatePermissionReq::getUuid));
|
||||
for (Map.Entry<String, List<UpdatePermissionReq>> permissionEntry : permissionMap.entrySet()) {
|
||||
BatchUpdatePermissionReq.FilePermissionItem item = new BatchUpdatePermissionReq.FilePermissionItem();
|
||||
item.setUuid(updatePermissionReq.getUuid());
|
||||
Map<Long, Byte> userPermissions = new HashMap<>();
|
||||
userPermissions.put(updatePermissionReq.getUserId(), FilePermissionEnum.ALL.getValue());
|
||||
String uuid = permissionEntry.getKey();
|
||||
item.setUuid(uuid);
|
||||
for (UpdatePermissionReq updatePermissionReq : permissionEntry.getValue()) {
|
||||
userPermissions.put(updatePermissionReq.getUserId(), updatePermissionReq.getPermission());
|
||||
}
|
||||
item.setUserPermissions(userPermissions);
|
||||
filePermissions.add(item);
|
||||
}
|
||||
|
||||
@@ -241,9 +241,9 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
continue;
|
||||
}
|
||||
// 项目经理
|
||||
BatchUpdatePermissionReq.FilePermissionItem managerItem = new BatchUpdatePermissionReq.FilePermissionItem();
|
||||
managerItem.setUuid(addNode.getUuid());
|
||||
for (String manager : memberList) {
|
||||
BatchUpdatePermissionReq.FilePermissionItem managerItem = new BatchUpdatePermissionReq.FilePermissionItem();
|
||||
managerItem.setUuid(addNode.getUuid());
|
||||
Map<Long, Byte> managerPermissions = new HashMap<>();
|
||||
// 2026-02-02 项目创建人对项目文件夹只有预览权限,项目经理(仿真专项代表)对项目文件夹有所有权限
|
||||
managerPermissions.put(Long.valueOf(manager), FilePermissionEnum.ALL.getValue());
|
||||
@@ -3492,16 +3492,14 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
// 批量更新需求权限
|
||||
if (CollectionUtils.isNotEmpty(permissionReqList)) {
|
||||
List<BatchUpdatePermissionReq.FilePermissionItem> filePermissions = new ArrayList<>();
|
||||
for (UpdatePermissionReq updatePermissionReq : permissionReqList) {
|
||||
Map<String, List<UpdatePermissionReq>> permissionMap = permissionReqList.stream().collect(Collectors.groupingBy(UpdatePermissionReq::getUuid));
|
||||
for (Map.Entry<String, List<UpdatePermissionReq>> permissionEntry : permissionMap.entrySet()) {
|
||||
BatchUpdatePermissionReq.FilePermissionItem item = new BatchUpdatePermissionReq.FilePermissionItem();
|
||||
item.setUuid(updatePermissionReq.getUuid());
|
||||
Map<Long, Byte> userPermissions = new HashMap<>();
|
||||
userPermissions.put(updatePermissionReq.getUserId(), updatePermissionReq.getPermission());
|
||||
// 项目经理对项目下的需求有预览、下载权限
|
||||
if (CollectionUtils.isNotEmpty(memberList)) {
|
||||
for (String manager : memberList) {
|
||||
userPermissions.put(Long.valueOf(manager), FilePermissionEnum.BASE.getValue());
|
||||
}
|
||||
String uuid = permissionEntry.getKey();
|
||||
item.setUuid(uuid);
|
||||
for (UpdatePermissionReq updatePermissionReq : permissionEntry.getValue()) {
|
||||
userPermissions.put(updatePermissionReq.getUserId(), updatePermissionReq.getPermission());
|
||||
}
|
||||
item.setUserPermissions(userPermissions);
|
||||
filePermissions.add(item);
|
||||
|
||||
@@ -371,7 +371,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
BatchUpdatePermissionReq batchReq = new BatchUpdatePermissionReq();
|
||||
batchReq.setFilePermissions(filePermissions);
|
||||
|
||||
log.info("仿真策划新增任务时,批量更新权限,任务数量:{}", filePermissions.size());
|
||||
log.info("仿真策划新增任务时,批量更新权限,任务数量:{},参数为:{}", filePermissions.size(),batchReq);
|
||||
SdmResponse response = dataClientFeignClient.batchUpdatePermission(batchReq);
|
||||
log.info("仿真策划新增任务时,批量更新权限结果:{}", response);
|
||||
|
||||
|
||||
@@ -283,59 +283,56 @@
|
||||
|
||||
<select id="getNodeListNoPermission" resultType="com.sdm.project.model.vo.SpdmNodeVo">
|
||||
select * from simulation_node sn
|
||||
<trim prefix="WHERE" suffixOverrides="and">
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
sn.nodeType = #{nodeType} and
|
||||
</if>
|
||||
<if test="nodeSubType != null and nodeSubType != ''">
|
||||
sn.nodeSubType = #{nodeSubType} and
|
||||
</if>
|
||||
<if test="exeStatus != null and exeStatus != ''">
|
||||
sn.exe_status = #{exeStatus} and
|
||||
</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">
|
||||
<bind name="searchKey1" value="'%' + nodeCode + '%'"/>
|
||||
sn.nodeCode like #{searchKey1} and
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
<bind name="searchKey2" value="'%' + manager + '%'"/>
|
||||
snm.name like #{searchKey2} and
|
||||
</if>
|
||||
<if test="nodeName != null and nodeName != ''">
|
||||
<bind name="searchKey3" value="'%' + nodeName + '%'"/>
|
||||
sn.nodeName like #{searchKey3} and
|
||||
</if>
|
||||
</trim>
|
||||
|
||||
where sn.tenantId = #{tenantId}
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
and sn.nodeType = #{nodeType}
|
||||
</if>
|
||||
<if test="nodeSubType != null and nodeSubType != ''">
|
||||
and sn.nodeSubType = #{nodeSubType}
|
||||
</if>
|
||||
<if test="exeStatus != null and exeStatus != ''">
|
||||
and sn.exe_status = #{exeStatus}
|
||||
</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">
|
||||
<bind name="searchKey1" value="'%' + nodeCode + '%'"/>
|
||||
and sn.nodeCode like #{searchKey1}
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
<bind name="searchKey2" value="'%' + manager + '%'"/>
|
||||
and snm.name like #{searchKey2}
|
||||
</if>
|
||||
<if test="nodeName != null and nodeName != ''">
|
||||
<bind name="searchKey3" value="'%' + nodeName + '%'"/>
|
||||
and sn.nodeName like #{searchKey3}
|
||||
</if>
|
||||
order by create_time desc
|
||||
limit #{pos},#{limit}
|
||||
</select>
|
||||
|
||||
<select id="getNodeListCountNoPermission" resultType="java.lang.Integer">
|
||||
select count(1) from simulation_node sn
|
||||
<trim prefix="WHERE" suffixOverrides ="and">
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
sn.nodeType = #{nodeType} and
|
||||
</if>
|
||||
<if test="nodeSubType != null and nodeSubType != ''">
|
||||
sn.nodeSubType = #{nodeSubType} and
|
||||
</if>
|
||||
<if test="exeStatus != null and exeStatus != ''">
|
||||
sn.exe_status = #{exeStatus} and
|
||||
</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">
|
||||
<bind name="searchKey1" value="'%' + nodeCode + '%'"/>
|
||||
sn.nodeCode like #{searchKey1} and
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
<bind name="searchKey2" value="'%' + manager + '%'"/>
|
||||
snm.name like #{searchKey2} and
|
||||
</if>
|
||||
<if test="nodeName != null and nodeName != ''">
|
||||
<bind name="searchKey3" value="'%' + nodeName + '%'"/>
|
||||
sn.nodeName like #{searchKey3} and
|
||||
</if>
|
||||
</trim>
|
||||
where sn.tenantId = #{tenantId}
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
and sn.nodeType = #{nodeType}
|
||||
</if>
|
||||
<if test="nodeSubType != null and nodeSubType != ''">
|
||||
and sn.nodeSubType = #{nodeSubType}
|
||||
</if>
|
||||
<if test="exeStatus != null and exeStatus != ''">
|
||||
and sn.exe_status = #{exeStatus}
|
||||
</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">
|
||||
<bind name="searchKey1" value="'%' + nodeCode + '%'"/>
|
||||
and sn.nodeCode like #{searchKey1}
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
<bind name="searchKey2" value="'%' + manager + '%'"/>
|
||||
and snm.name like #{searchKey2}
|
||||
</if>
|
||||
<if test="nodeName != null and nodeName != ''">
|
||||
<bind name="searchKey3" value="'%' + nodeName + '%'"/>
|
||||
and sn.nodeName like #{searchKey3}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getNodeExtraListByNodeIdList" resultType="com.sdm.project.model.vo.SpdmNodeExtraVo">
|
||||
|
||||
Reference in New Issue
Block a user