上传千猪肯德基 会员充值内容

dev-discount
袁野 2 years ago
parent 4d9358e060
commit 2bcf47b9a3
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 2
      hai-bweb/src/main/resources/dev/application.yml
  3. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  5. 49
      hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java
  6. 8
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  7. 1
      hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java
  8. 28
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  9. 34
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  10. 2
      hai-service/src/main/java/com/hai/service/ApiOpenService.java
  11. 12
      hai-service/src/main/java/com/hai/service/ApiProductService.java
  12. 16
      hai-service/src/main/java/com/hai/service/impl/ApiOpenServiceImpl.java
  13. 13
      hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java
  14. 42
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  15. 6
      hai-service/src/main/resources/dev/commonConfig.properties
  16. 6
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  17. 6
      hai-service/src/main/resources/prod/commonConfig.properties

File diff suppressed because one or more lines are too long

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hsg_yy?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -138,6 +138,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/czOrder/*") .excludePathPatterns("/czOrder/*")
.excludePathPatterns("/outRechargePrice/*") .excludePathPatterns("/outRechargePrice/*")
.excludePathPatterns("/userDiscount/*") .excludePathPatterns("/userDiscount/*")
.excludePathPatterns("/highThirdParty/*")
; ;
} }

File diff suppressed because one or more lines are too long

@ -113,9 +113,23 @@ public class HighThirdPartyController {
List<ApiStarbucksProducts> list = apiProductService.getStarbucksProducts(map); List<ApiStarbucksProducts> list = apiProductService.getStarbucksProducts(map);
for (ApiStarbucksProducts apiStarbucksProducts : list) { for (ApiStarbucksProducts apiStarbucksProducts : list) {
apiStarbucksProducts.setExt1(String.valueOf(i)); apiStarbucksProducts.setExt1(String.valueOf(i));
apiStarbucksProducts.setSalesVentiPrice(apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP));
apiStarbucksProducts.setSalesTallPrice(apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); BigDecimal salesVentiPrice = apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
apiStarbucksProducts.setSalesGrandePrice(apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) {
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice();
}
if (salesTallPrice.compareTo(apiStarbucksProducts.getMarketTallPrice()) > 0) {
salesTallPrice = apiStarbucksProducts.getMarketTallPrice();
}
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) {
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice();
}
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice);
apiStarbucksProducts.setSalesTallPrice(salesTallPrice);
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice);
starbucksProductsList.add(apiStarbucksProducts); starbucksProductsList.add(apiStarbucksProducts);
} }
starbucksProducts.setName(s); starbucksProducts.setName(s);
@ -157,7 +171,8 @@ public class HighThirdPartyController {
@ResponseBody @ResponseBody
@ApiOperation(value = "查询肯德基门店") @ApiOperation(value = "查询肯德基门店")
public ResponseData getKfcStoresList(@RequestParam(name = "storeName", required = false) String storeName, public ResponseData getKfcStoresList(@RequestParam(name = "storeName", required = false) String storeName,
@RequestParam(name = "cityCode", required = true) String cityCode, @RequestParam(name = "cityCode", required = false) String cityCode,
@RequestParam(name = "cityName", required = false) String cityName,
@RequestParam(name = "lat", required = true) String lat, @RequestParam(name = "lat", required = true) String lat,
@RequestParam(name = "lon", required = true) String lon) { @RequestParam(name = "lon", required = true) String lon) {
try { try {
@ -165,6 +180,7 @@ public class HighThirdPartyController {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("storeName", storeName); map.put("storeName", storeName);
map.put("cityCode", cityCode); map.put("cityCode", cityCode);
map.put("cityName", cityName);
List<ApiKfcStores> list = apiProductService.getKfcStoresList(map); List<ApiKfcStores> list = apiProductService.getKfcStoresList(map);
@ -202,7 +218,7 @@ public class HighThirdPartyController {
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId));
if (region != null) { if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
productDiscount = thirdProductConfig.getProductConfigNum(1, bsCompany.getId()); productDiscount = thirdProductConfig.getProductConfigNum(2, bsCompany.getId());
} }
if (productDiscount == null) { if (productDiscount == null) {
@ -219,13 +235,22 @@ public class HighThirdPartyController {
for (Object products : dataObject.getJSONArray("products")) { for (Object products : dataObject.getJSONArray("products")) {
JSONObject productsObject = (JSONObject) products; JSONObject productsObject = (JSONObject) products;
BigDecimal productsPrice = productsObject.getBigDecimal("price"); BigDecimal productsPrice = productsObject.getBigDecimal("price");
productsObject.put("salePrice", productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP));
BigDecimal salePriceF = productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP);
if (salePriceF.compareTo(productsObject.getBigDecimal("originalPrice")) > 0) {
salePriceF = productsObject.getBigDecimal("originalPrice");
}
productsObject.put("salePrice", salePriceF);
if (productsObject.getJSONArray("specGroups") != null) { if (productsObject.getJSONArray("specGroups") != null) {
for (Object specGroups : productsObject.getJSONArray("specGroups")) { for (Object specGroups : productsObject.getJSONArray("specGroups")) {
JSONObject specGroupsObject = (JSONObject) specGroups; JSONObject specGroupsObject = (JSONObject) specGroups;
BigDecimal specGroupsPrice = specGroupsObject.getBigDecimal("price"); BigDecimal specGroupsPrice = specGroupsObject.getBigDecimal("price");
specGroupsObject.put("salePrice", specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP)); BigDecimal salePrice = specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP);
if (salePrice.compareTo(specGroupsObject.getBigDecimal("originalPrice")) > 0) {
salePrice = specGroupsObject.getBigDecimal("originalPrice");
}
specGroupsObject.put("salePrice", salePrice);
} }
} }
} }
@ -281,6 +306,7 @@ public class HighThirdPartyController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
System.out.println("======================================================" + object);
if (StringUtils.isBlank(object.getString("customerMobile")) || if (StringUtils.isBlank(object.getString("customerMobile")) ||
StringUtils.isBlank(object.getString("regionId")) || StringUtils.isBlank(object.getString("regionId")) ||
@ -465,7 +491,14 @@ public class HighThirdPartyController {
List<ApiMemberProduct> list = apiMemberProductService.getListApiMemberProduct(map); List<ApiMemberProduct> list = apiMemberProductService.getListApiMemberProduct(map);
for (ApiMemberProduct memberProduct : list) { for (ApiMemberProduct memberProduct : list) {
memberProduct.setCostPrice(memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP));
BigDecimal costPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (costPrice.compareTo(memberProduct.getPrice()) > 0) {
costPrice = memberProduct.getPrice();
}
memberProduct.setCostPrice(costPrice);
} }
return ResponseMsgUtil.success(list); return ResponseMsgUtil.success(list);

@ -276,12 +276,12 @@ public class HighOrderSchedule {
} }
// 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败
if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) {
for (HighChildOrder childOrder : order.getHighChildOrderList()) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(3); childOrder.setChildOrdeStatus(3);
} }
order.setOrderStatus(3); highOrder.setOrderStatus(3);
order.setFinishTime(new Date()); highOrder.setFinishTime(new Date());
highOrderService.updateOrder(order); highOrderService.updateOrder(highOrder);
} }
} }

@ -490,6 +490,7 @@ public class HttpsUtils {
response = httpClient.execute(httpPost); response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8"); httpStr = EntityUtils.toString(entity, "UTF-8");
System.out.println("-------------------------------------------" + httpStr);
return JSON.parseObject(httpStr); return JSON.parseObject(httpStr);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);

@ -80,6 +80,10 @@ public class CommonSysConfig {
private String JjUrl; private String JjUrl;
private String JjAppSecret; private String JjAppSecret;
private String CyApiKey;
private String CyAppSecret;
private String CyPostUrl;
private String unionAppId; private String unionAppId;
private String unionSecret; private String unionSecret;
private String unionRsaKey; private String unionRsaKey;
@ -548,4 +552,28 @@ public class CommonSysConfig {
public void setThirdPostUrl(String thirdPostUrl) { public void setThirdPostUrl(String thirdPostUrl) {
this.thirdPostUrl = thirdPostUrl; this.thirdPostUrl = thirdPostUrl;
} }
public String getCyApiKey() {
return CyApiKey;
}
public void setCyApiKey(String cyApiKey) {
CyApiKey = cyApiKey;
}
public String getCyAppSecret() {
return CyAppSecret;
}
public void setCyAppSecret(String cyAppSecret) {
CyAppSecret = cyAppSecret;
}
public String getCyPostUrl() {
return CyPostUrl;
}
public void setCyPostUrl(String cyPostUrl) {
CyPostUrl = cyPostUrl;
}
} }

@ -2,22 +2,14 @@ package com.hai.config;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import com.hai.common.utils.WxUtils; import com.hai.common.utils.WxUtils;
import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargePrice;
import com.hai.service.OutRechargeChildOrderService;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.OutRechargePriceService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -143,4 +135,26 @@ public class RechargeConfig {
} }
/**
* @Author Sum1Dream
* @name rechargeOrderByCy.java
* @Description // 城宇话费下单
* @Date 10:22 2022/7/14
* @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject rechargeOrderByCy(JSONObject object) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("agentOrderId" , object.getString("agentOrderId"));
paramMap.put("productId" , object.getString("productId"));
paramMap.put("mobile" , object.getString("mobile"));
paramMap.put("timestamp" , DateUtil.date2String(new Date() , DateUtil.Y_M_D_HMS));
paramMap.put("appid" , CommonSysConst.getSysConfig().getCyApiKey());
paramMap.put("sign", WxUtils.generateSignatureLy(paramMap , CommonSysConst.getSysConfig().getCyAppSecret() , WXPayConstants.SignType.MD5));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCyPostUrl()+ "/api/interface/recharge", paramMap , new HashMap<>());
}
} }

@ -1,9 +1,7 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiCity;
import com.hai.entity.ApiMerchants; import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig; import com.hai.entity.ApiProductConfig;
/** /**

@ -214,6 +214,18 @@ public interface ApiProductService {
*/ */
List<ApiCity> getAllCity(String cityName); List<ApiCity> getAllCity(String cityName);
/**
* @Author Sum1Dream
* @name insertCity.java
* @Description // 插入城市
* @Date 17:18 2022/7/13
* @Param [com.hai.entity.ApiKfcStores]
* @return void
*/
void insertCity(ApiCity apiCity);
void updateCity(ApiCity apiCity);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name insertKfcStore.java * @name insertKfcStore.java

