|
@@ -257,7 +257,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
orderProductList.forEach(orderProduct -> {
|
|
|
// 商品含税未知 or 订单选择开企业发票,商品不含税不能开票
|
|
|
boolean productTaxFlag = (null == orderProduct.getIncludedTax()) || (null == orderProduct.getInvoiceType()) || (Integer.valueOf(2).equals(orderProduct.getIncludedTax()))
|
|
|
- || (Integer.valueOf(2).equals(order.getInvoiceFlag()) && (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && Integer.valueOf(3).equals(orderProduct.getInvoiceType())));
|
|
|
+ || (Integer.valueOf(2).equals(order.getInvoiceFlag()) && (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && Integer.valueOf(3).equals(orderProduct.getInvoiceType())));
|
|
|
if (productTaxFlag) {
|
|
|
order.setInvoiceStatus(true);
|
|
|
}
|
|
@@ -273,11 +273,12 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 生成网银支付链接
|
|
|
+ * 生成网银支付链接
|
|
|
+ *
|
|
|
* @param payLinkDto {
|
|
|
* orderId 订单ID
|
|
|
* vipRecordId 会员购买记录Id
|
|
|
- * }
|
|
|
+ * }
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<String> getPayLink(PayLinkDto payLinkDto) {
|
|
@@ -453,7 +454,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
Map<String, Object> map = weChatService.getInfoMapByWeb(payParam.getCode(), "crm");
|
|
|
openId = (String) map.get(WeChatService.Keys.OPEN_ID);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("try-catch:",e);
|
|
|
+ log.error("try-catch:", e);
|
|
|
}
|
|
|
if (StringUtils.isEmpty(openId)) {
|
|
|
return ResponseJson.error("微信公众号获取openId失败!", null);
|
|
@@ -696,7 +697,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
log.info("【支付异步回调】>>>>>>>>>>>>>>订单(部分支付),修改订单状态:" + order.getStatus() + ",orderId:" + orderId);
|
|
|
}
|
|
|
// 更新付款次数
|
|
|
- Integer paySuccessCounter = (null == order.getPaySuccessCounter()) ? 1 : order.getPaySuccessCounter() +1;
|
|
|
+ Integer paySuccessCounter = (null == order.getPaySuccessCounter()) ? 1 : order.getPaySuccessCounter() + 1;
|
|
|
order.setPaySuccessCounter(paySuccessCounter);
|
|
|
order.setUpdateDate(curDateStr);
|
|
|
// 更新订单支付状态
|
|
@@ -828,7 +829,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
}
|
|
|
// 超级会员用户标识
|
|
|
Integer svipUserId = baseMapper.getSvipUserIdByUserId(order.getUserId());
|
|
|
- if (null != svipUserId && svipUserId.equals(order.getUserId())){
|
|
|
+ if (null != svipUserId && svipUserId.equals(order.getUserId())) {
|
|
|
// 超级会员用户采美豆翻倍
|
|
|
num = num * 2;
|
|
|
}
|
|
@@ -842,7 +843,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
}
|
|
|
}
|
|
|
baseMapper.updateUserBeans(beansHistory.getUserId(), userBeans);
|
|
|
- log.info("【支付异步回调】>>>>>更新用户采美豆(update[user(userBeans:"+ userBeans +")]),userId:" + beansHistory.getUserId());
|
|
|
+ log.info("【支付异步回调】>>>>>更新用户采美豆(update[user(userBeans:" + userBeans + ")]),userId:" + beansHistory.getUserId());
|
|
|
}
|
|
|
// 已支付短信推送(取消推送)
|
|
|
/*boolean smsPushFlag = !orderRequestNo.contains("BETA") && !orderRequestNo.contains("DEV");
|
|
@@ -913,7 +914,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
/**
|
|
|
* 延时分账
|
|
|
*
|
|
|
- * @param callUrl 回调地址
|
|
|
+ * @param callUrl 回调地址
|
|
|
*/
|
|
|
@Override
|
|
|
public void delayedSplitting(String callUrl) {
|
|
@@ -944,7 +945,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
double shopTotalAmount = 0.00;
|
|
|
String subUserNo = "";
|
|
|
for (SplitAccountPo account : splitBillDetail) {
|
|
|
- if (null!= account.getType() && 4 == account.getType() && shopOrder.getShopId().equals(account.getShopId())) {
|
|
|
+ if (null != account.getType() && 4 == account.getType() && shopOrder.getShopId().equals(account.getShopId())) {
|
|
|
shopTotalAmount = MathUtil.add(shopTotalAmount, account.getSplitAccount()).doubleValue();
|
|
|
subUserNo = account.getSubUserNo();
|
|
|
}
|
|
@@ -1068,37 +1069,37 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
costPrice = splitAmount;
|
|
|
splitAmount = 0.00;
|
|
|
}
|
|
|
- String commercialCode = payOrderMapper.getShopCommercialCode(orderProduct.getShopId());
|
|
|
- SplitAccountPo splitAccount = new SplitAccountPo();
|
|
|
- splitAccount.setOrderId(order.getOrderId());
|
|
|
- splitAccount.setOrderProductId(orderProduct.getOrderProductId());
|
|
|
- splitAccount.setShopId(orderProduct.getShopId());
|
|
|
- splitAccount.setSplitAccount(costPrice);
|
|
|
- splitAccount.setProductType(1);
|
|
|
- if (StringUtils.isNotBlank(commercialCode)) {
|
|
|
- // 供应商拥有子商户号
|
|
|
- splitAccount.setType(4);
|
|
|
- splitAccount.setSubUserNo(commercialCode);
|
|
|
+ }
|
|
|
+ String commercialCode = payOrderMapper.getShopCommercialCode(orderProduct.getShopId());
|
|
|
+ SplitAccountPo splitAccount = new SplitAccountPo();
|
|
|
+ splitAccount.setOrderId(order.getOrderId());
|
|
|
+ splitAccount.setOrderProductId(orderProduct.getOrderProductId());
|
|
|
+ splitAccount.setShopId(orderProduct.getShopId());
|
|
|
+ splitAccount.setSplitAccount(costPrice);
|
|
|
+ splitAccount.setProductType(1);
|
|
|
+ if (StringUtils.isNotBlank(commercialCode)) {
|
|
|
+ // 供应商拥有子商户号
|
|
|
+ splitAccount.setType(4);
|
|
|
+ splitAccount.setSubUserNo(commercialCode);
|
|
|
+ } else {
|
|
|
+ if (1 == orderProduct.getInvoiceType()) {
|
|
|
+ // 开增值税发票,则分账到公账-专票
|
|
|
+ splitAccount.setType(1);
|
|
|
+ splitAccount.setSubUserNo(PayUtil.publicAccountNo);
|
|
|
+ } else if (2 == orderProduct.getInvoiceType()) {
|
|
|
+ // 开普通发票,则分账到公账-普票
|
|
|
+ splitAccount.setType(3);
|
|
|
+ splitAccount.setSubUserNo(PayUtil.commonInvoiceNo);
|
|
|
} else {
|
|
|
- if (1 == orderProduct.getInvoiceType()) {
|
|
|
- // 开增值税发票,则分账到公账-专票
|
|
|
- splitAccount.setType(1);
|
|
|
- splitAccount.setSubUserNo(PayUtil.publicAccountNo);
|
|
|
- } else if (2 == orderProduct.getInvoiceType()) {
|
|
|
- // 开普通发票,则分账到公账-普票
|
|
|
- splitAccount.setType(3);
|
|
|
- splitAccount.setSubUserNo(PayUtil.commonInvoiceNo);
|
|
|
- } else {
|
|
|
- // 不能开票,则分账到私账-无票
|
|
|
- splitAccount.setType(2);
|
|
|
- splitAccount.setSubUserNo(PayUtil.privateAccountNo);
|
|
|
- }
|
|
|
- }
|
|
|
- list.add(splitAccount);
|
|
|
- if (MathUtil.compare(splitAmount, 0) == 0) {
|
|
|
- break;
|
|
|
+ // 不能开票,则分账到私账-无票
|
|
|
+ splitAccount.setType(2);
|
|
|
+ splitAccount.setSubUserNo(PayUtil.privateAccountNo);
|
|
|
}
|
|
|
}
|
|
|
+ list.add(splitAccount);
|
|
|
+ if (MathUtil.compare(splitAmount, 0) == 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
// 付供应商运费,是以供应商为单位的
|
|
|
if (MathUtil.compare(splitAmount, 0) > 0) {
|