Browse Source

Merge remote-tracking branch 'origin/master'

master
zy 2 months ago
parent
commit
7aeb8b22f5
  1. 26
      yudao-dependencies/pom.xml
  2. 2
      yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java
  3. 2
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java
  4. 2
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
  5. 11
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
  6. 75
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  7. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java
  8. 95
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/EnterpriseTagController.java
  9. 28
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagPageReqVO.java
  10. 31
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagRespVO.java
  11. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagSaveReqVO.java
  12. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/vo/TagLibraryRespVO.java
  13. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/vo/TagLibrarySaveReqVO.java
  14. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java
  15. 39
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisetag/EnterpriseTagDO.java
  16. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taglibrary/TagLibraryDO.java
  17. 28
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisetag/EnterpriseTagMapper.java
  18. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taglibrary/TagLibraryMapper.java
  19. 11
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  20. 56
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisetag/EnterpriseTagService.java
  21. 75
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisetag/EnterpriseTagServiceImpl.java

26
yudao-dependencies/pom.xml

@ -525,7 +525,6 @@
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
@ -583,11 +582,6 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId>
<version>${weixin-java.version}</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
@ -599,26 +593,6 @@
<version>${weixin-java.version}</version>
</dependency>
<!-- 积木报表-->
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
<version>${jimureport.version}</version>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- MQTT -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${mqtt.version}</version>
</dependency>
<!-- 专属于 JDK8 安全漏洞升级 -->
<dependency>
<groupId>ch.qos.logback</groupId>

2
yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java

@ -41,6 +41,6 @@ public interface FileApi {
*/
Map<String, String> createFile(String name, String path, byte[] content);
List<String> listFile(List<Long> ids);
List<Map<String, String>> listFile(List<Long> ids);
}

2
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java

