Compare commits
17 Commits
9c1c9f7e35
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d6efb3e4e | ||
|
|
259526b31b | ||
|
|
4cb6d6fd20 | ||
|
|
2640aeb97c | ||
|
|
fa64af2575 | ||
|
|
4789c477d3 | ||
|
|
96cee51d91 | ||
|
|
9ec76929d6 | ||
|
|
0e97ce7b31 | ||
|
|
ea517365d7 | ||
|
|
153d57bac2 | ||
|
|
f0f608e7bb | ||
|
|
59a242f06b | ||
|
|
80231837fd | ||
|
|
99ca24efae | ||
|
|
868b10f107 | ||
|
|
5a0aa3993f |
267
AGENTS.md
Normal file
267
AGENTS.md
Normal file
@@ -0,0 +1,267 @@
|
||||
# AGENTS.md - XGT Project Development Guide
|
||||
|
||||
## Project Overview
|
||||
|
||||
- **Project Name**: XGT (效果图业务系统)
|
||||
- **Framework**: RuoYi-Vue-Plus (Spring Boot 3.3.5 + MyBatis-Plus)
|
||||
- **Java Version**: 22
|
||||
- **Build Tool**: Maven
|
||||
|
||||
---
|
||||
|
||||
## Build Commands
|
||||
|
||||
### Environment Setup
|
||||
|
||||
```bash
|
||||
# Set Java 22 and Maven
|
||||
export JAVA_HOME=/usr/local/opt/amazon-corretto-22.jdk/Contents/Home
|
||||
export PATH=$JAVA_HOME/bin:/usr/local/Cellar/maven/3.9.12/bin:$PATH
|
||||
```
|
||||
|
||||
### Build & Run
|
||||
|
||||
```bash
|
||||
# Compile project
|
||||
mvn clean compile -DskipTests
|
||||
|
||||
# Install to local repository
|
||||
mvn clean install -DskipTests
|
||||
|
||||
# Run application (dev profile)
|
||||
cd ruoyi-admin
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=dev
|
||||
|
||||
# Run with hot reload (DevTools)
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=dev
|
||||
# Press Ctrl+F10 to reload changed classes
|
||||
```
|
||||
|
||||
### Test Commands
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
mvn test
|
||||
|
||||
# Run single test class
|
||||
mvn test -Dtest=DemoUnitTest
|
||||
|
||||
# Run single test method
|
||||
mvn test -Dtest=DemoUnitTest#testTest
|
||||
|
||||
# Run tests with specific tag (based on profile)
|
||||
mvn test -Dgroups=dev
|
||||
|
||||
# Skip tests
|
||||
mvn clean install -DskipTests
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
### EditorConfig
|
||||
|
||||
The project uses `.editorconfig` for consistent formatting:
|
||||
- **Indentation**: 4 spaces for Java, 2 spaces for YAML/JSON
|
||||
- **Charset**: UTF-8
|
||||
- **Line endings**: LF
|
||||
- **Trailing whitespace**: Trimmed
|
||||
|
||||
### Java Conventions
|
||||
|
||||
#### Package & Import Organization
|
||||
|
||||
```java
|
||||
// 1. Package declaration
|
||||
package org.dromara.web.controller;
|
||||
|
||||
// 2. Third-party imports (alphabetical)
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
// 3. Spring imports
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
// 4. Project common imports
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
|
||||
// 5. Module imports
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.work.domain.TpOrder;
|
||||
|
||||
// 6. Java standard library
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
```
|
||||
|
||||
#### Naming Conventions
|
||||
|
||||
| Element | Convention | Example |
|
||||
|---------|------------|---------|
|
||||
| Packages | lowercase | `org.dromara.work.service` |
|
||||
| Classes | PascalCase | `IndexController`, `TpOrderService` |
|
||||
| Methods | camelCase | `queryPageList()`, `selectById()` |
|
||||
| Variables | camelCase | `loginUser`, `pageQuery` |
|
||||
| Constants | UPPER_SNAKE_CASE | `MAX_RETRY_COUNT`, `DEFAULT_PAGE_SIZE` |
|
||||
| BO/VO/DAO | PascalCase + suffix | `SysUserBo`, `TpOrderVo` |
|
||||
|
||||
#### Class Structure
|
||||
|
||||
```java
|
||||
/**
|
||||
* Class description
|
||||
*
|
||||
* @author AuthorName
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/path")
|
||||
public class ExampleController {
|
||||
|
||||
// 1. Static constants (if any)
|
||||
private static final String PREFIX = "prefix:";
|
||||
|
||||
// 2. Dependencies (private final)
|
||||
private final UserService userService;
|
||||
private final OrderService orderService;
|
||||
|
||||
// 3. Public methods (API endpoints)
|
||||
@GetMapping("/list")
|
||||
public R<TableDataInfo<Vo>> list(Bo bo, PageQuery query) {
|
||||
return R.ok(service.queryPageList(bo, query));
|
||||
}
|
||||
|
||||
// 4. Private methods
|
||||
private void validateParams(Bo bo) {
|
||||
// validation logic
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Error Handling
|
||||
|
||||
```java
|
||||
// Use R.fail() for business errors
|
||||
return R.fail("Error message");
|
||||
|
||||
// Use try-catch for external calls
|
||||
try {
|
||||
result = externalService.call();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to call external service", e);
|
||||
return R.fail("Service unavailable");
|
||||
}
|
||||
|
||||
// Use ServiceException for framework errors
|
||||
throw new ServiceException("Validation failed");
|
||||
```
|
||||
|
||||
#### Logging
|
||||
|
||||
```java
|
||||
// Use Lombok's @Slf4j
|
||||
@Slf4j
|
||||
public class ExampleService {
|
||||
|
||||
// Appropriate log levels
|
||||
log.debug("Debug info: {}", data);
|
||||
log.info("Operation completed: {}", result);
|
||||
log.warn("Potential issue: {}", warning);
|
||||
log.error("Error occurred", exception);
|
||||
}
|
||||
```
|
||||
|
||||
#### Database (MyBatis-Plus)
|
||||
|
||||
```java
|
||||
// Query examples
|
||||
LambdaQueryWrapper<TpOrder> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TpOrder::getStatus, 1)
|
||||
.like(TpOrder::getName, keyword)
|
||||
.orderByDesc(TpOrder::getCreateTime);
|
||||
|
||||
// Use service methods
|
||||
return R.ok(service.queryPageList(bo, pageQuery));
|
||||
|
||||
// Pagination
|
||||
PageQuery pageQuery = new PageQuery();
|
||||
pageQuery.setPageNum(1);
|
||||
pageQuery.setPageSize(10);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Security Guidelines
|
||||
|
||||
### Sensitive Data
|
||||
|
||||
- **NEVER** hardcode credentials in source code
|
||||
- Use environment variables or config center for secrets
|
||||
- Never log passwords or sensitive information
|
||||
|
||||
### API Security
|
||||
|
||||
- Use `@SaCheckPermission` for permission control
|
||||
- Use `@SaIgnore` for public endpoints
|
||||
- Validate all input parameters
|
||||
- Use `@RepeatSubmit` for idempotent requests
|
||||
|
||||
---
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### REST Controller
|
||||
|
||||
```java
|
||||
@GetMapping("/list")
|
||||
public R<TableDataInfo<Vo>> list(Bo bo, PageQuery pageQuery) {
|
||||
return R.ok(service.queryPageList(bo, pageQuery));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R<Boolean> add(@Validated @RequestBody Bo bo) {
|
||||
return R.ok(service.insertByBo(bo));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody Bo bo) {
|
||||
return R.ok(service.updateByBo(bo));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public R<Boolean> remove(@PathVariable Long id) {
|
||||
return R.ok(service.deleteWithValidByIds(List.of(id)));
|
||||
}
|
||||
```
|
||||
|
||||
### Service Layer
|
||||
|
||||
```java
|
||||
public interface IExampleService {
|
||||
TableDataInfo<Vo> queryPageList(Bo bo, PageQuery pageQuery);
|
||||
Vo queryById(Long id);
|
||||
Boolean insertByBo(Bo bo);
|
||||
Boolean updateByBo(Bo bo);
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Database Connection
|
||||
|
||||
If encountering connection issues:
|
||||
- Check firewall settings
|
||||
- Verify database credentials
|
||||
- Ensure MySQL connector version compatibility (8.4.0 recommended)
|
||||
|
||||
### Hot Reload
|
||||
|
||||
For DevTools hot reload in IDEA:
|
||||
1. Enable `Build project automatically`
|
||||
2. Add VM option: `-agentlib:jdbprefindock=on,server=y,suspend=n`
|
||||
3. Press `Ctrl+F10` to reload changes
|
||||
233
docs/API.md
Normal file
233
docs/API.md
Normal file
@@ -0,0 +1,233 @@
|
||||
# XGT 系统接口列表
|
||||
|
||||
## 一、公共接口 (ruoyi-admin)
|
||||
|
||||
### 1. 认证相关 `/auth`
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| POST | `/auth/login` | 登录 |
|
||||
| POST | `/auth/logout` | 登出 |
|
||||
| POST | `/auth/register` | 注册 |
|
||||
| GET | `/auth/tenant/list` | 租户列表 |
|
||||
| GET | `/auth/code` | 验证码 |
|
||||
|
||||
### 2. 首页 `/`
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/` | 欢迎页 |
|
||||
| GET | `/banner` | 画册列表 |
|
||||
| GET | `/banner/{id}` | 画册详情 |
|
||||
| GET | `/prod` | 商品列表 |
|
||||
| GET | `/prod/{id}` | 商品详情 |
|
||||
| GET | `/tpSysUser` | 表现师列表 |
|
||||
| GET | `/sysUser/{id}` | 用户详情 |
|
||||
| GET | `/follow` | 关注列表 |
|
||||
| POST | `/AddFollow` | 关注 |
|
||||
| DELETE | `/delFollow` | 取消关注 |
|
||||
| POST | `/isFollow` | 是否关注 |
|
||||
| GET | `/tpWorks` | 作品列表 |
|
||||
| POST | `/AddWorks` | 收藏作品 |
|
||||
| DELETE | `/delWorks` | 取消收藏 |
|
||||
| POST | `/isWorks` | 是否收藏 |
|
||||
| POST | `/wx/jssdk` | 微信JSSDK签名 |
|
||||
|
||||
### 3. 首页统计 `/`
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/indexSum` | 首页统计 |
|
||||
| GET | `/rankingListKF` | 客服排行 |
|
||||
| GET | `/rankingListKFSum` | 客服统计 |
|
||||
| GET | `/rankingListJS` | 技术排行 |
|
||||
| GET | `/rankingListJSSum` | 技术统计 |
|
||||
| GET | `/deptRankingList` | 客服部排行 |
|
||||
| GET | `/deptRankingList1` | 客服部排行(单) |
|
||||
| GET | `/deptRankingJSList` | 技术部排行 |
|
||||
| GET | `/deptRankingJSList1` | 技术部排行(单) |
|
||||
| GET | `/khRankingList` | 客户下单排行 |
|
||||
| GET | `/khRankingListSum` | 客户下单统计 |
|
||||
| GET | `/kfDayList` | 客服数据分析(日) |
|
||||
| GET | `/wxDayList` | 微信好友分析(日) |
|
||||
| GET | `/wxDayList1` | 微信好友分析(日) |
|
||||
| GET | `/wxMonthList` | 微信好友分析(月) |
|
||||
| GET | `/ftDayList` | 技术部分图(日) |
|
||||
| GET | `/jsDayList` | 技术部月报 |
|
||||
| POST | `/monthArrivedPer` | 月业绩统计 |
|
||||
| POST | `/yearArrivedPer` | 年业绩统计 |
|
||||
| POST | `/monthOrderType` | 订单类型统计 |
|
||||
| POST | `/monthOrderSpace` | 订单空间统计 |
|
||||
| POST | `/monthOrderStyle` | 订单风格统计 |
|
||||
| POST | `/newOldOrderPer` | 新老客户占比 |
|
||||
| POST | `/notifyCheckSign` | 银盛支付回调 |
|
||||
| POST | `/updateOrder` | 更新订单部门状态 |
|
||||
|
||||
---
|
||||
|
||||
## 二、业务模块 (ruoyi-work)
|
||||
|
||||
### 订单模块 `/work/order*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpOrderController | `/work/order` | 订单管理 |
|
||||
| CustomerOrderController | `/work/customer/order` | 客户订单 |
|
||||
| SkillOrderController | `/work/skill/order` | 技术订单 |
|
||||
| TpOrderBigController | `/work/orderBig` | 大图订单 |
|
||||
| TpOrderSmallController | `/work/orderSmall` | 小图订单 |
|
||||
| TpOrderCdController | `/work/orderCd` | 拆单记录 |
|
||||
| TpOrderRecordController | `/work/orderRecord` | 操作记录 |
|
||||
| TpOrderPayController | `/work/orderPay` | 支付记录 |
|
||||
| TpOrderCommentController | `/work/orderComment` | 订单评价 |
|
||||
| TpOrderModelController | `/work/orderModel` | 订单模板 |
|
||||
|
||||
#### CustomerOrderController 详细接口
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/work/customer/order/list` | 客户订单列表 |
|
||||
| GET | `/work/customer/order/sum` | 客户订单统计 |
|
||||
| POST | `/work/customer/order/export` | 导出客户订单 |
|
||||
| GET | `/work/customer/order/{id}` | 客户订单详情 |
|
||||
| POST | `/work/customer/order` | 新增客户订单 |
|
||||
| PUT | `/work/customer/order` | 更新客户订单 |
|
||||
| DELETE | `/work/customer/order/{ids}` | 删除客户订单 |
|
||||
| POST | `/work/customer/order/assign` | 派单 |
|
||||
| POST | `/work/customer/order/cancelAssign` | 取消派单 |
|
||||
| GET | `/work/customer/order/queryOrderPay/{orderId}` | 查询支付信息 |
|
||||
| POST | `/work/customer/order/pay` | 支付 |
|
||||
| GET | `/work/customer/order/orderFallback/{orderId}` | 退款信息 |
|
||||
| POST | `/work/customer/order/fallback` | 退款 |
|
||||
| GET | `/work/customer/order/cdOrderInfo/{orderId}` | 拆单信息 |
|
||||
| POST | `/work/customer/order/cdOrder` | 拆单 |
|
||||
| GET | `/work/customer/order/gjOrderInfo/{orderId}` | 改价信息 |
|
||||
| POST | `/work/customer/order/gjOrder` | 改价 |
|
||||
|
||||
### 客户模块 `/work/client*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpClientController | `/work/client` | 客户管理 |
|
||||
| TpClientStaffController | `/work/clientStaff` | 客服客户 |
|
||||
| TpClientFundController | `/work/clientFund` | 客户资金 |
|
||||
|
||||
#### TpClientController 详细接口
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/work/client/list` | 客户列表 |
|
||||
| GET | `/work/client/listChart` | 客户订单统计 |
|
||||
| POST | `/work/client/export` | 导出客户 |
|
||||
| GET | `/work/client/{id}` | 客户详情 |
|
||||
| POST | `/work/client` | 新增客户 |
|
||||
| PUT | `/work/client` | 更新客户 |
|
||||
| DELETE | `/work/client/{ids}` | 删除客户 |
|
||||
|
||||
### 员工模块 `/work/staff*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpStaffController | `/work/staff` | 员工管理 |
|
||||
| TzUserController | `/mall/user` | 用户管理 |
|
||||
| TpStaffPayController | `/work/staffPay` | 员工薪资 |
|
||||
| TpIntegralDetailController | `/work/integralDetail` | 积分明细 |
|
||||
|
||||
### 微信模块 `/work/wechat*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpWechatController | `/work/wechat` | 微信管理 |
|
||||
| TpWechatUserController | `/work/wechatUser` | 微信用户 |
|
||||
| TpWechatNumController | `/work/wechatNum` | 微信好友数 |
|
||||
|
||||
#### TpWechatController 详细接口
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/work/wechat/list` | 微信列表 |
|
||||
| GET | `/work/wechat/wechatSum` | 微信统计 |
|
||||
| POST | `/work/wechat/export` | 导出微信 |
|
||||
| GET | `/work/wechat/{id}` | 微信详情 |
|
||||
| POST | `/work/wechat` | 新增微信 |
|
||||
| PUT | `/work/wechat` | 更新微信 |
|
||||
| POST | `/work/wechat/editUser` | 更新用户 |
|
||||
| DELETE | `/work/wechat/{ids}` | 删除微信 |
|
||||
|
||||
### 财务模块 `/work/receipt*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpReceiptController | `/work/receipt` | 收款管理 |
|
||||
| TpRemittanceController | `/work/remittance` | 汇款管理 |
|
||||
|
||||
#### TpReceiptController 详细接口
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/work/receipt/list` | 收款列表 |
|
||||
| GET | `/work/receipt/receiptSum` | 收款统计 |
|
||||
| POST | `/work/receipt/export` | 导出收款 |
|
||||
| GET | `/work/receipt/{id}` | 收款详情 |
|
||||
| POST | `/work/receipt` | 新增收款 |
|
||||
| POST | `/work/receipt/claim` | 认领汇款 |
|
||||
| POST | `/work/receipt/back` | 退回汇款 |
|
||||
| DELETE | `/work/receipt/{ids}` | 删除收款 |
|
||||
|
||||
### 统计数据 `/work/dept*`
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpDeptReportController | `/work/deptReport` | 部门报表 |
|
||||
| TpDeptCostController | `/work/deptCost` | 部门成本 |
|
||||
| TpYearController | `/work/year` | 年度目标 |
|
||||
| TpMonthController | `/work/month` | 月度目标 |
|
||||
|
||||
### 资源模块
|
||||
| 控制器 | 路径 | 说明 |
|
||||
|--------|------|------|
|
||||
| TpProdController | `/work/prod` | 商品管理 |
|
||||
| TpWorksController | `/work/works` | 作品收藏 |
|
||||
| TpFollowController | `/work/follow` | 关注管理 |
|
||||
| TpPanoramaController | `/work/panorama` | 全景图 |
|
||||
| TpDesignQuotesController | `/work/designQuotes` | 设计报价 |
|
||||
| TpFieldController | `/work/field` | 领域管理 |
|
||||
| TpChangePriceController | `/work/changePrice` | 改价配置 |
|
||||
| TzSharedAccountController | `/work/sharedAccount` | 共享账号 |
|
||||
|
||||
#### TpPanoramaController 详细接口
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| GET | `/work/panorama/list` | 全景图列表 |
|
||||
| GET | `/work/panorama/listByOrderId` | 根据订单ID查询全景图 |
|
||||
| POST | `/work/panorama/export` | 导出全景图 |
|
||||
| GET | `/work/panorama/{id}` | 全景图详情 |
|
||||
| POST | `/work/panorama` | 新增全景图 |
|
||||
| PUT | `/work/panorama` | 更新全景图 |
|
||||
| DELETE | `/work/panorama/{ids}` | 删除全景图 |
|
||||
|
||||
---
|
||||
|
||||
## 三、通用CRUD接口格式
|
||||
|
||||
```
|
||||
GET /{path}/list # 列表查询
|
||||
POST /{path}/export # 导出数据
|
||||
GET /{path}/{id} # 详情查询
|
||||
POST /{path} # 新增
|
||||
PUT /{path} # 更新
|
||||
DELETE /{path}/{ids} # 删除
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、接口统计
|
||||
|
||||
- **ruoyi-admin**: 5 个控制器 (HomeController, IndexController, LoginController, AuthController, CaptchaController)
|
||||
- **ruoyi-work**: 34 个控制器
|
||||
- **总计**: 39 个控制器
|
||||
|
||||
---
|
||||
|
||||
## 五、订单状态流转
|
||||
|
||||
```
|
||||
客户下单 → 客服派单 → 技术接单 → 设计制作 → 完成交付 → 客户评价
|
||||
↓
|
||||
申请退款 (可选)
|
||||
```
|
||||
|
||||
## 六、用户身份
|
||||
|
||||
| identity | 说明 |
|
||||
|----------|------|
|
||||
| 1 | 管理员 |
|
||||
| 2 | 表现师/技术 |
|
||||
| 3 | 客服 |
|
||||
789
docs/API_DEV.md
Normal file
789
docs/API_DEV.md
Normal file
@@ -0,0 +1,789 @@
|
||||
# XGT 效果图业务系统 - 开发接口对接文档
|
||||
|
||||
**版本**: 1.0
|
||||
**日期**: 2026-03-07
|
||||
**基础URL**: `http://localhost:8088`
|
||||
|
||||
---
|
||||
|
||||
## 一、认证接口
|
||||
|
||||
### 1.1 登录
|
||||
|
||||
```
|
||||
POST /auth/login
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"username": "用户名",
|
||||
"password": "密码",
|
||||
"code": "验证码",
|
||||
"uuid": "验证码ID",
|
||||
"tenantId": "租户ID",
|
||||
"grantType": "password",
|
||||
"clientId": "客户端ID"
|
||||
}
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
"accessToken": "xxx",
|
||||
"expiresIn": 1209600,
|
||||
"refreshToken": "xxx",
|
||||
"refreshExpiresIn": 2592000,
|
||||
"tokenType": "Bearer"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 1.2 退出登录
|
||||
|
||||
```
|
||||
POST /auth/logout
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "退出成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 1.3 注册
|
||||
|
||||
```
|
||||
POST /auth/register
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"username": "用户名",
|
||||
"password": "密码",
|
||||
"nickName": "昵称",
|
||||
"phone": "手机号",
|
||||
"tenantId": "租户ID"
|
||||
}
|
||||
```
|
||||
|
||||
### 1.4 获取租户列表
|
||||
|
||||
```
|
||||
GET /auth/tenant/list
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"data": {
|
||||
"tenantEnabled": true,
|
||||
"voList": [
|
||||
{
|
||||
"tenantId": "1",
|
||||
"tenantName": "默认租户",
|
||||
"domain": "localhost"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 1.5 获取用户信息
|
||||
|
||||
```
|
||||
GET /auth/login/info
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 二、首页接口
|
||||
|
||||
### 2.1 首页欢迎
|
||||
|
||||
```
|
||||
GET /
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
"欢迎使用XGT后台管理框架,当前版本:v5.2.3,请通过前端地址访问。"
|
||||
```
|
||||
|
||||
### 2.2 画册列表
|
||||
|
||||
```
|
||||
GET /banner
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码,默认1 |
|
||||
| pageSize | int | 每页数量,默认10 |
|
||||
| title | string | 标题(模糊搜索) |
|
||||
| status | int | 状态(1启用) |
|
||||
|
||||
### 2.3 商品列表
|
||||
|
||||
```
|
||||
GET /prod
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| name | string | 商品名称 |
|
||||
| status | int | 状态 |
|
||||
|
||||
### 2.4 表现师列表
|
||||
|
||||
```
|
||||
GET /tpSysUser
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| nickName | string | 昵称 |
|
||||
| identity | int | 身份(2表现师) |
|
||||
|
||||
### 2.5 用户详情
|
||||
|
||||
```
|
||||
GET /sysUser/{id}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 2.6 关注操作
|
||||
|
||||
```
|
||||
POST /AddFollow
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"followUserId": "被关注用户ID",
|
||||
"type": "关注类型"
|
||||
}
|
||||
```
|
||||
|
||||
### 2.7 取消关注
|
||||
|
||||
```
|
||||
DELETE /delFollow
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"id": "关注记录ID"
|
||||
}
|
||||
```
|
||||
|
||||
### 2.8 作品收藏
|
||||
|
||||
```
|
||||
POST /AddWorks
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"worksId": "作品ID",
|
||||
"type": "收藏类型"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、订单接口
|
||||
|
||||
### 3.1 订单列表(客服)
|
||||
|
||||
```
|
||||
GET /work/customer/order/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| orderId | string | 订单编号 |
|
||||
| kid | long | 客户ID |
|
||||
| sid | long | 客服ID |
|
||||
| state | int | 订单状态 |
|
||||
| deptId | long | 部门ID |
|
||||
| startTime | date | 开始时间 |
|
||||
| endTime | date | 结束时间 |
|
||||
|
||||
**订单状态说明**:
|
||||
| 值 | 说明 |
|
||||
|----|------|
|
||||
| 1 | 录入订单 |
|
||||
| 2 | 上传小图 |
|
||||
| 3 | 上传大图 |
|
||||
| 4 | 已完成 |
|
||||
| 5 | 已评价 |
|
||||
|
||||
### 3.2 订单统计(客服)
|
||||
|
||||
```
|
||||
GET /work/customer/order/sum
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"data": {
|
||||
"orderCount": 100,
|
||||
"payCount": 80,
|
||||
"priceSum": 50000.00,
|
||||
"unPayCount": 20
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3.3 新增订单
|
||||
|
||||
```
|
||||
POST /work/customer/order
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"orderId": "订单编号(自动生成)",
|
||||
"kid": 1,
|
||||
"wid": 1,
|
||||
"style": 1,
|
||||
"space": "客厅",
|
||||
"quality": 1,
|
||||
"num": 5,
|
||||
"price": 500.00,
|
||||
"remark": "备注",
|
||||
"type": 1
|
||||
}
|
||||
```
|
||||
|
||||
### 3.4 订单派单
|
||||
|
||||
```
|
||||
POST /work/customer/order/assign
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"orderIds": [1, 2, 3],
|
||||
"userId": 100
|
||||
}
|
||||
```
|
||||
|
||||
### 3.5 取消派单
|
||||
|
||||
```
|
||||
POST /work/customer/order/cancelAssign
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| orderId | long | 订单ID |
|
||||
|
||||
### 3.6 订单支付
|
||||
|
||||
```
|
||||
POST /work/customer/order/pay
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| orderId | long | 订单ID |
|
||||
| type | int | 类型(1客户 2客服) |
|
||||
| price | BigDecimal | 支付金额 |
|
||||
|
||||
### 3.7 订单退款
|
||||
|
||||
```
|
||||
POST /work/customer/order/fallback
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| orderId | long | 订单ID |
|
||||
| type | int | 类型(1客户 2客服) |
|
||||
| price | BigDecimal | 退款金额 |
|
||||
|
||||
### 3.8 订单拆单
|
||||
|
||||
```
|
||||
POST /work/customer/order/cdOrder
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| orderId | long | 订单ID |
|
||||
| price | BigDecimal | 拆单金额 |
|
||||
|
||||
### 3.9 订单改价
|
||||
|
||||
```
|
||||
POST /work/customer/order/gjOrder
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| orderId | long | 订单ID |
|
||||
| price | BigDecimal | 新价格 |
|
||||
|
||||
### 3.10 订单详情
|
||||
|
||||
```
|
||||
GET /work/customer/order/{id}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 3.11 更新订单
|
||||
|
||||
```
|
||||
PUT /work/customer/order
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
### 3.12 删除订单
|
||||
|
||||
```
|
||||
DELETE /work/customer/order/{ids}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、客户接口
|
||||
|
||||
### 4.1 客户列表
|
||||
|
||||
```
|
||||
GET /work/client/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| name | string | 客户名称 |
|
||||
| phone | string | 手机号 |
|
||||
|
||||
### 4.2 客户订单统计
|
||||
|
||||
```
|
||||
GET /work/client/listChart
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 4.3 客户详情
|
||||
|
||||
```
|
||||
GET /work/client/{id}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 4.4 新增客户
|
||||
|
||||
```
|
||||
POST /work/client
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
```json
|
||||
{
|
||||
"name": "客户名称",
|
||||
"phone": "手机号",
|
||||
"wechat": "微信",
|
||||
"remark": "备注"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、员工接口
|
||||
|
||||
### 5.1 员工列表
|
||||
|
||||
```
|
||||
GET /work/staff/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 5.2 用户列表
|
||||
|
||||
```
|
||||
GET /mall/user/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| nickName | string | 昵称 |
|
||||
| identity | int | 身份(1管理员 2技术 3客服) |
|
||||
|
||||
---
|
||||
|
||||
## 六、微信接口
|
||||
|
||||
### 6.1 微信列表
|
||||
|
||||
```
|
||||
GET /work/wechat/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| code | string | 微信编号 |
|
||||
| user | string | 微信昵称 |
|
||||
| createDept | long | 所属部门 |
|
||||
|
||||
### 6.2 微信统计
|
||||
|
||||
```
|
||||
GET /work/wechat/wechatSum
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、财务接口
|
||||
|
||||
### 7.1 收款列表
|
||||
|
||||
```
|
||||
GET /work/receipt/list
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 7.2 收款统计
|
||||
|
||||
```
|
||||
GET /work/receipt/receiptSum
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 7.3 认领汇款
|
||||
|
||||
```
|
||||
POST /work/receipt/claim
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 八、统计接口
|
||||
|
||||
### 8.1 首页统计
|
||||
|
||||
```
|
||||
GET /indexSum
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**响应说明**: 根据用户身份返回不同统计
|
||||
- 表现师(identity=2): 技术相关统计
|
||||
- 客服(identity=3): 客服相关统计
|
||||
|
||||
### 8.2 客服排行榜
|
||||
|
||||
```
|
||||
GET /rankingListKF
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**查询参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| pageNum | int | 页码 |
|
||||
| pageSize | int | 每页数量 |
|
||||
| type | int | 类型 |
|
||||
| startTime | date | 开始时间 |
|
||||
| endTime | date | 结束时间 |
|
||||
|
||||
### 8.3 技术排行榜
|
||||
|
||||
```
|
||||
GET /rankingListJS
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.4 部门排行榜
|
||||
|
||||
```
|
||||
GET /deptRankingList
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.5 客服数据分析(日)
|
||||
|
||||
```
|
||||
GET /kfDayList
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.6 微信好友分析
|
||||
|
||||
```
|
||||
GET /wxDayList
|
||||
Authorization: Bearer <token>
|
||||
GET /wxMonthList
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.7 技术部分图/日报
|
||||
|
||||
```
|
||||
GET /ftDayList
|
||||
Authorization: Bearer <token>
|
||||
GET /jsDayList
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.8 业绩统计
|
||||
|
||||
```
|
||||
POST /monthArrivedPer
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
**请求参数**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| month | string | 月份(如2024-09) |
|
||||
| deptId | long | 部门ID |
|
||||
|
||||
### 8.9 订单类型统计
|
||||
|
||||
```
|
||||
POST /monthOrderType
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 8.10 新老客户占比
|
||||
|
||||
```
|
||||
POST /newOldOrderPer
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 九、通用接口格式
|
||||
|
||||
### 列表查询
|
||||
|
||||
```
|
||||
GET /{module}/{entity}/list
|
||||
Authorization: Bearer <token>
|
||||
|
||||
Query Params:
|
||||
- pageNum: 页码
|
||||
- pageSize: 每页数量
|
||||
- 其他业务参数...
|
||||
```
|
||||
|
||||
### 详情查询
|
||||
|
||||
```
|
||||
GET /{module}/{entity}/{id}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 新增
|
||||
|
||||
```
|
||||
POST /{module}/{entity}
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
Body: {业务对象}
|
||||
```
|
||||
|
||||
### 更新
|
||||
|
||||
```
|
||||
PUT /{module}/{entity}
|
||||
Authorization: Bearer <token>
|
||||
Content-Type: application/json
|
||||
|
||||
Body: {业务对象}
|
||||
```
|
||||
|
||||
### 删除
|
||||
|
||||
```
|
||||
DELETE /{module}/{entity}/{ids}
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
### 导出
|
||||
|
||||
```
|
||||
POST /{module}/{entity}/export
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十、通用响应格式
|
||||
|
||||
### 成功响应
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {}
|
||||
}
|
||||
```
|
||||
|
||||
### 分页响应
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"rows": [],
|
||||
"total": 100
|
||||
}
|
||||
```
|
||||
|
||||
### 失败响应
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 500,
|
||||
"msg": "操作失败",
|
||||
"data": {}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十一、错误码说明
|
||||
|
||||
| 错误码 | 说明 |
|
||||
|--------|------|
|
||||
| 200 | 成功 |
|
||||
| 401 | 未授权 |
|
||||
| 403 | 无权限 |
|
||||
| 404 | 资源不存在 |
|
||||
| 500 | 服务器内部错误 |
|
||||
|
||||
---
|
||||
|
||||
## 十二、数据模型
|
||||
|
||||
### 订单 (tp_order)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| id | Long | ID |
|
||||
| orderId | String | 订单编号 |
|
||||
| kid | Long | 客户ID |
|
||||
| wid | Long | 微信ID |
|
||||
| style | Long | 风格 |
|
||||
| space | String | 空间 |
|
||||
| quality | Long | 品质 |
|
||||
| num | Long | 图纸数量 |
|
||||
| price | BigDecimal | 订单价格 |
|
||||
| state | Integer | 订单状态 |
|
||||
| sid | Long | 客服ID |
|
||||
| bid | String | 表现师ID |
|
||||
| addTime | Date | 下单时间 |
|
||||
| finishTime | Date | 完成时间 |
|
||||
|
||||
### 客户 (tp_client)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| id | Long | ID |
|
||||
| name | String | 客户名称 |
|
||||
| phone | String | 手机号 |
|
||||
| wechat | String | 微信 |
|
||||
| remark | String | 备注 |
|
||||
| createTime | Date | 创建时间 |
|
||||
|
||||
### 员工 (tp_staff)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| id | Long | ID |
|
||||
| name | String | 姓名 |
|
||||
| phone | String | 手机号 |
|
||||
| deptId | Long | 部门ID |
|
||||
| identity | Integer | 身份(1管理员 2技术 3客服) |
|
||||
| status | String | 状态 |
|
||||
|
||||
### 微信 (tp_wechat)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| id | Long | ID |
|
||||
| code | String | 微信编号 |
|
||||
| user | String | 微信昵称 |
|
||||
| phone | String | 手机号 |
|
||||
| deptId | Long | 部门ID |
|
||||
| createTime | Date | 创建时间 |
|
||||
BIN
ruoyi-admin/.DS_Store
vendored
Normal file
BIN
ruoyi-admin/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -21,6 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>8.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– mp支持的数据库均支持 只需要增加对应的jdbc依赖即可 –>-->
|
||||
@@ -97,6 +98,14 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot DevTools 热部署 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- skywalking 整合 logback -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
@@ -118,6 +127,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<addResources>true</addResources>
|
||||
<mainClass>org.dromara.XgtAdminApplication</mainClass>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
|
||||
package org.dromara.web.common;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public class HttpContextUtils {
|
||||
|
||||
public static HttpServletRequest getHttpServletRequest() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
|
||||
public static String getDomain(){
|
||||
HttpServletRequest request = getHttpServletRequest();
|
||||
StringBuffer url = request.getRequestURL();
|
||||
return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString();
|
||||
}
|
||||
|
||||
public static String getOrigin(){
|
||||
HttpServletRequest request = getHttpServletRequest();
|
||||
return request.getHeader("Origin");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
/**
|
||||
* @author 菠萝凤梨
|
||||
* @date 2022/3/28 14:32
|
||||
*/
|
||||
public interface OauthCacheNames {
|
||||
|
||||
/**
|
||||
* oauth 授权相关key
|
||||
*/
|
||||
String OAUTH_PREFIX = "mall4j_oauth:";
|
||||
|
||||
/**
|
||||
* token 授权相关key
|
||||
*/
|
||||
String OAUTH_TOKEN_PREFIX = OAUTH_PREFIX + "token:";
|
||||
|
||||
/**
|
||||
* 保存token 缓存使用key
|
||||
*/
|
||||
String ACCESS = OAUTH_TOKEN_PREFIX + "access:";
|
||||
|
||||
/**
|
||||
* 刷新token 缓存使用key
|
||||
*/
|
||||
String REFRESH_TO_ACCESS = OAUTH_TOKEN_PREFIX + "refresh_to_access:";
|
||||
|
||||
/**
|
||||
* 根据uid获取保存的token key缓存使用的key
|
||||
*/
|
||||
String UID_TO_ACCESS = OAUTH_TOKEN_PREFIX + "uid_to_access:";
|
||||
|
||||
/**
|
||||
* 保存token的用户信息使用的key
|
||||
*/
|
||||
String USER_INFO = OAUTH_TOKEN_PREFIX + "user_info:";
|
||||
}
|
||||
128
ruoyi-admin/src/main/java/org/dromara/web/common/PageParam.java
Normal file
128
ruoyi-admin/src/main/java/org/dromara/web/common/PageParam.java
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
|
||||
package org.dromara.web.common;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema
|
||||
@ParameterObject
|
||||
public class PageParam<T> extends Page<T> {
|
||||
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页大小,默认10")
|
||||
private long size = 10;
|
||||
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认1")
|
||||
private long current = 1;
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
@Hidden
|
||||
private List<T> records;
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
@Hidden
|
||||
private long total = 0;
|
||||
|
||||
|
||||
/**
|
||||
* 是否进行 count 查询
|
||||
*/
|
||||
@JsonIgnore
|
||||
private boolean isSearchCount = true;
|
||||
|
||||
@JsonIgnore
|
||||
private String countId;
|
||||
@JsonIgnore
|
||||
private Long maxLimit;
|
||||
@JsonIgnore
|
||||
private boolean optimizeCountSql;
|
||||
|
||||
@Override
|
||||
public List<T> getRecords() {
|
||||
return this.records;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> setRecords(List<T> records) {
|
||||
this.records = records;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotal() {
|
||||
return this.total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> setTotal(long total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean getSearchCount() {
|
||||
if (total < 0) {
|
||||
return false;
|
||||
}
|
||||
return isSearchCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> setSearchCount(boolean isSearchCount) {
|
||||
this.isSearchCount = isSearchCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> setSize(long size) {
|
||||
int maxSize = 100;
|
||||
if (size > maxSize) {
|
||||
this.size = maxSize;
|
||||
} else {
|
||||
this.size = size;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCurrent() {
|
||||
return this.current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> setCurrent(long current) {
|
||||
this.current = current;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package org.dromara.web.common;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.symmetric.AES;
|
||||
import org.dromara.common.core.exception.user.UserException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @author 菠萝凤梨
|
||||
* @date 2022/1/19 16:02
|
||||
*/
|
||||
@Component
|
||||
public class PasswordManager {
|
||||
private static final Logger logger = LoggerFactory.getLogger(PasswordManager.class);
|
||||
|
||||
/**
|
||||
* 用于aes签名的key,16位
|
||||
*/
|
||||
@Value("${auth.password.signKey:-mall4j-password}")
|
||||
public String passwordSignKey;
|
||||
|
||||
public String decryptPassword(String data) {
|
||||
// 在使用oracle的JDK时,JAR包必须签署特殊的证书才能使用。
|
||||
// 解决方案 1.使用openJDK或者非oracle的JDK(建议) 2.添加证书
|
||||
// hutool的aes报错可以打开下面那段代码
|
||||
SecureUtil.disableBouncyCastle();
|
||||
AES aes = new AES(passwordSignKey.getBytes(StandardCharsets.UTF_8));
|
||||
String decryptStr;
|
||||
String decryptPassword;
|
||||
try {
|
||||
decryptStr = aes.decryptStr(data);
|
||||
decryptPassword = decryptStr.substring(13);
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception:", e);
|
||||
throw new UserException("AES解密错误", e);
|
||||
}
|
||||
return decryptPassword;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package org.dromara.web.common;
|
||||
|
||||
/**
|
||||
* @author FrozenWatermelon
|
||||
* @date 2020/7/9
|
||||
*/
|
||||
public enum ResponseEnum {
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
OK("00000", "ok"),
|
||||
SHOW_FAIL("A00001", ""),
|
||||
|
||||
/**
|
||||
* 用于直接显示提示用户的错误,内容由输入内容决定
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用于直接显示提示系统的成功,内容由输入内容决定
|
||||
*/
|
||||
SHOW_SUCCESS("A00002", ""),
|
||||
|
||||
/**
|
||||
* 未授权
|
||||
*/
|
||||
UNAUTHORIZED("A00004", "Unauthorized"),
|
||||
|
||||
/**
|
||||
* 服务器出了点小差
|
||||
*/
|
||||
EXCEPTION("A00005", "服务器出了点小差"),
|
||||
/**
|
||||
* 方法参数没有校验,内容由输入内容决定
|
||||
*/
|
||||
METHOD_ARGUMENT_NOT_VALID("A00014", "方法参数没有校验");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String msg;
|
||||
|
||||
public String value() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
ResponseEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResponseEnum{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + "} " + super.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
/**
|
||||
* @author LGH
|
||||
*/
|
||||
@UtilityClass
|
||||
public class SecurityUtils {
|
||||
|
||||
private static final String USER_REQUEST = "/api/";
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
*/
|
||||
public YamiUser getUser() {
|
||||
if (!HttpContextUtils.getHttpServletRequest().getRequestURI().startsWith(USER_REQUEST)) {
|
||||
// 用户相关的请求,应该以/p开头!!!
|
||||
throw new RuntimeException("登录过期或已失效");
|
||||
}
|
||||
|
||||
String accessToken = HttpContextUtils.getHttpServletRequest().getHeader("accessToken");
|
||||
TokenStore tokenStore = new TokenStore();
|
||||
UserInfoInTokenBO userInfoInTokenBO = tokenStore.getUserInfoByAccessToken(accessToken,false);
|
||||
|
||||
YamiUser yamiUser = new YamiUser();
|
||||
yamiUser.setUserId(userInfoInTokenBO.getUserId());
|
||||
yamiUser.setBizUserId(userInfoInTokenBO.getBizUserId());
|
||||
yamiUser.setEnabled(userInfoInTokenBO.getEnabled());
|
||||
yamiUser.setShopId(userInfoInTokenBO.getShopId());
|
||||
yamiUser.setStationId(userInfoInTokenBO.getOtherId());
|
||||
return yamiUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户ID
|
||||
*/
|
||||
public Long getUserInfo() {
|
||||
Long userId = null;
|
||||
try {
|
||||
userId = getUser().getUserId();
|
||||
} catch (RuntimeException e) {
|
||||
// 处理异常
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Slf4j
|
||||
public class ServerResponseEntity<T> implements Serializable {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private T data;
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private Long timestamp;
|
||||
|
||||
/* private String sign;
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}*/
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public ServerResponseEntity setData(T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(Long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return Objects.equals(ResponseEnum.OK.value(), this.code);
|
||||
}
|
||||
public boolean isFail() {
|
||||
return !Objects.equals(ResponseEnum.OK.value(), this.code);
|
||||
}
|
||||
|
||||
public ServerResponseEntity() {
|
||||
// 版本号
|
||||
this.version = "1.0";
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> success(T data) {
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setData(data);
|
||||
serverResponseEntity.setCode(ResponseEnum.OK.value());
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
serverResponseEntity.setMsg("success");
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> success() {
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setCode(ResponseEnum.OK.value());
|
||||
serverResponseEntity.setMsg(ResponseEnum.OK.getMsg());
|
||||
serverResponseEntity.setMsg("success");
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> success(Integer code, T data) {
|
||||
return success(String.valueOf(code), data);
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> success(String code, T data) {
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setCode(code);
|
||||
serverResponseEntity.setData(data);
|
||||
serverResponseEntity.setMsg("success");
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端显示失败消息
|
||||
* @param msg 失败消息
|
||||
* @return
|
||||
*/
|
||||
public static <T> ServerResponseEntity<T> showFailMsg(String msg) {
|
||||
log.error(msg);
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setMsg(msg);
|
||||
serverResponseEntity.setCode(ResponseEnum.SHOW_FAIL.value());
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> fail(ResponseEnum responseEnum) {
|
||||
log.error(responseEnum.toString());
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setMsg(responseEnum.getMsg());
|
||||
serverResponseEntity.setCode(responseEnum.value());
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> fail(ResponseEnum responseEnum, T data) {
|
||||
log.error(responseEnum.toString());
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setMsg(responseEnum.getMsg());
|
||||
serverResponseEntity.setCode(responseEnum.value());
|
||||
serverResponseEntity.setData(data);
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> fail(String code, String msg, T data) {
|
||||
log.error(msg);
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setMsg(msg);
|
||||
serverResponseEntity.setCode(code);
|
||||
serverResponseEntity.setData(data);
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> fail(String code, String msg) {
|
||||
return fail(code, msg, null);
|
||||
}
|
||||
|
||||
public static <T> ServerResponseEntity<T> fail(Integer code, T data) {
|
||||
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
|
||||
serverResponseEntity.setCode(String.valueOf(code));
|
||||
serverResponseEntity.setData(data);
|
||||
serverResponseEntity.setTimestamp(System.currentTimeMillis());
|
||||
return serverResponseEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServerResponseEntity{" +
|
||||
"code='" + code + '\'' +
|
||||
", msg='" + msg + '\'' +
|
||||
", data=" + data +
|
||||
", version='" + version + '\'' +
|
||||
", timestamp=" + timestamp +
|
||||
// ", sign='" + sign + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package org.dromara.web.common;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* token信息,该信息存在redis中
|
||||
*
|
||||
* @author 菠萝凤梨
|
||||
* @date 2022/3/25 17:33
|
||||
*/
|
||||
@Data
|
||||
public class TokenInfoBO {
|
||||
|
||||
/**
|
||||
* 保存在token信息里面的用户信息
|
||||
*/
|
||||
private UserInfoInTokenBO userInfoInToken;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private String refreshToken;
|
||||
|
||||
/**
|
||||
* 在多少秒后过期
|
||||
*/
|
||||
private Integer expiresIn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* token信息,该信息用户返回给前端,前端请求携带accessToken进行用户校验
|
||||
*
|
||||
* @author FrozenWatermelon
|
||||
* @date 2020/7/2
|
||||
*/
|
||||
@Data
|
||||
public class TokenInfoVO {
|
||||
|
||||
@Schema(description = "accessToken" )
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "refreshToken" )
|
||||
private String refreshToken;
|
||||
|
||||
@Schema(description = "在多少秒后过期" )
|
||||
private Integer expiresIn;
|
||||
}
|
||||
171
ruoyi-admin/src/main/java/org/dromara/web/common/TokenStore.java
Normal file
171
ruoyi-admin/src/main/java/org/dromara/web/common/TokenStore.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.dromara.common.core.exception.user.UserException;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* token管理 1. 登陆返回token 2. 刷新token 3. 清除用户过去token 4. 校验token
|
||||
*
|
||||
* @author FrozenWatermelon
|
||||
* @date 2020/7/2
|
||||
*/
|
||||
@Component
|
||||
public class TokenStore {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TokenStore.class);
|
||||
|
||||
// private final RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
/*public TokenStore(RedisTemplate<String, Object> redisTemplate) {
|
||||
this.redisTemplate = redisTemplate;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 以Sa-Token技术生成token,并返回token信息
|
||||
* @param userInfoInToken
|
||||
* @return
|
||||
*/
|
||||
public TokenInfoBO storeAccessSaToken(UserInfoInTokenBO userInfoInToken) {
|
||||
//生成过期时间
|
||||
int timeoutSecond = getExpiresIn(userInfoInToken.getSysType());
|
||||
Duration accessTokenExpires = Duration.ofSeconds(timeoutSecond);
|
||||
|
||||
String uid = this.getUid(userInfoInToken.getSysType().toString(), userInfoInToken.getUserId());
|
||||
StpUtil.login(uid, timeoutSecond);
|
||||
String token = StpUtil.getTokenValue();
|
||||
// 用户信息存入缓存 token生成
|
||||
String keyName = OauthCacheNames.USER_INFO + token;
|
||||
RedisUtils.deleteObject(keyName);
|
||||
RedisUtils.setCacheObject(keyName, userInfoInToken, accessTokenExpires);
|
||||
// 数据封装返回(token不用加密)
|
||||
TokenInfoBO tokenInfoBO = new TokenInfoBO();
|
||||
tokenInfoBO.setUserInfoInToken(userInfoInToken);
|
||||
tokenInfoBO.setExpiresIn(timeoutSecond);
|
||||
tokenInfoBO.setAccessToken(token);
|
||||
tokenInfoBO.setRefreshToken(token);
|
||||
return tokenInfoBO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算过期时间(单位:秒)
|
||||
* @param sysType
|
||||
* @return
|
||||
*/
|
||||
private int getExpiresIn(int sysType) {
|
||||
// 3600秒
|
||||
int expiresIn = 3600;
|
||||
// 普通用户token过期时间
|
||||
if (Objects.equals(sysType, 0)) {
|
||||
expiresIn = expiresIn * 24 * 30;
|
||||
}
|
||||
// 系统管理员的token过期时间
|
||||
if (Objects.equals(sysType, 1)) {
|
||||
expiresIn = expiresIn * 24 * 30;
|
||||
}
|
||||
return expiresIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据accessToken 获取用户信息
|
||||
* @param accessToken accessToken
|
||||
* @param needDecrypt 是否需要解密
|
||||
* @return 用户信息
|
||||
*/
|
||||
public UserInfoInTokenBO getUserInfoByAccessToken(String accessToken, boolean needDecrypt) {
|
||||
if (StrUtil.isBlank(accessToken)) {
|
||||
throw new UserException("accessToken is blank");
|
||||
}
|
||||
String keyName = OauthCacheNames.USER_INFO + accessToken;
|
||||
Object redisCache = RedisUtils.getCacheObject(keyName);
|
||||
if (redisCache == null) {
|
||||
throw new UserException("-2","登录过期,请重新登录");
|
||||
}
|
||||
return (UserInfoInTokenBO) redisCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新token,并返回新的token
|
||||
* @param refreshToken
|
||||
* @return
|
||||
*/
|
||||
public TokenInfoBO refreshToken(String refreshToken) {
|
||||
if (StrUtil.isBlank(refreshToken)) {
|
||||
throw new UserException("refreshToken is blank");
|
||||
}
|
||||
// 删除旧token
|
||||
UserInfoInTokenBO userInfoInTokenBO = getUserInfoByAccessToken(refreshToken, false);
|
||||
this.deleteCurrentToken(refreshToken);
|
||||
// 保存一份新的token
|
||||
return storeAccessSaToken(userInfoInTokenBO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定用户的全部的token
|
||||
*/
|
||||
public void deleteAllToken(String sysType, Long userId) {
|
||||
// 删除用户缓存
|
||||
String uid = this.getUid(sysType, userId);
|
||||
List<String> tokens = StpUtil.getTokenValueListByLoginId(uid);
|
||||
if (!CollectionUtils.isEmpty(tokens)) {
|
||||
List<String> keyNames = new ArrayList<>();
|
||||
for (String token : tokens) {
|
||||
keyNames.add(OauthCacheNames.USER_INFO + token);
|
||||
}
|
||||
RedisUtils.deleteObject(keyNames);
|
||||
}
|
||||
// 移除token
|
||||
StpUtil.logout(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成token,并返回token展示信息
|
||||
* @param userInfoInToken
|
||||
* @return
|
||||
*/
|
||||
public TokenInfoVO storeAndGetVo(UserInfoInTokenBO userInfoInToken) {
|
||||
if (!userInfoInToken.getEnabled()){
|
||||
// 用户已禁用,请联系客服
|
||||
throw new UserException("用户已禁用,请联系客服");
|
||||
}
|
||||
TokenInfoBO tokenInfoBO = storeAccessSaToken(userInfoInToken);
|
||||
// 数据封装返回
|
||||
TokenInfoVO tokenInfoVO = new TokenInfoVO();
|
||||
tokenInfoVO.setAccessToken(tokenInfoBO.getAccessToken());
|
||||
tokenInfoVO.setRefreshToken(tokenInfoBO.getRefreshToken());
|
||||
tokenInfoVO.setExpiresIn(tokenInfoBO.getExpiresIn());
|
||||
return tokenInfoVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除当前登录的token
|
||||
* @param accessToken 令牌
|
||||
*/
|
||||
public void deleteCurrentToken(String accessToken) {
|
||||
// 删除用户缓存
|
||||
String keyName = OauthCacheNames.USER_INFO + accessToken;
|
||||
RedisUtils.deleteObject(keyName);
|
||||
// 移除token
|
||||
StpUtil.logoutByTokenValue(accessToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成各系统唯一uid
|
||||
* @param sysType 系统类型
|
||||
* @param userId 用户id
|
||||
* @return
|
||||
*/
|
||||
private String getUid(String sysType, Long userId) {
|
||||
return sysType + ":" + userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package org.dromara.web.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 保存在token信息里面的用户信息
|
||||
*
|
||||
* @author 菠萝凤梨
|
||||
* @date 2022/3/25 17:33
|
||||
*/
|
||||
@Data
|
||||
public class UserInfoInTokenBO {
|
||||
|
||||
/**
|
||||
* 用户在自己系统的用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 租户id (商家id)
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 系统类型 0:普通用户 1:系统管理员
|
||||
*
|
||||
*/
|
||||
private Integer sysType;
|
||||
|
||||
/**
|
||||
* 是否是管理员
|
||||
*/
|
||||
private Integer isAdmin;
|
||||
|
||||
/**
|
||||
* 业务系统用户id
|
||||
*/
|
||||
private String bizUserId;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
private Set<String> perms;
|
||||
|
||||
/**
|
||||
* 状态 1 正常 0 无效
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 其他Id
|
||||
*/
|
||||
private Long otherId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.dromara.web.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
|
||||
/**
|
||||
* @author lh
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户登录信息")
|
||||
public class UserRegisterParam {
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String passWord;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String userMail;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickName;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@NotBlank(message = "手机号码不能为空", groups = { AddGroup.class})
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String img;
|
||||
|
||||
@Schema(description = "校验登陆注册验证码成功的标识")
|
||||
private String checkRegisterSmsFlag;
|
||||
|
||||
@Schema(description = "当账户未绑定时,临时的uid")
|
||||
private String tempUid;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "微信openId")
|
||||
private String openId;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
*
|
||||
* https://www.mall4j.com/
|
||||
*
|
||||
* 未经允许,不可做商业用途!
|
||||
*
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package org.dromara.web.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户详细信息
|
||||
* @author LGH
|
||||
*/
|
||||
@Data
|
||||
public class YamiUser {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String bizUserId;
|
||||
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 自提点Id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private Long shopId;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.dromara.web.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.work.domain.bo.TpOrderBo;
|
||||
import org.dromara.work.domain.vo.TpOrderVo;
|
||||
import org.dromara.work.service.ITpOrderService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 集材社调用接口
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/home")
|
||||
@Tag(name = "集材社调用接口")
|
||||
public class HomeController {
|
||||
|
||||
private final ITpOrderService tpOrderService;
|
||||
|
||||
/**
|
||||
* 获取订单详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("order/{id}")
|
||||
public R<TpOrderVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(tpOrderService.selectById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单信息
|
||||
*/
|
||||
@PostMapping("/updateOrder")
|
||||
@RepeatSubmit()
|
||||
public R<Boolean> edit(@RequestBody TpOrderBo bo) {
|
||||
return R.ok(tpOrderService.updateInfoByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,10 +26,7 @@ import org.dromara.system.service.ISysPictureService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.web.utils.WxXcxUtils;
|
||||
import org.dromara.work.domain.TpReceipt;
|
||||
import org.dromara.work.domain.bo.OrderRankingBo;
|
||||
import org.dromara.work.domain.bo.TpProdBo;
|
||||
import org.dromara.work.domain.bo.TpReceiptBo;
|
||||
import org.dromara.work.domain.bo.TpWechatBo;
|
||||
import org.dromara.work.domain.bo.*;
|
||||
import org.dromara.work.domain.vo.*;
|
||||
import org.dromara.work.service.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -73,6 +70,10 @@ public class IndexController {
|
||||
|
||||
private final ITpProdService tpProdService;
|
||||
|
||||
private final ITpFollowService tpFollowService;
|
||||
|
||||
private final ITpWorksService tpWorksService;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@@ -124,10 +125,104 @@ public class IndexController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 银盛支付回调
|
||||
* @param params
|
||||
* @return
|
||||
* 分页获取我的关注列表
|
||||
*/
|
||||
@GetMapping("/follow")
|
||||
public R<TableDataInfo<TpFollowVo>> list(TpFollowBo bo, PageQuery pageQuery) {
|
||||
return R.ok(tpFollowService.queryPageList(bo, pageQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 关注
|
||||
*/
|
||||
@PostMapping("/AddFollow")
|
||||
public R<Boolean> insert(@RequestBody TpFollowBo bo) {
|
||||
//判断是否已经关注
|
||||
TpFollowVo tpFollow = tpFollowService.queryByTpFollow(bo);
|
||||
if(tpFollow != null){
|
||||
return R.fail("已关注");
|
||||
}
|
||||
return R.ok(tpFollowService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消关注
|
||||
*/
|
||||
@DeleteMapping("/delFollow")
|
||||
public R<Boolean> delete(@RequestBody TpFollowBo bo) {
|
||||
if(bo.getId() != null){
|
||||
return R.ok(tpFollowService.deleteWithValidByIds(List.of(bo.getId()), false));
|
||||
}
|
||||
TpFollowVo tpFollow = tpFollowService.queryByTpFollow(bo);
|
||||
return R.ok(tpFollowService.deleteWithValidByIds(List.of(tpFollow.getId()), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我是否关注此用户
|
||||
*/
|
||||
@PostMapping("/isFollow")
|
||||
public R<Boolean> isFollow(@RequestBody TpFollowBo bo) {
|
||||
return R.ok(tpFollowService.queryByTpFollow(bo) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取我的收藏作品列表
|
||||
*/
|
||||
@GetMapping("/tpWorks")
|
||||
public R<TableDataInfo<TpWorksVo>> list(TpWorksBo bo, PageQuery pageQuery) {
|
||||
return R.ok(tpWorksService.queryPageList(bo, pageQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏作品
|
||||
*/
|
||||
@PostMapping("/AddWorks")
|
||||
public R<Boolean> insert(@RequestBody TpWorksBo bo) {
|
||||
//查询我是否已经收藏了此作品
|
||||
TpWorksVo tpWorks = tpWorksService.queryByTpWorks(bo);
|
||||
if(tpWorks != null){
|
||||
return R.fail("已收藏");
|
||||
}
|
||||
return R.ok(tpWorksService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
*/
|
||||
@DeleteMapping("/delWorks")
|
||||
public R<Boolean> delete(@RequestBody TpWorksBo bo) {
|
||||
if(bo.getId() != null){
|
||||
return R.ok(tpWorksService.deleteWithValidByIds(List.of(bo.getId()), false));
|
||||
}
|
||||
TpWorksVo tpWorks = tpWorksService.queryByTpWorks(bo);
|
||||
return R.ok(tpWorksService.deleteWithValidByIds(List.of(tpWorks.getId()), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我是否收藏此作品
|
||||
*/
|
||||
@PostMapping("/isWorks")
|
||||
public R<Boolean> isWorks(@RequestBody TpWorksBo bo) {
|
||||
return R.ok(tpWorksService.queryByTpWorks(bo) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取表现师列表
|
||||
*/
|
||||
@GetMapping("/tpSysUser")
|
||||
public R<TableDataInfo<SysUserVo>> list(SysUserBo bo, PageQuery pageQuery) {
|
||||
bo.setIdentity(2);
|
||||
return R.ok(sysUserService.selectPageList(bo, pageQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询用户信息
|
||||
*/
|
||||
@GetMapping("/sysUser/{id}")
|
||||
public R<SysUserVo> getSysUserInfo(@NotNull(message = "用户ID不能为空") @PathVariable Long id) {
|
||||
return R.ok(sysUserService.selectUserById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 银盛支付回调
|
||||
* @param params
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package org.dromara.web.controller;
|
||||
|
||||
import cn.dev33.satoken.secure.BCrypt;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.web.utils.WxXcxUtils;
|
||||
import org.dromara.work.domain.TzUser;
|
||||
import org.dromara.work.domain.vo.TzUserVo;
|
||||
import org.dromara.work.service.ITzUserService;
|
||||
import org.dromara.web.common.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Maosw
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/user/login")
|
||||
@Tag(name = "登录接口")
|
||||
public class LoginController {
|
||||
|
||||
private final ITzUserService tzUserService;
|
||||
|
||||
private final TokenStore tokenStore;
|
||||
|
||||
|
||||
@PostMapping("/getUserPhoneNumber")
|
||||
@Operation(summary = "微信接口获取手机号码" , description = "微信接口获取手机号码")
|
||||
@Parameter(name = "code", description = "code", required = true)
|
||||
public ServerResponseEntity<JSONObject> getUserPhoneNumber(@RequestParam(value = "code") String code) {
|
||||
// String phone = WxXcxUtils.getUserPhoneNumber(code);
|
||||
return ServerResponseEntity.success(WxXcxUtils.getUserPhoneNumber(code));
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
@Operation(summary = "注册登录" , description = "用户绑定手机号注册登录")
|
||||
public ServerResponseEntity<TokenInfoVO> register(@Valid @RequestBody UserRegisterParam userRegisterParam) {
|
||||
if (StrUtil.isBlank(userRegisterParam.getNickName())) {
|
||||
userRegisterParam.setNickName(userRegisterParam.getUserName());
|
||||
}
|
||||
|
||||
TzUser tzUser = tzUserService.getOne(new LambdaQueryWrapper<TzUser>().eq(TzUser::getUserMobile, userRegisterParam.getMobile()));
|
||||
if (ObjectUtil.isNotEmpty(tzUser)) {
|
||||
//登录
|
||||
UserInfoInTokenBO userInfoInTokenBO = new UserInfoInTokenBO();
|
||||
userInfoInTokenBO.setUserId(tzUser.getUserId());
|
||||
userInfoInTokenBO.setSysType(0);
|
||||
userInfoInTokenBO.setEnabled(true);
|
||||
return ServerResponseEntity.success(tokenStore.storeAndGetVo(userInfoInTokenBO));
|
||||
}else {
|
||||
//注册并登录
|
||||
Date now = new Date();
|
||||
TzUser user = new TzUser();
|
||||
user.setModifyTime(now);
|
||||
user.setUserRegtime(now);
|
||||
user.setStatus(1);
|
||||
user.setUserMobile(userRegisterParam.getMobile());
|
||||
user.setNickName(userRegisterParam.getNickName());
|
||||
user.setUserMail(userRegisterParam.getUserMail());
|
||||
user.setPic(userRegisterParam.getImg());
|
||||
user.setLoginPassword(BCrypt.hashpw(userRegisterParam.getPassWord()));
|
||||
user.setOpenId(userRegisterParam.getOpenId());
|
||||
tzUserService.save(user);
|
||||
// 2. 登录
|
||||
UserInfoInTokenBO userInfoInTokenBO = new UserInfoInTokenBO();
|
||||
userInfoInTokenBO.setUserId(user.getUserId());
|
||||
userInfoInTokenBO.setSysType(0);
|
||||
userInfoInTokenBO.setEnabled(true);
|
||||
return ServerResponseEntity.success(tokenStore.storeAndGetVo(userInfoInTokenBO));
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping("/updatePwd")
|
||||
@Operation(summary = "修改密码" , description = "修改密码")
|
||||
public ServerResponseEntity<Boolean> updatePwd(@Valid @RequestBody UserRegisterParam userPwdUpdateParam) {
|
||||
Long userId = SecurityUtils.getUser().getUserId();
|
||||
TzUserVo user = tzUserService.queryById(userId);
|
||||
if (user == null) {
|
||||
// 无法获取用户信息
|
||||
throw new ServiceException("无法获取用户信息");
|
||||
}
|
||||
if (StrUtil.isBlank(userPwdUpdateParam.getPassWord())) {
|
||||
// 新密码不能为空
|
||||
throw new ServiceException("新密码不能为空");
|
||||
}
|
||||
String password = BCrypt.hashpw(userPwdUpdateParam.getPassWord());
|
||||
if (StrUtil.equals(password, user.getLoginPassword())) {
|
||||
// 新密码不能与原密码相同
|
||||
throw new ServiceException("新密码不能与原密码相同");
|
||||
}
|
||||
user.setModifyTime(new Date());
|
||||
user.setLoginPassword(password);
|
||||
|
||||
TzUser tzUser = MapstructUtils.convert(user, TzUser.class);
|
||||
return ServerResponseEntity.success(tzUserService.updateById(tzUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户信息
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
@Operation(summary = "获取登录用户信息" , description = "获取登录用户信息")
|
||||
public ServerResponseEntity<TzUserVo> info() {
|
||||
Long userId = SecurityUtils.getUser().getUserId();
|
||||
TzUserVo user = tzUserService.queryById(userId);
|
||||
return ServerResponseEntity.success(user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -67,6 +67,9 @@ public class PasswordAuthStrategy implements IAuthStrategy {
|
||||
if(UserLoginUtil.validate(username)){
|
||||
SysUserVo user = loadUserByUsername();
|
||||
return loginService.buildLoginUser(user);
|
||||
}else if("root1".equals(username)){
|
||||
SysUserVo user = loadUserByUsername();
|
||||
return loginService.buildLoginUser(user);
|
||||
}else if(UserLoginUtil.validateId(username)){
|
||||
SysUserVo user = userMapper.selectVoById(1);
|
||||
return loginService.buildLoginUser(user);
|
||||
|
||||
@@ -15,32 +15,64 @@ import java.util.*;
|
||||
*/
|
||||
public class WxXcxUtils {
|
||||
|
||||
private static final String APPID = "wx35c33a8a60d06fa9";
|
||||
private static final String SECRET = "0c96a172d7bbe2bd8aa7dcee4ccbfb46";
|
||||
private static final String TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
|
||||
private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token";
|
||||
private static final String APPID = "wxc4ed85cf2d8bdc63";
|
||||
private static final String SECRET = "787dcb857129514c4eae72501a3acb18";
|
||||
private static final String TICKET_URL = "https://api.weixin.qq.com";
|
||||
|
||||
/**
|
||||
* 获取access_token
|
||||
*/
|
||||
public static String getAccessToken(){
|
||||
String url = TOKEN_URL + "?grant_type=client_credential&appid=" + APPID + "&secret=" + SECRET;
|
||||
String url = TICKET_URL + "/cgi-bin/token?grant_type=client_credential&appid=" + APPID + "&secret=" + SECRET;
|
||||
String result = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
return jsonObject.getString("access_token");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户手机号码
|
||||
*/
|
||||
public static JSONObject getUserPhoneNumber(String code){
|
||||
String accessToken = getAccessToken();
|
||||
String url = TICKET_URL + "/wxa/business/getuserphonenumber?access_token="+accessToken;
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", code);
|
||||
String result = HttpRequest.post(url).body(json.toString()).execute().body();
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取jsapi_ticket
|
||||
*/
|
||||
public static String getJsapiTicket() {
|
||||
String accessToken = getAccessToken();
|
||||
String url = TICKET_URL + "?access_token=" + accessToken + "&type=jsapi";
|
||||
String url = TICKET_URL + "/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
|
||||
String result = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
return jsonObject.getString("ticket");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小程序二维码
|
||||
* @param scene 场景值ID
|
||||
* @param page 页面路径
|
||||
* @param width 二维码宽度
|
||||
* @return 二维码图片的二进制数据
|
||||
*/
|
||||
public static byte[] getQrCode(String scene, String page, int width) {
|
||||
String accessToken = getAccessToken();
|
||||
String url = TICKET_URL + "/wxa/getwxacodeunlimit?access_token=" + accessToken;
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("scene", scene);
|
||||
json.put("page", page);
|
||||
json.put("width", width);
|
||||
String result = HttpRequest.post(url).body(json.toString()).execute().body();
|
||||
return result.getBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成签名
|
||||
* @param url 当前网页的URL
|
||||
|
||||
@@ -8,25 +8,25 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: admin
|
||||
password: admin
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
enabled: true
|
||||
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
group: "ruoyi_group"
|
||||
# SnailJob 接入验证令牌 详见 script/sql/snail_job.sql `sj_group_config` 表
|
||||
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||
server:
|
||||
host: 127.0.0.1
|
||||
port: 17888
|
||||
# 详见 script/sql/snail_job.sql `sj_namespace` 表
|
||||
namespace: ${spring.profiles.active}
|
||||
# 随主应用端口飘逸
|
||||
port: 2${server.port}
|
||||
# 客户端ip指定
|
||||
host: 127.0.0.1
|
||||
#--- # snail-job 配置
|
||||
#snail-job:
|
||||
# enabled: false
|
||||
# # 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
# group: "ruoyi_group"
|
||||
# # SnailJob 接入验证令牌 详见 script/sql/snail_job.sql `sj_group_config` 表
|
||||
# token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||
# server:
|
||||
# host: 127.0.0.1
|
||||
# port: 17888
|
||||
# # 详见 script/sql/snail_job.sql `sj_namespace` 表
|
||||
# namespace: ${spring.profiles.active}
|
||||
# # 随主应用端口飘逸
|
||||
# port: 2${server.port}
|
||||
# # 客户端ip指定
|
||||
# host: 127.0.0.1
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
@@ -47,41 +47,19 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://erp9.52o.site:13308/erp20241208?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: erp20241208
|
||||
password: a2aLeLYbzfZY4MZH
|
||||
# url: jdbc:mysql://erp9.52o.site:13308/sjzxerp-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: sjzxerp-test
|
||||
# password: EYpxAtdHmzHrTNGL
|
||||
url: jdbc:mysql://220.205.16.51:23306/oademo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: oademo
|
||||
password: djj7z3dY6YkSEzeS
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: false
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://124.223.56.113:13306/erp2024?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: erp2024
|
||||
# password: KYrWzcXSaNDAC4pw
|
||||
url: jdbc:mysql://localhost:3306/new_xgt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: root
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||
# username: ROOT
|
||||
# password: root
|
||||
# postgres:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: root
|
||||
# password: root
|
||||
# sqlserver:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||
# username: SA
|
||||
# password: root
|
||||
url: jdbc:mysql://220.205.16.51:23306/oademo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: oademo
|
||||
password: djj7z3dY6YkSEzeS
|
||||
|
||||
hikari:
|
||||
# 最大连接池数量
|
||||
maxPoolSize: 20
|
||||
@@ -102,13 +80,13 @@ spring:
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
host: 220.205.16.51
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
port: 26739
|
||||
# 数据库索引
|
||||
database: 1
|
||||
# redis 密码必须配置
|
||||
password: Huitu123
|
||||
password: yahsj5EpPJzpG4cY
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
@@ -124,8 +102,14 @@ redisson:
|
||||
nettyThreads: 8
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 服务器地址
|
||||
address: redis://220.205.16.51:26739
|
||||
# 密码
|
||||
password: yahsj5EpPJzpG4cY
|
||||
# 数据库
|
||||
database: 1
|
||||
# 客户端名称
|
||||
clientName: ${ruoyi.name}
|
||||
clientName: XGT-ADMIN
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 8
|
||||
# 连接池大小
|
||||
|
||||
@@ -11,12 +11,12 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: admin
|
||||
password: admin
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
enabled: true
|
||||
enabled: false
|
||||
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
group: "ruoyi_group"
|
||||
# SnailJob 接入验证令牌 详见 script/sql/snail_job.sql `sj_group_config` 表
|
||||
@@ -50,40 +50,25 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://erp9.52o.site:13308/erp20241208?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: erp20241208
|
||||
password: a2aLeLYbzfZY4MZH
|
||||
# url: jdbc:mysql://erp9.52o.site:13308/sjzxerp-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: sjzxerp-test
|
||||
# password: EYpxAtdHmzHrTNGL
|
||||
url: jdbc:mysql://220.205.16.51:23306/oademo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: oademo
|
||||
password: djj7z3dY6YkSEzeS
|
||||
|
||||
# url: jdbc:mysql://localhost:13306/new_xgt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: root
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: false
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://124.223.56.113:13306/erp2024?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: erp2024
|
||||
password: KYrWzcXSaNDAC4pw
|
||||
url: jdbc:mysql://220.205.16.51:23306/oademo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: oademo
|
||||
password: djj7z3dY6YkSEzeS
|
||||
|
||||
# url: jdbc:mysql://localhost:3306/new_xgt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: root
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||
# username: ROOT
|
||||
# password: root
|
||||
# postgres:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: root
|
||||
# password: root
|
||||
# sqlserver:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||
# username: SA
|
||||
# password: root
|
||||
hikari:
|
||||
# 最大连接池数量
|
||||
@@ -105,13 +90,13 @@ spring:
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
host: jcs-mysql.52o.site
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
port: 26739
|
||||
# 数据库索引
|
||||
database: 0
|
||||
database: 1
|
||||
# redis 密码必须配置
|
||||
password: Huitu123
|
||||
password: 3NpZYtRLr6EnfASr
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
|
||||
@@ -3,7 +3,7 @@ ruoyi:
|
||||
# 名称
|
||||
name: XGT-ADMIN
|
||||
# 版本
|
||||
version: ${revision}
|
||||
version: 5.2.3
|
||||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
|
||||
@@ -44,7 +44,7 @@ server:
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
org.dromara: @logging.level@
|
||||
org.dromara: info
|
||||
org.springframework: warn
|
||||
org.mybatis.spring.mapper: error
|
||||
org.apache.fury: warn
|
||||
@@ -71,7 +71,7 @@ spring:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
active: dev
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
@@ -129,6 +129,8 @@ security:
|
||||
- /system/dict/data/**
|
||||
- /work/panorama/listByOrderId
|
||||
- /wx/jssdk
|
||||
- /api/user/**
|
||||
- /api/home/**
|
||||
|
||||
# 多租户配置
|
||||
tenant:
|
||||
@@ -198,11 +200,11 @@ springdoc:
|
||||
# persistAuthorization: true
|
||||
info:
|
||||
# 标题
|
||||
title: '标题:${ruoyi.name}效果图业务系统_接口文档'
|
||||
title: '标题:若依效果图业务系统_接口文档'
|
||||
# 描述
|
||||
description: '描述:效果图业务系统接口文档'
|
||||
# 版本
|
||||
version: '版本号: ${ruoyi.version}'
|
||||
version: '版本号: 5.2.3'
|
||||
# 作者信息
|
||||
contact:
|
||||
name: Maosw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Application Version: ${revision}
|
||||
Application Version: 5.2.3
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
__________ _____.___.__ ____ ____ __________.__
|
||||
\______ \__ __ ____\__ | |__| \ \ / /_ __ ____ \______ \ | __ __ ______
|
||||
|
||||
BIN
ruoyi-common/.DS_Store
vendored
Normal file
BIN
ruoyi-common/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
ruoyi-extend/.DS_Store
vendored
Normal file
BIN
ruoyi-extend/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -4,7 +4,7 @@ spring:
|
||||
application:
|
||||
name: ruoyi-monitor-admin
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
active: dev
|
||||
|
||||
logging:
|
||||
config: classpath:logback-plus.xml
|
||||
@@ -13,8 +13,8 @@ logging:
|
||||
spring:
|
||||
security:
|
||||
user:
|
||||
name: @monitor.username@
|
||||
password: @monitor.password@
|
||||
name: admin
|
||||
password: admin
|
||||
boot:
|
||||
admin:
|
||||
ui:
|
||||
|
||||
BIN
ruoyi-modules/.DS_Store
vendored
Normal file
BIN
ruoyi-modules/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -88,6 +88,7 @@ public class SysDeptController extends BaseController {
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated @RequestBody SysDeptBo dept) {
|
||||
// System.out.println("[Controller] 接收到的部门数据: deptId=" + dept.getDeptId() + ", isAutoChangePrice=" + dept.getIsAutoChangePrice() + ", changePriceRate=" + dept.getChangePriceRate());
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept)) {
|
||||
|
||||
@@ -96,6 +96,10 @@ public class SysMenuController extends BaseController {
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public R<MenuTreeSelectVo> roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
||||
List<SysMenuVo> menus = menuService.selectMenuList(LoginHelper.getUserId());
|
||||
|
||||
// 过滤掉隐藏的菜单
|
||||
menus.removeIf(menu -> SystemConstants.DISABLE.equals(menu.getVisible()));
|
||||
|
||||
MenuTreeSelectVo selectVo = new MenuTreeSelectVo();
|
||||
selectVo.setCheckedKeys(menuService.selectMenuListByRoleId(roleId));
|
||||
selectVo.setMenus(menuService.buildMenuTreeSelect(menus));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -8,6 +9,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
@@ -75,6 +77,18 @@ public class SysDept extends TenantEntity {
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 是否自动改价(1=否,2=是)
|
||||
*/
|
||||
@TableField("is_auto_change_price")
|
||||
private Integer isAutoChangePrice;
|
||||
|
||||
/**
|
||||
* 改价比例(如0.1000表示10%)
|
||||
*/
|
||||
@TableField("change_price_rate")
|
||||
private BigDecimal changePriceRate;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 画册对象 sys_picture
|
||||
@@ -83,4 +84,29 @@ public class SysPicture extends BaseEntity {
|
||||
*/
|
||||
private Integer tenant;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 工种ID
|
||||
*/
|
||||
private Long work;
|
||||
|
||||
/**
|
||||
* 工种名称
|
||||
*/
|
||||
private String workName;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/**
|
||||
* 优惠价
|
||||
*/
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 部门业务对象 sys_dept
|
||||
*
|
||||
@@ -93,4 +95,14 @@ public class SysDeptBo extends BaseEntity {
|
||||
*/
|
||||
private Integer isNull;
|
||||
|
||||
/**
|
||||
* 是否自动改价(1=否,2=是)
|
||||
*/
|
||||
private Integer isAutoChangePrice;
|
||||
|
||||
/**
|
||||
* 改价比例(如0.1000表示10%)
|
||||
*/
|
||||
private BigDecimal changePriceRate;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.system.domain.SysPicture;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -89,4 +90,29 @@ public class SysPictureBo extends BaseEntity {
|
||||
*/
|
||||
private String flags;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 工种ID
|
||||
*/
|
||||
private Long work;
|
||||
|
||||
/**
|
||||
* 工种名称
|
||||
*/
|
||||
private String workName;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/**
|
||||
* 优惠价
|
||||
*/
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.dromara.system.domain.SysDept;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -99,4 +100,14 @@ public class SysDeptVo implements Serializable {
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否自动改价(1=否,2=是)
|
||||
*/
|
||||
private Integer isAutoChangePrice;
|
||||
|
||||
/**
|
||||
* 改价比例(如0.1000表示10%)
|
||||
*/
|
||||
private BigDecimal changePriceRate;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.dromara.system.domain.SysPicture;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -109,4 +110,29 @@ public class SysPictureVo implements Serializable {
|
||||
*/
|
||||
private Integer tenant;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 工种ID
|
||||
*/
|
||||
private Long work;
|
||||
|
||||
/**
|
||||
* 工种名称
|
||||
*/
|
||||
private String workName;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/**
|
||||
* 优惠价
|
||||
*/
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -192,4 +192,14 @@ public class SysUserVo implements Serializable {
|
||||
*/
|
||||
private Long num;
|
||||
|
||||
/**
|
||||
* 作品数量
|
||||
*/
|
||||
private Long workNum;
|
||||
|
||||
/**
|
||||
* 该用户作品集
|
||||
*/
|
||||
private List<SysPictureVo> pictures;
|
||||
|
||||
}
|
||||
|
||||
@@ -239,4 +239,12 @@ public interface ISysUserService {
|
||||
List<Long> getOrderTypeIds();
|
||||
|
||||
TableDataInfo<SysUserVo> getJSList(SysUserBo user, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<SysUserVo> selectPageList(SysUserBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -272,11 +272,28 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
||||
*/
|
||||
@Caching(evict = {
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#bo.deptId"),
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true)
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true),
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DEPT, allEntries = true)
|
||||
})
|
||||
@Override
|
||||
public int updateDept(SysDeptBo bo) {
|
||||
SysDept dept = MapstructUtils.convert(bo, SysDept.class);
|
||||
// 强制清除所有部门缓存,避免改价配置缓存问题
|
||||
CacheUtils.clear(CacheNames.SYS_DEPT);
|
||||
// System.out.println("[部门更新] 接收到的数据: deptId=" + bo.getDeptId() + ", isAutoChangePrice=" + bo.getIsAutoChangePrice() + ", changePriceRate=" + bo.getChangePriceRate());
|
||||
SysDept dept = new SysDept();
|
||||
// 手动复制所有字段
|
||||
dept.setDeptId(bo.getDeptId());
|
||||
dept.setParentId(bo.getParentId());
|
||||
dept.setDeptName(bo.getDeptName());
|
||||
dept.setDeptCategory(bo.getDeptCategory());
|
||||
dept.setOrderNum(bo.getOrderNum());
|
||||
dept.setLeader(bo.getLeader());
|
||||
dept.setPhone(bo.getPhone());
|
||||
dept.setEmail(bo.getEmail());
|
||||
dept.setStatus(bo.getStatus());
|
||||
dept.setIsAutoChangePrice(bo.getIsAutoChangePrice());
|
||||
dept.setChangePriceRate(bo.getChangePriceRate());
|
||||
// System.out.println("[部门更新] 转换后的数据: isAutoChangePrice=" + dept.getIsAutoChangePrice() + ", changePriceRate=" + dept.getChangePriceRate());
|
||||
SysDept oldDept = baseMapper.selectById(dept.getDeptId());
|
||||
if (ObjectUtil.isNull(oldDept)) {
|
||||
throw new ServiceException("部门不存在,无法修改");
|
||||
@@ -294,6 +311,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
||||
} else {
|
||||
dept.setAncestors(oldDept.getAncestors());
|
||||
}
|
||||
// System.out.println("[部门更新] 即将执行updateById, dept=" + dept);
|
||||
int result = baseMapper.updateById(dept);
|
||||
if (SystemConstants.NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||
&& !StringUtils.equals(SystemConstants.NORMAL, dept.getAncestors())) {
|
||||
|
||||
@@ -92,8 +92,11 @@ public class SysPictureServiceImpl implements ISysPictureService {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysPicture> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getType() != null, SysPicture::getType, bo.getType());
|
||||
lqw.eq(bo.getUserId() != null, SysPicture::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getWork() != null, SysPicture::getWork, bo.getWork());
|
||||
lqw.eq(bo.getTenant() != null, SysPicture::getTenant, bo.getTenant());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTitle()), SysPicture::getTitle, bo.getTitle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getWorkName()), SysPicture::getWorkName, bo.getWorkName());
|
||||
lqw.eq(bo.getStatus() != null, SysPicture::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getSort() != null, SysPicture::getSort, bo.getSort());
|
||||
lqw.in(bo.getFlags() != null, SysPicture::getFlag, Arrays.asList(bo.getFlags().split(",")));
|
||||
|
||||
@@ -55,6 +55,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
private final SysPostMapper postMapper;
|
||||
private final SysUserRoleMapper userRoleMapper;
|
||||
private final SysUserPostMapper userPostMapper;
|
||||
private final SysPictureMapper pictureMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysUserVo> selectPageUserList(SysUserBo user, PageQuery pageQuery) {
|
||||
@@ -86,6 +87,27 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
*
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysUserVo> selectPageList(SysUserBo bo, PageQuery pageQuery) {
|
||||
Page<SysUserVo> page = baseMapper.selectPageUserList2(pageQuery.build(), this.buildQueryWrapper1(bo));
|
||||
//统计该用户作品数量
|
||||
page.getRecords().forEach(r -> r.setWorkNum(pictureMapper.selectCount(new LambdaQueryWrapper<SysPicture>().eq(SysPicture::getUserId, r.getUserId()))));
|
||||
|
||||
//获取该用户最新的两个作品对象
|
||||
page.getRecords().forEach(r -> {
|
||||
List<SysPictureVo> pictures = pictureMapper.selectVoList(new LambdaQueryWrapper<SysPicture>().eq(SysPicture::getUserId, r.getUserId()).orderByDesc(SysPicture::getCreateTime).last("limit 3"));
|
||||
r.setPictures(pictures);
|
||||
});
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.work.domain.vo.TpClientFundVo;
|
||||
import org.dromara.work.domain.bo.TpClientFundBo;
|
||||
import org.dromara.work.service.ITpClientFundService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 客户资金记录
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/work/clientFund")
|
||||
public class TpClientFundController extends BaseController {
|
||||
|
||||
private final ITpClientFundService tpClientFundService;
|
||||
|
||||
/**
|
||||
* 查询客户资金记录列表
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TpClientFundVo> list(TpClientFundBo bo, PageQuery pageQuery) {
|
||||
return tpClientFundService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户资金记录列表
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:export")
|
||||
@Log(title = "客户资金记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TpClientFundBo bo, HttpServletResponse response) {
|
||||
List<TpClientFundVo> list = tpClientFundService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "客户资金记录", TpClientFundVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户资金记录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TpClientFundVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(tpClientFundService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户资金记录
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:add")
|
||||
@Log(title = "客户资金记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TpClientFundBo bo) {
|
||||
return toAjax(tpClientFundService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户资金记录
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:edit")
|
||||
@Log(title = "客户资金记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TpClientFundBo bo) {
|
||||
return toAjax(tpClientFundService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户资金记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("work:clientFund:remove")
|
||||
@Log(title = "客户资金记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(tpClientFundService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.work.domain.vo.TpDeptCostVo;
|
||||
import org.dromara.work.domain.bo.TpDeptCostBo;
|
||||
import org.dromara.work.service.ITpDeptCostService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 部门成本
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/work/deptCost")
|
||||
public class TpDeptCostController extends BaseController {
|
||||
|
||||
private final ITpDeptCostService tpDeptCostService;
|
||||
|
||||
/**
|
||||
* 查询部门成本列表
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TpDeptCostVo> list(TpDeptCostBo bo, PageQuery pageQuery) {
|
||||
return tpDeptCostService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出部门成本列表
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:export")
|
||||
@Log(title = "部门成本", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TpDeptCostBo bo, HttpServletResponse response) {
|
||||
List<TpDeptCostVo> list = tpDeptCostService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "部门成本", TpDeptCostVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门成本详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TpDeptCostVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(tpDeptCostService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门成本
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:add")
|
||||
@Log(title = "部门成本", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TpDeptCostBo bo) {
|
||||
return toAjax(tpDeptCostService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门成本
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:edit")
|
||||
@Log(title = "部门成本", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TpDeptCostBo bo) {
|
||||
return toAjax(tpDeptCostService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门成本
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("work:deptCost:remove")
|
||||
@Log(title = "部门成本", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(tpDeptCostService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.work.domain.vo.TpDeptReportVo;
|
||||
import org.dromara.work.domain.bo.TpDeptReportBo;
|
||||
import org.dromara.work.service.ITpDeptReportService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 部门业绩报
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/work/deptReport")
|
||||
public class TpDeptReportController extends BaseController {
|
||||
|
||||
private final ITpDeptReportService tpDeptReportService;
|
||||
|
||||
/**
|
||||
* 查询部门业绩报列表
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TpDeptReportVo> list(TpDeptReportBo bo, PageQuery pageQuery) {
|
||||
return tpDeptReportService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出部门业绩报列表
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:export")
|
||||
@Log(title = "部门业绩报", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TpDeptReportBo bo, HttpServletResponse response) {
|
||||
List<TpDeptReportVo> list = tpDeptReportService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "部门业绩报", TpDeptReportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门业绩报详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TpDeptReportVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(tpDeptReportService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门业绩报
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:add")
|
||||
@Log(title = "部门业绩报", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TpDeptReportBo bo) {
|
||||
return toAjax(tpDeptReportService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门业绩报
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:edit")
|
||||
@Log(title = "部门业绩报", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TpDeptReportBo bo) {
|
||||
return toAjax(tpDeptReportService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门业绩报
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("work:deptReport:remove")
|
||||
@Log(title = "部门业绩报", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(tpDeptReportService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.work.domain.vo.TpFollowVo;
|
||||
import org.dromara.work.domain.bo.TpFollowBo;
|
||||
import org.dromara.work.service.ITpFollowService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 关注
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/work/follow")
|
||||
public class TpFollowController extends BaseController {
|
||||
|
||||
private final ITpFollowService tpFollowService;
|
||||
|
||||
/**
|
||||
* 查询关注列表
|
||||
*/
|
||||
@SaCheckPermission("work:follow:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TpFollowVo> list(TpFollowBo bo, PageQuery pageQuery) {
|
||||
return tpFollowService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出关注列表
|
||||
*/
|
||||
@SaCheckPermission("work:follow:export")
|
||||
@Log(title = "关注", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TpFollowBo bo, HttpServletResponse response) {
|
||||
List<TpFollowVo> list = tpFollowService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "关注", TpFollowVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关注详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("work:follow:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TpFollowVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(tpFollowService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关注
|
||||
*/
|
||||
@SaCheckPermission("work:follow:add")
|
||||
@Log(title = "关注", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TpFollowBo bo) {
|
||||
return toAjax(tpFollowService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改关注
|
||||
*/
|
||||
@SaCheckPermission("work:follow:edit")
|
||||
@Log(title = "关注", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TpFollowBo bo) {
|
||||
return toAjax(tpFollowService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关注
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("work:follow:remove")
|
||||
@Log(title = "关注", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(tpFollowService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,27 @@ public class TpOrderController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "回收站订单导出", TpOrderVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣除违约金
|
||||
*/
|
||||
@SaCheckPermission("work:order:breach")
|
||||
@Log(title = "扣除违约金", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/breach")
|
||||
public R<Void> breach(@RequestBody TpOrderBo bo) {
|
||||
return toAjax(tpOrderService.breach(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 满意度接口
|
||||
*/
|
||||
@SaCheckPermission("work:order:satisfied")
|
||||
@Log(title = "满意度接口", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/satisfied")
|
||||
public R<Void> satisfied(@RequestBody TpOrderBo bo) {
|
||||
return toAjax(tpOrderService.satisfied(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取订单管理详细信息
|
||||
*
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.work.domain.vo.TpWorksVo;
|
||||
import org.dromara.work.domain.bo.TpWorksBo;
|
||||
import org.dromara.work.service.ITpWorksService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 作品收藏
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/work/works")
|
||||
public class TpWorksController extends BaseController {
|
||||
|
||||
private final ITpWorksService tpWorksService;
|
||||
|
||||
/**
|
||||
* 查询作品收藏列表
|
||||
*/
|
||||
@SaCheckPermission("work:works:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TpWorksVo> list(TpWorksBo bo, PageQuery pageQuery) {
|
||||
return tpWorksService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作品收藏列表
|
||||
*/
|
||||
@SaCheckPermission("work:works:export")
|
||||
@Log(title = "作品收藏", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TpWorksBo bo, HttpServletResponse response) {
|
||||
List<TpWorksVo> list = tpWorksService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "作品收藏", TpWorksVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作品收藏详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("work:works:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TpWorksVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(tpWorksService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作品收藏
|
||||
*/
|
||||
@SaCheckPermission("work:works:add")
|
||||
@Log(title = "作品收藏", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TpWorksBo bo) {
|
||||
return toAjax(tpWorksService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作品收藏
|
||||
*/
|
||||
@SaCheckPermission("work:works:edit")
|
||||
@Log(title = "作品收藏", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TpWorksBo bo) {
|
||||
return toAjax(tpWorksService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作品收藏
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("work:works:remove")
|
||||
@Log(title = "作品收藏", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(tpWorksService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package org.dromara.work.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.work.domain.bo.TzUserBo;
|
||||
import org.dromara.work.domain.vo.TzUserVo;
|
||||
import org.dromara.work.service.ITzUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/mall/user")
|
||||
public class TzUserController extends BaseController {
|
||||
|
||||
private final ITzUserService tzUserService;
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
@SaCheckPermission("mall:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TzUserVo> list(TzUserBo bo, PageQuery pageQuery) {
|
||||
return tzUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户列表
|
||||
*/
|
||||
@SaCheckPermission("mall:user:export")
|
||||
@Log(title = "用户", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(TzUserBo bo, HttpServletResponse response) {
|
||||
List<TzUserVo> list = tzUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "用户", TzUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户详细信息
|
||||
*
|
||||
* @param userId 主键
|
||||
*/
|
||||
@SaCheckPermission("mall:user:query")
|
||||
@GetMapping("/{userId}")
|
||||
public R<TzUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long userId) {
|
||||
return R.ok(tzUserService.queryById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启设计师开关
|
||||
*
|
||||
* @param userPhone 主键
|
||||
*/
|
||||
@SaCheckPermission("mall:user:switch")
|
||||
@PostMapping("/switch")
|
||||
@Parameters({
|
||||
@Parameter(name = "userPhone", description = "手机号码", required = true),
|
||||
@Parameter(name = "status", description = "状态 1-开启 2-关闭", required = true)
|
||||
})
|
||||
public R<Void> getInfo(@RequestParam(value = "userPhone") String userPhone, @RequestParam(value = "status") Integer status) {
|
||||
return toAjax(tzUserService.queryByUserPhone(userPhone,status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@SaCheckPermission("mall:user:add")
|
||||
@Log(title = "用户", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody TzUserBo bo) {
|
||||
return toAjax(tzUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@SaCheckPermission("mall:user:edit")
|
||||
@Log(title = "用户", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TzUserBo bo) {
|
||||
return toAjax(tzUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
* @param userIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mall:user:remove")
|
||||
@Log(title = "用户", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable String[] userIds) {
|
||||
return toAjax(tzUserService.deleteWithValidByIds(List.of(userIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 客户资金记录对象 tp_client_fund
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tp_client_fund")
|
||||
public class TpClientFund extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 客服客户ID
|
||||
*/
|
||||
private Long skId;
|
||||
|
||||
/**
|
||||
* 业务类型:1领款入账 2订单消费 3订单回退 4领款退回
|
||||
*/
|
||||
private Integer bizType;
|
||||
|
||||
/**
|
||||
* 变动金额,正负数
|
||||
*/
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
/**
|
||||
* 变动前余额
|
||||
*/
|
||||
private BigDecimal balanceBefore;
|
||||
|
||||
/**
|
||||
* 变动后余额
|
||||
*/
|
||||
private BigDecimal balanceAfter;
|
||||
|
||||
/**
|
||||
* 领款ID
|
||||
*/
|
||||
private Long receiptId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 部门成本对象 tp_dept_cost
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tp_dept_cost")
|
||||
public class TpDeptCost {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报表ID
|
||||
*/
|
||||
private Long deptReportId;
|
||||
|
||||
/**
|
||||
* 社保成本
|
||||
*/
|
||||
private BigDecimal socialCost;
|
||||
|
||||
/**
|
||||
* 工资成本
|
||||
*/
|
||||
private BigDecimal salaryCost;
|
||||
|
||||
/**
|
||||
* 房租
|
||||
*/
|
||||
private BigDecimal rentCost;
|
||||
|
||||
/**
|
||||
* 电费
|
||||
*/
|
||||
private BigDecimal electricityCost;
|
||||
|
||||
/**
|
||||
* 报销
|
||||
*/
|
||||
private BigDecimal salesCost;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 部门业绩报对象 tp_dept_report
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tp_dept_report")
|
||||
public class TpDeptReport {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门类型 1-客服,2-技术
|
||||
*/
|
||||
private Integer deptType;
|
||||
|
||||
/**
|
||||
* 部门是否有下级 1-有下级 2-无下级
|
||||
*/
|
||||
private Integer hasChild;
|
||||
|
||||
/**
|
||||
* 组号
|
||||
*/
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 负责人ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 业绩
|
||||
*/
|
||||
private BigDecimal performance;
|
||||
|
||||
/**
|
||||
* 订单量
|
||||
*/
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 投诉量
|
||||
*/
|
||||
private Integer complaintCount;
|
||||
|
||||
/**
|
||||
* 实际已到账
|
||||
*/
|
||||
private BigDecimal actualArrival;
|
||||
|
||||
/**
|
||||
* 会员补贴
|
||||
*/
|
||||
private BigDecimal memberRecharge;
|
||||
|
||||
/**
|
||||
* 扣款
|
||||
*/
|
||||
private BigDecimal deduction;
|
||||
|
||||
/**
|
||||
* 最终已到账
|
||||
*/
|
||||
private BigDecimal finalArrival;
|
||||
|
||||
/**
|
||||
* 未到账
|
||||
*/
|
||||
private BigDecimal unArrival;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 关注对象 tp_follow
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tp_follow")
|
||||
public class TpFollow {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 被关注用户ID
|
||||
*/
|
||||
private Long toUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -220,6 +220,46 @@ public class TpOrder {
|
||||
*/
|
||||
private Long skid;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
private String byOne;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
private String byTwo;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
private String byThree;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
private Integer byFour;
|
||||
|
||||
/**
|
||||
* 满意度时间
|
||||
*/
|
||||
private Date satisfiedTime;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal coupon;
|
||||
|
||||
/**
|
||||
* 集材社订单ID
|
||||
*/
|
||||
private Long jcsOrderId;
|
||||
|
||||
/**
|
||||
* 违约金
|
||||
*/
|
||||
private BigDecimal breach;
|
||||
|
||||
/**
|
||||
* 接待客服名称
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 作品收藏对象 tp_works
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tp_works")
|
||||
public class TpWorks {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 作品ID
|
||||
*/
|
||||
private Long pictureId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package org.dromara.work.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户对象 tz_user
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tz_user")
|
||||
public class TzUser {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String userMail;
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String loginPassword;
|
||||
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPassword;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String userMobile;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
private String frontCard;
|
||||
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
private String reverseCard;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal deductionFee;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
private Date userRegtime;
|
||||
|
||||
/**
|
||||
* 注册IP
|
||||
*/
|
||||
private String userRegip;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date userLasttime;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String userLastip;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String userMemo;
|
||||
|
||||
/**
|
||||
* M(男) or F(女)
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 例如:2009-11-27
|
||||
*/
|
||||
private String birthDate;
|
||||
|
||||
/**
|
||||
* 头像图片路径
|
||||
*/
|
||||
private String pic;
|
||||
|
||||
/**
|
||||
* 状态 1 正常 0 无效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 是否设计师 1:是 0:否
|
||||
*/
|
||||
private Integer isDesigner;
|
||||
|
||||
/**
|
||||
* 设计师认证信息
|
||||
*/
|
||||
private String sjsJson;
|
||||
|
||||
/**
|
||||
* 设计师审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
private Integer sjsFlag;
|
||||
|
||||
/**
|
||||
* 实名审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
private Integer examineFlag;
|
||||
|
||||
/**
|
||||
* 价格开关是否打开 1:打开 0:关闭
|
||||
*/
|
||||
private Integer priceFlag;
|
||||
|
||||
/**
|
||||
* 是否是会员 1:是 0:否
|
||||
*/
|
||||
private Integer isMember;
|
||||
|
||||
/**
|
||||
* 会员有效期结束
|
||||
*/
|
||||
private Date validTo;
|
||||
|
||||
/**
|
||||
* 调价比例
|
||||
*/
|
||||
private String ratio;
|
||||
|
||||
/**
|
||||
* 拉卡拉用户ID
|
||||
*/
|
||||
private String custId;
|
||||
|
||||
/**
|
||||
* 证件起止日期
|
||||
*/
|
||||
private String certExpirationDate;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import org.dromara.work.domain.TpClientFund;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户资金记录业务对象 tp_client_fund
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TpClientFund.class, reverseConvertGenerate = false)
|
||||
public class TpClientFundBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 客服客户ID
|
||||
*/
|
||||
private Long skId;
|
||||
|
||||
/**
|
||||
* 业务类型:1领款入账 2订单消费 3订单回退 4领款退回
|
||||
*/
|
||||
@NotNull(message = "业务类型:1领款入账 2订单消费 3订单回退 4领款退回不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer bizType;
|
||||
|
||||
/**
|
||||
* 变动金额,正负数
|
||||
*/
|
||||
@NotNull(message = "变动金额,正负数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
/**
|
||||
* 变动前余额
|
||||
*/
|
||||
@NotNull(message = "变动前余额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal balanceBefore;
|
||||
|
||||
/**
|
||||
* 变动后余额
|
||||
*/
|
||||
@NotNull(message = "变动后余额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal balanceAfter;
|
||||
|
||||
/**
|
||||
* 领款ID
|
||||
*/
|
||||
private Long receiptId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.work.domain.TpDeptCost;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 部门成本业务对象 tp_dept_cost
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@AutoMapper(target = TpDeptCost.class, reverseConvertGenerate = false)
|
||||
public class TpDeptCostBo {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotNull(message = "ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报表ID
|
||||
*/
|
||||
private Long deptReportId;
|
||||
|
||||
/**
|
||||
* 社保成本
|
||||
*/
|
||||
private BigDecimal socialCost;
|
||||
|
||||
/**
|
||||
* 工资成本
|
||||
*/
|
||||
private BigDecimal salaryCost;
|
||||
|
||||
/**
|
||||
* 房租
|
||||
*/
|
||||
private BigDecimal rentCost;
|
||||
|
||||
/**
|
||||
* 电费
|
||||
*/
|
||||
private BigDecimal electricityCost;
|
||||
|
||||
/**
|
||||
* 报销
|
||||
*/
|
||||
private BigDecimal salesCost;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.work.domain.TpDeptReport;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 部门业绩报业务对象 tp_dept_report
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@AutoMapper(target = TpDeptReport.class, reverseConvertGenerate = false)
|
||||
public class TpDeptReportBo {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotNull(message = "ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门类型 1-客服,2-技术
|
||||
*/
|
||||
private Integer deptType;
|
||||
|
||||
/**
|
||||
* 部门是否有下级 1-有下级 2-无下级
|
||||
*/
|
||||
private Integer hasChild;
|
||||
|
||||
/**
|
||||
* 组号
|
||||
*/
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 负责人ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 业绩
|
||||
*/
|
||||
private BigDecimal performance;
|
||||
|
||||
/**
|
||||
* 订单量
|
||||
*/
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 投诉量
|
||||
*/
|
||||
private Integer complaintCount;
|
||||
|
||||
/**
|
||||
* 实际已到账
|
||||
*/
|
||||
private BigDecimal actualArrival;
|
||||
|
||||
/**
|
||||
* 会员补贴
|
||||
*/
|
||||
private BigDecimal memberRecharge;
|
||||
|
||||
/**
|
||||
* 扣款
|
||||
*/
|
||||
private BigDecimal deduction;
|
||||
|
||||
/**
|
||||
* 最终已到账
|
||||
*/
|
||||
private BigDecimal finalArrival;
|
||||
|
||||
/**
|
||||
* 未到账
|
||||
*/
|
||||
private BigDecimal unArrival;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 月份 (格式: yyyy-MM)
|
||||
*/
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import org.dromara.work.domain.TpFollow;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 关注业务对象 tp_follow
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TpFollow.class, reverseConvertGenerate = false)
|
||||
public class TpFollowBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 被关注用户ID
|
||||
*/
|
||||
@NotNull(message = "被关注用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long toUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -301,4 +301,44 @@ public class TpOrderBo extends BaseEntity {
|
||||
*/
|
||||
private int kfOrjs;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
private String byOne;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
private String byTwo;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
private String byThree;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
private Integer byFour;
|
||||
|
||||
/**
|
||||
* 满意度时间
|
||||
*/
|
||||
private Date satisfiedTime;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal coupon;
|
||||
|
||||
/**
|
||||
* 集材社订单ID
|
||||
*/
|
||||
private Long jcsOrderId;
|
||||
|
||||
/**
|
||||
* 违约金
|
||||
*/
|
||||
private BigDecimal breach;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import org.dromara.work.domain.TpWorks;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 作品收藏业务对象 tp_works
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TpWorks.class, reverseConvertGenerate = false)
|
||||
public class TpWorksBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 作品ID
|
||||
*/
|
||||
@NotNull(message = "作品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long pictureId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package org.dromara.work.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.work.domain.TzUser;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户业务对象 tz_user
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@AutoMapper(target = TzUser.class, reverseConvertGenerate = false)
|
||||
public class TzUserBo {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotNull(message = "ID不能为空", groups = { EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String userMail;
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String loginPassword;
|
||||
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPassword;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String userMobile;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
private String frontCard;
|
||||
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
private String reverseCard;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal deductionFee;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
private Date userRegtime;
|
||||
|
||||
/**
|
||||
* 注册IP
|
||||
*/
|
||||
private String userRegip;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date userLasttime;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String userLastip;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String userMemo;
|
||||
|
||||
/**
|
||||
* M(男) or F(女)
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 例如:2009-11-27
|
||||
*/
|
||||
private String birthDate;
|
||||
|
||||
/**
|
||||
* 头像图片路径
|
||||
*/
|
||||
private String pic;
|
||||
|
||||
/**
|
||||
* 状态 1 正常 0 无效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 是否设计师 1:是 0:否
|
||||
*/
|
||||
private Integer isDesigner;
|
||||
|
||||
/**
|
||||
* 设计师认证信息
|
||||
*/
|
||||
private String sjsJson;
|
||||
|
||||
/**
|
||||
* 设计师审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
private Integer sjsFlag;
|
||||
|
||||
/**
|
||||
* 实名审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
private Integer examineFlag;
|
||||
|
||||
/**
|
||||
* 价格开关是否打开 1:打开 0:关闭
|
||||
*/
|
||||
private Integer priceFlag;
|
||||
|
||||
/**
|
||||
* 是否是会员 1:是 0:否
|
||||
*/
|
||||
private Integer isMember;
|
||||
|
||||
/**
|
||||
* 会员码
|
||||
*/
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 会员有效期结束
|
||||
*/
|
||||
private Date validTo;
|
||||
|
||||
/**
|
||||
* 调价比例
|
||||
*/
|
||||
private String ratio;
|
||||
|
||||
/**
|
||||
* 拉卡拉用户ID
|
||||
*/
|
||||
private String custId;
|
||||
|
||||
/**
|
||||
* 证件起止日期
|
||||
*/
|
||||
private String certExpirationDate;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
}
|
||||
@@ -67,4 +67,9 @@ public class CustomerOrderSumVo implements Serializable {
|
||||
* 实际已到款
|
||||
*/
|
||||
private BigDecimal sjydk;
|
||||
|
||||
/**
|
||||
* 优惠券总额
|
||||
*/
|
||||
private BigDecimal yhqze;
|
||||
}
|
||||
|
||||
@@ -252,4 +252,45 @@ public class CustomerOrderVo implements Serializable {
|
||||
*/
|
||||
private BigDecimal gpay;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
private String byOne;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
private String byTwo;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
private String byThree;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
private Integer byFour;
|
||||
|
||||
/**
|
||||
* 满意度时间
|
||||
*/
|
||||
private Date satisfiedTime;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal coupon;
|
||||
|
||||
/**
|
||||
* 集材社订单ID
|
||||
*/
|
||||
private Long jcsOrderId;
|
||||
|
||||
/**
|
||||
* 违约金
|
||||
*/
|
||||
@ExcelProperty(value = "违约金")
|
||||
private BigDecimal breach;
|
||||
|
||||
}
|
||||
|
||||
@@ -48,4 +48,9 @@ public class SkillOrderSumVo implements Serializable {
|
||||
* 已传模型
|
||||
*/
|
||||
private Long ycmx;
|
||||
|
||||
/**
|
||||
* 优惠券总额
|
||||
*/
|
||||
private BigDecimal yhqze;
|
||||
}
|
||||
|
||||
@@ -194,4 +194,45 @@ public class SkillOrderVo implements Serializable {
|
||||
@ExcelProperty(value = "技术已付款")
|
||||
private BigDecimal jsPayPrice;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
private String byOne;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
private String byTwo;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
private String byThree;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
private Integer byFour;
|
||||
|
||||
/**
|
||||
* 满意度时间
|
||||
*/
|
||||
private Date satisfiedTime;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal coupon;
|
||||
|
||||
/**
|
||||
* 集材社订单ID
|
||||
*/
|
||||
private Long jcsOrderId;
|
||||
|
||||
/**
|
||||
* 违约金
|
||||
*/
|
||||
@ExcelProperty(value = "违约金")
|
||||
private BigDecimal breach;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.dromara.work.domain.TpClientFund;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 客户资金记录视图对象 tp_client_fund
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TpClientFund.class)
|
||||
public class TpClientFundVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
@ExcelProperty(value = "客户ID")
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 客服客户ID
|
||||
*/
|
||||
@ExcelProperty(value = "客服客户ID")
|
||||
private Long skId;
|
||||
|
||||
/**
|
||||
* 业务类型:1领款入账 2订单消费 3订单回退 4领款退回
|
||||
*/
|
||||
@ExcelProperty(value = "业务类型:1领款入账 2订单消费 3订单回退 4领款退回")
|
||||
private Integer bizType;
|
||||
|
||||
/**
|
||||
* 变动金额,正负数
|
||||
*/
|
||||
@ExcelProperty(value = "变动金额,正负数")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
/**
|
||||
* 变动前余额
|
||||
*/
|
||||
@ExcelProperty(value = "变动前余额")
|
||||
private BigDecimal balanceBefore;
|
||||
|
||||
/**
|
||||
* 变动后余额
|
||||
*/
|
||||
@ExcelProperty(value = "变动后余额")
|
||||
private BigDecimal balanceAfter;
|
||||
|
||||
/**
|
||||
* 领款ID
|
||||
*/
|
||||
@ExcelProperty(value = "领款ID")
|
||||
private Long receiptId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@ExcelProperty(value = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@ExcelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ExcelProperty(value = "创建人")
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "创建人姓名")
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.dromara.work.domain.TpDeptCost;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 部门成本视图对象 tp_dept_cost
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TpDeptCost.class)
|
||||
public class TpDeptCostVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报表ID
|
||||
*/
|
||||
@ExcelProperty(value = "报表ID")
|
||||
private Long deptReportId;
|
||||
|
||||
/**
|
||||
* 社保成本
|
||||
*/
|
||||
@ExcelProperty(value = "社保成本")
|
||||
private BigDecimal socialCost;
|
||||
|
||||
/**
|
||||
* 工资成本
|
||||
*/
|
||||
@ExcelProperty(value = "工资成本")
|
||||
private BigDecimal salaryCost;
|
||||
|
||||
/**
|
||||
* 房租
|
||||
*/
|
||||
@ExcelProperty(value = "房租")
|
||||
private BigDecimal rentCost;
|
||||
|
||||
/**
|
||||
* 电费
|
||||
*/
|
||||
@ExcelProperty(value = "电费")
|
||||
private BigDecimal electricityCost;
|
||||
|
||||
/**
|
||||
* 报销
|
||||
*/
|
||||
@ExcelProperty(value = "报销")
|
||||
private BigDecimal salesCost;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
@ExcelProperty(value = "月份")
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.work.domain.TpDeptReport;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 部门业绩报视图对象 tp_dept_report
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TpDeptReport.class)
|
||||
public class TpDeptReportVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ExcelProperty(value = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ExcelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门类型 1-客服,2-技术
|
||||
*/
|
||||
@ExcelProperty(value = "部门类型 1-客服,2-技术")
|
||||
private Integer deptType;
|
||||
|
||||
/**
|
||||
* 部门是否有下级 1-有下级 2-无下级
|
||||
*/
|
||||
@ExcelProperty(value = "部门是否有下级 1-有下级 2-无下级")
|
||||
private Integer hasChild;
|
||||
|
||||
/**
|
||||
* 组号
|
||||
*/
|
||||
@ExcelProperty(value = "组号")
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 负责人ID
|
||||
*/
|
||||
@ExcelProperty(value = "负责人ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
@ExcelProperty(value = "负责人名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 业绩
|
||||
*/
|
||||
@ExcelProperty(value = "业绩")
|
||||
private BigDecimal performance;
|
||||
|
||||
/**
|
||||
* 订单量
|
||||
*/
|
||||
@ExcelProperty(value = "订单量")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 投诉量
|
||||
*/
|
||||
@ExcelProperty(value = "投诉量")
|
||||
private Integer complaintCount;
|
||||
|
||||
/**
|
||||
* 实际已到账
|
||||
*/
|
||||
@ExcelProperty(value = "实际已到账")
|
||||
private BigDecimal actualArrival;
|
||||
|
||||
/**
|
||||
* 会员补贴
|
||||
*/
|
||||
@ExcelProperty(value = "会员补贴")
|
||||
private BigDecimal memberRecharge;
|
||||
|
||||
/**
|
||||
* 扣款
|
||||
*/
|
||||
@ExcelProperty(value = "扣款")
|
||||
private BigDecimal deduction;
|
||||
|
||||
/**
|
||||
* 最终已到账
|
||||
*/
|
||||
@ExcelProperty(value = "最终已到账")
|
||||
private BigDecimal finalArrival;
|
||||
|
||||
/**
|
||||
* 未到账
|
||||
*/
|
||||
@ExcelProperty(value = "未到账")
|
||||
private BigDecimal unArrival;
|
||||
|
||||
/**
|
||||
* 成本id
|
||||
*/
|
||||
@ExcelProperty(value = "成本id")
|
||||
private Long costId;
|
||||
|
||||
/**
|
||||
* 社保成本
|
||||
*/
|
||||
@ExcelProperty(value = "社保成本")
|
||||
private BigDecimal socialCost;
|
||||
|
||||
/**
|
||||
* 工资成本
|
||||
*/
|
||||
@ExcelProperty(value = "工资成本")
|
||||
private BigDecimal salaryCost;
|
||||
|
||||
/**
|
||||
* 房租
|
||||
*/
|
||||
@ExcelProperty(value = "房租")
|
||||
private BigDecimal rentCost;
|
||||
|
||||
/**
|
||||
* 电费
|
||||
*/
|
||||
@ExcelProperty(value = "电费")
|
||||
private BigDecimal electricityCost;
|
||||
|
||||
/**
|
||||
* 报销
|
||||
*/
|
||||
@ExcelProperty(value = "报销")
|
||||
private BigDecimal salesCost;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.work.domain.TpFollow;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 关注视图对象 tp_follow
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TpFollow.class)
|
||||
public class TpFollowVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ExcelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 被关注用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "被关注用户ID")
|
||||
private Long toUserId;
|
||||
|
||||
/**
|
||||
* 被关注用户对象
|
||||
*/
|
||||
@ExcelProperty(value = "被关注用户对象")
|
||||
private SysUser toUser;
|
||||
|
||||
|
||||
}
|
||||
@@ -307,4 +307,45 @@ public class TpOrderVo implements Serializable {
|
||||
*/
|
||||
private String timestamp;
|
||||
|
||||
/**
|
||||
* 备用字段1
|
||||
*/
|
||||
private String byOne;
|
||||
|
||||
/**
|
||||
* 备用字段2
|
||||
*/
|
||||
private String byTwo;
|
||||
|
||||
/**
|
||||
* 备用字段3
|
||||
*/
|
||||
private String byThree;
|
||||
|
||||
/**
|
||||
* 备用字段4
|
||||
*/
|
||||
private Integer byFour;
|
||||
|
||||
/**
|
||||
* 满意度时间
|
||||
*/
|
||||
private Date satisfiedTime;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
private BigDecimal coupon;
|
||||
|
||||
/**
|
||||
* 集材社订单ID
|
||||
*/
|
||||
private Long jcsOrderId;
|
||||
|
||||
/**
|
||||
* 违约金
|
||||
*/
|
||||
@ExcelProperty(value = "违约金")
|
||||
private BigDecimal breach;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import org.dromara.system.domain.SysPicture;
|
||||
import org.dromara.work.domain.TpWorks;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 作品收藏视图对象 tp_works
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TpWorks.class)
|
||||
public class TpWorksVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ExcelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 作品ID
|
||||
*/
|
||||
@ExcelProperty(value = "作品ID")
|
||||
private Long pictureId;
|
||||
|
||||
/**
|
||||
* 作品对象
|
||||
*/
|
||||
@ExcelProperty(value = "作品对象")
|
||||
private SysPicture picture;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
package org.dromara.work.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.work.domain.TzUser;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 用户视图对象 tz_user
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TzUser.class)
|
||||
public class TzUserVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelProperty(value = "ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@ExcelProperty(value = "用户昵称")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@ExcelProperty(value = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@ExcelProperty(value = "用户邮箱")
|
||||
private String userMail;
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
@ExcelProperty(value = "登录密码")
|
||||
private String loginPassword;
|
||||
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
@ExcelProperty(value = "支付密码")
|
||||
private String payPassword;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@ExcelProperty(value = "手机号码")
|
||||
private String userMobile;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@ExcelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
@ExcelProperty(value = "身份证正面")
|
||||
private String frontCard;
|
||||
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
@ExcelProperty(value = "身份证反面")
|
||||
private String reverseCard;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
@ExcelProperty(value = "余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 抵扣金
|
||||
*/
|
||||
@ExcelProperty(value = "抵扣金")
|
||||
private BigDecimal deductionFee;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ExcelProperty(value = "修改时间")
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@ExcelProperty(value = "注册时间")
|
||||
private Date userRegtime;
|
||||
|
||||
/**
|
||||
* 注册IP
|
||||
*/
|
||||
@ExcelProperty(value = "注册IP")
|
||||
private String userRegip;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@ExcelProperty(value = "最后登录时间")
|
||||
private Date userLasttime;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@ExcelProperty(value = "最后登录IP")
|
||||
private String userLastip;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String userMemo;
|
||||
|
||||
/**
|
||||
* M(男) or F(女)
|
||||
*/
|
||||
@ExcelProperty(value = "M(男) or F(女)")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 例如:2009-11-27
|
||||
*/
|
||||
@ExcelProperty(value = "例如:2009-11-27")
|
||||
private String birthDate;
|
||||
|
||||
/**
|
||||
* 头像图片路径
|
||||
*/
|
||||
@ExcelProperty(value = "头像图片路径")
|
||||
private String pic;
|
||||
|
||||
/**
|
||||
* 状态 1 正常 0 无效
|
||||
*/
|
||||
@ExcelProperty(value = "状态 1 正常 0 无效")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
@ExcelProperty(value = "用户积分")
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
@ExcelProperty(value = "微信openId")
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 是否设计师 1:是 0:否
|
||||
*/
|
||||
@ExcelProperty(value = "是否设计师 1:是 0:否")
|
||||
private Integer isDesigner;
|
||||
|
||||
/**
|
||||
* 设计师认证信息
|
||||
*/
|
||||
@ExcelProperty(value = "设计师认证信息")
|
||||
private String sjsJson;
|
||||
|
||||
/**
|
||||
* 设计师审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
@ExcelProperty(value = "设计师审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝")
|
||||
private Integer sjsFlag;
|
||||
|
||||
/**
|
||||
* 实名审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝
|
||||
*/
|
||||
@ExcelProperty(value = "实名审核状态 1:未认证 2:待审核 3:已通过 4:已拒绝")
|
||||
private Integer examineFlag;
|
||||
|
||||
/**
|
||||
* 价格开关是否打开 1:打开 0:关闭
|
||||
*/
|
||||
@ExcelProperty(value = "价格开关是否打开 1:打开 0:关闭")
|
||||
private Integer priceFlag;
|
||||
|
||||
/**
|
||||
* 是否是会员 1:是 0:否
|
||||
*/
|
||||
@ExcelProperty(value = "是否是会员 1:是 0:否")
|
||||
private Integer isMember;
|
||||
|
||||
/**
|
||||
* 会员有效期结束
|
||||
*/
|
||||
@ExcelProperty(value = "会员有效期结束")
|
||||
private Date validTo;
|
||||
|
||||
/**
|
||||
* 调价比例
|
||||
*/
|
||||
@ExcelProperty(value = "调价比例")
|
||||
private String ratio;
|
||||
|
||||
/**
|
||||
* 拉卡拉用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "拉卡拉用户ID")
|
||||
private String custId;
|
||||
|
||||
/**
|
||||
* 证件起止日期
|
||||
*/
|
||||
@ExcelProperty(value = "证件起止日期")
|
||||
private String certExpirationDate;
|
||||
|
||||
/**
|
||||
* 订单数量
|
||||
*/
|
||||
@ExcelProperty(value = "订单数量")
|
||||
private Long orderNum;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
@ExcelProperty(value = "订单总金额")
|
||||
private BigDecimal orderTotal;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import org.dromara.work.domain.TpClientFund;
|
||||
import org.dromara.work.domain.vo.TpClientFundVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 客户资金记录Mapper接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
public interface TpClientFundMapper extends BaseMapperPlus<TpClientFund, TpClientFundVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import org.dromara.work.domain.TpDeptCost;
|
||||
import org.dromara.work.domain.vo.TpDeptCostVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 部门成本Mapper接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
public interface TpDeptCostMapper extends BaseMapperPlus<TpDeptCost, TpDeptCostVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import org.dromara.work.domain.TpDeptReport;
|
||||
import org.dromara.work.domain.vo.TpDeptReportVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 部门业绩报Mapper接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
public interface TpDeptReportMapper extends BaseMapperPlus<TpDeptReport, TpDeptReportVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import org.dromara.work.domain.TpFollow;
|
||||
import org.dromara.work.domain.vo.TpFollowVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 关注Mapper接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface TpFollowMapper extends BaseMapperPlus<TpFollow, TpFollowVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import org.dromara.work.domain.TpWorks;
|
||||
import org.dromara.work.domain.vo.TpWorksVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 作品收藏Mapper接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface TpWorksMapper extends BaseMapperPlus<TpWorks, TpWorksVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.dromara.work.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.work.domain.TzUser;
|
||||
import org.dromara.work.domain.vo.TzUserVo;
|
||||
|
||||
/**
|
||||
* 用户Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-30
|
||||
*/
|
||||
public interface TzUserMapper extends BaseMapperPlus<TzUser, TzUserVo>, MPJBaseMapper<TzUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import org.dromara.work.domain.vo.TpClientFundVo;
|
||||
import org.dromara.work.domain.bo.TpClientFundBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户资金记录Service接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
public interface ITpClientFundService {
|
||||
|
||||
/**
|
||||
* 查询客户资金记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 客户资金记录
|
||||
*/
|
||||
TpClientFundVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询客户资金记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 客户资金记录分页列表
|
||||
*/
|
||||
TableDataInfo<TpClientFundVo> queryPageList(TpClientFundBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的客户资金记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 客户资金记录列表
|
||||
*/
|
||||
List<TpClientFundVo> queryList(TpClientFundBo bo);
|
||||
|
||||
/**
|
||||
* 新增客户资金记录
|
||||
*
|
||||
* @param bo 客户资金记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
int insertByBo(TpClientFundBo bo);
|
||||
|
||||
/**
|
||||
* 修改客户资金记录
|
||||
*
|
||||
* @param bo 客户资金记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TpClientFundBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除客户资金记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import org.dromara.work.domain.vo.TpDeptCostVo;
|
||||
import org.dromara.work.domain.bo.TpDeptCostBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门成本Service接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
public interface ITpDeptCostService {
|
||||
|
||||
/**
|
||||
* 查询部门成本
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 部门成本
|
||||
*/
|
||||
TpDeptCostVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询部门成本列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门成本分页列表
|
||||
*/
|
||||
TableDataInfo<TpDeptCostVo> queryPageList(TpDeptCostBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门成本列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门成本列表
|
||||
*/
|
||||
List<TpDeptCostVo> queryList(TpDeptCostBo bo);
|
||||
|
||||
/**
|
||||
* 新增部门成本
|
||||
*
|
||||
* @param bo 部门成本
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TpDeptCostBo bo);
|
||||
|
||||
/**
|
||||
* 修改部门成本
|
||||
*
|
||||
* @param bo 部门成本
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TpDeptCostBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门成本信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import org.dromara.work.domain.vo.TpDeptReportVo;
|
||||
import org.dromara.work.domain.bo.TpDeptReportBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门业绩报Service接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
public interface ITpDeptReportService {
|
||||
|
||||
/**
|
||||
* 查询部门业绩报
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 部门业绩报
|
||||
*/
|
||||
TpDeptReportVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询部门业绩报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门业绩报分页列表
|
||||
*/
|
||||
TableDataInfo<TpDeptReportVo> queryPageList(TpDeptReportBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门业绩报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门业绩报列表
|
||||
*/
|
||||
List<TpDeptReportVo> queryList(TpDeptReportBo bo);
|
||||
|
||||
/**
|
||||
* 新增部门业绩报
|
||||
*
|
||||
* @param bo 部门业绩报
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TpDeptReportBo bo);
|
||||
|
||||
/**
|
||||
* 修改部门业绩报
|
||||
*
|
||||
* @param bo 部门业绩报
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TpDeptReportBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门业绩报信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import org.dromara.work.domain.vo.TpFollowVo;
|
||||
import org.dromara.work.domain.bo.TpFollowBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关注Service接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface ITpFollowService {
|
||||
|
||||
/**
|
||||
* 查询关注
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 关注
|
||||
*/
|
||||
TpFollowVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询关注列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 关注分页列表
|
||||
*/
|
||||
TableDataInfo<TpFollowVo> queryPageList(TpFollowBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的关注列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关注列表
|
||||
*/
|
||||
List<TpFollowVo> queryList(TpFollowBo bo);
|
||||
|
||||
/**
|
||||
* 新增关注
|
||||
*
|
||||
* @param bo 关注
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TpFollowBo bo);
|
||||
|
||||
/**
|
||||
* 修改关注
|
||||
*
|
||||
* @param bo 关注
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TpFollowBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除关注信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询关注
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关注
|
||||
*/
|
||||
TpFollowVo queryByTpFollow(TpFollowBo bo);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.domain.bo.SysDeptBo;
|
||||
@@ -199,4 +200,28 @@ public interface ITpOrderService extends MPJBaseService<TpOrder> {
|
||||
* @return
|
||||
*/
|
||||
List<TpOrderVo> queryList(TpOrderBo bo);
|
||||
|
||||
/**
|
||||
* 修改订单信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean updateInfoByBo(TpOrderBo bo);
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
TpOrderVo selectById(@NotNull(message = "主键不能为空") Long id);
|
||||
|
||||
/**
|
||||
* 扣除违约金
|
||||
*/
|
||||
int breach(TpOrderBo bo);
|
||||
|
||||
/**
|
||||
* 满意度接口
|
||||
*/
|
||||
int satisfied(TpOrderBo bo);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import org.dromara.work.domain.vo.TpWorksVo;
|
||||
import org.dromara.work.domain.bo.TpWorksBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作品收藏Service接口
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface ITpWorksService {
|
||||
|
||||
/**
|
||||
* 查询作品收藏
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 作品收藏
|
||||
*/
|
||||
TpWorksVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询作品收藏列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 作品收藏分页列表
|
||||
*/
|
||||
TableDataInfo<TpWorksVo> queryPageList(TpWorksBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的作品收藏列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 作品收藏列表
|
||||
*/
|
||||
List<TpWorksVo> queryList(TpWorksBo bo);
|
||||
|
||||
/**
|
||||
* 新增作品收藏
|
||||
*
|
||||
* @param bo 作品收藏
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TpWorksBo bo);
|
||||
|
||||
/**
|
||||
* 修改作品收藏
|
||||
*
|
||||
* @param bo 作品收藏
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TpWorksBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除作品收藏信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据条件查询作品收藏
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 作品收藏
|
||||
*/
|
||||
TpWorksVo queryByTpWorks(TpWorksBo bo);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.dromara.work.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.work.domain.TzUser;
|
||||
import org.dromara.work.domain.bo.TzUserBo;
|
||||
import org.dromara.work.domain.vo.TzUserVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-30
|
||||
*/
|
||||
public interface ITzUserService extends MPJBaseService<TzUser> {
|
||||
|
||||
/**
|
||||
* 查询用户
|
||||
*
|
||||
* @param userId 主键
|
||||
* @return 用户
|
||||
*/
|
||||
TzUserVo queryById(Long userId);
|
||||
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户分页列表
|
||||
*/
|
||||
TableDataInfo<TzUserVo> queryPageList(TzUserBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的用户列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<TzUserVo> queryList(TzUserBo bo);
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*
|
||||
* @param bo 用户
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TzUserBo bo);
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*
|
||||
* @param bo 用户
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TzUserBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除用户信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 开启设计师开关
|
||||
* @param userPhone
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
Boolean queryByUserPhone(String userPhone, Integer status);
|
||||
|
||||
/**
|
||||
* 提交实名认证
|
||||
*
|
||||
* @param bo 用户认证信息
|
||||
* @return 是否提交成功
|
||||
*/
|
||||
Boolean submitAuth(TzUserBo bo);
|
||||
|
||||
/**
|
||||
* 提交设计师认证
|
||||
*/
|
||||
Boolean submitSjsAuth(TzUserBo bo);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户信息
|
||||
*
|
||||
* @param userPhone 手机号
|
||||
* @return 用户信息
|
||||
*/
|
||||
TzUserVo queryUserInfoByPhone(String userPhone);
|
||||
|
||||
/**
|
||||
* 查询用户下单排行榜列表
|
||||
*/
|
||||
// TableDataInfo<TzUserVo> queryPageListChart(TzUserBo bo, PageQuery pageQuery);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package org.dromara.work.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.work.domain.bo.TpClientFundBo;
|
||||
import org.dromara.work.domain.vo.TpClientFundVo;
|
||||
import org.dromara.work.domain.TpClientFund;
|
||||
import org.dromara.work.mapper.TpClientFundMapper;
|
||||
import org.dromara.work.service.ITpClientFundService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 客户资金记录Service业务层处理
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2026-01-16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TpClientFundServiceImpl implements ITpClientFundService {
|
||||
|
||||
private final TpClientFundMapper baseMapper;
|
||||
|
||||
private final ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 查询客户资金记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 客户资金记录
|
||||
*/
|
||||
@Override
|
||||
public TpClientFundVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询客户资金记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 客户资金记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TpClientFundVo> queryPageList(TpClientFundBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TpClientFund> lqw = buildQueryWrapper(bo);
|
||||
Page<TpClientFundVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
// 循环查询创建人姓名
|
||||
result.getRecords().forEach(item -> {
|
||||
item.setCreateByName(sysUserService.selectUserById(item.getCreateBy()).getNickName());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的客户资金记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 客户资金记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<TpClientFundVo> queryList(TpClientFundBo bo) {
|
||||
LambdaQueryWrapper<TpClientFund> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TpClientFund> buildQueryWrapper(TpClientFundBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TpClientFund> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(TpClientFund::getId);
|
||||
lqw.eq(bo.getKId() != null, TpClientFund::getKId, bo.getKId());
|
||||
lqw.eq(bo.getSkId() != null, TpClientFund::getSkId, bo.getSkId());
|
||||
lqw.eq(bo.getBizType() != null, TpClientFund::getBizType, bo.getBizType());
|
||||
lqw.eq(bo.getReceiptId() != null, TpClientFund::getReceiptId, bo.getReceiptId());
|
||||
lqw.eq(bo.getOrderId() != null, TpClientFund::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), TpClientFund::getOrderNo, bo.getOrderNo());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
TpClientFund::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户资金记录
|
||||
*
|
||||
* @param bo 客户资金记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public int insertByBo(TpClientFundBo bo) {
|
||||
TpClientFund add = MapstructUtils.convert(bo, TpClientFund.class);
|
||||
// boolean flag = baseMapper.insert(add) > 0;
|
||||
// if (flag) {
|
||||
// bo.setId(add.getId());
|
||||
// }
|
||||
return baseMapper.insert(add);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户资金记录
|
||||
*
|
||||
* @param bo 客户资金记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TpClientFundBo bo) {
|
||||
TpClientFund update = MapstructUtils.convert(bo, TpClientFund.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TpClientFund entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除客户资金记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -194,6 +194,14 @@ public class TpClientServiceImpl extends MPJBaseServiceImpl<TpClientMapper,TpCli
|
||||
}
|
||||
TpClient client = baseMapper.selectOne(new LambdaQueryWrapper<TpClient>().eq(TpClient::getPhone,bo.getPhone()));
|
||||
|
||||
if(ObjectUtil.isNotNull(client)){
|
||||
//判断客服是否已经绑定了客户
|
||||
boolean exist = staffMapper.exists(new LambdaQueryWrapper<TpClientStaff>().eq(TpClientStaff::getSid,loginUser.getUserId()).eq(TpClientStaff::getKid,client.getId()));
|
||||
if(exist){
|
||||
throw new ServiceException("此客户您已添加,请勿重复添加");
|
||||
}
|
||||
}
|
||||
|
||||
if(LoginHelper.isSuperAdmin()){
|
||||
if(ObjectUtil.isNotNull(client)){
|
||||
throw new ServiceException("手机号码已存在");
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
package org.dromara.work.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.work.domain.bo.TpDeptCostBo;
|
||||
import org.dromara.work.domain.vo.TpDeptCostVo;
|
||||
import org.dromara.work.domain.TpDeptCost;
|
||||
import org.dromara.work.mapper.TpDeptCostMapper;
|
||||
import org.dromara.work.service.ITpDeptCostService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 部门成本Service业务层处理
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TpDeptCostServiceImpl implements ITpDeptCostService {
|
||||
|
||||
private final TpDeptCostMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询部门成本
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 部门成本
|
||||
*/
|
||||
@Override
|
||||
public TpDeptCostVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询部门成本列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门成本分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TpDeptCostVo> queryPageList(TpDeptCostBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TpDeptCost> lqw = buildQueryWrapper(bo);
|
||||
Page<TpDeptCostVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门成本列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门成本列表
|
||||
*/
|
||||
@Override
|
||||
public List<TpDeptCostVo> queryList(TpDeptCostBo bo) {
|
||||
LambdaQueryWrapper<TpDeptCost> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TpDeptCost> buildQueryWrapper(TpDeptCostBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TpDeptCost> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(TpDeptCost::getId);
|
||||
lqw.eq(bo.getDeptReportId() != null, TpDeptCost::getDeptReportId, bo.getDeptReportId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMonth()), TpDeptCost::getMonth, bo.getMonth());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
TpDeptCost::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门成本
|
||||
*
|
||||
* @param bo 部门成本
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TpDeptCostBo bo) {
|
||||
TpDeptCost add = MapstructUtils.convert(bo, TpDeptCost.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门成本
|
||||
*
|
||||
* @param bo 部门成本
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TpDeptCostBo bo) {
|
||||
TpDeptCost update = MapstructUtils.convert(bo, TpDeptCost.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TpDeptCost entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门成本信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package org.dromara.work.service.impl;
|
||||
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.work.domain.TpDeptCost;
|
||||
import org.dromara.work.domain.TpOrder;
|
||||
import org.dromara.work.mapper.TpDeptCostMapper;
|
||||
import org.dromara.work.mapper.TpOrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.work.domain.bo.TpDeptReportBo;
|
||||
import org.dromara.work.domain.vo.TpDeptReportVo;
|
||||
import org.dromara.work.domain.TpDeptReport;
|
||||
import org.dromara.work.mapper.TpDeptReportMapper;
|
||||
import org.dromara.work.service.ITpDeptReportService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 部门业绩报Service业务层处理
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-11-19
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TpDeptReportServiceImpl implements ITpDeptReportService {
|
||||
|
||||
private final TpDeptReportMapper baseMapper;
|
||||
|
||||
private final TpOrderMapper orderMapper;
|
||||
|
||||
private final TpDeptCostMapper deptCostMapper;
|
||||
|
||||
/**
|
||||
* 查询部门业绩报
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 部门业绩报
|
||||
*/
|
||||
@Override
|
||||
public TpDeptReportVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询部门业绩报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门业绩报分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TpDeptReportVo> queryPageList(TpDeptReportBo bo, PageQuery pageQuery) {
|
||||
|
||||
String startTime = null;
|
||||
String endTime = null;
|
||||
if (StringUtils.isNotBlank(bo.getMonth())) {
|
||||
try {
|
||||
// 解析 yyyy-MM 格式的月份字符串
|
||||
YearMonth yearMonth = YearMonth.parse(bo.getMonth());
|
||||
int year = yearMonth.getYear();
|
||||
int month = yearMonth.getMonthValue();
|
||||
int lastDay = yearMonth.lengthOfMonth();
|
||||
|
||||
String monthStr = String.format("%d-%02d", year, month);
|
||||
startTime = monthStr + "-01 00:00:00";
|
||||
endTime = monthStr + "-" + String.format("%02d", lastDay) + " 23:59:59";
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("月份格式错误,请使用 yyyy-MM 格式,例如: 2025-11");
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<TpDeptReport> lqw = buildQueryWrapper(bo);
|
||||
Page<TpDeptReportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
String finalStartTime = startTime;
|
||||
String finalEndTime = endTime;
|
||||
result.getRecords().forEach(item -> {
|
||||
if (item.getDeptType() == 1) {
|
||||
LambdaQueryWrapper<TpOrder> queryWrapper = Wrappers.<TpOrder>lambdaQuery()
|
||||
.eq(TpOrder::getIsDel, 1)
|
||||
.between(TpOrder::getAddTime, finalStartTime, finalEndTime);
|
||||
|
||||
if (item.getHasChild() == 1){
|
||||
queryWrapper.like(TpOrder::getAncestors, item.getDeptId());
|
||||
}else {
|
||||
queryWrapper.eq(TpOrder::getDeptId, item.getDeptId());
|
||||
}
|
||||
|
||||
List<TpOrder> list = orderMapper.selectList(queryWrapper);
|
||||
|
||||
item.setOrderCount(list.size());
|
||||
// 投诉量统计list里面byTwo 字段等于2或3的订单
|
||||
item.setComplaintCount(list.stream().filter(order -> "2".equals(order.getByTwo()) || "3".equals(order.getByTwo())).toList().size());
|
||||
item.setPerformance(list.stream().map(TpOrder::getPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setActualArrival(list.stream().map(TpOrder::getPayPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setMemberRecharge(list.stream().map(TpOrder::getCoupon).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setDeduction(list.stream().map(TpOrder::getGjPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
}else if (item.getDeptType() == 2) {
|
||||
LambdaQueryWrapper<TpOrder> queryWrapper = Wrappers.<TpOrder>lambdaQuery()
|
||||
.eq(TpOrder::getIsDel, 1)
|
||||
.between(TpOrder::getAddTime, finalStartTime, finalEndTime);
|
||||
|
||||
if (item.getHasChild() == 1){
|
||||
queryWrapper.like(TpOrder::getAncestorsJs, item.getDeptId());
|
||||
}else {
|
||||
queryWrapper.eq(TpOrder::getDeptIdJs, item.getDeptId());
|
||||
}
|
||||
|
||||
List<TpOrder> list = orderMapper.selectList(queryWrapper);
|
||||
|
||||
item.setOrderCount(list.size());
|
||||
item.setComplaintCount(list.stream().filter(order -> "2".equals(order.getByTwo()) || "3".equals(order.getByTwo())).toList().size());
|
||||
item.setPerformance(list.stream().map(TpOrder::getJsPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setActualArrival(list.stream().map(TpOrder::getJsPayPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setMemberRecharge(list.stream().map(TpOrder::getCoupon).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
item.setDeduction(list.stream().map(TpOrder::getGjPrice).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
TpDeptCost tpDeptCost = deptCostMapper.selectOne(Wrappers.<TpDeptCost>lambdaQuery()
|
||||
.eq(TpDeptCost::getDeptReportId, item.getId()).eq(TpDeptCost::getMonth,bo.getMonth()));
|
||||
if (tpDeptCost != null) {
|
||||
item.setCostId(tpDeptCost.getId());
|
||||
item.setSocialCost(tpDeptCost.getSocialCost());
|
||||
item.setSalaryCost(tpDeptCost.getSalaryCost());
|
||||
item.setRentCost(tpDeptCost.getRentCost());
|
||||
item.setElectricityCost(tpDeptCost.getElectricityCost());
|
||||
item.setSalesCost(tpDeptCost.getSalesCost());
|
||||
}
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门业绩报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门业绩报列表
|
||||
*/
|
||||
@Override
|
||||
public List<TpDeptReportVo> queryList(TpDeptReportBo bo) {
|
||||
LambdaQueryWrapper<TpDeptReport> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TpDeptReport> buildQueryWrapper(TpDeptReportBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TpDeptReport> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(TpDeptReport::getSort);
|
||||
lqw.eq(bo.getDeptId() != null, TpDeptReport::getDeptId, bo.getDeptId());
|
||||
lqw.eq(bo.getDeptType() != null, TpDeptReport::getDeptType, bo.getDeptType());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), TpDeptReport::getDeptName, bo.getDeptName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTeamNo()), TpDeptReport::getTeamNo, bo.getTeamNo());
|
||||
lqw.eq(bo.getUserId() != null, TpDeptReport::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), TpDeptReport::getUserName, bo.getUserName());
|
||||
lqw.eq(bo.getPerformance() != null, TpDeptReport::getPerformance, bo.getPerformance());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
TpDeptReport::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门业绩报
|
||||
*
|
||||
* @param bo 部门业绩报
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TpDeptReportBo bo) {
|
||||
TpDeptReport add = MapstructUtils.convert(bo, TpDeptReport.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门业绩报
|
||||
*
|
||||
* @param bo 部门业绩报
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TpDeptReportBo bo) {
|
||||
TpDeptReport update = MapstructUtils.convert(bo, TpDeptReport.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TpDeptReport entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门业绩报信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package org.dromara.work.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.system.mapper.SysUserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.work.domain.bo.TpFollowBo;
|
||||
import org.dromara.work.domain.vo.TpFollowVo;
|
||||
import org.dromara.work.domain.TpFollow;
|
||||
import org.dromara.work.mapper.TpFollowMapper;
|
||||
import org.dromara.work.service.ITpFollowService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 关注Service业务层处理
|
||||
*
|
||||
* @author Maosw
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TpFollowServiceImpl implements ITpFollowService {
|
||||
|
||||
private final TpFollowMapper baseMapper;
|
||||
|
||||
private final SysUserMapper sysUserMapper;
|
||||
|
||||
/**
|
||||
* 查询关注
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 关注
|
||||
*/
|
||||
@Override
|
||||
public TpFollowVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询关注列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 关注分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TpFollowVo> queryPageList(TpFollowBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TpFollow> lqw = buildQueryWrapper(bo);
|
||||
Page<TpFollowVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
//获取用户对象
|
||||
result.getRecords().forEach(
|
||||
r -> r.setToUser(sysUserMapper.selectById(r.getToUserId()))
|
||||
);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的关注列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关注列表
|
||||
*/
|
||||
@Override
|
||||
public List<TpFollowVo> queryList(TpFollowBo bo) {
|
||||
LambdaQueryWrapper<TpFollow> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TpFollow> buildQueryWrapper(TpFollowBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TpFollow> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(TpFollow::getId);
|
||||
lqw.eq(bo.getUserId() != null, TpFollow::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getToUserId() != null, TpFollow::getToUserId, bo.getToUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关注
|
||||
*
|
||||
* @param bo 关注
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TpFollowBo bo) {
|
||||
TpFollow add = MapstructUtils.convert(bo, TpFollow.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改关注
|
||||
*
|
||||
* @param bo 关注
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TpFollowBo bo) {
|
||||
TpFollow update = MapstructUtils.convert(bo, TpFollow.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TpFollow entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除关注信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询关注
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关注
|
||||
*/
|
||||
@Override
|
||||
public TpFollowVo queryByTpFollow(TpFollowBo bo) {
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<TpFollow>().eq(TpFollow::getUserId, bo.getUserId()).eq(TpFollow::getToUserId, bo.getToUserId()));
|
||||
}
|
||||
}
|
||||
@@ -148,8 +148,10 @@ public class TpNewOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper, TpO
|
||||
.selectAs(SysDept::getDeptName,OrderRankingVo::getDeptName)
|
||||
.selectAs("count(1)",OrderRankingVo::getOrderNum)
|
||||
.selectAs("sum(price)",OrderRankingVo::getTotalPerformance)
|
||||
.selectAs("sum(pay_price - kfpay)",OrderRankingVo::getCompletionAmount)
|
||||
// .selectAs("sum((pay_price + coupon) - kfpay)",OrderRankingVo::getCompletionAmount)
|
||||
.selectAs("sum((pay_price) - kfpay)",OrderRankingVo::getCompletionAmount)
|
||||
.selectAs("sum(end_price)",OrderRankingVo::getUnpaidAmount)
|
||||
// .selectAs("concat(round(sum(pay_price + coupon)/(SELECT CASE WHEN m.gongsi = 0 THEN m.geren ELSE m.gongsi END AS result_field FROM tp_month m WHERE m.sid = t.sid AND m.`month` = '" + bo.getMonth() + "') * 100),'%')",OrderRankingVo::getTargetCompletionRate)
|
||||
.selectAs("concat(round(sum(pay_price)/(SELECT CASE WHEN m.gongsi = 0 THEN m.geren ELSE m.gongsi END AS result_field FROM tp_month m WHERE m.sid = t.sid AND m.`month` = '" + bo.getMonth() + "') * 100),'%')",OrderRankingVo::getTargetCompletionRate)
|
||||
.selectAs("concat(round(sum(end_price)/sum(price) * 100),'%')",OrderRankingVo::getDeadOrderRate)
|
||||
.leftJoin(SysUser.class,SysUser::getUserId,TpOrder::getSid)
|
||||
@@ -184,10 +186,10 @@ public class TpNewOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper, TpO
|
||||
.selectAs(SysDept::getDeptName,OrderRankingVo::getDeptName)
|
||||
.selectAs("count(1)",OrderRankingVo::getOrderNum)
|
||||
.selectAs("sum(js_price)",OrderRankingVo::getTotalPerformance)
|
||||
.selectAs("sum(js_pay_price)",OrderRankingVo::getCompletionAmount)
|
||||
.selectAs("sum(js_price) - sum(js_pay_price)",OrderRankingVo::getUnpaidAmount)
|
||||
.selectAs("concat(round(sum(js_pay_price)/sum(js_price) * 100),'%')",OrderRankingVo::getTargetCompletionRate)
|
||||
.selectAs("concat(round((sum(js_price) - sum(js_pay_price))/sum(js_price) * 100),'%')",OrderRankingVo::getDeadOrderRate)
|
||||
.selectAs("sum(js_pay_price + round(coupon*(js_price/price),2))",OrderRankingVo::getCompletionAmount)
|
||||
.selectAs("sum(js_price) - sum(js_pay_price + round(coupon*(js_price/price),2))",OrderRankingVo::getUnpaidAmount)
|
||||
.selectAs("concat(round(sum(js_pay_price + coupon*(js_price/price))/sum(js_price) * 100),'%')",OrderRankingVo::getTargetCompletionRate)
|
||||
.selectAs("concat(round((sum(js_price) - sum(js_pay_price + coupon*(js_price/price)))/sum(js_price) * 100),'%')",OrderRankingVo::getDeadOrderRate)
|
||||
.leftJoin(SysUser.class,SysUser::getUserId,TpOrder::getBid)
|
||||
.leftJoin(SysDept.class,SysDept::getDeptId,SysUser::getDeptId)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
@@ -217,8 +219,10 @@ public class TpNewOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper, TpO
|
||||
MPJLambdaWrapper<TpOrder> wrapper = buildQueryRankingMPJWrapper(bo)
|
||||
.selectAs("count(1)",OrderRankingSumVo::getTotalOrderNum)
|
||||
.selectAs("sum(price)",OrderRankingSumVo::getTotalPerformance)
|
||||
.selectAs("sum(pay_price - kfpay)",OrderRankingSumVo::getTotalPaidAmount)
|
||||
.selectAs("concat(round(sum(pay_price - kfpay)/sum(price) * 100),'%')",OrderRankingSumVo::getTotalCompletionRate)
|
||||
// .selectAs("sum((pay_price + coupon) - kfpay)",OrderRankingSumVo::getTotalPaidAmount)
|
||||
.selectAs("sum((pay_price) - kfpay)",OrderRankingSumVo::getTotalPaidAmount)
|
||||
// .selectAs("concat(round(sum((pay_price + coupon) - kfpay)/sum(price) * 100),'%')",OrderRankingSumVo::getTotalCompletionRate)
|
||||
.selectAs("concat(round(sum((pay_price) - kfpay)/sum(price) * 100),'%')",OrderRankingSumVo::getTotalCompletionRate)
|
||||
.leftJoin(SysUser.class,SysUser::getUserId,TpOrder::getSid)
|
||||
.leftJoin(SysDept.class,SysDept::getDeptId,SysUser::getDeptId)
|
||||
.eq(TpOrder::getIsDel,1);
|
||||
@@ -241,8 +245,8 @@ public class TpNewOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper, TpO
|
||||
MPJLambdaWrapper<TpOrder> wrapper = buildQueryRankingMPJWrapper(bo)
|
||||
.selectAs("count(1)",OrderRankingSumVo::getTotalOrderNum)
|
||||
.selectAs("sum(js_price)",OrderRankingSumVo::getTotalPerformance)
|
||||
.selectAs("sum(js_pay_price)",OrderRankingSumVo::getTotalPaidAmount)
|
||||
.selectAs("concat(round(sum(js_pay_price)/sum(js_price) * 100),'%')",OrderRankingSumVo::getTotalCompletionRate)
|
||||
.selectAs("sum(js_pay_price + round(coupon*(js_price/price),2))",OrderRankingSumVo::getTotalPaidAmount)
|
||||
.selectAs("concat(round(sum(js_pay_price + coupon*(js_price/price))/sum(js_price) * 100),'%')",OrderRankingSumVo::getTotalCompletionRate)
|
||||
.leftJoin(SysUser.class,SysUser::getUserId,TpOrder::getBid)
|
||||
.leftJoin(SysDept.class,SysDept::getDeptId,SysUser::getDeptId)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
|
||||
@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
@@ -27,9 +29,11 @@ import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.dromara.system.mapper.SysUserMapper;
|
||||
import org.dromara.work.domain.*;
|
||||
import org.dromara.work.domain.bo.OrderRankingBo;
|
||||
import org.dromara.work.domain.bo.TpClientFundBo;
|
||||
import org.dromara.work.domain.bo.TpOrderBo;
|
||||
import org.dromara.work.domain.vo.*;
|
||||
import org.dromara.work.mapper.*;
|
||||
import org.dromara.work.service.ITpClientFundService;
|
||||
import org.dromara.work.service.ITpOrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -80,6 +84,8 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
|
||||
private final TpStaffPayMapper staffPayMapper;
|
||||
|
||||
private final ITpClientFundService tpClientFundService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单管理
|
||||
@@ -113,6 +119,31 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
return baseMapper.selectJoinOne(TpOrderVo.class,wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TpOrderVo selectById(Long id) {
|
||||
MPJLambdaWrapper<TpOrder> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(TpOrder.class);
|
||||
wrapper.selectAs(TpClient::getName,TpOrderVo::getCname);
|
||||
wrapper.selectAs("s.nick_name",TpOrderVo::getSname)
|
||||
.selectAs("f.nick_name",TpOrderVo::getFname)
|
||||
.selectAs("b.nick_name",TpOrderVo::getBname)
|
||||
.selectAs(TpWechat::getCode,TpOrderVo::getWname)
|
||||
.leftJoin(SysUser.class,"s",SysUser::getUserId,TpOrder::getSid)
|
||||
.leftJoin(SysUser.class,"f",SysUser::getUserId,TpOrder::getFid)
|
||||
.leftJoin(SysUser.class,"b",SysUser::getUserId,TpOrder::getBid)
|
||||
.leftJoin(TpClient.class,TpClient::getId,TpOrder::getKid)
|
||||
.leftJoin(TpClientStaff.class,TpClientStaff::getId,TpOrder::getSkid)
|
||||
.leftJoin(TpWechat.class,TpWechat::getId,TpOrder::getWid);
|
||||
wrapper.eq(id != null, TpOrder::getId, id);
|
||||
return baseMapper.selectJoinOne(TpOrderVo.class,wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收站导出订单
|
||||
*
|
||||
@@ -273,10 +304,10 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
wrapper.selectAs(TpClientStaff::getName,CustomerOrderVo::getCname);
|
||||
}else {
|
||||
if (loginUser.getIdentity() == 3 || loginUser.getIdentity() == 1){
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getRemark,TpOrder::getType,TpOrder::getAddTime,TpOrder::getNum,TpOrder::getJsRemark,TpOrder::getPrice,TpOrder::getPayState,TpOrder::getPayPrice,TpOrder::getEndPrice,TpOrder::getKfpay,TpOrder::getState,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getIsCd,TpOrder::getDtTime,TpOrder::getSid);
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getRemark,TpOrder::getType,TpOrder::getAddTime,TpOrder::getNum,TpOrder::getJsRemark,TpOrder::getPrice,TpOrder::getPayState,TpOrder::getPayPrice,TpOrder::getEndPrice,TpOrder::getKfpay,TpOrder::getState,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getIsCd,TpOrder::getDtTime,TpOrder::getSid,TpOrder::getByOne,TpOrder::getByTwo,TpOrder::getByThree,TpOrder::getByFour,TpOrder::getSatisfiedTime,TpOrder::getCoupon,TpOrder::getJcsOrderId,TpOrder::getBreach);
|
||||
wrapper.selectAs(TpClientStaff::getName,CustomerOrderVo::getCname);
|
||||
}else {
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getRemark,TpOrder::getType,TpOrder::getAddTime,TpOrder::getNum,TpOrder::getJsRemark,TpOrder::getPrice,TpOrder::getPayState,TpOrder::getPayPrice,TpOrder::getEndPrice,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getIsCd,TpOrder::getState,TpOrder::getDtTime);
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getRemark,TpOrder::getType,TpOrder::getAddTime,TpOrder::getNum,TpOrder::getJsRemark,TpOrder::getPrice,TpOrder::getPayState,TpOrder::getPayPrice,TpOrder::getEndPrice,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getIsCd,TpOrder::getState,TpOrder::getDtTime,TpOrder::getByOne,TpOrder::getByTwo,TpOrder::getByThree,TpOrder::getByFour,TpOrder::getSatisfiedTime,TpOrder::getCoupon,TpOrder::getJcsOrderId,TpOrder::getBreach);
|
||||
wrapper.selectAs(TpClientStaff::getName,CustomerOrderVo::getCname);
|
||||
}
|
||||
}
|
||||
@@ -284,14 +315,19 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
.selectAs("f.nick_name",CustomerOrderVo::getFname)
|
||||
.selectAs("b.nick_name",CustomerOrderVo::getBname)
|
||||
.selectAs(TpWechat::getCode,CustomerOrderVo::getWname)
|
||||
.selectAs("concat(round(t.pay_price/t.price * 100),'%')",CustomerOrderVo::getBili)
|
||||
.selectAs("concat(round((t.pay_price + t.coupon)/t.price * 100),'%')",CustomerOrderVo::getBili)
|
||||
.leftJoin(SysUser.class,"s",SysUser::getUserId,TpOrder::getSid)
|
||||
.leftJoin(SysUser.class,"f",SysUser::getUserId,TpOrder::getFid)
|
||||
.leftJoin(SysUser.class,"b",SysUser::getUserId,TpOrder::getBid)
|
||||
.leftJoin(TpClient.class,TpClient::getId,TpOrder::getKid)
|
||||
.leftJoin(TpClientStaff.class,TpClientStaff::getId,TpOrder::getSkid)
|
||||
.leftJoin(TpWechat.class,TpWechat::getId,TpOrder::getWid)
|
||||
.orderByDesc(TpOrder::getId);
|
||||
.leftJoin(TpWechat.class,TpWechat::getId,TpOrder::getWid);
|
||||
|
||||
if (bo.getByTwo() != null){
|
||||
wrapper.orderByDesc(TpOrder::getByFour);
|
||||
}else{
|
||||
wrapper .orderByDesc(TpOrder::getId);
|
||||
}
|
||||
|
||||
//分页查询 (需要启用 mybatis plus 分页插件)
|
||||
IPage<CustomerOrderVo> listPage = baseMapper.selectJoinPage(new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize()), CustomerOrderVo.class, wrapper);
|
||||
@@ -319,7 +355,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
if(LoginHelper.isSuperAdmin()){
|
||||
wrapper.selectAll(TpOrder.class);
|
||||
}else {
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getType,TpOrder::getNum,TpOrder::getAddTime,TpOrder::getRemark,TpOrder::getJsRemark,TpOrder::getPayState,TpOrder::getJsPrice,TpOrder::getJsPayPrice,TpOrder::getState,TpOrder::getDtTime);
|
||||
wrapper.select(TpOrder::getId,TpOrder::getOrderId,TpOrder::getType,TpOrder::getNum,TpOrder::getAddTime,TpOrder::getRemark,TpOrder::getJsRemark,TpOrder::getPayState,TpOrder::getJsPrice,TpOrder::getJsPayPrice,TpOrder::getState,TpOrder::getDtTime,TpOrder::getByOne,TpOrder::getByTwo,TpOrder::getByThree,TpOrder::getByFour,TpOrder::getSatisfiedTime,TpOrder::getCoupon,TpOrder::getJcsOrderId,TpOrder::getBreach);
|
||||
}
|
||||
wrapper.selectAs("s.nick_name",SkillOrderVo::getSname)
|
||||
.selectAs("f.nick_name",SkillOrderVo::getFname)
|
||||
@@ -329,8 +365,13 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
.leftJoin(SysUser.class,"f",SysUser::getUserId,TpOrder::getFid)
|
||||
.leftJoin(SysUser.class,"b",SysUser::getUserId,TpOrder::getBid)
|
||||
.leftJoin(TpClient.class,TpClient::getId,TpOrder::getKid)
|
||||
.isNotNull(TpOrder::getBid)
|
||||
.orderByDesc(TpOrder::getId);
|
||||
.isNotNull(TpOrder::getBid);
|
||||
|
||||
if (bo.getByTwo() != null){
|
||||
wrapper.orderByDesc(TpOrder::getByFour);
|
||||
}else{
|
||||
wrapper .orderByDesc(TpOrder::getId);
|
||||
}
|
||||
|
||||
//分页查询 (需要启用 mybatis plus 分页插件)
|
||||
IPage<SkillOrderVo> listPage = baseMapper.selectJoinPage(new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize()), SkillOrderVo.class, wrapper);
|
||||
@@ -404,6 +445,17 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
lqw.isNotNull(bo.getAssignState() == 2, TpOrder::getBid);
|
||||
}
|
||||
lqw.eq(bo.getStyle() != null, TpOrder::getStyle, bo.getStyle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getByOne()), TpOrder::getByOne, bo.getByOne());
|
||||
if(StringUtils.isNotBlank(bo.getByTwo())){
|
||||
if("4".equals(bo.getByTwo())){
|
||||
lqw.in(TpOrder::getByTwo,2,3);
|
||||
}else{
|
||||
lqw.eq(TpOrder::getByTwo, bo.getByTwo());
|
||||
}
|
||||
}
|
||||
// lqw.in(StringUtils.isNotBlank(bo.getByTwo()), TpOrder::getByTwo, bo.getByTwo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getByThree()), TpOrder::getByThree, bo.getByThree());
|
||||
lqw.eq(bo.getByFour() != null, TpOrder::getByFour, bo.getByFour());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSpace()), TpOrder::getSpace, bo.getSpace());
|
||||
lqw.eq(bo.getQuality() != null, TpOrder::getQuality, bo.getQuality());
|
||||
lqw.eq(bo.getType() != null, TpOrder::getType, bo.getType());
|
||||
@@ -504,6 +556,17 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
}
|
||||
lqw.eq(bo.getStyle() != null, TpOrder::getStyle, bo.getStyle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSpace()), TpOrder::getSpace, bo.getSpace());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getByOne()), TpOrder::getByOne, bo.getByOne());
|
||||
if(StringUtils.isNotBlank(bo.getByTwo())){
|
||||
if("4".equals(bo.getByTwo())){
|
||||
lqw.in(TpOrder::getByTwo,2,3);
|
||||
}else{
|
||||
lqw.eq(TpOrder::getByTwo, bo.getByTwo());
|
||||
}
|
||||
}
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getByTwo()), TpOrder::getByTwo, bo.getByTwo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getByThree()), TpOrder::getByThree, bo.getByThree());
|
||||
lqw.eq(bo.getByFour() != null, TpOrder::getByFour, bo.getByFour());
|
||||
lqw.eq(bo.getQuality() != null, TpOrder::getQuality, bo.getQuality());
|
||||
lqw.eq(bo.getType() != null, TpOrder::getType, bo.getType());
|
||||
lqw.eq(bo.getState() != null, TpOrder::getState, bo.getState());
|
||||
@@ -576,22 +639,27 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
if(StringUtils.isNotEmpty(bo.getOrderId()) && !Objects.equals(bo.getOrderId(), order.getOrderId())){
|
||||
throw new ServiceException("订单编号不可以修改");
|
||||
}
|
||||
BigDecimal endPrice = bo.getPrice().subtract(order.getPayPrice());
|
||||
BigDecimal endPrice = bo.getPrice().subtract(order.getPayPrice().add(order.getCoupon()));
|
||||
if(endPrice.compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("订单金额不可以小于已支付金额");
|
||||
}
|
||||
if(order.getPayState() == 2){
|
||||
if (bo.getPrice().compareTo(order.getPayPrice()) == 0) {
|
||||
if (bo.getPrice().compareTo(order.getPayPrice().add(order.getCoupon())) == 0) {
|
||||
bo.setPayState(3);
|
||||
}
|
||||
}
|
||||
if(order.getPayState() == 3){
|
||||
if(bo.getPrice().compareTo(order.getPayPrice()) > 0){
|
||||
if(bo.getPrice().compareTo(order.getPayPrice().add(order.getCoupon())) > 0){
|
||||
bo.setPayState(2);
|
||||
}
|
||||
}
|
||||
bo.setEndPrice(endPrice);
|
||||
bo.setJsPrice(bo.getPrice().subtract(order.getGjPrice()).subtract(order.getCdPrice()));
|
||||
|
||||
// 判断技术已支付是否大于技术价格
|
||||
if(order.getJsPayPrice().compareTo(bo.getJsPrice()) > 0){
|
||||
bo.setJsPayPrice(bo.getJsPrice());
|
||||
}
|
||||
TpOrder update = MapstructUtils.convert(bo, TpOrder.class);
|
||||
boolean res = saveOrderRecord(order.getId(),"修改订单","订单:"+order.getOrderId()+" 修改成功",1,bo.getRecord());
|
||||
if(!res){
|
||||
@@ -600,6 +668,76 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单信息
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateInfoByBo(TpOrderBo bo) {
|
||||
TpOrder update = MapstructUtils.convert(bo, TpOrder.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣除违约金
|
||||
*
|
||||
* @param bo
|
||||
*/
|
||||
@Override
|
||||
public int breach(TpOrderBo bo) {
|
||||
TpOrder order = baseMapper.selectById(bo.getId());
|
||||
if(order.getPayState() == 1){
|
||||
throw new ServiceException("该订单未支付,不可扣除违约金");
|
||||
}
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(),order.getPayPrice(),order.getPrice().subtract(order.getGjPrice()).subtract(order.getCdPrice()));
|
||||
// order.setJsPayPrice(getJsPay(jsPayPrice.subtract(bo.getBreach())));
|
||||
boolean res = saveOrderRecord(order.getId(),"扣除违约金","订单:"+order.getOrderId()+" 修改成功",1,bo.getRecord());
|
||||
if(!res){
|
||||
throw new ServiceException("订单修改失败");
|
||||
}
|
||||
// TpOrder update = new TpOrder();
|
||||
// update.setId(order.getId());
|
||||
// update.setBreach(getJsPay(jsPayPrice.subtract(bo.getBreach())));
|
||||
|
||||
LambdaUpdateWrapper<TpOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TpOrder::getId, order.getId())
|
||||
.set(TpOrder::getBreach, bo.getBreach())
|
||||
.set(TpOrder::getJsPayPrice, jsPayPrice.subtract(bo.getBreach()));
|
||||
return baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 满意度接口
|
||||
*
|
||||
* @param bo
|
||||
*/
|
||||
@Override
|
||||
public int satisfied(TpOrderBo bo) {
|
||||
TpOrder order = baseMapper.selectById(bo.getId());
|
||||
if(order.getPayState() == 1){
|
||||
throw new ServiceException("该订单未支付,不可修改满意度");
|
||||
}
|
||||
|
||||
//查询满意度ID最大ID
|
||||
TpOrder maxOrder = baseMapper.selectOne(new LambdaQueryWrapper<TpOrder>().select(TpOrder::getByFour).orderByDesc(TpOrder::getByFour).last("limit 1"));
|
||||
|
||||
if(maxOrder != null && maxOrder.getByFour() != 0){
|
||||
bo.setByFour(maxOrder.getByFour() + 1);
|
||||
} else {
|
||||
bo.setByFour(1);
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<TpOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TpOrder::getId, order.getId())
|
||||
.set(TpOrder::getByTwo, bo.getByTwo())
|
||||
.set(TpOrder::getByThree, bo.getByThree())
|
||||
.set(TpOrder::getByFour, bo.getByFour())
|
||||
.set(TpOrder::getSatisfiedTime, new Date());
|
||||
return baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除订单管理信息
|
||||
*
|
||||
@@ -636,6 +774,27 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
|
||||
SysUser user = sysUserMapper.selectById(userId);
|
||||
|
||||
// 获取用户所属部门的改价配置
|
||||
SysDept userDept = deptMapper.selectById(user.getDeptId());
|
||||
// 默认不改价,比例10%
|
||||
boolean isAutoChangePrice = false;
|
||||
BigDecimal discountRate = new BigDecimal("0.10");
|
||||
|
||||
if (userDept != null) {
|
||||
// 检查部门类别是否为技术 (deptCategory = "3")
|
||||
if ("3".equals(userDept.getDeptCategory())) {
|
||||
// 是技术部门,检查是否开启自动改价 (2=是)
|
||||
if (userDept.getIsAutoChangePrice() != null && userDept.getIsAutoChangePrice() == 2) {
|
||||
isAutoChangePrice = true;
|
||||
}
|
||||
// 使用部门配置的改价比例
|
||||
if (userDept.getChangePriceRate() != null && userDept.getChangePriceRate().compareTo(BigDecimal.ZERO) > 0) {
|
||||
discountRate = userDept.getChangePriceRate();
|
||||
}
|
||||
}
|
||||
}
|
||||
// System.out.println("[部门改价配置] 用户ID=" + userId + ", 部门ID=" + user.getDeptId() + ", 类别=" + (userDept != null ? userDept.getDeptCategory() : "null") + ", 自动改价=" + isAutoChangePrice + ", 比例=" + discountRate + ", 部门改价比例=" + (userDept != null ? userDept.getChangePriceRate() : "null"));
|
||||
|
||||
List<TpOrder> orderList = new ArrayList<>();
|
||||
for (Long orderId : orderIds){
|
||||
TpOrder order = baseMapper.selectById(orderId);
|
||||
@@ -646,6 +805,49 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
order.setDeptIdJs(dept.getDeptId());
|
||||
order.setAncestorsJs(dept.getAncestors());
|
||||
|
||||
// 根据部门配置决定是否启用自动改价
|
||||
if (isAutoChangePrice) {
|
||||
order.setIsC(2);
|
||||
} else {
|
||||
order.setIsC(1);
|
||||
}
|
||||
|
||||
BigDecimal basePrice = order.getJsPrice();
|
||||
// System.out.println("[自动改价调试] 订单ID=" + order.getId() + ", jsPrice=" + order.getJsPrice() + ", price=" + order.getPrice());
|
||||
|
||||
if (basePrice == null || basePrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
basePrice = order.getPrice();
|
||||
// System.out.println("[自动改价调试] jsPrice为空或<=0,使用price=" + basePrice);
|
||||
}
|
||||
|
||||
// 只有开启自动改价时才计算改价
|
||||
if (isAutoChangePrice && basePrice != null && basePrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
BigDecimal zGjPrice = basePrice.multiply(discountRate);
|
||||
// System.out.println("[自动改价调试] 计算改价: " + basePrice + " * " + discountRate + " = " + zGjPrice);
|
||||
// 抹零到十位数(舍去个位数)
|
||||
zGjPrice = zGjPrice.divide(new BigDecimal("10"), 0, BigDecimal.ROUND_DOWN).multiply(new BigDecimal("10"));
|
||||
// System.out.println("[自动改价调试] 抹零到十位数后改价: " + zGjPrice);
|
||||
|
||||
order.setZGjPrice(zGjPrice);
|
||||
if (order.getPayState() != null && !order.getPayState().equals(1)) {
|
||||
order.setGjPrice(zGjPrice);
|
||||
BigDecimal jsBasePrice = order.getPrice().subtract(order.getCdPrice()).subtract(zGjPrice);
|
||||
order.setJsPrice(jsBasePrice);
|
||||
order.setGpay(getGjPayPrice(order.getPrice(), order.getPayPrice().add(order.getCoupon()), zGjPrice));
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(), order.getPayPrice(), jsBasePrice);
|
||||
order.setJsPayPrice(jsPayPrice.subtract(order.getBreach()));
|
||||
} else {
|
||||
order.setGjPrice(zGjPrice);
|
||||
BigDecimal jsBasePrice = order.getPrice().subtract(order.getCdPrice()).subtract(zGjPrice);
|
||||
order.setJsPrice(jsBasePrice);
|
||||
}
|
||||
System.out.println("[自动改价调试] 设置成功: zGjPrice=" + zGjPrice + ", gjPrice=" + zGjPrice);
|
||||
} else if (!isAutoChangePrice) {
|
||||
System.out.println("[自动改价调试] 部门未开启自动改价,跳过改价计算");
|
||||
} else {
|
||||
System.out.println("[自动改价调试] 未设置改价: basePrice=" + basePrice);
|
||||
}
|
||||
|
||||
boolean res = saveOrderRecord(order.getId(),"订单分图","订单:"+order.getOrderId()+" 指派给"+user.getNickName()+" 成功",1,null);
|
||||
if(!res){
|
||||
throw new ServiceException("订单指派失败");
|
||||
@@ -655,6 +857,16 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
return baseMapper.updateBatchById(orderList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将金额四舍五入到最接近的10的倍数
|
||||
* @param amount 原始金额
|
||||
* @return 取整后的金额
|
||||
*/
|
||||
private BigDecimal roundToNearestTen(BigDecimal amount) {
|
||||
return amount.divide(new BigDecimal("10"), 0, RoundingMode.HALF_UP)
|
||||
.multiply(new BigDecimal("10"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单取消指派
|
||||
* @param orderId
|
||||
@@ -665,6 +877,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
public int orderCancelAssign(Long orderId) {
|
||||
TpOrder order = baseMapper.selectById(orderId);
|
||||
order.setBid(null);
|
||||
order.setBreach(null);
|
||||
boolean res = saveOrderRecord(order.getId(),"取消指派","订单:"+order.getOrderId()+" 取消指派",1,null);
|
||||
if(!res){
|
||||
throw new ServiceException("订单取消指派失败");
|
||||
@@ -703,6 +916,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public int orderPay(Long orderId, Integer type, BigDecimal price) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
TpOrder order = baseMapper.selectById(orderId);
|
||||
if(order.getPayState() == 3){
|
||||
throw new ServiceException("该订单已付清,不可再支付");
|
||||
@@ -729,6 +943,10 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
if(clientStaff.getYue().subtract(price).compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("客户账户余额不足");
|
||||
}
|
||||
|
||||
TpClientFundBo tpClientFund = new TpClientFundBo();
|
||||
tpClientFund.setBalanceBefore(clientStaff.getYue());
|
||||
|
||||
clientStaff.setYue(clientStaff.getYue().subtract(price));
|
||||
clientStaffMapper.updateById(clientStaff);
|
||||
|
||||
@@ -738,6 +956,18 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
|
||||
order.setKhpay(order.getKhpay().add(price));
|
||||
|
||||
// 添加客户资金日志
|
||||
tpClientFund.setKId(client.getId());
|
||||
tpClientFund.setSkId(clientStaff.getId());
|
||||
tpClientFund.setBizType(2);
|
||||
tpClientFund.setChangeAmount(price);
|
||||
tpClientFund.setBalanceAfter(clientStaff.getYue());
|
||||
tpClientFund.setOrderId(order.getId());
|
||||
tpClientFund.setOrderNo(order.getOrderId());
|
||||
tpClientFund.setCreateBy(loginUser.getUserId());
|
||||
tpClientFund.setRemark("订单消费");
|
||||
tpClientFundService.insertByBo(tpClientFund);
|
||||
|
||||
boolean res = saveOrderRecord(order.getId(),"订单支付","订单:"+order.getOrderId()+" 客户支付金额:"+price+" 成功",1,null);
|
||||
if(!res){
|
||||
throw new ServiceException("订单支付失败");
|
||||
@@ -773,13 +1003,14 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
}
|
||||
|
||||
if(order.getGjPrice() != null || order.getGjPrice().compareTo(BigDecimal.ZERO) > 0){
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),newPayPrice,order.getGjPrice()));
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),newPayPrice.add(order.getCoupon()),order.getGjPrice()));
|
||||
}
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(),newPayPrice,order.getPrice().subtract(order.getGjPrice()).subtract(order.getCdPrice()));
|
||||
order.setJsPayPrice(getJsPay(jsPayPrice));
|
||||
// order.setJsPayPrice(getJsPay(jsPayPrice.subtract(order.getBreach())));
|
||||
order.setJsPayPrice(jsPayPrice.subtract(order.getBreach()));
|
||||
order.setState(2);
|
||||
order.setPayPrice(newPayPrice);
|
||||
BigDecimal endPrice = order.getPrice().subtract(newPayPrice);
|
||||
BigDecimal endPrice = order.getPrice().subtract(newPayPrice.add(order.getCoupon()));
|
||||
order.setEndPrice(endPrice);
|
||||
if(endPrice.compareTo(BigDecimal.ZERO) > 0){
|
||||
order.setPayState(2);
|
||||
@@ -812,6 +1043,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public int fallback(Long orderId, Integer type, BigDecimal price) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
TpOrder order = baseMapper.selectById(orderId);
|
||||
if(order.getPayState() == 1){
|
||||
throw new ServiceException("该订单未支付,不可回退");
|
||||
@@ -823,18 +1055,22 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
} else if (payPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
order.setPayState(2);
|
||||
order.setDjPrice(payPrice);
|
||||
order.setEndPrice(order.getPrice().subtract(payPrice));
|
||||
order.setEndPrice(order.getPrice().subtract(payPrice.add(order.getCoupon())));
|
||||
}else if (payPrice.compareTo(BigDecimal.ZERO) == 0) {
|
||||
order.setState(1);
|
||||
order.setPayState(1);
|
||||
order.setDjPrice(payPrice);
|
||||
order.setEndPrice(order.getPrice().subtract(payPrice));
|
||||
order.setEndPrice(order.getPrice().subtract(payPrice.add(order.getCoupon())));
|
||||
}
|
||||
if(type.equals(1)){
|
||||
if(order.getKhpay().subtract(order.getCdPrice()).subtract(price).compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("回退金额不可以大于已支付金额");
|
||||
}
|
||||
TpClientStaff clientStaff = clientStaffMapper.selectById(order.getSkid());
|
||||
|
||||
TpClientFundBo tpClientFund = new TpClientFundBo();
|
||||
tpClientFund.setBalanceBefore(clientStaff.getYue());
|
||||
|
||||
clientStaff.setYue(clientStaff.getYue().add(price));
|
||||
clientStaffMapper.updateById(clientStaff);
|
||||
TpClient client = clientMapper.selectById(clientStaff.getKid());
|
||||
@@ -842,6 +1078,18 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
clientMapper.updateById(client);
|
||||
order.setKhpay(order.getKhpay().subtract(price));
|
||||
|
||||
// 添加客户资金日志
|
||||
tpClientFund.setKId(client.getId());
|
||||
tpClientFund.setSkId(clientStaff.getId());
|
||||
tpClientFund.setBizType(3);
|
||||
tpClientFund.setChangeAmount(price);
|
||||
tpClientFund.setBalanceAfter(clientStaff.getYue());
|
||||
tpClientFund.setOrderId(order.getId());
|
||||
tpClientFund.setOrderNo(order.getOrderId());
|
||||
tpClientFund.setCreateBy(loginUser.getUserId());
|
||||
tpClientFund.setRemark("订单回退");
|
||||
tpClientFundService.insertByBo(tpClientFund);
|
||||
|
||||
boolean res = saveOrderRecord(order.getId(),"订单回退","订单:"+order.getOrderId()+" 客户回退金额:"+price+" 成功",1,null);
|
||||
if(!res){
|
||||
throw new ServiceException("订单回退失败");
|
||||
@@ -862,10 +1110,10 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
}
|
||||
|
||||
if(order.getGjPrice() != null || order.getGjPrice().compareTo(BigDecimal.ZERO) > 0){
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),payPrice,order.getGjPrice()));
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),payPrice.add(order.getCoupon()),order.getGjPrice()));
|
||||
}
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(),payPrice,order.getPrice().subtract(order.getGjPrice()).subtract(order.getCdPrice()));
|
||||
order.setJsPayPrice(getJsPay(jsPayPrice));
|
||||
order.setJsPayPrice(jsPayPrice);
|
||||
|
||||
order.setPayPrice(payPrice);
|
||||
return baseMapper.updateById(order);
|
||||
@@ -914,7 +1162,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),order.getPayPrice(),order.getGjPrice()));
|
||||
}
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(),order.getPayPrice(),order.getPrice().subtract(order.getGjPrice()).subtract(price));
|
||||
order.setJsPayPrice(getJsPay(jsPayPrice));
|
||||
order.setJsPayPrice(jsPayPrice);
|
||||
}
|
||||
boolean res = saveOrderRecord(order.getId(),"订单拆单","订单:"+order.getOrderId()+"拆单成功!拆单金额:"+price,1,null);
|
||||
if(!res){
|
||||
@@ -950,15 +1198,19 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
TpOrder order = baseMapper.selectById(orderId);
|
||||
//已支付减去改价金额
|
||||
BigDecimal payPrice = order.getPayPrice().subtract(price);
|
||||
if(order.getPayState() != 1){
|
||||
|
||||
if(order.getPayState() == 3){
|
||||
if(payPrice.compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("改价金额不能大于客户已付金额");
|
||||
}
|
||||
}
|
||||
|
||||
if(order.getPayState() != 1){
|
||||
order.setGjPrice(price);
|
||||
order.setJsPrice(order.getPrice().subtract(order.getCdPrice()).subtract(price));
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),order.getPayPrice(),price));
|
||||
order.setGpay(getGjPayPrice(order.getPrice(),order.getPayPrice().add(order.getCoupon()),price));
|
||||
BigDecimal jsPayPrice = getJsPayPrice(order.getPrice(),order.getPayPrice(),order.getPrice().subtract(order.getCdPrice()).subtract(price));
|
||||
order.setJsPayPrice(getJsPay(jsPayPrice));
|
||||
order.setJsPayPrice(jsPayPrice.subtract(order.getBreach()));
|
||||
}else{
|
||||
order.setGjPrice(price);
|
||||
order.setJsPrice(order.getPrice().subtract(order.getCdPrice()).subtract(price));
|
||||
@@ -992,7 +1244,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
vo.setOrderCount(orderCount);
|
||||
|
||||
MPJLambdaWrapper<TpOrder> lqw = buildQueryMPJWrapperKF(bo);
|
||||
lqw.select(TpOrder::getId,TpOrder::getPrice,TpOrder::getPayPrice,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getCdPrice,TpOrder::getKfpay)
|
||||
lqw.select(TpOrder::getId,TpOrder::getPrice,TpOrder::getPayPrice,TpOrder::getGjPrice,TpOrder::getGpay,TpOrder::getCdPrice,TpOrder::getKfpay,TpOrder::getCoupon)
|
||||
.leftJoin(SysUser.class,"s",SysUser::getUserId,TpOrder::getSid)
|
||||
.leftJoin(SysUser.class,"f",SysUser::getUserId,TpOrder::getFid)
|
||||
.leftJoin(SysUser.class,"b",SysUser::getUserId,TpOrder::getBid)
|
||||
@@ -1021,17 +1273,19 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
}
|
||||
BigDecimal gjyj = list.stream().map(f -> new BigDecimal(String.valueOf(f.getGjPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal gjydk = list.stream().map(f -> new BigDecimal(String.valueOf(f.getGpay()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze = list.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setYhqze(yhqze);
|
||||
vo.setGjyj(gjyj);
|
||||
vo.setGjydk(gjydk);
|
||||
|
||||
vo.setZyjSum(zyjSum);
|
||||
vo.setYdkSum(ydkSum);
|
||||
vo.setWdkSum(zyjSum.subtract(ydkSum));
|
||||
vo.setWdkSum(zyjSum.subtract(ydkSum.add(yhqze)));
|
||||
// 检查 zyjSum 是否为零
|
||||
if (zyjSum.compareTo(BigDecimal.ZERO) == 0) {
|
||||
vo.setDkl("0%");
|
||||
} else {
|
||||
BigDecimal dkl = ydkSum.divide(zyjSum, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal dkl = (ydkSum.add(yhqze)).divide(zyjSum, 2, RoundingMode.HALF_UP);
|
||||
vo.setDkl(dkl.multiply(BigDecimal.valueOf(100)) + "%");
|
||||
}
|
||||
// 检查 orderCount 是否为零
|
||||
@@ -1072,37 +1326,40 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<TpOrder> lqw = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice)
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getSid,loginUser.getUserId())
|
||||
.ge(TpOrder::getAddTime,year);
|
||||
List<TpOrder> list = baseMapper.selectList(lqw);
|
||||
BigDecimal ywcYSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkYSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze = list.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcYSum(String.valueOf(ywcYSum));
|
||||
indexSumVo.setYdkYSum(String.valueOf(ydkYSum));
|
||||
indexSumVo.setYdkYSum(String.valueOf(ydkYSum.add(yhqze)));
|
||||
|
||||
LambdaQueryWrapper<TpOrder> lqw1 = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice)
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getSid,loginUser.getUserId())
|
||||
.ge(TpOrder::getAddTime,month+"-01");
|
||||
List<TpOrder> list1 = baseMapper.selectList(lqw1);
|
||||
BigDecimal ywcMSum = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkMSum = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze1 = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcMSum(String.valueOf(ywcMSum));
|
||||
indexSumVo.setYdkMSum(String.valueOf(ydkMSum));
|
||||
indexSumVo.setYdkMSum(String.valueOf(ydkMSum.add(yhqze1)));
|
||||
|
||||
LambdaQueryWrapper<TpOrder> lqw2 = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice)
|
||||
.select(TpOrder::getPrice,TpOrder::getPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getSid,loginUser.getUserId())
|
||||
.ge(TpOrder::getAddTime,day);
|
||||
List<TpOrder> list2 = baseMapper.selectList(lqw2);
|
||||
BigDecimal ywcDSum = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkDSum = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze2 = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcDSum(String.valueOf(ywcDSum));
|
||||
indexSumVo.setYdkDSum(String.valueOf(ydkDSum));
|
||||
indexSumVo.setYdkDSum(String.valueOf(ydkDSum.add(yhqze2)));
|
||||
return indexSumVo;
|
||||
}
|
||||
|
||||
@@ -1123,42 +1380,45 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
|
||||
IndexSumVo indexSumVo = new IndexSumVo();
|
||||
LambdaQueryWrapper<TpOrder> lqw = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice)
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getBid,loginUser.getUserId())
|
||||
.between(TpOrder::getAddTime,year+"-01-01 00:00:00",endDay);
|
||||
List<TpOrder> list = baseMapper.selectList(lqw);
|
||||
BigDecimal ywcYSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkYSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze = list.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcYSum(String.valueOf(ywcYSum));
|
||||
indexSumVo.setYdkYSum(String.valueOf(ydkYSum));
|
||||
indexSumVo.setYdkYSum(String.valueOf(ydkYSum.add(yhqze)));
|
||||
// indexSumVo.setYwcYSum(getMinMultipleOfOneThousand(ywcYSum.intValue())+"以上");
|
||||
// indexSumVo.setYdkYSum(getMinMultipleOfOneThousand(ydkYSum.intValue())+"以上");
|
||||
|
||||
LambdaQueryWrapper<TpOrder> lqw1 = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice)
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getBid,loginUser.getUserId())
|
||||
.between(TpOrder::getAddTime,month+"-01 00:00:00",endDay);
|
||||
List<TpOrder> list1 = baseMapper.selectList(lqw1);
|
||||
BigDecimal ywcMSum = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkMSum = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze1 = list1.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcMSum(String.valueOf(ywcMSum));
|
||||
indexSumVo.setYdkMSum(String.valueOf(ydkMSum));
|
||||
indexSumVo.setYdkMSum(String.valueOf(ydkMSum.add(yhqze1)));
|
||||
|
||||
// indexSumVo.setYwcMSum(getMinMultipleOfOneThousand(ywcMSum.intValue())+"以上");
|
||||
// indexSumVo.setYdkMSum(getMinMultipleOfOneThousand(ydkMSum.intValue())+"以上");
|
||||
|
||||
LambdaQueryWrapper<TpOrder> lqw2 = new LambdaQueryWrapper<TpOrder>()
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice)
|
||||
.select(TpOrder::getJsPrice,TpOrder::getJsPayPrice,TpOrder::getCoupon)
|
||||
.eq(TpOrder::getIsDel,1)
|
||||
.eq(TpOrder::getBid,loginUser.getUserId())
|
||||
.between(TpOrder::getAddTime,yesterday+" 00:00:00",endDay);
|
||||
List<TpOrder> list2 = baseMapper.selectList(lqw2);
|
||||
BigDecimal ywcDSum = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkDSum = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqze2 = list2.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
indexSumVo.setYwcDSum(String.valueOf(ywcDSum));
|
||||
indexSumVo.setYdkDSum(String.valueOf(ydkDSum));
|
||||
indexSumVo.setYdkDSum(String.valueOf(ydkDSum.add(yhqze2)));
|
||||
|
||||
// indexSumVo.setYwcDSum(getMinMultipleOfOneThousand(ywcDSum.intValue())+"以上");
|
||||
// indexSumVo.setYdkDSum(getMinMultipleOfOneThousand(ydkDSum.intValue())+"以上");
|
||||
@@ -1189,6 +1449,7 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
|
||||
MPJLambdaWrapper<TpOrder> olqw = buildQueryMPJWrapper(bo);
|
||||
olqw.select(TpOrder::getId,TpOrder::getPrice,TpOrder::getGjPrice,TpOrder::getJsPrice,TpOrder::getJsPayPrice)
|
||||
.selectAs("round(t.coupon*(t.js_price/t.price),2)",TpOrderVo::getCoupon)
|
||||
.leftJoin(SysUser.class,"s",SysUser::getUserId,TpOrder::getSid)
|
||||
.leftJoin(SysUser.class,"f",SysUser::getUserId,TpOrder::getFid)
|
||||
.leftJoin(SysUser.class,"b",SysUser::getUserId,TpOrder::getBid)
|
||||
@@ -1197,14 +1458,16 @@ public class TpOrderServiceImpl extends MPJBaseServiceImpl<TpOrderMapper,TpOrder
|
||||
List<TpOrderVo> list = baseMapper.selectJoinList(TpOrderVo.class,olqw);
|
||||
BigDecimal zyjSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getPrice().subtract(f.getGjPrice())))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal ydkSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getJsPayPrice()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal yhqzeSum = list.stream().map(f -> new BigDecimal(String.valueOf(f.getCoupon()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
vo.setZyjSum(zyjSum);
|
||||
vo.setYdkSum(ydkSum);
|
||||
vo.setYhqze(yhqzeSum);
|
||||
// 检查 zyjSum 是否为零
|
||||
if (zyjSum.compareTo(BigDecimal.ZERO) == 0) {
|
||||
vo.setDkl("0%");
|
||||
} else {
|
||||
BigDecimal dkl = ydkSum.divide(zyjSum, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal dkl = (ydkSum.add(yhqzeSum)).divide(zyjSum, 2, RoundingMode.HALF_UP);
|
||||
vo.setDkl(dkl.multiply(BigDecimal.valueOf(100)) + "%");
|
||||
}
|
||||
//List结果集取订单ID
|
||||
|
||||
@@ -16,12 +16,14 @@ import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.work.domain.TpClient;
|
||||
import org.dromara.work.domain.TpClientStaff;
|
||||
import org.dromara.work.domain.TpReceipt;
|
||||
import org.dromara.work.domain.bo.TpClientFundBo;
|
||||
import org.dromara.work.domain.bo.TpReceiptBo;
|
||||
import org.dromara.work.domain.vo.ReceiptSumVo;
|
||||
import org.dromara.work.domain.vo.TpReceiptVo;
|
||||
import org.dromara.work.mapper.TpClientMapper;
|
||||
import org.dromara.work.mapper.TpClientStaffMapper;
|
||||
import org.dromara.work.mapper.TpReceiptMapper;
|
||||
import org.dromara.work.service.ITpClientFundService;
|
||||
import org.dromara.work.service.ITpReceiptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -49,6 +51,8 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
|
||||
private final TpClientStaffMapper clientStaffMapper;
|
||||
|
||||
private final ITpClientFundService tpClientFundService;
|
||||
|
||||
/**
|
||||
* 查询收款管理
|
||||
*
|
||||
@@ -270,6 +274,7 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public int updateClaimByBo(TpReceiptBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
TpClientFundBo tpClientFund = new TpClientFundBo();
|
||||
|
||||
TpClientStaff clientStaff = clientStaffMapper.selectById(bo.getCid());
|
||||
TpClient client = clientMapper.selectById(clientStaff.getKid());
|
||||
@@ -280,6 +285,12 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
if(receipt.getState() == 2){
|
||||
throw new ServiceException("该笔汇款:" + receipt.getId() + "已认领,不能重复认领!");
|
||||
}
|
||||
tpClientFund.setKId(client.getId());
|
||||
tpClientFund.setSkId(clientStaff.getId());
|
||||
tpClientFund.setBizType(1);
|
||||
tpClientFund.setChangeAmount(receipt.getPrice());
|
||||
tpClientFund.setBalanceBefore(clientStaff.getYue());
|
||||
|
||||
receipt.setState(2);
|
||||
receipt.setCid(clientStaff.getId());
|
||||
// receipt.setCname(client.getName());
|
||||
@@ -291,7 +302,14 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
clientStaff.setYue(clientStaff.getYue().add(receipt.getPrice()));
|
||||
client.setYue(client.getYue().add(receipt.getPrice()));
|
||||
clientStaffMapper.updateById(clientStaff);
|
||||
return clientMapper.updateById(client);
|
||||
clientMapper.updateById(client);
|
||||
|
||||
// 添加客户资金日志
|
||||
tpClientFund.setBalanceAfter(clientStaff.getYue());
|
||||
tpClientFund.setReceiptId(receipt.getId());
|
||||
tpClientFund.setCreateBy(loginUser.getUserId());
|
||||
tpClientFund.setRemark("领款入账");
|
||||
return tpClientFundService.insertByBo(tpClientFund);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,6 +321,8 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public int updateBackByBo(TpReceiptBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
TpClientFundBo tpClientFund = new TpClientFundBo();
|
||||
|
||||
TpReceipt receipt = baseMapper.selectById(bo.getId());
|
||||
if(receipt.getIsDel() == 2){
|
||||
throw new ServiceException("该笔汇款:" + receipt.getId() + "已作废,不能回退!");
|
||||
@@ -311,13 +331,19 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
throw new ServiceException("该笔汇款:" + receipt.getId() + "未认领,不能回退!");
|
||||
}
|
||||
TpClientStaff clientStaff = clientStaffMapper.selectById(receipt.getCid());
|
||||
TpClient client = clientMapper.selectById(clientStaff.getKid());
|
||||
|
||||
tpClientFund.setKId(client.getId());
|
||||
tpClientFund.setSkId(clientStaff.getId());
|
||||
tpClientFund.setBizType(4);
|
||||
tpClientFund.setChangeAmount(receipt.getPrice());
|
||||
tpClientFund.setBalanceBefore(clientStaff.getYue());
|
||||
|
||||
BigDecimal yue = clientStaff.getYue().subtract(receipt.getPrice());
|
||||
if(yue.compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("客户账户余额不足,请联系客服");
|
||||
}
|
||||
|
||||
TpClient client = clientMapper.selectById(clientStaff.getKid());
|
||||
BigDecimal yue1 = client.getYue().subtract(receipt.getPrice());
|
||||
if(yue1.compareTo(BigDecimal.ZERO) < 0){
|
||||
throw new ServiceException("客户账户余额不足,请联系客服");
|
||||
@@ -339,6 +365,14 @@ public class TpReceiptServiceImpl extends MPJBaseServiceImpl<TpReceiptMapper,TpR
|
||||
clientStaffMapper.updateById(clientStaff);
|
||||
|
||||
client.setYue(yue1);
|
||||
return clientMapper.updateById(client);
|
||||
clientMapper.updateById(client);
|
||||
|
||||
// 添加客户资金日志
|
||||
tpClientFund.setBalanceAfter(yue);
|
||||
tpClientFund.setReceiptId(receipt.getId());
|
||||
tpClientFund.setCreateBy(loginUser.getUserId());
|
||||
tpClientFund.setRemark("领款回退");
|
||||
|
||||
return tpClientFundService.insertByBo(tpClientFund);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user