Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-12-15 09:50:16 +08:00
22 changed files with 947 additions and 35 deletions

View File

@@ -0,0 +1,32 @@
package com.sdm.project.controller;
import com.alibaba.excel.util.StringUtils;
import com.sdm.common.common.SdmResponse;
import com.sdm.project.common.ApprovalStatusEnum;
import com.sdm.project.model.entity.SimulationNode;
import com.sdm.project.service.ISimulationLyricNodeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
@RestController
@RequestMapping(value = "/node")
@Tag(name = "利元亨定制节点相关接口", description = "利元亨定制节点相关接口")
public class SimulationLyricNodeController {
@Autowired
private ISimulationLyricNodeService nodeService;
@GetMapping("/updateApprovalStatus")
@Operation(summary = "仿真节点审批状态更新", description = "仿真节点审批状态更新")
public SdmResponse updateApprovalStatus(@RequestParam(value = "projectName") @Validated String projectName, @RequestParam(value = "workspaceName") @Validated String workspaceName, @RequestParam(value = "approvalStatus") @Validated Integer approvalStatus) {
return nodeService.updateApprovalStatus(projectName,workspaceName,approvalStatus);
}
}

View File

@@ -0,0 +1,12 @@
package com.sdm.project.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sdm.project.model.entity.SimulationBaseQuantities;
import com.sdm.project.model.entity.SimulationNode;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SimulationLyricNodeMapper extends BaseMapper<SimulationNode> {
}

View File

@@ -143,5 +143,7 @@ public class SimulationNode implements Serializable {
@TableField("tag10")
private String tag10;
@TableField("approval_status")
private String approvalStatus;
}

View File

@@ -0,0 +1,10 @@
package com.sdm.project.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sdm.project.model.entity.SimulationDemand;
import org.springframework.stereotype.Service;
public interface ISimulationLyricDemandService extends IService<SimulationDemand> {
}

View File

@@ -0,0 +1,12 @@
package com.sdm.project.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sdm.common.common.SdmResponse;
import com.sdm.project.model.entity.SimulationNode;
import org.springframework.stereotype.Service;
public interface ISimulationLyricNodeService extends IService<SimulationNode> {
SdmResponse updateApprovalStatus(String projectName, String workspaceName, Integer approvalStatus);
}

View File

@@ -0,0 +1,44 @@
package com.sdm.project.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdm.common.common.SdmResponse;
import com.sdm.common.entity.enums.NodeTypeEnum;
import com.sdm.project.common.ApprovalStatusEnum;
import com.sdm.project.dao.SimulationLyricNodeMapper;
import com.sdm.project.model.entity.SimulationNode;
import com.sdm.project.service.ISimulationLyricNodeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class ISimulationLyricNodeServiceImpl extends ServiceImpl<SimulationLyricNodeMapper, SimulationNode> implements ISimulationLyricNodeService {
@Override
public SdmResponse updateApprovalStatus(String projectName, String workspaceName, Integer approvalStatus) {
// 0:未通过1已通过
String approvalStatusValue = String.valueOf(approvalStatus == 0 ? ApprovalStatusEnum.REJECTED.getCode() : ApprovalStatusEnum.PASSED.getCode());
List<SimulationNode> projectNodeList = this.lambdaQuery().eq(SimulationNode::getNodeName, projectName)
.eq(SimulationNode::getNodeType, NodeTypeEnum.PROJECT.getValue()).list();
if (CollectionUtils.isEmpty(projectNodeList)) {
log.error("根据项目名称:{},未查询到节点信息", projectName);
return SdmResponse.failed("根据项目名称:" + projectName + ",未查询到节点信息,请确认后重试");
}
if (projectNodeList.size() > 1) {
log.error("根据项目名称:{},查询到{}个项目信息", projectName, projectNodeList.size());
return SdmResponse.failed("根据项目名称:" + projectName + ",查询到" + projectNodeList.size() + "个项目信息,请确认处理后重试");
}
SimulationNode projectNode = projectNodeList.get(0);
log.info("查询到的节点为:{}", projectNode);
boolean updateFlag = this.lambdaUpdate().set(SimulationNode::getApprovalStatus, approvalStatusValue)
.eq(SimulationNode::getTag1, projectNode.getUuid())
.eq(SimulationNode::getNodeName, workspaceName)
.update();
return updateFlag ? SdmResponse.success("仿真节点审批状态成功") : SdmResponse.failed("仿真节点审批状态更新失败");
}
}

