Browse Source

1.修复用户余额不足的几种情况没有生成商场以及商家赠送积分记录的bug;
2.扣积分支付时增加商家没有商场时的判断
3.商户登录时增加审核状态的判断

LIDEXI 4 years ago
parent
commit
7a94b4ad65

+ 4 - 0
doc/xmind/更新日志.txt

@@ -0,0 +1,4 @@
+日期                 修改说明
+20210823             第一版本
+20210824        修复用户余额不足的几种情况没有生成商场以及商家赠送积分记录的bug;增加商家没有商场时的判断
+

+ 0 - 0
doc/xmind/联兑通支付扣积分流程.xmind → doc/xmind/联兑通支付扣积分流程20210823.xmind


BIN
doc/xmind/联兑通支付扣积分流程20210824.xmind


+ 15 - 0
src/main/java/org/springblade/modules/ldt/appaccount/controller/AppAccountController.java

@@ -33,6 +33,8 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DigestUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.ldt.shop.entity.Shop;
+import org.springblade.modules.ldt.shop.service.IShopService;
 import org.springblade.modules.system.entity.User;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -43,6 +45,8 @@ import org.springblade.modules.ldt.appaccount.vo.AppAccountVO;
 import org.springblade.modules.ldt.appaccount.service.IAppAccountService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  *  控制器
  *
@@ -57,6 +61,7 @@ public class AppAccountController extends BladeController {
 
 	private final IAppAccountService appAccountService;
 	private final RedisTemplate<String,String> redisTemplate;
+	private final IShopService shopService;
 	private static final String REDIS_KEY_CODE = "sms:code:";
 
 	/**
@@ -148,6 +153,16 @@ public class AppAccountController extends BladeController {
 			.eq(AppAccount::getPhone, appAccount.getPhone()).eq(AppAccount::getType, appAccount.getType())
 			.eq(AppAccount::getPassword,DigestUtil.hex(appAccount.getPassword())));
 		if(isExist != null){
+			if(SystemConstant.MALLORSHOP.SHOP.getValue()==appAccount.getType()){
+				//如果是商家登录,先判断有没有通过的商户信息,若没有则返回400
+				List<Shop> shopList = shopService.getBaseMapper().selectList(new QueryWrapper<>(new Shop()).lambda()
+					.eq(Shop::getAuditStatus, SystemConstant.AuditStatus.PASS.getValue())
+					.eq(Shop::getPersonTel, appAccount.getPhone()));
+				if(shopList.size() == 0){
+					return R.data(400,"该商户还未审核通过");
+				}
+			}
+			//根据手机号获取商家列表
 			return R.status(true);
 		}
 		return R.status(false);

+ 4 - 2
src/main/java/org/springblade/modules/ldt/loginuser/controller/AppUserController.java

@@ -68,7 +68,8 @@ public class AppUserController {
 			.eq(PointDetail::getBillRecordStatus,SystemConstant.BillRecordPayStatus.PAYED.getValue())
 			.isNotNull(PointDetail::getChannelId)
 			.in(PointDetail::getType,
-				Arrays.asList(SystemConstant.PointDetailType.CHANNEL.getValue(),SystemConstant.PointDetailType.MALL_SEND.getValue(),SystemConstant.PointDetailType.USER_PAY.getValue())));
+				Arrays.asList(SystemConstant.PointDetailType.CHANNEL.getValue(),SystemConstant.PointDetailType.MALL_SEND.getValue(),SystemConstant.PointDetailType.USER_PAY.getValue()))
+		.orderByDesc(PointDetail::getUpdateTime));
 		return R.data(PointDetailWrapper.build(billRecordService).pageVO(pages));
 	}
 
@@ -90,7 +91,8 @@ public class AppUserController {
 		IPage<PointDetail> pages = pointDetailService.page(Condition.getPage(query), Condition.getQueryWrapper(pointDetail).lambda()
 			.like(selectMonth != null,PointDetail::getCreateTime,selectMonth)
 			.eq(PointDetail::getBillRecordStatus,SystemConstant.BillRecordPayStatus.PAYED.getValue())
-			.in(PointDetail::getType,Arrays.asList(SystemConstant.PointDetailType.USER_PAY.getValue(),SystemConstant.PointDetailType.SHOP_SEND.getValue())));
+			.in(PointDetail::getType,Arrays.asList(SystemConstant.PointDetailType.USER_PAY.getValue(),SystemConstant.PointDetailType.SHOP_SEND.getValue()))
+			.orderByDesc(PointDetail::getUpdateTime));
 		return R.data(PointDetailWrapper.build(billRecordService).pageVO(pages));
 	}
 }

+ 12 - 0
src/main/java/org/springblade/modules/ldt/loginuser/service/impl/LoginUserServiceImpl.java

@@ -712,6 +712,18 @@ public class LoginUserServiceImpl extends BaseServiceImpl<LoginUserMapper, Login
 			}
 
 
+		}else{//该商户没有商场信息,没有渠道--相当于大B渠道为0
+			if(loginUser.getPointValue().compareTo(BigDecimal.ZERO) == 0){//大B渠道积分价值为零,用户余额为0
+				return PointPayTypeEnum.CHANNEL_ZERO_RARE_ZERO;
+			}else{//大B渠道积分价值为零,余额不为0
+				boolean userAccoutEnough = yingfu.subtract(loginUser.getPointValue().multiply(BigDecimal.ONE.add(gxServerRate))).compareTo(BigDecimal.ZERO) > 0 ? false : true;
+				if(userAccoutEnough){//大B渠道积分价值为零,余额够扣
+					return PointPayTypeEnum.CHANNEL_ZERO_RARE_ENOUGH;
+				}else{//大B渠道积分价值为零,余额不够扣
+					return PointPayTypeEnum.CHANNEL_ZERO_RARE_NOENOUGH;
+				}
+			}
+
 		}
 
 		return null;

+ 7 - 5
src/main/java/org/springblade/modules/payment/listener/UserPayListener.java

@@ -112,12 +112,14 @@ public class UserPayListener {
 							.eq(Member::getUserId,billRecord.getUserId())
 							.eq(Member::getType,SystemConstant.MALLORSHOP.SHOP.getValue())
 							.eq(Member::getShopId,billRecord.getShopId()));
-						Member mallMember =  memberService.getBaseMapper().selectOne(new QueryWrapper<>(new Member()).lambda()
-							.eq(Member::getType,SystemConstant.MALLORSHOP.MALL.getValue())
-							.eq(Member::getUserId,billRecord.getUserId())
-							.eq(Member::getMallId,billRecord.getMallId()));
+						Member mallMember =  null;
+
 						ChannelUserPoint channelUserPoint = null;
-						if (mallPointDetails.size() > 0) {
+						if (mallPointDetails.size() > 0 && shop.getMallId() != null) {
+							mallMember = memberService.getBaseMapper().selectOne(new QueryWrapper<>(new Member()).lambda()
+								.eq(Member::getType,SystemConstant.MALLORSHOP.MALL.getValue())
+								.eq(Member::getUserId,billRecord.getUserId())
+								.eq(Member::getMallId,billRecord.getMallId()));
 							PointDetail mallPointDetail = mallPointDetails.get(0);
 							/**
 							 * 增加商场的积分成本