Ver a proveniência

Merge branch 'for_member_only' of https://git.youlane.cn/server/formallProject into for_member_only

release_toaliyun_real
xiaohanzi há 5 anos
ascendente
cometimento
5e8aca23e5
8 ficheiros alterados com 50 adições e 60 eliminações
  1. +2
    -9
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxOrderController.java
  2. +5
    -4
      mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java
  3. +13
    -13
      mallinkBApi/src/main/java/com/iformall/controller/WxMemController.java
  4. +5
    -15
      mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java
  5. +4
    -1
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarCYFCallBackController.java
  6. +4
    -1
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarETCPCallBackController.java
  7. +4
    -1
      mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarTJDCallBackController.java
  8. +13
    -16
      mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java

+ 2
- 9
mallinkAdmin/src/main/java/com/iformall/controller/market/WxOrderController.java Ver ficheiro

@@ -170,7 +170,7 @@ public class WxOrderController extends BaseController {
} }


try { try {
WxCUser user = wxCUserService.getById(orderSaveDto.getUserId());
WxCUserBasicInfo user = wxCUserBasicInfoService.getById(orderSaveDto.getUserId());
if(null == user) { if(null == user) {
logger.error("wxcuser未找到:"+orderSaveDto.getUserId()); logger.error("wxcuser未找到:"+orderSaveDto.getUserId());
return new ResultData(ErrorCode.COUPON_IS_EMPTY); return new ResultData(ErrorCode.COUPON_IS_EMPTY);
@@ -186,15 +186,8 @@ public class WxOrderController extends BaseController {
if (!wxOrderService.checkCouponIsFree(coupon)) { if (!wxOrderService.checkCouponIsFree(coupon)) {
return new ResultData(ErrorCode.COUPON_IS_NOT_FREE); return new ResultData(ErrorCode.COUPON_IS_NOT_FREE);
} }
if(!user.isBasicInfo()) {
return new ResultData(ErrorCode.USER_IS_NOT_MEMBER);
}
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getById(orderSaveDto.getUserId());
if (null == basicInfo) {
return new ResultData(ErrorCode.COUPON_IS_EMPTY.getCode(),"会员用户未找到. "+orderSaveDto.getUserId());
}
// 免费券 // 免费券
order = wxOrderService.saveFreeOrderForCoupon(basicInfo, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null);
order = wxOrderService.saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null);
return new ResultData(order); return new ResultData(order);
} catch (MallinkException e) { } catch (MallinkException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());


+ 5
- 4
mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java Ver ficheiro

@@ -95,12 +95,13 @@ public class WxCUserController extends BaseController {
if (wxCUserFromB == null) { if (wxCUserFromB == null) {
//TODO phone可能为空 //TODO phone可能为空
String phone = wxCUser.getPhone(); String phone = wxCUser.getPhone();

WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.findInfoByPhone(bUser, phone);
//查询会员信息 //查询会员信息
List<WxCUserBasicInfo> byPhone = wxCUserBasicInfoService.findByPhone(bUser, phone);
//List<WxCUserBasicInfo> byPhone = wxCUserBasicInfoService.findByPhone(bUser, phone);
//存在会员信息 //存在会员信息
if (!byPhone.isEmpty()) {
if (wxCUserBasicInfo != null) {
//更新会员信息 //更新会员信息
WxCUserBasicInfo wxCUserBasicInfo = byPhone.get(0);
if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) {
wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); wxCUserBasicInfo.setName(wxCUserFromBDto.getName());
} }
@@ -133,7 +134,7 @@ public class WxCUserController extends BaseController {
} else { } else {
//新增来自B端的会员 //新增来自B端的会员
long cUserId = idWorker.nextId(); long cUserId = idWorker.nextId();
WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo();
wxCUserBasicInfo = new WxCUserBasicInfo();
wxCUserBasicInfo.setId(cUserId); wxCUserBasicInfo.setId(cUserId);
if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) {
wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); wxCUserBasicInfo.setName(wxCUserFromBDto.getName());


+ 13
- 13
mallinkBApi/src/main/java/com/iformall/controller/WxMemController.java Ver ficheiro

@@ -67,25 +67,25 @@ public class WxMemController extends BaseController {


WxMerchantBUser bUser = getUser(); WxMerchantBUser bUser = getUser();


WxCUser cUser = userService.getById(id);
if(cUser == null) {
return new ResultData(ErrorCode.USER_IS_EMPTY);
}
// WxCUser cUser = userService.getById(id);
// if(cUser == null) {
// return new ResultData(ErrorCode.USER_IS_EMPTY);
// }


WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUser.getId());
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(id);
if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) {
return new ResultData(ErrorCode.MEMBER_IS_LOCKED); return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
} }


WxCUserVo userVo = new WxCUserVo(); WxCUserVo userVo = new WxCUserVo();
org.springframework.beans.BeanUtils.copyProperties(cUser, userVo);
if (wxCUserBasicInfo != null) {
userVo.setName(wxCUserBasicInfo.getName());
userVo.setBirthdate(wxCUserBasicInfo.getBirthdate());
userVo.setSex(wxCUserBasicInfo.getSex());
userVo.setAddress(wxCUserBasicInfo.getAddress());
}
org.springframework.beans.BeanUtils.copyProperties(wxCUserBasicInfo, userVo);
// if (wxCUserBasicInfo != null) {
// userVo.setName(wxCUserBasicInfo.getName());
// userVo.setBirthdate(wxCUserBasicInfo.getBirthdate());
// userVo.setSex(wxCUserBasicInfo.getSex());
// userVo.setAddress(wxCUserBasicInfo.getAddress());
// }


userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL);
userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT); userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT);


