Merge branch 'main' of http://192.168.65.198:3000/toolchaintechnologycenter/spdm-backend
This commit is contained in:
1
1-sql/2025-12-30/project/simulation_task.sql
Normal file
1
1-sql/2025-12-30/project/simulation_task.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE spdm_baseline.simulation_task ADD commitmentDeadline varchar(100) NULL COMMENT '军令状时间';
|
||||
@@ -30,6 +30,4 @@ public interface FlowMapper {
|
||||
@Select("SELECT templateVersion,approveType,uuid,templateCode FROM simulation_flow_template WHERE templateCode=#{templateCode} AND tenantId=#{tenantId}")
|
||||
List<SimulationFlowTemplateBrief> queryFlowTemplateVersionByCode(@Param("templateCode") String templateCode,@Param("tenantId")long tenantId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -502,6 +502,7 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
|
||||
if (sdmResponse.getData() != null) {
|
||||
flowTemplate.processDefinitionId = sdmResponse.getData().getProcessDefinitionId();
|
||||
}
|
||||
flowTemplate.templateStatus = 1;
|
||||
}
|
||||
flowTemplate.approveType = approveStatus;
|
||||
flowMapper.updateFlowTemplate(flowTemplate);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.common.service;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.feign.inter.system.ISysUserFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -18,7 +19,7 @@ import java.util.stream.Collectors;
|
||||
public class UserNameCacheService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserFeignClient sysUserFeignClient;
|
||||
private SysUserFeignClientImpl sysUserFeignClient;
|
||||
|
||||
/**
|
||||
* 批量获取用户名 - 带缓存 TODO 后续加入Redis的时候改成Redis
|
||||
|
||||
@@ -233,4 +233,8 @@ public class ProjectNode extends BaseEntity {
|
||||
private List<String> tag10;
|
||||
|
||||
private Long imageFileId;
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
}
|
||||
|
||||
@@ -265,5 +265,9 @@ public class TaskNode extends BaseEntity {
|
||||
|
||||
private String demandId;
|
||||
private Long imageFileId;
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
|
||||
}
|
||||
|
||||
@@ -198,5 +198,11 @@ public class SimulationTask implements Serializable {
|
||||
@TableField("cidFlowId")
|
||||
private String cidFlowId;
|
||||
|
||||
@TableField("imageFileId")
|
||||
private Long imageFileId;
|
||||
|
||||
@TableField("commitmentDeadline")
|
||||
private String commitmentDeadline;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -187,5 +187,8 @@ public class TaskNodePo extends NodeAllBase {
|
||||
private String tag10;
|
||||
|
||||
private Long imageFileId;
|
||||
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
}
|
||||
|
||||
@@ -1,100 +1,219 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.sdm.project.model.bo.TaskExtraNode;
|
||||
import com.sdm.project.model.bo.TaskMemberNode;
|
||||
import com.sdm.project.model.bo.TaskNode;
|
||||
import com.sdm.project.model.po.ProjectNodeExtraPo;
|
||||
import com.sdm.project.model.po.TaskNodeMemberPo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpdmEditTaskForDataReq {
|
||||
|
||||
/**
|
||||
* simulation_node关联的节点id
|
||||
* 父节点id,第一级节点的pid为0
|
||||
*/
|
||||
@NotBlank(message = "relatedResourceUuid不能为空")
|
||||
private String relatedResourceUuid;
|
||||
private String pid;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 当前节点id
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
private String taskName;
|
||||
private String ownRootNodeUuid;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
private String taskCode;
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
private String nodeCode;
|
||||
|
||||
private String taskPoolName;
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
private String taskPoolVersion;
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
private String nodeSubType;
|
||||
|
||||
/**
|
||||
* 父节点id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 项目进度状态(未开始、进行中、已完成)
|
||||
*/
|
||||
private String exeStatus;
|
||||
|
||||
private String exeStatusValue;
|
||||
|
||||
/**
|
||||
* 项目进度状态
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
private String progressStatusValue;
|
||||
|
||||
/**
|
||||
* 项目达成状态(红黄绿灯)
|
||||
*/
|
||||
private Integer achieveStatus;
|
||||
|
||||
private String achieveStatusValue;
|
||||
|
||||
/**
|
||||
* 计划开始(精确到秒)
|
||||
*/
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 计划结束(精确到秒)
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 标准工时
|
||||
*/
|
||||
private Integer days;
|
||||
|
||||
/**
|
||||
* 实际完成时间(精确到秒)
|
||||
*/
|
||||
private String finishTime;
|
||||
|
||||
/**
|
||||
* 实际工时
|
||||
*/
|
||||
private Integer realDays;
|
||||
|
||||
/**
|
||||
* 难度系数
|
||||
*/
|
||||
private Float difficult;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 确认状态
|
||||
*/
|
||||
private String confirmStatus;
|
||||
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String managers;
|
||||
|
||||
/**
|
||||
* 拓展属性集合
|
||||
*/
|
||||
private List<ProjectNodeExtraPo> extraList;
|
||||
|
||||
/**
|
||||
* 项目详情图片
|
||||
*/
|
||||
private String detailImgUrl;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 达标方式
|
||||
*/
|
||||
private String method;
|
||||
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 目标值
|
||||
*/
|
||||
private String targetValue;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
private List<TaskNode> children = new ArrayList<>(); //适配前端组件
|
||||
|
||||
private String nodeVersion;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private List<TaskExtraNode> taskExtraNodeList;
|
||||
|
||||
private List<TaskMemberNode> memberList;
|
||||
|
||||
private List<TaskExtraNode> extras;
|
||||
|
||||
private List<TaskNodeMemberPo> members;
|
||||
|
||||
private String levelType;
|
||||
|
||||
private String nodeLevel;
|
||||
|
||||
/**
|
||||
* 仿真负责人
|
||||
*/
|
||||
@JsonProperty(value = "pMemberList")
|
||||
private String pMemberList;
|
||||
|
||||
/**
|
||||
* 仿真执行人
|
||||
*/
|
||||
@JsonProperty(value = "eMemberList")
|
||||
private String eMemberList;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
private String standard;
|
||||
|
||||
private String foldId;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String achieveStatus;
|
||||
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private String finishTime;
|
||||
|
||||
private Integer progress;
|
||||
|
||||
private String exeStatus;
|
||||
|
||||
private String confidence;
|
||||
|
||||
private String englishName;
|
||||
private String analyseTarget;
|
||||
|
||||
private String confidence;
|
||||
private String analyseSoftware;
|
||||
|
||||
private String approvalStatus;
|
||||
|
||||
private String comfirmStatus;
|
||||
|
||||
private String description;
|
||||
|
||||
private Float difficult;
|
||||
|
||||
private String tenantId;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private Long updater;
|
||||
|
||||
|
||||
private String updateTime;
|
||||
|
||||
|
||||
private String department;
|
||||
|
||||
|
||||
@JsonProperty(value = "section")
|
||||
private String sectionName;
|
||||
|
||||
|
||||
@JsonProperty(value = "group")
|
||||
private String groupName;
|
||||
|
||||
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
|
||||
|
||||
private String flowTemplate;
|
||||
|
||||
private String englishName;
|
||||
|
||||
private String demandId;
|
||||
/*
|
||||
* 3D图示
|
||||
*/
|
||||
private Long imageFileId;
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
}
|
||||
|
||||
@@ -277,5 +277,9 @@ public class TaskEditNodeReq extends BaseEntity {
|
||||
private String attentionList;
|
||||
|
||||
private Long imageFileId;
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,15 @@ public class SpdmTaskVo extends BaseEntity {
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 当前节点名称(=任务名称)
|
||||
*/
|
||||
private String nodeName;
|
||||
/**
|
||||
* 当前节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
@@ -98,7 +107,9 @@ public class SpdmTaskVo extends BaseEntity {
|
||||
private Float difficult;
|
||||
|
||||
private String department;
|
||||
@JsonProperty(value = "section")
|
||||
private String sectionName;
|
||||
@JsonProperty(value = "group")
|
||||
private String groupName;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
@@ -150,5 +161,13 @@ public class SpdmTaskVo extends BaseEntity {
|
||||
* 关联的需求名称
|
||||
*/
|
||||
private String demandName;
|
||||
/**
|
||||
* 3D图片文件id
|
||||
*/
|
||||
private Long imageFileId;
|
||||
/**
|
||||
* 军令状时间
|
||||
*/
|
||||
private String commitmentDeadline;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sdm.project.model.req.SpdmEditTaskForDataReq;
|
||||
import com.sdm.project.model.req.SpdmTaskOprReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.sdm.outbridge.entity.LyricVMainPlanDM;
|
||||
import com.sdm.outbridge.entity.LyricVTodoEmulationInfoDM;
|
||||
import com.sdm.outbridge.service.lyric.LyricVMainPlanDMService;
|
||||
import com.sdm.outbridge.service.lyric.LyricVTodoInfoService;
|
||||
import com.sdm.project.common.MemberTypeEnum;
|
||||
import com.sdm.project.dao.SimulationDemandMapper;
|
||||
import com.sdm.project.dao.SimulationNodeMapper;
|
||||
import com.sdm.project.dao.SimulationProjectMapper;
|
||||
@@ -1588,6 +1589,20 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
return null;
|
||||
}
|
||||
SdmResponse createDirResult;
|
||||
for (TaskNode taskNode : addTaskList) {
|
||||
// 设置仿真执行人
|
||||
if (StringUtils.isNotBlank(taskNode.getEMemberList())) {
|
||||
String[] userIdArr = taskNode.getEMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.saveTaskMemberList(taskNode.getUuid(), MemberTypeEnum.EXECUTOR.getCode(), longUserIdList);
|
||||
}
|
||||
// 设置仿真负责人
|
||||
if (StringUtils.isNotBlank(taskNode.getPMemberList())) {
|
||||
String[] userIdArr = taskNode.getPMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.saveTaskMemberList(taskNode.getUuid(), MemberTypeEnum.PRINCIPAL.getCode(), longUserIdList);
|
||||
}
|
||||
}
|
||||
for (TaskNode taskNode : addTaskList) {
|
||||
createDirResult = createDir(taskNode.getUuid(), taskNode.getNodeType(), taskNode.getPid(), taskNode.getNodeName());
|
||||
if (createDirResult.getCode() != ResultCode.SUCCESS.getCode()) {
|
||||
|
||||
@@ -5,18 +5,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.utils.RandomUtil;
|
||||
import com.sdm.project.common.MemberTypeEnum;
|
||||
import com.sdm.project.model.bo.TaskExtraNode;
|
||||
import com.sdm.project.model.bo.TaskNode;
|
||||
import com.sdm.project.model.entity.SimulationNode;
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import com.sdm.project.dao.SimulationTaskMapper;
|
||||
import com.sdm.project.model.entity.SimulationTaskMember;
|
||||
import com.sdm.project.model.req.SpdmEditNodeForDataReq;
|
||||
import com.sdm.project.model.req.SpdmEditTaskForDataReq;
|
||||
import com.sdm.project.model.req.SpdmTaskOprReq;
|
||||
import com.sdm.project.service.ISimulationTaskMemberService;
|
||||
import com.sdm.project.service.ISimulationTaskService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -29,6 +41,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper, SimulationTask> implements ISimulationTaskService {
|
||||
|
||||
@Autowired
|
||||
private ISimulationTaskMemberService simulationTaskMemberService;
|
||||
|
||||
@Override
|
||||
public boolean updateSimulationTask(SpdmTaskOprReq req) {
|
||||
LambdaUpdateWrapper<SimulationTask> wrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -66,8 +81,22 @@ public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper,
|
||||
public SdmResponse editTaskForData(SpdmEditTaskForDataReq req) {
|
||||
SimulationTask simulationTask = new SimulationTask();
|
||||
BeanUtils.copyProperties(req,simulationTask);
|
||||
LambdaUpdateWrapper<SimulationTask> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
this.update(updateWrapper.setEntity(simulationTask));
|
||||
this.updateById(simulationTask);
|
||||
|
||||
// 设置仿真执行人
|
||||
if (StringUtils.isNotBlank(req.getEMemberList())) {
|
||||
String[] userIdArr = req.getEMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.deleteTaskMemberList(req.getUuid(), MemberTypeEnum.EXECUTOR.getCode());
|
||||
simulationTaskMemberService.saveTaskMemberList(req.getUuid(), MemberTypeEnum.EXECUTOR.getCode(), longUserIdList);
|
||||
}
|
||||
// 设置仿真负责人
|
||||
if (StringUtils.isNotBlank(req.getPMemberList())) {
|
||||
String[] userIdArr = req.getPMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.deleteTaskMemberList(req.getUuid(), MemberTypeEnum.PRINCIPAL.getCode());
|
||||
simulationTaskMemberService.saveTaskMemberList(req.getUuid(), MemberTypeEnum.PRINCIPAL.getCode(), longUserIdList);
|
||||
}
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -1368,9 +1368,8 @@ public class TaskServiceImpl implements ITaskService {
|
||||
log.error("根据id:{},未查询到任务", req.getRelatedResourceUuid());
|
||||
return SdmResponse.failed("未查询到任务");
|
||||
}
|
||||
SpdmTaskDetailVo spdmTaskDetailVo = new SpdmTaskDetailVo();
|
||||
BeanUtils.copyProperties(taskVo, spdmTaskDetailVo);
|
||||
spdmTaskDetailVo.setId(taskVo.getId());
|
||||
taskVo.setNodeName(taskVo.getTaskName());
|
||||
taskVo.setNodeType("task");
|
||||
List<SpdmTaskMemberVo> memberList = mapper.getMemberList(Collections.singletonList(taskVo.getUuid()), null);
|
||||
if (CollectionUtils.isNotEmpty(memberList)) {
|
||||
List<Long> userIdList = memberList.stream().map(SpdmTaskMemberVo::getUserId).toList();
|
||||
@@ -1391,7 +1390,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(spdmPUserVoList)) {
|
||||
spdmTaskDetailVo.setPMemberList(spdmPUserVoList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(",")));
|
||||
taskVo.setPMemberList(spdmPUserVoList);
|
||||
}
|
||||
}
|
||||
List<SpdmTaskMemberVo> eMemberList = memberList.stream().filter(member -> MemberTypeEnum.EXECUTOR.getCode().equals(member.getType())).toList();
|
||||
@@ -1403,11 +1402,11 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(spdmEUserVoList)) {
|
||||
spdmTaskDetailVo.setEMemberList(spdmEUserVoList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(",")));
|
||||
taskVo.setEMemberList(spdmEUserVoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return SdmResponse.success(spdmTaskDetailVo);
|
||||
return SdmResponse.success(taskVo);
|
||||
}
|
||||
|
||||
private SdmResponse createDir(String uuid, String uuidOwnType, String parentUuid, String dirName) {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
,creator,create_time,department,sectionName,groupName,bCapacity,flowTemplate,englishName,demand_id,tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10,imageFileId) values
|
||||
<foreach collection='list' item='it' index='index' separator=','>
|
||||
(#{it.uuid},#{it.taskName},#{it.taskCode},'','',#{it.nodeId},#{it.days},#{it.standard},'',1,0,
|
||||
#{it.beginTime},#{it.endTime},0,1,#{it.confidence},#{it.analyseTarget},#{it.analyseSoftwares},'0',#{it.description},#{it.difficult},#{it.tenantId},
|
||||
#{it.beginTime},#{it.endTime},0,1,#{it.confidence},#{it.analyseTarget},#{it.analyseSoftware},'0',#{it.description},#{it.difficult},#{it.tenantId},
|
||||
#{it.creator},#{it.createTime},#{it.department},#{it.section},#{it.group},#{it.bCapacity},#{it.flowTemplate},#{it.englishName},#{it.demandId},#{it.tag1,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag2,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.tag3,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag4,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.tag5,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag6,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
|
||||
@@ -84,5 +84,28 @@ public class SimulationAppCenterController {
|
||||
return service.querySimulationAppConfig(appId);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addApplicationCallRecord")
|
||||
@ResponseBody
|
||||
SdmResponse addSimulationAppCallRecord(@RequestBody AppCenterItemBean appBean)
|
||||
{
|
||||
return service.addSimulationAppCallRecord(appBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/queryAllApplicationCallRecord")
|
||||
@ResponseBody
|
||||
SdmResponse queryAllSimulationAppCallRecord()
|
||||
{
|
||||
return service.queryAllSimulationAppCallRecord();
|
||||
}
|
||||
|
||||
@GetMapping(value = "/queryApplicationCallRecord")
|
||||
@ResponseBody
|
||||
SdmResponse querySimulationAppCallRecord(@RequestParam("appName")String appName,@RequestParam("appType")int appType)
|
||||
{
|
||||
return service.querySimulationAppCallRecord(appName,appType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.sdm.system.dao;
|
||||
|
||||
import com.sdm.system.model.entity.AppCenterItemBean;
|
||||
import com.sdm.system.model.entity.AppConfigureBean;
|
||||
import com.sdm.system.model.entity.AppItemStatisticInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -42,4 +43,13 @@ public interface SimulationAppManageMapper {
|
||||
@Select("SELECT * FROM simulation_app_configure WHERE ${condition}")
|
||||
List<AppConfigureBean> querySimulationAppConfigByCondition(@Param("condition") String condition);
|
||||
|
||||
@Insert("INSERT INTO simulation_app_call_record(appName,appType,creator) VALUES (#{appName},#{appType},#{creator})")
|
||||
int addSimulationAppCallRecord(@Param("appName")String appName,@Param("appType")int appType,@Param("creator")long creator);
|
||||
|
||||
@Select("SELECT appName,appType,COUNT(*)callTimes FROM simulation_app_call_record GROUP BY appName,appType")
|
||||
List<AppItemStatisticInfo> queryAllSimulationAppCallRecord();
|
||||
|
||||
@Select("SELECT COUNT(*) FROM simulation_app_call_record WHERE appName=#{appName} AND appType=#{appType}")
|
||||
int querySimulationAppCallRecordCount(@Param("appName")String appName,@Param("appType")int appType);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.sdm.system.model.entity;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
public class AppItemStatisticInfo {
|
||||
|
||||
@Schema(description = "应用名称")
|
||||
public String appName;
|
||||
|
||||
@Schema(description = "应用类型")
|
||||
public int appType;
|
||||
|
||||
@Schema(description = "调用次数")
|
||||
public int callTimes;
|
||||
}
|
||||
@@ -87,5 +87,26 @@ public interface ISimulatinoAppCenterService {
|
||||
*/
|
||||
SdmResponse querySimulationAppConfig(String appId);
|
||||
|
||||
/**
|
||||
* 添加应用调用记录
|
||||
* @param appBean
|
||||
* @return
|
||||
*/
|
||||
SdmResponse addSimulationAppCallRecord(AppCenterItemBean appBean);
|
||||
|
||||
/**
|
||||
* 查询系统中所有仿真工具调用记录
|
||||
* @return
|
||||
*/
|
||||
SdmResponse queryAllSimulationAppCallRecord();
|
||||
|
||||
|
||||
/**
|
||||
* 查询系统中具体仿真工具的调用记录
|
||||
* @param appName
|
||||
* @param appType
|
||||
* @return
|
||||
*/
|
||||
SdmResponse querySimulationAppCallRecord(String appName,int appType);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.sdm.common.service.BaseService;
|
||||
import com.sdm.system.dao.SimulationAppManageMapper;
|
||||
import com.sdm.system.model.entity.AppCenterItemBean;
|
||||
import com.sdm.system.model.entity.AppConfigureBean;
|
||||
import com.sdm.system.model.entity.AppItemStatisticInfo;
|
||||
import com.sdm.system.service.ISimulatinoAppCenterService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -294,4 +295,44 @@ public class SimulationAppCenterServiceImpl extends BaseService implements ISimu
|
||||
response.setData(configureBeans);
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse addSimulationAppCallRecord(AppCenterItemBean appBean)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
if(appManageMapper.addSimulationAppCallRecord(appBean.appName,appBean.appType,appBean.creator) <= 0)
|
||||
{
|
||||
response = SdmResponse.failed("添加app调用记录失败");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统中所有仿真工具调用记录
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SdmResponse queryAllSimulationAppCallRecord()
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
List<AppItemStatisticInfo> statisticInfos = appManageMapper.queryAllSimulationAppCallRecord();
|
||||
response.setData(statisticInfos);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询系统中具体仿真工具的调用记录
|
||||
* @param appName
|
||||
* @param appType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SdmResponse querySimulationAppCallRecord(String appName,int appType)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
int count = appManageMapper.querySimulationAppCallRecordCount(appName,appType);
|
||||
response.setData(count);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,6 +324,7 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
if (CollectionUtils.isNotEmpty(formConfigureService.lambdaQuery().eq(SysFormConfigure::getFormName, configure.formName).list())) {
|
||||
LambdaUpdateWrapper<SysFormConfigure> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(SysFormConfigure::getFormName, configure.getFormName());
|
||||
updateWrapper.eq(SysFormConfigure::getTenantId, ThreadLocalContext.getTenantId());
|
||||
if (configure.getFormConfig() != null) {
|
||||
updateWrapper.set(SysFormConfigure::getFormConfig, configure.getFormConfig());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user