fix:MES查询待办列表

This commit is contained in:
2026-03-25 15:35:22 +08:00
parent 5645fe59a1
commit 93f2b0d34b
8 changed files with 90 additions and 17 deletions

View File

@@ -130,10 +130,10 @@ public class SimulationDemandController {
* 给 MES系统使用 查询是否开模件的待办列表
* @return
*/
@GetMapping("/queryTodoList")
@PostMapping("/queryTodoList")
@Operation(summary = "条件查询待办(需求)列表", description = "条件查询待办(需求)列表")
public SdmResponse queryTodoList(@RequestParam String isMoldMaking) {
return demandService.queryTodoList(isMoldMaking);
public SdmResponse queryTodoList(@RequestBody DemandQryReq qryReq) {
return demandService.queryTodoList(qryReq);
}
/**

View File

@@ -45,7 +45,7 @@ public interface SimulationDemandMapper extends BaseMapper<SimulationDemand> {
Set<String> getAllCodeList();
List<SpdmDemandVo> getDemandListWithCondition(@Param("isMoldMaking") String isMoldMaking);
List<SpdmDemandVo> getDemandListWithCondition(@Param("req") DemandQryReq req);
List<SpdmDemandVo> getDemandListByProjectId(@Param("nodeId") String nodeId);

View File

@@ -8,5 +8,17 @@ public class DemandQryReq {
* 是否开模件 Y/N
*/
private String isMoldMaking;
/**
* 物料号
*/
private String materialNo;
/**
* 项目号对应simulation_node的nodeCode
*/
private String projectCode;
/**
* 工作空间编码对应simulation_node的nodeCode
*/
private String workspaceCode;
}

View File

@@ -184,6 +184,11 @@ public class SpdmDemandVo extends BaseEntity {
* 是否开模件
*/
private String isMoldMaking;
/**
* 确认人id
*/
private String pUserId;
/**
* 需求附件id列表
*/

View File

@@ -45,7 +45,7 @@ public interface IDemandService {
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFiles(QueryDirReq req);
SdmResponse queryTodoList(String isMoldMaking);
SdmResponse queryTodoList(DemandQryReq qryReq);
SdmResponse addDemandNoPermission(SpdmAddDemandReq req);

View File

@@ -1538,11 +1538,40 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
}
@Override
public SdmResponse queryTodoList(String isMoldMaking) {
List<SpdmDemandVo> demandVoList = mapper.getDemandListWithCondition(isMoldMaking);
public SdmResponse queryTodoList(DemandQryReq qryReq) {
List<SpdmDemandVo> demandVoList = mapper.getDemandListWithCondition(qryReq);
if (CollectionUtils.isNotEmpty(demandVoList)) {
// 收集所有pUserId
List<Long> pUserIds = demandVoList.stream()
.map(SpdmDemandVo::getPUserId)
.filter(StringUtils::isNotBlank)
.map(Long::valueOf)
.distinct()
.collect(Collectors.toList());
// 批量查询用户信息
Map<Long, List<CIDUserResp>> userMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(pUserIds)) {
SdmResponse<List<CIDUserResp>> cidUserResp = sysUserFeignClient.listUserByIds(
UserQueryReq.builder().userIds(pUserIds).build()
);
if (cidUserResp.isSuccess() && CollectionUtils.isNotEmpty(cidUserResp.getData())) {
userMap = cidUserResp.getData().stream().collect(Collectors.groupingBy(CIDUserResp::getUserId));
}
}
// 遍历设置pMemberList和文件信息
for (SpdmDemandVo demandVo : demandVoList) {
QueryDirReq dirReq = new QueryDirReq();
// 设置pMemberList
if (StringUtils.isNotBlank(demandVo.getPUserId())) {
Long userId = Long.valueOf(demandVo.getPUserId());
if (CollectionUtils.isNotEmpty(userMap.get(userId))) {
demandVo.setPMemberList(userMap.get(userId));
}
}
// 设置文件信息
QueryDirReq dirReq = new QueryDirReq();
dirReq.setCurrent(1);
dirReq.setSize(999);
dirReq.setUuid(demandVo.getUuid());

View File

@@ -2926,6 +2926,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
Long parentDirId = getParentDirId(simulationRun.getTaskId(), dirName);
copyFileToTaskReq.setParentDirId(parentDirId);
SdmResponse<Long> response = dataFeignClient.copyFileToTask(copyFileToTaskReq);
log.info("[syncKeyResultToTask] copyFileToTask req:{},resp:{}", JSON.toJSONString(copyFileToTaskReq), JSON.toJSONString(response));
if (!response.isSuccess()) {
return SdmResponse.failed("归档关键结果文件失败");
}

View File

@@ -188,17 +188,43 @@
SELECT
sd.*,
mold_material.property_value AS materialNo,
is_mold.property_value AS isMoldMaking
is_mold.property_value AS isMoldMaking,
sdm.user_id AS pUserId,
project_node.nodeCode AS projectCode,
workspace_node.nodeCode AS workspaceCode
FROM simulation_demand sd
INNER JOIN simulation_demand_extra is_mold
ON sd.uuid = is_mold.demand_id
AND is_mold.property_name = 'isMoldMaking'
<if test="isMoldMaking != null">
AND is_mold.property_value = #{isMoldMaking}
INNER JOIN simulation_demand_extra is_mold ON sd.uuid = is_mold.demand_id AND is_mold.property_name = 'isMoldMaking'
<if test="req.isMoldMaking != null">
AND is_mold.property_value = #{req.isMoldMaking}
</if>
LEFT JOIN simulation_demand_extra mold_material
ON sd.uuid = mold_material.demand_id
AND mold_material.property_name = 'materialNo'
<choose>
<when test="req.materialNo != null and req.materialNo != ''">
INNER JOIN simulation_demand_extra mold_material ON sd.uuid = mold_material.demand_id AND mold_material.property_name = 'materialNo'
AND mold_material.property_value = #{req.materialNo}
</when>
<otherwise>
LEFT JOIN simulation_demand_extra mold_material ON sd.uuid = mold_material.demand_id AND mold_material.property_name = 'materialNo'
</otherwise>
</choose>
LEFT JOIN simulation_demand_member sdm ON sd.uuid = sdm.demand_id AND sdm.type = 0
<choose>
<when test="req.projectCode != null and req.projectCode != ''">
INNER JOIN simulation_node project_node ON sd.project_id = project_node.uuid
AND project_node.nodeCode = #{req.projectCode}
</when>
<otherwise>
LEFT JOIN simulation_node project_node ON sd.project_id = project_node.uuid
</otherwise>
</choose>
<choose>
<when test="req.workspaceCode != null and req.workspaceCode != ''">
INNER JOIN simulation_node workspace_node ON sd.workspace_id = workspace_node.uuid
AND workspace_node.nodeCode = #{req.workspaceCode}
</when>
<otherwise>
LEFT JOIN simulation_node workspace_node ON sd.workspace_id = workspace_node.uuid
</otherwise>
</choose>
</select>
<select id="getDemandListNoPermission" resultType="com.sdm.project.model.vo.SpdmDemandVo">