技术方案库
This commit is contained in:
parent
42c32bdf16
commit
9fe8cc3ff4
|
|
@ -0,0 +1,108 @@
|
|||
package com.bonus.web.controller.enterprise;
|
||||
|
||||
import com.bonus.common.annotation.RequiresPermissions;
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterpriseVo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.TechnicalVo;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.web.service.enterprise.TechnicalService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:TechnicalController
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:41
|
||||
* @version:1.0
|
||||
* @description:技术方案库-web层
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mainDatabase/technical")
|
||||
public class TechnicalController extends BaseController {
|
||||
|
||||
@Resource(name = "TechnicalService")
|
||||
private TechnicalService technicalService;
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "查询类型列表")
|
||||
@GetMapping("getTypeList")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->查询类型列表", businessType = OperaType.QUERY, details = "查询类型列表", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:list")
|
||||
public AjaxResult getTypeList(TechnicalDto.TypeDto dto) {
|
||||
return technicalService.getTypeList(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "新增技术方案类别库")
|
||||
@PostMapping("addTypeData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->新增技术方案类别库", businessType = OperaType.INSERT, details = "新增技术方案类别库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:add")
|
||||
public AjaxResult addTypeData(@RequestBody TechnicalDto.TypeDto dto) {
|
||||
return technicalService.addTypeData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "修改技术方案类别库")
|
||||
@PostMapping("editTypeData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->修改技术方案类别库", businessType = OperaType.UPDATE, details = "修改技术方案类别库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:edit")
|
||||
public AjaxResult editTypeData(@RequestBody TechnicalDto.TypeDto dto) {
|
||||
return technicalService.editTypeData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "删除技术方案类别库")
|
||||
@PostMapping("delTypeData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->删除技术方案类别库", businessType = OperaType.DELETE, details = "删除技术方案类别库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:del")
|
||||
public AjaxResult delTypeData(@RequestBody TechnicalDto.TypeDto dto) {
|
||||
return technicalService.delTypeData(dto);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "查询数据列表")
|
||||
@GetMapping("getDataList")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->查询数据列表", businessType = OperaType.QUERY, details = "查询数据列表", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:list")
|
||||
public TableDataInfo getDataList(TechnicalDto.TechnicalDataDto dto) {
|
||||
startPage();
|
||||
List<TechnicalVo.Technical> list = technicalService.getList(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "新增技术方案库")
|
||||
@PostMapping("addData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->新增技术方案库", businessType = OperaType.INSERT, details = "新增技术方案库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:add")
|
||||
public AjaxResult addData(@RequestBody TechnicalDto.TechnicalDataDto dto) {
|
||||
return technicalService.addData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "修改技术方案库")
|
||||
@PostMapping("editData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->修改技术方案库", businessType = OperaType.UPDATE, details = "修改技术方案库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:edit")
|
||||
public AjaxResult editData(@RequestBody TechnicalDto.TechnicalDataDto dto) {
|
||||
return technicalService.editData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "删除技术方案库")
|
||||
@PostMapping("delData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->删除技术方案库", businessType = OperaType.DELETE, details = "删除技术方案库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:del")
|
||||
public AjaxResult delData(@RequestBody TechnicalDto.TechnicalDataDto dto) {
|
||||
return technicalService.delData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "技术方案库", notes = "技术方案库详情")
|
||||
@GetMapping("detailData")
|
||||
@SysLog(title = "技术方案库", module = "企业知识库->技术方案库->技术方案库详情", businessType = OperaType.QUERY, details = "删除技术方案库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:technical:detail")
|
||||
public AjaxResult detailData(TechnicalDto.TechnicalDataDto dto) {
|
||||
return technicalService.detailData(dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -317,7 +317,7 @@ public class PersonnelService {
|
|||
// 3.查询人员关联资源文件
|
||||
List<ResourceFileVo> fileVoList = sourceFileService.getFilesByTable(dto.getPersonnelId(),TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
// 4.取minio中的文件访问路径
|
||||
List<ResourceFileVo> resourceFileVos = setFile(fileVoList);
|
||||
List<ResourceFileVo> resourceFileVos = fileUploadService.setFile(fileVoList);
|
||||
detailVo.setResourceFileVoList(resourceFileVos);
|
||||
|
||||
// 5.查询人员证书
|
||||
|
|
@ -328,7 +328,7 @@ public class PersonnelService {
|
|||
vo.setCertificate(item);
|
||||
List<ResourceFileVo> filesByTable = sourceFileService.getFilesByTable(item.getPersonnelCertificateId(), TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
// 取minio中的文件访问路径
|
||||
List<ResourceFileVo> fileVos = setFile(filesByTable);
|
||||
List<ResourceFileVo> fileVos = fileUploadService.setFile(filesByTable);
|
||||
vo.setFileVoList(fileVos);
|
||||
certificateDetailList.add(vo);
|
||||
}
|
||||
|
|
@ -373,7 +373,7 @@ public class PersonnelService {
|
|||
* @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) {
|
||||
|
|
@ -384,5 +384,5 @@ public class PersonnelService {
|
|||
}
|
||||
}
|
||||
return fileVoList;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,270 @@
|
|||
package com.bonus.web.service.enterprise;
|
||||
|
||||
import com.bonus.common.constant.TableConstants;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.common.domain.file.vo.ResourceFileVo;
|
||||
import com.bonus.common.domain.file.vo.SysFile;
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.TechnicalVo;
|
||||
import com.bonus.common.utils.ValidatorsUtils;
|
||||
import com.bonus.file.service.FileUploadService;
|
||||
import com.bonus.file.service.SourceFileService;
|
||||
import com.bonus.mainDataBase.service.IMDTechnicalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @className:TechnicalService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:42
|
||||
* @version:1.0
|
||||
* @description:技术方案库-业务层
|
||||
*/
|
||||
@Service(value = "TechnicalService")
|
||||
@Slf4j
|
||||
public class TechnicalService {
|
||||
|
||||
@Resource(name = "IMDTechnicalService")
|
||||
private IMDTechnicalService imdTechnicalService;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
@Resource(name = "SourceFileService")
|
||||
private SourceFileService sourceFileService;
|
||||
|
||||
@Resource(name = "FileUploadService")
|
||||
private FileUploadService fileUploadService;
|
||||
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->查询类型列表
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
public AjaxResult getTypeList(TechnicalDto.TypeDto dto) {
|
||||
List<TechnicalVo.TypeVo> list = imdTechnicalService.getTypeList(dto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->新增技术方案类型
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
public AjaxResult addTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.ADD.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 1.技术方案库类别是否重复
|
||||
int result = imdTechnicalService.isRepeat(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("技术方案库类别已存在");
|
||||
}
|
||||
// 2.添加技术方案库类别数据
|
||||
imdTechnicalService.operTypeData(dto, 1);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->修改技术方案类型
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
public AjaxResult editTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.UPDATE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 1.技术方案库类别是否重复
|
||||
int result = imdTechnicalService.isRepeat(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("技术方案库类别已存在");
|
||||
}
|
||||
// 2.添加技术方案库类别数据
|
||||
imdTechnicalService.operTypeData(dto, 1);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->删除技术方案类型
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:19
|
||||
*/
|
||||
public AjaxResult delTypeData(TechnicalDto.TypeDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TypeDto.DELETE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 1.技术方案库类别是否存在子集
|
||||
int result = imdTechnicalService.hasChildData(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("技术方案库类别子集数据,无法删除");
|
||||
}
|
||||
// 2.添加技术方案库类别数据
|
||||
imdTechnicalService.operTypeData(dto, 3);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->新增技术方案库数据
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
public AjaxResult addData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.ADD.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
List<TechnicalDto.TechnicalDataDto> dataDtos = new ArrayList<>();
|
||||
|
||||
String[] ignoreProperties = {"files"}; // 要忽略的属性名
|
||||
for (ResourceFilePo file : dto.getFiles()) {
|
||||
TechnicalDto.TechnicalDataDto dataDto = new TechnicalDto.TechnicalDataDto();
|
||||
BeanUtils.copyProperties(dto, dataDto,ignoreProperties);
|
||||
String fileName = StringUtils.substringBeforeLast(file.getFileName(), ".");
|
||||
dataDto.setTechnicalName(fileName);
|
||||
dataDtos.add(dataDto);
|
||||
}
|
||||
// 2.添加技术方案库数据
|
||||
imdTechnicalService.operData(dataDtos, 1);
|
||||
// 3.添加文件
|
||||
for (int i = 0; i < dto.getFiles().size(); i++) {
|
||||
dto.getFiles().get(i).setBusinessId(dataDtos.get(i).getTechnicalSolutionId()); // 业务id
|
||||
dto.getFiles().get(i).setSourceTable(TableConstants.TB_ENTERPRISE_TECHNICAL_SOLUTION); // 来源表
|
||||
}
|
||||
sourceFileService.saveResourceFile(dto.getFiles());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->修改技术方案库数据
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
public AjaxResult editData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.UPDATE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 修改技术方案库数据
|
||||
imdTechnicalService.operData(Collections.singletonList(dto), 2);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->删除技术方案库数据
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
public AjaxResult delData(TechnicalDto.TechnicalDataDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, TechnicalDto.TechnicalDataDto.DELETE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 删除技术方案库数据
|
||||
imdTechnicalService.operData(Collections.singletonList(dto), 3);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->技术方案库详情数据
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:09
|
||||
*/
|
||||
public List<TechnicalVo.Technical> getList(TechnicalDto.TechnicalDataDto dto) {
|
||||
List<TechnicalVo.Technical> list = imdTechnicalService.getList(dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->技术方案库详情数据
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 11:25
|
||||
*/
|
||||
public AjaxResult detailData(TechnicalDto.TechnicalDataDto dto) {
|
||||
TechnicalVo.Technical vo = new TechnicalVo.Technical();
|
||||
// 1.查询关联资源文件
|
||||
List<ResourceFileVo> fileVoList = sourceFileService.getFilesByTable(dto.getTechnicalSolutionId(),TableConstants.TB_ENTERPRISE_TECHNICAL_SOLUTION);
|
||||
// 2.取minio中的文件访问路径
|
||||
List<ResourceFileVo> resourceFileVos = fileUploadService.setFile(fileVoList);
|
||||
vo.setResourceFileVoList(resourceFileVos);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -17,4 +17,7 @@ public class TableConstants {
|
|||
|
||||
/**人员证书*/
|
||||
public static final String TB_PERSONNEL_CERTIFICATE = "tb_personnel_certificate";
|
||||
|
||||
/**技术方案库*/
|
||||
public static final String TB_ENTERPRISE_TECHNICAL_SOLUTION = "tb_enterprise_technical_solution";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class EnterpriseDto {
|
|||
* 企业名称
|
||||
*/
|
||||
@NotBlank(message = "企业名称不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "企业名称字符长度不能超过256", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "企业名称字符长度不能超过64", groups = {ADD.class, UPDATE.class})
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,218 @@
|
|||
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 lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @className:TechnicalDto
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:50
|
||||
* @version:1.0
|
||||
* @description:企业技术方案库类别库-dto
|
||||
*/
|
||||
@Data
|
||||
public class TechnicalDto {
|
||||
|
||||
@Data
|
||||
public static class TypeDto {
|
||||
|
||||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {ADD.class,UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 技术方案名称
|
||||
*/
|
||||
@NotBlank(message = "技术方案名称不能为空", groups = {EnterpriseDto.ADD.class, EnterpriseDto.UPDATE.class})
|
||||
@Length(max = 64, message = "技术方案名称字符长度不能超过64", groups = {EnterpriseDto.ADD.class, EnterpriseDto.UPDATE.class})
|
||||
private String technicalSolutionName;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 查询条件限制
|
||||
*/
|
||||
public interface QUERY {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条件限制
|
||||
*/
|
||||
public interface ADD {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件限制
|
||||
*/
|
||||
public interface UPDATE {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条件限制
|
||||
*/
|
||||
public interface DELETE {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TechnicalDataDto {
|
||||
|
||||
/**
|
||||
* 技术方案id
|
||||
*/
|
||||
@NotNull(message = "技术方案id不能为空", groups = {UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long technicalSolutionId;
|
||||
|
||||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
@NotNull(message = "技术方案类别id不能为空", groups = {UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
* 技术方案名称
|
||||
* */
|
||||
private String technicalName;
|
||||
|
||||
/**
|
||||
* 电压等级(字典表配置)
|
||||
*/
|
||||
@NotBlank(message = "电压等级不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "电压等级字符长度不能超过64", groups = {ADD.class, UPDATE.class})
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 建设性质(字典表配置)
|
||||
*/
|
||||
@NotBlank(message = "建设性质不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 512, message = "建设性质字符长度不能超过512", groups = {ADD.class, UPDATE.class})
|
||||
private String natureConstruction;
|
||||
|
||||
|
||||
/**
|
||||
* 结构形式(字典表配置)
|
||||
*/
|
||||
@NotBlank(message = "结构形式不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "结构形式字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String structuralForm;
|
||||
|
||||
/**
|
||||
* 基础形式
|
||||
*/
|
||||
@NotBlank(message = "基础形式不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "基础形式字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String basicForm;
|
||||
|
||||
/**
|
||||
* 资源文件
|
||||
*/
|
||||
@NotEmpty(message = "文件不能为空", groups = {ADD.class})
|
||||
@Size(min = 1,message = "最少上传一个文件", groups = {ADD.class})
|
||||
private List<ResourceFilePo> files;
|
||||
|
||||
|
||||
/**
|
||||
* 文件状态 1.解析中 2.可引用
|
||||
*/
|
||||
private String technicalSolutionState = "2";
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 查询条件限制
|
||||
*/
|
||||
public interface QUERY {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条件限制
|
||||
*/
|
||||
public interface ADD {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件限制
|
||||
*/
|
||||
public interface UPDATE {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条件限制
|
||||
*/
|
||||
public interface DELETE {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.bonus.common.domain.mainDatabase.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 企业技术方案库
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TechnicalSolution {
|
||||
|
||||
/**
|
||||
* 技术方案id
|
||||
*/
|
||||
private Long technicalSolutionId;
|
||||
|
||||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
* 电压等级(字典表配置)
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 建设性质(字典表配置)
|
||||
*/
|
||||
private String natureConstruction;
|
||||
|
||||
/**
|
||||
* 基础形式
|
||||
*/
|
||||
private String basicForm;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 删除状态 0.未删除 1.删除
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 文件状态
|
||||
*/
|
||||
private String technicalSolutionState;
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.bonus.common.domain.mainDatabase.vo;
|
||||
|
||||
import com.bonus.common.domain.file.vo.ResourceFileVo;
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:TechnicalVo
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:52
|
||||
* @version:1.0
|
||||
* @description:技术方案库类别-vo
|
||||
*/
|
||||
@Data
|
||||
public class TechnicalVo {
|
||||
|
||||
@Data
|
||||
public static class TypeVo {
|
||||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 技术方案名称
|
||||
*/
|
||||
private String technicalSolutionName;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Technical {
|
||||
/**
|
||||
* 技术方案id
|
||||
*/
|
||||
private Long technicalSolutionId;
|
||||
|
||||
/**
|
||||
* 技术方案类别id
|
||||
*/
|
||||
private Long technicalSolutionTypeId;
|
||||
|
||||
/**
|
||||
* 技术方案名称
|
||||
* */
|
||||
private String technicalName;
|
||||
|
||||
/**
|
||||
* 电压等级(字典表配置)
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 结构形式(字典表配置)
|
||||
*/
|
||||
private String structuralForm;
|
||||
|
||||
/**
|
||||
* 建设性质(字典表配置)
|
||||
*/
|
||||
private String natureConstruction;
|
||||
|
||||
/**
|
||||
* 基础形式
|
||||
*/
|
||||
private String basicForm;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 文件状态 1.解析中 2.可引用
|
||||
*/
|
||||
private String technicalSolutionState;
|
||||
|
||||
/**人员相关资源文件*/
|
||||
private List<ResourceFileVo> resourceFileVoList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ public enum UploadSuffixEnum {
|
|||
*/
|
||||
QUALIFICATION_DATABASE("qualification_database", "qualificationDatabase"),
|
||||
/**
|
||||
* 业绩库
|
||||
* 技术方案库
|
||||
*/
|
||||
TECHNICAL_SOLUTION_DATABASE("technical_solution_database", "technicalSolutionDatabase"),
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
package com.bonus.file.service;
|
||||
|
||||
import com.bonus.common.domain.file.vo.ResourceFileVo;
|
||||
import com.bonus.common.domain.file.vo.SysFile;
|
||||
import com.bonus.file.config.MinioConfig;
|
||||
import com.bonus.file.util.MinioUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @className:FileUploadService
|
||||
|
|
@ -70,6 +74,13 @@ public class FileUploadService {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件
|
||||
* @param filePath
|
||||
* @return SysFile
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 13:11
|
||||
*/
|
||||
public SysFile getFile(String filePath) {
|
||||
try{
|
||||
String fileUrl = minioUtil.getFileUrl(minioConfig.getBucketName(), filePath, 60 * 60 * 12);
|
||||
|
|
@ -83,4 +94,23 @@ public class FileUploadService {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件访问路径赋值
|
||||
* @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 = getFile(file.getFilePath());
|
||||
if(Objects.nonNull(sysFile)){
|
||||
file.setLsFilePath(sysFile.getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileVoList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,6 @@ public class MinioUtil {
|
|||
.object(partName)
|
||||
.stream(stream, stream.available(), -1)
|
||||
.build());
|
||||
System.out.println("Uploaded part: " + partName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error uploading part: " + partName, e);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.bonus.mainDataBase.mapper;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.TechnicalVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IMDTechnicalMapper
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:44
|
||||
* @version:1.0
|
||||
* @description:数据方案库-数据层
|
||||
*/
|
||||
@Repository(value = "IMDTechnicalMapper")
|
||||
public interface IMDTechnicalMapper {
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->查询类型列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<TypeVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:21
|
||||
*/
|
||||
List<TechnicalVo.TypeVo> getTypeList(TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->操作技术方案库类别
|
||||
* @param dto
|
||||
* @param type
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/29 9:01
|
||||
*/
|
||||
void operTypeData(@Param("params") TechnicalDto.TypeDto dto, @Param("type") int type);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->技术方案库类别是否重复
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 9:50
|
||||
*/
|
||||
int isRepeat(@Param("params") TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->技术方案库类别是否存在子集
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 9:59
|
||||
*/
|
||||
int hasChildData(TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->查询数据列表
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:15
|
||||
*/
|
||||
List<TechnicalVo.Technical> getList(TechnicalDto.TechnicalDataDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->操作技术方案库数据
|
||||
* @param list
|
||||
* @param type
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 11:01
|
||||
*/
|
||||
void operData(@Param("list") List<TechnicalDto.TechnicalDataDto> list,@Param("type") int type);
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.mainDataBase.service;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.TechnicalVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IMDTechnicalService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:43
|
||||
* @version:1.0
|
||||
* @description:技术方案库-具体业务层
|
||||
*/
|
||||
public interface IMDTechnicalService {
|
||||
/**
|
||||
* 企业知识库->技术方案库->查询技术方案库类型列表
|
||||
* @param dto
|
||||
* @return List<TypeVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:20
|
||||
*/
|
||||
List<TechnicalVo.TypeVo> getTypeList(TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 技术方案库类别是否重复
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:29
|
||||
*/
|
||||
int isRepeat(TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 技术方案库类别是否重复
|
||||
* @param dto
|
||||
* @param type
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/28 18:30
|
||||
*/
|
||||
void operTypeData(@Param("params") TechnicalDto.TypeDto dto, @Param("type") int type);
|
||||
|
||||
/**
|
||||
* 技术方案库类别是否存在子集
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 9:59
|
||||
*/
|
||||
int hasChildData(TechnicalDto.TypeDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->查询数据列表
|
||||
* @param dto
|
||||
* @return List<Technical>
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 10:15
|
||||
*/
|
||||
List<TechnicalVo.Technical> getList(TechnicalDto.TechnicalDataDto dto);
|
||||
|
||||
/**
|
||||
* 企业知识库->技术方案库->操作技术方案库数据
|
||||
* @param dataDtos
|
||||
* @param type
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/30 11:00
|
||||
*/
|
||||
void operData(List<TechnicalDto.TechnicalDataDto> dataDtos, int type);
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.TechnicalDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.TechnicalVo;
|
||||
import com.bonus.mainDataBase.mapper.IMDTechnicalMapper;
|
||||
import com.bonus.mainDataBase.service.IMDTechnicalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:MDTechnicalService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-28-17:44
|
||||
* @version:1.0
|
||||
* @description:技术方案库-具体业务逻辑层
|
||||
*/
|
||||
@Slf4j
|
||||
@Service(value = "IMDTechnicalService")
|
||||
public class MDTechnicalService implements IMDTechnicalService {
|
||||
|
||||
@Resource(name = "IMDTechnicalMapper")
|
||||
private IMDTechnicalMapper imdTechnicalMapper;
|
||||
|
||||
@Override
|
||||
public List<TechnicalVo.TypeVo> getTypeList(TechnicalDto.TypeDto dto) {
|
||||
try {
|
||||
return imdTechnicalMapper.getTypeList(dto);
|
||||
} catch (Exception e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isRepeat(TechnicalDto.TypeDto dto) {
|
||||
try {
|
||||
return imdTechnicalMapper.isRepeat(dto);
|
||||
} catch (Exception e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operTypeData(TechnicalDto.TypeDto dto, int type) {
|
||||
imdTechnicalMapper.operTypeData(dto,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hasChildData(TechnicalDto.TypeDto dto) {
|
||||
try {
|
||||
return imdTechnicalMapper.hasChildData(dto);
|
||||
} catch (Exception e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TechnicalVo.Technical> getList(TechnicalDto.TechnicalDataDto dto) {
|
||||
try {
|
||||
return imdTechnicalMapper.getList(dto);
|
||||
} catch (Exception e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operData(List<TechnicalDto.TechnicalDataDto> dataDtos, int type) {
|
||||
imdTechnicalMapper.operData(dataDtos,type);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.mainDataBase.mapper.IMDTechnicalMapper">
|
||||
<!--企业知识库->技术方案库->操作技术方案库类别-->
|
||||
<insert id="operTypeData" useGeneratedKeys="true" keyProperty="params.technicalSolutionTypeId" keyColumn="technical_solution_type_id">
|
||||
<if test="type == 1">
|
||||
INSERT INTO tb_enterprise_technical_solution_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="params.enterpriseId != null">enterprise_id,</if>
|
||||
<if test="params.technicalSolutionName != null and params.technicalSolutionName!=''">technical_solution_name,</if>
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
update_user_id,
|
||||
update_user_name
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="params.enterpriseId != null">#{params.enterpriseId},</if>
|
||||
<if test="params.technicalSolutionName != null and params.technicalSolutionName!=''">#{params.technicalSolutionName},</if>
|
||||
#{params.createUserId},
|
||||
#{params.createUserName},
|
||||
#{params.updateUserId},
|
||||
#{params.updateUserName},
|
||||
</trim>
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
UPDATE tb_enterprise_technical_solution_type SET technical_solution_name = #{params.technicalSolutionName}
|
||||
WHERE technical_solution_type_id = #{params.technicalSolutionTypeId};
|
||||
</if>
|
||||
<if test="type == 3">
|
||||
UPDATE tb_enterprise_technical_solution_type SET del_flag = '1'
|
||||
WHERE technical_solution_type_id = #{params.technicalSolutionTypeId}
|
||||
</if>
|
||||
</insert>
|
||||
|
||||
<!--企业知识库->技术方案库->操作技术方案库数据-->
|
||||
<insert id="operData" useGeneratedKeys="true" keyColumn="technical_solution_id" keyProperty="technicalSolutionId">
|
||||
<if test="type == 1">
|
||||
INSERT INTO tb_enterprise_technical_solution
|
||||
(
|
||||
technical_solution_type_id,
|
||||
technical_name,
|
||||
voltage_level,
|
||||
nature_construction,
|
||||
structural_form,
|
||||
basic_form,
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
update_user_id,
|
||||
update_user_name
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.technicalSolutionTypeId},
|
||||
#{item.technicalName},
|
||||
#{item.voltageLevel},
|
||||
#{item.natureConstruction},
|
||||
#{item.structuralForm},
|
||||
#{item.basicForm},
|
||||
#{item.createUserId},
|
||||
#{item.createUserName},
|
||||
#{item.updateUserId},
|
||||
#{item.updateUserName}
|
||||
)
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="type == 2">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE tb_enterprise_technical_solution
|
||||
<set>
|
||||
<if test="item.technicalSolutionTypeId != null">technical_solution_type_id = #{item.technicalSolutionTypeId},</if>
|
||||
<if test="item.technicalName != null and item.technicalName != ''">technical_name = #{item.technicalName},</if>
|
||||
<if test="item.voltageLevel != null and item.voltageLevel != ''">voltage_level = #{item.voltageLevel},</if>
|
||||
<if test="item.natureConstruction != null and item.natureConstruction != ''">nature_construction = #{item.natureConstruction},</if>
|
||||
<if test="item.structuralForm != null and item.structuralForm != ''">structural_form = #{item.structuralForm},</if>
|
||||
<if test="item.basicForm != null and item.basicForm != ''">basic_form = #{item.basicForm},</if>
|
||||
update_user_id = #{item.updateUserId},
|
||||
update_user_name = #{item.updateUserName}
|
||||
</set>
|
||||
WHERE technical_solution_id = #{item.technicalSolutionId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="type == 3">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE tb_enterprise_technical_solution
|
||||
<set>
|
||||
del_flag = '1'
|
||||
</set>
|
||||
WHERE technical_solution_id = #{item.technicalSolutionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</insert>
|
||||
|
||||
<!--企业知识库->技术方案库->查询类型列表-->
|
||||
<select id="getTypeList" resultType="com.bonus.common.domain.mainDatabase.vo.TechnicalVo$TypeVo">
|
||||
SELECT technical_solution_type_id AS technicalSolutionTypeId,
|
||||
technical_solution_name AS technicalSolutionName,
|
||||
enterprise_id AS enterpriseId
|
||||
FROM tb_enterprise_technical_solution_type
|
||||
WHERE enterprise_id = #{enterpriseId}
|
||||
</select>
|
||||
<!--企业知识库->技术方案库->技术方案库类别是否重复-->
|
||||
<select id="isRepeat" resultType="java.lang.Integer">
|
||||
<if test="params.technicalSolutionTypeId == null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution_type WHERE technical_solution_name = #{params.technicalSolutionName} AND del_flag = '0';
|
||||
</if>
|
||||
<if test="params.technicalSolutionTypeId != null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution_type
|
||||
WHERE technical_solution_type_id != #{params.technicalSolutionTypeId}
|
||||
AND technical_solution_name = #{params.technicalSolutionName} AND del_flag = '0'
|
||||
</if>
|
||||
</select>
|
||||
<!--技术方案库类别是否存在子集-->
|
||||
<select id="hasChildData" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution WHERE technical_solution_type_id = #{technicalSolutionTypeId} AND del_flag = '0'
|
||||
</select>
|
||||
<!--企业知识库->技术方案库->查询数据列表-->
|
||||
<select id="getList" resultType="com.bonus.common.domain.mainDatabase.vo.TechnicalVo$Technical">
|
||||
SELECT * FROM (
|
||||
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 natureConstructionLabels
|
||||
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>
|
||||
<if test="technicalName!=null and technicalName!=''">
|
||||
AND INSTR(tets.technical_name,#{technicalName}) > 0
|
||||
</if>
|
||||
AND tets.del_flag = '0'
|
||||
</where>
|
||||
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
|
||||
) A
|
||||
ORDER BY A.createTime DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue