Compare commits
23 Commits
edef616e23
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 424759542b | |||
| 647ce28aff | |||
| 9addfdc28a | |||
| 21942595b0 | |||
| 795cff8c82 | |||
| 74a7e8735f | |||
| f81b60720c | |||
| babe033c22 | |||
| 679f92415c | |||
| 74bad2d393 | |||
| 3e986ae573 | |||
| d88179c746 | |||
| 84d578fb59 | |||
| 72ccd0cff6 | |||
| c208dcf29d | |||
| 2a0bd99a0f | |||
| 442aa5a214 | |||
| 84b972126e | |||
| 6f02115585 | |||
| df08c9c1fb | |||
| 66b06473c6 | |||
| fe09dbf0e2 | |||
| 86219d26a2 |
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -59,8 +59,9 @@ pipeline {
|
||||
--name \${CONTAINER_NAME} \
|
||||
--network sczx-net \
|
||||
-p 8082:8082 \
|
||||
-e SPRING_PROFILES_ACTIVE=test \
|
||||
-e JAVA_OPTS="-Xms256m -Xmx512m -Duser.timezone=Asia/Shanghai" \
|
||||
-e TZ=Asia/Shanghai \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
--restart always \
|
||||
\${DOCKER_IMAGE}
|
||||
"""
|
||||
|
||||
5
pom.xml
5
pom.xml
@ -75,6 +75,11 @@
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package com.sczx.store.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 小程序类型枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum WalletChangeTypeEnum {
|
||||
REFERRAL("REFERRAL", "引荐"),
|
||||
WITHDRAWAL("WITHDRAWAL", "提现");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
|
||||
WalletChangeTypeEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.sczx.store.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.ParameterBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
@ -17,6 +18,7 @@ import java.util.Arrays;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@Profile("!prod") // 除了prod环境外都启用
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
|
||||
@ -5,6 +5,7 @@ import com.sczx.store.dto.OssPlicyReq;
|
||||
import com.sczx.store.dto.OssPolicyRes;
|
||||
import com.sczx.store.service.OssService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -19,6 +20,7 @@ public class OssController {
|
||||
@Autowired
|
||||
private OssService ossService;
|
||||
|
||||
@ApiOperation(value = "获取oss的policy")
|
||||
@PostMapping("/policy")
|
||||
public Result<OssPolicyRes> policy(@RequestBody OssPlicyReq ossPlicyReq) {
|
||||
return Result.ok(ossService.getPolicy(ossPlicyReq));
|
||||
|
||||
@ -2,13 +2,17 @@ package com.sczx.store.controller;
|
||||
|
||||
|
||||
import com.sczx.store.common.Result;
|
||||
import com.sczx.store.dto.CompanyDTO;
|
||||
import com.sczx.store.dto.CompanyStoreDTO;
|
||||
import com.sczx.store.dto.req.StoreChangeReq;
|
||||
import com.sczx.store.service.CompanyService;
|
||||
import com.sczx.store.service.StoreService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -18,18 +22,26 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @author zhangli
|
||||
* @since 2025-07-08 21:16:36
|
||||
*/
|
||||
@Api(value = "门店公共接口", tags = "公共接口")
|
||||
@Api(value = "公共接口", tags = "公共接口")
|
||||
@RestController
|
||||
@RequestMapping("/pub")
|
||||
public class StorePubController {
|
||||
public class PubController {
|
||||
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
|
||||
@ApiOperation(value = "根据门店id查询门店信息")
|
||||
@GetMapping("/getStoreById")
|
||||
public Result<CompanyStoreDTO> getStoreById(@RequestParam(name = "storeId") Integer storeId){
|
||||
return Result.ok(storeService.getStoreById(storeId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据门店id查询门店信息")
|
||||
@GetMapping("/getCompanyById")
|
||||
public Result<CompanyDTO> getCompanyById(@RequestParam(name = "companyId") Integer companyId){
|
||||
return Result.ok(companyService.getCompanyById(companyId));
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,8 @@ package com.sczx.store.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.sczx.store.common.Result;
|
||||
import com.sczx.store.dto.CompanyStoreDTO;
|
||||
import com.sczx.store.dto.OrderAgreementDTO;
|
||||
import com.sczx.store.dto.req.QueryOrderAgreementReq;
|
||||
import com.sczx.store.dto.req.StoreDistanceReq;
|
||||
import com.sczx.store.service.StoreService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -36,4 +38,12 @@ public class StoreClientController {
|
||||
public Result<IPage<CompanyStoreDTO>> listStoresByBBoxWithDistance(@RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize, @RequestBody StoreDistanceReq storeDistanceReq){
|
||||
return Result.ok(storeService.listStoresByBBoxWithDistance(storeDistanceReq, pageNo, pageSize));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询订单协议签约各方信息")
|
||||
@PostMapping("/queryOrderAgreement")
|
||||
public Result<OrderAgreementDTO> queryOrderAgreement(@RequestBody QueryOrderAgreementReq req){
|
||||
return Result.ok(storeService.queryOrderAgreement( req));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -52,4 +52,10 @@ public class StoreManageController {
|
||||
public Result<Boolean> changeStoreInfo(@RequestBody StoreChangeReq storeChangeReq){
|
||||
return Result.ok(storeService.changeStore(storeChangeReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据storenumber记录token")
|
||||
@PostMapping("/recordToken")
|
||||
public Result<Boolean> recordToken(@RequestParam(value = "storeNumber") String storeNumber, @RequestParam(value = "token") String token){
|
||||
return Result.ok(storeService.recordToken(storeNumber, token));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,15 +2,13 @@ package com.sczx.store.controller;
|
||||
|
||||
|
||||
import com.sczx.store.common.Result;
|
||||
import com.sczx.store.dto.SysConfigDTO;
|
||||
import com.sczx.store.dto.SysDictDataDTO;
|
||||
import com.sczx.store.service.SysDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -43,4 +41,19 @@ public class SysDataController {
|
||||
|
||||
return Result.ok(sysDataService.getDictDataByDicTypeAndValue(dicType, dicValue));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据key列表查询配置列表")
|
||||
@PostMapping("/listConfigByConfigKey")
|
||||
public Result<List<SysConfigDTO>> listConfigByConfigKey(@RequestBody List<String> configKeys){
|
||||
|
||||
return Result.ok(sysDataService.listConfigByConfigKey(configKeys));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据key查询配置")
|
||||
@GetMapping("/getConfigByConfigKey")
|
||||
public Result<SysConfigDTO> getConfigByConfigKey(@RequestParam(name = "configKey") String configKey){
|
||||
|
||||
return Result.ok(sysDataService.getConfigByConfigKey(configKey));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
package com.sczx.store.controller;
|
||||
|
||||
|
||||
import com.sczx.store.common.Result;
|
||||
import com.sczx.store.dto.BaseWalletChangeDTO;
|
||||
import com.sczx.store.dto.BaseWalletDTO;
|
||||
import com.sczx.store.dto.WalletChangeQueryReq;
|
||||
import com.sczx.store.dto.WithdrawalReq;
|
||||
import com.sczx.store.dto.req.DistibIncomeReq;
|
||||
import com.sczx.store.service.IWalletService;
|
||||
import com.sczx.store.util.JwtUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包信息 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-16 17:45:46
|
||||
*/
|
||||
@Api(value = "钱包控制器", tags = "钱包")
|
||||
@RestController
|
||||
@RequestMapping("/wallet")
|
||||
public class WalletController {
|
||||
|
||||
@Autowired
|
||||
private IWalletService walletService;
|
||||
|
||||
@Autowired
|
||||
private JwtUtil jwtUtil;
|
||||
|
||||
@ApiOperation(value = "获取钱包信息", notes = "获取钱包信息")
|
||||
@GetMapping("/walletInfo")
|
||||
public Result<BaseWalletDTO> walletInfo(@RequestParam(value = "userId") Long userId) {
|
||||
return Result.ok(walletService.getWalletInfo(userId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分润入账", notes = "分润入账")
|
||||
@PostMapping("/distibIncome")
|
||||
public Result<Boolean> distibIncome(@RequestBody DistibIncomeReq distibIncomeReq) {
|
||||
walletService.distibIncome(distibIncomeReq);
|
||||
return Result.ok(true);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取钱包变更信息列表", notes = "获取钱包变更信息列表")
|
||||
@PostMapping("/listWalletChange")
|
||||
public Result<List<BaseWalletChangeDTO>> listWalletChange(@RequestBody WalletChangeQueryReq baseWalletChangeQueryReq) {
|
||||
return Result.ok(walletService.listWalletChange(baseWalletChangeQueryReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "门店提现申请", notes = "门店提现申请")
|
||||
@PostMapping("/storeWithdrawal")
|
||||
public Result<Boolean> storeWithdrawal(@RequestBody WithdrawalReq withdrawalReq) {
|
||||
walletService.storeWithdrawal(withdrawalReq);
|
||||
return Result.ok(true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.sczx.store.convert;
|
||||
|
||||
|
||||
import com.sczx.store.dto.BaseWalletChangeDTO;
|
||||
import com.sczx.store.po.BaseWalletChangePO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BaseWalletChangeConvert {
|
||||
BaseWalletChangeConvert INSTANCE = Mappers.getMapper(BaseWalletChangeConvert.class);
|
||||
BaseWalletChangeDTO po2Dto(BaseWalletChangePO baseWalletPO);
|
||||
BaseWalletChangePO dto2Po(BaseWalletChangeDTO baseWalletDTO);
|
||||
List<BaseWalletChangeDTO> pos2Dtos(List<BaseWalletChangePO> baseWalletPOs);
|
||||
}
|
||||
13
src/main/java/com/sczx/store/convert/BaseWalletConvert.java
Normal file
13
src/main/java/com/sczx/store/convert/BaseWalletConvert.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.sczx.store.convert;
|
||||
|
||||
|
||||
import com.sczx.store.dto.BaseWalletDTO;
|
||||
import com.sczx.store.po.BaseWalletPO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface BaseWalletConvert {
|
||||
BaseWalletConvert INSTANCE = Mappers.getMapper(BaseWalletConvert.class);
|
||||
BaseWalletDTO po2Dto(BaseWalletPO baseWalletPO);
|
||||
}
|
||||
13
src/main/java/com/sczx/store/convert/CompanyConvert.java
Normal file
13
src/main/java/com/sczx/store/convert/CompanyConvert.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.sczx.store.convert;
|
||||
|
||||
import com.sczx.store.dto.CompanyDTO;
|
||||
import com.sczx.store.po.CompanyPO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface CompanyConvert {
|
||||
CompanyConvert INSTANCE = Mappers.getMapper(CompanyConvert.class);
|
||||
CompanyPO dtoToPO(CompanyDTO dto);
|
||||
CompanyDTO poToDTO(CompanyPO po);
|
||||
}
|
||||
16
src/main/java/com/sczx/store/convert/SysConfigConvert.java
Normal file
16
src/main/java/com/sczx/store/convert/SysConfigConvert.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.convert;
|
||||
|
||||
import com.sczx.store.dto.SysConfigDTO;
|
||||
import com.sczx.store.po.SysConfigPO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysConfigConvert {
|
||||
SysConfigConvert INSTANCE = Mappers.getMapper(SysConfigConvert.class);
|
||||
SysConfigPO dtoToPO(SysConfigDTO dto);
|
||||
SysConfigDTO poToDTO(SysConfigPO po);
|
||||
List<SysConfigDTO> posToDtos(List<SysConfigPO> pos);
|
||||
}
|
||||
37
src/main/java/com/sczx/store/dto/BaseWalletChangeDTO.java
Normal file
37
src/main/java/com/sczx/store/dto/BaseWalletChangeDTO.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel(value = "BaseWalletChangeDTO对象", description = "钱包变更记录")
|
||||
@Data
|
||||
public class BaseWalletChangeDTO {
|
||||
@ApiModelProperty("id主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("变更类型")
|
||||
private String changeType;
|
||||
|
||||
@ApiModelProperty("支付类型")
|
||||
private String payType;
|
||||
|
||||
@ApiModelProperty("变更时间")
|
||||
private LocalDateTime changeTime;
|
||||
|
||||
@ApiModelProperty("变更金额(元)")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@ApiModelProperty("引荐订单")
|
||||
private String referralOrderNo;
|
||||
|
||||
@ApiModelProperty("审核状态")
|
||||
private String changeStatus;
|
||||
|
||||
}
|
||||
30
src/main/java/com/sczx/store/dto/BaseWalletDTO.java
Normal file
30
src/main/java/com/sczx/store/dto/BaseWalletDTO.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ApiModel(value = "BaseWalletDTO对象", description = "钱包信息")
|
||||
@Data
|
||||
public class BaseWalletDTO {
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty("余额(元)")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty("可用金额(元)")
|
||||
private BigDecimal availableAmount;
|
||||
|
||||
@ApiModelProperty("冻结金额(元)")
|
||||
private BigDecimal freezeAmount;
|
||||
}
|
||||
165
src/main/java/com/sczx/store/dto/CompanyDTO.java
Normal file
165
src/main/java/com/sczx/store/dto/CompanyDTO.java
Normal file
@ -0,0 +1,165 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营商表
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 23:21:15
|
||||
*/
|
||||
|
||||
|
||||
@ApiModel(value = "CompanyPO对象", description = "运营商表")
|
||||
@Data
|
||||
public class CompanyDTO{
|
||||
|
||||
|
||||
@ApiModelProperty("公司ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("公司名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty("联系人姓名")
|
||||
private String contactName;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("公司地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty("押金/保证金金额")
|
||||
private BigDecimal deposit;
|
||||
|
||||
@ApiModelProperty("公司类型(用数字表示的分类)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("是否已删除")
|
||||
private Boolean isDelete;
|
||||
|
||||
@ApiModelProperty("是否允许拆分账单")
|
||||
private Boolean allowSplitBill;
|
||||
|
||||
@ApiModelProperty("最大百分比")
|
||||
private BigDecimal maxPercentage;
|
||||
|
||||
@ApiModelProperty("是否可新增套餐")
|
||||
private String isAddRules;
|
||||
|
||||
@ApiModelProperty("租车平台分成比例")
|
||||
private Integer sharingRatio;
|
||||
|
||||
@ApiModelProperty("微信支付模式")
|
||||
private String wechatPayModel;
|
||||
|
||||
@ApiModelProperty("微信收款商户号")
|
||||
private String wechatReceivingAccount;
|
||||
|
||||
@ApiModelProperty("微信收款密钥")
|
||||
private String wechatKey;
|
||||
|
||||
@ApiModelProperty("计费模式")
|
||||
private Integer chargeMode;
|
||||
|
||||
@ApiModelProperty("计费参数")
|
||||
private BigDecimal chargeParam;
|
||||
|
||||
@ApiModelProperty("是否允许修改")
|
||||
private Boolean allowChange;
|
||||
|
||||
@ApiModelProperty("渠道/通路ID")
|
||||
private Integer channelId;
|
||||
|
||||
@ApiModelProperty("运营商管理城市")
|
||||
private String citys;
|
||||
|
||||
@ApiModelProperty("运营商管理城市")
|
||||
private String cityName;
|
||||
|
||||
@ApiModelProperty("支付宝支付模式")
|
||||
private Integer aliPayModel;
|
||||
|
||||
@ApiModelProperty("支付宝收款商户号")
|
||||
private String aliReceivingAccount;
|
||||
|
||||
@ApiModelProperty("支付宝收款密钥")
|
||||
private String aliKey;
|
||||
|
||||
@ApiModelProperty("服务费收费订单类型")
|
||||
private String serviceOrderType;
|
||||
|
||||
@ApiModelProperty("分账订单类型")
|
||||
private String splitOrderType;
|
||||
|
||||
@ApiModelProperty("微信公共平台余额")
|
||||
private BigDecimal wechatBalance;
|
||||
|
||||
@ApiModelProperty("支付宝公共平台余额")
|
||||
private BigDecimal alipayBalance;
|
||||
|
||||
@ApiModelProperty("邀请奖励模式")
|
||||
private Integer inviteRewardMode;
|
||||
|
||||
@ApiModelProperty("邀请奖励参数")
|
||||
private BigDecimal inviteRewardParam;
|
||||
|
||||
@ApiModelProperty("奖励方式")
|
||||
private Integer rewardType;
|
||||
|
||||
@ApiModelProperty("奖励参数")
|
||||
private BigDecimal rewardParam;
|
||||
|
||||
@ApiModelProperty("是否预约")
|
||||
private Boolean isReservation;
|
||||
|
||||
@ApiModelProperty("预约时长")
|
||||
private Integer reservationDuration;
|
||||
|
||||
@ApiModelProperty("预约次数")
|
||||
private Integer reservationNumber;
|
||||
|
||||
@ApiModelProperty("部门状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String extend1;
|
||||
|
||||
private String extend2;
|
||||
|
||||
private String extend3;
|
||||
|
||||
private String extend4;
|
||||
|
||||
private String extend5;
|
||||
|
||||
@ApiModelProperty("充电平台运营商ID")
|
||||
private Long bOpId;
|
||||
|
||||
|
||||
}
|
||||
@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "CompanyStoreDTO对象", description = "门店信息")
|
||||
public class CompanyStoreDTO {
|
||||
@ -67,7 +69,23 @@ public class CompanyStoreDTO {
|
||||
@ApiModelProperty("营业状态")
|
||||
private String status;
|
||||
|
||||
|
||||
@ApiModelProperty("租车分成比例")
|
||||
private BigDecimal zucheRatio;
|
||||
|
||||
@ApiModelProperty("租电分成比例")
|
||||
private BigDecimal zudianRatio;
|
||||
|
||||
@ApiModelProperty("以租代售分成比例")
|
||||
private BigDecimal daishouRatio;
|
||||
|
||||
@ApiModelProperty("距离(米)")
|
||||
private Double distance;
|
||||
|
||||
@ApiModelProperty("美团token")
|
||||
private String mtToken;
|
||||
|
||||
@ApiModelProperty("抖音门店id")
|
||||
private String dyStoreId;
|
||||
|
||||
}
|
||||
|
||||
28
src/main/java/com/sczx/store/dto/OrderAgreementDTO.java
Normal file
28
src/main/java/com/sczx/store/dto/OrderAgreementDTO.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "订单协议签署各方信息")
|
||||
@Data
|
||||
public class OrderAgreementDTO {
|
||||
|
||||
@ApiModelProperty("平台正式名称")
|
||||
private String platformOfficialName;
|
||||
|
||||
@ApiModelProperty("平台社会信用代码")
|
||||
private String platformIdNo;
|
||||
|
||||
@ApiModelProperty("门店正式名称")
|
||||
private String storeOfficialName;
|
||||
|
||||
@ApiModelProperty("门店社会信用代码")
|
||||
private String storeIdNo;
|
||||
|
||||
@ApiModelProperty("用户真实姓名")
|
||||
private String custRealName;
|
||||
|
||||
@ApiModelProperty("门店社会信用代码")
|
||||
private String custIdNo;
|
||||
}
|
||||
@ -20,10 +20,27 @@ public class SimpleUserInfoDTO {
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Integer roleId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "小程序类型")
|
||||
private String miniProgramType;
|
||||
|
||||
@ApiModelProperty("头像")
|
||||
private String avatarUrl;
|
||||
|
||||
@ApiModelProperty("微信小程序 openid")
|
||||
private String wechatOpenid;
|
||||
|
||||
@ApiModelProperty("支付宝小程序 userid")
|
||||
private String alipayUserid;
|
||||
|
||||
@ApiModelProperty("支付宝小程序 openid")
|
||||
private String alipayOpenid;
|
||||
|
||||
@ApiModelProperty("是否认证0未认证1已认证")
|
||||
private Integer authed;
|
||||
|
||||
@ApiModelProperty("身份证号")
|
||||
private String idNo;
|
||||
|
||||
@ApiModelProperty("实名")
|
||||
private String realName;
|
||||
}
|
||||
|
||||
43
src/main/java/com/sczx/store/dto/SysConfigDTO.java
Normal file
43
src/main/java/com/sczx/store/dto/SysConfigDTO.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel(value = "SysConfigDTO")
|
||||
@Data
|
||||
public class SysConfigDTO {
|
||||
|
||||
|
||||
@ApiModelProperty("参数主键")
|
||||
private Integer configId;
|
||||
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
@ApiModelProperty("参数键名")
|
||||
private String configKey;
|
||||
|
||||
@ApiModelProperty("参数键值")
|
||||
private String configValue;
|
||||
|
||||
@ApiModelProperty("系统内置(Y是 N否)")
|
||||
private String configType;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
16
src/main/java/com/sczx/store/dto/WalletChangeQueryReq.java
Normal file
16
src/main/java/com/sczx/store/dto/WalletChangeQueryReq.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "钱包变更记录查询请求对象")
|
||||
@Data
|
||||
public class WalletChangeQueryReq {
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("变更类型")
|
||||
private String changeType;
|
||||
}
|
||||
18
src/main/java/com/sczx/store/dto/WithdrawalReq.java
Normal file
18
src/main/java/com/sczx/store/dto/WithdrawalReq.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.sczx.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ApiModel(value = "提现请求")
|
||||
@Data
|
||||
public class WithdrawalReq {
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long storeId;
|
||||
|
||||
@ApiModelProperty("提现金额")
|
||||
private BigDecimal withdrawalAmount;
|
||||
}
|
||||
18
src/main/java/com/sczx/store/dto/req/DistibIncomeReq.java
Normal file
18
src/main/java/com/sczx/store/dto/req/DistibIncomeReq.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.sczx.store.dto.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ApiModel(value = "分润收入查询参数")
|
||||
@Data
|
||||
public class DistibIncomeReq {
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long storeId;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount ;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.sczx.store.dto.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "查询订单协议签署各方信息请求")
|
||||
@Data
|
||||
public class QueryOrderAgreementReq {
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long storeId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.mapper;
|
||||
|
||||
import com.sczx.store.po.BaseWalletChangePO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包变更记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:52:11
|
||||
*/
|
||||
public interface BaseWalletChangeMapper extends BaseMapper<BaseWalletChangePO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/mapper/BaseWalletMapper.java
Normal file
16
src/main/java/com/sczx/store/mapper/BaseWalletMapper.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.mapper;
|
||||
|
||||
import com.sczx.store.po.BaseWalletPO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:48:45
|
||||
*/
|
||||
public interface BaseWalletMapper extends BaseMapper<BaseWalletPO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/mapper/CompanyMapper.java
Normal file
16
src/main/java/com/sczx/store/mapper/CompanyMapper.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.mapper;
|
||||
|
||||
import com.sczx.store.po.CompanyPO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营商表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 23:21:15
|
||||
*/
|
||||
public interface CompanyMapper extends BaseMapper<CompanyPO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/mapper/SysConfigMapper.java
Normal file
16
src/main/java/com/sczx/store/mapper/SysConfigMapper.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.mapper;
|
||||
|
||||
import com.sczx.store.po.SysConfigPO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 20:36:48
|
||||
*/
|
||||
public interface SysConfigMapper extends BaseMapper<SysConfigPO> {
|
||||
|
||||
}
|
||||
66
src/main/java/com/sczx/store/po/BaseWalletChangePO.java
Normal file
66
src/main/java/com/sczx/store/po/BaseWalletChangePO.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.sczx.store.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包变更记录
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:52:11
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("zc_base_wallet_change")
|
||||
@ApiModel(value = "BaseWalletChangePO对象", description = "钱包变更记录")
|
||||
public class BaseWalletChangePO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("变更类型")
|
||||
private String changeType;
|
||||
|
||||
@ApiModelProperty("支付类型")
|
||||
private String payType;
|
||||
|
||||
@ApiModelProperty("变更时间")
|
||||
private LocalDateTime changeTime;
|
||||
|
||||
@ApiModelProperty("变更金额(元)")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@ApiModelProperty("引荐订单")
|
||||
private String referralOrderNo;
|
||||
|
||||
@ApiModelProperty("审核状态")
|
||||
private String changeStatus;
|
||||
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
62
src/main/java/com/sczx/store/po/BaseWalletPO.java
Normal file
62
src/main/java/com/sczx/store/po/BaseWalletPO.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.sczx.store.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包信息
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:48:45
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("zc_base_wallet")
|
||||
@ApiModel(value = "BaseWalletPO对象", description = "钱包信息")
|
||||
public class BaseWalletPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("用户id主键")
|
||||
@TableId(value = "user_id", type = IdType.AUTO)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty("余额(元)")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty("可用金额(元)")
|
||||
private BigDecimal availableAmount;
|
||||
|
||||
@ApiModelProperty("冻结金额(元)")
|
||||
private BigDecimal freezeAmount;
|
||||
|
||||
@ApiModelProperty("钱包类型0门店1用户")
|
||||
private Integer walletType;
|
||||
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
171
src/main/java/com/sczx/store/po/CompanyPO.java
Normal file
171
src/main/java/com/sczx/store/po/CompanyPO.java
Normal file
@ -0,0 +1,171 @@
|
||||
package com.sczx.store.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营商表
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 23:21:15
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("zc_company")
|
||||
@ApiModel(value = "CompanyPO对象", description = "运营商表")
|
||||
public class CompanyPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("公司ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("公司名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty("联系人姓名")
|
||||
private String contactName;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("公司地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty("押金/保证金金额")
|
||||
private BigDecimal deposit;
|
||||
|
||||
@ApiModelProperty("公司类型(用数字表示的分类)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("是否已删除")
|
||||
private Boolean isDelete;
|
||||
|
||||
@ApiModelProperty("是否允许拆分账单")
|
||||
private Boolean allowSplitBill;
|
||||
|
||||
@ApiModelProperty("最大百分比")
|
||||
private BigDecimal maxPercentage;
|
||||
|
||||
@ApiModelProperty("是否可新增套餐")
|
||||
private String isAddRules;
|
||||
|
||||
@ApiModelProperty("租车平台分成比例")
|
||||
private Integer sharingRatio;
|
||||
|
||||
@ApiModelProperty("微信支付模式")
|
||||
private String wechatPayModel;
|
||||
|
||||
@ApiModelProperty("微信收款商户号")
|
||||
private String wechatReceivingAccount;
|
||||
|
||||
@ApiModelProperty("微信收款密钥")
|
||||
private String wechatKey;
|
||||
|
||||
@ApiModelProperty("计费模式")
|
||||
private Integer chargeMode;
|
||||
|
||||
@ApiModelProperty("计费参数")
|
||||
private BigDecimal chargeParam;
|
||||
|
||||
@ApiModelProperty("是否允许修改")
|
||||
private Boolean allowChange;
|
||||
|
||||
@ApiModelProperty("渠道/通路ID")
|
||||
private Integer channelId;
|
||||
|
||||
@ApiModelProperty("运营商管理城市")
|
||||
private String citys;
|
||||
|
||||
@ApiModelProperty("运营商管理城市")
|
||||
private String cityName;
|
||||
|
||||
@ApiModelProperty("支付宝支付模式")
|
||||
private Integer aliPayModel;
|
||||
|
||||
@ApiModelProperty("支付宝收款商户号")
|
||||
private String aliReceivingAccount;
|
||||
|
||||
@ApiModelProperty("支付宝收款密钥")
|
||||
private String aliKey;
|
||||
|
||||
@ApiModelProperty("服务费收费订单类型")
|
||||
private String serviceOrderType;
|
||||
|
||||
@ApiModelProperty("分账订单类型")
|
||||
private String splitOrderType;
|
||||
|
||||
@ApiModelProperty("微信公共平台余额")
|
||||
private BigDecimal wechatBalance;
|
||||
|
||||
@ApiModelProperty("支付宝公共平台余额")
|
||||
private BigDecimal alipayBalance;
|
||||
|
||||
@ApiModelProperty("邀请奖励模式")
|
||||
private Integer inviteRewardMode;
|
||||
|
||||
@ApiModelProperty("邀请奖励参数")
|
||||
private BigDecimal inviteRewardParam;
|
||||
|
||||
@ApiModelProperty("奖励方式")
|
||||
private Integer rewardType;
|
||||
|
||||
@ApiModelProperty("奖励参数")
|
||||
private BigDecimal rewardParam;
|
||||
|
||||
@ApiModelProperty("是否预约")
|
||||
private Boolean isReservation;
|
||||
|
||||
@ApiModelProperty("预约时长")
|
||||
private Integer reservationDuration;
|
||||
|
||||
@ApiModelProperty("预约次数")
|
||||
private Integer reservationNumber;
|
||||
|
||||
@ApiModelProperty("部门状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String extend1;
|
||||
|
||||
private String extend2;
|
||||
|
||||
private String extend3;
|
||||
|
||||
private String extend4;
|
||||
|
||||
private String extend5;
|
||||
|
||||
@ApiModelProperty("充电平台运营商ID")
|
||||
private Long bOpId;
|
||||
|
||||
|
||||
}
|
||||
@ -173,5 +173,10 @@ public class CompanyStorePO implements Serializable {
|
||||
|
||||
private String extend5;
|
||||
|
||||
@ApiModelProperty("美团token")
|
||||
private String mtToken;
|
||||
|
||||
@ApiModelProperty("抖音门店id")
|
||||
private String dyStoreId;
|
||||
|
||||
}
|
||||
|
||||
62
src/main/java/com/sczx/store/po/SysConfigPO.java
Normal file
62
src/main/java/com/sczx/store/po/SysConfigPO.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.sczx.store.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数配置表
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 20:36:48
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("sys_config")
|
||||
@ApiModel(value = "SysConfigPO对象", description = "参数配置表")
|
||||
public class SysConfigPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("参数主键")
|
||||
@TableId(value = "config_id", type = IdType.AUTO)
|
||||
private Integer configId;
|
||||
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
@ApiModelProperty("参数键名")
|
||||
private String configKey;
|
||||
|
||||
@ApiModelProperty("参数键值")
|
||||
private String configValue;
|
||||
|
||||
@ApiModelProperty("系统内置(Y是 N否)")
|
||||
private String configType;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.repository;
|
||||
|
||||
import com.sczx.store.po.BaseWalletChangePO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包变更记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:52:11
|
||||
*/
|
||||
public interface BaseWalletChangeRepo extends IService<BaseWalletChangePO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/repository/BaseWalletRepo.java
Normal file
16
src/main/java/com/sczx/store/repository/BaseWalletRepo.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.repository;
|
||||
|
||||
import com.sczx.store.po.BaseWalletPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:48:45
|
||||
*/
|
||||
public interface BaseWalletRepo extends IService<BaseWalletPO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/repository/CompanyRepo.java
Normal file
16
src/main/java/com/sczx/store/repository/CompanyRepo.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.repository;
|
||||
|
||||
import com.sczx.store.po.CompanyPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营商表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 23:21:15
|
||||
*/
|
||||
public interface CompanyRepo extends IService<CompanyPO> {
|
||||
|
||||
}
|
||||
16
src/main/java/com/sczx/store/repository/SysConfigRepo.java
Normal file
16
src/main/java/com/sczx/store/repository/SysConfigRepo.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.sczx.store.repository;
|
||||
|
||||
import com.sczx.store.po.SysConfigPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数配置表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 20:36:48
|
||||
*/
|
||||
public interface SysConfigRepo extends IService<SysConfigPO> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.sczx.store.repository.impl;
|
||||
|
||||
import com.sczx.store.po.BaseWalletChangePO;
|
||||
import com.sczx.store.mapper.BaseWalletChangeMapper;
|
||||
import com.sczx.store.repository.BaseWalletChangeRepo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包变更记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:52:11
|
||||
*/
|
||||
@Service
|
||||
public class BaseWalletChangeRepoImpl extends ServiceImpl<BaseWalletChangeMapper, BaseWalletChangePO> implements BaseWalletChangeRepo {
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.sczx.store.repository.impl;
|
||||
|
||||
import com.sczx.store.po.BaseWalletPO;
|
||||
import com.sczx.store.mapper.BaseWalletMapper;
|
||||
import com.sczx.store.repository.BaseWalletRepo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-24 12:48:45
|
||||
*/
|
||||
@Service
|
||||
public class BaseWalletRepoImpl extends ServiceImpl<BaseWalletMapper, BaseWalletPO> implements BaseWalletRepo {
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.sczx.store.repository.impl;
|
||||
|
||||
import com.sczx.store.po.CompanyPO;
|
||||
import com.sczx.store.mapper.CompanyMapper;
|
||||
import com.sczx.store.repository.CompanyRepo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营商表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 23:21:15
|
||||
*/
|
||||
@Service
|
||||
public class CompanyRepoImpl extends ServiceImpl<CompanyMapper, CompanyPO> implements CompanyRepo {
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.sczx.store.repository.impl;
|
||||
|
||||
import com.sczx.store.po.SysConfigPO;
|
||||
import com.sczx.store.mapper.SysConfigMapper;
|
||||
import com.sczx.store.repository.SysConfigRepo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数配置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangli
|
||||
* @since 2025-08-23 20:36:48
|
||||
*/
|
||||
@Service
|
||||
public class SysConfigRepoImpl extends ServiceImpl<SysConfigMapper, SysConfigPO> implements SysConfigRepo {
|
||||
|
||||
}
|
||||
7
src/main/java/com/sczx/store/service/CompanyService.java
Normal file
7
src/main/java/com/sczx/store/service/CompanyService.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.sczx.store.service;
|
||||
|
||||
import com.sczx.store.dto.CompanyDTO;
|
||||
|
||||
public interface CompanyService {
|
||||
CompanyDTO getCompanyById(Integer id);
|
||||
}
|
||||
41
src/main/java/com/sczx/store/service/IWalletService.java
Normal file
41
src/main/java/com/sczx/store/service/IWalletService.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.sczx.store.service;
|
||||
|
||||
|
||||
import com.sczx.store.dto.BaseWalletChangeDTO;
|
||||
import com.sczx.store.dto.BaseWalletDTO;
|
||||
import com.sczx.store.dto.WalletChangeQueryReq;
|
||||
import com.sczx.store.dto.WithdrawalReq;
|
||||
import com.sczx.store.dto.req.DistibIncomeReq;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IWalletService {
|
||||
|
||||
/**
|
||||
* 根据用户id获取钱包信息
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
BaseWalletDTO getWalletInfo(Long userId);
|
||||
|
||||
/**
|
||||
* 佣金收入
|
||||
* @param distibIncomeReq
|
||||
*/
|
||||
void distibIncome(@RequestBody DistibIncomeReq distibIncomeReq);
|
||||
|
||||
/**
|
||||
* 根据条件获取钱包变更记录
|
||||
* @param baseWalletChangeQueryReq
|
||||
* @return
|
||||
*/
|
||||
List<BaseWalletChangeDTO> listWalletChange(WalletChangeQueryReq baseWalletChangeQueryReq);
|
||||
|
||||
/**
|
||||
* 门店提现申请
|
||||
* @param withdrawalReq
|
||||
*/
|
||||
void storeWithdrawal(WithdrawalReq withdrawalReq);
|
||||
}
|
||||
@ -2,6 +2,8 @@ package com.sczx.store.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.sczx.store.dto.CompanyStoreDTO;
|
||||
import com.sczx.store.dto.OrderAgreementDTO;
|
||||
import com.sczx.store.dto.req.QueryOrderAgreementReq;
|
||||
import com.sczx.store.dto.req.StoreChangeReq;
|
||||
import com.sczx.store.dto.req.StoreDistanceReq;
|
||||
|
||||
@ -17,6 +19,14 @@ public interface StoreService {
|
||||
*/
|
||||
IPage<CompanyStoreDTO> listStoresByBBoxWithDistance(StoreDistanceReq storeDistanceReq, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询订单协议信息
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
OrderAgreementDTO queryOrderAgreement(QueryOrderAgreementReq req);
|
||||
|
||||
/**
|
||||
* 根据id获取门店信息
|
||||
*
|
||||
@ -39,4 +49,7 @@ public interface StoreService {
|
||||
* @return
|
||||
*/
|
||||
List<CompanyStoreDTO> listStoresByManage(Integer managerId);
|
||||
|
||||
|
||||
Boolean recordToken(String storeNumber, String token);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.sczx.store.service;
|
||||
|
||||
import com.sczx.store.dto.SysConfigDTO;
|
||||
import com.sczx.store.dto.SysDictDataDTO;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,4 +21,18 @@ public interface SysDataService {
|
||||
* @return
|
||||
*/
|
||||
SysDictDataDTO getDictDataByDicTypeAndValue(String dicType, String dicValue);
|
||||
|
||||
/**
|
||||
* 根据配置key查询配置信息
|
||||
* @param configKeys
|
||||
* @return
|
||||
*/
|
||||
List<SysConfigDTO> listConfigByConfigKey(List<String> configKeys);
|
||||
|
||||
/**
|
||||
* 根据配置key查询配置信息
|
||||
* @param configKey
|
||||
* @return
|
||||
*/
|
||||
SysConfigDTO getConfigByConfigKey(String configKey);
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package com.sczx.store.service.impl;
|
||||
|
||||
import com.sczx.store.convert.CompanyConvert;
|
||||
import com.sczx.store.dto.CompanyDTO;
|
||||
import com.sczx.store.exception.BizException;
|
||||
import com.sczx.store.po.CompanyPO;
|
||||
import com.sczx.store.repository.CompanyRepo;
|
||||
import com.sczx.store.service.CompanyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CompanyServiceImpl implements CompanyService {
|
||||
|
||||
@Autowired
|
||||
private CompanyRepo companyRepo;
|
||||
|
||||
@Override
|
||||
public CompanyDTO getCompanyById(Integer id) {
|
||||
CompanyPO companyPO = companyRepo.getById(id);
|
||||
if(!StringUtils.equalsIgnoreCase(companyPO.getStatus(),"0")){
|
||||
throw new BizException("该运营商已停用");
|
||||
}
|
||||
return CompanyConvert.INSTANCE.poToDTO(companyPO);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.sczx.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.sczx.store.config.OSSConfig;
|
||||
import com.sczx.store.dto.OssPlicyReq;
|
||||
import com.sczx.store.dto.OssPolicyRes;
|
||||
@ -13,10 +14,7 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -29,20 +27,11 @@ public class OssServiceImpl implements OssService {
|
||||
public OssPolicyRes getPolicy(OssPlicyReq ossPlicyReq) {
|
||||
|
||||
long expireEndTime = System.currentTimeMillis() + ossPlicyReq.getExpireTime() * 1000;
|
||||
Date expiration = new Date(expireEndTime);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
String expire = df.format(expiration);
|
||||
Map<String, Object> policyMap = getStringObjectMap(ossPlicyReq, expireEndTime);
|
||||
|
||||
// 创建policy
|
||||
Map<String, Object> policyMap = new LinkedHashMap<>();
|
||||
policyMap.put("expiration", expire);
|
||||
|
||||
Map<String, Object> conditionMap = new LinkedHashMap<>();
|
||||
conditionMap.put("bucket", ossPlicyReq.getBucketName()); // 需要替换成你的 bucket 名称
|
||||
|
||||
policyMap.put("conditions", new Object[]{conditionMap});
|
||||
|
||||
String policy = Base64.getEncoder().encodeToString(policyMap.toString().getBytes(StandardCharsets.UTF_8));
|
||||
// 使用FastJSON序列化policy为标准JSON字符串
|
||||
String policyJson = JSON.toJSONString(policyMap);
|
||||
String policy = Base64.getEncoder().encodeToString(policyJson.getBytes(StandardCharsets.UTF_8));
|
||||
String signature = calculateSignature(ossConfig.getAccessKeySecret(), policy);
|
||||
|
||||
// 构造返回数据
|
||||
@ -50,12 +39,47 @@ public class OssServiceImpl implements OssService {
|
||||
response.setAccessid(ossConfig.getAccessKeyId());
|
||||
response.setPolicy(policy);
|
||||
response.setSignature(signature);
|
||||
response.setDir(ossPlicyReq.getDir()+"/"); // 可以自定义上传目录
|
||||
response.setHost("https://" + ossPlicyReq.getBucketName() + "." + ossConfig.getRegion() + ".aliyuncs.com"); // 需要替换成你的 bucket 名称
|
||||
response.setDir(ossPlicyReq.getDir()); // 可以自定义上传目录
|
||||
response.setHost("https://" + ossPlicyReq.getBucketName() + "." + ossConfig.getRegion() + ".aliyuncs.com");
|
||||
response.setExpire(expireEndTime / 1000);
|
||||
return response;
|
||||
}
|
||||
|
||||
private static Map<String, Object> getStringObjectMap(OssPlicyReq ossPlicyReq, long expireEndTime) {
|
||||
Date expiration = new Date(expireEndTime);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
String expire = df.format(expiration);
|
||||
|
||||
// 创建policy - 使用标准的JSON结构
|
||||
Map<String, Object> policyMap = new HashMap<>();
|
||||
policyMap.put("expiration", expire);
|
||||
|
||||
// 构造conditions数组
|
||||
List<Object> conditions = new ArrayList<>();
|
||||
|
||||
// bucket条件
|
||||
Map<String, String> bucketCondition = new HashMap<>();
|
||||
bucketCondition.put("bucket", ossPlicyReq.getBucketName());
|
||||
conditions.add(bucketCondition);
|
||||
|
||||
// 可选:添加目录前缀条件
|
||||
if (ossPlicyReq.getDir() != null && !ossPlicyReq.getDir().isEmpty()) {
|
||||
List<String> startsWithCondition = new ArrayList<>();
|
||||
startsWithCondition.add("starts-with");
|
||||
startsWithCondition.add("$key");
|
||||
startsWithCondition.add(ossPlicyReq.getDir());
|
||||
conditions.add(startsWithCondition);
|
||||
}
|
||||
|
||||
// 添加 ACL 条件,设置上传文件为公共读
|
||||
Map<String, String> aclCondition = new HashMap<>();
|
||||
aclCondition.put("x-oss-object-acl", "public-read");
|
||||
conditions.add(aclCondition);
|
||||
|
||||
policyMap.put("conditions", conditions);
|
||||
return policyMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算签名
|
||||
* @param accessKeySecret
|
||||
|
||||
@ -1,23 +1,29 @@
|
||||
package com.sczx.store.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.sczx.store.convert.StoreConvert;
|
||||
import com.sczx.store.dto.CompanyStoreDTO;
|
||||
import com.sczx.store.dto.SimpleUserInfoDTO;
|
||||
import com.sczx.store.dto.*;
|
||||
import com.sczx.store.dto.req.QueryOrderAgreementReq;
|
||||
import com.sczx.store.dto.req.StoreChangeReq;
|
||||
import com.sczx.store.dto.req.StoreDistanceReq;
|
||||
import com.sczx.store.exception.BizException;
|
||||
import com.sczx.store.po.CompanyStorePO;
|
||||
import com.sczx.store.repository.CompanyStoreRepo;
|
||||
import com.sczx.store.service.CompanyService;
|
||||
import com.sczx.store.service.StoreService;
|
||||
import com.sczx.store.service.SysDataService;
|
||||
import com.sczx.store.util.JwtUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class StoreServiceImpl implements StoreService {
|
||||
@ -26,15 +32,51 @@ public class StoreServiceImpl implements StoreService {
|
||||
|
||||
@Autowired
|
||||
private CompanyStoreRepo companyStoreRepo;
|
||||
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
|
||||
@Autowired
|
||||
private SysDataService sysDataService;
|
||||
|
||||
@Autowired
|
||||
private JwtUtil jwtUtil;
|
||||
|
||||
@Override
|
||||
public IPage<CompanyStoreDTO> listStoresByBBoxWithDistance(StoreDistanceReq storeDistanceReq, Integer pageNo, Integer pageSize) {
|
||||
return companyStoreRepo.listStoresByBBoxWithDistance(storeDistanceReq,pageNo, pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderAgreementDTO queryOrderAgreement(QueryOrderAgreementReq req) {
|
||||
OrderAgreementDTO orderAgreementDTO = new OrderAgreementDTO();
|
||||
List<SysDictDataDTO> sysDictDataList= sysDataService.listDictDataByDicType("platform_agreement");
|
||||
if (CollectionUtils.isEmpty(sysDictDataList)) {
|
||||
throw new BizException("未配置平台签约信息");
|
||||
}
|
||||
Map<String,SysDictDataDTO> sysDictDataMap = sysDictDataList.stream().collect(Collectors.toMap(SysDictDataDTO::getDictLabel, v -> v));
|
||||
CompanyStorePO companyStorePO = companyStoreRepo.getById(req.getStoreId());
|
||||
orderAgreementDTO.setStoreIdNo(companyStorePO.getExtend2());
|
||||
orderAgreementDTO.setStoreOfficialName(companyStorePO.getExtend3());
|
||||
orderAgreementDTO.setPlatformIdNo(sysDictDataMap.get("code").getDictValue());
|
||||
orderAgreementDTO.setPlatformOfficialName(sysDictDataMap.get("name").getDictValue());
|
||||
SimpleUserInfoDTO simpleUserInfoDTO = jwtUtil.getUserInfoFromToken();
|
||||
orderAgreementDTO.setCustIdNo(simpleUserInfoDTO.getIdNo());
|
||||
orderAgreementDTO.setCustRealName(simpleUserInfoDTO.getUserName());
|
||||
|
||||
return orderAgreementDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompanyStoreDTO getStoreById(Integer id) {
|
||||
CompanyStorePO companyStorePO = companyStoreRepo.getById(id);
|
||||
|
||||
if(!StringUtils.equalsIgnoreCase(companyStorePO.getStatus(),"0")){
|
||||
throw new BizException("门店已下架");
|
||||
}
|
||||
CompanyDTO companyDTO = companyService.getCompanyById(companyStorePO.getOperatingCompanyId());
|
||||
if(Objects.isNull(companyDTO)){
|
||||
throw new BizException("运营商已下架");
|
||||
}
|
||||
return StoreConvert.INSTANCE.poToDTO(companyStorePO);
|
||||
}
|
||||
|
||||
@ -45,6 +87,7 @@ public class StoreServiceImpl implements StoreService {
|
||||
.set(StringUtils.isNotBlank(storeChangeReq.getStartTime()),CompanyStorePO::getStartTime, storeChangeReq.getStartTime())
|
||||
.set(StringUtils.isNotBlank(storeChangeReq.getEndTime()),CompanyStorePO::getEndTime, storeChangeReq.getEndTime())
|
||||
.set(StringUtils.isNotBlank(storeChangeReq.getPhone()),CompanyStorePO::getPhone, storeChangeReq.getPhone())
|
||||
.set(StringUtils.isNotBlank(storeChangeReq.getImage()),CompanyStorePO::getImage, storeChangeReq.getImage())
|
||||
.eq(CompanyStorePO::getId, storeChangeReq.getId());
|
||||
companyStoreRepo.update(wrapper);
|
||||
return true;
|
||||
@ -55,4 +98,13 @@ public class StoreServiceImpl implements StoreService {
|
||||
|
||||
return companyStoreRepo.listStoresByManage(managerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean recordToken(String storeNumber, String token) {
|
||||
LambdaUpdateWrapper<CompanyStorePO> wrapper = Wrappers.lambdaUpdate(CompanyStorePO.class);
|
||||
wrapper.set(StringUtils.isNotBlank(token),CompanyStorePO::getMtToken, token)
|
||||
.eq(CompanyStorePO::getStoreNumber, storeNumber);
|
||||
companyStoreRepo.update(wrapper);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.sczx.store.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.sczx.store.convert.SysConfigConvert;
|
||||
import com.sczx.store.convert.SysDictDataConvert;
|
||||
import com.sczx.store.dto.SysConfigDTO;
|
||||
import com.sczx.store.dto.SysDictDataDTO;
|
||||
import com.sczx.store.po.SysConfigPO;
|
||||
import com.sczx.store.po.SysDictDataPO;
|
||||
import com.sczx.store.repository.SysConfigRepo;
|
||||
import com.sczx.store.repository.SysDictDataRepo;
|
||||
import com.sczx.store.service.SysDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -19,6 +23,9 @@ public class SysDataServiceImpl implements SysDataService {
|
||||
@Autowired
|
||||
private SysDictDataRepo sysDictDataRepo;
|
||||
|
||||
@Autowired
|
||||
private SysConfigRepo sysConfigRepo;
|
||||
|
||||
@Override
|
||||
public List<SysDictDataDTO> listDictDataByDicType(String dicType) {
|
||||
LambdaQueryWrapper<SysDictDataPO> wrapper = new LambdaQueryWrapper<>();
|
||||
@ -34,4 +41,20 @@ public class SysDataServiceImpl implements SysDataService {
|
||||
wrapper.eq(SysDictDataPO::getDictType, dicType).eq(SysDictDataPO::getDictValue, dicValue).last(" limit 1");
|
||||
return SysDictDataConvert.INSTANCE.poToDTO(sysDictDataRepo.getOne(wrapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysConfigDTO> listConfigByConfigKey(List<String> configKeys) {
|
||||
LambdaQueryWrapper<SysConfigPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SysConfigPO::getConfigKey, configKeys);
|
||||
List<SysConfigPO> sysConfigPOList = sysConfigRepo.list(wrapper);
|
||||
return SysConfigConvert.INSTANCE.posToDtos(sysConfigPOList);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysConfigDTO getConfigByConfigKey(String configKey) {
|
||||
LambdaQueryWrapper<SysConfigPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SysConfigPO::getConfigKey, configKey);
|
||||
return SysConfigConvert.INSTANCE.poToDTO(sysConfigRepo.getOne(wrapper));
|
||||
}
|
||||
}
|
||||
|
||||
118
src/main/java/com/sczx/store/service/impl/WalletServiceImpl.java
Normal file
118
src/main/java/com/sczx/store/service/impl/WalletServiceImpl.java
Normal file
@ -0,0 +1,118 @@
|
||||
package com.sczx.store.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sczx.store.common.enums.WalletChangeTypeEnum;
|
||||
import com.sczx.store.convert.BaseWalletChangeConvert;
|
||||
import com.sczx.store.convert.BaseWalletConvert;
|
||||
import com.sczx.store.dto.BaseWalletChangeDTO;
|
||||
import com.sczx.store.dto.BaseWalletDTO;
|
||||
import com.sczx.store.dto.WalletChangeQueryReq;
|
||||
import com.sczx.store.dto.WithdrawalReq;
|
||||
import com.sczx.store.dto.req.DistibIncomeReq;
|
||||
import com.sczx.store.exception.BizException;
|
||||
import com.sczx.store.po.BaseWalletChangePO;
|
||||
import com.sczx.store.po.BaseWalletPO;
|
||||
import com.sczx.store.po.CompanyStorePO;
|
||||
import com.sczx.store.repository.BaseWalletChangeRepo;
|
||||
import com.sczx.store.repository.BaseWalletRepo;
|
||||
import com.sczx.store.repository.CompanyStoreRepo;
|
||||
import com.sczx.store.service.IWalletService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class WalletServiceImpl implements IWalletService {
|
||||
|
||||
@Autowired
|
||||
private BaseWalletRepo baseWalletRepo;
|
||||
|
||||
@Autowired
|
||||
private BaseWalletChangeRepo baseWalletChangeRepo;
|
||||
|
||||
@Autowired
|
||||
private CompanyStoreRepo companyStoreRepo;
|
||||
|
||||
@Override
|
||||
public BaseWalletDTO getWalletInfo(Long userId) {
|
||||
BaseWalletPO baseWalletPO = baseWalletRepo.getById(userId);
|
||||
return BaseWalletConvert.INSTANCE.po2Dto(baseWalletPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void distibIncome(DistibIncomeReq distibIncomeReq) {
|
||||
CompanyStorePO companyStorePO = companyStoreRepo.getById(distibIncomeReq.getStoreId());
|
||||
if(Objects.isNull(companyStorePO)){
|
||||
throw new BizException("门店不存在");
|
||||
}
|
||||
if(!StringUtils.equalsIgnoreCase(companyStorePO.getStatus(),"0")){
|
||||
throw new BizException("门店已下架");
|
||||
}
|
||||
BaseWalletPO baseWalletPO = baseWalletRepo.getById(companyStorePO.getId());
|
||||
if(Objects.isNull(baseWalletPO)){
|
||||
baseWalletPO = new BaseWalletPO();
|
||||
baseWalletPO.setUserId(distibIncomeReq.getStoreId());
|
||||
baseWalletPO.setPhoneNumber(companyStorePO.getStoreNumber());
|
||||
baseWalletPO.setUserName(companyStorePO.getName());
|
||||
baseWalletPO.setWalletType(0);
|
||||
baseWalletPO.setBalance(distibIncomeReq.getAmount());
|
||||
baseWalletPO.setAvailableAmount(distibIncomeReq.getAmount());
|
||||
baseWalletRepo.save(baseWalletPO);
|
||||
} else {
|
||||
baseWalletPO.setBalance(baseWalletPO.getBalance().add(distibIncomeReq.getAmount()));
|
||||
baseWalletPO.setAvailableAmount(baseWalletPO.getAvailableAmount().add(distibIncomeReq.getAmount()));
|
||||
baseWalletRepo.updateById(baseWalletPO);
|
||||
}
|
||||
//添加钱包变动记录
|
||||
BaseWalletChangePO baseWalletChangePO = new BaseWalletChangePO();
|
||||
baseWalletChangePO.setUserId(baseWalletPO.getUserId());
|
||||
baseWalletChangePO.setChangeType(WalletChangeTypeEnum.REFERRAL.getCode());
|
||||
baseWalletChangePO.setChangeTime(LocalDateTime.now());
|
||||
baseWalletChangePO.setChangeAmount(distibIncomeReq.getAmount());
|
||||
baseWalletChangeRepo.save(baseWalletChangePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseWalletChangeDTO> listWalletChange(WalletChangeQueryReq baseWalletChangeQueryReq) {
|
||||
LambdaQueryWrapper<BaseWalletChangePO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BaseWalletChangePO::getUserId, baseWalletChangeQueryReq.getUserId())
|
||||
.eq(StringUtils.isNotBlank(baseWalletChangeQueryReq.getChangeType()),BaseWalletChangePO::getChangeType, baseWalletChangeQueryReq.getChangeType())
|
||||
.orderByDesc(BaseWalletChangePO::getChangeTime);
|
||||
List<BaseWalletChangePO> baseWalletChangePOList = baseWalletChangeRepo.list(queryWrapper);
|
||||
return BaseWalletChangeConvert.INSTANCE.pos2Dtos(baseWalletChangePOList);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void storeWithdrawal(WithdrawalReq withdrawalReq) {
|
||||
//先
|
||||
BaseWalletPO baseWalletPO = baseWalletRepo.getById(withdrawalReq.getStoreId());
|
||||
if(Objects.isNull(baseWalletPO)){
|
||||
throw new BizException("门店钱包未创建");
|
||||
}
|
||||
if(baseWalletPO.getAvailableAmount().compareTo(withdrawalReq.getWithdrawalAmount()) < 0){
|
||||
throw new BizException("钱包可用余额不足");
|
||||
}
|
||||
//更新钱包信息
|
||||
LambdaUpdateWrapper<BaseWalletPO> updateWalletWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWalletWrapper.eq(BaseWalletPO::getUserId, withdrawalReq.getStoreId())
|
||||
.set(BaseWalletPO::getAvailableAmount, baseWalletPO.getAvailableAmount().subtract(withdrawalReq.getWithdrawalAmount()))
|
||||
.set(BaseWalletPO::getFreezeAmount, baseWalletPO.getFreezeAmount().add(withdrawalReq.getWithdrawalAmount()));
|
||||
baseWalletRepo.update(updateWalletWrapper);
|
||||
|
||||
//添加钱包变动记录
|
||||
BaseWalletChangePO baseWalletChangePO = new BaseWalletChangePO();
|
||||
baseWalletChangePO.setUserId(withdrawalReq.getStoreId());
|
||||
baseWalletChangePO.setChangeType(WalletChangeTypeEnum.WITHDRAWAL.getCode());
|
||||
baseWalletChangePO.setChangeTime(LocalDateTime.now());
|
||||
baseWalletChangePO.setChangeAmount(withdrawalReq.getWithdrawalAmount());
|
||||
baseWalletChangePO.setChangeStatus("UNREVIEWED");
|
||||
baseWalletChangeRepo.save(baseWalletChangePO);
|
||||
}
|
||||
}
|
||||
@ -1,91 +1,4 @@
|
||||
|
||||
server:
|
||||
port: 8082
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: sczx-store # 微服务名称
|
||||
http:
|
||||
encoding:
|
||||
charset: UTF-8
|
||||
enabled: true
|
||||
force: true
|
||||
mvc:
|
||||
async:
|
||||
request-timeout: -1
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 115.190.8.52:8848 # Nacos 地址
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
env: dev
|
||||
lifecycle:
|
||||
timeout-per-shutdown-phase: 30s # 设置优雅停机时间
|
||||
datasource:
|
||||
url: jdbc:mysql://115.190.8.52:3306/sczx?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
username: sczx_user
|
||||
password: Sczx123@
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
hikari:
|
||||
maximum-pool-size: 10
|
||||
auto-commit: true
|
||||
redis:
|
||||
host: 115.190.8.52
|
||||
port: 6379
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: 2000ms
|
||||
max-idle: 4
|
||||
min-idle: 1
|
||||
max-life-time: 300000ms
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*" # 暴露所有监控端点
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
feign:
|
||||
client:
|
||||
config:
|
||||
default:
|
||||
connectTimeout: 5000
|
||||
readTimeout: 5000
|
||||
hystrix:
|
||||
enabled: true # 启用 Feign 的 Hystrix 支持
|
||||
|
||||
hystrix:
|
||||
command:
|
||||
default:
|
||||
execution:
|
||||
isolation:
|
||||
thread:
|
||||
timeoutInMilliseconds: 10000 # 默认熔断超时时间
|
||||
|
||||
#springdoc:
|
||||
# swagger-ui:
|
||||
# url: /v3/api-docs
|
||||
# path: /doc.html
|
||||
# packages-to-scan: com.sczx.store.controller # 替换为你的 controller 包路径
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml
|
||||
type-aliases-package: com.sczx.store.po # 实体类包路径
|
||||
configuration:
|
||||
mapUnderscoreToCamelCase: true
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 控制台打印 SQL(调试用)
|
||||
|
||||
auth:
|
||||
secret-key: his-is-a-very-long-and-secure-secret-key-for-jwt-signing-please-dont-use-short-keys
|
||||
token-expiration: 86400000 # 24小时
|
||||
|
||||
oss:
|
||||
region: oss-cn-shanghai
|
||||
accessKeyId: LTAI5tFZygsWsFqAqUbBmCrB
|
||||
accessKeySecret: n417ym6PZyq5Gc4NHHps3EwzNiClDJ
|
||||
15
src/main/resources/bootstrap.yml
Normal file
15
src/main/resources/bootstrap.yml
Normal file
@ -0,0 +1,15 @@
|
||||
spring:
|
||||
application:
|
||||
name: sczx-store # 应用名称,对应 Nacos 配置的 dataId
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 115.190.8.52:8848 # Nacos 服务器地址
|
||||
config:
|
||||
group: DEFAULT_GROUP # 配置分组
|
||||
file-extension: yaml # 配置文件格式
|
||||
timeout: 5000 # 配置读取超时时间
|
||||
# 添加共享配置
|
||||
shared-configs:
|
||||
- data-id: shared-config.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true # 是否支持动态刷新
|
||||
5
src/main/resources/mapper/BaseWalletChangeMapper.xml
Normal file
5
src/main/resources/mapper/BaseWalletChangeMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.store.mapper.BaseWalletChangeMapper">
|
||||
|
||||
</mapper>
|
||||
5
src/main/resources/mapper/BaseWalletMapper.xml
Normal file
5
src/main/resources/mapper/BaseWalletMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.store.mapper.BaseWalletMapper">
|
||||
|
||||
</mapper>
|
||||
5
src/main/resources/mapper/CompanyMapper.xml
Normal file
5
src/main/resources/mapper/CompanyMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.store.mapper.CompanyMapper">
|
||||
|
||||
</mapper>
|
||||
@ -47,13 +47,15 @@
|
||||
)
|
||||
)) AS distance
|
||||
FROM
|
||||
zc_company_store t
|
||||
zc_company_store t ,zc_company zc
|
||||
<where>
|
||||
t.is_del = 0
|
||||
and t.status = 0
|
||||
and t.is_show = 1
|
||||
and t.latitude between #{storeDistanceReq.minLat} and #{storeDistanceReq.maxLat}
|
||||
and t.longitude between #{storeDistanceReq.minLng} and #{storeDistanceReq.maxLng}
|
||||
and t.operating_company_id = zc.id
|
||||
and zc.status = 0
|
||||
</where>
|
||||
order by distance asc
|
||||
|
||||
|
||||
5
src/main/resources/mapper/SysConfigMapper.xml
Normal file
5
src/main/resources/mapper/SysConfigMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.store.mapper.SysConfigMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user