@ -26,7 +26,7 @@ public class FileApiImpl implements FileApi {
}
@Override
public List<String> listFile(List<Long> ids) {
public List<Map<String, String>> listFile(List<Long> ids) {
return fileService.listFile(ids);
}

2
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java

@ -66,5 +66,5 @@ public interface FileService {
*/
FilePresignedUrlRespVO getFilePresignedUrl(String path) throws Exception;
List<String> listFile(List<Long> ids);
List<Map<String,String>> listFile(List<Long> ids);
}

11
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java

@ -126,10 +126,17 @@ public class FileServiceImpl implements FileService {
}
@Override
public List<String> listFile(List<Long> ids) {
public List<Map<String, String>> listFile(List<Long> ids) {
LambdaQueryWrapper<FileDO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(FileDO::getId, ids);
return fileMapper.selectList(wrapper).stream().map(FileDO::getUrl).collect(Collectors.toList());
final List<FileDO> fileDOS = fileMapper.selectList(wrapper);
return fileDOS.stream().map(fileDO -> {
Map<String, String> map = new HashMap<>();
map.put("id", fileDO.getId().toString());
map.put("url", fileDO.getUrl());
return map;
}).collect(Collectors.toList());
}
}

75
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java

@ -2,13 +2,18 @@ package cn.iocoder.yudao.module.system.controller.admin.enterprise;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMapper;
import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper;
import cn.iocoder.yudao.module.system.dal.mysql.qualification.EnterpriseQualificationMapper;
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper;
import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService;
import cn.iocoder.yudao.module.system.service.qualification.EnterpriseQualificationService;
import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@ -59,6 +64,10 @@ public class EnterpriseController {
private EnterpriseQualificationMapper enterpriseQualificationMapper;
@Resource
private EnterpriseAuditLogMapper enterpriseAuditLogMapper;
@Resource
private TagLibraryMapper tagLibraryMapper;
@Resource
private EnterpriseTagMapper enterpriseTagMapper;
@PostMapping("/create")
@Operation(summary = "创建企业")
@ -90,24 +99,25 @@ public class EnterpriseController {
// @PreAuthorize("@ss.hasPermission('system:enterprise:query')")
public CommonResult<EnterpriseRespVO> getEnterprise(@RequestParam("id") Long id) {
EnterpriseDO enterprise = enterpriseService.getEnterprise(id);
if (enterprise != null) {
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FileInfoDO::getDictType, 644l);
wrapper.eq(FileInfoDO::getDictData, 1l);
wrapper.eq(FileInfoDO::getUnitId, enterprise.getId());
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
//获取企业图片
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FileInfoDO::getDictType, 644l);
wrapper.eq(FileInfoDO::getDictData, 1l);
wrapper.eq(FileInfoDO::getUnitId, enterprise.getId());
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<Map<String,String>> list = fileApi.listFile(collect);
enterprise.setFiles(list);
}
if (!collect.isEmpty()) {
final List<String> list = fileApi.listFile(collect);
enterprise.setFiles(list);
//获取资质
LambdaQueryWrapper<EnterpriseQualificationDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(EnterpriseQualificationDO::getEnterpriseId, enterprise.getId());
final List<EnterpriseQualificationDO> enterpriseQualificationList = enterpriseQualificationMapper.selectList(queryWrapper);
enterprise.setQualificationList(enterpriseQualificationList);
}
//获取资质
LambdaQueryWrapper<EnterpriseQualificationDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(EnterpriseQualificationDO::getEnterpriseId, enterprise.getId());
final List<EnterpriseQualificationDO> enterpriseQualificationList = enterpriseQualificationMapper.selectList(queryWrapper);
enterprise.setQualificationList(enterpriseQualificationList);
//获取企业标签
return success(BeanUtils.toBean(enterprise, EnterpriseRespVO.class));
}
@ -117,6 +127,39 @@ public class EnterpriseController {
@PreAuthorize("@ss.hasPermission('system:enterprise:query')")
public CommonResult<PageResult<EnterpriseRespVO>> getEnterprisePage(@Valid EnterprisePageReqVO pageReqVO) {
PageResult<EnterpriseDO> pageResult = enterpriseService.getEnterprisePage(pageReqVO);
pageResult.getList().forEach(item->{
//企业审核状态
QueryWrapper<EnterpriseAuditLogDO> auditLogDOQueryWrapper = new QueryWrapper<>();
auditLogDOQueryWrapper.eq("enterprise_id", item.getId());
EnterpriseAuditLogDO enterpriseAuditLogDO = enterpriseAuditLogMapper.selectOne(auditLogDOQueryWrapper);
if (enterpriseAuditLogDO != null) {
item.setAudit(enterpriseAuditLogDO.getAudit());
}
//企业图片
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FileInfoDO::getDictType, 644l);
wrapper.eq(FileInfoDO::getDictData, 1l);
wrapper.eq(FileInfoDO::getUnitId, item.getId());
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<Map<String,String>> list = fileApi.listFile(collect);
item.setFiles(list);
}
// 企业标签
LambdaQueryWrapper<EnterpriseTagDO> tagDOLambdaQueryWrapper = new LambdaQueryWrapper<>();
tagDOLambdaQueryWrapper.eq(EnterpriseTagDO::getEnterpriseId, item.getId());
List<EnterpriseTagDO> enterpriseTagDOS = enterpriseTagMapper.selectList(tagDOLambdaQueryWrapper);
if (enterpriseTagDOS != null && enterpriseTagDOS.size() > 0) {
List<Long> tagIds = enterpriseTagDOS.stream().map(EnterpriseTagDO::getTagId).collect(Collectors.toList());
List<TagLibraryDO> tagLibraryDOS = tagLibraryMapper.selectList(new LambdaQueryWrapper<TagLibraryDO>().in(TagLibraryDO::getId, tagIds));
if (tagLibraryDOS != null && tagLibraryDOS.size() > 0) {
List<String> tagNames = tagLibraryDOS.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList());
item.setTagList(tagNames);
}
}
});
return success(BeanUtils.toBean(pageResult, EnterpriseRespVO.class));
}
@ -143,7 +186,7 @@ public class EnterpriseController {
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<String> list = fileApi.listFile(collect);
final List<Map<String,String>> list = fileApi.listFile(collect);
item.setFiles(list);
}

7
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprise.vo;
import cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -88,9 +89,13 @@ public class EnterpriseRespVO {
private Integer audit;
@Schema(description = "企业图片", example = "26433")
private List<String> files;
private List<Map<String,String>> files;
@Schema(description = "企业资质列表", example = "26433")
private List<EnterpriseQualificationDO> qualificationList;
@Schema(description = "企业标签", example = "26433")
private List<Map<String, String>> tagList;
}

