修改会员添加报错

This commit is contained in:
韩鹏辉
2024-05-31 15:16:24 +08:00
parent 689db4cf1b
commit 70b29bd3ff
8 changed files with 70 additions and 20 deletions

View File

@@ -26,4 +26,7 @@ public interface TbShopInfoMapper {
List<TbShopInfo> selectAll();
List<TbShopInfo> selectAllByCreateTime();
}

View File

@@ -25,6 +25,8 @@ public interface TbShopUserMapper {
List<TbShopUser> selectByShopId(@Param("shopId") String shopId,@Param("phone") String phone);
List<TbShopUser> selectByShopIdAndPhone(@Param("shopId") String shopId,@Param("phone") String phone);
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
TbShopUser selectByShopIdAndDdynamicCode(@Param("shopId") String shopId,@Param("memberAccount") String memberAccount);

View File

@@ -619,7 +619,7 @@ public class CloudPrinterService {
memberData=new ArrayList<>();
ShopUserDutyPay shopUserDutyPay=shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(),"deposit");
if(ObjectUtil.isNotEmpty(shopUserDutyPay)){
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"会员卡支付"));
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"会员卡消费"));
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"会员卡支付"));
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ONE.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"储值卡支付"));

View File

@@ -96,12 +96,18 @@ public class MemberService {
String shopId = String.valueOf(map.get("shopId"));
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectByShopId(shopId, phone);
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectByShopIdAndPhone(shopId, phone);
if (ObjectUtil.isNotEmpty(tbShopUsers) && tbShopUsers.get(0).getIsVip().toString().equals("1")) {
if (ObjectUtil.isNotEmpty(tbShopUsers)&&tbShopUsers.stream().filter(it->"1".equals(it.getIsVip().toString())).count()>0) {
return Result.fail(CodeEnum.MEMBERHAVED);
}
// for (TbShopUser tbShopUser : tbShopUsers) {
// if("1".equals(tbShopUser.getIsVip().toString())){
// return Result.fail(CodeEnum.MEMBERHAVED);
// }
// }
if (ObjectUtil.isNotNull(tbShopUsers) && ObjectUtil.isNotEmpty(tbShopUsers)) {
TbShopUser tbShopUser = tbShopUsers.get(0);
String code = DateUtils.getSsdfTimes();
@@ -152,6 +158,9 @@ public class MemberService {
return Result.fail(CodeEnum.PARAM);
}
String memberId = String.valueOf(map.get("memberId"));
String shopId = String.valueOf(map.get("shopId"));
@@ -168,7 +177,24 @@ public class MemberService {
String authCode = map.get("authCode").toString();
String qpay = null;
String payTypeCode = authCode.substring(0, 1);// 判断收款码
String payTypeCode = authCode.substring(0, 2);// 判断收款码
if(Integer.valueOf(payTypeCode)>=25&&Integer.valueOf(payTypeCode)<=30){
qpay = "scanCode";
}else if(Integer.valueOf(payTypeCode)>=10&&Integer.valueOf(payTypeCode)<=19){
qpay = "scanCode";
}else if("62".equals(payTypeCode)){
return Result.fail(CodeEnum.ERRORQR);
}else if("01".equals(payTypeCode)){
return Result.fail(CodeEnum.ERRORQR);
}else {
return Result.fail(CodeEnum.ERRORQR);
}
switch (payTypeCode) {
case "1":
@@ -337,8 +363,6 @@ public class MemberService {
}
}
}
}

View File

@@ -147,19 +147,23 @@ public class PayService {
String payName = null;
String qpay = null;
String payTypeCode = authCode.substring(0, 1);// 判断收款码
String payTypeCode = authCode.substring(0, 2);// 判断收款码
switch (payTypeCode) {
case "1":
payType = "wechatPay";
payName = "微信支付";
qpay = "scanCode";
break;
case "2":
payType = "aliPay";
payName = "支付宝支付";
qpay = "scanCode";
break;
if(Integer.valueOf(payTypeCode)>=25&&Integer.valueOf(payTypeCode)<=30){
payType = "aliPay";
payName = "支付宝支付";
qpay = "scanCode";
}else if(Integer.valueOf(payTypeCode)>=10&&Integer.valueOf(payTypeCode)<=19){
payType = "wechatPay";
payName = "微信支付";
qpay = "scanCode";
}else if("62".equals(payTypeCode)){
return Result.fail(CodeEnum.ERRORQR);
}else if("01".equals(payTypeCode)){
return Result.fail(CodeEnum.ERRORQR);
}else {
return Result.fail(CodeEnum.ERRORQR);
}
int count = tbShopPayTypeMapper.countSelectByShopIdAndPayType(orderInfo.getShopId(), qpay);
@@ -425,6 +429,10 @@ public class PayService {
}
TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId));
if (ObjectUtil.isEmpty(orderInfo)) {
return Result.fail(CodeEnum.ORDERNOEXIST);
@@ -450,7 +458,13 @@ public class PayService {
if(ObjectUtil.isNotEmpty(memberAccount)){
if(!memberAccount.substring(0,2).equals("46")){
return Result.fail(CodeEnum.ERRORQR);
}
user=tbShopUserMapper.selectByShopIdAndDdynamicCode(orderInfo.getShopId(),memberAccount);
}

View File

@@ -66,7 +66,7 @@ public enum CodeEnum {
UNAUTHORIZED("100021",false,"该账号无权限登录,请联系管理员","fail"),
ERRORQR("100026",false,"错误的码信息","fail"),

View File

@@ -98,7 +98,7 @@
FROM
tb_shop_user_duty_pay
WHERE
duty_id = #{dutyId}
duty_id = #{dutyId} and type!='deposit'
</select>
<select id="selectCetoryBydutyId" resultType="java.util.Map">

View File

@@ -383,4 +383,11 @@
<select id="selectByShopIdAndDdynamicCode" resultMap="BaseResultMap">
select * from tb_shop_user where shop_id=#{shopId} and dynamic_code=#{memberAccount}
</select>
<select id="selectByShopIdAndPhone" resultMap="BaseResultMap">
select * from tb_shop_user where shop_id=#{shopId} and telephone = #{phone}
order by id desc
</select>
</mapper>