Explorar o código

Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro

# Conflicts:
#	yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm
YunaiV hai 8 meses
pai
achega
7c54204716
Modificáronse 14 ficheiros con 41 adicións e 19 borrados
  1. 5 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java
  2. 1 1
      yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
  3. 6 0
      yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml
  4. 0 3
      yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/DictTypeConstants.java
  5. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java
  6. 7 6
      yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/receivable/CrmReceivableRespVO.java
  7. 1 1
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
  8. 12 0
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java
  9. 1 0
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java
  10. 1 1
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
  11. 1 1
      yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/h2.vm
  12. 2 2
      yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm
  13. 2 2
      yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm
  14. 1 1
      yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCouponPriceCalculator.java

+ 5 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java

@@ -1,9 +1,11 @@
 package cn.iocoder.yudao.framework.ip.core;
 package cn.iocoder.yudao.framework.ip.core;
 
 
 import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
 import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
+import lombok.ToString;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -17,6 +19,7 @@ import java.util.List;
 @Data
 @Data
 @AllArgsConstructor
 @AllArgsConstructor
 @NoArgsConstructor
 @NoArgsConstructor
+@ToString(exclude = {"parent"}) // 参见 https://gitee.com/yudaocode/yudao-cloud-mini/pulls/2 原因
 public class Area {
 public class Area {
 
 
     /**
     /**
@@ -46,10 +49,12 @@ public class Area {
     /**
     /**
      * 父节点
      * 父节点
      */
      */
+    @JsonManagedReference
     private Area parent;
     private Area parent;
     /**
     /**
      * 子节点
      * 子节点
      */
      */
+    @JsonManagedReference
     private List<Area> children;
     private List<Area> children;
 
 
 }
 }

+ 1 - 1
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java

@@ -182,7 +182,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
     // ========== 请求和响应的脱敏逻辑,移除类似 password、token 等敏感字段 ==========
     // ========== 请求和响应的脱敏逻辑,移除类似 password、token 等敏感字段 ==========
 
 
     private static String sanitizeMap(Map<String, ?> map, String[] sanitizeKeys) {
     private static String sanitizeMap(Map<String, ?> map, String[] sanitizeKeys) {
-        if (CollUtil.isNotEmpty(map)) {
+        if (CollUtil.isEmpty(map)) {
             return null;
             return null;
         }
         }
         if (sanitizeKeys != null) {
         if (sanitizeKeys != null) {

+ 6 - 0
yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml

@@ -58,6 +58,12 @@
             <groupId>com.alibaba</groupId>
             <groupId>com.alibaba</groupId>
             <artifactId>dashscope-sdk-java</artifactId>
             <artifactId>dashscope-sdk-java</artifactId>
             <version>2.14.0</version>
             <version>2.14.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-simple</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
 
 
         <!-- Test 测试相关 -->
         <!-- Test 测试相关 -->

+ 0 - 3
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/DictTypeConstants.java

@@ -7,7 +7,4 @@ package cn.iocoder.yudao.module.bpm.enums;
  */
  */
 public interface DictTypeConstants {
 public interface DictTypeConstants {
 
 
-    String TASK_ASSIGN_RULE_TYPE = "bpm_task_assign_rule_type"; // 任务分配规则类型
-    String TASK_ASSIGN_SCRIPT = "bpm_task_assign_script"; // 任务分配自定义脚本
-
 }
 }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java

@@ -135,7 +135,7 @@ public class BpmProcessInstanceController {
                 processDefinitionService.getProcessDefinitionBpmnModel(processInstance.getProcessDefinitionId()));
                 processDefinitionService.getProcessDefinitionBpmnModel(processInstance.getProcessDefinitionId()));
         AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId()));
         AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId()));
         DeptRespDTO dept = null;
         DeptRespDTO dept = null;
