提交代码

dev-discount
胡锐 2 years ago
parent 99386e32cb
commit 70ce2b2526
  1. 2
      hai-order/src/main/java/com/web/controller/business/OrderOilController.java
  2. 124
      hai-service/src/main/java/com/hai/dao/HighGasOrderMapper.java
  3. 58
      hai-service/src/main/java/com/hai/dao/HighGasOrderSqlProvider.java
  4. 9
      hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java
  5. 66
      hai-service/src/main/java/com/hai/entity/HighGasOrder.java
  6. 238
      hai-service/src/main/java/com/hai/entity/HighGasOrderExample.java
  7. 19
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  8. 1
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  9. 56
      hai-user/src/main/java/com/web/config/AuthConfig.java
  10. 75
      hai-user/src/main/java/com/web/controller/CoresController.java

@ -293,7 +293,7 @@ public class OrderOilController {
model.setGasPricePlatform(gasOrder.getGasPricePlatform()); model.setGasPricePlatform(gasOrder.getGasPricePlatform());
model.setGasPriceGun(gasOrder.getGasPriceGun()); model.setGasPriceGun(gasOrder.getGasPriceGun());
model.setGasPriceOfficial(gasOrder.getGasPriceOfficial()); model.setGasPriceOfficial(gasOrder.getGasPriceOfficial());
model.setDeductionPrice(gasOrder.getDeductionPrice()); model.setDeductionPrice(gasOrder.getTotalDeductionPrice());
model.setPayablePrice(gasOrder.getPayablePrice()); model.setPayablePrice(gasOrder.getPayablePrice());
model.setPayGold(gasOrder.getPayGold()); model.setPayGold(gasOrder.getPayGold());
model.setPayPrice(gasOrder.getPayPrice()!=null?gasOrder.getPayPrice().toString():"未支付"); model.setPayPrice(gasOrder.getPayPrice()!=null?gasOrder.getPayPrice().toString():"未支付");

@ -44,55 +44,57 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt {
"mem_id, mem_phone, ", "mem_id, mem_phone, ",
"company_id, company_name, ", "company_id, company_name, ",
"mer_id, mer_name, store_id, ", "mer_id, mer_name, store_id, ",
"store_name, deduction_price, ", "store_name, store_address, ",
"payable_price, pay_gold, ", "total_deduction_price, deduction_coupon_price, ",
"pay_price, gas_refuel_price, ", "deduction_product_price, payable_price, ",
"gas_oil_no, gas_gun_no, ", "pay_gold, pay_price, ",
"gas_oil_type, gas_price_platform, ", "gas_refuel_price, gas_oil_no, ",
"gas_price_gun, gas_price_vip, ", "gas_gun_no, gas_oil_type, ",
"gas_price_official, gas_price_cost, ", "gas_price_platform, gas_price_gun, ",
"gas_price_cost_total, gas_price_channel_pay, ", "gas_price_vip, gas_price_official, ",
"gas_oil_liters, gas_discount, ", "gas_price_cost, gas_price_cost_total, ",
"gas_oil_subsidy, gas_liters_preferences, ", "gas_price_channel_pay, gas_oil_liters, ",
"gas_price_preferences, gas_class_group_id, ", "gas_discount, gas_oil_subsidy, ",
"gas_class_group_name, gas_class_group_task_id, ", "gas_liters_preferences, gas_price_preferences, ",
"gas_staff_id, gas_staff_name, ", "gas_class_group_id, gas_class_group_name, ",
"gas_salesman_id, gas_salesman_name, ", "gas_class_group_task_id, gas_staff_id, ",
"gas_agent_id, gas_agent_name, ", "gas_staff_name, gas_salesman_id, ",
"gas_org_id, gas_org_name, ", "gas_salesman_name, gas_agent_id, ",
"pay_type, `status`, ", "gas_agent_name, gas_org_id, ",
"create_time, cancel_time, ", "gas_org_name, pay_type, ",
"pay_time, refund_time, ", "`status`, create_time, ",
"refund_remarks, ext_1, ", "cancel_time, pay_time, ",
"ext_2, ext_3, ext_4, ", "refund_time, refund_remarks, ",
"ext_5, ext_6)", "ext_1, ext_2, ext_3, ",
"ext_4, ext_5, ext_6)",
"values (#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ", "values (#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ",
"#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ", "#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ",
"#{memId,jdbcType=BIGINT}, #{memPhone,jdbcType=VARCHAR}, ", "#{memId,jdbcType=BIGINT}, #{memPhone,jdbcType=VARCHAR}, ",
"#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", "#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ", "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
"#{storeName,jdbcType=VARCHAR}, #{deductionPrice,jdbcType=DECIMAL}, ", "#{storeName,jdbcType=VARCHAR}, #{storeAddress,jdbcType=VARCHAR}, ",
"#{payablePrice,jdbcType=DECIMAL}, #{payGold,jdbcType=INTEGER}, ", "#{totalDeductionPrice,jdbcType=DECIMAL}, #{deductionCouponPrice,jdbcType=DECIMAL}, ",
"#{payPrice,jdbcType=DECIMAL}, #{gasRefuelPrice,jdbcType=DECIMAL}, ", "#{deductionProductPrice,jdbcType=DECIMAL}, #{payablePrice,jdbcType=DECIMAL}, ",
"#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ", "#{payGold,jdbcType=INTEGER}, #{payPrice,jdbcType=DECIMAL}, ",
"#{gasOilType,jdbcType=INTEGER}, #{gasPricePlatform,jdbcType=DECIMAL}, ", "#{gasRefuelPrice,jdbcType=DECIMAL}, #{gasOilNo,jdbcType=VARCHAR}, ",
"#{gasPriceGun,jdbcType=DECIMAL}, #{gasPriceVip,jdbcType=DECIMAL}, ", "#{gasGunNo,jdbcType=VARCHAR}, #{gasOilType,jdbcType=INTEGER}, ",
"#{gasPriceOfficial,jdbcType=DECIMAL}, #{gasPriceCost,jdbcType=DECIMAL}, ", "#{gasPricePlatform,jdbcType=DECIMAL}, #{gasPriceGun,jdbcType=DECIMAL}, ",
"#{gasPriceCostTotal,jdbcType=DECIMAL}, #{gasPriceChannelPay,jdbcType=DECIMAL}, ", "#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ",
"#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ", "#{gasPriceCost,jdbcType=DECIMAL}, #{gasPriceCostTotal,jdbcType=DECIMAL}, ",
"#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ", "#{gasPriceChannelPay,jdbcType=DECIMAL}, #{gasOilLiters,jdbcType=DECIMAL}, ",
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ", "#{gasDiscount,jdbcType=DECIMAL}, #{gasOilSubsidy,jdbcType=DECIMAL}, ",
"#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ", "#{gasLitersPreferences,jdbcType=DECIMAL}, #{gasPricePreferences,jdbcType=DECIMAL}, ",
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ", "#{gasClassGroupId,jdbcType=BIGINT}, #{gasClassGroupName,jdbcType=VARCHAR}, ",
"#{gasSalesmanId,jdbcType=BIGINT}, #{gasSalesmanName,jdbcType=VARCHAR}, ", "#{gasClassGroupTaskId,jdbcType=BIGINT}, #{gasStaffId,jdbcType=BIGINT}, ",
"#{gasAgentId,jdbcType=BIGINT}, #{gasAgentName,jdbcType=VARCHAR}, ", "#{gasStaffName,jdbcType=VARCHAR}, #{gasSalesmanId,jdbcType=BIGINT}, ",
"#{gasOrgId,jdbcType=BIGINT}, #{gasOrgName,jdbcType=VARCHAR}, ", "#{gasSalesmanName,jdbcType=VARCHAR}, #{gasAgentId,jdbcType=BIGINT}, ",
"#{payType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", "#{gasAgentName,jdbcType=VARCHAR}, #{gasOrgId,jdbcType=BIGINT}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", "#{gasOrgName,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{refundRemarks,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{refundRemarks,jdbcType=VARCHAR}, ",
"#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasOrder record); int insert(HighGasOrder record);
@ -116,7 +118,10 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt {
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
@Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), @Result(column="store_address", property="storeAddress", jdbcType=JdbcType.VARCHAR),
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="deduction_coupon_price", property="deductionCouponPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="deduction_product_price", property="deductionProductPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), @Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@ -166,15 +171,16 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt {
@Select({ @Select({
"select", "select",
"id, order_no, child_order_no, channel_type, channel_order_no, mem_id, mem_phone, ", "id, order_no, child_order_no, channel_type, channel_order_no, mem_id, mem_phone, ",
"company_id, company_name, mer_id, mer_name, store_id, store_name, deduction_price, ", "company_id, company_name, mer_id, mer_name, store_id, store_name, store_address, ",
"payable_price, pay_gold, pay_price, gas_refuel_price, gas_oil_no, gas_gun_no, ", "total_deduction_price, deduction_coupon_price, deduction_product_price, payable_price, ",
"gas_oil_type, gas_price_platform, gas_price_gun, gas_price_vip, gas_price_official, ", "pay_gold, pay_price, gas_refuel_price, gas_oil_no, gas_gun_no, gas_oil_type, ",
"gas_price_cost, gas_price_cost_total, gas_price_channel_pay, gas_oil_liters, ", "gas_price_platform, gas_price_gun, gas_price_vip, gas_price_official, gas_price_cost, ",
"gas_discount, gas_oil_subsidy, gas_liters_preferences, gas_price_preferences, ", "gas_price_cost_total, gas_price_channel_pay, gas_oil_liters, gas_discount, gas_oil_subsidy, ",
"gas_class_group_id, gas_class_group_name, gas_class_group_task_id, gas_staff_id, ", "gas_liters_preferences, gas_price_preferences, gas_class_group_id, gas_class_group_name, ",
"gas_staff_name, gas_salesman_id, gas_salesman_name, gas_agent_id, gas_agent_name, ", "gas_class_group_task_id, gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, ",
"gas_org_id, gas_org_name, pay_type, `status`, create_time, cancel_time, pay_time, ", "gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, pay_type, `status`, ",
"refund_time, refund_remarks, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", "create_time, cancel_time, pay_time, refund_time, refund_remarks, ext_1, ext_2, ",
"ext_3, ext_4, ext_5, ext_6",
"from high_gas_order", "from high_gas_order",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -192,7 +198,10 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt {
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
@Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), @Result(column="store_address", property="storeAddress", jdbcType=JdbcType.VARCHAR),
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="deduction_coupon_price", property="deductionCouponPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="deduction_product_price", property="deductionProductPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), @Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@ -262,7 +271,10 @@ public interface HighGasOrderMapper extends HighGasOrderMapperExt {
"mer_name = #{merName,jdbcType=VARCHAR},", "mer_name = #{merName,jdbcType=VARCHAR},",
"store_id = #{storeId,jdbcType=BIGINT},", "store_id = #{storeId,jdbcType=BIGINT},",
"store_name = #{storeName,jdbcType=VARCHAR},", "store_name = #{storeName,jdbcType=VARCHAR},",
"deduction_price = #{deductionPrice,jdbcType=DECIMAL},", "store_address = #{storeAddress,jdbcType=VARCHAR},",
"total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},",
"deduction_coupon_price = #{deductionCouponPrice,jdbcType=DECIMAL},",
"deduction_product_price = #{deductionProductPrice,jdbcType=DECIMAL},",
"payable_price = #{payablePrice,jdbcType=DECIMAL},", "payable_price = #{payablePrice,jdbcType=DECIMAL},",
"pay_gold = #{payGold,jdbcType=INTEGER},", "pay_gold = #{payGold,jdbcType=INTEGER},",
"pay_price = #{payPrice,jdbcType=DECIMAL},", "pay_price = #{payPrice,jdbcType=DECIMAL},",

@ -76,8 +76,20 @@ public class HighGasOrderSqlProvider {
sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}"); sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}");
} }
if (record.getDeductionPrice() != null) { if (record.getStoreAddress() != null) {
sql.VALUES("deduction_price", "#{deductionPrice,jdbcType=DECIMAL}"); sql.VALUES("store_address", "#{storeAddress,jdbcType=VARCHAR}");
}
if (record.getTotalDeductionPrice() != null) {
sql.VALUES("total_deduction_price", "#{totalDeductionPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionCouponPrice() != null) {
sql.VALUES("deduction_coupon_price", "#{deductionCouponPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionProductPrice() != null) {
sql.VALUES("deduction_product_price", "#{deductionProductPrice,jdbcType=DECIMAL}");
} }
if (record.getPayablePrice() != null) { if (record.getPayablePrice() != null) {
@ -274,7 +286,10 @@ public class HighGasOrderSqlProvider {
sql.SELECT("mer_name"); sql.SELECT("mer_name");
sql.SELECT("store_id"); sql.SELECT("store_id");
sql.SELECT("store_name"); sql.SELECT("store_name");
sql.SELECT("deduction_price"); sql.SELECT("store_address");
sql.SELECT("total_deduction_price");
sql.SELECT("deduction_coupon_price");
sql.SELECT("deduction_product_price");
sql.SELECT("payable_price"); sql.SELECT("payable_price");
sql.SELECT("pay_gold"); sql.SELECT("pay_gold");
sql.SELECT("pay_price"); sql.SELECT("pay_price");
@ -387,8 +402,20 @@ public class HighGasOrderSqlProvider {
sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}");
} }
if (record.getDeductionPrice() != null) { if (record.getStoreAddress() != null) {
sql.SET("deduction_price = #{record.deductionPrice,jdbcType=DECIMAL}"); sql.SET("store_address = #{record.storeAddress,jdbcType=VARCHAR}");
}
if (record.getTotalDeductionPrice() != null) {
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionCouponPrice() != null) {
sql.SET("deduction_coupon_price = #{record.deductionCouponPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionProductPrice() != null) {
sql.SET("deduction_product_price = #{record.deductionProductPrice,jdbcType=DECIMAL}");
} }
if (record.getPayablePrice() != null) { if (record.getPayablePrice() != null) {
@ -584,7 +611,10 @@ public class HighGasOrderSqlProvider {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}");
sql.SET("deduction_price = #{record.deductionPrice,jdbcType=DECIMAL}"); sql.SET("store_address = #{record.storeAddress,jdbcType=VARCHAR}");
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}");
sql.SET("deduction_coupon_price = #{record.deductionCouponPrice,jdbcType=DECIMAL}");
sql.SET("deduction_product_price = #{record.deductionProductPrice,jdbcType=DECIMAL}");
sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}"); sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}");
sql.SET("pay_gold = #{record.payGold,jdbcType=INTEGER}"); sql.SET("pay_gold = #{record.payGold,jdbcType=INTEGER}");
sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
@ -686,8 +716,20 @@ public class HighGasOrderSqlProvider {
sql.SET("store_name = #{storeName,jdbcType=VARCHAR}"); sql.SET("store_name = #{storeName,jdbcType=VARCHAR}");
} }
if (record.getDeductionPrice() != null) { if (record.getStoreAddress() != null) {
sql.SET("deduction_price = #{deductionPrice,jdbcType=DECIMAL}"); sql.SET("store_address = #{storeAddress,jdbcType=VARCHAR}");
}
if (record.getTotalDeductionPrice() != null) {
sql.SET("total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionCouponPrice() != null) {
sql.SET("deduction_coupon_price = #{deductionCouponPrice,jdbcType=DECIMAL}");
}
if (record.getDeductionProductPrice() != null) {
sql.SET("deduction_product_price = #{deductionProductPrice,jdbcType=DECIMAL}");
} }
if (record.getPayablePrice() != null) { if (record.getPayablePrice() != null) {

@ -14,12 +14,9 @@ public interface HighMerchantAccountMapperExt {
@Select({"select " + @Select({"select " +
" case when sum(a.gas_price_cost_total) is not null then sum(a.gas_price_cost_total) ELSE 0 end " + " case when sum(gas_price_cost) is not null then sum(gas_price_cost) ELSE 0 end " +
" from high_child_order a, high_order b" + " from high_gas_order " +
" where goods_type = 3 " + " where store_id in (SELECT id from high_merchant_store where merchant_id = #{merId}) and `status` in (2,5,6)"})
" and a.order_id = b.id" +
" and goods_id in (SELECT id from high_merchant_store where merchant_id = #{merId}) " +
" and b.order_status in (2,3,6,7)"})
BigDecimal countMerGasOilAmount(@Param("merId") Long merId); BigDecimal countMerGasOilAmount(@Param("merId") Long merId);
@Select({ @Select({

@ -80,9 +80,24 @@ public class HighGasOrder implements Serializable {
private String storeName; private String storeName;
/** /**
* 优惠金额 * 门店地址
*/ */
private BigDecimal deductionPrice; private String storeAddress;
/**
* 交易总优惠金额优惠券优惠金额+产品优惠金额
*/
private BigDecimal totalDeductionPrice;
/**
* 优惠券优惠金额
*/
private BigDecimal deductionCouponPrice;
/**
* 产品优惠金额
*/
private BigDecimal deductionProductPrice;
/** /**
* 应付金额 * 应付金额
@ -393,12 +408,36 @@ public class HighGasOrder implements Serializable {
this.storeName = storeName; this.storeName = storeName;
} }
public BigDecimal getDeductionPrice() { public String getStoreAddress() {
return deductionPrice; return storeAddress;
}
public void setStoreAddress(String storeAddress) {
this.storeAddress = storeAddress;
}
public BigDecimal getTotalDeductionPrice() {
return totalDeductionPrice;
}
public void setTotalDeductionPrice(BigDecimal totalDeductionPrice) {
this.totalDeductionPrice = totalDeductionPrice;
}
public BigDecimal getDeductionCouponPrice() {
return deductionCouponPrice;
}
public void setDeductionCouponPrice(BigDecimal deductionCouponPrice) {
this.deductionCouponPrice = deductionCouponPrice;
}
public BigDecimal getDeductionProductPrice() {
return deductionProductPrice;
} }
public void setDeductionPrice(BigDecimal deductionPrice) { public void setDeductionProductPrice(BigDecimal deductionProductPrice) {
this.deductionPrice = deductionPrice; this.deductionProductPrice = deductionProductPrice;
} }
public BigDecimal getPayablePrice() { public BigDecimal getPayablePrice() {
@ -770,7 +809,10 @@ public class HighGasOrder implements Serializable {
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
&& (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName())) && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
&& (this.getDeductionPrice() == null ? other.getDeductionPrice() == null : this.getDeductionPrice().equals(other.getDeductionPrice())) && (this.getStoreAddress() == null ? other.getStoreAddress() == null : this.getStoreAddress().equals(other.getStoreAddress()))
&& (this.getTotalDeductionPrice() == null ? other.getTotalDeductionPrice() == null : this.getTotalDeductionPrice().equals(other.getTotalDeductionPrice()))
&& (this.getDeductionCouponPrice() == null ? other.getDeductionCouponPrice() == null : this.getDeductionCouponPrice().equals(other.getDeductionCouponPrice()))
&& (this.getDeductionProductPrice() == null ? other.getDeductionProductPrice() == null : this.getDeductionProductPrice().equals(other.getDeductionProductPrice()))
&& (this.getPayablePrice() == null ? other.getPayablePrice() == null : this.getPayablePrice().equals(other.getPayablePrice())) && (this.getPayablePrice() == null ? other.getPayablePrice() == null : this.getPayablePrice().equals(other.getPayablePrice()))
&& (this.getPayGold() == null ? other.getPayGold() == null : this.getPayGold().equals(other.getPayGold())) && (this.getPayGold() == null ? other.getPayGold() == null : this.getPayGold().equals(other.getPayGold()))
&& (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice()))
@ -833,7 +875,10 @@ public class HighGasOrder implements Serializable {
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode()); result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
result = prime * result + ((getDeductionPrice() == null) ? 0 : getDeductionPrice().hashCode()); result = prime * result + ((getStoreAddress() == null) ? 0 : getStoreAddress().hashCode());
result = prime * result + ((getTotalDeductionPrice() == null) ? 0 : getTotalDeductionPrice().hashCode());
result = prime * result + ((getDeductionCouponPrice() == null) ? 0 : getDeductionCouponPrice().hashCode());
result = prime * result + ((getDeductionProductPrice() == null) ? 0 : getDeductionProductPrice().hashCode());
result = prime * result + ((getPayablePrice() == null) ? 0 : getPayablePrice().hashCode()); result = prime * result + ((getPayablePrice() == null) ? 0 : getPayablePrice().hashCode());
result = prime * result + ((getPayGold() == null) ? 0 : getPayGold().hashCode()); result = prime * result + ((getPayGold() == null) ? 0 : getPayGold().hashCode());
result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode());
@ -899,7 +944,10 @@ public class HighGasOrder implements Serializable {
sb.append(", merName=").append(merName); sb.append(", merName=").append(merName);
sb.append(", storeId=").append(storeId); sb.append(", storeId=").append(storeId);
sb.append(", storeName=").append(storeName); sb.append(", storeName=").append(storeName);
sb.append(", deductionPrice=").append(deductionPrice); sb.append(", storeAddress=").append(storeAddress);
sb.append(", totalDeductionPrice=").append(totalDeductionPrice);
sb.append(", deductionCouponPrice=").append(deductionCouponPrice);
sb.append(", deductionProductPrice=").append(deductionProductPrice);
sb.append(", payablePrice=").append(payablePrice); sb.append(", payablePrice=").append(payablePrice);
sb.append(", payGold=").append(payGold); sb.append(", payGold=").append(payGold);
sb.append(", payPrice=").append(payPrice); sb.append(", payPrice=").append(payPrice);

@ -976,63 +976,253 @@ public class HighGasOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceIsNull() { public Criteria andStoreAddressIsNull() {
addCriterion("deduction_price is null"); addCriterion("store_address is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceIsNotNull() { public Criteria andStoreAddressIsNotNull() {
addCriterion("deduction_price is not null"); addCriterion("store_address is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceEqualTo(BigDecimal value) { public Criteria andStoreAddressEqualTo(String value) {
addCriterion("deduction_price =", value, "deductionPrice"); addCriterion("store_address =", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceNotEqualTo(BigDecimal value) { public Criteria andStoreAddressNotEqualTo(String value) {
addCriterion("deduction_price <>", value, "deductionPrice"); addCriterion("store_address <>", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceGreaterThan(BigDecimal value) { public Criteria andStoreAddressGreaterThan(String value) {
addCriterion("deduction_price >", value, "deductionPrice"); addCriterion("store_address >", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceGreaterThanOrEqualTo(BigDecimal value) { public Criteria andStoreAddressGreaterThanOrEqualTo(String value) {
addCriterion("deduction_price >=", value, "deductionPrice"); addCriterion("store_address >=", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceLessThan(BigDecimal value) { public Criteria andStoreAddressLessThan(String value) {
addCriterion("deduction_price <", value, "deductionPrice"); addCriterion("store_address <", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceLessThanOrEqualTo(BigDecimal value) { public Criteria andStoreAddressLessThanOrEqualTo(String value) {
addCriterion("deduction_price <=", value, "deductionPrice"); addCriterion("store_address <=", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceIn(List<BigDecimal> values) { public Criteria andStoreAddressLike(String value) {
addCriterion("deduction_price in", values, "deductionPrice"); addCriterion("store_address like", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceNotIn(List<BigDecimal> values) { public Criteria andStoreAddressNotLike(String value) {
addCriterion("deduction_price not in", values, "deductionPrice"); addCriterion("store_address not like", value, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceBetween(BigDecimal value1, BigDecimal value2) { public Criteria andStoreAddressIn(List<String> values) {
addCriterion("deduction_price between", value1, value2, "deductionPrice"); addCriterion("store_address in", values, "storeAddress");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDeductionPriceNotBetween(BigDecimal value1, BigDecimal value2) { public Criteria andStoreAddressNotIn(List<String> values) {
addCriterion("deduction_price not between", value1, value2, "deductionPrice"); addCriterion("store_address not in", values, "storeAddress");
return (Criteria) this;
}
public Criteria andStoreAddressBetween(String value1, String value2) {
addCriterion("store_address between", value1, value2, "storeAddress");
return (Criteria) this;
}
public Criteria andStoreAddressNotBetween(String value1, String value2) {
addCriterion("store_address not between", value1, value2, "storeAddress");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceIsNull() {
addCriterion("total_deduction_price is null");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceIsNotNull() {
addCriterion("total_deduction_price is not null");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceEqualTo(BigDecimal value) {
addCriterion("total_deduction_price =", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceNotEqualTo(BigDecimal value) {
addCriterion("total_deduction_price <>", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceGreaterThan(BigDecimal value) {
addCriterion("total_deduction_price >", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("total_deduction_price >=", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceLessThan(BigDecimal value) {
addCriterion("total_deduction_price <", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("total_deduction_price <=", value, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceIn(List<BigDecimal> values) {
addCriterion("total_deduction_price in", values, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceNotIn(List<BigDecimal> values) {
addCriterion("total_deduction_price not in", values, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("total_deduction_price between", value1, value2, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andTotalDeductionPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("total_deduction_price not between", value1, value2, "totalDeductionPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceIsNull() {
addCriterion("deduction_coupon_price is null");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceIsNotNull() {
addCriterion("deduction_coupon_price is not null");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceEqualTo(BigDecimal value) {
addCriterion("deduction_coupon_price =", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceNotEqualTo(BigDecimal value) {
addCriterion("deduction_coupon_price <>", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceGreaterThan(BigDecimal value) {
addCriterion("deduction_coupon_price >", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("deduction_coupon_price >=", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceLessThan(BigDecimal value) {
addCriterion("deduction_coupon_price <", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("deduction_coupon_price <=", value, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceIn(List<BigDecimal> values) {
addCriterion("deduction_coupon_price in", values, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceNotIn(List<BigDecimal> values) {
addCriterion("deduction_coupon_price not in", values, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("deduction_coupon_price between", value1, value2, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionCouponPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("deduction_coupon_price not between", value1, value2, "deductionCouponPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceIsNull() {
addCriterion("deduction_product_price is null");
return (Criteria) this;
}
public Criteria andDeductionProductPriceIsNotNull() {
addCriterion("deduction_product_price is not null");
return (Criteria) this;
}
public Criteria andDeductionProductPriceEqualTo(BigDecimal value) {
addCriterion("deduction_product_price =", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceNotEqualTo(BigDecimal value) {
addCriterion("deduction_product_price <>", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceGreaterThan(BigDecimal value) {
addCriterion("deduction_product_price >", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("deduction_product_price >=", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceLessThan(BigDecimal value) {
addCriterion("deduction_product_price <", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("deduction_product_price <=", value, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceIn(List<BigDecimal> values) {
addCriterion("deduction_product_price in", values, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceNotIn(List<BigDecimal> values) {
addCriterion("deduction_product_price not in", values, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("deduction_product_price between", value1, value2, "deductionProductPrice");
return (Criteria) this;
}
public Criteria andDeductionProductPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("deduction_product_price not between", value1, value2, "deductionProductPrice");
return (Criteria) this; return (Criteria) this;
} }

@ -338,12 +338,16 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
gasOrder.setMerName(merchant.getMerchantName()); gasOrder.setMerName(merchant.getMerchantName());
gasOrder.setStoreId(store.getId()); gasOrder.setStoreId(store.getId());
gasOrder.setStoreName(store.getStoreName()); gasOrder.setStoreName(store.getStoreName());
gasOrder.setStoreAddress(store.getAddress());
gasOrder.setGasRefuelPrice(childOrder.getGoodsPrice()); gasOrder.setGasRefuelPrice(childOrder.getGoodsPrice());
gasOrder.setGasOilNo(createOrderChild.getGasOilNo()); gasOrder.setGasOilNo(createOrderChild.getGasOilNo());
gasOrder.setGasGunNo(createOrderChild.getGasGunNo()); gasOrder.setGasGunNo(createOrderChild.getGasGunNo());
gasOrder.setGasOilType(Integer.parseInt(gasOilType.getExt1())); gasOrder.setGasOilType(Integer.parseInt(gasOilType.getExt1()));
gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber()); gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber());
gasOrder.setGasDiscount(new BigDecimal("0")); gasOrder.setGasDiscount(new BigDecimal("0"));
gasOrder.setTotalDeductionPrice(new BigDecimal("0"));
gasOrder.setDeductionCouponPrice(new BigDecimal("0"));
gasOrder.setDeductionProductPrice(new BigDecimal("0"));
// 成本价 油站价 减 营销策略价 // 成本价 油站价 减 营销策略价
gasOrder.setGasPriceCost(priceModel.getPriceGun().subtract(marketingPrice)); gasOrder.setGasPriceCost(priceModel.getPriceGun().subtract(marketingPrice));
@ -364,20 +368,20 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
if (gasOrder.getGasRefuelPrice().compareTo(discountUserRel.getHighDiscount().getDiscountCondition()) > 1) { if (gasOrder.getGasRefuelPrice().compareTo(discountUserRel.getHighDiscount().getDiscountCondition()) > 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+discountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券"); throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+discountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券");
} }
gasOrder.setDeductionPrice(discountUserRel.getHighDiscount().getDiscountPrice()); gasOrder.setDeductionCouponPrice(discountUserRel.getHighDiscount().getDiscountPrice());
} }
else if (discountUserRel.getHighDiscount().getDiscountType() == 2) { else if (discountUserRel.getHighDiscount().getDiscountType() == 2) {
gasOrder.setDeductionPrice(discountUserRel.getHighDiscount().getDiscountPrice()); gasOrder.setDeductionCouponPrice(discountUserRel.getHighDiscount().getDiscountPrice());
} }
else if (discountUserRel.getHighDiscount().getDiscountType() == 3) { else if (discountUserRel.getHighDiscount().getDiscountType() == 3) {
// 加油金额 * 折扣 // 加油金额 * 折扣
BigDecimal deductionPrice = gasOrder.getGasRefuelPrice() BigDecimal deductionPrice = gasOrder.getGasRefuelPrice()
.multiply(discountUserRel.getHighDiscount().getDiscountPrice()) .multiply(discountUserRel.getHighDiscount().getDiscountPrice())
.setScale(2, BigDecimal.ROUND_HALF_DOWN); .setScale(2, BigDecimal.ROUND_HALF_DOWN);
gasOrder.setDeductionPrice(gasOrder.getGasRefuelPrice().subtract(deductionPrice)); gasOrder.setDeductionCouponPrice(gasOrder.getGasRefuelPrice().subtract(deductionPrice));
} }
gasOrder.setPayablePrice(gasOrder.getGasRefuelPrice().subtract(gasOrder.getDeductionPrice())); gasOrder.setPayablePrice(gasOrder.getGasRefuelPrice().subtract(gasOrder.getTotalDeductionPrice()));
if (gasOrder.getPayablePrice().compareTo(new BigDecimal("0")) < 0) { if (gasOrder.getPayablePrice().compareTo(new BigDecimal("0")) < 0) {
gasOrder.setPayablePrice(new BigDecimal("0")); gasOrder.setPayablePrice(new BigDecimal("0"));
} }
@ -392,11 +396,10 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
gasOrder.setGasOilSubsidy(new BigDecimal("0")); gasOrder.setGasOilSubsidy(new BigDecimal("0"));
gasOrder.setGasLitersPreferences(new BigDecimal("0")); gasOrder.setGasLitersPreferences(new BigDecimal("0"));
gasOrder.setGasPricePreferences(priceModel.getPriceGun()); gasOrder.setGasPricePreferences(priceModel.getPriceGun());
} } else {
else {
// 支付价格 // 支付价格
childOrder.setGoodsActualPrice(priceModel.getPayPrice()); childOrder.setGoodsActualPrice(priceModel.getPayPrice());
gasOrder.setDeductionPrice(priceModel.getTotalPreferences()); gasOrder.setDeductionCouponPrice(priceModel.getTotalPreferences());
gasOrder.setPayablePrice(priceModel.getPayPrice()); gasOrder.setPayablePrice(priceModel.getPayPrice());
// 油价信息 // 油价信息
@ -410,7 +413,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
gasOrder.setGasLitersPreferences(priceModel.getLitersPreferences()); gasOrder.setGasLitersPreferences(priceModel.getLitersPreferences());
gasOrder.setGasPricePreferences(priceModel.getPricePreferences()); gasOrder.setGasPricePreferences(priceModel.getPricePreferences());
} }
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
gasOrder.setPayGold(createOrderModel.getPayGold()!=null?createOrderModel.getPayGold():0); gasOrder.setPayGold(createOrderModel.getPayGold()!=null?createOrderModel.getPayGold():0);
if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {

@ -132,7 +132,6 @@ public class HighUserServiceImpl implements HighUserService {
HighUserModel highUserModel = new HighUserModel(); HighUserModel highUserModel = new HighUserModel();
highUserModel.setHighUser(getDetailDataByUser(user.getId())); highUserModel.setHighUser(getDetailDataByUser(user.getId()));
SessionObject so = new SessionObject(AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(user.getPhone(), "123")), 1 , highUserModel); SessionObject so = new SessionObject(AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(user.getPhone(), "123")), 1 , highUserModel);
so.setType(1);
userCenter.save(null,null,so); userCenter.save(null,null,so);
return highUserModel; return highUserModel;

@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.RequestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -62,16 +61,28 @@ public class AuthConfig implements WebMvcConfigurer {
if(debug){ if(debug){
return true; return true;
} }
String token = request.getHeader("Authorization"); String token = request.getParameter("Authorization");
if (StringUtils.isNotBlank(token)) { if (StringUtils.isBlank(token)) {
if(userCenter.isLogin(request) == true) { token = request.getHeader("Authorization");
return true;
} }
if((StringUtils.isNotBlank(token) && userCenter.isTokenLogin(token)) || userCenter.isLogin(request)){//如果未登录,将无法使用任何接口
userCenter.refreshCookie(request, response);
return true;
} else if(request instanceof StandardMultipartHttpServletRequest) {
StandardMultipartHttpServletRequest re = (StandardMultipartHttpServletRequest)request;
if(userCenter.isLogin(re.getRequest())){
return true;
} else {
log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL());
response.setStatus(401);
return false;
} }
log.error("the user is not logged in,remoteAddr:"+ RequestUtils.getIpAddress(request)+",requestUrl:"+request.getRequestURL()); } else{
log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL());
response.setStatus(401); response.setStatus(401);
return false; return false;
} }
}
}) })
.addPathPatterns("/**") .addPathPatterns("/**")
.excludePathPatterns("/swagger-resources/**") .excludePathPatterns("/swagger-resources/**")
@ -82,4 +93,37 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/sms/*") .excludePathPatterns("/sms/*")
; ;
} }
public String getIpAddress(HttpServletRequest request) {
// 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址
String ip = request.getHeader("X-Forwarded-For");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
} else if (ip.length() > 15) {
String[] ips = ip.split(",");
for (int index = 0; index < ips.length; index++) {
String strIp = ips[index];
if (!("unknown".equalsIgnoreCase(strIp))) {
ip = strIp;
break;
}
}
}
return ip;
}
} }

@ -8,11 +8,17 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.MemberValidateUtil; import com.hai.common.utils.MemberValidateUtil;
import com.hai.common.utils.RedisUtil; import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.entity.HighOilCard;
import com.hai.entity.HighUserCard;
import com.hai.enum_type.LoginPlatform; import com.hai.enum_type.LoginPlatform;
import com.hai.enum_type.RedisFileFolder; import com.hai.enum_type.RedisFileFolder;
import com.hai.enum_type.UserCardType;
import com.hai.model.HighUserModel; import com.hai.model.HighUserModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.HighOilCardService;
import com.hai.service.HighUserCardService;
import com.hai.service.HighUserService; import com.hai.service.HighUserService;
import com.web.type.LoginType; import com.web.type.LoginType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -30,6 +36,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @className: CoresController * @className: CoresController
@ -50,9 +58,76 @@ public class CoresController {
@Resource @Resource
private HighUserService userService; private HighUserService userService;
@Resource
private HighUserCardService userCardService;
@Resource
private HighOilCardService oilCardService;
@Resource @Resource
private UserCenter userCenter; private UserCenter userCenter;
@RequestMapping(value = "/getUserDetail", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取用户详情")
public ResponseData getUserDetail(HttpServletRequest request, HttpServletResponse response) {
try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
if (userInfoModel == null) {
log.error("CoresController --> outLogin() error!", "用户身份错误或已过期");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
return ResponseMsgUtil.success(userService.getDetailDataByUser(userInfoModel.getHighUser().getId()));
} catch (Exception e) {
log.error("CoresController --> getUserDetail() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getUserAccount", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取用户账户余额")
public ResponseData getUserAccount(HttpServletRequest request, HttpServletResponse response) {
try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
if (userInfoModel == null) {
log.error("CoresController --> outLogin() error!", "用户身份错误或已过期");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
Map<String, Object> map = new HashMap<>();
map.put("integral", userService.findByUserId(userInfoModel.getHighUser().getId()).getGold());
map.put("oilCardPrice", 0);
map.put("hltCardPrice", 0);
// 嗨森逛油卡
List<HighUserCard> oilCardList = userCardService.getListByUser(userInfoModel.getHighUser().getId(), UserCardType.type2.getType());
if (oilCardList.size() > 0) {
// 查询油卡
HighOilCard oilCard = oilCardService.getOilCardByCardNo(oilCardList.get(0).getCardNo());
if (oilCard != null) {
map.put("oilCardPrice", oilCard.getAmount());
}
}
// 贵州汇联通工会卡
List<HighUserCard> hltCardList = userCardService.getListByUser(userInfoModel.getHighUser().getId(), UserCardType.type1.getType());
if (hltCardList.size() > 0) {
// 查询油卡
JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(oilCardList.get(0).getCardNo());
if (StringUtils.isBlank(cardInfo.getString("data"))) {
map.put("hltCardPrice", cardInfo.getString("data"));
}
}
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("CoresController --> getUserAccount() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/outLogin", method = RequestMethod.POST) @RequestMapping(value = "/outLogin", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "退出登录") @ApiOperation(value = "退出登录")

Loading…
Cancel
Save