提交代码

dev-discount
胡锐 3 years ago
parent a3b2753589
commit 3920c7e322
  1. 66
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 9
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  4. 6
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  5. 6
      hai-service/src/main/resources/prod/commonConfig.properties

@ -101,14 +101,14 @@ public class HighGasController {
PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {
map.put("price_gun", MapUtils.getString(map, "price_vip"));
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no"));
@ -116,7 +116,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
@ -127,7 +127,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
}
@ -212,6 +212,7 @@ public class HighGasController {
if (oilNo != null && !oilNo.getStatus().equals(GasOilPriceStatusEnum.status1.getStatus())) {
continue;
}
price.put("priceGun", price.getString("priceVip"));
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), price.getString("oilNo"));
@ -219,7 +220,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNo(price.getString("oilNo"));
@ -227,7 +228,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
@ -238,7 +239,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
newOilPriceList.add(price);
@ -317,55 +318,4 @@ public class HighGasController {
}
}
@RequestMapping(value="/refuelingOrderPush",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "手动推送订单")
public ResponseData refuelingOrderPush() {
try {
// {"app_key":"208241666939552","gunNo":"1","refuelingAmount":"1.02","thirdSerialNo":"HF2021062716143174807","sign":"83c7e8f70b984a04b937b28b8652aded","driverPhone":"15583658692","gasId":"CS000116587","priceVip":"7.31","oilNo":"90","timestamp":1624781755439,"priceGun":"7.31"}"
Map<String,Object> map = new HashMap<>();
map.put("gasId", "CS000116587");
map.put("oilNo", "92");
map.put("gunNo", 2);
BigDecimal priceGun = new BigDecimal("7.50");
BigDecimal priceVip = new BigDecimal("7.50");
// BigDecimal priceGun = new BigDecimal("5.58");
// BigDecimal priceVip = new BigDecimal("5.40");
map.put("priceGun", priceGun); // 枪单价
map.put("priceVip", priceVip); // 优惠价
map.put("driverPhone", "18581170527");
map.put("thirdSerialNo", "HF2021063009483541009");
BigDecimal refuelingAmount = new BigDecimal("1").divide(priceGun,10,BigDecimal.ROUND_DOWN).multiply(priceVip).setScale(2,BigDecimal.ROUND_HALF_UP);
map.put("refuelingAmount", refuelingAmount);
/*JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(map);
if (orderPushObject == null || !orderPushObject.getString("code").equals("200")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交订单,出现了未知错误");
}
JSONObject result = orderPushObject.getJSONObject("result");*/
//return ResponseMsgUtil.success(TuanYouConfig.refuelingOrderPush(map));
JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(map);
// 推送团油订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type1.getType());
highGasOrderPush.setOrderNo(MapUtils.getString(map, "thirdSerialNo"));
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(orderPushObject.getString("code"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(map));
highGasOrderPush.setReturnContent(orderPushObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
return ResponseMsgUtil.success(orderPushObject.getJSONObject("result").getString("orderNo"));
}
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("HighGasController -> refuelingOrderPush() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

File diff suppressed because one or more lines are too long

@ -260,9 +260,11 @@ public class WechatController {
// 根据手机号查询用户
HighUser user = highUserService.findByPhone(body.getString("phone"));
// 获取手机号验证码
String phoneSmsCode = (String) redisUtil.get("SMS_"+ body.getString("phone"));
// 验证码校验
if (body.getString("smsCode").equals("982693")) {
// 定义个人所有数据
if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,body.getString("smsCode"))) {
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
@ -270,9 +272,6 @@ public class WechatController {
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
}

@ -52,6 +52,6 @@ CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7
unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586

@ -53,6 +53,6 @@ CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7
unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586

Loading…
Cancel
Save