提交代码

dev-discount
胡锐 3 years ago
parent c0407c0a59
commit 7bb560f9b1
  1. 28
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java
  3. 8
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  4. 7
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java

@ -332,8 +332,11 @@ public class HighTyAgentOilStationController {
public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "goodsName", required = false) String goodsName, @RequestParam(name = "goodsName", required = false) String goodsName,
@RequestParam(name = "salesmanName", required = false) String salesmanName, @RequestParam(name = "salesmanName", required = false) String salesmanName,
@RequestParam(name = "salesmanId", required = false) Long salesmanId,
@RequestParam(name = "agentName", required = false) String agentName, @RequestParam(name = "agentName", required = false) String agentName,
@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "orgName", required = false) String orgName, @RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "orgId", required = false) Long orgId,
@RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "payTimeE", required = false) Long payTimeE,
@ -359,17 +362,23 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) {
param.put("companyId", userModel.getBsCompany().getId()); param.put("companyId", userModel.getBsCompany().getId());
param.put("orgName", orgName); param.put("orgName", orgName);
param.put("orgId", orgId);
param.put("agentName", agentName); param.put("agentName", agentName);
param.put("agentId", agentId);
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) { } else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) {
param.put("orgId", userModel.getBsOrganization().getId()); param.put("orgId", userModel.getBsOrganization().getId());
param.put("agentName", agentName); param.put("agentName", agentName);
param.put("agentId", agentId);
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
param.put("agentId", userModel.getHighTyAgent().getId()); param.put("agentId", userModel.getHighTyAgent().getId());
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) {
param.put("salesmanId", userModel.getHighTySalesman().getId()); param.put("salesmanId", userModel.getHighTySalesman().getId());
@ -391,11 +400,14 @@ public class HighTyAgentOilStationController {
public ResponseData excelOrder(@RequestParam(name = "orderNo", required = false) String orderNo, public ResponseData excelOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "goodsName", required = false) String goodsName, @RequestParam(name = "goodsName", required = false) String goodsName,
@RequestParam(name = "salesmanName", required = false) String salesmanName, @RequestParam(name = "salesmanName", required = false) String salesmanName,
@RequestParam(name = "salesmanId", required = false) Long salesmanId,
@RequestParam(name = "agentName", required = false) String agentName,
@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "orgId", required = false) Long orgId,
@RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "payTimeE", required = false) Long payTimeE) {
@RequestParam(name = "agentName", required = false) String agentName,
@RequestParam(name = "orgName", required = false) String orgName) {
try { try {
UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class); UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class);
if (userModel == null) { if (userModel == null) {
@ -416,17 +428,23 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) {
param.put("companyId", userModel.getBsCompany().getId()); param.put("companyId", userModel.getBsCompany().getId());
param.put("orgName", orgName); param.put("orgName", orgName);
param.put("orgId", orgId);
param.put("agentName", agentName); param.put("agentName", agentName);
param.put("agentId", agentId);
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) { } else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) {
param.put("orgId", userModel.getBsOrganization().getId()); param.put("orgId", userModel.getBsOrganization().getId());
param.put("agentName", agentName); param.put("agentName", agentName);
param.put("agentId", agentId);
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
param.put("agentId", userModel.getHighTyAgent().getId()); param.put("agentId", userModel.getHighTyAgent().getId());
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("salesmanId", salesmanId);
} else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) {
param.put("salesmanId", userModel.getHighTySalesman().getId()); param.put("salesmanId", userModel.getHighTySalesman().getId());
@ -442,7 +460,7 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null) { if (userModel.getBsCompany() != null) {
headList.add("代理商"); headList.add("代理商");
} }
if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { if ((userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
headList.add("业务员"); headList.add("业务员");
} }
if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) {
@ -473,7 +491,7 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null) { if (userModel.getBsCompany() != null) {
data.add(orderModel.getAgentName()); data.add(orderModel.getAgentName());
} }
if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { if ((userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
data.add(orderModel.getSalesmanName()); data.add(orderModel.getSalesmanName());
} }
if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) {

@ -124,7 +124,7 @@ public class HighTyAgentPriceController {
// 价格 // 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString()); HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString());
if (priceRate == null) { if (priceRate == null) {
oilPriceMap.put("priceRate", MapUtils.getLong(oilPriceMap, "lowPrice")); oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate());
} else { } else {
oilPriceMap.put("priceRate", priceRate.getPriceRate()); oilPriceMap.put("priceRate", priceRate.getPriceRate());
} }

@ -103,7 +103,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); 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_DOWN)); map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
if (isTyAgent != null && isTyAgent == true) { if (isTyAgent != null && isTyAgent == true) {
@ -115,7 +115,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); 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_DOWN)); map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
} }
} }
@ -164,7 +164,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); 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_DOWN)); price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
if (isTyAgent != null && isTyAgent == true) { if (isTyAgent != null && isTyAgent == true) {
@ -176,7 +176,7 @@ public class HighGasController {
// 优惠比例 / 100 = 最终优惠比例 // 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); 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_DOWN)); price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
} }
} }

@ -256,7 +256,7 @@ public class HighOrderController {
// 平台的价格 // 平台的价格
childOrder.setExt1(childOrder.getGasPriceVip().toString()); childOrder.setExt1(childOrder.getGasPriceVip().toString());
childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_HALF_UP)); childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_DOWN));
// 团油的价格 // 团油的价格
childOrder.setGasPriceGun(priceDetail.getBigDecimal("priceGun")); childOrder.setGasPriceGun(priceDetail.getBigDecimal("priceGun"));
@ -423,11 +423,6 @@ public class HighOrderController {
} }
} }
public static void main(String[] args) {
System.out.println(new BigDecimal("100").divide(new BigDecimal("7.00"),10,BigDecimal.ROUND_DOWN)
.multiply(new BigDecimal("4.2")).setScale(2,BigDecimal.ROUND_HALF_UP));
}
@RequestMapping(value = "/getOrderById", method = RequestMethod.GET) @RequestMapping(value = "/getOrderById", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据id查询订单详情") @ApiOperation(value = "根据id查询订单详情")

Loading…
Cancel
Save