Merge branch 'main' of http://carsafe.uicp.cn/toolchaintechnologycenter/spdm-backend
This commit is contained in:
@@ -4,6 +4,7 @@ package com.sdm.project.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.sdm.common.common.ResultCode;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.entity.ExportExcelFormat;
|
||||
@@ -206,6 +207,11 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
batchCreateNormalDirReq.setFolderItems(Collections.singletonList(folderItemReq));
|
||||
log.info("手动同步待办创建文件夹参数: {}", batchCreateNormalDirReq);
|
||||
SdmResponse dirCreateResp = dataFeignClient.batchCreateNormalDirs(batchCreateNormalDirReq);
|
||||
if (ObjectUtils.isEmpty(dirCreateResp) || dirCreateResp.getCode() != ResultCode.SUCCESS.getCode()) {
|
||||
log.error("手动创建{}项目下的{}需求时,创建文件夹失败,原因为:{}", req.getProjectId(),req.getDemandName(), dirCreateResp.getMessage());
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return SdmResponse.failed("您没有选择项目的相应权限,请更换其他项目进行创建");
|
||||
}
|
||||
log.info("手动同步待办创建文件夹响应: {}", dirCreateResp);
|
||||
|
||||
// 更新文件权限
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mybatis.spring.MyBatisSystemException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -1230,7 +1231,15 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
log.error("queryProjectInfo中syncProjectId为空");
|
||||
return SdmResponse.success();
|
||||
}
|
||||
LyricVProjectToDM projectNode = lyricVProjectToDmService.lambdaQuery().eq(LyricVProjectToDM::getId, syncProjectId).one();
|
||||
LyricVProjectToDM projectNode = null;
|
||||
try {
|
||||
// 根据projectId查询EP项目信息
|
||||
projectNode = lyricVProjectToDmService.lambdaQuery().eq(LyricVProjectToDM::getId, syncProjectId).one();
|
||||
} catch (MyBatisSystemException ex) {
|
||||
// 查询发生异常,记录异常日志(可能是测试环境预期异常)
|
||||
log.warn("查询项目信息时发生异常(可能是测试环境预期异常),项目id:{},异常信息:{}",
|
||||
syncProjectId, ex.getMessage());
|
||||
}
|
||||
log.info("根据syncProjectId:{},查询到的项目信息为:{}", syncProjectId, projectNode);
|
||||
return SdmResponse.success(projectNode);
|
||||
}
|
||||
@@ -1238,11 +1247,19 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
@Override
|
||||
public SdmResponse queryProjectInfoList(EpProjectQueryReq req) {
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
List<LyricVProjectToDM> projectList = lyricVProjectToDmService.lambdaQuery()
|
||||
.like(StringUtils.isNotBlank(req.getProjectNum()), LyricVProjectToDM::getProjectNum, req.getProjectNum())
|
||||
.like(StringUtils.isNotBlank(req.getProjectName()), LyricVProjectToDM::getProjectName, req.getProjectName())
|
||||
.like(StringUtils.isNotBlank(req.getDifficultyType()), LyricVProjectToDM::getDifficultyType, req.getDifficultyType())
|
||||
.list();
|
||||
List<LyricVProjectToDM> projectList = new ArrayList<>();
|
||||
try {
|
||||
// 拉取EP项目列表信息
|
||||
projectList = lyricVProjectToDmService.lambdaQuery()
|
||||
.like(StringUtils.isNotBlank(req.getProjectNum()), LyricVProjectToDM::getProjectNum, req.getProjectNum())
|
||||
.like(StringUtils.isNotBlank(req.getProjectName()), LyricVProjectToDM::getProjectName, req.getProjectName())
|
||||
.like(StringUtils.isNotBlank(req.getDifficultyType()), LyricVProjectToDM::getDifficultyType, req.getDifficultyType())
|
||||
.list();
|
||||
} catch (MyBatisSystemException ex) {
|
||||
// 查询发生异常,记录异常日志(可能是测试环境预期异常)
|
||||
log.warn("查询EP项目列表时发生异常(可能是测试环境预期异常),项目编号:{},项目名称:{},项目类型:{},异常信息:{}",
|
||||
req.getProjectNum(),req.getProjectName(),req.getDifficultyType(), ex.getMessage());
|
||||
}
|
||||
PageInfo<LyricVProjectToDM> page = new PageInfo<>(projectList);
|
||||
return PageUtils.getJsonObjectSdmResponse(projectList, page);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mybatis.spring.MyBatisSystemException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -1102,9 +1103,17 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
BeanUtils.copyProperties(projectNode, spdmNodeDetailVo);
|
||||
if (SYNC_PROJECT_SOURCE.equals(projectNode.getProjectSource())) {
|
||||
// EP类型项目直接从视图拉取当前阶段的信息
|
||||
LyricVProjectToDM lyricVProject = lyricVProjectToDmService.lambdaQuery()
|
||||
.eq(StringUtils.isNotBlank(projectNode.getNodeCode()), LyricVProjectToDM::getProjectNum, projectNode.getNodeCode())
|
||||
.one();
|
||||
LyricVProjectToDM lyricVProject = null;
|
||||
try {
|
||||
// EP类型项目直接从视图拉取当前阶段的信息
|
||||
lyricVProject = lyricVProjectToDmService.lambdaQuery()
|
||||
.eq(StringUtils.isNotBlank(projectNode.getNodeCode()), LyricVProjectToDM::getProjectNum, projectNode.getNodeCode())
|
||||
.one();
|
||||
} catch (MyBatisSystemException ex) {
|
||||
// 查询发生异常,记录异常日志(可能是测试环境预期异常)
|
||||
log.warn("查询EP项目信息并设置当前阶段时发生异常(可能是测试环境预期异常),项目编号:{},异常信息:{}",
|
||||
projectNode.getNodeCode(), ex.getMessage());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(lyricVProject)) {
|
||||
spdmNodeDetailVo.setCurrentPhase(lyricVProject.getStage());
|
||||
return SdmResponse.success(spdmNodeDetailVo);
|
||||
|
||||
@@ -1604,7 +1604,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
if (CollectionUtils.isNotEmpty(pMemberList)) {
|
||||
pMemberName = pMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
eMemberList = spdmNewTaskVo.getPMemberList();
|
||||
eMemberList = spdmNewTaskVo.getEMemberList();
|
||||
if (CollectionUtils.isNotEmpty(eMemberList)) {
|
||||
eMemberName = eMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
@@ -309,5 +309,35 @@ public class SimulationSystemConfigController implements ISysConfigFeignClient {
|
||||
return SdmResponse.failed("导入失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户自定义配置
|
||||
*/
|
||||
@GetMapping(value = "/getUserFormConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse getUserFormConfigure(@RequestParam("formName") String formName)
|
||||
{
|
||||
return service.getUserFormConfigure(formName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户自定义配置
|
||||
*/
|
||||
@PostMapping(value = "/addUserFormConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse addUserFormConfigure(@RequestBody FormConfigure configure)
|
||||
{
|
||||
return service.addUserFormConfigure(configure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户自定义配置
|
||||
*/
|
||||
@PostMapping(value = "/updateUserFormConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse updateUserFormConfigure(@RequestBody FormConfigure configure)
|
||||
{
|
||||
return service.updateUserFormConfigure(configure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.sdm.system.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sdm.system.model.entity.SysFormUserConfigure;
|
||||
|
||||
public interface FormUserConfigureMapper extends BaseMapper<SysFormUserConfigure> {
|
||||
|
||||
}
|
||||
@@ -21,4 +21,8 @@ public class FormConfigure{
|
||||
public String createTime;
|
||||
|
||||
public String userId;
|
||||
|
||||
// 图表是1 动态表格2
|
||||
public String type;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.sdm.system.model.entity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户自定义表单配置表实体类
|
||||
*
|
||||
* @TableName system_form_user_configure
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("system_form_user_configure")
|
||||
@ApiModel(value="SysFormUserConfigure对象", description="用户自定义表单配置表")
|
||||
public class SysFormUserConfigure implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联主配置的id")
|
||||
@TableField("form_configure_id")
|
||||
private Long formConfigureId;
|
||||
|
||||
@Schema(description = "表单名称")
|
||||
@TableField("formName")
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "表单配置信息(JSON格式)")
|
||||
@TableField("formConfig")
|
||||
private String formConfig;
|
||||
|
||||
@Schema(description = "表单描述信息")
|
||||
@TableField("comment")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
@TableField("tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "创建人ID")
|
||||
@TableField("creator")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@TableField("createTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.sdm.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sdm.system.model.entity.SysFormUserConfigure;
|
||||
|
||||
public interface IFormUserConfigureService extends IService<SysFormUserConfigure> {
|
||||
|
||||
}
|
||||
@@ -47,4 +47,10 @@ public interface ISimulationSystemConfigService {
|
||||
|
||||
SdmResponse listFormConfigure(FormConfigureReq req);
|
||||
|
||||
SdmResponse getUserFormConfigure(String formName);
|
||||
|
||||
SdmResponse addUserFormConfigure(FormConfigure configure);
|
||||
|
||||
SdmResponse updateUserFormConfigure(FormConfigure configure);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sdm.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sdm.system.dao.FormUserConfigureMapper;
|
||||
import com.sdm.system.model.entity.SysFormUserConfigure;
|
||||
import com.sdm.system.service.IFormUserConfigureService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class IFormUserConfigureServiceImpl extends ServiceImpl<FormUserConfigureMapper, SysFormUserConfigure> implements IFormUserConfigureService {
|
||||
|
||||
}
|
||||
@@ -19,9 +19,11 @@ import com.sdm.common.entity.bo.DataDictionary;
|
||||
import com.sdm.system.model.bo.DictionaryClass;
|
||||
import com.sdm.system.model.bo.FormConfigure;
|
||||
import com.sdm.system.model.entity.SysFormConfigure;
|
||||
import com.sdm.system.model.entity.SysFormUserConfigure;
|
||||
import com.sdm.system.model.req.system.FormConfigureReq;
|
||||
import com.sdm.system.model.resp.SimuDictionaryResp;
|
||||
import com.sdm.system.service.IFormConfigureService;
|
||||
import com.sdm.system.service.IFormUserConfigureService;
|
||||
import com.sdm.system.service.ISimulationSystemConfigService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@@ -44,6 +46,9 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
@Autowired
|
||||
private IFormConfigureService formConfigureService;
|
||||
|
||||
@Autowired
|
||||
private IFormUserConfigureService formUserConfigureService;
|
||||
|
||||
@Autowired
|
||||
private SysTenantFeignClientImpl sysTenantFeignClient;
|
||||
|
||||
@@ -427,6 +432,69 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
return PageUtils.getJsonObjectSdmResponse(list, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户自定义配置
|
||||
* @param formName
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse getUserFormConfigure(String formName)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
|
||||
LambdaQueryWrapper<SysFormUserConfigure> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysFormUserConfigure::getFormName, formName);
|
||||
queryWrapper.eq(SysFormUserConfigure::getTenantId, tenantId);
|
||||
SysFormUserConfigure formConfigure = formUserConfigureService.getOne(queryWrapper);
|
||||
if(formConfigure == null)
|
||||
{
|
||||
response = SdmResponse.failed("表单不存在");
|
||||
}
|
||||
response.setData(formConfigure);
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse addUserFormConfigure(FormConfigure configure) {
|
||||
SdmResponse response = SdmResponse.success();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
if (CollectionUtils.isNotEmpty(formUserConfigureService.lambdaQuery().eq(SysFormUserConfigure::getFormName, configure.formName).eq(SysFormUserConfigure::getTenantId, tenantId).list())) {
|
||||
response = SdmResponse.failed("该表单配置已存在");
|
||||
} else {
|
||||
SysFormUserConfigure sysFormUserConfigure = new SysFormUserConfigure();
|
||||
BeanUtils.copyProperties(configure, sysFormUserConfigure);
|
||||
sysFormUserConfigure.setTenantId(tenantId);
|
||||
sysFormUserConfigure.setCreator(userId);
|
||||
if (!formUserConfigureService.save(sysFormUserConfigure)) {
|
||||
response = SdmResponse.failed("添加表单配置失败");
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse updateUserFormConfigure(FormConfigure configure) {
|
||||
SdmResponse response = SdmResponse.success();
|
||||
if (CollectionUtils.isNotEmpty(formUserConfigureService.lambdaQuery().eq(SysFormUserConfigure::getFormName, configure.formName).list())) {
|
||||
LambdaUpdateWrapper<SysFormUserConfigure> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(SysFormUserConfigure::getFormName, configure.getFormName());
|
||||
updateWrapper.eq(SysFormUserConfigure::getTenantId, ThreadLocalContext.getTenantId());
|
||||
if (configure.getFormConfig() != null) {
|
||||
updateWrapper.set(SysFormUserConfigure::getFormConfig, configure.getFormConfig());
|
||||
}
|
||||
if (configure.getComment() != null) {
|
||||
updateWrapper.set(SysFormUserConfigure::getComment, configure.getComment());
|
||||
}
|
||||
formUserConfigureService.update(updateWrapper);
|
||||
} else {
|
||||
response = SdmResponse.failed("该表单配置不存在");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user