Prechádzať zdrojové kódy

fixed 积分、余额所属店铺

fushengqian 1 rok pred
rodič
commit
58acead414

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/PointService.java

@@ -26,7 +26,7 @@ public interface PointService extends IService<MtPoint> {
     /**
     /**
      * 添加积分
      * 添加积分
      *
      *
-     * @param reqPointDto
+     * @param  reqPointDto
      * @throws BusinessCheckException
      * @throws BusinessCheckException
      */
      */
     void addPoint(MtPoint reqPointDto) throws BusinessCheckException;
     void addPoint(MtPoint reqPointDto) throws BusinessCheckException;

+ 4 - 2
fuint-application/src/main/java/com/fuint/common/service/impl/BalanceServiceImpl.java

@@ -123,7 +123,7 @@ public class BalanceServiceImpl extends ServiceImpl<MtBalanceMapper, MtBalance>
     /**
     /**
      * 添加余额记录
      * 添加余额记录
      *
      *
-     * @param mtBalance
+     * @param  mtBalance
      * @throws BusinessCheckException
      * @throws BusinessCheckException
      */
      */
     @Override
     @Override
@@ -142,7 +142,9 @@ public class BalanceServiceImpl extends ServiceImpl<MtBalanceMapper, MtBalance>
         if (newAmount.compareTo(new BigDecimal("0")) < 0) {
         if (newAmount.compareTo(new BigDecimal("0")) < 0) {
            return false;
            return false;
         }
         }
-
+        if (mtUser.getStoreId() != null) {
+            mtBalance.setStoreId(mtUser.getStoreId());
+        }
         mtUser.setBalance(newAmount);
         mtUser.setBalance(newAmount);
         mtUserMapper.updateById(mtUser);
         mtUserMapper.updateById(mtUser);
 
 

+ 9 - 7
fuint-application/src/main/java/com/fuint/common/service/impl/PointServiceImpl.java

@@ -114,7 +114,7 @@ public class PointServiceImpl extends ServiceImpl<MtPointMapper, MtPoint> implem
     /**
     /**
      * 添加积分记录
      * 添加积分记录
      *
      *
-     * @param mtPoint
+     * @param  mtPoint
      * @throws BusinessCheckException
      * @throws BusinessCheckException
      */
      */
     @Override
     @Override
@@ -136,14 +136,16 @@ public class PointServiceImpl extends ServiceImpl<MtPointMapper, MtPoint> implem
             mtPoint.setOrderSn(mtPoint.getOrderSn());
             mtPoint.setOrderSn(mtPoint.getOrderSn());
         }
         }
 
 
-        MtUser user = mtUserMapper.selectById(mtPoint.getUserId());
-        Integer newAmount = user.getPoint() + mtPoint.getAmount();
+        MtUser mtUser = mtUserMapper.selectById(mtPoint.getUserId());
+        Integer newAmount = mtUser.getPoint() + mtPoint.getAmount();
         if (newAmount < 0) {
         if (newAmount < 0) {
             return;
             return;
         }
         }
-        user.setPoint(newAmount);
-
-        mtUserMapper.updateById(user);
+        mtUser.setPoint(newAmount);
+        if (mtUser.getStoreId() != null) {
+            mtPoint.setStoreId(mtUser.getStoreId());
+        }
+        mtUserMapper.updateById(mtUser);
         mtPointMapper.insert(mtPoint);
         mtPointMapper.insert(mtPoint);
 
 
         // 发送小程序订阅消息
         // 发送小程序订阅消息
@@ -154,7 +156,7 @@ public class PointServiceImpl extends ServiceImpl<MtPointMapper, MtPoint> implem
         params.put("amount", mtPoint.getAmount());
         params.put("amount", mtPoint.getAmount());
         params.put("time", dateTime);
         params.put("time", dateTime);
         params.put("remark", "您的积分发生了变动,请留意~");
         params.put("remark", "您的积分发生了变动,请留意~");
-        weixinService.sendSubscribeMessage(mtPoint.getUserId(), user.getOpenId(), WxMessageEnum.POINT_CHANGE.getKey(), "pages/user/index", params, sendTime);
+        weixinService.sendSubscribeMessage(mtPoint.getUserId(), mtUser.getOpenId(), WxMessageEnum.POINT_CHANGE.getKey(), "pages/user/index", params, sendTime);
 
 
         return;
         return;
     }
     }

+ 1 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendPointController.java

@@ -63,7 +63,7 @@ public class BackendPointController extends BaseController {
     /**
     /**
      * 积分明细列表查询
      * 积分明细列表查询
      *
      *
-     * @param  request  HttpServletRequest对象
+     * @param request HttpServletRequest对象
      * @return 积分明细列表
      * @return 积分明细列表
      */
      */
     @ApiOperation(value = "积分明细列表查询")
     @ApiOperation(value = "积分明细列表查询")