+ 5
- 15
mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java Ver ficheiro

@@ -311,7 +311,7 @@ public class WxMicroPayController extends BaseController {
} }


// 获取C用户 // 获取C用户
WxCUser cUser = null;
WxCUserBasicInfo cUser = null;
if (StringUtils.isNotBlank(cUserIdStr)) { if (StringUtils.isNotBlank(cUserIdStr)) {
Long cUserId = 0L; Long cUserId = 0L;
try { try {
@@ -321,12 +321,9 @@ public class WxMicroPayController extends BaseController {
logger.error("cUserId参数不正确: " + paramMap.toString()); logger.error("cUserId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.SYS_CLASSCAST_ERROR); return new ResultData(ErrorCode.SYS_CLASSCAST_ERROR);
} }
cUser = wxCUserService.getById(cUserId);
cUser = wxCUserBasicInfoService.getById(cUserId);
} else { } else {
WxCUser userQ = new WxCUser();
userQ.updateTenantInfo(user);
userQ.setPhone(phone);
cUser = wxCUserService.getByObject(userQ);
cUser = wxCUserBasicInfoService.findInfoByPhone(user,phone);
} }
if (cUser == null) { if (cUser == null) {
logger.error("cUser不存在: " + cUserIdStr); logger.error("cUser不存在: " + cUserIdStr);
@@ -342,15 +339,8 @@ public class WxMicroPayController extends BaseController {


WxOrder order = null; WxOrder order = null;
try { try {
if (!cUser.isBasicInfo()) {
return new ResultData(ErrorCode.USER_IS_NOT_MEMBER);
}
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getById(cUser.getUserId());
if ( null == basicInfo) {
logger.error("会员用户未找到."+cUser.getUserId());
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"会员用户未找到."+cUser.getUserId());
}
order = wxOrderService.saveMicroPayOrderV2(user, basicInfo, payment);

order = wxOrderService.saveMicroPayOrderV2(user, cUser, payment);
} catch (MallinkException e) { } catch (MallinkException e) {
logger.error("saveMicopayOrder 1" + e.getMessage()); logger.error("saveMicopayOrder 1" + e.getMessage());
return new ResultData(e.getErrorCode(), e.getMessage()); return new ResultData(e.getErrorCode(), e.getMessage());


+ 4
- 1
mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarCYFCallBackController.java Ver ficheiro

@@ -55,6 +55,9 @@ public class WxCarCYFCallBackController extends BaseController {
@Autowired @Autowired
WxCarPayRecordService wxCarPayRecordService; WxCarPayRecordService wxCarPayRecordService;


@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;

/** /**
* @description 车易付 车辆入场通知 * @description 车易付 车辆入场通知
* @Params [paramMap] * @Params [paramMap]
@@ -114,7 +117,7 @@ public class WxCarCYFCallBackController extends BaseController {
for (WxCUserCar userCar : userCarList) { for (WxCUserCar userCar : userCarList) {
userCar.setParentTenantId(park.getParentTenantId()); userCar.setParentTenantId(park.getParentTenantId());
wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar);
WxCUser cUser = wxCUserService.getById(userCar.getCUserId());
WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId());
if(cUser != null){ if(cUser != null){
if(bFirst) { if(bFirst) {
phoneStrs = cUser.getPhone(); phoneStrs = cUser.getPhone();


+ 4
- 1
mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarETCPCallBackController.java Ver ficheiro

@@ -56,6 +56,9 @@ public class WxCarETCPCallBackController extends BaseController {
@Autowired @Autowired
WxCUserService wxCUserService; WxCUserService wxCUserService;


@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");


/** /**
@@ -359,7 +362,7 @@ public class WxCarETCPCallBackController extends BaseController {
for (WxCUserCar userCar : userCarList) { for (WxCUserCar userCar : userCarList) {
userCar.setParentTenantId(park.getParentTenantId()); userCar.setParentTenantId(park.getParentTenantId());
wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar);
WxCUser cUser = wxCUserService.getById(userCar.getCUserId());
WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId());
if(cUser != null){ if(cUser != null){
if(bFirst) { if(bFirst) {
phoneStrs = cUser.getPhone(); phoneStrs = cUser.getPhone();


+ 4
- 1
mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarTJDCallBackController.java Ver ficheiro

@@ -51,6 +51,9 @@ public class WxCarTJDCallBackController extends BaseController {
@Autowired @Autowired
WxCUserService wxCUserService; WxCUserService wxCUserService;


@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;

/** /**
* 注册车牌 * 注册车牌
* @param paramMap * @param paramMap
@@ -166,7 +169,7 @@ public class WxCarTJDCallBackController extends BaseController {
for (WxCUserCar userCar : userCarList) { for (WxCUserCar userCar : userCarList) {
userCar.setParentTenantId(park.getParentTenantId()); userCar.setParentTenantId(park.getParentTenantId());
wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar);
WxCUser cUser = wxCUserService.getById(userCar.getCUserId());
WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId());
if(cUser != null){ if(cUser != null){
if(bFirst) { if(bFirst) {
phoneStrs = cUser.getPhone(); phoneStrs = cUser.getPhone();


+ 13
- 16
mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java Ver ficheiro

@@ -41,7 +41,7 @@ public class PosServiceImpl implements PosService {


private final WxMallService mallService; private final WxMallService mallService;
private final PosMallConfigService posMallConfigService; private final PosMallConfigService posMallConfigService;
private final WxCUserService cUserService;
private final WxCUserBasicInfoService cUserBasicInfoService;
private final WxLevelConfigService levelConfigService; private final WxLevelConfigService levelConfigService;
private final WxCouponOrderService couponOrderService; private final WxCouponOrderService couponOrderService;
private final WxMerchantService merchantService; private final WxMerchantService merchantService;
@@ -286,7 +286,7 @@ public class PosServiceImpl implements PosService {
dataMap.put(WxPayConstant.ORDER_AMOUNT_LEFT, orderAmountLeftStr); dataMap.put(WxPayConstant.ORDER_AMOUNT_LEFT, orderAmountLeftStr);
} }


WxCUser user = null;
WxCUserBasicInfo user = null;
if (StringUtils.isNotBlank(cardIdStr)) { if (StringUtils.isNotBlank(cardIdStr)) {
Long cardId; Long cardId;
try { try {
@@ -299,7 +299,7 @@ public class PosServiceImpl implements PosService {
if (couponOrder == null) { if (couponOrder == null) {
throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND);
} }
user = cUserService.getById(couponOrder.getOwnerId());
user = cUserBasicInfoService.getById(couponOrder.getOwnerId());
} else { } else {
if (StringUtils.isBlank(memIdStr) && StringUtils.isBlank(memPhoneStr)) { if (StringUtils.isBlank(memIdStr) && StringUtils.isBlank(memPhoneStr)) {
errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE);
@@ -687,8 +687,8 @@ public class PosServiceImpl implements PosService {
return couponOrderCVo; return couponOrderCVo;
} }


private WxCUser getMemUser(TenantEntity tenantEntity, String memIdStr, String memPhoneStr) {
WxCUser user = null;
private WxCUserBasicInfo getMemUser(TenantEntity tenantEntity, String memIdStr, String memPhoneStr) {
WxCUserBasicInfo user = null;
if (StringUtils.isNotBlank(memIdStr)) { if (StringUtils.isNotBlank(memIdStr)) {
Long memId; Long memId;
try { try {
@@ -697,14 +697,10 @@ public class PosServiceImpl implements PosService {
logger.error(e.getMessage()); logger.error(e.getMessage());
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage());
} }

user = cUserService.getById(memId);
user = cUserBasicInfoService.getById(memId);
} }
if (StringUtils.isNotBlank(memPhoneStr)) { if (StringUtils.isNotBlank(memPhoneStr)) {
WxCUser q = new WxCUser();
q.updateTenantInfo(tenantEntity);
q.setPhone(memPhoneStr);
user = cUserService.getByObject(q);
user = cUserBasicInfoService.findInfoByPhone(tenantEntity,memPhoneStr);
} }
return user; return user;
} }
@@ -718,7 +714,8 @@ public class PosServiceImpl implements PosService {
* @param merchantId * @param merchantId
* @return * @return
*/ */
private JSONObject getMemLevelDiscount(PromotionCalc promotionCalc, Integer discountConfig, TenantEntity tenantEntity, WxCUser user, Long merchantId) {
private JSONObject getMemLevelDiscount(PromotionCalc promotionCalc, Integer discountConfig,
TenantEntity tenantEntity, WxCUserBasicInfo user, Long merchantId) {
JSONObject discountObj = new JSONObject(); JSONObject discountObj = new JSONObject();
Integer discount = 100; Integer discount = 100;
if (discountConfig.equals(EnumPosEnableType.Enable.getCode())) { if (discountConfig.equals(EnumPosEnableType.Enable.getCode())) {
@@ -727,7 +724,7 @@ public class PosServiceImpl implements PosService {
List<WxLevelConfig> levelList = levelConfigService.getByTenantId(tenantEntity.getTenantId()); List<WxLevelConfig> levelList = levelConfigService.getByTenantId(tenantEntity.getTenantId());
Long levelId = 0L; Long levelId = 0L;
for (WxLevelConfig levelConfig : levelList) { for (WxLevelConfig levelConfig : levelList) {
if (user.getScore() >= levelConfig.getPoints()) {
if (user.getPoins() >= levelConfig.getPoints()) {
if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode()))
levelId = levelConfig.getId(); levelId = levelConfig.getId();
level = levelConfig.getLevel(); level = levelConfig.getLevel();
@@ -912,7 +909,7 @@ public class PosServiceImpl implements PosService {
errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE);
} }
// 10. 获取会员信息 // 10. 获取会员信息
WxCUser user = getMemUser(merchant, memIdStr, memPhoneStr);
WxCUserBasicInfo user = getMemUser(merchant, memIdStr, memPhoneStr);
if (user == null) { if (user == null) {
logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); logger.error(ErrorCode.USER_NOT_MEMBER.getMessage());
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); throw new MallinkException(ErrorCode.USER_NOT_MEMBER);
@@ -1179,7 +1176,7 @@ public class PosServiceImpl implements PosService {
throw new MallinkException(ErrorCode.POS_COUPON_REFUND_ERROR.getCode(), errMesg); throw new MallinkException(ErrorCode.POS_COUPON_REFUND_ERROR.getCode(), errMesg);
} }
// 10. 获取会员信息 // 10. 获取会员信息
WxCUser user = getMemUser(merchant, memIdStr, memPhoneStr);
WxCUserBasicInfo user = getMemUser(merchant, memIdStr, memPhoneStr);
if (user == null) { if (user == null) {
logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); logger.error(ErrorCode.USER_NOT_MEMBER.getMessage());
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); throw new MallinkException(ErrorCode.USER_NOT_MEMBER);
@@ -1600,7 +1597,7 @@ public class PosServiceImpl implements PosService {
throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND);
} }
if (StringUtils.isNotBlank(memIdStr) || StringUtils.isNotBlank(memPhoneStr)) { if (StringUtils.isNotBlank(memIdStr) || StringUtils.isNotBlank(memPhoneStr)) {
WxCUser cuUser = getMemUser(merchant, memIdStr, memPhoneStr);
WxCUserBasicInfo cuUser = getMemUser(merchant, memIdStr, memPhoneStr);
if (cuUser == null) { if (cuUser == null) {
logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); logger.error(ErrorCode.USER_NOT_MEMBER.getMessage());
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); throw new MallinkException(ErrorCode.USER_NOT_MEMBER);


Carregando…
Cancelar
Guardar