Compare commits
11 commits
2b6eee2ada
...
f298273bb1
| Author | SHA1 | Date | |
|---|---|---|---|
| f298273bb1 | |||
| 120be5d526 | |||
|
|
469ff37b8e | ||
|
|
6badf1652b | ||
|
|
64e9304966 | ||
|
|
221902f161 | ||
|
|
9add2e7643 | ||
|
|
ad74be0e2b | ||
|
|
bd6f95560c | ||
|
|
efdf3092e5 | ||
|
|
a71844875a |
24 changed files with 410 additions and 34 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM java:8u111-jdk
|
FROM openjdk:8u342-jre
|
||||||
|
|
||||||
#作者
|
#作者
|
||||||
LABEL maintainer="peng"
|
LABEL maintainer="peng"
|
||||||
|
|
|
||||||
26
README.md
26
README.md
|
|
@ -34,6 +34,32 @@
|
||||||
- Eclipse、IDEA运行sqxApplication.java,则可启动项目
|
- Eclipse、IDEA运行sqxApplication.java,则可启动项目
|
||||||
- Swagger文档路径:http://localhost:8964/sqx_fast/swagger/index.html
|
- Swagger文档路径:http://localhost:8964/sqx_fast/swagger/index.html
|
||||||
- Swagger注解路径:http://localhost:8964/sqx_fast/swagger-ui.html
|
- Swagger注解路径:http://localhost:8964/sqx_fast/swagger-ui.html
|
||||||
|
使用以下命令安装依赖
|
||||||
|
```bash
|
||||||
|
# 安装 icbc-api-sdk-cop.jar
|
||||||
|
mvn install:install-file \
|
||||||
|
-Dfile=src/main/resources/lib/icbc-api-sdk-cop.jar \
|
||||||
|
-DgroupId=com.icbc \
|
||||||
|
-DartifactId=icbc-api-sdk-cop \
|
||||||
|
-Dversion=1.0.5 \
|
||||||
|
-Dpackaging=jar
|
||||||
|
|
||||||
|
# 安装 icbc-api-sdk-cop-io.jar
|
||||||
|
mvn install:install-file \
|
||||||
|
-Dfile=src/main/resources/lib/icbc-api-sdk-cop-io.jar \
|
||||||
|
-DgroupId=com.icbc \
|
||||||
|
-DartifactId=icbc-api-sdk-cop-io \
|
||||||
|
-Dversion=1.0.5 \
|
||||||
|
-Dpackaging=jar
|
||||||
|
|
||||||
|
# 安装 hsm-software-share-1.0.5.jar
|
||||||
|
mvn install:install-file \
|
||||||
|
-Dfile=src/main/resources/lib/hsm-software-share-1.0.5.jar \
|
||||||
|
-DgroupId=com.icbc \
|
||||||
|
-DartifactId=icbc-hsm \
|
||||||
|
-Dversion=1.0.5 \
|
||||||
|
-Dpackaging=jar
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
|
||||||
23
deploy.sh
Executable file
23
deploy.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 设置版本号或标签
|
||||||
|
TAG="songshui:sqx-1.0.4"
|
||||||
|
IMAGE_NAME="crpi-189p4y6a6tb3b6dl.cn-hangzhou.personal.cr.aliyuncs.com/peng_all"
|
||||||
|
|
||||||
|
# 构建 Docker 镜像
|
||||||
|
docker build --platform linux/amd64 -t "$TAG" .
|
||||||
|
|
||||||
|
# 获取构建后的镜像ID
|
||||||
|
IMAGE_ID=$(docker images -q "$TAG")
|
||||||
|
|
||||||
|
# 标记镜像
|
||||||
|
docker tag "$IMAGE_ID" "$IMAGE_NAME/$TAG"
|
||||||
|
|
||||||
|
# 推送到远程仓库
|
||||||
|
docker push "$IMAGE_NAME/$TAG"
|
||||||
|
|
||||||
|
# 删除镜像
|
||||||
|
docker rmi "$IMAGE_NAME/$TAG"
|
||||||
|
|
||||||
|
# 打印信息
|
||||||
|
echo "Docker image built and pushed with tag: $TAG"
|
||||||
14
pom.xml
14
pom.xml
|
|
@ -406,11 +406,6 @@
|
||||||
<artifactId>icbc-hsm</artifactId>
|
<artifactId>icbc-hsm</artifactId>
|
||||||
<version>1.0.5</version>
|
<version>1.0.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>com.baidu.aip</groupId>-->
|
|
||||||
<!-- <artifactId>java-sdk</artifactId>-->
|
|
||||||
<!-- <version>4.11.3</version>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -486,10 +481,15 @@
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>showye-repository-r3d</id>
|
||||||
|
<name>Showye Repository</name>
|
||||||
|
<url>https://maven.showye.cn/r3d</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>public</id>
|
<id>public</id>
|
||||||
<name>aliyun nexus</name>
|
<name>aliyun nexus</name>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
|
|
@ -499,7 +499,7 @@
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>public</id>
|
<id>public</id>
|
||||||
<name>aliyun nexus</name>
|
<name>aliyun nexus</name>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,8 @@ public class UserController {
|
||||||
//设置本年收入
|
//设置本年收入
|
||||||
homeMessageResponse.setYearRevenue(userService.queryPayMoney(3));
|
homeMessageResponse.setYearRevenue(userService.queryPayMoney(3));
|
||||||
|
|
||||||
|
//设置所有用户总金额
|
||||||
|
homeMessageResponse.setTotalMoney(userMoneyService.sumMoney());
|
||||||
return Result.success().put("data", homeMessageResponse);
|
return Result.success().put("data", homeMessageResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.sqx.modules.app.utils.UserConstantInterface;
|
||||||
import com.sqx.modules.app.utils.WxPhone;
|
import com.sqx.modules.app.utils.WxPhone;
|
||||||
import com.sqx.modules.common.entity.CommonInfo;
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
import com.sqx.modules.common.service.CommonInfoService;
|
import com.sqx.modules.common.service.CommonInfoService;
|
||||||
|
import com.sqx.modules.sys.service.SysCaptchaService;
|
||||||
import com.sqx.modules.utils.HttpClientUtil;
|
import com.sqx.modules.utils.HttpClientUtil;
|
||||||
import com.sqx.modules.utils.MD5Util;
|
import com.sqx.modules.utils.MD5Util;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import weixin.popular.api.SnsAPI;
|
import weixin.popular.api.SnsAPI;
|
||||||
import weixin.popular.bean.sns.SnsToken;
|
import weixin.popular.bean.sns.SnsToken;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -43,6 +46,9 @@ public class AppLoginController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CommonInfoService commonInfoService;
|
private CommonInfoService commonInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SysCaptchaService sysCaptchaService;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("微信小程序登陆")
|
@ApiOperation("微信小程序登陆")
|
||||||
@RequestMapping(value = "/wxLogin", method = RequestMethod.GET)
|
@RequestMapping(value = "/wxLogin", method = RequestMethod.GET)
|
||||||
|
|
@ -119,9 +125,13 @@ public class AppLoginController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("用户端发送验证码")
|
@ApiOperation("用户端发送验证码")
|
||||||
@RequestMapping(value = "/sendMsg/{phone}/{state}", method = RequestMethod.GET)
|
@RequestMapping(value = "/sendMsg/{phone}/{state}/{captchaval}/{uuid}", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Result sendMsg(@PathVariable String phone, @PathVariable String state) {
|
public Result sendMsg(@PathVariable String phone, @PathVariable String state,@PathVariable String captchaval,@PathVariable String uuid) {
|
||||||
|
boolean captcha = sysCaptchaService.validate(uuid, captchaval);
|
||||||
|
if(!captcha){
|
||||||
|
return Result.error("验证码不正确");
|
||||||
|
}
|
||||||
return userService.sendMsg(phone, state);
|
return userService.sendMsg(phone, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,9 @@ public interface UserMoneyDao extends BaseMapper<UserMoney> {
|
||||||
|
|
||||||
|
|
||||||
BigDecimal sumHasSafetyMoney();
|
BigDecimal sumHasSafetyMoney();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询总金额
|
||||||
|
*/
|
||||||
|
BigDecimal sumMoney();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,9 @@ public class UserEntity implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer isSafetyMoney;
|
private Integer isSafetyMoney;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal money;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是推广员 1是
|
* 是否是推广员 1是
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -49,4 +49,9 @@ public class HomeMessageResponse implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Double yearRevenue;
|
private Double yearRevenue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有用户金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,11 @@ import com.sqx.modules.app.entity.UserMoneyDetails;
|
||||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public interface UserMoneyService extends IService<UserMoney> {
|
public interface UserMoneyService extends IService<UserMoney> {
|
||||||
|
|
||||||
|
BigDecimal sumMoney();
|
||||||
|
|
||||||
UserMoney selectUserMoneyByUserId(Long userId);
|
UserMoney selectUserMoneyByUserId(Long userId);
|
||||||
|
|
||||||
void updateSafetyMoneyWay(Long id, Integer safetyMoneyWay, String orderNo);
|
void updateSafetyMoneyWay(Long id, Integer safetyMoneyWay, String orderNo);
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,11 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
|
||||||
baseMapper.updateSafetyMoney(i, userId, money);
|
baseMapper.updateSafetyMoney(i, userId, money);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal sumMoney() {
|
||||||
|
return baseMapper.sumMoney();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserMoney selectUserMoneyByUserId(Long userId) {
|
public UserMoney selectUserMoneyByUserId(Long userId) {
|
||||||
UserMoney userMoney = baseMapper.selectOne(new QueryWrapper<UserMoney>().eq("user_id", userId));
|
UserMoney userMoney = baseMapper.selectOne(new QueryWrapper<UserMoney>().eq("user_id", userId));
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,24 @@ package com.sqx.modules.common.service;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.common.entity.CommonInfo;
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fang
|
* @author fang
|
||||||
* @date 2020/7/8
|
* @date 2020/7/8
|
||||||
*/
|
*/
|
||||||
public interface CommonInfoService {
|
public interface CommonInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据充值金额获取赠送金额
|
||||||
|
* @param rechargeAmount 充值金额
|
||||||
|
* @return 赠送金额
|
||||||
|
*/
|
||||||
|
BigDecimal getRechargeBonus(BigDecimal rechargeAmount);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存对象
|
* 保存对象
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,24 @@ import com.sqx.modules.common.entity.CommonInfo;
|
||||||
import com.sqx.modules.common.service.CommonInfoService;
|
import com.sqx.modules.common.service.CommonInfoService;
|
||||||
import com.sqx.modules.tbCoupon.entity.TbCoupon;
|
import com.sqx.modules.tbCoupon.entity.TbCoupon;
|
||||||
import com.sqx.modules.tbCoupon.service.TbCouponService;
|
import com.sqx.modules.tbCoupon.service.TbCouponService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fang
|
* @author fang
|
||||||
* @date 2020/7/8
|
* @date 2020/7/8
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo> implements CommonInfoService {
|
public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo> implements CommonInfoService {
|
||||||
|
|
||||||
|
|
@ -33,8 +39,93 @@ public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo
|
||||||
this.commonInfoDao = commonInfoDao;
|
this.commonInfoDao = commonInfoDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证充值金额配置格式
|
||||||
|
* @param configValue 配置值,格式为:充值金额:赠送金额,充值金额:赠送金额,... 或 充值金额,充值金额,...
|
||||||
|
* @return 验证结果,成功返回null,失败返回错误信息
|
||||||
|
*/
|
||||||
|
private Result validateRechargeBonusConfig(String configValue) {
|
||||||
|
if (StringUtils.isBlank(configValue)) {
|
||||||
|
return Result.error("充值金额配置不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 按逗号分割每个配置项
|
||||||
|
String[] configItems = configValue.split(",");
|
||||||
|
|
||||||
|
// 检查是否所有项都不包含冒号(纯充值金额格式)
|
||||||
|
boolean allWithoutColon = true;
|
||||||
|
boolean allWithColon = true;
|
||||||
|
|
||||||
|
for (String item : configItems) {
|
||||||
|
if (item.contains(":")) {
|
||||||
|
allWithoutColon = false;
|
||||||
|
} else {
|
||||||
|
allWithColon = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不允许混合格式(有些有冒号,有些没有)
|
||||||
|
if (!allWithoutColon && !allWithColon) {
|
||||||
|
return Result.error("充值金额配置格式错误,不能混合使用两种格式。请使用统一格式:充值金额:赠送金额,... 或 充值金额,...");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查每个配置项的格式
|
||||||
|
for (String item : configItems) {
|
||||||
|
if (item.contains(":")) {
|
||||||
|
// 带赠送金额的格式
|
||||||
|
String[] parts = item.split(":");
|
||||||
|
if (parts.length != 2) {
|
||||||
|
return Result.error("充值金额配置格式错误,正确格式为:充值金额:赠送金额,充值金额:赠送金额,...");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 验证金额是否为有效的数字
|
||||||
|
BigDecimal rechargeAmount = new BigDecimal(parts[0].trim());
|
||||||
|
BigDecimal bonusAmount = new BigDecimal(parts[1].trim());
|
||||||
|
|
||||||
|
// 验证金额是否为正数
|
||||||
|
if (rechargeAmount.compareTo(BigDecimal.ZERO) <= 0 || bonusAmount.compareTo(BigDecimal.ZERO) < 0) {
|
||||||
|
return Result.error("充值金额必须大于0,赠送金额必须大于等于0");
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return Result.error("充值金额和赠送金额必须为有效的数字");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 纯充值金额格式
|
||||||
|
try {
|
||||||
|
// 验证金额是否为有效的数字
|
||||||
|
BigDecimal rechargeAmount = new BigDecimal(item.trim());
|
||||||
|
|
||||||
|
// 验证金额是否为正数
|
||||||
|
if (rechargeAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
return Result.error("充值金额必须大于0");
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return Result.error("充值金额必须为有效的数字");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证通过
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Result.error("充值金额配置格式错误,正确格式为:充值金额:赠送金额,... 或 充值金额,...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result update(CommonInfo commonInfo) {
|
public Result update(CommonInfo commonInfo) {
|
||||||
|
// 检查是否是充值金额配置(type=279)
|
||||||
|
if (commonInfo != null && commonInfo.getType() != null && commonInfo.getType() == 279) {
|
||||||
|
// 验证充值金额配置格式
|
||||||
|
Result validationResult = validateRechargeBonusConfig(commonInfo.getValue());
|
||||||
|
if (validationResult != null) {
|
||||||
|
return validationResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过验证,更新数据库
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
commonInfo.setCreateAt(sdf.format(now));
|
commonInfo.setCreateAt(sdf.format(now));
|
||||||
|
|
@ -80,6 +171,83 @@ public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo
|
||||||
}
|
}
|
||||||
return Result.success().put("data", commonInfoList);
|
return Result.success().put("data", commonInfoList);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public BigDecimal getRechargeBonus(BigDecimal rechargeAmount) {
|
||||||
|
// 获取充值赠送配置(type=279)
|
||||||
|
log.info("rechargeAmount:{}", rechargeAmount);
|
||||||
|
CommonInfo rechargeConfig = commonInfoDao.findOne(279);
|
||||||
|
log.info("获取充值赠送配置:{}", rechargeConfig);
|
||||||
|
if (rechargeConfig == null || StringUtils.isBlank(rechargeConfig.getValue())) {
|
||||||
|
log.info("StringUtils.isBlank final:{}", StringUtils.isBlank(rechargeConfig.getValue()),rechargeConfig.getValue());
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String configValue = rechargeConfig.getValue();
|
||||||
|
Map<BigDecimal, BigDecimal> bonusMap = parseRechargeBonusConfig(configValue);
|
||||||
|
log.info("bonusMap final:{}", bonusMap);
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal bonus = BigDecimal.ZERO;
|
||||||
|
for (Map.Entry<BigDecimal, BigDecimal> entry : bonusMap.entrySet()) {
|
||||||
|
if (entry.getKey().compareTo(rechargeAmount) == 0) {
|
||||||
|
bonus = entry.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("get rechargeAmount final:{}", bonus);
|
||||||
|
|
||||||
|
return bonus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取支付方式描述
|
||||||
|
*/
|
||||||
|
private String getPayTypeDesc(Integer payType) {
|
||||||
|
switch (payType) {
|
||||||
|
case 1:
|
||||||
|
return "微信";
|
||||||
|
case 2:
|
||||||
|
return "支付宝";
|
||||||
|
case 3:
|
||||||
|
return "工商银行";
|
||||||
|
default:
|
||||||
|
return "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析充值赠送配置
|
||||||
|
* @param configValue 配置值,格式为:充值金额:赠送金额,充值金额:赠送金额,...
|
||||||
|
* @return 充值金额与赠送金额的映射
|
||||||
|
*/
|
||||||
|
private Map<BigDecimal, BigDecimal> parseRechargeBonusConfig(String configValue) {
|
||||||
|
if (StringUtils.isBlank(configValue)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 按逗号分割每个配置项
|
||||||
|
String[] configItems = configValue.split(",");
|
||||||
|
Map<BigDecimal, BigDecimal> bonusMap = new java.util.HashMap<>();
|
||||||
|
|
||||||
|
for (String item : configItems) {
|
||||||
|
// 检查配置项是否包含冒号
|
||||||
|
if (item.contains(":")) {
|
||||||
|
String[] parts = item.split(":");
|
||||||
|
if (parts.length == 2) {
|
||||||
|
BigDecimal rechargeAmount = new BigDecimal(parts[0].trim());
|
||||||
|
BigDecimal bonusAmount = new BigDecimal(parts[1].trim());
|
||||||
|
bonusMap.put(rechargeAmount, bonusAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return bonusMap;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 解析异常时返回空映射
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,14 +2,19 @@ package com.sqx.modules.operatorsLog.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.operatorsLog.entity.OperatorsLog;
|
import com.sqx.modules.operatorsLog.entity.OperatorsLog;
|
||||||
import com.sqx.modules.operatorsLog.service.OperatorsLogService;
|
import com.sqx.modules.operatorsLog.service.OperatorsLogService;
|
||||||
|
import com.sqx.modules.pay.entity.PayDetails;
|
||||||
|
import com.sqx.modules.utils.EasyPoi.ExcelUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
|
|
@ -31,6 +36,13 @@ public class AdminOperatorsLogController {
|
||||||
return Result.success().put("data", operatorsLogService.getOperatorsLogList(page, limit, operatorsLog));
|
return Result.success().put("data", operatorsLogService.getOperatorsLogList(page, limit, operatorsLog));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/operatorsLogListExcel")
|
||||||
|
@ApiOperation("压桶修改日志列表导出")
|
||||||
|
public void operatorsLogListExcel(Integer page, Integer limit, OperatorsLog operatorsLog, HttpServletResponse response) throws Exception {
|
||||||
|
IPage<OperatorsLog> operatorsLogList = operatorsLogService.getOperatorsLogList(page, limit, operatorsLog);
|
||||||
|
ExcelUtils.exportExcel(operatorsLogList.getRecords(), "押桶记录", "押桶记录", OperatorsLog.class, "押桶记录", response);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "deleteLogById")
|
@RequestMapping(value = "deleteLogById")
|
||||||
@ApiOperation("根据id删除日志")
|
@ApiOperation("根据id删除日志")
|
||||||
public Result deleteLogById(Long logId) {
|
public Result deleteLogById(Long logId) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.sqx.modules.operatorsLog.entity;
|
package com.sqx.modules.operatorsLog.entity;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.SqlCondition;
|
import com.baomidou.mybatisplus.annotation.SqlCondition;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
|
@ -27,6 +28,7 @@ public class OperatorsLog implements Serializable {
|
||||||
* 日志id
|
* 日志id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "log_id", type = IdType.AUTO)
|
@TableId(value = "log_id", type = IdType.AUTO)
|
||||||
|
@Excel(name = "日志id")
|
||||||
private Long logId;
|
private Long logId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,11 +44,13 @@ public class OperatorsLog implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 修改人昵称
|
* 修改人昵称
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "修改人")
|
||||||
@TableField(condition = SqlCondition.LIKE)
|
@TableField(condition = SqlCondition.LIKE)
|
||||||
private String updateUserName;
|
private String updateUserName;
|
||||||
/**
|
/**
|
||||||
* 修改人手机号码
|
* 修改人手机号码
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "修改人手机号码")
|
||||||
private String updateUserPhone;
|
private String updateUserPhone;
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
|
|
@ -56,40 +60,48 @@ public class OperatorsLog implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "用户昵称")
|
||||||
@TableField(condition = SqlCondition.LIKE)
|
@TableField(condition = SqlCondition.LIKE)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户手机号码
|
* 用户手机号码
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "用户手机号码")
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户上一次压桶数
|
* 用户上一次压桶数
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "用户上一次压桶数")
|
||||||
private Integer lastBucket;
|
private Integer lastBucket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1增加 2减少
|
* 1增加 2减少
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "操作类型")
|
||||||
private Integer operator;
|
private Integer operator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改数量
|
* 修改数量
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "修改数量")
|
||||||
private Integer operatorNum;
|
private Integer operatorNum;
|
||||||
/**
|
/**
|
||||||
* 0待审核 1已通过 2已拒绝
|
* 0待审核 1已通过 2已拒绝
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "操作状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改后的压桶数
|
* 修改后的压桶数
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "修改后的压桶数")
|
||||||
private Integer nextBucket;
|
private Integer nextBucket;
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "修改时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,7 @@ import com.sqx.modules.taking.entity.OrderTaking;
|
||||||
import com.sqx.modules.tbCoupon.entity.TbCouponUser;
|
import com.sqx.modules.tbCoupon.entity.TbCouponUser;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
@ -118,7 +115,7 @@ public class Orders implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 无需验证码 完成订单的图片
|
* 无需验证码 完成订单的图片
|
||||||
*/
|
*/
|
||||||
private String noCodeFinishImg;
|
private String noCodeFinishImg;
|
||||||
/**
|
/**
|
||||||
* 下单用户类型 1用户 2师傅
|
* 下单用户类型 1用户 2师傅
|
||||||
*/
|
*/
|
||||||
|
|
@ -141,12 +138,15 @@ public class Orders implements Serializable {
|
||||||
private String laundryPhone;
|
private String laundryPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*是否已修改桶数量 0未修改 1已修改
|
* 是否已修改桶数量 0未修改 1已修改
|
||||||
*/
|
*/
|
||||||
private Integer isUpdateBucket;
|
private Integer isUpdateBucket;
|
||||||
/**
|
/**
|
||||||
*是否已推送
|
* 是否已推送
|
||||||
*/
|
*/
|
||||||
private Integer isPushMeg;
|
private Integer isPushMeg;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private int bucket;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import com.sqx.modules.utils.SenInfoCheckUtil;
|
||||||
import com.sqx.modules.utils.excel.ExcelData;
|
import com.sqx.modules.utils.excel.ExcelData;
|
||||||
import jodd.util.StringUtil;
|
import jodd.util.StringUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import lombok.val;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.gavaghan.geodesy.Ellipsoid;
|
import org.gavaghan.geodesy.Ellipsoid;
|
||||||
import org.gavaghan.geodesy.GlobalCoordinates;
|
import org.gavaghan.geodesy.GlobalCoordinates;
|
||||||
|
|
@ -985,6 +986,8 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
orders.setLaundryPhone(laundry.getLaundryPhone());
|
orders.setLaundryPhone(laundry.getLaundryPhone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val userBucketCount = getUserBucketCount(orders.getUserId());
|
||||||
|
orders.setBucket(userBucketCount);
|
||||||
return Result.success().put("data", orders);
|
return Result.success().put("data", orders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -490,10 +490,10 @@ public class CashController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/refund/{cashId}/{content}", method = RequestMethod.POST)
|
@RequestMapping(value = "/refund/{cashId}", method = RequestMethod.POST)
|
||||||
@ApiOperation("管理平台退款")
|
@ApiOperation("管理平台退款")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Result refund(@PathVariable("cashId") Long cashId, @PathVariable("content") String content) {
|
public Result refund(@PathVariable("cashId") Long cashId, @RequestParam("content") String content) {
|
||||||
CashOut one = cashOutService.selectById(cashId);
|
CashOut one = cashOutService.selectById(cashId);
|
||||||
if (one == null) {
|
if (one == null) {
|
||||||
return Result.error("提现信息不存在");
|
return Result.error("提现信息不存在");
|
||||||
|
|
|
||||||
|
|
@ -170,8 +170,18 @@ public class AliPayController {
|
||||||
//设置订单更新时间
|
//设置订单更新时间
|
||||||
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||||
payOrderDao.updateById(orders);
|
payOrderDao.updateById(orders);
|
||||||
//调用处理接口
|
// 处理充值赠送金额
|
||||||
userMoneyDao.updateMayMoney(1, orders.getUserId(), orders.getMoney());
|
BigDecimal bonusAmount = commonInfoService.getRechargeBonus(orders.getMoney());
|
||||||
|
// 计算总金额(充值金额 + 赠送金额)
|
||||||
|
BigDecimal totalAmount = orders.getMoney().add(bonusAmount);
|
||||||
|
|
||||||
|
// 一次性更新用户余额(充值金额 + 赠送金额)
|
||||||
|
userMoneyDao.updateMayMoney(1, orders.getUserId(), totalAmount);
|
||||||
|
|
||||||
|
// 创建交易记录列表
|
||||||
|
List<UserMoneyDetails> detailsList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 添加充值记录
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
||||||
userMoneyDetails.setUserId(orders.getUserId());
|
userMoneyDetails.setUserId(orders.getUserId());
|
||||||
userMoneyDetails.setTitle("支付宝充值");
|
userMoneyDetails.setTitle("支付宝充值");
|
||||||
|
|
@ -180,7 +190,22 @@ public class AliPayController {
|
||||||
userMoneyDetails.setMoney(orders.getMoney());
|
userMoneyDetails.setMoney(orders.getMoney());
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
detailsList.add(userMoneyDetails);
|
||||||
|
|
||||||
|
// 如果有赠送金额,添加赠送记录
|
||||||
|
if (bonusAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
UserMoneyDetails bonusDetails = new UserMoneyDetails();
|
||||||
|
bonusDetails.setUserId(orders.getUserId());
|
||||||
|
bonusDetails.setTitle("充值赠送");
|
||||||
|
bonusDetails.setContent("充值" + orders.getPayMoney() + "元,赠送" + bonusAmount + "元");
|
||||||
|
bonusDetails.setType(1);
|
||||||
|
bonusDetails.setMoney(bonusAmount);
|
||||||
|
bonusDetails.setCreateTime(sdf.format(new Date()));
|
||||||
|
detailsList.add(bonusDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性保存所有交易记录
|
||||||
|
userMoneyDetailsService.saveBatch(detailsList);
|
||||||
} else if (payDetails.getType() == 2) {
|
} else if (payDetails.getType() == 2) {
|
||||||
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
||||||
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
||||||
|
|
|
||||||
|
|
@ -512,8 +512,21 @@ public class WxServiceImpl implements WxService {
|
||||||
//设置订单更新时间
|
//设置订单更新时间
|
||||||
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||||
payOrderDao.updateById(orders);
|
payOrderDao.updateById(orders);
|
||||||
//调用处理接口
|
// 处理充值赠送金额
|
||||||
userMoneyDao.updateMayMoney(1, orders.getUserId(), orders.getMoney());
|
BigDecimal bonusAmount = commonInfoService.getRechargeBonus(orders.getMoney());
|
||||||
|
log.info("get bonusAmount:{}", bonusAmount);
|
||||||
|
|
||||||
|
// 计算总金额(充值金额 + 赠送金额)
|
||||||
|
BigDecimal totalAmount = orders.getMoney().add(bonusAmount);
|
||||||
|
|
||||||
|
// 一次性更新用户余额(充值金额 + 赠送金额)
|
||||||
|
userMoneyDao.updateMayMoney(1, orders.getUserId(), totalAmount);
|
||||||
|
|
||||||
|
// 创建交易记录列表
|
||||||
|
List<UserMoneyDetails> detailsList = new ArrayList<>();
|
||||||
|
log.info("get totalAmount:{}", bonusAmount);
|
||||||
|
|
||||||
|
// 添加充值记录
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
||||||
userMoneyDetails.setUserId(orders.getUserId());
|
userMoneyDetails.setUserId(orders.getUserId());
|
||||||
userMoneyDetails.setTitle("微信充值");
|
userMoneyDetails.setTitle("微信充值");
|
||||||
|
|
@ -522,7 +535,22 @@ public class WxServiceImpl implements WxService {
|
||||||
userMoneyDetails.setMoney(orders.getMoney());
|
userMoneyDetails.setMoney(orders.getMoney());
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
detailsList.add(userMoneyDetails);
|
||||||
|
|
||||||
|
// 如果有赠送金额,添加赠送记录
|
||||||
|
if (bonusAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
UserMoneyDetails bonusDetails = new UserMoneyDetails();
|
||||||
|
bonusDetails.setUserId(orders.getUserId());
|
||||||
|
bonusDetails.setTitle("充值赠送");
|
||||||
|
bonusDetails.setContent("充值" + orders.getPayMoney() + "元,赠送" + bonusAmount + "元");
|
||||||
|
bonusDetails.setType(1);
|
||||||
|
bonusDetails.setMoney(bonusAmount);
|
||||||
|
bonusDetails.setCreateTime(sdf.format(new Date()));
|
||||||
|
detailsList.add(bonusDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性保存所有交易记录
|
||||||
|
userMoneyDetailsService.saveBatch(detailsList);
|
||||||
} else if (payDetails.getType() == 2) {
|
} else if (payDetails.getType() == 2) {
|
||||||
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
||||||
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
||||||
|
|
@ -837,7 +865,18 @@ public class WxServiceImpl implements WxService {
|
||||||
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
orders.setUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||||
payOrderDao.updateById(orders);
|
payOrderDao.updateById(orders);
|
||||||
//调用处理接口
|
//调用处理接口
|
||||||
userMoneyDao.updateMayMoney(1, orders.getUserId(), orders.getMoney());
|
// 处理充值赠送金额
|
||||||
|
BigDecimal bonusAmount = commonInfoService.getRechargeBonus(orders.getMoney());
|
||||||
|
// 计算总金额(充值金额 + 赠送金额)
|
||||||
|
BigDecimal totalAmount = orders.getMoney().add(bonusAmount);
|
||||||
|
|
||||||
|
// 一次性更新用户余额(充值金额 + 赠送金额)
|
||||||
|
userMoneyDao.updateMayMoney(1, orders.getUserId(), totalAmount);
|
||||||
|
|
||||||
|
// 创建交易记录列表
|
||||||
|
List<UserMoneyDetails> detailsList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 添加充值记录
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
||||||
userMoneyDetails.setUserId(orders.getUserId());
|
userMoneyDetails.setUserId(orders.getUserId());
|
||||||
userMoneyDetails.setTitle("微信充值");
|
userMoneyDetails.setTitle("微信充值");
|
||||||
|
|
@ -846,7 +885,22 @@ public class WxServiceImpl implements WxService {
|
||||||
userMoneyDetails.setMoney(orders.getMoney());
|
userMoneyDetails.setMoney(orders.getMoney());
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
detailsList.add(userMoneyDetails);
|
||||||
|
|
||||||
|
// 如果有赠送金额,添加赠送记录
|
||||||
|
if (bonusAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
UserMoneyDetails bonusDetails = new UserMoneyDetails();
|
||||||
|
bonusDetails.setUserId(orders.getUserId());
|
||||||
|
bonusDetails.setTitle("充值赠送");
|
||||||
|
bonusDetails.setContent("充值" + orders.getPayMoney() + "元,赠送" + bonusAmount + "元");
|
||||||
|
bonusDetails.setType(1);
|
||||||
|
bonusDetails.setMoney(bonusAmount);
|
||||||
|
bonusDetails.setCreateTime(sdf.format(new Date()));
|
||||||
|
detailsList.add(bonusDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性保存所有交易记录
|
||||||
|
userMoneyDetailsService.saveBatch(detailsList);
|
||||||
} else if (payDetails.getType() == 2) {
|
} else if (payDetails.getType() == 2) {
|
||||||
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
Orders orders = ordersDao.selectOne(new QueryWrapper<Orders>().eq("orders_no", payDetails.getOrderId()));
|
||||||
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
GoodsSku goodsSku = goodsSkuService.getById(orders.getSkuId());
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class SysCaptchaServiceImpl extends ServiceImpl<SysCaptchaDao, SysCaptcha
|
||||||
captchaEntity.setCode(code);
|
captchaEntity.setCode(code);
|
||||||
//5分钟后过期
|
//5分钟后过期
|
||||||
captchaEntity.setExpireTime(DateUtils.addDateMinutes(new Date(), 5));
|
captchaEntity.setExpireTime(DateUtils.addDateMinutes(new Date(), 5));
|
||||||
this.save(captchaEntity);
|
this.saveOrUpdate(captchaEntity,new QueryWrapper<SysCaptchaEntity>().eq("uuid",uuid));
|
||||||
|
|
||||||
return producer.createImage(code);
|
return producer.createImage(code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
<select id="selectUserPage" resultType="com.sqx.modules.app.entity.UserEntity">
|
<select id="selectUserPage" resultType="com.sqx.modules.app.entity.UserEntity">
|
||||||
select * from ( SELECT
|
select * from ( SELECT
|
||||||
u.*,
|
u.*,
|
||||||
|
IFNULL(um.money,0) AS money,
|
||||||
l.laundry_name AS laundryName,
|
l.laundry_name AS laundryName,
|
||||||
IF(v.is_vip = 1, 1, 2) AS isVip,
|
IF(v.is_vip = 1, 1, 2) AS isVip,
|
||||||
v.end_time as vipEndTime,
|
v.end_time as vipEndTime,
|
||||||
|
|
@ -24,6 +25,8 @@
|
||||||
ON l.laundry_id = u.laundry_id
|
ON l.laundry_id = u.laundry_id
|
||||||
LEFT JOIN user_vip v
|
LEFT JOIN user_vip v
|
||||||
ON u.user_id = v.user_id
|
ON u.user_id = v.user_id
|
||||||
|
LEFT JOIN user_money um
|
||||||
|
ON u.user_id = um.user_id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
<if test="isVip==2">
|
<if test="isVip==2">
|
||||||
and (v.is_vip =2 or v.is_vip is null)
|
and (v.is_vip =2 or v.is_vip is null)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@
|
||||||
<select id="sumHasSafetyMoney" resultType="java.math.BigDecimal">
|
<select id="sumHasSafetyMoney" resultType="java.math.BigDecimal">
|
||||||
SELECT IFNULL(SUM(safety_money),0) FROM user_money
|
SELECT IFNULL(SUM(safety_money),0) FROM user_money
|
||||||
</select>
|
</select>
|
||||||
|
<select id="sumMoney" resultType="java.math.BigDecimal">
|
||||||
|
SELECT IFNULL(SUM(money), 0)
|
||||||
|
FROM user_money
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -661,13 +661,15 @@
|
||||||
select u.user_id as userId,u.user_name as userName,u.avatar,u.create_time as createTime,
|
select u.user_id as userId,u.user_name as userName,u.avatar,u.create_time as createTime,
|
||||||
<if test="type==1">
|
<if test="type==1">
|
||||||
(select ifnull(sum(o.zhi_rate),0.00) from orders o where
|
(select ifnull(sum(o.zhi_rate),0.00) from orders o where
|
||||||
o.user_id = u.user_id and o.state=2 and zhi_user_id=#{userId} ) as money
|
o.user_id = u.user_id and o.state=2 and zhi_user_id=#{userId} ) as money,
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
(select ifnull(sum(o.fei_rate),0.00) from orders o where
|
(select ifnull(sum(o.fei_rate),0.00) from orders o where
|
||||||
o.user_id = u.user_id and o.state=2 and fei_user_id=#{userId} ) as money
|
o.user_id = u.user_id and o.state=2 and fei_user_id=#{userId} ) as money,
|
||||||
</if>
|
</if>
|
||||||
|
ifnull(um.money, 0.00) as balance
|
||||||
from tb_user u
|
from tb_user u
|
||||||
|
left join user_money um on u.user_id = um.user_id
|
||||||
where
|
where
|
||||||
<if test="type==1">
|
<if test="type==1">
|
||||||
inviter_code=#{invitationCode}
|
inviter_code=#{invitationCode}
|
||||||
|
|
@ -685,7 +687,8 @@
|
||||||
u.user_name AS userName,
|
u.user_name AS userName,
|
||||||
u.avatar,
|
u.avatar,
|
||||||
u.create_time AS createTime,
|
u.create_time AS createTime,
|
||||||
o.money
|
o.money,
|
||||||
|
ifnull(um.money, 0.00) as balance
|
||||||
from (
|
from (
|
||||||
SELECT ifnull(sum(fei_rate), 0.00) as money, user_id
|
SELECT ifnull(sum(fei_rate), 0.00) as money, user_id
|
||||||
FROM orders
|
FROM orders
|
||||||
|
|
@ -693,6 +696,7 @@
|
||||||
and fei_user_id = #{userId}
|
and fei_user_id = #{userId}
|
||||||
GROUP BY user_id) o
|
GROUP BY user_id) o
|
||||||
left join tb_user u on u.user_id = o.user_id
|
left join tb_user u on u.user_id = o.user_id
|
||||||
|
left join user_money um on u.user_id = um.user_id
|
||||||
) a
|
) a
|
||||||
order by money desc
|
order by money desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue