发展基金相关实现-增加发展基金 #5
@@ -1,6 +1,7 @@
|
|||||||
package com.buy507.mall.mapper;
|
package com.buy507.mall.mapper;
|
||||||
|
|
||||||
import com.buy507.mall.model.UmsDevelopmentFund;
|
import com.buy507.mall.model.UmsDevelopmentFund;
|
||||||
|
import org.apache.ibatis.annotations.Insert;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -26,6 +27,20 @@ public interface UmsDevelopmentFundMapper {
|
|||||||
*/
|
*/
|
||||||
@Select("SELECT SUM(points_total) FROM ums_development_fund")
|
@Select("SELECT SUM(points_total) FROM ums_development_fund")
|
||||||
Integer getTotalPoints();
|
Integer getTotalPoints();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发展基金现金流水
|
||||||
|
* @param payAmount
|
||||||
|
*/
|
||||||
|
@Insert("INSERT INTO ums_development_fund (cash_total, updated_at) VALUES (#{payAmount}, NOW())")
|
||||||
|
void insertCash(BigDecimal payAmount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发展基金积分流水
|
||||||
|
* @param rewardPoints
|
||||||
|
*/
|
||||||
|
@Insert("INSERT INTO ums_development_fund (points_total, updated_at) VALUES (#{rewardPoints}, NOW())")
|
||||||
|
void insertPoints(BigDecimal rewardPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SmsHomeNewProductMapper homeNewProductMapper;
|
private SmsHomeNewProductMapper homeNewProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UmsDevelopmentFundMapper umsDevelopmentFundMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Value("${kuaidi100.url}")
|
@Value("${kuaidi100.url}")
|
||||||
@@ -1788,6 +1791,10 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
OmsOrder order = list.get(0);
|
OmsOrder order = list.get(0);
|
||||||
|
|
||||||
|
//获取订单实付金额
|
||||||
|
BigDecimal payAmount = order.getPayAmount();
|
||||||
|
//增加基金现金流水
|
||||||
|
umsDevelopmentFundMapper.insertCash(payAmount);
|
||||||
//获取积分专区状态
|
//获取积分专区状态
|
||||||
int pointsAreaStatus = orderMapper.selectPointsAreaStatus(outTradeNo);
|
int pointsAreaStatus = orderMapper.selectPointsAreaStatus(outTradeNo);
|
||||||
//如果是积分专区的商品则进行积分专区相对应的逻辑
|
//如果是积分专区的商品则进行积分专区相对应的逻辑
|
||||||
@@ -1807,7 +1814,8 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
|
|
||||||
// 更新用户积分
|
// 更新用户积分
|
||||||
memberMapper.updateByPrimaryKey(member);
|
memberMapper.updateByPrimaryKey(member);
|
||||||
|
//增加基金积分流水
|
||||||
|
umsDevelopmentFundMapper.insertPoints(rewardPoints);
|
||||||
}
|
}
|
||||||
//订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
|
//订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
|
||||||
if (order != null && order.getStatus() == 0) {
|
if (order != null && order.getStatus() == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user