技术方案库修改
This commit is contained in:
parent
625ae85773
commit
7ce332a032
|
|
@ -252,6 +252,7 @@ public class PersonnelService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/22 17:15
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult delData(EnterprisePersonnelDto dto) {
|
||||
// 1.校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, EnterprisePersonnelDto.DELETE.class);
|
||||
|
|
@ -366,23 +367,4 @@ public class PersonnelService {
|
|||
resourceFilePo.setFileType(item.getCertificateType());
|
||||
return resourceFilePo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件访问路径赋值
|
||||
* @param fileVoList
|
||||
* @return List<ResourceFileVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:37
|
||||
*//*
|
||||
public List<ResourceFileVo> setFile(List<ResourceFileVo> fileVoList){
|
||||
if(CollectionUtils.isNotEmpty(fileVoList)){
|
||||
for (ResourceFileVo file : fileVoList) {
|
||||
SysFile sysFile = fileUploadService.getFile(file.getFilePath());
|
||||
if(Objects.nonNull(sysFile)){
|
||||
file.setLsFilePath(sysFile.getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileVoList;
|
||||
}*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -64,6 +65,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.ADD.class);
|
||||
|
|
@ -93,6 +95,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult editTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.UPDATE.class);
|
||||
|
|
@ -106,7 +109,7 @@ public class TechnicalService {
|
|||
return AjaxResult.error("技术方案库类别已存在");
|
||||
}
|
||||
// 2.添加技术方案库类别数据
|
||||
imdTechnicalService.operTypeData(dto, 1);
|
||||
imdTechnicalService.operTypeData(dto, 2);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
|
|
@ -122,6 +125,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult delTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.DELETE.class);
|
||||
|
|
@ -153,6 +157,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.ADD.class);
|
||||
|
|
@ -193,6 +198,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult editData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.UPDATE.class);
|
||||
|
|
@ -217,6 +223,7 @@ public class TechnicalService {
|
|||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult delData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.DELETE.class);
|
||||
|
|
@ -257,6 +264,7 @@ public class TechnicalService {
|
|||
*/
|
||||
public AjaxResult detailData(TechnicalDto.TechnicalDataDto dto) {
|
||||
TechnicalVo.Technical vo = new TechnicalVo.Technical();
|
||||
vo = imdTechnicalService.getDetailData(dto);
|
||||
// 1.查询关联资源文件
|
||||
List<ResourceFileVo> fileVoList = sourceFileService.getFilesByTable(dto.getTechnicalSolutionId(),TableConstants.TB_ENTERPRISE_TECHNICAL_SOLUTION);
|
||||
// 2.取minio中的文件访问路径
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.common.domain.mainDatabase.dto;
|
|||
import com.bonus.common.core.domain.model.LoginUser;
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ public class TechnicalDto {
|
|||
/**
|
||||
* 企业id
|
||||
*/
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {ADD.class,UPDATE.class, DELETE.class, QUERY.class})
|
||||
@NotNull(message = "企业id不能为空", groups = {ADD.class,UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
|
|
@ -111,7 +112,7 @@ public class TechnicalDto {
|
|||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {UPDATE.class, DELETE.class, QUERY.class})
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {ADD.class,UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
|
|
@ -189,6 +190,9 @@ public class TechnicalDto {
|
|||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 查询条件限制
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -73,4 +73,13 @@ public interface IMDTechnicalMapper {
|
|||
* @date 2025/10/30 11:01
|
||||
*/
|
||||
void operData(@Param("list") List<TechnicalDto.TechnicalDataDto> list,@Param("type") int type);
|
||||
|
||||
/**
|
||||
* 业知识库->技术方案库->技术方案库详情数据
|
||||
* @param dto
|
||||
* @return Technical
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 17:13
|
||||
*/
|
||||
TechnicalVo.Technical getDetailData(TechnicalDto.TechnicalDataDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,4 +69,13 @@ public interface IMDTechnicalService {
|
|||
* @date 2025/10/30 11:00
|
||||
*/
|
||||
void operData(List<TechnicalDto.TechnicalDataDto> dataDtos, int type);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->技术方案库详情数据
|
||||
* @param dto
|
||||
* @return Technical
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 17:12
|
||||
*/
|
||||
TechnicalVo.Technical getDetailData(TechnicalDto.TechnicalDataDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @className:MDTechnicalService
|
||||
|
|
@ -70,4 +71,13 @@ public class MDTechnicalService implements IMDTechnicalService {
|
|||
public void operData(List<TechnicalDto.TechnicalDataDto> dataDtos, int type) {
|
||||
imdTechnicalMapper.operData(dataDtos,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TechnicalVo.Technical getDetailData(TechnicalDto.TechnicalDataDto dto) {
|
||||
try {
|
||||
return Optional.ofNullable(imdTechnicalMapper.getDetailData(dto)).orElse(new TechnicalVo.Technical());
|
||||
} catch (Exception e) {
|
||||
return new TechnicalVo.Technical();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</insert>
|
||||
|
||||
<!--企业知识库->技术方案库->操作技术方案库数据-->
|
||||
<insert id="operData" useGeneratedKeys="true" keyColumn="technical_solution_id" keyProperty="technicalSolutionId">
|
||||
<insert id="operData" useGeneratedKeys="true" keyColumn="technical_solution_id" keyProperty="list.technicalSolutionId">
|
||||
<if test="type == 1">
|
||||
INSERT INTO tb_enterprise_technical_solution
|
||||
(
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
technical_solution_name AS technicalSolutionName,
|
||||
enterprise_id AS enterpriseId
|
||||
FROM tb_enterprise_technical_solution_type
|
||||
WHERE enterprise_id = #{enterpriseId}
|
||||
WHERE enterprise_id = #{enterpriseId} AND del_flag = '0'
|
||||
</select>
|
||||
<!--企业知识库->技术方案库->技术方案库类别是否重复-->
|
||||
<select id="isRepeat" resultType="java.lang.Integer">
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
sdd.dict_label AS voltageLevel,
|
||||
sdd2.dict_label AS structuralForm,
|
||||
sdd3.dict_label AS basicForm,
|
||||
GROUP_CONCAT(DISTINCT sdd4.dict_label ORDER BY sdd4.dict_value SEPARATOR ',') AS natureConstructionLabels
|
||||
GROUP_CONCAT(DISTINCT sdd4.dict_label ORDER BY sdd4.dict_value SEPARATOR ',') AS natureConstruction
|
||||
FROM tb_enterprise_technical_solution tets
|
||||
LEFT JOIN sys_dict_data sdd ON tets.voltage_level = sdd.dict_value AND sdd.dict_type = 'voltage_level'
|
||||
LEFT JOIN sys_dict_data sdd2 ON tets.structural_form = sdd2.dict_value AND sdd2.dict_type = 'structural_form'
|
||||
|
|
@ -152,4 +152,43 @@
|
|||
) A
|
||||
ORDER BY A.createTime DESC
|
||||
</select>
|
||||
<!--企业知识库->技术方案库->技术方案库详情数据-->
|
||||
<select id="getDetailData" resultType="com.bonus.common.domain.mainDatabase.vo.TechnicalVo$Technical">
|
||||
<if test="type == null and type ==''">
|
||||
SELECT technical_solution_id AS technicalSolutionId,
|
||||
technical_solution_type_id AS technicalSolutionTypeId,
|
||||
technical_name AS technicalName,
|
||||
voltage_level AS voltageLevel,
|
||||
nature_construction AS natureConstruction,
|
||||
structural_form AS structuralForm,
|
||||
basic_form AS basic_form
|
||||
FROM tb_enterprise_technical_solution
|
||||
WHERE technical_solution_id = #{technicalSolutionId}
|
||||
</if>
|
||||
<if test="type == 'detail'">
|
||||
SELECT
|
||||
tets.technical_solution_id AS technicalSolutionId,
|
||||
tets.technical_solution_type_id AS technicalSolutionTypeId,
|
||||
tets.technical_name AS technicalName,
|
||||
tets.create_time AS createTime,
|
||||
sdd.dict_label AS voltageLevel,
|
||||
sdd2.dict_label AS structuralForm,
|
||||
sdd3.dict_label AS basicForm,
|
||||
GROUP_CONCAT(DISTINCT sdd4.dict_label ORDER BY sdd4.dict_value SEPARATOR '、') AS natureConstruction
|
||||
FROM tb_enterprise_technical_solution tets
|
||||
LEFT JOIN sys_dict_data sdd ON tets.voltage_level = sdd.dict_value AND sdd.dict_type = 'voltage_level'
|
||||
LEFT JOIN sys_dict_data sdd2 ON tets.structural_form = sdd2.dict_value AND sdd2.dict_type = 'structural_form'
|
||||
LEFT JOIN sys_dict_data sdd3 ON tets.basic_form = sdd3.dict_value AND sdd3.dict_type = 'basic_form'
|
||||
LEFT JOIN sys_dict_data sdd4 ON FIND_IN_SET(sdd4.dict_value, tets.nature_construction) AND sdd4.dict_type = 'construction_nature'
|
||||
WHERE technical_solution_id = #{technicalSolutionId}
|
||||
GROUP BY
|
||||
tets.technical_solution_id,
|
||||
tets.technical_solution_type_id,
|
||||
tets.technical_name,
|
||||
tets.create_time,
|
||||
sdd.dict_label,
|
||||
sdd2.dict_label,
|
||||
sdd3.dict_label
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue