多角色保存修复、售后退款余额、积分处理、微信退款类型处理、升级springboot2.7.10、druid1.2.16、mybatis-plus3.5.3
This commit is contained in:
8
pom.xml
8
pom.xml
@ -28,7 +28,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.7.6</version>
|
<version>2.7.10</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<jedis.version>3.3.0</jedis.version>
|
<jedis.version>3.3.0</jedis.version>
|
||||||
<swagger.version>3.0.0</swagger.version>
|
<swagger.version>3.0.0</swagger.version>
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
<fastjson.version>1.2.83</fastjson.version>
|
||||||
<druid.version>1.2.12</druid.version>
|
<druid.version>1.2.16</druid.version>
|
||||||
<hutool.version>5.5.7</hutool.version>
|
<hutool.version>5.5.7</hutool.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<commons-pool2.version>2.5.0</commons-pool2.version>
|
<commons-pool2.version>2.5.0</commons-pool2.version>
|
||||||
@ -154,8 +154,8 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<!--Mysql依赖包-->
|
<!--Mysql依赖包-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- druid数据源驱动 -->
|
<!-- druid数据源驱动 -->
|
||||||
|
@ -276,14 +276,16 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
|
|||||||
user.setSex(resources.getSex());
|
user.setSex(resources.getSex());
|
||||||
boolean result = this.saveOrUpdate(user);
|
boolean result = this.saveOrUpdate(user);
|
||||||
usersRolesService.lambdaUpdate().eq(UsersRoles ::getUserId,resources.getId()).remove();
|
usersRolesService.lambdaUpdate().eq(UsersRoles ::getUserId,resources.getId()).remove();
|
||||||
UsersRoles usersRoles = new UsersRoles();
|
List<UsersRoles> usersRolesList = new ArrayList<>();
|
||||||
usersRoles.setUserId(resources.getId());
|
|
||||||
Set<Role> set = resources.getRoles();
|
Set<Role> set = resources.getRoles();
|
||||||
for (Role roleIds : set) {
|
for (Role roleIds : set) {
|
||||||
|
UsersRoles usersRoles = new UsersRoles();
|
||||||
|
usersRoles.setUserId(resources.getId());
|
||||||
usersRoles.setRoleId(roleIds.getId());
|
usersRoles.setRoleId(roleIds.getId());
|
||||||
|
usersRolesList.add(usersRoles);
|
||||||
}
|
}
|
||||||
if (result) {
|
if (result) {
|
||||||
usersRolesService.save(usersRoles);
|
usersRolesService.saveBatch(usersRolesList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果用户的角色改变了,需要手动清理下缓存
|
// 如果用户的角色改变了,需要手动清理下缓存
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jjwt.version>0.10.6</jjwt.version>
|
<jjwt.version>0.10.6</jjwt.version>
|
||||||
<mybatis-plus-boot-starter.version>3.5.1</mybatis-plus-boot-starter.version>
|
<mybatis-plus-boot-starter.version>3.5.3</mybatis-plus-boot-starter.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -1,13 +1,21 @@
|
|||||||
package co.yixiang.modules.sales;
|
package co.yixiang.modules.sales;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import co.yixiang.api.YshopException;
|
||||||
import co.yixiang.dozer.service.IGenerator;
|
import co.yixiang.dozer.service.IGenerator;
|
||||||
|
import co.yixiang.enums.OrderInfoEnum;
|
||||||
|
import co.yixiang.enums.PayTypeEnum;
|
||||||
import co.yixiang.modules.logging.aop.log.Log;
|
import co.yixiang.modules.logging.aop.log.Log;
|
||||||
import co.yixiang.modules.mp.service.WeixinPayService;
|
import co.yixiang.modules.mp.service.WeixinPayService;
|
||||||
|
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||||
|
import co.yixiang.modules.order.vo.YxStoreOrderQueryVo;
|
||||||
import co.yixiang.modules.sales.domain.StoreAfterSales;
|
import co.yixiang.modules.sales.domain.StoreAfterSales;
|
||||||
import co.yixiang.modules.sales.param.SalesCheckDto;
|
import co.yixiang.modules.sales.param.SalesCheckDto;
|
||||||
import co.yixiang.modules.sales.param.YxStoreAfterSalesDto;
|
import co.yixiang.modules.sales.param.YxStoreAfterSalesDto;
|
||||||
import co.yixiang.modules.sales.service.StoreAfterSalesService;
|
import co.yixiang.modules.sales.service.StoreAfterSalesService;
|
||||||
import co.yixiang.modules.sales.param.YxStoreAfterSalesQueryCriteria;
|
import co.yixiang.modules.sales.param.YxStoreAfterSalesQueryCriteria;
|
||||||
|
import co.yixiang.modules.user.service.YxUserService;
|
||||||
|
import co.yixiang.modules.user.vo.YxUserQueryVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -38,7 +46,9 @@ public class StoreAfterSalesController {
|
|||||||
|
|
||||||
private final StoreAfterSalesService storeAfterSalesService;
|
private final StoreAfterSalesService storeAfterSalesService;
|
||||||
private final WeixinPayService weixinPayService;
|
private final WeixinPayService weixinPayService;
|
||||||
|
private final YxStoreOrderService storeOrderService;
|
||||||
private final IGenerator generator;
|
private final IGenerator generator;
|
||||||
|
private final YxUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核
|
* 审核
|
||||||
@ -62,7 +72,22 @@ public class StoreAfterSalesController {
|
|||||||
StoreAfterSales sales = storeAfterSalesService.makeMoney(salesId, orderCode);
|
StoreAfterSales sales = storeAfterSalesService.makeMoney(salesId, orderCode);
|
||||||
BigDecimal bigDecimal = new BigDecimal("100");
|
BigDecimal bigDecimal = new BigDecimal("100");
|
||||||
int payPrice = bigDecimal.multiply(sales.getRefundAmount()).intValue();
|
int payPrice = bigDecimal.multiply(sales.getRefundAmount()).intValue();
|
||||||
|
YxStoreOrderQueryVo orderInfo = storeOrderService.getOrderInfo(orderCode, null);
|
||||||
|
if (PayTypeEnum.WEIXIN.getValue().equals(orderInfo.getPayType())) {
|
||||||
|
if (ObjectUtil.isNull(orderInfo)) {
|
||||||
|
throw new YshopException("订单不存在");
|
||||||
|
}
|
||||||
|
YxUserQueryVo userQueryVo = userService.getYxUserById(orderInfo.getUid());
|
||||||
|
if (ObjectUtil.isNull(userQueryVo)) {
|
||||||
|
throw new YshopException("用户不存在");
|
||||||
|
}
|
||||||
|
if (OrderInfoEnum.REFUND_STATUS_2.getValue().equals(orderInfo.getRefundStatus())) {
|
||||||
|
throw new YshopException("订单已经退款了哦!");
|
||||||
|
}
|
||||||
weixinPayService.refundOrder(orderCode, payPrice);
|
weixinPayService.refundOrder(orderCode, payPrice);
|
||||||
|
} else {
|
||||||
|
storeOrderService.orderRefund(orderCode, sales.getRefundAmount(), 1);
|
||||||
|
}
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ public class WeixinPayService {
|
|||||||
if(orderInfo.getExtendOrderId()!=null){
|
if(orderInfo.getExtendOrderId()!=null){
|
||||||
orderId=orderInfo.getExtendOrderId();
|
orderId=orderInfo.getExtendOrderId();
|
||||||
}
|
}
|
||||||
WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WECHAT);
|
WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.toType(orderInfo.getPayType()));
|
||||||
WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest();
|
WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest();
|
||||||
BigDecimal bigDecimal = new BigDecimal("100");
|
BigDecimal bigDecimal = new BigDecimal("100");
|
||||||
int totalFee = bigDecimal.multiply(orderInfo.getPayPrice()).intValue();
|
int totalFee = bigDecimal.multiply(orderInfo.getPayPrice()).intValue();
|
||||||
|
Reference in New Issue
Block a user