Skip to content

Commit 65c466a

Browse files
committed
2 parents 75522a1 + d48507a commit 65c466a

File tree

16 files changed

+536
-46
lines changed

16 files changed

+536
-46
lines changed

README.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[中文](./README.md) | English
1+
[中文](./README.md) | English | [日本語](./README.ja-JP.md)
22

33
![JEECG](https://jeecgos.oss-cn-beijing.aliyuncs.com/files/logov3.png "JeecgBoot低代码开发平台")
44

@@ -456,4 +456,4 @@ AI Chat Assistant
456456

457457
If so, buy the author a cup of coffee ☺
458458

459-
![](https://static.oschina.net/uploads/img/201903/08155608_0EFX.png)
459+
![](https://static.oschina.net/uploads/img/201903/08155608_0EFX.png)

README.ja-JP.md

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
中文 | [English](./README.en-US.md)
1+
中文 | [English](./README.en-US.md) | [日本語](./README.ja-JP.md)
22

33
JeecgBoot AI低代码平台
44
===============
@@ -594,4 +594,4 @@ AI写文章
594594

595595
如果觉得还不错,请作者喝杯咖啡吧 ☺
596596

597-
![](https://static.oschina.net/uploads/img/201903/08155608_0EFX.png)
597+
![](https://static.oschina.net/uploads/img/201903/08155608_0EFX.png)

jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/document/TikaDocumentParser.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,25 @@ public Document parse(File file) {
7373
AssertUtils.assertNotEmpty("请选择文件", file);
7474
try {
7575
// 用于解析(使用FileInputStream避免file.toPath()在Linux非UTF-8环境下中文文件名报错)
76-
InputStream isForParsing = new FileInputStream(file);
77-
// 使用 Tika 自动检测 MIME 类型
78-
String fileName = file.getName().toLowerCase();
79-
//后缀
80-
String ext = FilenameUtils.getExtension(fileName);
81-
if (fileName.endsWith(".txt")
82-
|| fileName.endsWith(".md")
83-
|| fileName.endsWith(".pdf")) {
84-
return extractByTika(isForParsing);
85-
//update-begin---author:wangshuai---date:2026-01-09---for:【QQYUN-14261】【AI】AI助手,支持多模态能力- 文档---
86-
} else if (FILE_SUFFIX.contains(ext.toLowerCase())) {
87-
return parseDocExcelPdfUsingApachePoi(file);
88-
//update-end---author:wangshuai---date:2026-01-09---for:【QQYUN-14261】【AI】AI助手,支持多模态能力- 文档---
89-
} else {
90-
throw new IllegalArgumentException("不支持的文件格式: " + FilenameUtils.getExtension(fileName));
76+
try (InputStream isForParsing = new FileInputStream(file)) {
77+
// 使用 Tika 自动检测 MIME 类型
78+
String fileName = file.getName().toLowerCase();
79+
//后缀
80+
String ext = FilenameUtils.getExtension(fileName);
81+
if (fileName.endsWith(".txt")
82+
|| fileName.endsWith(".md")
83+
|| fileName.endsWith(".pdf")) {
84+
return extractByTika(isForParsing);
85+
//update-begin---author:wangshuai---date:2026-01-09---for:【QQYUN-14261】【AI】AI助手,支持多模态能力- 文档---
86+
} else if (FILE_SUFFIX.contains(ext.toLowerCase())) {
87+
return parseDocExcelPdfUsingApachePoi(file);
88+
//update-end---author:wangshuai---date:2026-01-09---for:【QQYUN-14261】【AI】AI助手,支持多模态能力- 文档---
89+
} else {
90+
throw new IllegalArgumentException("不支持的文件格式: " + FilenameUtils.getExtension(fileName));
91+
}
92+
} catch (IOException e) {
93+
throw new RuntimeException(e);
9194
}
92-
} catch (IOException e) {
93-
throw new RuntimeException(e);
9495
}
9596
}
9697

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-account/src/main/java/org/jeecg/modules/test/seata/account/controller/SeataAccountController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.jeecg.modules.test.seata.account.controller;
22

33
import lombok.extern.slf4j.Slf4j;
4+
import org.jeecg.common.api.vo.Result;
45
import org.jeecg.modules.test.seata.account.service.SeataAccountService;
56
import org.springframework.beans.factory.annotation.Autowired;
67
import org.springframework.web.bind.annotation.PostMapping;
@@ -20,7 +21,7 @@ public class SeataAccountController {
2021
private SeataAccountService accountService;
2122

2223
@PostMapping("/reduceBalance")
23-
public void reduceBalance(Long userId, BigDecimal amount) {
24-
accountService.reduceBalance(userId, amount);
24+
public Result<?> reduceBalance(Long userId, BigDecimal amount) {
25+
return accountService.reduceBalance(userId, amount);
2526
}
2627
}

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-account/src/main/java/org/jeecg/modules/test/seata/account/service/SeataAccountService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.jeecg.modules.test.seata.account.service;
22

3+
import org.jeecg.common.api.vo.Result;
4+
35
import java.math.BigDecimal;
46

57
/**
@@ -14,5 +16,5 @@ public interface SeataAccountService {
1416
* @param userId 用户 ID
1517
* @param amount 扣减金额
1618
*/
17-
void reduceBalance(Long userId, BigDecimal amount);
19+
Result<?> reduceBalance(Long userId, BigDecimal amount);
1820
}

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-account/src/main/java/org/jeecg/modules/test/seata/account/service/impl/SeataAccountServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io.seata.core.context.RootContext;
66
import lombok.extern.slf4j.Slf4j;
77

8+
import org.jeecg.common.api.vo.Result;
89
import org.jeecg.modules.test.seata.account.entity.SeataAccount;
910
import org.jeecg.modules.test.seata.account.mapper.SeataAccountMapper;
1011
import org.jeecg.modules.test.seata.account.service.SeataAccountService;
@@ -34,7 +35,7 @@ public class SeataAccountServiceImpl implements SeataAccountService {
3435
@DS("account")
3536
@Override
3637
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
37-
public void reduceBalance(Long userId, BigDecimal amount) {
38+
public Result<?> reduceBalance(Long userId, BigDecimal amount) {
3839
log.info("xid:"+ RootContext.getXID());
3940
log.info("=============ACCOUNT START=================");
4041
SeataAccount account = accountMapper.selectById(userId);
@@ -44,13 +45,14 @@ public void reduceBalance(Long userId, BigDecimal amount) {
4445

4546
if (balance.compareTo(amount)==-1) {
4647
log.warn("用户 {} 余额不足,当前余额:{}", userId, balance);
47-
throw new RuntimeException("余额不足");
48+
return Result.error("余额不足");
4849
}
4950
log.info("开始扣减用户 {} 余额", userId);
5051
BigDecimal currentBalance = account.getBalance().subtract(amount);
5152
account.setBalance(currentBalance);
5253
accountMapper.updateById(account);
5354
log.info("扣减用户 {} 余额成功,扣减后用户账户余额为{}", userId, currentBalance);
5455
log.info("=============ACCOUNT END=================");
56+
return Result.OK();
5557
}
5658
}

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-account/src/main/resources/application.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ spring:
44
data:
55
redis:
66
##redis 单机环境配置
7-
host: localhost
7+
host: jeecg-boot-redis
88
port: 6379
99
database: 0
1010
password:
@@ -22,15 +22,15 @@ spring:
2222
autoconfigure:
2323
exclude: com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration
2424
datasource:
25-
url: jdbc:mysql://127.0.0.1:3306/jeecg_account?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
25+
url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg_account?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
2626
username: root
2727
password: root
2828
driver-class-name: com.mysql.cj.jdbc.Driver
2929
sql:
3030
init:
3131
schema-locations: classpath:sql/schema-account.sql
3232
seata:
33-
enable-auto-data-source-proxy: false
33+
enable-auto-data-source-proxy: true
3434
service:
3535
grouplist:
3636
default: 127.0.0.1:8091

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-order/src/main/java/org/jeecg/modules/test/seata/order/feign/AccountClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jeecg.modules.test.seata.order.feign;
22

3+
import org.jeecg.common.api.vo.Result;
34
import org.springframework.cloud.openfeign.FeignClient;
45
import org.springframework.web.bind.annotation.PostMapping;
56
import org.springframework.web.bind.annotation.RequestParam;
@@ -19,5 +20,5 @@ public interface AccountClient {
1920
* @return
2021
*/
2122
@PostMapping("/test/seata/account/reduceBalance")
22-
String reduceBalance(@RequestParam("userId") Long userId, @RequestParam("amount") BigDecimal amount);
23+
Result<?> reduceBalance(@RequestParam("userId") Long userId, @RequestParam("amount") BigDecimal amount);
2324
}

jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-test/jeecg-cloud-test-seata/jeecg-cloud-test-seata-order/src/main/java/org/jeecg/modules/test/seata/order/feign/ProductClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jeecg.modules.test.seata.order.feign;
22

3+
import org.jeecg.common.api.vo.Result;
34
import org.springframework.cloud.openfeign.FeignClient;
45
import org.springframework.web.bind.annotation.PostMapping;
56
import org.springframework.web.bind.annotation.RequestParam;
@@ -21,5 +22,5 @@ public interface ProductClient {
2122
* @return
2223
*/
2324
@PostMapping("/test/seata/product/reduceStock")
24-
BigDecimal reduceStock(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);
25+
Result<BigDecimal> reduceStock(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);
2526
}

0 commit comments

Comments
 (0)