95
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/EnterpriseTagController.java

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisetag;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.module.system.service.enterprisetag.EnterpriseTagService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 企业标签")
@RestController
@RequestMapping("/system/enterprise-tag")
@Validated
public class EnterpriseTagController {
@Resource
private EnterpriseTagService enterpriseTagService;
@PostMapping("/create")
@Operation(summary = "创建企业标签")
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:create')")
public CommonResult<Long> createEnterpriseTag(@Valid @RequestBody EnterpriseTagSaveReqVO createReqVO) {
return success(enterpriseTagService.createEnterpriseTag(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新企业标签")
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:update')")
public CommonResult<Boolean> updateEnterpriseTag(@Valid @RequestBody EnterpriseTagSaveReqVO updateReqVO) {
enterpriseTagService.updateEnterpriseTag(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除企业标签")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:delete')")
public CommonResult<Boolean> deleteEnterpriseTag(@RequestParam("id") Long id) {
enterpriseTagService.deleteEnterpriseTag(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得企业标签")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:query')")
public CommonResult<EnterpriseTagRespVO> getEnterpriseTag(@RequestParam("id") Long id) {
EnterpriseTagDO enterpriseTag = enterpriseTagService.getEnterpriseTag(id);
return success(BeanUtils.toBean(enterpriseTag, EnterpriseTagRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得企业标签分页")
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:query')")
public CommonResult<PageResult<EnterpriseTagRespVO>> getEnterpriseTagPage(@Valid EnterpriseTagPageReqVO pageReqVO) {
PageResult<EnterpriseTagDO> pageResult = enterpriseTagService.getEnterpriseTagPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, EnterpriseTagRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出企业标签 Excel")
@PreAuthorize("@ss.hasPermission('system:enterprise-tag:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEnterpriseTagExcel(@Valid EnterpriseTagPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<EnterpriseTagDO> list = enterpriseTagService.getEnterpriseTagPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "企业标签.xls", "数据", EnterpriseTagRespVO.class,
BeanUtils.toBean(list, EnterpriseTagRespVO.class));
}
}

28
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagPageReqVO.java

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 企业标签分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EnterpriseTagPageReqVO extends PageParam {
@Schema(description = "企业id", example = "32136")
private Long enterpriseId;
@Schema(description = "标签id", example = "13027")
private Long tagId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

31
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagRespVO.java

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 企业标签 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EnterpriseTagRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19630")
@ExcelProperty("主键")
private Long id;
@Schema(description = "企业id", example = "32136")
@ExcelProperty("企业id")
private Long enterpriseId;
@Schema(description = "标签id", example = "13027")
@ExcelProperty("标签id")
private Long tagId;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

20
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisetag/vo/EnterpriseTagSaveReqVO.java

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@Schema(description = "管理后台 - 企业标签新增/修改 Request VO")
@Data
public class EnterpriseTagSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19630")
private Long id;
@Schema(description = "企业id", example = "32136")
private Long enterpriseId;
@Schema(description = "标签id", example = "13027")
private Long tagId;
}

4
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/vo/TagLibraryRespVO.java

@ -33,6 +33,10 @@ public class TagLibraryRespVO {
@ExcelProperty("1、企业标签2、执法标签")
private Integer tagType;
@Schema(description = "排序", example = "2")
@ExcelProperty("排序")
private Integer sort;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/vo/TagLibrarySaveReqVO.java

@ -21,10 +21,12 @@ public class TagLibrarySaveReqVO {
@Schema(description = "父标签的ID", example = "30648")
private Integer parentId;
@Schema(description = "标签层级(一级、二级、三级)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "标签层级(一级、二级、三级)不能为空")
@Schema(description = "标签层级(一级、二级、三级)")
private Integer tagLevel;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "1、企业标签2、执法标签", example = "2")
private Integer tagType;

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.dal.dataobject.enterprise;
import cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import lombok.*;
import java.time.LocalDate;
@ -88,9 +89,12 @@ public class EnterpriseDO extends BaseDO {
private Integer audit;
@TableField(exist = false)
private List<String> files;
private List<Map<String, String>> files;
@TableField(exist = false)
private List<EnterpriseQualificationDO> qualificationList;
@TableField(exist = false)
private List<String> tagList;
}

39
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisetag/EnterpriseTagDO.java

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 企业标签 DO
*
* @author 芋道源码
*/
@TableName("enterprise_tag")
@KeySequence("enterprise_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EnterpriseTagDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 企业id
*/
private Long enterpriseId;
/**
* 标签id
*/
private Long tagId;
}

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taglibrary/TagLibraryDO.java

@ -43,6 +43,8 @@ public class TagLibraryDO extends BaseDO {
* 1企业标签2执法标签
*/
private Integer tagType;
//排序
private Integer sort;
@TableField(exist = false)
private List<TagLibraryDO> children = new ArrayList<>(); // 子标签列表

28
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisetag/EnterpriseTagMapper.java

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.system.dal.mysql.enterprisetag;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo.*;
/**
* 企业标签 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface EnterpriseTagMapper extends BaseMapperX<EnterpriseTagDO> {
default PageResult<EnterpriseTagDO> selectPage(EnterpriseTagPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EnterpriseTagDO>()
.eqIfPresent(EnterpriseTagDO::getEnterpriseId, reqVO.getEnterpriseId())
.eqIfPresent(EnterpriseTagDO::getTagId, reqVO.getTagId())
.betweenIfPresent(EnterpriseTagDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EnterpriseTagDO::getId));
}
}

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taglibrary/TagLibraryMapper.java

@ -24,7 +24,7 @@ public interface TagLibraryMapper extends BaseMapperX<TagLibraryDO> {
.eqIfPresent(TagLibraryDO::getTagLevel, reqVO.getTagLevel())
.eqIfPresent(TagLibraryDO::getTagType, reqVO.getTagType())
.betweenIfPresent(TagLibraryDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(TagLibraryDO::getId));
.orderByDesc(TagLibraryDO::getSort));
}
}

11
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.enterprise;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper;
import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService;
@ -57,7 +58,12 @@ public class EnterpriseServiceImpl implements EnterpriseService {
if (enterpriseDO != null) {
throw exception(ENTERPRISE_EXISTS);
}
//专管员所属部门
// final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId());
// if (user == null) {
// throw exception(USER_NOT_EXISTS);
// }
// createReqVO.setDeptId(user.getDeptId());
// 插入
EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class);
enterpriseMapper.insert(enterprise);
@ -68,7 +74,7 @@ public class EnterpriseServiceImpl implements EnterpriseService {
enterpriseAuditLogDO.setAudit(1);
enterpriseAuditLogMapper.insert(enterpriseAuditLogDO);
if (createReqVO.getFileIds().length > 0) {
if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) {
FileInfoDO fileInfoDO = new FileInfoDO();
fileInfoDO.setDictData(1l); //文件类型
@ -95,7 +101,6 @@ public class EnterpriseServiceImpl implements EnterpriseService {
fileInfoMapper.delete(wrapper);
}
for (Long fileId : updateReqVO.getFileIds()) {
FileInfoDO fileInfoDO = new FileInfoDO();
fileInfoDO.setDictData(1l); //文件类型

56
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisetag/EnterpriseTagService.java

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.system.service.enterprisetag;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 企业标签 Service 接口
*
* @author 芋道源码
*/
public interface EnterpriseTagService {
/**
* 创建企业标签
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createEnterpriseTag(@Valid EnterpriseTagSaveReqVO createReqVO);
/**
* 更新企业标签
*
* @param updateReqVO 更新信息
*/
void updateEnterpriseTag(@Valid EnterpriseTagSaveReqVO updateReqVO);
/**
* 删除企业标签
*
* @param id 编号
*/
void deleteEnterpriseTag(Long id);
/**
* 获得企业标签
*
* @param id 编号
* @return 企业标签
*/
EnterpriseTagDO getEnterpriseTag(Long id);
/**
* 获得企业标签分页
*
* @param pageReqVO 分页查询
* @return 企业标签分页
*/
PageResult<EnterpriseTagDO> getEnterpriseTagPage(EnterpriseTagPageReqVO pageReqVO);
}

75
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisetag/EnterpriseTagServiceImpl.java

@ -0,0 +1,75 @@
package cn.iocoder.yudao.module.system.service.enterprisetag;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisetag.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 企业标签 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class EnterpriseTagServiceImpl implements EnterpriseTagService {
@Resource
private EnterpriseTagMapper enterpriseTagMapper;
@Override
public Long createEnterpriseTag(EnterpriseTagSaveReqVO createReqVO) {
// 插入
EnterpriseTagDO enterpriseTag = BeanUtils.toBean(createReqVO, EnterpriseTagDO.class);
enterpriseTagMapper.insert(enterpriseTag);
// 返回
return enterpriseTag.getId();
}
@Override
public void updateEnterpriseTag(EnterpriseTagSaveReqVO updateReqVO) {
// 校验存在
validateEnterpriseTagExists(updateReqVO.getId());
// 更新
EnterpriseTagDO updateObj = BeanUtils.toBean(updateReqVO, EnterpriseTagDO.class);
enterpriseTagMapper.updateById(updateObj);
}
@Override
public void deleteEnterpriseTag(Long id) {
// 校验存在
validateEnterpriseTagExists(id);
// 删除
enterpriseTagMapper.deleteById(id);
}
private void validateEnterpriseTagExists(Long id) {
if (enterpriseTagMapper.selectById(id) == null) {
throw exception(USER_MOBILE_EXISTS);
}
}
@Override
public EnterpriseTagDO getEnterpriseTag(Long id) {
return enterpriseTagMapper.selectById(id);
}
@Override
public PageResult<EnterpriseTagDO> getEnterpriseTagPage(EnterpriseTagPageReqVO pageReqVO) {
return enterpriseTagMapper.selectPage(pageReqVO);
}
}
Loading…
Cancel
Save