View File

@@ -52,6 +52,9 @@
<if test="editNode.endTime != null and editNode.endTime != ''">
endTime = #{editNode.endTime},
</if>
<if test="editNode.finishTime != null and editNode.finishTime != ''">
finishTime = #{editNode.finishTime},
</if>
<if test="editNode.description != null and editNode.description != ''">
description = #{editNode.description},
</if>

View File

@@ -70,34 +70,25 @@
)
</if>
<if test="req.beginTime != null and req.beginTime != ''">
<![CDATA[
and STR_TO_DATE(begin_time,'%Y-%m-%d') >= #{req.beginTime}
]]>
</if>
<if test="req.beginSTime != null and req.beginSTime != ''">
<![CDATA[
and STR_TO_DATE(begin_time,'%Y-%m-%d') >= #{req.beginSTime}
and STR_TO_DATE(begin_time,'%Y-%m-%d %H:%i:%s') >= #{req.beginSTime}
]]>
</if>
<if test="req.beginETime != null and req.beginETime != ''">
<![CDATA[
and STR_TO_DATE(begin_time,'%Y-%m-%d') <= #{req.beginETime}
]]>
</if>
<if test="req.endTime != null and req.endTime != ''">
<![CDATA[
and STR_TO_DATE(end_time,'%Y-%m-%d') <= #{req.endTime}
and STR_TO_DATE(begin_time,'%Y-%m-%d %H:%i:%s') <= #{req.beginETime}
]]>
</if>
<if test="req.endSTime != null and req.endSTime != ''">
<![CDATA[
and STR_TO_DATE(end_time,'%Y-%m-%d') <= #{req.endSTime}
and STR_TO_DATE(end_time,'%Y-%m-%d %H:%i:%s') >= #{req.endSTime}
]]>
</if>
<if test="req.endETime != null and req.endETime != ''">
<![CDATA[
and STR_TO_DATE(end_time,'%Y-%m-%d') <= #{req.endETime}
and STR_TO_DATE(end_time,'%Y-%m-%d %H:%i:%s') <= #{req.endETime}
]]>
</if>
<if test="req.todayTmrTasks != null and req.todayTmrTasks != ''">
@@ -106,19 +97,15 @@
and STR_TO_DATE(end_time,'%Y-%m-%d') <= DATE_ADD(CURRENT_DATE(), INTERVAL 2 DAY)
]]>
</if>
<if test="req.finishTime != null and req.finishTime != ''">
<![CDATA[
and STR_TO_DATE(finish_time,'%Y-%m-%d') <= #{req.finishTime}
]]>
</if>
<if test="req.finishSTime != null and req.finishSTime != ''">
<![CDATA[
and STR_TO_DATE(finish_time,'%Y-%m-%d') <= #{req.finishSTime}
and STR_TO_DATE(finish_time,'%Y-%m-%d %H:%i:%s') >= #{req.finishSTime}
]]>
</if>
<if test="req.finishETime != null and req.finishETime != ''">
<![CDATA[
and STR_TO_DATE(finish_time,'%Y-%m-%d') <= #{req.finishETime}
and STR_TO_DATE(finish_time,'%Y-%m-%d %H:%i:%s') <= #{req.finishETime}
]]>
</if>
<if test='req.sortOrder != null and req.sortOrder == "0"'>