-        if (startUser != null) {
+        if (startUser != null && startUser.getDeptId() != null) {
             dept = deptApi.getDept(startUser.getDeptId());
             dept = deptApi.getDept(startUser.getDeptId());
         }
         }
         return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstance(processInstance,
         return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstance(processInstance,

+ 7 - 6
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/receivable/CrmReceivableRespVO.java

@@ -1,6 +1,9 @@
 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.receivable;
 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.receivable;
 
 
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
 import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO;
 import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO;
+import cn.iocoder.yudao.module.crm.enums.DictTypeConstants;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -27,7 +30,8 @@ public class CrmReceivableRespVO {
     private Long planId;
     private Long planId;
 
 
     @Schema(description = "回款方式", example = "2")
     @Schema(description = "回款方式", example = "2")
-    @ExcelProperty("回款方式")
+    @ExcelProperty(value = "回款方式", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.CRM_RECEIVABLE_RETURN_TYPE)
     private Integer returnType;
     private Integer returnType;
 
 
     @Schema(description = "回款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000")
     @Schema(description = "回款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000")
@@ -39,7 +43,6 @@ public class CrmReceivableRespVO {
     private LocalDateTime returnTime;
     private LocalDateTime returnTime;
 
 
     @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
     @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("客户编号")
     private Long customerId;
     private Long customerId;
     @Schema(description = "客户名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "test")
     @Schema(description = "客户名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "test")
     @ExcelProperty("客户名字")
     @ExcelProperty("客户名字")
@@ -49,11 +52,9 @@ public class CrmReceivableRespVO {
     @ExcelProperty("合同编号")
     @ExcelProperty("合同编号")
     private Long contractId;
     private Long contractId;
     @Schema(description = "合同信息")
     @Schema(description = "合同信息")
-    @ExcelProperty("合同信息")
     private CrmContractRespVO contract;
     private CrmContractRespVO contract;
 
 
     @Schema(description = "负责人的用户编号", example = "25682")
     @Schema(description = "负责人的用户编号", example = "25682")
-    @ExcelProperty("负责人的用户编号")
     private Long ownerUserId;
     private Long ownerUserId;
     @Schema(description = "负责人名字", example = "25682")
     @Schema(description = "负责人名字", example = "25682")
     @ExcelProperty("负责人名字")
     @ExcelProperty("负责人名字")
@@ -67,7 +68,8 @@ public class CrmReceivableRespVO {
     private String processInstanceId;
     private String processInstanceId;
 
 
     @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
     @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
-    @ExcelProperty("审批状态")
+    @ExcelProperty(value = "审批状态", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.CRM_AUDIT_STATUS)
     private Integer auditStatus;
     private Integer auditStatus;
 
 
     @Schema(description = "工作流编号", example = "备注")
     @Schema(description = "工作流编号", example = "备注")
@@ -83,7 +85,6 @@ public class CrmReceivableRespVO {
     private LocalDateTime updateTime;
     private LocalDateTime updateTime;
 
 
     @Schema(description = "创建人", example = "25682")
     @Schema(description = "创建人", example = "25682")
-    @ExcelProperty("创建人")
     private String creator;
     private String creator;
     @Schema(description = "创建人名字", example = "test")
     @Schema(description = "创建人名字", example = "test")
     @ExcelProperty("创建人名字")
     @ExcelProperty("创建人名字")

+ 1 - 1
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java

@@ -94,7 +94,7 @@ public class ConfigController {
     @Operation(summary = "导出参数配置")
     @Operation(summary = "导出参数配置")
     @PreAuthorize("@ss.hasPermission('infra:config:export')")
     @PreAuthorize("@ss.hasPermission('infra:config:export')")
     @ApiAccessLog(operateType = EXPORT)
     @ApiAccessLog(operateType = EXPORT)
-    public void exportConfig(@Valid ConfigPageReqVO exportReqVO,
+    public void exportConfig(ConfigPageReqVO exportReqVO,
                              HttpServletResponse response) throws IOException {
                              HttpServletResponse response) throws IOException {
         exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         List<ConfigDO> list = configService.getConfigPage(exportReqVO).getList();
         List<ConfigDO> list = configService.getConfigPage(exportReqVO).getList();

+ 12 - 0
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java

@@ -37,6 +37,7 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> {
                 .region(buildRegion()) // Region
                 .region(buildRegion()) // Region
                 .credentials(config.getAccessKey(), config.getAccessSecret()) // 认证密钥
                 .credentials(config.getAccessKey(), config.getAccessSecret()) // 认证密钥
                 .build();
                 .build();
+        enableVirtualStyleEndpoint();
     }
     }
 
 
     /**
     /**
@@ -86,6 +87,17 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> {
         return null;
         return null;
     }
     }
 
 
+    /**
+     * 开启 VirtualStyle 模式
+     */
+    private void enableVirtualStyleEndpoint() {
+        if (StrUtil.containsAll(config.getEndpoint(),
+                S3FileClientConfig.ENDPOINT_TENCENT, // 腾讯云 https://cloud.tencent.com/document/product/436/41284
+                S3FileClientConfig.ENDPOINT_VOLCES)) { // 火山云 https://www.volcengine.com/docs/6349/1288493
+            client.enableVirtualStyleEndpoint();
+        }
+    }
+
     @Override
     @Override
     public String upload(byte[] content, String path, String type) throws Exception {
     public String upload(byte[] content, String path, String type) throws Exception {
         // 执行上传
         // 执行上传

+ 1 - 0
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java

@@ -20,6 +20,7 @@ public class S3FileClientConfig implements FileClientConfig {
     public static final String ENDPOINT_QINIU = "qiniucs.com";
     public static final String ENDPOINT_QINIU = "qiniucs.com";
     public static final String ENDPOINT_ALIYUN = "aliyuncs.com";
     public static final String ENDPOINT_ALIYUN = "aliyuncs.com";
     public static final String ENDPOINT_TENCENT = "myqcloud.com";
     public static final String ENDPOINT_TENCENT = "myqcloud.com";
+    public static final String ENDPOINT_VOLCES = "volces.com"; // 火山云(字节)
 
 
     /**
     /**
      * 节点地址
      * 节点地址

+ 1 - 1
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java

@@ -58,6 +58,6 @@ public interface ConfigService {
      * @param reqVO 分页条件
      * @param reqVO 分页条件
      * @return 分页列表
      * @return 分页列表
      */
      */
-    PageResult<ConfigDO> getConfigPage(@Valid ConfigPageReqVO reqVO);
+    PageResult<ConfigDO> getConfigPage(ConfigPageReqVO reqVO);
 
 
 }
 }

+ 1 - 1
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/h2.vm

@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
     "${column.columnName}" ${dataType} DEFAULT '',
     "${column.columnName}" ${dataType} DEFAULT '',
     #elseif (${column.columnName} == 'deleted')
     #elseif (${column.columnName} == 'deleted')
     "deleted" bit NOT NULL DEFAULT FALSE,
     "deleted" bit NOT NULL DEFAULT FALSE,
-    #elseif (${column.columnName} == 'tenantId')
+    #elseif (${column.columnName} == 'tenant_id')
     "tenant_id" bigint NOT NULL DEFAULT 0,
     "tenant_id" bigint NOT NULL DEFAULT 0,
     #else
     #else
     "${column.columnName.toLowerCase()}" ${dataType}#if (${column.nullable} == false) NOT NULL#end,
     "${column.columnName.toLowerCase()}" ${dataType}#if (${column.nullable} == false) NOT NULL#end,

+ 2 - 2
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm

@@ -306,8 +306,8 @@ export default {
       await this.#[[$modal]]#.confirm('是否确认导出所有${table.classComment}数据项?');
       await this.#[[$modal]]#.confirm('是否确认导出所有${table.classComment}数据项?');
       try {
       try {
         this.exportLoading = true;
         this.exportLoading = true;
-        const res = await ${simpleClassName}Api.export${simpleClassName}Excel(this.queryParams);
-        this.#[[$]]#download.excel(res, '${table.classComment}.xls');
+        const data = await ${simpleClassName}Api.export${simpleClassName}Excel(this.queryParams);
+        this.#[[$]]#download.excel(data, '${table.classComment}.xls');
       } catch {
       } catch {
       } finally {
       } finally {
         this.exportLoading = false;
         this.exportLoading = false;

+ 2 - 2
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm

@@ -74,7 +74,7 @@
           start-placeholder="开始日期"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           end-placeholder="结束日期"
           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          class="!w-240px"
+          class="!w-220px"
         />
         />
       </el-form-item>
       </el-form-item>
       #end
       #end
@@ -181,7 +181,7 @@
         #end
         #end
       #end
       #end
     #end
     #end
-      <el-table-column label="操作" align="center">
+      <el-table-column label="操作" align="center" min-width="120px">
         <template #default="scope">
         <template #default="scope">
           <el-button
           <el-button
             link
             link

+ 1 - 1
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCouponPriceCalculator.java

@@ -90,7 +90,7 @@ public class TradeCouponPriceCalculator implements TradePriceCalculator {
         if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
         if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
             return coupon.getDiscountPrice();
             return coupon.getDiscountPrice();
         } else if (PromotionDiscountTypeEnum.PERCENT.getType().equals(coupon.getDiscountType())) { // 打折
         } else if (PromotionDiscountTypeEnum.PERCENT.getType().equals(coupon.getDiscountType())) { // 打折
-            int couponPrice = totalPayPrice * coupon.getDiscountPercent() / 100;
+            int couponPrice = totalPayPrice - (totalPayPrice * coupon.getDiscountPercent() / 100);
             return coupon.getDiscountLimitPrice() == null ? couponPrice
             return coupon.getDiscountLimitPrice() == null ? couponPrice
                     : Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
                     : Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
         }
         }