1、新增利元亨定制接口
2、修改节点时,补充实际完成时间字段
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -143,5 +143,7 @@ public class SimulationNode implements Serializable {
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
@TableField("approval_status")
|
||||
private String approvalStatus;
|
||||
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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("仿真节点审批状态更新失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user