提交代码

master
胡锐 2 months ago
parent e69ae7415e
commit 31615080a6
  1. 14
      bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java
  2. 35
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  3. 17
      service/src/main/java/com/hfkj/dao/BsAgentPriceMapper.java
  4. 14
      service/src/main/java/com/hfkj/dao/BsAgentPriceSqlProvider.java
  5. 39
      service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java
  6. 84
      service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java
  7. 16
      service/src/main/java/com/hfkj/entity/BsAgentPrice.java
  8. 60
      service/src/main/java/com/hfkj/entity/BsAgentPriceExample.java
  9. 96
      service/src/main/java/com/hfkj/entity/BsGasOrder.java
  10. 380
      service/src/main/java/com/hfkj/entity/BsGasOrderExample.java
  11. 23
      service/src/main/java/com/hfkj/model/GasPayPriceModel.java
  12. 4
      service/src/main/java/com/hfkj/service/gas/BsGasService.java
  13. 65
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  14. 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());
}
}
}

@ -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}");
}

@ -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;
}

@ -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,10 +180,19 @@ 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.setServiceFeeRate(serviceFeeRate);
// 服务费金额
payPriceModel.setServiceFeePrice(payPriceModel.getOilingPrice().multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
// 加油优惠
payPriceModel.setDeductionOilPrice(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP));
// 本次优惠 优惠卷 + 加油优惠 - 服务费
payPriceModel.setTotalPreferences(payPriceModel.getDeductionCouponPrice().add(payPriceModel.getDeductionOilPrice()).subtract(payPriceModel.getServiceFeePrice()));
// 支付价格 加油金额 - 本次优惠
// 支付价格 加油金额 - 本次优惠 + 服务费
payPriceModel.setPayPrice(refuelPrice.subtract(payPriceModel.getTotalPreferences()));
return payPriceModel;

@ -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