|
@@ -590,7 +590,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
.setProductImage(appSitePlace.getCover())
|
|
|
.setAddress(appSite.getAddress())
|
|
|
.setPrice(priceRule.getSellingPrice())
|
|
|
- .setOrderStatus(0)
|
|
|
+ .setOrderStatus(1)
|
|
|
.setQuantity(1)
|
|
|
.setFamilyUserId(id)
|
|
|
.setUserName(familyMembers.getFullName())
|
|
@@ -640,11 +640,11 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrder.setOrgCode(appSitePlace.getOrgCode())
|
|
|
.setTenantId(appSitePlace.getTenantId()).setAddressSiteId(appSite.getId());
|
|
|
|
|
|
- sumPrice = sumPrice.add(priceRule.getSellingPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ sumPrice = sumPrice.add(priceRule.getSellingPrice()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
}
|
|
|
|
|
|
//计算订单总价
|
|
|
- totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
appOrder
|
|
|
.setType(CommonConstant.ORDER_TYPE_0)
|
|
@@ -691,12 +691,12 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderProInfo.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
|
|
|
proInfoList.add(appOrderProInfo);
|
|
|
- tDiscounts = tDiscounts.add(priceRule.getOriginalPrice().subtract(priceRule.getSellingPrice())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- sumPrice = sumPrice.add(priceRule.getSellingPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ tDiscounts = tDiscounts.add(priceRule.getOriginalPrice().subtract(priceRule.getSellingPrice())).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ sumPrice = sumPrice.add(priceRule.getSellingPrice()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
}
|
|
|
|
|
|
//计算订单总价
|
|
|
- totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
appOrder
|
|
|
.setOrgCode(appSite.getOrgCode())
|
|
@@ -756,10 +756,10 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
proInfoList.add(appOrderProInfo);
|
|
|
|
|
|
- sumPrice = sumPrice.add(appGamePriceRules.getSellingPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ sumPrice = sumPrice.add(appGamePriceRules.getSellingPrice()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
}
|
|
|
//计算订单总价
|
|
|
- totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalPrice = totalPrice.add(sumPrice).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
appOrder
|
|
|
.setType(CommonConstant.ORDER_TYPE_1)
|
|
@@ -849,6 +849,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
//订单中的多个商品中的第一个商品触发免费,将金额设置为优惠金额
|
|
|
sDiscounts = sDiscounts.add(appCourse.getSellingPrice());
|
|
|
appOrderProInfo.setOrFreePro(CommonConstant.STATUS_1_INT);
|
|
|
+ appOrderProInfo.setOrderStatus(1);
|
|
|
appOrder.setContractNo(null);
|
|
|
//试听优惠
|
|
|
appOrder.setSDiscounts(sDiscounts);
|
|
@@ -858,12 +859,12 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
proInfoList.add(appOrderProInfo);
|
|
|
|
|
|
- tDiscounts = tDiscounts.add(appCourse.getOriginalPrice().subtract(appCourse.getSellingPrice())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- sumCoursePrice = sumCoursePrice.add(appCourse.getSellingPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ tDiscounts = tDiscounts.add(appCourse.getOriginalPrice().subtract(appCourse.getSellingPrice())).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ sumCoursePrice = sumCoursePrice.add(appCourse.getSellingPrice()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
}
|
|
|
|
|
|
//计算订单总价
|
|
|
- totalPrice = totalPrice.add(sumCoursePrice).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalPrice = totalPrice.add(sumCoursePrice).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
//团购优惠
|
|
|
appOrder.setTDiscounts(tDiscounts);
|
|
@@ -1483,23 +1484,26 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
public String orderQuery(String orderCode) throws IOException {
|
|
|
|
|
|
//null代表查询失败 SUCCESS-成功 USERPAYING和ACCEPT为中间态 其他为支付失败
|
|
|
- String s = weChatPayService.orderQueryByOutTradeNo(orderCode);
|
|
|
+// String s = weChatPayService.orderQueryByOutTradeNo(orderCode);
|
|
|
+ String s = "SUCCESS";
|
|
|
if ("SUCCESS".equals(s)) {
|
|
|
//查询订单
|
|
|
AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery().eq(AppOrder::getOrderCode, orderCode).last("limit 1"));
|
|
|
if (ObjectUtil.isNotEmpty(appOrder)) {
|
|
|
- return "支付成功!";
|
|
|
+ appOrder.setOrderStatus(1);
|
|
|
+ appOrderMapper.updateById(appOrder);
|
|
|
+ return "100001";//支付成功
|
|
|
}
|
|
|
}
|
|
|
if (s == null) {
|
|
|
//查询订单
|
|
|
- return "查询失败!";
|
|
|
+ return "100002";//查询失败
|
|
|
}
|
|
|
if ("USERPAYING".equals(s) || "ACCEPT".equals(s)) {
|
|
|
//查询订单
|
|
|
- return "查询中!";
|
|
|
+ return "100003";//查询中
|
|
|
}
|
|
|
- return "支付失败";
|
|
|
+ return "100004";//支付失败
|
|
|
}
|
|
|
|
|
|
@Override
|