Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -63,7 +63,7 @@ public class FlowController implements ISimulationFlowFeignClient {
|
||||
@SysLog("删除流程模版草稿")
|
||||
@PostMapping("/deleteFlowTemplateDraft")
|
||||
public SdmResponse deleteFlowTemplateDraft(@RequestBody SimulationFlowTemplate flowTemplate) {
|
||||
return IFlowService.deleteFlowTemplateDraft(flowTemplate.uuid);
|
||||
return IFlowService.deleteFlowTemplateDraft(flowTemplate);
|
||||
}
|
||||
|
||||
@SysLog("发布流程模版草稿")
|
||||
|
||||
@@ -16,7 +16,10 @@ public interface FlowMapper {
|
||||
int updateFlowTemplate(@Param("template") SimulationFlowTemplate template);
|
||||
|
||||
@Delete("DELETE FROM simulation_flow_template WHERE uuid=#{uuid}")
|
||||
int deleteFlowTemplate(@Param("uuid") String uuid);
|
||||
int deleteFlowTemplateByUuid(@Param("uuid") String uuid);
|
||||
|
||||
@Delete("DELETE FROM simulation_flow_template WHERE templateCode=#{templateCode}")
|
||||
int deleteFlowTemplateByCode(@Param("templateCode") String templateCode);
|
||||
|
||||
@Update("UPDATE simulation_flow_template SET templateName=#{newName} WHERE templateName=#{oldName} AND tenantId=#{tenantId}")
|
||||
int updateFlowTemplateName(@Param("oldName") String oldName,@Param("newName") String newName,@Param("tenantId")long tenantId);
|
||||
|
||||
@@ -35,10 +35,9 @@ public interface IFlowService {
|
||||
|
||||
/**
|
||||
* 删除流程模版
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
SdmResponse deleteFlowTemplateDraft(String uuid);
|
||||
SdmResponse deleteFlowTemplateDraft(SimulationFlowTemplate flowTemplate);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
|
||||
import com.sdm.common.service.BaseService;
|
||||
import com.sdm.common.utils.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -199,12 +200,19 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse deleteFlowTemplateDraft(String uuid) {
|
||||
public SdmResponse deleteFlowTemplateDraft(SimulationFlowTemplate flowTemplate) {
|
||||
|
||||
SdmResponse response = SdmResponse.success();
|
||||
if(flowMapper.deleteFlowTemplate(uuid) <= 0)
|
||||
{
|
||||
response = SdmResponse.failed("删除流程模版草稿失败");
|
||||
if (StringUtils.isNotBlank(flowTemplate.getUuid())) {
|
||||
if(flowMapper.deleteFlowTemplateByUuid(flowTemplate.getUuid()) <= 0)
|
||||
{
|
||||
response = SdmResponse.failed("删除流程模版草稿失败");
|
||||
}
|
||||
} else {
|
||||
if(flowMapper.deleteFlowTemplateByCode(flowTemplate.getTemplateCode()) <= 0)
|
||||
{
|
||||
response = SdmResponse.failed("删除流程模版草稿失败");
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ public class SimulationReportTemplateServiceImpl extends ServiceImpl<SimulationR
|
||||
|
||||
upgradeTemplate.setTemplateVersion(generateVersion(reportTemplate.getTemplateVersion(),templateDto.getVersionType()));
|
||||
upgradeTemplate.setUuid(generateUuid("report_template_"));
|
||||
upgradeTemplate.setTemplateCode(reportTemplate.getTemplateCode());
|
||||
upgradeTemplate.setCreator(creator);
|
||||
upgradeTemplate.setTenantId(tenantId);
|
||||
|
||||
|
||||
@@ -172,6 +172,8 @@ public class TaskServiceImpl implements ITaskService {
|
||||
|
||||
private static final String CONVERT_CREATE_DIR_ERROR_MSG_DIR_EXIST = "任务已存在";
|
||||
|
||||
private static final float EPSILON = 1e-6f;
|
||||
|
||||
|
||||
/**
|
||||
* 预处理请求参数
|
||||
@@ -1079,6 +1081,13 @@ public class TaskServiceImpl implements ITaskService {
|
||||
System.out.println("===== 格式化打印所有任务耗时(推荐日志输出) =====");
|
||||
System.out.println(stopWatch.prettyPrint()); // Spring内置格式化,含耗时百分比,直接打印日志即可
|
||||
// 11. 最终返回
|
||||
// 20260311 如果任务中的难度系数为0,就设置为null
|
||||
for (SpdmNewTaskVo spdmNewTaskVo : newTaskList) {
|
||||
Float difficult = spdmNewTaskVo.getDifficult();
|
||||
if (difficult != null && Math.abs(difficult) < EPSILON) {
|
||||
spdmNewTaskVo.setDifficult(null);
|
||||
}
|
||||
}
|
||||
jsonObject.put("data", newTaskList);
|
||||
jsonObject.put("currentPage", req.getCurrent());
|
||||
jsonObject.put("pageSize", req.getSize());
|
||||
|
||||
Reference in New Issue
Block a user