提交代码

dev-discount
胡锐 3 years ago
parent 4b6a0f0cfd
commit 6d838a7ed9
  1. 2
      hai-bweb/src/main/resources/dev/application.yml
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  3. 8
      hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java
  4. 1
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  5. 9
      hai-service/src/main/java/com/hai/model/GasOrderModel.java
  6. 27
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  7. 43
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -28,7 +28,7 @@ spring:
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 5
database: 0
host: 139.159.177.244
port: 36379
password: HF123456.Redis

@ -238,7 +238,7 @@ public class HighGasController {
// 查询油枪
List<Map<String, Object>> gasGunMapList = new ArrayList<>();
Map<String, Object> gasGunMap;
List<HighGasOilGunNo> oilGunNoList = gasOilGunNoService.getGunNoListByOilPrice(store.getId());
List<HighGasOilGunNo> oilGunNoList = gasOilGunNoService.getGunNoListByStoreId(store.getId());
for (HighGasOilGunNo oilGunNo : oilGunNoList) {
gasGunMap = new HashMap<>();
gasGunMap.put("gunNo", oilGunNo.getGunNo());

@ -56,8 +56,8 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L2>加油金额</L2><BR>" +
"<L2>¥" + orderPrice + "元</L2><BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C>来"嗨森逛“;开心又省钱</C>";
return str;
@ -95,8 +95,8 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L2>加油金额</L2><BR>" +
"<L2>¥" + orderPrice + "元</L2><BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C>来"嗨森逛“;开心又省钱</C>";
return str;

@ -1094,6 +1094,7 @@ public interface HighOrderMapperExt {
" a.goods_name gasName," +
" (select address from high_merchant_store where id = a.goods_id) gasAddress," +
" (select store_logo from high_merchant_store where id = a.goods_id) gasLogo," +
" a.gas_oil_type gasOilType," +
" a.gas_oil_no gasOilNo," +
" a.gas_gun_no gasGunNo," +
" a.gas_price_gun gasPriceGun," +

@ -19,6 +19,7 @@ public class GasOrderModel {
private String gasLogo;
private String gasName;
private String gasAddress;
private String gasOilType;
private String gasOilNo;
private String gasGunNo;
private String gasOilLiters;
@ -31,6 +32,14 @@ public class GasOrderModel {
private Date payTime;
private Date refundTime;
public String getGasOilType() {
return gasOilType;
}
public void setGasOilType(String gasOilType) {
this.gasOilType = gasOilType;
}
public String getOrderNo() {
return orderNo;
}

@ -105,6 +105,10 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
// 是否是加油站
if (!store.getType().equals(1)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
// 优惠比例
BigDecimal discount = new BigDecimal("100");
@ -129,7 +133,13 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
}
}
discount = discount.divide(new BigDecimal("100"));
// 枪价
BigDecimal priceGun = null;
// 优惠价
BigDecimal priceVip = null;
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(2)) {
// 查询油站油品价格
JSONObject oilPriceObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), oilNo);
if (oilPriceObject == null) {
@ -139,16 +149,23 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
if (oilPriceObjectArray.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
JSONObject priceDetail = (JSONObject) oilPriceObjectArray.get(0);
// 团油枪价
priceGun = priceDetail.getBigDecimal("priceGun");
// 团油优惠价
priceVip = priceDetail.getBigDecimal("priceVip");
}
HighGasOilPrice gasOilPrice = gasOilPriceService.getGasOilPriceByStoreAndOilNo(goodsId, Integer.parseInt(oilNo));
if (gasOilPrice == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
if (priceGun == null) {
priceGun = gasOilPrice.getPriceGun();
}
if (priceVip == null) {
priceVip = gasOilPrice.getPriceVip();
}
JSONObject priceDetail = (JSONObject) oilPriceObjectArray.get(0);
// 团油枪价
BigDecimal priceGun = priceDetail.getBigDecimal("priceGun");
// 团油优惠价
BigDecimal priceVip = priceDetail.getBigDecimal("priceVip");
// 团油国标价
BigDecimal priceOfficial = gasOilPrice.getPriceOfficial();
// 嗨森逛平台价 国标价 * 折扣

@ -357,6 +357,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (highChildOrder.getGoodsType() == 3) {
highChildOrder.setChildOrdeStatus(3);
highOrder.setOrderStatus(3);
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId());
// 来源类型 1:平台自建 2:团油
@ -439,43 +440,6 @@ public class HighOrderServiceImpl implements HighOrderService {
}
}
}
/* if (highChildOrder.getGoodsType() == 3) {
highChildOrder.setChildOrdeStatus(3);
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId());
// 推送团油订单
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("gasId", store.getStoreKey());
paramMap.put("oilNo", highChildOrder.getGasOilNo());
paramMap.put("gunNo", highChildOrder.getGasGunNo());
BigDecimal priceGun = highChildOrder.getGasPriceGun();
BigDecimal priceVip = highChildOrder.getGasPriceVip();
paramMap.put("priceGun", priceGun); // 枪单价
paramMap.put("priceVip", priceVip); // 优惠价
paramMap.put("driverPhone", highOrder.getMemPhone());
paramMap.put("thirdSerialNo", highOrder.getOrderNo());
paramMap.put("refuelingAmount", highChildOrder.getTotalPrice());
// 油品类型 1:汽油:2:柴油;3:天然气
if (highChildOrder.getGasOilType() == 1) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount());
} else if (highChildOrder.getGasOilType() == 2) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount());
}
JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap);
// 推送团油订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type1.getType());
highGasOrderPush.setOrderNo(highOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(orderPushObject.getString("code"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap));
highGasOrderPush.setReturnContent(orderPushObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo"));
}
}*/
if (highChildOrder.getGoodsType() == 7) {
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId());
@ -506,13 +470,16 @@ public class HighOrderServiceImpl implements HighOrderService {
updateOrder(highOrder);
new Thread(() -> {
if (highOrder.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
Map<String, Object> message = new HashMap<>();
message.put("order", highOrderService.getOrderByOrderNo(highOrder.getOrderNo()));
message.put("order", highOrderService.getGasOrderDetail(highOrder.getOrderNo()));
message.put("voice", baiduVoiceService.text2audio(highOrder.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + highOrder.getTotalPrice()));
webSocket.SenderMessage(highOrder.getHighChildOrderList().get(0).getGoodsId().toString()
, JSONObject.toJSONString(message));
}
}).start();
}
@Override

Loading…
Cancel
Save