This commit is contained in:
2026-01-21 14:10:49 +08:00
20 changed files with 252 additions and 40 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

@@ -39,7 +39,7 @@ public interface SimulationNodeMapper extends BaseMapper<SimulationNode> {
List<SpdmNodeVo> getNodeList(@Param("nodeType") String nodeType, @Param("nodeSubType") String nodeSubType, @Param("exeStatus") String exeStatus, @Param("nodeCode") String nodeCode,
@Param("manager") String manager, @Param("nodeName") String nodeName, @Param("tenantId") Long tenantId, @Param("pos") int pos, @Param("limit") int limit);
int getNodeListCount(@Param("nodeType") String nodeType, @Param("nodeSubType") String nodeSubType, @Param("progressStatus") Integer progressStatus, @Param("nodeCode") String nodeCode,
int getNodeListCount(@Param("nodeType") String nodeType, @Param("nodeSubType") String nodeSubType, @Param("exeStatus") String exeStatus, @Param("nodeCode") String nodeCode,
@Param("manager") String manager, @Param("nodeName") String nodeName, @Param("tenantId") Long tenantId);

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

@@ -1,24 +1,24 @@
package com.sdm.project.schedule.lyric;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class CommitmentDeadlineStatusSchedule {
@Autowired
private CommitmentDeadlineStatusScheduleExecutor commitmentDeadlineStatusScheduleExecutor;
// fixedDelayString 读取配置值为【毫秒】所以拼接000
@Scheduled(fixedDelayString = "${commitmentDeadlineStatusTask.schedule.interval:1800}000")
public void doCommitmentDeadlineStatusTask() {
try {
commitmentDeadlineStatusScheduleExecutor.run();
} catch (Exception e) {
log.error("【承诺截止状态更新任务】执行异常,原因:{}", e.getMessage(), e);
}
}
}
//package com.sdm.project.schedule.lyric;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//@Component
//@Slf4j
//public class CommitmentDeadlineStatusSchedule {
//
// @Autowired
// private CommitmentDeadlineStatusScheduleExecutor commitmentDeadlineStatusScheduleExecutor;
//
// // fixedDelayString 读取配置值为【毫秒】所以拼接000
// @Scheduled(fixedDelayString = "${commitmentDeadlineStatusTask.schedule.interval:1800}000")
// public void doCommitmentDeadlineStatusTask() {
// try {
// commitmentDeadlineStatusScheduleExecutor.run();
// } catch (Exception e) {
// log.error("【承诺截止状态更新任务】执行异常,原因:{}", e.getMessage(), e);
// }
// }
//}

View File

@@ -6,10 +6,12 @@ import com.sdm.project.model.entity.SimulationNode;
import com.sdm.project.model.entity.SimulationTask;
import com.sdm.project.service.INodeService;
import com.sdm.project.service.ISimulationTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -22,8 +24,8 @@ import java.util.stream.Collectors;
import static com.sdm.project.service.impl.NodeServiceImpl.SYNC_PROJECT_SOURCE;
@Slf4j
@Service
public class CommitmentDeadlineStatusScheduleExecutor implements Runnable {
@Component
public class CommitmentDeadlineStatusScheduleExecutor{
// 时间格式化器全局常量线程安全可复用yyyy-MM-dd HH:mm:ss 固定格式)
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -37,8 +39,8 @@ public class CommitmentDeadlineStatusScheduleExecutor implements Runnable {
@Resource
private ISimulationTaskService taskService;
@Override
public void run() {
@XxlJob("commitmentDeadlineStatusHandler")
public void commitmentDeadlineStatusHandler() {
log.info("定时任务执行");
try {
// 1. 获取所有节点(工位)

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

@@ -326,7 +326,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
jsonObject.put("total", 0);
return SdmResponse.success(jsonObject);
}
int total = nodeMapper.getNodeListCount(req.getNodeType(), req.getNodeSubType(), req.getProgressStatus(), req.getNodeCode(), req.getManager(), req.getNodeName(), ThreadLocalContext.getTenantId());
int total = nodeMapper.getNodeListCount(req.getNodeType(), req.getNodeSubType(), req.getExeStatus(), req.getNodeCode(), req.getManager(), req.getNodeName(), ThreadLocalContext.getTenantId());
log.info("总数为:{}", total);
Integer progressStatus;
Integer achieveStatus;

View File

@@ -149,4 +149,33 @@ project:
basic:
enabled: true
lyric:
enabled: false
enabled: false
# xxljob 配置开始
xxl:
job:
admin:
# 调度中心地址列表
addresses: http://192.168.190.161:7110/xxl-job-admin
# 调度中心访问令牌
accessToken: default_token
# xxl-job 超时时间默认3秒
timeout: 3
executor:
# 执行器是否启用默认true
enabled: true
# 执行器应用名称 服务名-job-executor
appname: project-job-executor
# 执行器注册地址默认使用address注册若为null则使用ip:port注册
address:
# 执行器IP
ip:
# 执行器端口,为了好记web服务端口+1000
port: 8101
# 执行器日志路径
logpath: /home/app/project/xxljob
# 执行器日志保留天数
logretentiondays: 14
# 执行器排除扫描的包,多个用逗号分隔,如 "org.package01" 或 "org.package01,org.package02"
excludedpackage:
# xxljob 配置结束

View File

@@ -149,4 +149,33 @@ project:
basic:
enabled: true
lyric:
enabled: false
enabled: false
# xxljob 配置开始
xxl:
job:
admin:
# 调度中心地址列表
addresses: http://192.168.65.161:7110/xxl-job-admin
# 调度中心访问令牌
accessToken: default_token
# xxl-job 超时时间默认3秒
timeout: 3
executor:
# 执行器是否启用默认true
enabled: true
# 执行器应用名称 服务名-job-executor
appname: project-job-executor
# 执行器注册地址默认使用address注册若为null则使用ip:port注册
address:
# 执行器IP
ip:
# 执行器端口,为了好记web服务端口+1000
port: 8101
# 执行器日志路径
logpath: /home/app/project/xxljob
# 执行器日志保留天数
logretentiondays: 14
# 执行器排除扫描的包,多个用逗号分隔,如 "org.package01" 或 "org.package01,org.package02"
excludedpackage:
# xxljob 配置结束

View File

@@ -153,4 +153,33 @@ project:
basic:
enabled: true
lyric:
enabled: false
enabled: false
# xxljob 配置开始
xxl:
job:
admin:
# 调度中心地址列表
addresses: http://127.0.0.1:7110/xxl-job-admin
# 调度中心访问令牌
accessToken: default_token
# xxl-job 超时时间默认3秒
timeout: 3
executor:
# 执行器是否启用默认true
enabled: true
# 执行器应用名称 服务名-job-executor
appname: project-job-executor
# 执行器注册地址默认使用address注册若为null则使用ip:port注册
address:
# 执行器IP
ip:
# 执行器端口,为了好记web服务端口+1000
port: 8101
# 执行器日志路径
logpath: D:\xxljob\logs
# 执行器日志保留天数
logretentiondays: 14
# 执行器排除扫描的包,多个用逗号分隔,如 "org.package01" 或 "org.package01,org.package02"
excludedpackage:
# xxljob 配置结束

View File

@@ -150,4 +150,33 @@ project:
basic:
enabled: false
lyric:
enabled: true
enabled: true
# xxljob 配置开始
xxl:
job:
admin:
# 调度中心地址列表
addresses: http://192.168.30.148:7110/xxl-job-admin
# 调度中心访问令牌
accessToken: default_token
# xxl-job 超时时间默认3秒
timeout: 3
executor:
# 执行器是否启用默认true
enabled: true
# 执行器应用名称 服务名-job-executor
appname: project-job-executor
# 执行器注册地址默认使用address注册若为null则使用ip:port注册
address:
# 执行器IP
ip:
# 执行器端口,为了好记web服务端口+1000
port: 8101
# 执行器日志路径
logpath: /home/app/project/xxljob
# 执行器日志保留天数
logretentiondays: 14
# 执行器排除扫描的包,多个用逗号分隔,如 "org.package01" 或 "org.package01,org.package02"
excludedpackage:
# xxljob 配置结束

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>

View File

@@ -231,8 +231,8 @@
<if test="nodeSubType != null and nodeSubType != ''">
and sn.nodeSubType = #{nodeSubType}
</if>
<if test="progressStatus != null">
and sn.progress = #{progressStatus}
<if test="exeStatus != null and exeStatus != ''">
and sn.exe_status = #{exeStatus}
</if>
<if test="nodeCode != null and nodeCode != ''">
and sn.nodeCode like CONCAT('%',#{nodeCode},'%')