Compare commits

...

4 Commits

  1. 14
      bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java
  2. 2
      bweb/src/main/java/com/bweb/controller/BsGasOrderController.java
  3. 26
      cweb/src/main/java/com/cweb/controller/BsDiscountUserController.java
  4. 35
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  5. 17
      service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java
  6. 14
      service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java
  7. 39
      service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java
  8. 84
      service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java
  9. 36
      service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java
  10. 20
      service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java
  11. 16
      service/src/main/java/com/hfkj/entity/BsAgentPrice.java
  12. 60
      service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java
  13. 96
      service/src/main/java/com/hfkj/entity/BsGasOrder.java
  14. 380
      service/src/main/java/com/hfkj/entity/BsGasOrderExample.java
  15. 23
      service/src/main/java/com/hfkj/model/GasPayPriceModel.java
  16. 4
      service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java
  17. 4
      service/src/main/java/com/hfkj/service/gas/BsGasService.java
  18. 68
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  19. 4
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java
  20. 13
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java

@ -79,7 +79,9 @@ public class BsAgentPriceController {
JSONObject body = (JSONObject)JSONObject.toJSON(obj);
if (StringUtils.isBlank(body.getString("merNo"))
|| StringUtils.isBlank(body.getString("oilNo"))
|| body.getBigDecimal("priceRate") == null) {
|| body.getBigDecimal("priceRate") == null
|| body.getBigDecimal("serviceFeeRate") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
@ -127,8 +129,10 @@ public class BsAgentPriceController {
agentPrice.setOilNoName(oilNo.getName());
agentPrice.setAgentMerId(agentMer!=null?agentMer.getId():null);
agentPrice.setPriceRate(body.getBigDecimal("priceRate"));
agentPrice.setServiceFeeRate(body.getBigDecimal("serviceFeeRate"));
} else {
agentPrice.setPriceRate(body.getBigDecimal("priceRate"));
agentPrice.setServiceFeeRate(body.getBigDecimal("serviceFeeRate"));
}
agentPriceService.editData(agentPrice);
}
@ -155,7 +159,8 @@ public class BsAgentPriceController {
if (body.getJSONArray("merNoList") == null
|| StringUtils.isBlank(body.getString("oilNo"))
|| body.getBigDecimal("priceRate") == null) {
|| body.getBigDecimal("priceRate") == null
|| body.getBigDecimal("serviceFeeRate") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
Integer accountObjectType = userSession.getAccount().getObjectType();
@ -214,8 +219,10 @@ public class BsAgentPriceController {
agentPrice.setOilNoName(oilNo.getName());
agentPrice.setAgentMerId(agentMer!=null?agentMer.getId():null);
agentPrice.setPriceRate(body.getBigDecimal("priceRate"));
agentPrice.setServiceFeeRate(body.getBigDecimal("serviceFeeRate"));
} else {
agentPrice.setPriceRate(body.getBigDecimal("priceRate"));
agentPrice.setServiceFeeRate(body.getBigDecimal("serviceFeeRate"));
}
agentPriceService.editData(agentPrice);
}
@ -269,12 +276,14 @@ public class BsAgentPriceController {
oilPriceMap.put("oilNoName", price.getOilNoName());
oilPriceMap.put("status", price.getStatus());
oilPriceMap.put("priceRate", 100L);
oilPriceMap.put("serviceFeeRate", 0L);
if (accountObjectType.equals(SecUserObjectTypeEnum.type1.getCode())) {
// 价格
BsAgentPrice priceRate = agentPriceService.getDetail(AgentPriceTypeEnum.type1, merchant.getMerNo(), price.getOilNo());
if (priceRate != null) {
oilPriceMap.put("priceRate", priceRate.getPriceRate());
oilPriceMap.put("serviceFeeRate", priceRate.getServiceFeeRate());
}
} else {
if (agentMer != null) {
@ -282,6 +291,7 @@ public class BsAgentPriceController {
BsAgentPrice priceRate = agentPriceService.getDetail(agentMer.getId(), price.getOilNo());
if (priceRate != null) {
oilPriceMap.put("priceRate", priceRate.getPriceRate());
oilPriceMap.put("serviceFeeRate", priceRate.getServiceFeeRate());
}
}
}

@ -305,6 +305,7 @@ public class BsGasOrderController {
model.setTotalDeductionPrice(gasOrder.getTotalDeductionPrice());
model.setDeductionCouponPrice(gasOrder.getDeductionCouponPrice());
model.setDeductionOilPrice(gasOrder.getDeductionOilPrice());
model.setServiceFeePrice(gasOrder.getGasServiceFeePrice());
model.setPayablePrice(gasOrder.getPayablePrice());
model.setPayIntegral(gasOrder.getPayIntegral()==null?new BigDecimal("0"):new BigDecimal(""+gasOrder.getPayIntegral()).divide(new BigDecimal("100")));
model.setPayPrice(gasOrder.getActualPayPrice()!=null?gasOrder.getActualPayPrice().toString():"未支付");
@ -339,6 +340,7 @@ public class BsGasOrderController {
includeColumnFiledNames.add("totalDeductionPrice");
includeColumnFiledNames.add("deductionCouponPrice");
includeColumnFiledNames.add("deductionOilPrice");
includeColumnFiledNames.add("serviceFeePrice");
includeColumnFiledNames.add("payablePrice");
includeColumnFiledNames.add("payIntegral");
includeColumnFiledNames.add("payPrice");

@ -8,14 +8,17 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAgentPrice;
import com.hfkj.entity.BsDiscountUser;
import com.hfkj.model.DiscountUserModel;
import com.hfkj.model.GasListModel;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.agent.BsAgentPriceService;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.service.gas.BsGasService;
import com.hfkj.sysenum.agent.AgentPriceTypeEnum;
import com.hfkj.sysenum.discount.DiscountUserStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -47,11 +50,14 @@ public class BsDiscountUserController {
private UserCenter userCenter;
@Resource
private BsGasService gasService;
@Resource
private BsAgentPriceService agentPriceService;
@RequestMapping(value="/usableMerList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "可用加油站列表")
public ResponseData usableMerList(@RequestParam(name = "discountNo", required = true) String discountNo,
@RequestParam(name = "agentMerId", required = false) Long agentMerId,
@RequestParam(name = "gasName", required = false) String gasName,
@RequestParam(name = "distanceLimit", required = false) Integer distanceLimit,
@RequestParam(name = "oilNo", required = true) String oilNo,
@ -62,7 +68,25 @@ public class BsDiscountUserController {
try {
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasService.getGasListByDiscount(discountNo,longitude, latitude, oilNo, gasName, distanceLimit, true)));
PageInfo<GasListModel> pageInfo = new PageInfo<>(gasService.getGasListByDiscount(discountNo,longitude, latitude, oilNo, gasName, distanceLimit, true));
for (GasListModel gas : pageInfo.getList()) {
BigDecimal discount = new BigDecimal("100");
if (agentMerId != null) {
// 查询代理价格
BsAgentPrice agentPrice = agentPriceService.getDetail(agentMerId, gas.getOilNo());
if (agentPrice != null) {
discount = agentPrice.getPriceRate();
}
} else {
// 查询平台价格
BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, gas.getMerNo(), gas.getOilNo());
if (agentPrice != null) {
discount = agentPrice.getPriceRate();
}
}
gas.setPriceVip(gas.getPriceVip().multiply(discount.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
}
return ResponseMsgUtil.success(pageInfo);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);

@ -101,41 +101,8 @@ public class BsGasController {
@RequestParam(name = "merNo", required = true) String merNo,
@RequestParam(name = "oilNo", required = true) String oilNo) {
try {
BigDecimal discountPrice = new BigDecimal("0");
if (userDiscountId != null) {
// 查询用户优惠券
BsDiscountUser discountUser = discountUserService.getDetail(userDiscountId);
if (discountUser == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户优惠券");
}
if (DiscountTypeEnum.type1.getCode().equals(discountUser.getDiscountType())) {
// 如果订单总额 小于 满减价格
if (refuelPrice.compareTo(discountUser.getDiscountCondition()) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未达到满减金额,无法使用此优惠券");
}
discountPrice = discountUser.getDiscountPrice();
} else if (DiscountTypeEnum.type2.getCode().equals(discountUser.getDiscountType())) {
discountPrice = discountUser.getDiscountPrice();
} else if (DiscountTypeEnum.type3.getCode().equals(discountUser.getDiscountType())) {
// 加油金额 - (加油金额 * 折扣) = 优惠金额
discountPrice = refuelPrice.subtract(
refuelPrice.multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN)
);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
}
}
// 计算价格
GasPayPriceModel gasPayPriceModel = gasService.refuelPriceCompute(refuelPrice, merNo, oilNo, agentMerId, userDiscountId==null);
gasPayPriceModel.setPayPrice(gasPayPriceModel.getPayPrice().subtract(discountPrice));
gasPayPriceModel.setPayPrice(gasPayPriceModel.getPayPrice().compareTo(new BigDecimal("0"))>=0?gasPayPriceModel.getPayPrice():new BigDecimal("0"));
if (userDiscountId != null) {
gasPayPriceModel.setTotalPreferences(discountPrice);
}
return ResponseMsgUtil.success(gasPayPriceModel);
return ResponseMsgUtil.success(gasService.refuelPriceCompute(refuelPrice, merNo, oilNo, agentMerId, userDiscountId));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);

@ -43,16 +43,16 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
"mer_no, mer_name, ",
"agent_mer_id, oil_no_name, ",
"oil_no, price_rate, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"service_fee_rate, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{merId,jdbcType=BIGINT}, ",
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
"#{agentMerId,jdbcType=BIGINT}, #{oilNoName,jdbcType=VARCHAR}, ",
"#{oilNo,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{serviceFeeRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgentPrice record);
@ -72,6 +72,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@Result(column="service_fee_rate", property="serviceFeeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -84,7 +85,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
@Select({
"select",
"id, `type`, mer_id, mer_no, mer_name, agent_mer_id, oil_no_name, oil_no, price_rate, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"service_fee_rate, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_agent_price",
"where id = #{id,jdbcType=BIGINT}"
})
@ -98,6 +99,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@Result(column="service_fee_rate", property="serviceFeeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -126,6 +128,7 @@ public interface BsAgentPriceMapper extends BsAgentPriceMapperExt {
"oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},",
"price_rate = #{priceRate,jdbcType=DECIMAL},",
"service_fee_rate = #{serviceFeeRate,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -60,6 +60,10 @@ public class BsAgentPriceSqlProvider {
sql.VALUES("price_rate", "#{priceRate,jdbcType=DECIMAL}");
}
if (record.getServiceFeeRate() != null) {
sql.VALUES("service_fee_rate", "#{serviceFeeRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -102,6 +106,7 @@ public class BsAgentPriceSqlProvider {
sql.SELECT("oil_no_name");
sql.SELECT("oil_no");
sql.SELECT("price_rate");
sql.SELECT("service_fee_rate");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -161,6 +166,10 @@ public class BsAgentPriceSqlProvider {
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
}
if (record.getServiceFeeRate() != null) {
sql.SET("service_fee_rate = #{record.serviceFeeRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -202,6 +211,7 @@ public class BsAgentPriceSqlProvider {
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
sql.SET("service_fee_rate = #{record.serviceFeeRate,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
@ -250,6 +260,10 @@ public class BsAgentPriceSqlProvider {
sql.SET("price_rate = #{priceRate,jdbcType=DECIMAL}");
}
if (record.getServiceFeeRate() != null) {
sql.SET("service_fee_rate = #{serviceFeeRate,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -50,6 +50,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"deduction_coupon_price, deduction_oil_price, ",
"pay_integral, payable_price, ",
"actual_pay_price, gas_refuel_price, ",
"gas_service_fee_rate, gas_service_fee_price, ",
"gas_oil_no, gas_gun_no, ",
"gas_oil_type, gas_price_official, ",
"gas_price_gun, gas_price_vip, ",
@ -59,9 +60,9 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_price_preferences, gas_class_group_id, ",
"gas_class_group_name, gas_class_group_task_id, ",
"gas_staff_id, gas_staff_name, ",
"receipt_status, receipt_fail_remark, ",
"pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, ",
"receipt_status, receipt_fail_remark, ",
"create_time, cancel_time, ",
"pay_time, refund_time, ",
"refund_remarks, abnormal, ",
@ -79,6 +80,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"#{deductionCouponPrice,jdbcType=DECIMAL}, #{deductionOilPrice,jdbcType=DECIMAL}, ",
"#{payIntegral,jdbcType=BIGINT}, #{payablePrice,jdbcType=DECIMAL}, ",
"#{actualPayPrice,jdbcType=DECIMAL}, #{gasRefuelPrice,jdbcType=DECIMAL}, ",
"#{gasServiceFeeRate,jdbcType=DECIMAL}, #{gasServiceFeePrice,jdbcType=DECIMAL}, ",
"#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ",
"#{gasOilType,jdbcType=INTEGER}, #{gasPriceOfficial,jdbcType=DECIMAL}, ",
"#{gasPriceGun,jdbcType=DECIMAL}, #{gasPriceVip,jdbcType=DECIMAL}, ",
@ -88,9 +90,9 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ",
"#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ",
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ",
"#{receiptStatus,jdbcType=INTEGER}, #{receiptFailRemark,jdbcType=VARCHAR}, ",
"#{payType,jdbcType=INTEGER}, #{paySerialNo,jdbcType=VARCHAR}, ",
"#{payChannelOrderNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{receiptStatus,jdbcType=INTEGER}, #{receiptFailRemark,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
"#{refundRemarks,jdbcType=VARCHAR}, #{abnormal,jdbcType=BIT}, ",
@ -131,6 +133,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="actual_pay_price", property="actualPayPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_service_fee_rate", property="gasServiceFeeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_service_fee_price", property="gasServiceFeePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_oil_type", property="gasOilType", jdbcType=JdbcType.INTEGER),
@ -149,12 +153,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -177,13 +181,14 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"agent_staff_id, agent_staff_name, user_id, user_phone, mer_chain_brand_id, mer_chain_brand_name, ",
"mer_id, mer_no, mer_name, mer_address, total_deduction_price, deduction_coupon_price, ",
"deduction_oil_price, pay_integral, payable_price, actual_pay_price, gas_refuel_price, ",
"gas_oil_no, gas_gun_no, gas_oil_type, gas_price_official, gas_price_gun, gas_price_vip, ",
"gas_price_platform, gas_price_cost, gas_oil_liters, gas_discount, gas_oil_subsidy, ",
"gas_liters_preferences, gas_price_preferences, gas_class_group_id, gas_class_group_name, ",
"gas_class_group_task_id, gas_staff_id, gas_staff_name, pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, receipt_status, receipt_fail_remark, create_time, ",
"cancel_time, pay_time, refund_time, refund_remarks, abnormal, abnormal_content, ",
"ext_1, ext_2, ext_3, ext_4, ext_5, ext_6",
"gas_service_fee_rate, gas_service_fee_price, gas_oil_no, gas_gun_no, gas_oil_type, ",
"gas_price_official, gas_price_gun, gas_price_vip, gas_price_platform, gas_price_cost, ",
"gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, gas_price_preferences, ",
"gas_class_group_id, gas_class_group_name, gas_class_group_task_id, gas_staff_id, ",
"gas_staff_name, receipt_status, receipt_fail_remark, pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, create_time, cancel_time, pay_time, refund_time, ",
"refund_remarks, abnormal, abnormal_content, ext_1, ext_2, ext_3, ext_4, ext_5, ",
"ext_6",
"from bs_gas_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -212,6 +217,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="actual_pay_price", property="actualPayPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_service_fee_rate", property="gasServiceFeeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_service_fee_price", property="gasServiceFeePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_oil_type", property="gasOilType", jdbcType=JdbcType.INTEGER),
@ -230,12 +237,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -286,6 +293,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"payable_price = #{payablePrice,jdbcType=DECIMAL},",
"actual_pay_price = #{actualPayPrice,jdbcType=DECIMAL},",
"gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL},",
"gas_service_fee_rate = #{gasServiceFeeRate,jdbcType=DECIMAL},",
"gas_service_fee_price = #{gasServiceFeePrice,jdbcType=DECIMAL},",
"gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},",
"gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},",
"gas_oil_type = #{gasOilType,jdbcType=INTEGER},",
@ -304,12 +313,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_class_group_task_id = #{gasClassGroupTaskId,jdbcType=BIGINT},",
"gas_staff_id = #{gasStaffId,jdbcType=BIGINT},",
"gas_staff_name = #{gasStaffName,jdbcType=VARCHAR},",
"receipt_status = #{receiptStatus,jdbcType=INTEGER},",
"receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR},",
"pay_type = #{payType,jdbcType=INTEGER},",
"pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
"pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"receipt_status = #{receiptStatus,jdbcType=INTEGER},",
"receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"cancel_time = #{cancelTime,jdbcType=TIMESTAMP},",
"pay_time = #{payTime,jdbcType=TIMESTAMP},",

@ -120,6 +120,14 @@ public class BsGasOrderSqlProvider {
sql.VALUES("gas_refuel_price", "#{gasRefuelPrice,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeeRate() != null) {
sql.VALUES("gas_service_fee_rate", "#{gasServiceFeeRate,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeePrice() != null) {
sql.VALUES("gas_service_fee_price", "#{gasServiceFeePrice,jdbcType=DECIMAL}");
}
if (record.getGasOilNo() != null) {
sql.VALUES("gas_oil_no", "#{gasOilNo,jdbcType=VARCHAR}");
}
@ -192,6 +200,14 @@ public class BsGasOrderSqlProvider {
sql.VALUES("gas_staff_name", "#{gasStaffName,jdbcType=VARCHAR}");
}
if (record.getReceiptStatus() != null) {
sql.VALUES("receipt_status", "#{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.VALUES("receipt_fail_remark", "#{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) {
sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}");
}
@ -208,14 +224,6 @@ public class BsGasOrderSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.VALUES("receipt_status", "#{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.VALUES("receipt_fail_remark", "#{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -301,6 +309,8 @@ public class BsGasOrderSqlProvider {
sql.SELECT("payable_price");
sql.SELECT("actual_pay_price");
sql.SELECT("gas_refuel_price");
sql.SELECT("gas_service_fee_rate");
sql.SELECT("gas_service_fee_price");
sql.SELECT("gas_oil_no");
sql.SELECT("gas_gun_no");
sql.SELECT("gas_oil_type");
@ -319,12 +329,12 @@ public class BsGasOrderSqlProvider {
sql.SELECT("gas_class_group_task_id");
sql.SELECT("gas_staff_id");
sql.SELECT("gas_staff_name");
sql.SELECT("receipt_status");
sql.SELECT("receipt_fail_remark");
sql.SELECT("pay_type");
sql.SELECT("pay_serial_no");
sql.SELECT("pay_channel_order_no");
sql.SELECT("`status`");
sql.SELECT("receipt_status");
sql.SELECT("receipt_fail_remark");
sql.SELECT("create_time");
sql.SELECT("cancel_time");
sql.SELECT("pay_time");
@ -451,6 +461,14 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeeRate() != null) {
sql.SET("gas_service_fee_rate = #{record.gasServiceFeeRate,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeePrice() != null) {
sql.SET("gas_service_fee_price = #{record.gasServiceFeePrice,jdbcType=DECIMAL}");
}
if (record.getGasOilNo() != null) {
sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}");
}
@ -523,6 +541,14 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) {
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}");
}
@ -539,14 +565,6 @@ public class BsGasOrderSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -631,6 +649,8 @@ public class BsGasOrderSqlProvider {
sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}");
sql.SET("actual_pay_price = #{record.actualPayPrice,jdbcType=DECIMAL}");
sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}");
sql.SET("gas_service_fee_rate = #{record.gasServiceFeeRate,jdbcType=DECIMAL}");
sql.SET("gas_service_fee_price = #{record.gasServiceFeePrice,jdbcType=DECIMAL}");
sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}");
sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}");
sql.SET("gas_oil_type = #{record.gasOilType,jdbcType=INTEGER}");
@ -649,12 +669,12 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_class_group_task_id = #{record.gasClassGroupTaskId,jdbcType=BIGINT}");
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}");
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}");
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}");
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}");
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}");
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
@ -770,6 +790,14 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeeRate() != null) {
sql.SET("gas_service_fee_rate = #{gasServiceFeeRate,jdbcType=DECIMAL}");
}
if (record.getGasServiceFeePrice() != null) {
sql.SET("gas_service_fee_price = #{gasServiceFeePrice,jdbcType=DECIMAL}");
}
if (record.getGasOilNo() != null) {
sql.SET("gas_oil_no = #{gasOilNo,jdbcType=VARCHAR}");
}
@ -842,6 +870,14 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_staff_name = #{gasStaffName,jdbcType=VARCHAR}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) {
sql.SET("pay_type = #{payType,jdbcType=INTEGER}");
}
@ -858,14 +894,6 @@ public class BsGasOrderSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -262,7 +262,31 @@ public class PrinterTemplate {
divLine3.put("type", "div_star");
contents.add(divLine3);
// 加油金额标题
// 加油金额
JSONObject refuelPrice = new JSONObject();
refuelPrice.put("cont", "加油金额:" + gasOrder.getGasRefuelPrice()+"元");
refuelPrice.put("type", "text");
contents.add(refuelPrice);
// 优惠金额
JSONObject discountPrice = new JSONObject();
discountPrice.put("cont", "优惠金额:" + gasOrder.getTotalDeductionPrice()+"元");
discountPrice.put("type", "text");
contents.add(discountPrice);
// 分割线
JSONObject divLine4 = new JSONObject();
divLine4.put("cont", "");
divLine4.put("type", "div_star");
contents.add(divLine4);
// 实际支付
JSONObject actualPayment = new JSONObject();
actualPayment.put("cont", "实际支付:" + gasOrder.getActualPayPrice()+"元");
actualPayment.put("type", "text");
contents.add(actualPayment);
/* // 加油金额标题
JSONObject refuelPriceTitle = new JSONObject();
refuelPriceTitle.put("cont", "加油金额");
refuelPriceTitle.put("type", "text");
@ -273,13 +297,13 @@ public class PrinterTemplate {
refuelPrice.put("cont", "¥" + gasOrder.getGasRefuelPrice() + "元");
refuelPrice.put("type", "text");
refuelPrice.put("size", "11");
contents.add(refuelPrice);
contents.add(refuelPrice);*/
// 分割线
JSONObject divLine4 = new JSONObject();
divLine4.put("cont", "");
divLine4.put("type", "div_star");
contents.add(divLine4);
JSONObject divLine5 = new JSONObject();
divLine5.put("cont", "");
divLine5.put("type", "div_star");
contents.add(divLine5);
// 小票底部
JSONObject receiptBottom = new JSONObject();

@ -66,6 +66,8 @@ public class SpPrinterTemplate {
String oilNo,
String oilLiters,
String orderPrice,
String discountPrice,
String actualPayment,
Map<String, Object> receiptMap,
boolean makeUp) {
@ -84,8 +86,12 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"加油金额:"+ orderPrice + "元<BR>" +
"优惠金额:" + discountPrice + "元<BR>" +
"------------------------------<BR>" +
"实际支付:" + actualPayment +"元<BR>" +
/* "<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +*/
"------------------------------<BR>" +
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>";
return str;
@ -112,6 +118,8 @@ public class SpPrinterTemplate {
String oilNo,
String oilLiters,
String orderPrice,
String discountPrice,
String actualPayment,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
String str = "<C><L1>" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨加油") + "</L1></C> <BR> " +
@ -129,8 +137,12 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"加油金额:"+ orderPrice + "元<BR>" +
"优惠金额:" + discountPrice + "元<BR>" +
"------------------------------<BR>" +
"实际支付:" + actualPayment +"元<BR>" +
/* "<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +*/
"------------------------------<BR>" +
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>";
return str;

@ -56,6 +56,11 @@ public class BsAgentPrice implements Serializable {
*/
private BigDecimal priceRate;
/**
* 服务费比例
*/
private BigDecimal serviceFeeRate;
/**
* 状态 0删除 1正常
*/
@ -151,6 +156,14 @@ public class BsAgentPrice implements Serializable {
this.priceRate = priceRate;
}
public BigDecimal getServiceFeeRate() {
return serviceFeeRate;
}
public void setServiceFeeRate(BigDecimal serviceFeeRate) {
this.serviceFeeRate = serviceFeeRate;
}
public Integer getStatus() {
return status;
}
@ -220,6 +233,7 @@ public class BsAgentPrice implements Serializable {
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
&& (this.getPriceRate() == null ? other.getPriceRate() == null : this.getPriceRate().equals(other.getPriceRate()))
&& (this.getServiceFeeRate() == null ? other.getServiceFeeRate() == null : this.getServiceFeeRate().equals(other.getServiceFeeRate()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
@ -241,6 +255,7 @@ public class BsAgentPrice implements Serializable {
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
result = prime * result + ((getPriceRate() == null) ? 0 : getPriceRate().hashCode());
result = prime * result + ((getServiceFeeRate() == null) ? 0 : getServiceFeeRate().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
@ -265,6 +280,7 @@ public class BsAgentPrice implements Serializable {
sb.append(", oilNoName=").append(oilNoName);
sb.append(", oilNo=").append(oilNo);
sb.append(", priceRate=").append(priceRate);
sb.append(", serviceFeeRate=").append(serviceFeeRate);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -706,6 +706,66 @@ public class BsAgentPriceExample {
return (Criteria) this;
}
public Criteria andServiceFeeRateIsNull() {
addCriterion("service_fee_rate is null");
return (Criteria) this;
}
public Criteria andServiceFeeRateIsNotNull() {
addCriterion("service_fee_rate is not null");
return (Criteria) this;
}
public Criteria andServiceFeeRateEqualTo(BigDecimal value) {
addCriterion("service_fee_rate =", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateNotEqualTo(BigDecimal value) {
addCriterion("service_fee_rate <>", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateGreaterThan(BigDecimal value) {
addCriterion("service_fee_rate >", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("service_fee_rate >=", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateLessThan(BigDecimal value) {
addCriterion("service_fee_rate <", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateLessThanOrEqualTo(BigDecimal value) {
addCriterion("service_fee_rate <=", value, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateIn(List<BigDecimal> values) {
addCriterion("service_fee_rate in", values, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateNotIn(List<BigDecimal> values) {
addCriterion("service_fee_rate not in", values, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("service_fee_rate between", value1, value2, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andServiceFeeRateNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("service_fee_rate not between", value1, value2, "serviceFeeRate");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -134,6 +134,16 @@ public class BsGasOrder implements Serializable {
*/
private BigDecimal gasRefuelPrice;
/**
* 加油站加油服务费比例
*/
private BigDecimal gasServiceFeeRate;
/**
* 加油站加油服务费金额
*/
private BigDecimal gasServiceFeePrice;
/**
* 加油站油号
*/
@ -224,6 +234,16 @@ public class BsGasOrder implements Serializable {
*/
private String gasStaffName;
/**
* 收据状态0未开票 1处理中 2开票成功 3开票失败
*/
private Integer receiptStatus;
/**
* 开票失败备注
*/
private String receiptFailRemark;
/**
* 支付方式 1支付宝 2微信 3云闪付
*/
@ -250,16 +270,6 @@ public class BsGasOrder implements Serializable {
*/
private Integer status;
/**
* 收据状态0未开票 1处理中 2开票成功 3开票失败
*/
private Integer receiptStatus;
/**
* 开票失败备注
*/
private String receiptFailRemark;
/**
* 创建时间
*/
@ -501,6 +511,22 @@ public class BsGasOrder implements Serializable {
this.gasRefuelPrice = gasRefuelPrice;
}
public BigDecimal getGasServiceFeeRate() {
return gasServiceFeeRate;
}
public void setGasServiceFeeRate(BigDecimal gasServiceFeeRate) {
this.gasServiceFeeRate = gasServiceFeeRate;
}
public BigDecimal getGasServiceFeePrice() {
return gasServiceFeePrice;
}
public void setGasServiceFeePrice(BigDecimal gasServiceFeePrice) {
this.gasServiceFeePrice = gasServiceFeePrice;
}
public String getGasOilNo() {
return gasOilNo;
}
@ -645,6 +671,22 @@ public class BsGasOrder implements Serializable {
this.gasStaffName = gasStaffName;
}
public Integer getReceiptStatus() {
return receiptStatus;
}
public void setReceiptStatus(Integer receiptStatus) {
this.receiptStatus = receiptStatus;
}
public String getReceiptFailRemark() {
return receiptFailRemark;
}
public void setReceiptFailRemark(String receiptFailRemark) {
this.receiptFailRemark = receiptFailRemark;
}
public Integer getPayType() {
return payType;
}
@ -677,22 +719,6 @@ public class BsGasOrder implements Serializable {
this.status = status;
}
public Integer getReceiptStatus() {
return receiptStatus;
}
public void setReceiptStatus(Integer receiptStatus) {
this.receiptStatus = receiptStatus;
}
public String getReceiptFailRemark() {
return receiptFailRemark;
}
public void setReceiptFailRemark(String receiptFailRemark) {
this.receiptFailRemark = receiptFailRemark;
}
public Date getCreateTime() {
return createTime;
}
@ -833,6 +859,8 @@ public class BsGasOrder implements Serializable {
&& (this.getPayablePrice() == null ? other.getPayablePrice() == null : this.getPayablePrice().equals(other.getPayablePrice()))
&& (this.getActualPayPrice() == null ? other.getActualPayPrice() == null : this.getActualPayPrice().equals(other.getActualPayPrice()))
&& (this.getGasRefuelPrice() == null ? other.getGasRefuelPrice() == null : this.getGasRefuelPrice().equals(other.getGasRefuelPrice()))
&& (this.getGasServiceFeeRate() == null ? other.getGasServiceFeeRate() == null : this.getGasServiceFeeRate().equals(other.getGasServiceFeeRate()))
&& (this.getGasServiceFeePrice() == null ? other.getGasServiceFeePrice() == null : this.getGasServiceFeePrice().equals(other.getGasServiceFeePrice()))
&& (this.getGasOilNo() == null ? other.getGasOilNo() == null : this.getGasOilNo().equals(other.getGasOilNo()))
&& (this.getGasGunNo() == null ? other.getGasGunNo() == null : this.getGasGunNo().equals(other.getGasGunNo()))
&& (this.getGasOilType() == null ? other.getGasOilType() == null : this.getGasOilType().equals(other.getGasOilType()))
@ -851,12 +879,12 @@ public class BsGasOrder implements Serializable {
&& (this.getGasClassGroupTaskId() == null ? other.getGasClassGroupTaskId() == null : this.getGasClassGroupTaskId().equals(other.getGasClassGroupTaskId()))
&& (this.getGasStaffId() == null ? other.getGasStaffId() == null : this.getGasStaffId().equals(other.getGasStaffId()))
&& (this.getGasStaffName() == null ? other.getGasStaffName() == null : this.getGasStaffName().equals(other.getGasStaffName()))
&& (this.getReceiptStatus() == null ? other.getReceiptStatus() == null : this.getReceiptStatus().equals(other.getReceiptStatus()))
&& (this.getReceiptFailRemark() == null ? other.getReceiptFailRemark() == null : this.getReceiptFailRemark().equals(other.getReceiptFailRemark()))
&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()))
&& (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo()))
&& (this.getPayChannelOrderNo() == null ? other.getPayChannelOrderNo() == null : this.getPayChannelOrderNo().equals(other.getPayChannelOrderNo()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getReceiptStatus() == null ? other.getReceiptStatus() == null : this.getReceiptStatus().equals(other.getReceiptStatus()))
&& (this.getReceiptFailRemark() == null ? other.getReceiptFailRemark() == null : this.getReceiptFailRemark().equals(other.getReceiptFailRemark()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime()))
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
@ -900,6 +928,8 @@ public class BsGasOrder implements Serializable {
result = prime * result + ((getPayablePrice() == null) ? 0 : getPayablePrice().hashCode());
result = prime * result + ((getActualPayPrice() == null) ? 0 : getActualPayPrice().hashCode());
result = prime * result + ((getGasRefuelPrice() == null) ? 0 : getGasRefuelPrice().hashCode());
result = prime * result + ((getGasServiceFeeRate() == null) ? 0 : getGasServiceFeeRate().hashCode());
result = prime * result + ((getGasServiceFeePrice() == null) ? 0 : getGasServiceFeePrice().hashCode());
result = prime * result + ((getGasOilNo() == null) ? 0 : getGasOilNo().hashCode());
result = prime * result + ((getGasGunNo() == null) ? 0 : getGasGunNo().hashCode());
result = prime * result + ((getGasOilType() == null) ? 0 : getGasOilType().hashCode());
@ -918,12 +948,12 @@ public class BsGasOrder implements Serializable {
result = prime * result + ((getGasClassGroupTaskId() == null) ? 0 : getGasClassGroupTaskId().hashCode());
result = prime * result + ((getGasStaffId() == null) ? 0 : getGasStaffId().hashCode());
result = prime * result + ((getGasStaffName() == null) ? 0 : getGasStaffName().hashCode());
result = prime * result + ((getReceiptStatus() == null) ? 0 : getReceiptStatus().hashCode());
result = prime * result + ((getReceiptFailRemark() == null) ? 0 : getReceiptFailRemark().hashCode());
result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode());
result = prime * result + ((getPayChannelOrderNo() == null) ? 0 : getPayChannelOrderNo().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getReceiptStatus() == null) ? 0 : getReceiptStatus().hashCode());
result = prime * result + ((getReceiptFailRemark() == null) ? 0 : getReceiptFailRemark().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode());
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
@ -970,6 +1000,8 @@ public class BsGasOrder implements Serializable {
sb.append(", payablePrice=").append(payablePrice);
sb.append(", actualPayPrice=").append(actualPayPrice);
sb.append(", gasRefuelPrice=").append(gasRefuelPrice);
sb.append(", gasServiceFeeRate=").append(gasServiceFeeRate);
sb.append(", gasServiceFeePrice=").append(gasServiceFeePrice);
sb.append(", gasOilNo=").append(gasOilNo);
sb.append(", gasGunNo=").append(gasGunNo);
sb.append(", gasOilType=").append(gasOilType);
@ -988,12 +1020,12 @@ public class BsGasOrder implements Serializable {
sb.append(", gasClassGroupTaskId=").append(gasClassGroupTaskId);
sb.append(", gasStaffId=").append(gasStaffId);
sb.append(", gasStaffName=").append(gasStaffName);
sb.append(", receiptStatus=").append(receiptStatus);
sb.append(", receiptFailRemark=").append(receiptFailRemark);
sb.append(", payType=").append(payType);
sb.append(", paySerialNo=").append(paySerialNo);
sb.append(", payChannelOrderNo=").append(payChannelOrderNo);
sb.append(", status=").append(status);
sb.append(", receiptStatus=").append(receiptStatus);
sb.append(", receiptFailRemark=").append(receiptFailRemark);
sb.append(", createTime=").append(createTime);
sb.append(", cancelTime=").append(cancelTime);
sb.append(", payTime=").append(payTime);

@ -1666,6 +1666,126 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andGasServiceFeeRateIsNull() {
addCriterion("gas_service_fee_rate is null");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateIsNotNull() {
addCriterion("gas_service_fee_rate is not null");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_rate =", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateNotEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_rate <>", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateGreaterThan(BigDecimal value) {
addCriterion("gas_service_fee_rate >", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_rate >=", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateLessThan(BigDecimal value) {
addCriterion("gas_service_fee_rate <", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateLessThanOrEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_rate <=", value, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateIn(List<BigDecimal> values) {
addCriterion("gas_service_fee_rate in", values, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateNotIn(List<BigDecimal> values) {
addCriterion("gas_service_fee_rate not in", values, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_service_fee_rate between", value1, value2, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeeRateNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_service_fee_rate not between", value1, value2, "gasServiceFeeRate");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceIsNull() {
addCriterion("gas_service_fee_price is null");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceIsNotNull() {
addCriterion("gas_service_fee_price is not null");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_price =", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceNotEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_price <>", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceGreaterThan(BigDecimal value) {
addCriterion("gas_service_fee_price >", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_price >=", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceLessThan(BigDecimal value) {
addCriterion("gas_service_fee_price <", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("gas_service_fee_price <=", value, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceIn(List<BigDecimal> values) {
addCriterion("gas_service_fee_price in", values, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceNotIn(List<BigDecimal> values) {
addCriterion("gas_service_fee_price not in", values, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_service_fee_price between", value1, value2, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasServiceFeePriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_service_fee_price not between", value1, value2, "gasServiceFeePrice");
return (Criteria) this;
}
public Criteria andGasOilNoIsNull() {
addCriterion("gas_oil_no is null");
return (Criteria) this;
@ -2786,6 +2906,136 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andReceiptStatusIsNull() {
addCriterion("receipt_status is null");
return (Criteria) this;
}
public Criteria andReceiptStatusIsNotNull() {
addCriterion("receipt_status is not null");
return (Criteria) this;
}
public Criteria andReceiptStatusEqualTo(Integer value) {
addCriterion("receipt_status =", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotEqualTo(Integer value) {
addCriterion("receipt_status <>", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThan(Integer value) {
addCriterion("receipt_status >", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("receipt_status >=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThan(Integer value) {
addCriterion("receipt_status <", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThanOrEqualTo(Integer value) {
addCriterion("receipt_status <=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusIn(List<Integer> values) {
addCriterion("receipt_status in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotIn(List<Integer> values) {
addCriterion("receipt_status not in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusBetween(Integer value1, Integer value2) {
addCriterion("receipt_status between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotBetween(Integer value1, Integer value2) {
addCriterion("receipt_status not between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNull() {
addCriterion("receipt_fail_remark is null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNotNull() {
addCriterion("receipt_fail_remark is not null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkEqualTo(String value) {
addCriterion("receipt_fail_remark =", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotEqualTo(String value) {
addCriterion("receipt_fail_remark <>", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThan(String value) {
addCriterion("receipt_fail_remark >", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark >=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThan(String value) {
addCriterion("receipt_fail_remark <", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark <=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLike(String value) {
addCriterion("receipt_fail_remark like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotLike(String value) {
addCriterion("receipt_fail_remark not like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIn(List<String> values) {
addCriterion("receipt_fail_remark in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotIn(List<String> values) {
addCriterion("receipt_fail_remark not in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkBetween(String value1, String value2) {
addCriterion("receipt_fail_remark between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotBetween(String value1, String value2) {
addCriterion("receipt_fail_remark not between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andPayTypeIsNull() {
addCriterion("pay_type is null");
return (Criteria) this;
@ -3046,136 +3296,6 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andReceiptStatusIsNull() {
addCriterion("receipt_status is null");
return (Criteria) this;
}
public Criteria andReceiptStatusIsNotNull() {
addCriterion("receipt_status is not null");
return (Criteria) this;
}
public Criteria andReceiptStatusEqualTo(Integer value) {
addCriterion("receipt_status =", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotEqualTo(Integer value) {
addCriterion("receipt_status <>", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThan(Integer value) {
addCriterion("receipt_status >", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("receipt_status >=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThan(Integer value) {
addCriterion("receipt_status <", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThanOrEqualTo(Integer value) {
addCriterion("receipt_status <=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusIn(List<Integer> values) {
addCriterion("receipt_status in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotIn(List<Integer> values) {
addCriterion("receipt_status not in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusBetween(Integer value1, Integer value2) {
addCriterion("receipt_status between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotBetween(Integer value1, Integer value2) {
addCriterion("receipt_status not between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNull() {
addCriterion("receipt_fail_remark is null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNotNull() {
addCriterion("receipt_fail_remark is not null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkEqualTo(String value) {
addCriterion("receipt_fail_remark =", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotEqualTo(String value) {
addCriterion("receipt_fail_remark <>", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThan(String value) {
addCriterion("receipt_fail_remark >", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark >=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThan(String value) {
addCriterion("receipt_fail_remark <", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark <=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLike(String value) {
addCriterion("receipt_fail_remark like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotLike(String value) {
addCriterion("receipt_fail_remark not like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIn(List<String> values) {
addCriterion("receipt_fail_remark in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotIn(List<String> values) {
addCriterion("receipt_fail_remark not in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkBetween(String value1, String value2) {
addCriterion("receipt_fail_remark between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotBetween(String value1, String value2) {
addCriterion("receipt_fail_remark not between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -73,6 +73,26 @@ public class GasPayPriceModel {
*/
private BigDecimal pricePreferences;
/**
* 优惠券优惠
*/
private BigDecimal deductionCouponPrice;
/**
* 加油优惠
*/
private BigDecimal deductionOilPrice;
/**
* 服务费比例
*/
private BigDecimal serviceFeeRate;
/**
* 服务费金额
*/
private BigDecimal serviceFeePrice;
/**
* 本次优惠
*/
@ -83,7 +103,4 @@ public class GasPayPriceModel {
*/
private BigDecimal payPrice;
private List<BsDiscountUser> discountList;
}

@ -92,6 +92,10 @@ public class ExportGasOrderModel {
@ExcelProperty({ "支付信息", "加油优惠"})
private BigDecimal deductionOilPrice;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "服务费"})
private BigDecimal serviceFeePrice;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "应付金额"})
private BigDecimal payablePrice;

@ -33,11 +33,11 @@ public interface BsGasService {
* @param merNo
* @param oilNo
* @param agentMerId 代理商商户id
* @param enjoyDiscount 享受优惠
* @param userDiscountId 用户优惠券id
* @return
* @throws Exception
*/
GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId, Boolean enjoyDiscount) ;
GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId, Long userDiscountId) ;
/**
* 查询油站信息

@ -6,6 +6,7 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsMerchantMapper;
import com.hfkj.entity.BsAgentPrice;
import com.hfkj.entity.BsDiscountUser;
import com.hfkj.entity.BsGasOilPrice;
import com.hfkj.entity.BsMerchant;
import com.hfkj.model.GasListModel;
@ -13,11 +14,13 @@ import com.hfkj.model.GasModel;
import com.hfkj.model.GasOilPriceModel;
import com.hfkj.model.GasPayPriceModel;
import com.hfkj.service.agent.BsAgentPriceService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.gas.BsGasService;
import com.hfkj.service.merchant.BsMerchantService;
import com.hfkj.sysenum.agent.AgentPriceTypeEnum;
import com.hfkj.sysenum.discount.DiscountTypeEnum;
import com.hfkj.sysenum.gas.GasOilPriceStatusEnum;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -45,6 +48,8 @@ public class BsGasServiceImpl implements BsGasService {
@Resource
private BsAgentPriceService agentPriceService;
@Resource
private BsDiscountUserService discountUserService;
@Resource
private RedisUtil redisUtil;
private final static String CACHE_GAS_KEY = "GAS:";
@ -59,30 +64,65 @@ public class BsGasServiceImpl implements BsGasService {
}
@Override
public GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId, Boolean enjoyDiscount) {
public GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Long agentMerId, Long userDiscountId) {
// 查询油站信息
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
GasPayPriceModel payPriceModel = new GasPayPriceModel();
payPriceModel.setDeductionCouponPrice(new BigDecimal("0"));
// 优惠比例
BigDecimal discount = new BigDecimal("100");
BigDecimal serviceFeeRate = new BigDecimal("0");
// 是否享受优惠
if (enjoyDiscount.equals(true)) {
// 没有使用优惠券,可以享受油价优惠
if (userDiscountId == null) {
if (agentMerId != null) {
// 查询代理价格
BsAgentPrice agentPrice = agentPriceService.getDetail(agentMerId, oilNo);
if (agentPrice != null) {
discount = agentPrice.getPriceRate();
serviceFeeRate = agentPrice.getServiceFeeRate();
}
} else {
// 查询平台价格
BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, merNo, oilNo);
if (agentPrice != null) {
discount = agentPrice.getPriceRate();
serviceFeeRate = agentPrice.getServiceFeeRate();
}
}
} else {
// 查询用户优惠券
BsDiscountUser discountUser = discountUserService.getDetail(userDiscountId);
if (discountUser == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户优惠券");
}
// 查询平台服务费
BsAgentPrice agentPrice = agentPriceService.getDetail(AgentPriceTypeEnum.type1, merNo, oilNo);
if (agentPrice != null) {
serviceFeeRate = agentPrice.getServiceFeeRate();
}
if (DiscountTypeEnum.type1.getCode().equals(discountUser.getDiscountType())) {
// 如果订单总额 小于 满减价格
if (refuelPrice.compareTo(discountUser.getDiscountCondition()) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未达到满减金额,无法使用此优惠券");
}
payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice());
} else if (DiscountTypeEnum.type2.getCode().equals(discountUser.getDiscountType())) {
payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice());
} else if (DiscountTypeEnum.type3.getCode().equals(discountUser.getDiscountType())) {
// 加油金额 - (加油金额 * 折扣) = 优惠金额
payPriceModel.setDeductionCouponPrice(refuelPrice.subtract(
refuelPrice.multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN)
));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
}
}
discount = discount.divide(new BigDecimal("100"));
@ -99,9 +139,7 @@ public class BsGasServiceImpl implements BsGasService {
// 油站直降
BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop();
// 油站优惠价
BigDecimal priceVip = enjoyDiscount?gasOilPrice.getPriceVip():priceGun;
GasPayPriceModel payPriceModel = new GasPayPriceModel();
BigDecimal priceVip = userDiscountId==null?gasOilPrice.getPriceVip():priceGun;
// 嗨森逛平台价 油站优惠价 * 折扣
BigDecimal pricePlatform = priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
@ -142,8 +180,22 @@ public class BsGasServiceImpl implements BsGasService {
// 每升优惠 国标价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceGun().subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP));
// 加油优惠
payPriceModel.setDeductionOilPrice(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP));
// 服务费费率
payPriceModel.setServiceFeeRate(serviceFeeRate);
// 总优惠 = 优惠券 + 加油优惠
BigDecimal totalPreferences = payPriceModel.getDeductionCouponPrice().add(payPriceModel.getDeductionOilPrice());
// 服务费金额【总优惠 * 服务费费率】
//payPriceModel.setServiceFeePrice(totalPreferences.multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
// 服务费金额【加油金额 * 服务费费率】
payPriceModel.setServiceFeePrice(payPriceModel.getOilingPrice().multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
// 本次优惠 总优惠 - 服务费
payPriceModel.setTotalPreferences(totalPreferences.subtract(payPriceModel.getServiceFeePrice()));
// 支付价格 加油金额 - 本次优惠
payPriceModel.setPayPrice(refuelPrice.subtract(payPriceModel.getTotalPreferences()));

@ -109,6 +109,8 @@ public class BsDeviceServiceImpl implements BsDeviceService {
gasOrder.getGasOilNo(),
gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(),
gasOrder.getTotalDeductionPrice().toString(),
gasOrder.getActualPayPrice().toString(),
receiptMap,
makeUp
), 1);
@ -127,6 +129,8 @@ public class BsDeviceServiceImpl implements BsDeviceService {
gasOrder.getGasOilNo(),
gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(),
gasOrder.getTotalDeductionPrice().toString(),
gasOrder.getActualPayPrice().toString(),
receiptMap,
makeUp
), 1);

@ -137,12 +137,15 @@ public class OrderCreateService {
}
// 计算价格
GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(), orderChild.getAgentMerId(),(orderDeduction.getUserCouponDiscountId() == null));
GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(), orderChild.getAgentMerId(),orderDeduction.getUserCouponDiscountId());
gasOrder.setDeductionCouponPrice(orderDeduction.getCouponDiscountActualPrice());
gasOrder.setDeductionOilPrice(priceModel.getTotalPreferences());
gasOrder.setTotalDeductionPrice(gasOrder.getDeductionOilPrice().add(gasOrder.getDeductionCouponPrice()));
gasOrder.setPayablePrice(priceModel.getOilingPrice().subtract(gasOrder.getTotalDeductionPrice()));
gasOrder.setDeductionCouponPrice(priceModel.getDeductionCouponPrice());
gasOrder.setDeductionOilPrice(priceModel.getDeductionOilPrice());
gasOrder.setGasServiceFeeRate(priceModel.getServiceFeeRate());
gasOrder.setGasServiceFeePrice(priceModel.getServiceFeePrice());
gasOrder.setTotalDeductionPrice(priceModel.getTotalPreferences());
gasOrder.setPayablePrice(priceModel.getPayPrice());
gasOrder.setPayablePrice(gasOrder.getPayablePrice().compareTo(new BigDecimal("0"))>=0?gasOrder.getPayablePrice():new BigDecimal("0"));
// 油价信息

Loading…
Cancel
Save