From c13e5e8e54af736093e2f113bd8a2319608e2bf0 Mon Sep 17 00:00:00 2001
From: yedejiamingshi <540057894@qq.com>
Date: Wed, 12 Feb 2025 10:04:17 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=2002.12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/.gitignore | 8 -
.idea/compiler.xml | 66 -------
.idea/encodings.xml | 121 ------------
.idea/jarRepositories.xml | 25 ---
.idea/misc.xml | 12 --
.idea/uiDesigner.xml | 124 -------------
.idea/vcs.xml | 6 -
.../businessinfo/dto/BusinessInfoRespDTO.java | 4 -
.../basic/api/redis/dto/BusinessInfoDTO.java | 5 -
.../businessinfo/BusinessInfoController.java | 12 --
.../vo/BusinessInfoCreateReqVO.java | 3 -
.../businessinfo/vo/BusinessInfoRespVO.java | 3 -
.../vo/BusinessInfoUpdateReqVO.java | 3 -
.../businessinfo/BusinessInfoDO.java | 11 +-
.../rpc/config/RpcConfiguration.java | 2 -
.../businessinfo/BusinessInfoService.java | 7 -
.../businessinfo/BusinessInfoServiceImpl.java | 38 +---
.../api/businessrule/BusinessRuleApi.java | 33 ----
.../businessrule/dto/BusinessRuleRespDTO.java | 37 ----
.../api/businessrule/businessRuleApiImpl.java | 43 -----
.../businessrule/BusinessRuleController.java | 106 -----------
.../businessrule/vo/BusinessRuleBaseVO.java | 33 ----
.../vo/BusinessRuleCreateReqVO.java | 14 --
.../businessrule/vo/BusinessRuleExcelVO.java | 41 -----
.../vo/BusinessRuleExportReqVO.java | 36 ----
.../vo/BusinessRulePageReqVO.java | 38 ----
.../businessrule/vo/BusinessRuleRespVO.java | 20 --
.../vo/BusinessRuleUpdateReqVO.java | 18 --
.../GenerateRecordController.java | 2 +-
.../vo/GenerateRecordCreateReqVO.java | 11 +-
.../businessrule/BusinessRuleConvert.java | 34 ----
.../businessrule/BusinessRuleDO.java | 53 ------
.../businessrule/BusinessRuleMapper.java | 44 -----
.../businessrule/BusinessRuleService.java | 77 --------
.../businessrule/BusinessRuleServiceImpl.java | 173 ------------------
.../GenerateRecordServiceImpl.java | 50 +----
.../businessrule/BusinessRuleMapper.xml | 12 --
.../BusinessRuleServiceImplTest.java | 152 ---------------
.../admin/envdata/vo/EnvDataBaseVO.java | 14 +-
.../admin/envdata/vo/EnvDataPageReqVO.java | 13 +-
.../dal/dataobject/envdata/EnvDataDO.java | 15 +-
.../mapper/envdata/EnvDataMapper.xml | 9 +-
.../permission/PermissionServiceImpl.java | 4 -
43 files changed, 35 insertions(+), 1497 deletions(-)
delete mode 100644 .idea/.gitignore
delete mode 100644 .idea/compiler.xml
delete mode 100644 .idea/encodings.xml
delete mode 100644 .idea/jarRepositories.xml
delete mode 100644 .idea/misc.xml
delete mode 100644 .idea/uiDesigner.xml
delete mode 100644 .idea/vcs.xml
delete mode 100644 yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/BusinessRuleApi.java
delete mode 100644 yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/dto/BusinessRuleRespDTO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/businessRuleApiImpl.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/BusinessRuleController.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleBaseVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleCreateReqVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExcelVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExportReqVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRulePageReqVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleRespVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleUpdateReqVO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/convert/businessrule/BusinessRuleConvert.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/dataobject/businessrule/BusinessRuleDO.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/mysql/businessrule/BusinessRuleMapper.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleService.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImpl.java
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml
delete mode 100644 yudao-module-identity/yudao-module-identity-biz/src/test/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImplTest.java
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 35410ca..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# 默认忽略的文件
-/shelf/
-/workspace.xml
-# 基于编辑器的 HTTP 客户端请求
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 4fd4cee..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index a9b6425..0000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index 551526c..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index d5cd614..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index 2b63946..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/businessinfo/dto/BusinessInfoRespDTO.java b/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/businessinfo/dto/BusinessInfoRespDTO.java
index 23c7062..80ff78b 100644
--- a/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/businessinfo/dto/BusinessInfoRespDTO.java
+++ b/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/businessinfo/dto/BusinessInfoRespDTO.java
@@ -20,10 +20,6 @@ public class BusinessInfoRespDTO {
* 商户code
*/
private String businessId;
- /**
- * 溯源码编码规则ID
- */
- private Long codeRuleId;
/**
* 所属行政区,例如福建省/福州市/鼓楼区
*/
diff --git a/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/redis/dto/BusinessInfoDTO.java b/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/redis/dto/BusinessInfoDTO.java
index 1d1f351..8204d1d 100644
--- a/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/redis/dto/BusinessInfoDTO.java
+++ b/yudao-module-basic/yudao-module-basic-api/src/main/java/cn/iocoder/yudao/module/basic/api/redis/dto/BusinessInfoDTO.java
@@ -38,11 +38,6 @@ public class BusinessInfoDTO {
*/
@ApiModelProperty(value = "商户编码")
private String businessId;
- /**
- * 溯源码编码规则ID
- */
- @ApiModelProperty(value = "溯源码编码规则ID")
- private Long codeRuleId;
/**
* 所属行政区,例如福建省/福州市/鼓楼区
*/
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/BusinessInfoController.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/BusinessInfoController.java
index c88f7a6..676f59e 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/BusinessInfoController.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/BusinessInfoController.java
@@ -89,16 +89,4 @@ public class BusinessInfoController {
BusinessInfoDO businessInfoByBusinessId = businessInfoService.getBusinessInfoByBusinessId(businessId);
return success(BusinessInfoConvert.INSTANCE.convert(businessInfoByBusinessId));
}
-
- @PutMapping("/setDefaultRuleCode")
- @ApiOperation("设置默认码规则")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "codeId", value = "码规则编号", required = true, example = "1024", dataTypeClass = Long.class),
- @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
- })
- @PreAuthorize("@ss.hasPermission('basic:business-info:update')")
- public CommonResult setDefaultRuleCode(@RequestParam("id") Long id,@RequestParam("codeId") Long codeId) {
- businessInfoService.setDefaultRuleCode(id,codeId);
- return success(true);
- }
}
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoCreateReqVO.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoCreateReqVO.java
index 9336629..f84f7d4 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoCreateReqVO.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoCreateReqVO.java
@@ -14,9 +14,6 @@ public class BusinessInfoCreateReqVO extends BusinessInfoBaseVO {
@ApiModelProperty(value = "商户code")
private String businessId;
- @ApiModelProperty(value = "溯源码编码规则ID")
- private Long codeRuleId;
-
@ApiModelProperty(value = "认证状态", example = "0")
private byte verifyState;
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoRespVO.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoRespVO.java
index 8fe4285..9b336b9 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoRespVO.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoRespVO.java
@@ -15,9 +15,6 @@ public class BusinessInfoRespVO extends BusinessInfoBaseVO {
@ApiModelProperty(value = "商户code", required = true)
private String businessId;
- @ApiModelProperty(value = "溯源码编码规则ID")
- private Long codeRuleId;
-
@ApiModelProperty(value = "认证状态", example = "0")
private byte verifyState;
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoUpdateReqVO.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoUpdateReqVO.java
index 57fef60..480bb9b 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoUpdateReqVO.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/controller/admin/businessinfo/vo/BusinessInfoUpdateReqVO.java
@@ -19,9 +19,6 @@ public class BusinessInfoUpdateReqVO extends BusinessInfoBaseVO {
@NotNull(message = "商户code不能为空")
private String businessId;
- @ApiModelProperty(value = "溯源码编码规则ID")
- private Long codeRuleId;
-
@ApiModelProperty(value = "所属行政区,例如福建省/福州市/鼓楼区")
private String area;
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/dal/dataobject/businessinfo/BusinessInfoDO.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/dal/dataobject/businessinfo/BusinessInfoDO.java
index a23c9e4..9f1dcd5 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/dal/dataobject/businessinfo/BusinessInfoDO.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/dal/dataobject/businessinfo/BusinessInfoDO.java
@@ -1,9 +1,10 @@
package cn.iocoder.yudao.module.basic.dal.dataobject.businessinfo;
-import lombok.*;
-import java.util.*;
-import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
/**
* 商户 DO
@@ -37,10 +38,6 @@ public class BusinessInfoDO extends BaseDO {
* 商户code
*/
private String businessId;
- /**
- * 溯源码编码规则ID
- */
- private Long codeRuleId;
/**
* 所属行政区,例如福建省/福州市/鼓楼区
*/
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/framework/rpc/config/RpcConfiguration.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/framework/rpc/config/RpcConfiguration.java
index 491fe33..79f5767 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/framework/rpc/config/RpcConfiguration.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/framework/rpc/config/RpcConfiguration.java
@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.basic.framework.rpc.config;
import cn.iocoder.yudao.module.configure.api.uniTemplate.UniTemplateApi;
import cn.iocoder.yudao.module.flow.api.outbound.OutboundApi;
-import cn.iocoder.yudao.module.identity.api.businessrule.BusinessRuleApi;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.product.api.harvestbatch.HarvestBatchApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
@@ -10,7 +9,6 @@ import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@EnableFeignClients(clients = {
- BusinessRuleApi.class,
FileApi.class,
UniTemplateApi.class,
OutboundApi.class,
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoService.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoService.java
index b3ae667..692221c 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoService.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoService.java
@@ -74,11 +74,4 @@ public interface BusinessInfoService {
*/
BusinessInfoDO getBusinessInfoByBusinessId(String businessId);
- /**
- * 设置默认码规则
- * @param id 编号
- * @param codeId 码规则编号
- * @return
- */
- void setDefaultRuleCode(Long id,Long codeId);
}
diff --git a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoServiceImpl.java b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoServiceImpl.java
index 5ec5781..9730a03 100644
--- a/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoServiceImpl.java
+++ b/yudao-module-basic/yudao-module-basic-biz/src/main/java/cn/iocoder/yudao/module/basic/service/businessinfo/BusinessInfoServiceImpl.java
@@ -12,10 +12,7 @@ import cn.iocoder.yudao.module.basic.dal.dataobject.businessinfo.BusinessInfoDO;
import cn.iocoder.yudao.module.basic.dal.mysql.businessinfo.BusinessInfoMapper;
import cn.iocoder.yudao.module.basic.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.configure.api.uniTemplate.UniTemplateApi;
-import cn.iocoder.yudao.module.identity.api.businessrule.BusinessRuleApi;
-import cn.iocoder.yudao.module.identity.api.businessrule.dto.BusinessRuleRespDTO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -39,9 +36,6 @@ public class BusinessInfoServiceImpl implements BusinessInfoService {
@Resource
private BusinessInfoMapper businessInfoMapper;
- @Resource
- private BusinessRuleApi businessRuleApi;
-
@Resource
private UniTemplateApi uniTemplateApi;
@@ -63,24 +57,8 @@ public class BusinessInfoServiceImpl implements BusinessInfoService {
BusinessInfoDO businessInfo = BusinessInfoConvert.INSTANCE.convert(createReqVO);
businessInfo.setBusinessId(CodeEnum.BUSINESS_CODE.getCode());
businessInfo.setVerifyState((byte) 0);
- try {
- // 创建码规则信息
- BusinessRuleRespDTO businessRule = new BusinessRuleRespDTO();
- // 创建码规则信息
- businessRule.setBusinessId(businessInfo.getBusinessId());
- businessRule.setBusinessName(businessInfo.getBusinessName());
- businessRule.setCodeType(0);
- Long codeRuleId = businessRuleApi.createBusinessRule(businessRule).getData();
- if (codeRuleId.equals((long) 0)) {
- throw exception(BUSINESS_RULE_INIT_FAIL_CREATE);
- }
- businessInfo.setCodeRuleId(codeRuleId);
-
- businessInfoMapper.insert(businessInfo);
- } catch (Exception e) {
- e.printStackTrace();
- throw exception(BUSINESS_INFO_FAIL_CREATE);
- }
+
+ businessInfoMapper.insert(businessInfo);
redisUtil.updateBusinessInfoRedis(businessInfo.getId(), BusinessInfoConvert.INSTANCE.convertToDTO(businessInfo));
// 返回
@@ -157,18 +135,6 @@ public class BusinessInfoServiceImpl implements BusinessInfoService {
return businessInfoMapper.selectOne(queryWrapper);
}
- /**
- * 设置默认码规则
- *
- * @param id 编号
- * @param codeId 码规则编号
- * @return
- */
- @Override
- public void setDefaultRuleCode(Long id, Long codeId) {
- businessInfoMapper.update(new BusinessInfoDO().setCodeRuleId(codeId), new UpdateWrapper().eq("id", id));
- }
-
private void validateBusinessNameExists(String businessName) {
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq("business_name", businessName);
diff --git a/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/BusinessRuleApi.java b/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/BusinessRuleApi.java
deleted file mode 100644
index 44c93f6..0000000
--- a/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/BusinessRuleApi.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package cn.iocoder.yudao.module.identity.api.businessrule;
-
-
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
-import cn.iocoder.yudao.module.identity.api.businessrule.dto.BusinessRuleRespDTO;
-import cn.iocoder.yudao.module.identity.enums.ApiConstants;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-
-import javax.validation.Valid;
-
-@FeignClient(name = ApiConstants.NAME)
-@Api(tags = "RPC 服务 - 码规则")
-public interface BusinessRuleApi {
- String PREFIX = ApiConstants.CONST + "/business-rule";
-
- @PostMapping(PREFIX + "/create")
- @ApiOperation("创建码规则")
- @OperateLog(enable = false) // 不记录操作日志
- CommonResult createBusinessRule(@Valid @RequestBody BusinessRuleRespDTO businessRule);
-
- @PostMapping(PREFIX + "/delBusinessRule")
- @ApiOperation("删除码规则")
- @ApiImplicitParam(name = "codeRuleId", value = "码规则ID", required = true, example = "1", dataTypeClass = Long.class)
- @OperateLog(enable = false) // 不记录操作日志
- CommonResult delBusinessRule(Long codeRuleId);
-}
diff --git a/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/dto/BusinessRuleRespDTO.java b/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/dto/BusinessRuleRespDTO.java
deleted file mode 100644
index 78a1a85..0000000
--- a/yudao-module-identity/yudao-module-identity-api/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/dto/BusinessRuleRespDTO.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package cn.iocoder.yudao.module.identity.api.businessrule.dto;
-
-import lombok.Data;
-
-@Data
-public class BusinessRuleRespDTO {
-
- /**
- * businessId 商户id
- */
- private String businessId;
-
- /**
- * businessName 商户名称
- */
- private String businessName;
-
- /**
- * codeRuleId 溯源码id
- */
- private String codeRuleId;
-
- /**
- * codeRuleName 码规则名称
- */
- private String codeRuleName;
-
- /**
- * codeType 码类型 :0:普通码 1:明暗码
- */
- private Integer codeType;
-
- /**
- * 码规则 codeRuleFormat
- */
- private String codeRuleFormat;
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/businessRuleApiImpl.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/businessRuleApiImpl.java
deleted file mode 100644
index 26c09c0..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/api/businessrule/businessRuleApiImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package cn.iocoder.yudao.module.identity.api.businessrule;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.module.identity.api.businessrule.dto.BusinessRuleRespDTO;
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.BusinessRuleCreateReqVO;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import cn.iocoder.yudao.module.identity.service.businessrule.BusinessRuleService;
-import cn.iocoder.yudao.module.system.enums.ApiConstants;
-import org.apache.dubbo.config.annotation.DubboService;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import javax.validation.Valid;
-
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-
-
-@RestController // 提供 RESTful API 接口,给 Feign 调用
-@DubboService(version = ApiConstants.VERSION) // 提供 Dubbo RPC 接口,给 Dubbo Consumer 调用
-@Validated
-public class businessRuleApiImpl implements BusinessRuleApi {
-
- @Resource
- private BusinessRuleService businessRuleService;
-
- @Override
- @Transactional
- public CommonResult createBusinessRule(@Valid BusinessRuleRespDTO businessRule) {
- // BeanUtils.copyProperties(businessRule);
- BusinessRuleCreateReqVO businessRuleCreateReqVO = new BusinessRuleCreateReqVO();
- BeanUtil.copyProperties(businessRule, businessRuleCreateReqVO);
- return CommonResult.success(businessRuleService.createBusinessRule(businessRuleCreateReqVO));
- }
-
- @Override
- public CommonResult delBusinessRule(Long codeRuleId) {
- businessRuleService.deleteBusinessRule(codeRuleId);
- return success(true);
- }
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/BusinessRuleController.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/BusinessRuleController.java
deleted file mode 100644
index 38ec3ae..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/BusinessRuleController.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule;
-
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.*;
-
-import javax.validation.constraints.*;
-import javax.validation.*;
-import javax.servlet.http.*;
-import java.util.*;
-import java.io.IOException;
-
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-
-import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
-
-import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
-import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
-
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import cn.iocoder.yudao.module.identity.convert.businessrule.BusinessRuleConvert;
-import cn.iocoder.yudao.module.identity.service.businessrule.BusinessRuleService;
-
-@Api(tags = "管理后台 - 码规则")
-@RestController
-@RequestMapping("/identity/business-rule")
-@Validated
-public class BusinessRuleController {
-
- @Resource
- private BusinessRuleService businessRuleService;
-
- @PostMapping("/create")
- @ApiOperation("创建码规则")
- @PreAuthorize("@ss.hasPermission('identity:business-rule:create')")
- public CommonResult createBusinessRule(@Valid @RequestBody BusinessRuleCreateReqVO createReqVO) {
- return success(businessRuleService.createBusinessRule(createReqVO));
- }
-
- @PutMapping("/update")
- @ApiOperation("更新码规则")
- @PreAuthorize("@ss.hasPermission('identity:business-rule:update')")
- public CommonResult updateBusinessRule(@Valid @RequestBody BusinessRuleUpdateReqVO updateReqVO) {
- businessRuleService.updateBusinessRule(updateReqVO);
- return success(true);
- }
-
- @DeleteMapping("/delete")
- @ApiOperation("删除码规则")
- @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
- @PreAuthorize("@ss.hasPermission('identity:business-rule:delete')")
- public CommonResult deleteBusinessRule(@RequestParam("id") Long id) {
- businessRuleService.deleteBusinessRule(id);
- return success(true);
- }
-
- @GetMapping("/get")
- @ApiOperation("获得码规则")
- @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
- @PreAuthorize("@ss.hasPermission('identity:business-rule:query')")
- public CommonResult getBusinessRule(@RequestParam("id") Long id) {
- BusinessRuleDO businessRule = businessRuleService.getBusinessRule(id);
- return success(BusinessRuleConvert.INSTANCE.convert(businessRule));
- }
-
- @GetMapping("/list")
- @ApiOperation("获得码规则列表")
- @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
- @PreAuthorize("@ss.hasPermission('identity:business-rule:query')")
- public CommonResult> getBusinessRuleList(@RequestParam("ids") Collection ids) {
- List list = businessRuleService.getBusinessRuleList(ids);
- return success(BusinessRuleConvert.INSTANCE.convertList(list));
- }
-
- @GetMapping("/listByBusinessId")
- @ApiOperation("根据所属商户编码,获得码规则列表")
- @ApiImplicitParam(name = "businessId", value = "所属商户编码", required = true, dataTypeClass = String.class)
- @PreAuthorize("@ss.hasPermission('identity:business-rule:query')")
- public CommonResult> getBusinessRuleListByBusinessId(String businessId) {
- List list = businessRuleService.getBusinessRuleListByBusinessId(businessId);
- return success(BusinessRuleConvert.INSTANCE.convertList(list));
- }
-
- @GetMapping("/page")
- @ApiOperation("获得码规则分页")
- @PreAuthorize("@ss.hasPermission('identity:business-rule:query')")
- public CommonResult> getBusinessRulePage(@Valid BusinessRulePageReqVO pageVO) {
- PageResult pageResult = businessRuleService.getBusinessRulePage(pageVO);
- return success(BusinessRuleConvert.INSTANCE.convertPage(pageResult));
- }
-
- @GetMapping("/getBusinessRuleByBusinessName")
- @ApiOperation("根据商户昵称获取马规则信息")
- @ApiImplicitParam(name = "businessName", value = "商户编码", required = true, example = "1024", dataTypeClass = Long.class)
- @PreAuthorize("@ss.hasPermission('identity:business-rule:query')")
- public CommonResult getBusinessRuleByBusinessName(@RequestParam("businessName") String businessName) {
- BusinessRuleDO businessRuleByBusinessName = businessRuleService.getBusinessRuleByBusinessName(businessName);
- return success(businessRuleByBusinessName);
- }
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleBaseVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleBaseVO.java
deleted file mode 100644
index 426b51c..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleBaseVO.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import javax.validation.constraints.*;
-
-/**
-* 码规则 Base VO,提供给添加、修改、详细的子 VO 使用
-* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
-*/
-@Data
-public class BusinessRuleBaseVO {
-
- @ApiModelProperty(value = "商户id")
- private String businessId;
-
- @ApiModelProperty(value = "商户名称")
- private String businessName;
-
- @ApiModelProperty(value = "溯源码规则标识码")
- private String codeRuleId;
-
- @ApiModelProperty(value = "码规则名称")
- private String codeRuleName;
-
- @ApiModelProperty(value = "码类型:0:普通码 1:明暗码")
- private Integer codeType;
-
- @ApiModelProperty(value = "码规则")
- private String codeRuleFormat;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleCreateReqVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleCreateReqVO.java
deleted file mode 100644
index 2f174f6..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleCreateReqVO.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import javax.validation.constraints.*;
-
-@ApiModel("管理后台 - 码规则创建 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BusinessRuleCreateReqVO extends BusinessRuleBaseVO {
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExcelVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExcelVO.java
deleted file mode 100644
index 4546e28..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExcelVO.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-
-import com.alibaba.excel.annotation.ExcelProperty;
-
-/**
- * 码规则 Excel VO
- *
- * @author 芋道源码
- */
-@Data
-public class BusinessRuleExcelVO {
-
- @ExcelProperty("编码")
- private Long id;
-
- @ExcelProperty("商户id")
- private String businessId;
-
- @ExcelProperty("商户名称")
- private String businessName;
-
- @ExcelProperty("溯源码规则标识码")
- private String codeRuleId;
-
- @ExcelProperty("码规则名称")
- private String codeRuleName;
-
- @ExcelProperty("码类型:0:普通码 1:明暗码")
- private Integer codeType;
-
- @ExcelProperty("码规则")
- private String codeRuleFormat;
-
- @ExcelProperty("创建时间")
- private Date createTime;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExportReqVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExportReqVO.java
deleted file mode 100644
index 8d8eb76..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleExportReqVO.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import org.springframework.format.annotation.DateTimeFormat;
-
-@ApiModel(value = "管理后台 - 码规则 Excel 导出 Request VO", description = "参数和 BusinessRulePageReqVO 是一致的")
-@Data
-public class BusinessRuleExportReqVO {
-
- @ApiModelProperty(value = "商户id")
- private String businessId;
-
- @ApiModelProperty(value = "商户名称")
- private String businessName;
-
- @ApiModelProperty(value = "溯源码规则标识码")
- private String codeRuleId;
-
- @ApiModelProperty(value = "码规则名称")
- private String codeRuleName;
-
- @ApiModelProperty(value = "码类型:0:普通码 1:明暗码")
- private Integer codeType;
-
- @ApiModelProperty(value = "码规则")
- private String codeRuleFormat;
-
- @ApiModelProperty(value = "创建时间")
- @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private Date[] createTime;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRulePageReqVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRulePageReqVO.java
deleted file mode 100644
index e2baf79..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRulePageReqVO.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import org.springframework.format.annotation.DateTimeFormat;
-
-@ApiModel("管理后台 - 码规则分页 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BusinessRulePageReqVO extends PageParam {
-
- @ApiModelProperty(value = "商户id")
- private String businessId;
-
- @ApiModelProperty(value = "商户名称")
- private String businessName;
-
- @ApiModelProperty(value = "溯源码规则标识码")
- private String codeRuleId;
-
- @ApiModelProperty(value = "码规则名称")
- private String codeRuleName;
-
- @ApiModelProperty(value = "码类型:0:普通码 1:明暗码")
- private Integer codeType;
-
- @ApiModelProperty(value = "码规则")
- private String codeRuleFormat;
-
- @ApiModelProperty(value = "创建时间")
- @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private Date[] createTime;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleRespVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleRespVO.java
deleted file mode 100644
index 109084e..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleRespVO.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import lombok.*;
-import io.swagger.annotations.*;
-
-import java.util.Date;
-
-@ApiModel("管理后台 - 码规则 Response VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BusinessRuleRespVO extends BusinessRuleBaseVO {
-
- @ApiModelProperty(value = "编码", required = true)
- private Long id;
-
- @ApiModelProperty(value = "创建时间")
- private Date createTime;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleUpdateReqVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleUpdateReqVO.java
deleted file mode 100644
index 7c02643..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/businessrule/vo/BusinessRuleUpdateReqVO.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo;
-
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import javax.validation.constraints.*;
-
-@ApiModel("管理后台 - 码规则更新 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BusinessRuleUpdateReqVO extends BusinessRuleBaseVO {
-
- @ApiModelProperty(value = "编码", required = true)
- @NotNull(message = "编码不能为空")
- private Long id;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/GenerateRecordController.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/GenerateRecordController.java
index 51230fb..6ef0b62 100644
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/GenerateRecordController.java
+++ b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/GenerateRecordController.java
@@ -38,7 +38,7 @@ public class GenerateRecordController {
@PostMapping("/create")
@ApiOperation("创建标识码生成记录")
@PreAuthorize("@ss.hasPermission('identity:generate-record:create')")
- public CommonResult createGenerateRecord(@Valid @RequestBody GenerateRecordCreateReqVO createReqVOe) throws IOException, WriterException {
+ public CommonResult createGenerateRecord(@Valid @RequestBody GenerateRecordCreateReqVO createReqVOe) {
return success(generateRecordService.createGenerateRecord(createReqVOe));
}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/vo/GenerateRecordCreateReqVO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/vo/GenerateRecordCreateReqVO.java
index d058a32..09188cf 100644
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/vo/GenerateRecordCreateReqVO.java
+++ b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/controller/admin/generaterecord/vo/GenerateRecordCreateReqVO.java
@@ -14,14 +14,6 @@ import javax.validation.constraints.NotNull;
@ToString(callSuper = true)
public class GenerateRecordCreateReqVO {
- @ApiModelProperty(value = "码规则id", required = true)
- @NotNull(message = "码规则id不能为空")
- private Long ruleId;
-
- @ApiModelProperty(value = "码类型 0普通码 1明暗码", required = true)
- @NotNull(message = "码类型 0普通码 1明暗码不能为空")
- private Integer codeType;
-
@ApiModelProperty(value = "字符长度", required = true)
@NotNull(message = "字符长度不能为空")
@Max(32)
@@ -34,6 +26,8 @@ public class GenerateRecordCreateReqVO {
@ApiModelProperty(value = "数量", required = true)
@NotNull(message = "数量不能为空")
+ @Min(value = 1, message = "数量的取值范围为1~500")
+ @Max(value = 500, message = "数量的取值范围为1~500")
private Integer codeNum;
@ApiModelProperty(value = "所属商户编码", required = true)
@@ -47,4 +41,5 @@ public class GenerateRecordCreateReqVO {
@ApiModelProperty(value = "经销商编码", required = true)
@NotNull(message = "经销商编码不能为空")
private String dealerId;
+
}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/convert/businessrule/BusinessRuleConvert.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/convert/businessrule/BusinessRuleConvert.java
deleted file mode 100644
index 27a8e4b..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/convert/businessrule/BusinessRuleConvert.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package cn.iocoder.yudao.module.identity.convert.businessrule;
-
-import java.util.*;
-
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-
-/**
- * 码规则 Convert
- *
- * @author 芋道源码
- */
-@Mapper
-public interface BusinessRuleConvert {
-
- BusinessRuleConvert INSTANCE = Mappers.getMapper(BusinessRuleConvert.class);
-
- BusinessRuleDO convert(BusinessRuleCreateReqVO bean);
-
- BusinessRuleDO convert(BusinessRuleUpdateReqVO bean);
-
- BusinessRuleRespVO convert(BusinessRuleDO bean);
-
- List convertList(List list);
-
- PageResult convertPage(PageResult page);
-
- List convertList02(List list);
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/dataobject/businessrule/BusinessRuleDO.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/dataobject/businessrule/BusinessRuleDO.java
deleted file mode 100644
index 5dee99a..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/dataobject/businessrule/BusinessRuleDO.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package cn.iocoder.yudao.module.identity.dal.dataobject.businessrule;
-
-import lombok.*;
-import java.util.*;
-import com.baomidou.mybatisplus.annotation.*;
-import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
-
-/**
- * 码规则 DO
- *
- * @author 芋道源码
- */
-@TableName("identity_business_rule")
-@KeySequence("identity_business_rule_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class BusinessRuleDO extends BaseDO {
-
- /**
- * 编码
- */
- @TableId
- private Long id;
- /**
- * 商户id
- */
- private String businessId;
- /**
- * 商户名称
- */
- private String businessName;
- /**
- * 溯源码规则标识码
- */
- private String codeRuleId;
- /**
- * 码规则名称
- */
- private String codeRuleName;
- /**
- * 码类型:0:普通码 1:明暗码
- */
- private Integer codeType;
- /**
- * 码规则
- */
- private String codeRuleFormat;
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/mysql/businessrule/BusinessRuleMapper.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/mysql/businessrule/BusinessRuleMapper.java
deleted file mode 100644
index 1a3fa85..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/dal/mysql/businessrule/BusinessRuleMapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package cn.iocoder.yudao.module.identity.dal.mysql.businessrule;
-
-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.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import org.apache.ibatis.annotations.Mapper;
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-
-/**
- * 码规则 Mapper
- *
- * @author 芋道源码
- */
-@Mapper
-public interface BusinessRuleMapper extends BaseMapperX {
-
- default PageResult selectPage(BusinessRulePageReqVO reqVO) {
- return selectPage(reqVO, new LambdaQueryWrapperX()
- .eqIfPresent(BusinessRuleDO::getBusinessId, reqVO.getBusinessId())
- .likeIfPresent(BusinessRuleDO::getBusinessName, reqVO.getBusinessName())
- .eqIfPresent(BusinessRuleDO::getCodeRuleId, reqVO.getCodeRuleId())
- .likeIfPresent(BusinessRuleDO::getCodeRuleName, reqVO.getCodeRuleName())
- .eqIfPresent(BusinessRuleDO::getCodeType, reqVO.getCodeType())
- .eqIfPresent(BusinessRuleDO::getCodeRuleFormat, reqVO.getCodeRuleFormat())
- .betweenIfPresent(BusinessRuleDO::getCreateTime, reqVO.getCreateTime())
- .orderByDesc(BusinessRuleDO::getId));
- }
-
- default List selectList(BusinessRuleExportReqVO reqVO) {
- return selectList(new LambdaQueryWrapperX()
- .eqIfPresent(BusinessRuleDO::getBusinessId, reqVO.getBusinessId())
- .likeIfPresent(BusinessRuleDO::getBusinessName, reqVO.getBusinessName())
- .eqIfPresent(BusinessRuleDO::getCodeRuleId, reqVO.getCodeRuleId())
- .likeIfPresent(BusinessRuleDO::getCodeRuleName, reqVO.getCodeRuleName())
- .eqIfPresent(BusinessRuleDO::getCodeType, reqVO.getCodeType())
- .eqIfPresent(BusinessRuleDO::getCodeRuleFormat, reqVO.getCodeRuleFormat())
- .betweenIfPresent(BusinessRuleDO::getCreateTime, reqVO.getCreateTime())
- .orderByDesc(BusinessRuleDO::getId));
- }
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleService.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleService.java
deleted file mode 100644
index 31ce4a6..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleService.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package cn.iocoder.yudao.module.identity.service.businessrule;
-
-import java.util.*;
-import javax.validation.*;
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-
-/**
- * 码规则 Service 接口
- *
- * @author 芋道源码
- */
-public interface BusinessRuleService {
-
- /**
- * 创建码规则
- *
- * @param createReqVO 创建信息
- * @return 编号
- */
- Long createBusinessRule(@Valid BusinessRuleCreateReqVO createReqVO);
-
- /**
- * 更新码规则
- *
- * @param updateReqVO 更新信息
- */
- void updateBusinessRule(@Valid BusinessRuleUpdateReqVO updateReqVO);
-
- /**
- * 删除码规则
- *
- * @param id 编号
- */
- void deleteBusinessRule(Long id);
-
- /**
- * 获得码规则
- *
- * @param id 编号
- * @return 码规则
- */
- BusinessRuleDO getBusinessRule(Long id);
-
- /**
- * 获得码规则列表
- *
- * @param ids 编号
- * @return 码规则列表
- */
- List getBusinessRuleList(Collection ids);
-
- /**
- * 获得码规则列表
- *
- * @param businessId 商户编编码
- * @return 码规则列表
- */
- List getBusinessRuleListByBusinessId(String businessId);
-
- /**
- * 获得码规则分页
- *
- * @param pageReqVO 分页查询
- * @return 码规则分页
- */
- PageResult getBusinessRulePage(BusinessRulePageReqVO pageReqVO);
-
- /**
- * 根据商户昵称获取马规则信息
- * @param businessName
- * @return
- */
- BusinessRuleDO getBusinessRuleByBusinessName(String businessName);
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImpl.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImpl.java
deleted file mode 100644
index 391a725..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package cn.iocoder.yudao.module.identity.service.businessrule;
-
-import cn.iocoder.yudao.framework.common.enums.CodeEnum;
-
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.module.basic.api.businessinfo.BusinessInfoApi;
-import cn.iocoder.yudao.module.basic.api.redis.dto.BusinessInfoDTO;
-import cn.iocoder.yudao.module.identity.api.businessrule.BusinessRuleApi;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
-
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.annotation.Validated;
-
-import java.util.*;
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-
-import cn.iocoder.yudao.module.identity.convert.businessrule.BusinessRuleConvert;
-import cn.iocoder.yudao.module.identity.dal.mysql.businessrule.BusinessRuleMapper;
-
-import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.iocoder.yudao.module.basic.enums.ErrorCodeConstants.BUSINESS_INFO_NOT_EXISTS;
-import static cn.iocoder.yudao.module.identity.enums.ErrorCodeConstants.*;
-
-/**
- * 码规则 Service 实现类
- *
- * @author 芋道源码
- */
-@Service
-@Validated
-public class BusinessRuleServiceImpl implements BusinessRuleService {
-
- @Resource
- private BusinessRuleMapper businessRuleMapper;
-
- @Resource
- private BusinessInfoApi businessInfoApi;
-
-
- /**
- * 创建码规则
- *
- * @param createReqVO 创建信息
- * @return 编号
- */
- @Override
- public Long createBusinessRule(BusinessRuleCreateReqVO createReqVO) {
- // 设置默认值
- String codeRuleName = "默认码规则"; //码规则名称
- //码规则
- String codeRuleFormat = "^https://trace.minipro.yuanhaotest.com/1304120058656711/(.*)";
- //码类型 0:普通类型
- Integer CodeType = 0;
- // 插入 将请求VO转换成DO
- BusinessRuleDO businessRule = new BusinessRuleDO();
- try {
- businessRule = BusinessRuleConvert.INSTANCE.convert(createReqVO);
-
- // 如果请求中的码规则名称为空,则使用默认值
- businessRule.setCodeRuleName(StringUtils.defaultIfBlank(businessRule.getCodeRuleName(), codeRuleName));
- // 如果请求中的码规则为空,则使用默认值
- businessRule.setCodeRuleFormat(StringUtils.defaultIfBlank(businessRule.getCodeRuleFormat(), codeRuleFormat));
- // 如果请求中的码类型为空,则使用默认值
- businessRule.setCodeType(businessRule.getCodeType() == 0 ? businessRule.getCodeType() : CodeType);
- businessRule.setCodeRuleId(CodeEnum.BUSINESS_RULE_CODE.getCode());
-
- // 插入到数据库中
- businessRuleMapper.insert(businessRule);
- }catch (Exception e){
- throw exception(BUSINESS_RULE_CREAT_FAIL);
- }
- // 返回ID
- return businessRule.getId();
-
- }
-
- /**
- * 更新码规则
- *
- * @param updateReqVO 更新信息
- */
- @Override
- public void updateBusinessRule(BusinessRuleUpdateReqVO updateReqVO) {
- // 校验存在
- validateBusinessRuleExists(updateReqVO.getId());
- // 更新
- BusinessRuleDO updateObj = BusinessRuleConvert.INSTANCE.convert(updateReqVO);
- businessRuleMapper.updateById(updateObj);
- }
-
- /**
- * 删除码规则
- *
- * @param id 编号
- */
- @Override
- public void deleteBusinessRule(Long id) {
- // 校验存在
- validateBusinessRuleExists(id);
- // 删除
- businessRuleMapper.deleteById(id);
- }
-
- private void validateBusinessRuleExists(Long id) {
- if (businessRuleMapper.selectById(id) == null) {
- throw exception(BUSINESS_RULE_NOT_EXISTS);
- }
- }
-
- /**
- * 获得码规则
- *
- * @param id 编号
- * @return 码规则
- */
- @Override
- public BusinessRuleDO getBusinessRule(Long id) {
- return businessRuleMapper.selectById(id);
- }
-
- /**
- * 获得码规则列表
- *
- * @param ids 编号
- * @return 码规则列表
- */
- @Override
- public List getBusinessRuleList(Collection ids) {
- return businessRuleMapper.selectBatchIds(ids);
- }
-
- /**
- * 获得码规则列表
- *
- * @param businessId 商户编编码
- * @return 码规则列表
- */
- @Override
- public List getBusinessRuleListByBusinessId(String businessId) {
- return businessRuleMapper.selectList(BusinessRuleDO::getBusinessId,businessId);
- }
-
- /**
- * 获得码规则分页
- *
- * @param pageReqVO 分页查询
- * @return 码规则分页
- */
- @Override
- public PageResult getBusinessRulePage(BusinessRulePageReqVO pageReqVO) {
- return businessRuleMapper.selectPage(pageReqVO);
- }
-
- /**
- * 根据商户ID获取马规则信息
- *
- * @param businessName
- * @return
- */
- @Override
- public BusinessRuleDO getBusinessRuleByBusinessName(String businessName) {
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("business_name", businessName);
- return businessRuleMapper.selectOne(queryWrapper);
- }
-
-}
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/generaterecord/GenerateRecordServiceImpl.java b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/generaterecord/GenerateRecordServiceImpl.java
index cc00cbf..9dcf9f5 100644
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/generaterecord/GenerateRecordServiceImpl.java
+++ b/yudao-module-identity/yudao-module-identity-biz/src/main/java/cn/iocoder/yudao/module/identity/service/generaterecord/GenerateRecordServiceImpl.java
@@ -7,7 +7,6 @@ import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.qrcode.QrCodeUtil;
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
-import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.basic.api.businessinfo.BusinessInfoApi;
@@ -16,15 +15,15 @@ import cn.iocoder.yudao.module.basic.api.dealerinfo.dto.DealerInfoRespDTO;
import cn.iocoder.yudao.module.basic.api.redis.dto.BusinessInfoDTO;
import cn.iocoder.yudao.module.identity.controller.admin.generaterecord.vo.*;
import cn.iocoder.yudao.module.identity.convert.generaterecord.GenerateRecordConvert;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
import cn.iocoder.yudao.module.identity.dal.dataobject.code.CodeDO;
import cn.iocoder.yudao.module.identity.dal.dataobject.generatebatch.GenerateBatchDO;
import cn.iocoder.yudao.module.identity.dal.dataobject.generaterecord.GenerateRecordDO;
-import cn.iocoder.yudao.module.identity.dal.mysql.businessrule.BusinessRuleMapper;
import cn.iocoder.yudao.module.identity.dal.mysql.code.CodeMapper;
import cn.iocoder.yudao.module.identity.dal.mysql.generatebatch.GenerateBatchMapper;
import cn.iocoder.yudao.module.identity.dal.mysql.generaterecord.GenerateRecordMapper;
-import cn.iocoder.yudao.module.identity.enums.*;
+import cn.iocoder.yudao.module.identity.enums.BatchTypeEnums;
+import cn.iocoder.yudao.module.identity.enums.ErrorCodeConstants;
+import cn.iocoder.yudao.module.identity.enums.GenerateRecordStateEnums;
import cn.iocoder.yudao.module.identity.qrcode.QRCodeProperties;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.product.api.harvestbatch.HarvestBatchApi;
@@ -41,7 +40,9 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.identity.enums.ErrorCodeConstants.GENERATE_RECORD_NOT_EXISTS;
@@ -65,9 +66,6 @@ public class GenerateRecordServiceImpl implements GenerateRecordService {
@Resource
private CodeMapper codeMapper;
- @Resource
- private BusinessRuleMapper businessRuleMapper;
-
@Resource
private FileApi fileApi;
@@ -113,31 +111,13 @@ public class GenerateRecordServiceImpl implements GenerateRecordService {
throw ServiceExceptionUtil.exception(cn.iocoder.yudao.module.basic.enums.ErrorCodeConstants.DEALER_INFO_NOT_EXISTS);
}
- // 查询码规则
- BusinessRuleDO businessRule = businessRuleMapper.selectOne(new LambdaQueryWrapperX().eq(BusinessRuleDO::getBusinessId, businessInfo.getBusinessId())
- .eq(BusinessRuleDO::getId, createReqVO.getRuleId()));
- if(businessRule == null) {
- throw ServiceExceptionUtil.exception(ErrorCodeConstants.BUSINESS_RULE_NOT_EXISTS);
- }
-
- List verifyCodes = new ArrayList<>();
List stringList = new ArrayList<>(StrUtils.getRandomStringList(createReqVO.getCharLength(), createReqVO.getCharType(), createReqVO.getCodeNum()));
- if(businessRule.getCodeType().equals(CodeTypeEnums.SECRET_CODE.getCodeType())) {
- // 这里懒得写成静态变量。直接用。 获得6位纯数字作为校验码
- verifyCodes.addAll(StrUtils.getRandomStringList(6, CharTypeEnums.NUMBER.getCharType(), createReqVO.getCodeNum()));
- }
-
ByteArrayOutputStream os = new ByteArrayOutputStream();
String fileUrl;
try {
List bufferedImages = new ArrayList<>();
- for(int i = 0; i < stringList.size(); i++) {
- BufferedImage bufferedImage;
- if(businessRule.getCodeType().equals(CodeTypeEnums.GENERAL_CODE.getCodeType())) {
- bufferedImage = QrCodeUtil.createQrCode(qrCodeProperties.getUrl() + stringList.get(i), stringList.get(i));
- } else {
- bufferedImage = QrCodeUtil.createQrCode(qrCodeProperties.getUrl() + stringList.get(i), verifyCodes.get(i));
- }
+ for (String s : stringList) {
+ BufferedImage bufferedImage = QrCodeUtil.createQrCode(qrCodeProperties.getUrl() + s, s);
bufferedImages.add(bufferedImage);
}
QrCodeUtil.compressQrCodeToZip(bufferedImages, os);
@@ -183,8 +163,6 @@ public class GenerateRecordServiceImpl implements GenerateRecordService {
generateRecord.setFileUrl(fileUrl);
generateRecord.setImageFileUrl(imageFileUrl);
generateRecord.setGenerateRecordId(CodeEnum.CODE_CODE.getCode());
- generateRecord.setRuleId(createReqVO.getRuleId());
- generateRecord.setCodeRuleFormat(businessRule.getCodeRuleFormat());
generateRecord.setOperateUser(adminUser.getNickname());
generateRecord.setOperateUserId(SecurityFrameworkUtils.getLoginUserId());
generateRecord.setBelongBusinessId(businessInfo.getId());
@@ -201,16 +179,10 @@ public class GenerateRecordServiceImpl implements GenerateRecordService {
generateBatchDO.setBatchId(createReqVO.getBatchId());
// 循环生成的二维码 并封装要插入数据库的数据
- for(int i = 0; i < stringList.size(); i++) {
+ for (String s : stringList) {
CodeDO codeDO = new CodeDO();
codeDO.setGenerateRecordId(generateRecord.getGenerateRecordId());
- codeDO.setIdentityCode(stringList.get(i));
- if(businessRule.getCodeType().equals(CodeTypeEnums.SECRET_CODE.getCodeType())) {
- codeDO.setVerfiyCode(verifyCodes.get(i));
- }
- codeDO.setRuleId(businessRule.getId());
- codeDO.setCodeRuleFormat(businessRule.getCodeRuleFormat());
- codeDO.setCodeType(createReqVO.getCodeType());
+ codeDO.setIdentityCode(s);
codeDO.setCharLength(createReqVO.getCharLength());
codeDO.setCharType(createReqVO.getCharType());
codeDO.setBatchId(harvestBatch.getHarvestBatchId());
@@ -241,8 +213,6 @@ public class GenerateRecordServiceImpl implements GenerateRecordService {
/**
* 根据 generateRecordId记录编码查询出该条数据信息
*
- * @param generateRecordId
- * @return
*/
@Override
public GenerateRecordDO getGenerateRecordByRecordId(String generateRecordId) {
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml b/yudao-module-identity/yudao-module-identity-biz/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml
deleted file mode 100644
index 37226ac..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/yudao-module-identity/yudao-module-identity-biz/src/test/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImplTest.java b/yudao-module-identity/yudao-module-identity-biz/src/test/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImplTest.java
deleted file mode 100644
index 94cacbb..0000000
--- a/yudao-module-identity/yudao-module-identity-biz/src/test/java/cn/iocoder/yudao/module/identity/service/businessrule/BusinessRuleServiceImplTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package cn.iocoder.yudao.module.identity.service.businessrule;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.iocoder.yudao.module.identity.controller.admin.businessrule.vo.*;
-import cn.iocoder.yudao.module.identity.dal.dataobject.businessrule.BusinessRuleDO;
-import cn.iocoder.yudao.module.identity.dal.mysql.businessrule.BusinessRuleMapper;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.iocoder.yudao.module.identity.enums.ErrorCodeConstants.*;
-import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
-import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
-import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
-* {@link BusinessRuleServiceImpl} 的单元测试类
-*
-* @author 芋道源码
-*/
-@Import(BusinessRuleServiceImpl.class)
-public class BusinessRuleServiceImplTest extends BaseDbUnitTest {
-
- @Resource
- private BusinessRuleServiceImpl businessRuleService;
-
- @Resource
- private BusinessRuleMapper businessRuleMapper;
-
- @Test
- public void testCreateBusinessRule_success() {
- // 准备参数
- BusinessRuleCreateReqVO reqVO = randomPojo(BusinessRuleCreateReqVO.class);
-
- // 调用
- Long businessRuleId = businessRuleService.createBusinessRule(reqVO);
- // 断言
- assertNotNull(businessRuleId);
- // 校验记录的属性是否正确
- BusinessRuleDO businessRule = businessRuleMapper.selectById(businessRuleId);
- assertPojoEquals(reqVO, businessRule);
- }
-
- @Test
- public void testUpdateBusinessRule_success() {
- // mock 数据
- BusinessRuleDO dbBusinessRule = randomPojo(BusinessRuleDO.class);
- businessRuleMapper.insert(dbBusinessRule);// @Sql: 先插入出一条存在的数据
- // 准备参数
- BusinessRuleUpdateReqVO reqVO = randomPojo(BusinessRuleUpdateReqVO.class, o -> {
- o.setId(dbBusinessRule.getId()); // 设置更新的 ID
- });
-
- // 调用
- businessRuleService.updateBusinessRule(reqVO);
- // 校验是否更新正确
- BusinessRuleDO businessRule = businessRuleMapper.selectById(reqVO.getId()); // 获取最新的
- assertPojoEquals(reqVO, businessRule);
- }
-
- @Test
- public void testUpdateBusinessRule_notExists() {
- // 准备参数
- BusinessRuleUpdateReqVO reqVO = randomPojo(BusinessRuleUpdateReqVO.class);
-
- // 调用, 并断言异常
- assertServiceException(() -> businessRuleService.updateBusinessRule(reqVO), BUSINESS_RULE_NOT_EXISTS);
- }
-
- @Test
- public void testDeleteBusinessRule_success() {
- // mock 数据
- BusinessRuleDO dbBusinessRule = randomPojo(BusinessRuleDO.class);
- businessRuleMapper.insert(dbBusinessRule);// @Sql: 先插入出一条存在的数据
- // 准备参数
- Long id = dbBusinessRule.getId();
-
- // 调用
- businessRuleService.deleteBusinessRule(id);
- // 校验数据不存在了
- assertNull(businessRuleMapper.selectById(id));
- }
-
- @Test
- public void testDeleteBusinessRule_notExists() {
- // 准备参数
- Long id = randomLongId();
-
- // 调用, 并断言异常
- assertServiceException(() -> businessRuleService.deleteBusinessRule(id), BUSINESS_RULE_NOT_EXISTS);
- }
-
- @Test
- @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
- public void testGetBusinessRulePage() {
- // mock 数据
- BusinessRuleDO dbBusinessRule = randomPojo(BusinessRuleDO.class, o -> { // 等会查询到
- o.setBusinessId(null);
- o.setBusinessName(null);
- o.setCodeRuleId(null);
- o.setCodeRuleName(null);
- o.setCodeType(null);
- o.setCodeRuleFormat(null);
- o.setCreateTime(null);
- });
- businessRuleMapper.insert(dbBusinessRule);
- // 测试 businessId 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setBusinessId(null)));
- // 测试 businessName 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setBusinessName(null)));
- // 测试 codeRuleId 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setCodeRuleId(null)));
- // 测试 codeRuleName 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setCodeRuleName(null)));
- // 测试 codeType 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setCodeType(null)));
- // 测试 codeRuleFormat 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setCodeRuleFormat(null)));
- // 测试 createTime 不匹配
- businessRuleMapper.insert(cloneIgnoreId(dbBusinessRule, o -> o.setCreateTime(null)));
- // 准备参数
- BusinessRulePageReqVO reqVO = new BusinessRulePageReqVO();
- reqVO.setBusinessId(null);
- reqVO.setBusinessName(null);
- reqVO.setCodeRuleId(null);
- reqVO.setCodeRuleName(null);
- reqVO.setCodeType(null);
- reqVO.setCodeRuleFormat(null);
-// reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
- // 调用
- PageResult pageResult = businessRuleService.getBusinessRulePage(reqVO);
- // 断言
- assertEquals(1, pageResult.getTotal());
- assertEquals(1, pageResult.getList().size());
- assertPojoEquals(dbBusinessRule, pageResult.getList().get(0));
- }
-}
diff --git a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataBaseVO.java b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataBaseVO.java
index fd63ffb..51d5b8c 100644
--- a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataBaseVO.java
+++ b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataBaseVO.java
@@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.product.controller.admin.envdata.vo;
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import javax.validation.constraints.*;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
/**
* 环境数据 Base VO,提供给添加、修改、详细的子 VO 使用
@@ -18,12 +18,6 @@ public class EnvDataBaseVO {
@ApiModelProperty(value = "环境数据名称")
private String envName;
- @ApiModelProperty(value = "地块/鱼塘/牧场编码")
- private String landId;
-
- @ApiModelProperty(value = "地块名称")
- private String landName;
-
@ApiModelProperty(value = "数据值")
private String value;
diff --git a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataPageReqVO.java b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataPageReqVO.java
index 65e9fda..3df53f6 100644
--- a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataPageReqVO.java
+++ b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/envdata/vo/EnvDataPageReqVO.java
@@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.product.controller.admin.envdata.vo;
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import org.springframework.format.annotation.DateTimeFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
@ApiModel("管理后台 - 环境数据分页 Request VO")
@Data
@@ -16,9 +16,6 @@ public class EnvDataPageReqVO extends PageParam {
@ApiModelProperty(value = "环境类型")
private Long envTypeId;
- @ApiModelProperty(value = "地块名称")
- private String landName;
-
@ApiModelProperty(value = "所属商户id")
private Long belongBusinessId;
diff --git a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/envdata/EnvDataDO.java b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/envdata/EnvDataDO.java
index 034d3ce..208ca85 100644
--- a/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/envdata/EnvDataDO.java
+++ b/yudao-module-product/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/envdata/EnvDataDO.java
@@ -1,9 +1,10 @@
package cn.iocoder.yudao.module.product.dal.dataobject.envdata;
-import lombok.*;
-import java.util.*;
-import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
/**
* 环境数据 DO
@@ -33,14 +34,6 @@ public class EnvDataDO extends BaseDO {
* 环境数据名称
*/
private String envName;
- /**
- * 地块/鱼塘/牧场编码
- */
- private String landId;
- /**
- * 地块名称
- */
- private String landName;
/**
* 数据值
*/
diff --git a/yudao-module-product/yudao-module-product-biz/src/main/resources/mapper/envdata/EnvDataMapper.xml b/yudao-module-product/yudao-module-product-biz/src/main/resources/mapper/envdata/EnvDataMapper.xml
index 10b254e..c19e6c0 100644
--- a/yudao-module-product/yudao-module-product-biz/src/main/resources/mapper/envdata/EnvDataMapper.xml
+++ b/yudao-module-product/yudao-module-product-biz/src/main/resources/mapper/envdata/EnvDataMapper.xml
@@ -15,7 +15,6 @@
LEFT JOIN product_env_type pet ON pet.id = ped.env_type_id
ped.deleted = 0
- and ped.land_name like concat('%',#{pageReqVO.landName},'%') ESCAPE '/'
and ped.env_type_id = #{pageReqVO.envTypeId}
and ped.belong_business_id = #{pageReqVO.belongBusinessId}
@@ -23,14 +22,13 @@