feat:根据是否开模件查询待办列表提供给MES

This commit is contained in:
2026-01-21 11:48:42 +08:00
parent 922959749a
commit bfb7d0f2f9
11 changed files with 98 additions and 4 deletions

View File

@@ -415,7 +415,13 @@ public class DataFileController implements IDataFeignClient {
@GetMapping("/getMinioPresignedUrl")
@Operation(summary = "获取MinIO文件下载的预签名URL", description = "获取MinIO文件的预签名URL")
public SdmResponse<MinioDownloadUrlResp> getMinioPresignedUrl(@Parameter(description = "文件id") @RequestParam("fileId") Long fileId) {
return IDataFileService.getMinioDownloadUrl(fileId);
return IDataFileService.getDownloadUrlWithPermission(fileId);
}
@GetMapping("/getPublicDownloadUrl")
@Operation(summary = "获取MinIO文件下载的预签名URL无权限校验", description = "获取MinIO文件的预签名URL无权限校验")
public SdmResponse<MinioDownloadUrlResp> getPublicDownloadUrl(@Parameter(description = "文件id") @RequestParam("fileId") Long fileId) {
return IDataFileService.getPublicDownloadUrl(fileId);
}
@GetMapping("/queryFileMetadataInfo")

View File

@@ -247,7 +247,11 @@ public interface IDataFileService {
* @param fileId 文件id
* @return 带签名的下载URL响应
*/
default SdmResponse<MinioDownloadUrlResp> getMinioDownloadUrl(Long fileId){
default SdmResponse<MinioDownloadUrlResp> getDownloadUrlWithPermission(Long fileId){
return null;
}
default SdmResponse<MinioDownloadUrlResp> getPublicDownloadUrl(Long fileId){
return null;
}

View File

@@ -2289,7 +2289,16 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
@Override
@PermissionCheckAspect.FilePermissionCheck(value = FilePermissionEnum.DOWNLOAD, fileIdExpression = "#fileId")
public SdmResponse<MinioDownloadUrlResp> getMinioDownloadUrl(Long fileId) {
public SdmResponse<MinioDownloadUrlResp> getDownloadUrlWithPermission(Long fileId) {
return getMinioDownloadUrl(fileId);
}
@Override
public SdmResponse<MinioDownloadUrlResp> getPublicDownloadUrl(Long fileId) {
return getMinioDownloadUrl(fileId);
}
private SdmResponse<MinioDownloadUrlResp> getMinioDownloadUrl(Long fileId) {
FileMetadataInfo fileMetadataInfo = fileMetadataInfoService.getById(fileId);
if (fileMetadataInfo == null) {
return SdmResponse.failed("文件不存在");

View File

@@ -141,7 +141,7 @@ xxl:
job:
admin:
# 调度中心地址列表
addresses: http://192.168.30.146:7110/xxl-job-admin
addresses: http://192.168.30.148:7110/xxl-job-admin
# 调度中心访问令牌
accessToken: default_token
# xxl-job 超时时间默认3秒

View File

@@ -127,4 +127,15 @@ public class SimulationDemandController {
return demandService.queryDemandFiles(req);
}
/**
* 给 MES系统使用 查询是否开模件的待办列表
* @param req
* @return
*/
@GetMapping("/queryTodoList")
@Operation(summary = "条件查询待办(需求)列表", description = "条件查询待办(需求)列表")
public SdmResponse queryTodoList(@RequestBody DemandQryReq req) {
return demandService.queryTodoList(req);
}
}

View File

@@ -38,4 +38,6 @@ public interface SimulationDemandMapper extends BaseMapper<SimulationDemand> {
List<SpdmDemandVo> getAllList();
List<SpdmDemandVo> getDemandListWithCondition(@Param("req") DemandQryReq req);
}

View File

@@ -0,0 +1,15 @@
package com.sdm.project.model.req;
import lombok.Data;
@Data
public class DemandQryReq {
/**
* 是否开模件 Y/N
*/
private String isMoldMaking;
/**
* 物料号
*/
private String materialNo;
}

View File

@@ -129,4 +129,13 @@ public class SpdmDemandVo extends BaseEntity {
*/
private String demandSource;
/**
* 物料号
*/
private String materialNo;
/**
* 需求附件id列表
*/
private List<Long> demandFileIds;
}

View File

@@ -45,4 +45,5 @@ public interface IDemandService {
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFiles(QueryDirReq req);
SdmResponse queryTodoList(DemandQryReq req);
}

View File

@@ -1022,6 +1022,24 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
return queryDemandFileHandler.queryDemandFile(req);
}
@Override
public SdmResponse queryTodoList(DemandQryReq req) {
List<SpdmDemandVo> demandVoList = mapper.getDemandListWithCondition(req);
if (CollectionUtils.isNotEmpty(demandVoList)) {
for (SpdmDemandVo demandVo : demandVoList) {
QueryDirReq dirReq = new QueryDirReq();
dirReq.setCurrent(1);
dirReq.setSize(999);
dirReq.setUuid(demandVo.getUuid());
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> response = dataFeignClient.queryDir(dirReq);
if (response.isSuccess() && response.getData() != null && response.getData().getData() != null) {
demandVo.setDemandFileIds(response.getData().getData().stream().map(FileMetadataInfoResp::getId).toList());
}
}
}
return SdmResponse.success(demandVoList);
}
private String getLastNodeId(TaskNode taskNode) {
List<String> tagListProperty;
String lastNodeId = "";

View File

@@ -169,4 +169,23 @@
select * from simulation_demand where demandSource = 'EP'
</select>
<select id="getDemandListWithCondition" resultType="com.sdm.project.model.vo.SpdmDemandVo">
SELECT
sd.*,
mold_material.property_value AS materialNo
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="req.isMoldMaking != null and req.isMoldMaking == 'Y'">
and is_mold.property_value = 'Y'
</if>
<if test="req.isMoldMaking != null and req.isMoldMaking == 'N'">
and is_mold.property_value = 'N'
</if>
LEFT JOIN simulation_demand_extra mold_material
ON sd.uuid = mold_material.demand_id
AND mold_material.property_name = 'materialNo'
</select>
</mapper>