@ -1,25 +1,18 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil; import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator; import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.MD5Util;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
import com.hai.config.QianZhuConfig;
import com.hai.config.RechargeConfig; import com.hai.config.RechargeConfig;
import com.hai.dao.ApiAmountRecordMapper;
import com.hai.dao.ApiCityMapper;
import com.hai.dao.OutRechargeOrderMapper; import com.hai.dao.OutRechargeOrderMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.OperatorEnum;
import com.hai.model.OutRechargePriceModel;
import com.hai.service.*; import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -56,11 +49,6 @@ public class ApiOpenServiceImpl implements ApiOpenService {
@Resource @Resource
private BsRequestRecordService bsRequestRecordService; private BsRequestRecordService bsRequestRecordService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private ApiCityMapper apiCityMapper;
@Override @Override
@Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW) @Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW)

@ -362,6 +362,16 @@ public class ApiProductServiceImpl implements ApiProductService {
return apiCityMapper.selectByExample(example); return apiCityMapper.selectByExample(example);
} }
@Override
public void insertCity(ApiCity apiCity) {
apiCityMapper.insert(apiCity);
}
@Override
public void updateCity(ApiCity apiCity) {
apiCityMapper.updateByPrimaryKeySelective(apiCity);
}
@Override @Override
public void insertKfcStore(ApiKfcStores apiKfcStores) { public void insertKfcStore(ApiKfcStores apiKfcStores) {
apiKfcStoresMapper.insert(apiKfcStores); apiKfcStoresMapper.insert(apiKfcStores);
@ -398,6 +408,9 @@ public class ApiProductServiceImpl implements ApiProductService {
if (StringUtils.isNotBlank(MapUtils.getString(map , "storeName"))) { if (StringUtils.isNotBlank(MapUtils.getString(map , "storeName"))) {
criteria.andStoreNameLike("%" + MapUtils.getString(map , "storeName") + "%"); criteria.andStoreNameLike("%" + MapUtils.getString(map , "storeName") + "%");
} }
if (StringUtils.isNotBlank(MapUtils.getString(map , "cityName"))) {
criteria.andCityNameLike("%" + MapUtils.getString(map , "cityName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(map , "storeCode"))) { if (StringUtils.isNotBlank(MapUtils.getString(map , "storeCode"))) {
criteria.andStoreCodeEqualTo(MapUtils.getString(map , "storeCode")); criteria.andStoreCodeEqualTo(MapUtils.getString(map , "storeCode"));

@ -1921,23 +1921,21 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.setGoodsImg(childObject.getString("imgUrl")); childOrder.setGoodsImg(childObject.getString("imgUrl"));
childOrder.setSaleCount(childObject.getInteger("quantity")); childOrder.setSaleCount(childObject.getInteger("quantity"));
childOrder.setGoodsPrice(childObject.getBigDecimal("marketPrice")); childOrder.setGoodsPrice(childObject.getBigDecimal("marketPrice"));
// String goodsSpecName = childObject.getString("cupSize") + childOrder.setGoodsActualPrice(childObject.getBigDecimal("unitPrice"));
// "," + childObject.getString("temperature") +
// "," + childObject.getString("milk") +
// "," + childObject.getString("milkBubble") +
// "," + childObject.getString("espresso") +
// "," + childObject.getString("cream");
// childOrder.setGoodsSpecName(goodsSpecName);
// 计算利润 // 计算利润
BigDecimal profitPrice = childObject.getBigDecimal("unitPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); BigDecimal profitPrice = childObject.getBigDecimal("unitPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)));
// 计算子订单支付金额
BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP); BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP);
// 计算实际支付金额 if (childPrice.compareTo(childObject.getBigDecimal("marketPrice")) > 0) {
childPrice = childObject.getBigDecimal("marketPrice");
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice); orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额 // 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice")); marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(childPrice);
childOrder.setGoodsActualPrice(childPrice);
childOrder.setTotalPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
highChildOrderMapper.insert(childOrder); highChildOrderMapper.insert(childOrder);
} }
@ -1988,19 +1986,24 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.setGoodsImg(childObject.getString("imageUrl")); childOrder.setGoodsImg(childObject.getString("imageUrl"));
childOrder.setSaleCount(childObject.getInteger("quantity")); childOrder.setSaleCount(childObject.getInteger("quantity"));
childOrder.setGoodsPrice(childObject.getBigDecimal("originPrice")); childOrder.setGoodsPrice(childObject.getBigDecimal("originPrice"));
childOrder.setGoodsActualPrice(childObject.getBigDecimal("price"));
// 计算利润 // 计算利润
BigDecimal profitPrice = childObject.getBigDecimal("price").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); BigDecimal profitPrice = childObject.getBigDecimal("price").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)));
// 计算子订单支付金额
BigDecimal childPrice = childObject.getBigDecimal("price").add(profitPrice).setScale(2 , RoundingMode.HALF_UP); BigDecimal childPrice = childObject.getBigDecimal("price").add(profitPrice).setScale(2 , RoundingMode.HALF_UP);
// 计算实际支付金额 if (childPrice.compareTo(childObject.getBigDecimal("originPrice")) > 0) {
childPrice = childObject.getBigDecimal("originPrice");
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice); orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额 // 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice")); marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(childPrice);
childOrder.setGoodsActualPrice(childPrice);
childOrder.setTotalPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
highChildOrderMapper.insert(childOrder); highChildOrderMapper.insert(childOrder);
} }
} else if (object.getInteger("productType") == 3) { } else if (object.getInteger("productType") == 3) {
ApiMemberProduct memberProduct = apiMemberProductService.findById(object.getLong("goodsId")); ApiMemberProduct memberProduct = apiMemberProductService.findById(object.getLong("goodsId"));
@ -2021,6 +2024,9 @@ public class HighOrderServiceImpl implements HighOrderService {
// 计算实际支付金额 // 计算实际支付金额
orderPayPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); orderPayPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (orderPayPrice.compareTo(memberProduct.getPrice()) > 0) {
orderPayPrice = memberProduct.getPrice();
}
// 计算市场价金额 // 计算市场价金额
marketPrice = memberProduct.getPrice(); marketPrice = memberProduct.getPrice();

@ -74,11 +74,15 @@ LyNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallbackByLy
#LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU #LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
#LyMemberId=18665 #LyMemberId=18665
#LyPostUrl=https://cz.31994.cn/yrapi.php/ #LyPostUrl=https://cz.31994.cn/yrapi.php/
LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236 LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/ LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=7113783e75354df2a985efd3f31b9528 unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653 unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c

@ -70,6 +70,12 @@ LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236 LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/ LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586 unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586

@ -68,6 +68,12 @@ LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236 LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/ LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586 unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586

Loading…
Cancel
Save