|
|
|
@@ -70,19 +70,13 @@ public class PosServiceImpl implements PosService { |
|
|
|
String password = params.get(WxPayConstant.PASSWORD); // buUser's password |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(phone)) { |
|
|
|
String errMessage = "request params[phone] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.PHONE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(password)) { |
|
|
|
String errMessage = "request params[password] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.PASSWORD); |
|
|
|
} |
|
|
|
WxMerchantBUser user = new WxMerchantBUser(); |
|
|
|
user.setTenantId(tenantId); |
|
|
|
@@ -93,26 +87,12 @@ public class PosServiceImpl implements PosService { |
|
|
|
try { |
|
|
|
user1 = merchantBUserService.getBUserByAppId(user); |
|
|
|
} catch (Exception e) { |
|
|
|
String errMessage = "B端用户不存在或者已被禁用, phone: " + phone + ", " +e.getMessage(); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), errMessage); |
|
|
|
String errMessage = ErrorCode.MERCHANT_BUSER_NOT_VALID.getMessage() + "phone: " + phone + ", " +e.getMessage(); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_BUSER_NOT_VALID.getCode(), errMessage); |
|
|
|
} |
|
|
|
if (user1 != null) { |
|
|
|
// check merchant 状态 |
|
|
|
WxMerchant merchant = null; |
|
|
|
try { |
|
|
|
merchant = merchantService.getById(user1.getMerchantId()); |
|
|
|
} catch (Exception e) { |
|
|
|
String errMessage = ErrorCode.DB_FAIL.getMessage() + ": " + user1.getMerchantId() + e.getMessage(); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), errMessage); |
|
|
|
} |
|
|
|
if (merchant == null) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + user1.getMerchantId()); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
if (merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + user1.getMerchantId()); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
WxMerchant merchant = checkAndGetMerchant(user1.getMerchantId()); |
|
|
|
// check password |
|
|
|
if (user1.getUserPwd().equalsIgnoreCase(password)) { |
|
|
|
retMap.put(WxPayConstant.TENANT_ID, user1.getTenantId()); |
|
|
|
@@ -141,9 +121,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String tenantId = params.get(WxPayConstant.TENANT_ID); // 租户ID |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
@@ -168,9 +146,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String tenantId = params.get(WxPayConstant.TENANT_ID); // 租户ID |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
WxMall mall = mallService.getByTenantId(tenantId); |
|
|
|
if (mall == null) { |
|
|
|
@@ -199,9 +175,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String posAmountStr = params.get(WxPayConstant.POS_AMOUNT); // POS订单金额(单位:分) |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
|
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
@@ -211,19 +185,13 @@ public class PosServiceImpl implements PosService { |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(memIdStr) && StringUtils.isBlank(memPhoneStr)) { |
|
|
|
@@ -354,9 +322,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String posAmountStr = params.get(WxPayConstant.POS_AMOUNT); // POS订单总额(单位:分) |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
@@ -368,22 +334,17 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_MEM_COUPON_DISABLE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(couponOrderIdStr)) { |
|
|
|
String errMessage = "request params[coupon_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.COUPON_ORDER_ID); |
|
|
|
} |
|
|
|
if (actionType.equals(EnumVerifyActionType.CHECK)) { |
|
|
|
if (StringUtils.isBlank(verifyType)) { |
|
|
|
String errMessage = "request params[verify_type] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.VERIFY_TYPE); |
|
|
|
} |
|
|
|
if (!(verifyType.equalsIgnoreCase(WxPayConstant.VERIFY_TYPE_INDEPENT) || verifyType.equalsIgnoreCase(WxPayConstant.VERIFY_TYPE_PAY))) { |
|
|
|
String errMessage = "request params[verify_type] only support independent or pay."; |
|
|
|
@@ -398,15 +359,13 @@ public class PosServiceImpl implements PosService { |
|
|
|
actionType.equals(EnumVerifyActionType.VERIFY_INDEPENT) || |
|
|
|
actionType.equals(EnumVerifyActionType.VERIFY_PAY)) { |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
} |
|
|
|
if (actionType.equals(EnumVerifyActionType.PRE_VERIFY) || |
|
|
|
actionType.equals(EnumVerifyActionType.VERIFY_PAY)) { |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -429,25 +388,9 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); |
|
|
|
} |
|
|
|
// 2. check merchant |
|
|
|
WxMerchant merchant = merchantService.getById(merchantId); |
|
|
|
if (merchant == null) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
if (merchant.getIsDel().equals(EnumDelStatus.DEL.getCode()) || merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
WxMerchant merchant = checkAndGetMerchant(merchantId); |
|
|
|
// 3. check buUser |
|
|
|
WxMerchantBUser buUser = merchantBUserService.getById(buUserId); |
|
|
|
if (buUser == null) { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (!buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
WxMerchantBUser buUser = checkAndGetMerchantUser(buUserId, merchantId); |
|
|
|
|
|
|
|
JSONArray coRetArr = new JSONArray(); |
|
|
|
if (couponOrderIdStr != null) { |
|
|
|
@@ -481,9 +424,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String verifyType = WxPayConstant.VERIFY_TYPE_PAY; // 此接口只有支付使用 |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
@@ -495,26 +436,20 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_MEM_COUPON_DISABLE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(selCoListStr)) { |
|
|
|
String errMessage = "request params[sel_co_list] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.SELECTED_COUPON_ORDER_LIST); |
|
|
|
} |
|
|
|
if (actionType.equals(EnumVerifyActionType.PRE_VERIFY) || actionType.equals(EnumVerifyActionType.VERIFY_INDEPENT)) { |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -534,25 +469,9 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); |
|
|
|
} |
|
|
|
// 2. check merchant |
|
|
|
WxMerchant merchant = merchantService.getById(merchantId); |
|
|
|
if (merchant == null) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
if (merchant.getIsDel().equals(EnumDelStatus.DEL.getCode()) || merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
WxMerchant merchant = checkAndGetMerchant(merchantId); |
|
|
|
// 3. check buUser |
|
|
|
WxMerchantBUser buUser = merchantBUserService.getById(buUserId); |
|
|
|
if (buUser == null) { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (!buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
WxMerchantBUser buUser = checkAndGetMerchantUser(buUserId, merchantId); |
|
|
|
|
|
|
|
JSONArray selCoArr = JSONObject.parseArray(selCoListStr); |
|
|
|
if (selCoArr.size() <= 0) { |
|
|
|
@@ -657,11 +576,10 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_USED); |
|
|
|
} |
|
|
|
|
|
|
|
Long couponOrderId = couponOrderCVo.getId(); |
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
// 5. 检查有效期 |
|
|
|
if (couponOrderCVo.getValidStartDate() != null && couponOrderCVo.getValidEndDate() != null) { |
|
|
|
Date now = new Date(); |
|
|
|
if (couponOrderCVo.getValidStartDate().getTime() > now.getTime()) { |
|
|
|
logger.error("此券有效期未开始:" + couponOrderIdStr); |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); |
|
|
|
@@ -671,6 +589,13 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); |
|
|
|
} |
|
|
|
} |
|
|
|
// 5.1 券已过期 |
|
|
|
if (couponOrderCVo.getExpiredTime().before(now)) { |
|
|
|
logger.error("此券已过期:" + couponOrderIdStr); |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); |
|
|
|
} |
|
|
|
|
|
|
|
Long couponOrderId = couponOrderCVo.getId(); |
|
|
|
|
|
|
|
// 6. 检查适用门店 |
|
|
|
WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); |
|
|
|
@@ -854,30 +779,20 @@ public class PosServiceImpl implements PosService { |
|
|
|
String forceStr = params.get(WxPayConstant.FORCE); // 是否强制 |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(couponOrderIdStr)) { |
|
|
|
String errMessage = "request params[coupon_order_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.COUPON_ORDER_ID); |
|
|
|
} |
|
|
|
if (actionType.equals(EnumVerifyActionType.PRE_VERIFY) || actionType.equals(EnumVerifyActionType.VERIFY_INDEPENT)) { |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -902,6 +817,10 @@ public class PosServiceImpl implements PosService { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserId); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
// 4. check couponOrderId |
|
|
|
WxCouponOrderCVo couponOrderCVo = couponOrderService.detailCUserVo(couponOrderIdStr); |
|
|
|
if (couponOrderCVo == null) { |
|
|
|
@@ -1078,7 +997,8 @@ public class PosServiceImpl implements PosService { |
|
|
|
* @param buUserId |
|
|
|
* @param posOrderId |
|
|
|
*/ |
|
|
|
private void doVerify(EnumVerifyActionType actionType, WxCouponOrderCVo couponOrderCVo, WxCoupon coupon, Long merchantId, Long buUserId, Long posOrderId, Map<String, String> retMap) { |
|
|
|
private void doVerify(EnumVerifyActionType actionType, WxCouponOrderCVo couponOrderCVo, WxCoupon coupon, |
|
|
|
Long merchantId, Long buUserId, Long posOrderId, Map<String, String> retMap) { |
|
|
|
int num = 0; |
|
|
|
// 1. insert posOrderId |
|
|
|
PosCouponOrderVerify posCouponOrderVerify = new PosCouponOrderVerify(); |
|
|
|
@@ -1135,7 +1055,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
try { |
|
|
|
WxOrder order = orderMapper.selectByPrimaryKey(couponOrderCVo.getOrderId()); |
|
|
|
int point = scoreRulesService.addScore2(EnumScoreType.CONSUMPTION, order, couponOrderCVo.getBusinessId()); |
|
|
|
retMap.put("point", String.valueOf(point)); |
|
|
|
retMap.put(WxPayConstant.POINT, String.valueOf(point)); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("核销成长值异常:" + e.getMessage()); |
|
|
|
} |
|
|
|
@@ -1157,7 +1077,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
creditHistory.setMerchantId(merchantId); |
|
|
|
creditHistory = creditHistoryService.saveOrUpdate(creditHistory); |
|
|
|
if (creditHistory.getCreditNum() != null) { |
|
|
|
retMap.put("credit", String.valueOf(creditHistory.getCreditNum())); |
|
|
|
retMap.put(WxPayConstant.CREDIT, String.valueOf(creditHistory.getCreditNum())); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("核销积分值异常:" + e.getMessage()); |
|
|
|
@@ -1275,25 +1195,19 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_MEM_COUPON_DISABLE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cardIdStr)) { |
|
|
|
String errMessage = "request params[card_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.CARD_ID); |
|
|
|
} |
|
|
|
|
|
|
|
Long merchantId, buUserId, posOrderId, cardId; |
|
|
|
@@ -1393,9 +1307,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String cardSpendIdStr = params.get(WxPayConstant.CARD_SPEND_ID); // 消费卡花费ID |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
@@ -1407,29 +1319,22 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_MEM_COUPON_DISABLE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cardIdStr)) { |
|
|
|
String errMessage = "request params[card_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.CARD_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cardSpendIdStr)) { |
|
|
|
String errMessage = "request params[card_spend_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.CARD_SPEND_ID); |
|
|
|
} |
|
|
|
|
|
|
|
Long merchantId, buUserId, posOrderId, cardId, cardSpendId; |
|
|
|
@@ -1458,25 +1363,9 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_MERANT_IS_NULL.getCode(), errMessage); |
|
|
|
} |
|
|
|
// 2. check merchant |
|
|
|
WxMerchant merchant = merchantService.getById(merchantId); |
|
|
|
if (merchant == null) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
if (merchant.getIsDel().equals(EnumDelStatus.DEL.getCode()) || merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + merchantIdStr); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
WxMerchant merchant = checkAndGetMerchant(merchantId); |
|
|
|
// 3. check buUser |
|
|
|
WxMerchantBUser buUser = merchantBUserService.getById(buUserId); |
|
|
|
if (buUser == null) { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (!buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
WxMerchantBUser buUser = checkAndGetMerchantUser(buUserId, merchantId); |
|
|
|
|
|
|
|
WxCouponOrder couponOrder = couponOrderService.getById(cardId); |
|
|
|
if(couponOrder == null) { |
|
|
|
@@ -1533,9 +1422,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
String cardSpendIdStr = params.get(WxPayConstant.CARD_SPEND_ID); // 消费卡花费ID |
|
|
|
|
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
String errMessage = "request params[tenant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
@@ -1547,29 +1434,22 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_MEM_COUPON_DISABLE); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
String errMessage = "request params[merchant_id] error."; |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
String errMessage = "request params[bu_user_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.BUSER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
String errMessage = "request params[pos_order_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
String errMessage = "request params[pos_amount] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.POS_AMOUNT); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cardIdStr)) { |
|
|
|
String errMessage = "request params[card_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.CARD_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cardSpendIdStr)) { |
|
|
|
String errMessage = "request params[card_spend_id] error."; |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
errParam(WxPayConstant.CARD_SPEND_ID); |
|
|
|
} |
|
|
|
|
|
|
|
Long merchantId, buUserId, posOrderId, cardId, cardSpendId; |
|
|
|
@@ -1608,15 +1488,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
// 3. check buUser |
|
|
|
WxMerchantBUser buUser = merchantBUserService.getById(buUserId); |
|
|
|
if (buUser == null) { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (!buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserIdStr); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
WxMerchantBUser buUser = checkAndGetMerchantUser(buUserId, merchantId); |
|
|
|
|
|
|
|
WxCouponOrder couponOrder = couponOrderService.getById(cardId); |
|
|
|
if(couponOrder == null) { |
|
|
|
@@ -1652,4 +1524,197 @@ public class PosServiceImpl implements PosService { |
|
|
|
|
|
|
|
return retMap; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map<String, String> posOrderSync(Map<String, String> params) throws MallinkException { |
|
|
|
Map<String, String> retMap = new HashMap<>(); |
|
|
|
|
|
|
|
String tenantId = params.get(WxPayConstant.NEU_TENANT_ID); // 租户ID |
|
|
|
String merchantIdStr = params.get(WxPayConstant.NEU_MERCHANT_ID); // 商户ID |
|
|
|
String buUserIdStr = params.get(WxPayConstant.NEU_BU_USER_ID); // POS操作员ID |
|
|
|
String cuUserIdStr = params.get(WxPayConstant.NEU_MEM_ID); // 富茂系统会员ID |
|
|
|
String posOrderIdStr = params.get(WxPayConstant.NEU_ORDER_ID); // POS订单ID |
|
|
|
String posOrderTimeStr = params.get(WxPayConstant.NEU_ORDER_TIME); // POS订单时间 |
|
|
|
String posAmountStr = params.get(WxPayConstant.NEU_ORDER_AMOUNT); // POS订单总额 |
|
|
|
String posStatusStr = params.get(WxPayConstant.NEU_ORDER_STATUS); // 订单状态: 0有效,1取消,根据订单状态处理优惠券;有效:优惠券从预核销处理为核销; |
|
|
|
|
|
|
|
// 1. check params |
|
|
|
if (StringUtils.isBlank(tenantId)) { |
|
|
|
errParam(WxPayConstant.NEU_TENANT_ID); |
|
|
|
} |
|
|
|
PosMallConfig config = posMallConfigService.getByTenantId(tenantId); |
|
|
|
if (config == null) { |
|
|
|
logger.error(ErrorCode.POS_CONFIG_NOT_FOUND.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.POS_CONFIG_NOT_FOUND); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(merchantIdStr)) { |
|
|
|
errParam(WxPayConstant.NEU_MERCHANT_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buUserIdStr)) { |
|
|
|
errParam(WxPayConstant.NEU_BU_USER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(cuUserIdStr)) { |
|
|
|
errParam(WxPayConstant.NEU_MEM_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderIdStr)) { |
|
|
|
errParam(WxPayConstant.NEU_ORDER_ID); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posOrderTimeStr)) { |
|
|
|
errParam(WxPayConstant.NEU_ORDER_TIME); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posAmountStr)) { |
|
|
|
errParam(WxPayConstant.NEU_ORDER_AMOUNT); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(posStatusStr)) { |
|
|
|
errParam(WxPayConstant.NEU_ORDER_STATUS); |
|
|
|
} |
|
|
|
Long merchantId, buUserId, posOrderId, cardId; |
|
|
|
Integer posAmount = 0; |
|
|
|
try { |
|
|
|
merchantId = Long.valueOf(merchantIdStr); |
|
|
|
buUserId = Long.valueOf(buUserIdStr); |
|
|
|
posOrderId = Long.valueOf(posOrderIdStr); |
|
|
|
posAmount = Integer.valueOf(posAmountStr); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); |
|
|
|
} |
|
|
|
// 2. check merchant |
|
|
|
WxMerchant merchant = checkAndGetMerchant(merchantId); |
|
|
|
// 3. check buUser |
|
|
|
WxMerchantBUser merchantBUser = checkAndGetMerchantUser(merchantId, buUserId); |
|
|
|
if (posStatusStr.equalsIgnoreCase("0")) { |
|
|
|
// TODO |
|
|
|
// add to wx_order |
|
|
|
String payDetail = params.get(WxPayConstant.NEU_PAY_DETAIL); |
|
|
|
JSONObject payDetailObj = JSON.parseObject(payDetail); |
|
|
|
JSONArray payDetailList = payDetailObj.getJSONArray(WxPayConstant.NEU_PAY_DETAIL_LIST); |
|
|
|
for (int i=0;i<payDetailList.size();i++) { |
|
|
|
JSONObject payOrderObj = payDetailList.getJSONObject(i); |
|
|
|
// ADD to wx_pay_order |
|
|
|
String neuPayOrderType = payOrderObj.getString(WxPayConstant.NEU_PAY_ORDER_TYPE); |
|
|
|
if (neuPayOrderType.equalsIgnoreCase(String.valueOf(EnumPosPamentType.MEM_DISCOUNT.getCode()))) { |
|
|
|
// 会员折扣 |
|
|
|
} else if (neuPayOrderType.equalsIgnoreCase(String.valueOf(EnumPosPamentType.MEM_COUPON.getCode()))) { |
|
|
|
// 优惠券, 交易核销 |
|
|
|
String couponOrderIdStr = payOrderObj.getString(WxPayConstant.NEU_PAY_ORDER_OUT_NO); |
|
|
|
} else if (neuPayOrderType.equalsIgnoreCase(String.valueOf(EnumPosPamentType.MEM_CARD.getCode()))) { |
|
|
|
// 预付卡, 不能退 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (posStatusStr.equalsIgnoreCase("1")) { |
|
|
|
// TODO |
|
|
|
// add to wx_order |
|
|
|
String refundDetail = params.get(WxPayConstant.NEU_REFUND_DETAIL); |
|
|
|
JSONObject refundDetailObj = JSON.parseObject(refundDetail); |
|
|
|
JSONArray refundDetailList = refundDetailObj.getJSONArray(WxPayConstant.NEU_REFUND_DETAIL_LIST); |
|
|
|
for (int i=0;i<refundDetailList.size();i++) { |
|
|
|
JSONObject refundOrderObj = refundDetailList.getJSONObject(i); |
|
|
|
// TODO |
|
|
|
// ADD to wx_pay_order |
|
|
|
String neuRefundOrderType = refundOrderObj.getString(WxPayConstant.NEU_REFUND_ORDER_TYPE); |
|
|
|
if (neuRefundOrderType.equalsIgnoreCase(String.valueOf(EnumPosRefundType.MEM_DISCOUNT.getCode()))) { |
|
|
|
// 会员折扣, |
|
|
|
} else if (neuRefundOrderType.equalsIgnoreCase(String.valueOf(EnumPosRefundType.MEM_COUPON.getCode()))) { |
|
|
|
// 优惠券, 退优惠券 |
|
|
|
} else if (neuRefundOrderType.equalsIgnoreCase(String.valueOf(EnumPosRefundType.MEM_CARD.getCode()))) { |
|
|
|
// 预付卡, 不能退 |
|
|
|
} else if (neuRefundOrderType.equalsIgnoreCase(String.valueOf(EnumPosRefundType.BOOK.getCode()))) { |
|
|
|
// 记账 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return retMap; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 检查及获取商户信息 |
|
|
|
* @param merchantId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private WxMerchant checkAndGetMerchant(Long merchantId) { |
|
|
|
WxMerchant merchant = merchantService.getById(merchantId); |
|
|
|
if (merchant == null) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + merchantId); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
if (merchant.getIsDel().equals(EnumDelStatus.DEL.getCode()) || |
|
|
|
merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + merchantId); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
return merchant; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查及获取商户用户 |
|
|
|
* @param buUserId |
|
|
|
* @param merchantId |
|
|
|
*/ |
|
|
|
private WxMerchantBUser checkAndGetMerchantUser(Long buUserId, Long merchantId) { |
|
|
|
WxMerchantBUser buUser = merchantBUserService.getById(buUserId); |
|
|
|
if (buUser == null) { |
|
|
|
logger.error(ErrorCode.USER_IS_EMPTY.getMessage() + ": " + buUserId); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (!buUser.getMerchantId().equals(merchantId)) { |
|
|
|
logger.error(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG.getMessage() + ": " + buUserId); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_BUSER_MERCHANT_NOT_BELONG); |
|
|
|
} |
|
|
|
if (buUser.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
logger.error(ErrorCode.MERCHANT_BUSER_NOT_VALID.getMessage() + ": " + buUserId); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_BUSER_NOT_VALID); |
|
|
|
} |
|
|
|
return buUser; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 输入参数错误 |
|
|
|
* @param paramStr |
|
|
|
* @throws MallinkException |
|
|
|
*/ |
|
|
|
private void errParam(String paramStr) throws MallinkException { |
|
|
|
String errMessage = String.format("request params[%s] error.", paramStr); |
|
|
|
logger.error(errMessage); |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), errMessage); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* POS订单添加 |
|
|
|
* @return |
|
|
|
* @throws MallinkException |
|
|
|
*/ |
|
|
|
private WxOrder addToWxOrder(String tenantId, String merchantNo, String buUserNo, String memNo, String memPhone, |
|
|
|
String posOrderNo, String posOrderTimeStr, String posOrderAmount, String posOrderStatus) throws MallinkException { |
|
|
|
|
|
|
|
// 1. 根据posOrderNo查找 |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* POS支付订单 |
|
|
|
* @return |
|
|
|
* @throws MallinkException |
|
|
|
*/ |
|
|
|
private WxPayOrder addToWxPayOrder(WxOrder orderRecord, |
|
|
|
String posPayOrderNo, String posPayOrderTime, |
|
|
|
String paymentType, String thirdParam, String payOrderNo, String payAmount, String payTime) throws MallinkException { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* POS支付退款订单 |
|
|
|
* @return |
|
|
|
* @throws MallinkException |
|
|
|
*/ |
|
|
|
private WxPayOrder addToWxRefundOrder(WxOrder orderRecord, |
|
|
|
String posPayOrderNo, String posRefundOrderNo, String posRefundOrderTime, |
|
|
|
String refundType, String thirdParam, String refundStatusStr, |
|
|
|
String refundOrderNo, String refundAmount, String refundTime) throws MallinkException { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |