多角色保存修复、售后退款余额、积分处理、微信退款类型处理、升级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>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.6</version>
|
||||
<version>2.7.10</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@ -38,7 +38,7 @@
|
||||
<jedis.version>3.3.0</jedis.version>
|
||||
<swagger.version>3.0.0</swagger.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>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<commons-pool2.version>2.5.0</commons-pool2.version>
|
||||
@ -154,8 +154,8 @@
|
||||
</dependency>
|
||||
<!--Mysql依赖包-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- druid数据源驱动 -->
|
||||
|
@ -276,14 +276,16 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
|
||||
user.setSex(resources.getSex());
|
||||
boolean result = this.saveOrUpdate(user);
|
||||
usersRolesService.lambdaUpdate().eq(UsersRoles ::getUserId,resources.getId()).remove();
|
||||
UsersRoles usersRoles = new UsersRoles();
|
||||
usersRoles.setUserId(resources.getId());
|
||||
List<UsersRoles> usersRolesList = new ArrayList<>();
|
||||
Set<Role> set = resources.getRoles();
|
||||
for (Role roleIds : set) {
|
||||
UsersRoles usersRoles = new UsersRoles();
|
||||
usersRoles.setUserId(resources.getId());
|
||||
usersRoles.setRoleId(roleIds.getId());
|
||||
usersRolesList.add(usersRoles);
|
||||
}
|
||||
if (result) {
|
||||
usersRolesService.save(usersRoles);
|
||||
usersRolesService.saveBatch(usersRolesList);
|
||||
}
|
||||
|
||||
// 如果用户的角色改变了,需要手动清理下缓存
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<properties>
|
||||
<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>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -1,13 +1,21 @@
|
||||
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.enums.OrderInfoEnum;
|
||||
import co.yixiang.enums.PayTypeEnum;
|
||||
import co.yixiang.modules.logging.aop.log.Log;
|
||||
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.param.SalesCheckDto;
|
||||
import co.yixiang.modules.sales.param.YxStoreAfterSalesDto;
|
||||
import co.yixiang.modules.sales.service.StoreAfterSalesService;
|
||||
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.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -38,7 +46,9 @@ public class StoreAfterSalesController {
|
||||
|
||||
private final StoreAfterSalesService storeAfterSalesService;
|
||||
private final WeixinPayService weixinPayService;
|
||||
private final YxStoreOrderService storeOrderService;
|
||||
private final IGenerator generator;
|
||||
private final YxUserService userService;
|
||||
|
||||
/**
|
||||
* 审核
|
||||
@ -62,7 +72,22 @@ public class StoreAfterSalesController {
|
||||
StoreAfterSales sales = storeAfterSalesService.makeMoney(salesId, orderCode);
|
||||
BigDecimal bigDecimal = new BigDecimal("100");
|
||||
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);
|
||||
} else {
|
||||
storeOrderService.orderRefund(orderCode, sales.getRefundAmount(), 1);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ public class WeixinPayService {
|
||||
if(orderInfo.getExtendOrderId()!=null){
|
||||
orderId=orderInfo.getExtendOrderId();
|
||||
}
|
||||
WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WECHAT);
|
||||
WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.toType(orderInfo.getPayType()));
|
||||
WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest();
|
||||
BigDecimal bigDecimal = new BigDecimal("100");
|
||||
int totalFee = bigDecimal.multiply(orderInfo.getPayPrice()).intValue();
|
||||
|
Reference in New Issue
Block a user