diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index b5a2297e..19fbfff3 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -812,6 +812,10 @@ public class HighGasController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,未找到加油站信息"); } + // 油站来源,根据不同的来源,请求不同的退款业务接口。 + // 团油 退款需要申请。不是实时退款 + // 加好油 实时退款,退款成功就可以退款给用户 + // 金猪加油 没有线上退款接口,线下核实后直接退款给用户。 if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent")); if (object == null || !object.getString("code").equals("200")) { @@ -831,9 +835,13 @@ public class HighGasController { highOrderService.updateOrderDetail(order); } + + // 用户支付金额原路退款 // 来源类型 1:平台自建 2:团油 if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber()) - || store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { + || store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber()) + || store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber()) + ) { if (order.getPayType() == 2) { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getAccountMerchantNum(), order.getPayRealPrice()); diff --git a/hai-bweb/src/main/java/com/bweb/model/ImportStoreModel.java b/hai-bweb/src/main/java/com/bweb/model/ImportStoreModel.java index bb18791f..7a93b19f 100644 --- a/hai-bweb/src/main/java/com/bweb/model/ImportStoreModel.java +++ b/hai-bweb/src/main/java/com/bweb/model/ImportStoreModel.java @@ -5,7 +5,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat; /** * @Author 胡锐 - * @Description 导入门店 + * @Description * @Date 2021/3/26 19:23 **/ public class ImportStoreModel { diff --git a/hai-service/src/main/java/com/hai/config/JinZhuJiaYouService.java b/hai-service/src/main/java/com/hai/config/JinZhuJiaYouService.java index 5223c7f3..caf9d88c 100644 --- a/hai-service/src/main/java/com/hai/config/JinZhuJiaYouService.java +++ b/hai-service/src/main/java/com/hai/config/JinZhuJiaYouService.java @@ -112,7 +112,7 @@ public class JinZhuJiaYouService { // 请求头部 Map heard = new HashMap<>(); heard.put("Request-App-Id", "app_xiaohan_test_01"); - heard.put("Request-Service-Name", "STATION_TREE_PAGE"); + heard.put("Request-Service-Name", service); heard.put("Request-Signature", generateSign(param)); JSONObject repsObject = HttpsUtils.doPost(reqUrl, param, heard); @@ -128,7 +128,6 @@ public class JinZhuJiaYouService { || !repsObject.getInteger("status").equals(200) || !repsObject.getString("type").equals("OK")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, repsObject == null?"请求失败":repsObject.getString("title")); - } return repsObject; } diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java index c92fd604..72349bcd 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -52,16 +52,17 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_oil_type, gas_order_no, ", "gas_price_platform, gas_price_gun, ", "gas_price_vip, gas_price_official, ", - "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, ", - "gas_salesman_id, gas_salesman_name, ", - "gas_agent_id, gas_agent_name, ", - "gas_org_id, gas_org_name, ", - "ext_1, ext_2, ext_3, ", - "ext_4, ext_5, ext_6)", + "gas_price_channel_pay, 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, gas_salesman_id, ", + "gas_salesman_name, gas_agent_id, ", + "gas_agent_name, gas_org_id, ", + "gas_org_name, ext_1, ", + "ext_2, ext_3, ext_4, ", + "ext_5, ext_6)", "values (#{orderId,jdbcType=BIGINT}, #{memId,jdbcType=BIGINT}, ", "#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ", "#{storeAddress,jdbcType=VARCHAR}, #{goodsType,jdbcType=INTEGER}, ", @@ -75,16 +76,17 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "#{gasOilType,jdbcType=INTEGER}, #{gasOrderNo,jdbcType=VARCHAR}, ", "#{gasPricePlatform,jdbcType=DECIMAL}, #{gasPriceGun,jdbcType=DECIMAL}, ", "#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ", - "#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ", - "#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ", - "#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ", - "#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ", - "#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ", - "#{gasSalesmanId,jdbcType=BIGINT}, #{gasSalesmanName,jdbcType=VARCHAR}, ", - "#{gasAgentId,jdbcType=BIGINT}, #{gasAgentName,jdbcType=VARCHAR}, ", - "#{gasOrgId,jdbcType=BIGINT}, #{gasOrgName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", - "#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" + "#{gasPriceChannelPay,jdbcType=DECIMAL}, #{gasOilLiters,jdbcType=DECIMAL}, ", + "#{gasDiscount,jdbcType=DECIMAL}, #{gasOilSubsidy,jdbcType=DECIMAL}, ", + "#{gasLitersPreferences,jdbcType=DECIMAL}, #{gasPricePreferences,jdbcType=DECIMAL}, ", + "#{gasClassGroupId,jdbcType=BIGINT}, #{gasClassGroupName,jdbcType=VARCHAR}, ", + "#{gasClassGroupTaskId,jdbcType=BIGINT}, #{gasStaffId,jdbcType=BIGINT}, ", + "#{gasStaffName,jdbcType=VARCHAR}, #{gasSalesmanId,jdbcType=BIGINT}, ", + "#{gasSalesmanName,jdbcType=VARCHAR}, #{gasAgentId,jdbcType=BIGINT}, ", + "#{gasAgentName,jdbcType=VARCHAR}, #{gasOrgId,jdbcType=BIGINT}, ", + "#{gasOrgName,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") int insert(HighChildOrder record); @@ -122,6 +124,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_channel_pay", property="gasPriceChannelPay", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), @Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), @@ -153,11 +156,11 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "goods_name, goods_desc, goods_img, goods_spec_name, goods_price, goods_actual_price, ", "sale_count, total_price, giveaway_type, child_orde_status, praise_status, gas_oil_no, ", "gas_gun_no, gas_oil_type, gas_order_no, gas_price_platform, gas_price_gun, gas_price_vip, ", - "gas_price_official, 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, gas_salesman_id, gas_salesman_name, gas_agent_id, ", - "gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ext_4, ext_5, ", - "ext_6", + "gas_price_official, gas_price_channel_pay, 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, gas_salesman_id, gas_salesman_name, ", + "gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ", + "ext_4, ext_5, ext_6", "from high_child_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -189,6 +192,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_channel_pay", property="gasPriceChannelPay", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), @Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), @@ -251,6 +255,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},", "gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL},", "gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL},", + "gas_price_channel_pay = #{gasPriceChannelPay,jdbcType=DECIMAL},", "gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL},", "gas_discount = #{gasDiscount,jdbcType=DECIMAL},", "gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},", diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java index e89debe9..2159353f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -132,6 +132,10 @@ public class HighChildOrderSqlProvider { sql.VALUES("gas_price_official", "#{gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceChannelPay() != null) { + sql.VALUES("gas_price_channel_pay", "#{gasPriceChannelPay,jdbcType=DECIMAL}"); + } + if (record.getGasOilLiters() != null) { sql.VALUES("gas_oil_liters", "#{gasOilLiters,jdbcType=DECIMAL}"); } @@ -256,6 +260,7 @@ public class HighChildOrderSqlProvider { sql.SELECT("gas_price_gun"); sql.SELECT("gas_price_vip"); sql.SELECT("gas_price_official"); + sql.SELECT("gas_price_channel_pay"); sql.SELECT("gas_oil_liters"); sql.SELECT("gas_discount"); sql.SELECT("gas_oil_subsidy"); @@ -403,6 +408,10 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceChannelPay() != null) { + sql.SET("gas_price_channel_pay = #{record.gasPriceChannelPay,jdbcType=DECIMAL}"); + } + if (record.getGasOilLiters() != null) { sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}"); } @@ -526,6 +535,7 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); + sql.SET("gas_price_channel_pay = #{record.gasPriceChannelPay,jdbcType=DECIMAL}"); sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}"); sql.SET("gas_discount = #{record.gasDiscount,jdbcType=DECIMAL}"); sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}"); @@ -662,6 +672,10 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceChannelPay() != null) { + sql.SET("gas_price_channel_pay = #{gasPriceChannelPay,jdbcType=DECIMAL}"); + } + if (record.getGasOilLiters() != null) { sql.SET("gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java index 41b38ac2..a3bd8ee3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java @@ -43,16 +43,16 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { "oil_no_name, preferential_margin, ", "gas_station_drop, price_vip, ", "price_gun, price_official, ", - "oil_type, oil_type_name, ", - "`status`, ext_1, ext_2, ", - "ext_3)", + "price_cost, oil_type, ", + "oil_type_name, `status`, ", + "ext_1, ext_2, ext_3)", "values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ", "#{oilNoName,jdbcType=VARCHAR}, #{preferentialMargin,jdbcType=DECIMAL}, ", "#{gasStationDrop,jdbcType=DECIMAL}, #{priceVip,jdbcType=DECIMAL}, ", "#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ", - "#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", - "#{ext3,jdbcType=VARCHAR})" + "#{priceCost,jdbcType=DECIMAL}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighGasOilPrice record); @@ -72,6 +72,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="price_cost", property="priceCost", jdbcType=JdbcType.DECIMAL), @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -84,8 +85,8 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Select({ "select", "id, merchant_store_id, oil_no, oil_no_name, preferential_margin, gas_station_drop, ", - "price_vip, price_gun, price_official, oil_type, oil_type_name, `status`, ext_1, ", - "ext_2, ext_3", + "price_vip, price_gun, price_official, price_cost, oil_type, oil_type_name, `status`, ", + "ext_1, ext_2, ext_3", "from high_gas_oil_price", "where id = #{id,jdbcType=BIGINT}" }) @@ -99,6 +100,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="price_cost", property="priceCost", jdbcType=JdbcType.DECIMAL), @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -127,6 +129,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { "price_vip = #{priceVip,jdbcType=DECIMAL},", "price_gun = #{priceGun,jdbcType=DECIMAL},", "price_official = #{priceOfficial,jdbcType=DECIMAL},", + "price_cost = #{priceCost,jdbcType=DECIMAL},", "oil_type = #{oilType,jdbcType=INTEGER},", "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java index 714766f9..d2186faf 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java @@ -60,6 +60,10 @@ public class HighGasOilPriceSqlProvider { sql.VALUES("price_official", "#{priceOfficial,jdbcType=DECIMAL}"); } + if (record.getPriceCost() != null) { + sql.VALUES("price_cost", "#{priceCost,jdbcType=DECIMAL}"); + } + if (record.getOilType() != null) { sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); } @@ -102,6 +106,7 @@ public class HighGasOilPriceSqlProvider { sql.SELECT("price_vip"); sql.SELECT("price_gun"); sql.SELECT("price_official"); + sql.SELECT("price_cost"); sql.SELECT("oil_type"); sql.SELECT("oil_type_name"); sql.SELECT("`status`"); @@ -161,6 +166,10 @@ public class HighGasOilPriceSqlProvider { sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); } + if (record.getPriceCost() != null) { + sql.SET("price_cost = #{record.priceCost,jdbcType=DECIMAL}"); + } + if (record.getOilType() != null) { sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); } @@ -202,6 +211,7 @@ public class HighGasOilPriceSqlProvider { sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}"); sql.SET("price_gun = #{record.priceGun,jdbcType=DECIMAL}"); sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); + sql.SET("price_cost = #{record.priceCost,jdbcType=DECIMAL}"); sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); @@ -250,6 +260,10 @@ public class HighGasOilPriceSqlProvider { sql.SET("price_official = #{priceOfficial,jdbcType=DECIMAL}"); } + if (record.getPriceCost() != null) { + sql.SET("price_cost = #{priceCost,jdbcType=DECIMAL}"); + } + if (record.getOilType() != null) { sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java index 134f3e9f..9ed597a1 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java @@ -148,6 +148,11 @@ public class HighChildOrder implements Serializable { */ private BigDecimal gasPriceOfficial; + /** + * 【加油站】渠道支付金额 + */ + private BigDecimal gasPriceChannelPay; + /** * 【加油站】加油升数 */ @@ -458,6 +463,14 @@ public class HighChildOrder implements Serializable { this.gasPriceOfficial = gasPriceOfficial; } + public BigDecimal getGasPriceChannelPay() { + return gasPriceChannelPay; + } + + public void setGasPriceChannelPay(BigDecimal gasPriceChannelPay) { + this.gasPriceChannelPay = gasPriceChannelPay; + } + public BigDecimal getGasOilLiters() { return gasOilLiters; } @@ -673,6 +686,7 @@ public class HighChildOrder implements Serializable { && (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun())) && (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip())) && (this.getGasPriceOfficial() == null ? other.getGasPriceOfficial() == null : this.getGasPriceOfficial().equals(other.getGasPriceOfficial())) + && (this.getGasPriceChannelPay() == null ? other.getGasPriceChannelPay() == null : this.getGasPriceChannelPay().equals(other.getGasPriceChannelPay())) && (this.getGasOilLiters() == null ? other.getGasOilLiters() == null : this.getGasOilLiters().equals(other.getGasOilLiters())) && (this.getGasDiscount() == null ? other.getGasDiscount() == null : this.getGasDiscount().equals(other.getGasDiscount())) && (this.getGasOilSubsidy() == null ? other.getGasOilSubsidy() == null : this.getGasOilSubsidy().equals(other.getGasOilSubsidy())) @@ -728,6 +742,7 @@ public class HighChildOrder implements Serializable { result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode()); result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().hashCode()); result = prime * result + ((getGasPriceOfficial() == null) ? 0 : getGasPriceOfficial().hashCode()); + result = prime * result + ((getGasPriceChannelPay() == null) ? 0 : getGasPriceChannelPay().hashCode()); result = prime * result + ((getGasOilLiters() == null) ? 0 : getGasOilLiters().hashCode()); result = prime * result + ((getGasDiscount() == null) ? 0 : getGasDiscount().hashCode()); result = prime * result + ((getGasOilSubsidy() == null) ? 0 : getGasOilSubsidy().hashCode()); @@ -786,6 +801,7 @@ public class HighChildOrder implements Serializable { sb.append(", gasPriceGun=").append(gasPriceGun); sb.append(", gasPriceVip=").append(gasPriceVip); sb.append(", gasPriceOfficial=").append(gasPriceOfficial); + sb.append(", gasPriceChannelPay=").append(gasPriceChannelPay); sb.append(", gasOilLiters=").append(gasOilLiters); sb.append(", gasDiscount=").append(gasDiscount); sb.append(", gasOilSubsidy=").append(gasOilSubsidy); @@ -812,4 +828,4 @@ public class HighChildOrder implements Serializable { sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java index cdde1256..124e94bf 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java @@ -1835,6 +1835,66 @@ public class HighChildOrderExample { return (Criteria) this; } + public Criteria andGasPriceChannelPayIsNull() { + addCriterion("gas_price_channel_pay is null"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayIsNotNull() { + addCriterion("gas_price_channel_pay is not null"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayEqualTo(BigDecimal value) { + addCriterion("gas_price_channel_pay =", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayNotEqualTo(BigDecimal value) { + addCriterion("gas_price_channel_pay <>", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayGreaterThan(BigDecimal value) { + addCriterion("gas_price_channel_pay >", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_channel_pay >=", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayLessThan(BigDecimal value) { + addCriterion("gas_price_channel_pay <", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_channel_pay <=", value, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayIn(List values) { + addCriterion("gas_price_channel_pay in", values, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayNotIn(List values) { + addCriterion("gas_price_channel_pay not in", values, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_channel_pay between", value1, value2, "gasPriceChannelPay"); + return (Criteria) this; + } + + public Criteria andGasPriceChannelPayNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_channel_pay not between", value1, value2, "gasPriceChannelPay"); + return (Criteria) this; + } + public Criteria andGasOilLitersIsNull() { addCriterion("gas_oil_liters is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java index 202d2494..5e2eb4a5 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java @@ -58,6 +58,11 @@ public class HighGasOilPrice implements Serializable { */ private BigDecimal priceOfficial; + /** + * 成本价 + */ + private BigDecimal priceCost; + /** * 油品类型 1:汽油:2:柴油;3:天然气 */ @@ -153,6 +158,14 @@ public class HighGasOilPrice implements Serializable { this.priceOfficial = priceOfficial; } + public BigDecimal getPriceCost() { + return priceCost; + } + + public void setPriceCost(BigDecimal priceCost) { + this.priceCost = priceCost; + } + public Integer getOilType() { return oilType; } @@ -222,6 +235,7 @@ public class HighGasOilPrice implements Serializable { && (this.getPriceVip() == null ? other.getPriceVip() == null : this.getPriceVip().equals(other.getPriceVip())) && (this.getPriceGun() == null ? other.getPriceGun() == null : this.getPriceGun().equals(other.getPriceGun())) && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) + && (this.getPriceCost() == null ? other.getPriceCost() == null : this.getPriceCost().equals(other.getPriceCost())) && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) @@ -243,6 +257,7 @@ public class HighGasOilPrice implements Serializable { result = prime * result + ((getPriceVip() == null) ? 0 : getPriceVip().hashCode()); result = prime * result + ((getPriceGun() == null) ? 0 : getPriceGun().hashCode()); result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode()); + result = prime * result + ((getPriceCost() == null) ? 0 : getPriceCost().hashCode()); result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); @@ -267,6 +282,7 @@ public class HighGasOilPrice implements Serializable { sb.append(", priceVip=").append(priceVip); sb.append(", priceGun=").append(priceGun); sb.append(", priceOfficial=").append(priceOfficial); + sb.append(", priceCost=").append(priceCost); sb.append(", oilType=").append(oilType); sb.append(", oilTypeName=").append(oilTypeName); sb.append(", status=").append(status); diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java index 313cda7f..59f713d7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java @@ -675,6 +675,66 @@ public class HighGasOilPriceExample { return (Criteria) this; } + public Criteria andPriceCostIsNull() { + addCriterion("price_cost is null"); + return (Criteria) this; + } + + public Criteria andPriceCostIsNotNull() { + addCriterion("price_cost is not null"); + return (Criteria) this; + } + + public Criteria andPriceCostEqualTo(BigDecimal value) { + addCriterion("price_cost =", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostNotEqualTo(BigDecimal value) { + addCriterion("price_cost <>", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostGreaterThan(BigDecimal value) { + addCriterion("price_cost >", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price_cost >=", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostLessThan(BigDecimal value) { + addCriterion("price_cost <", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostLessThanOrEqualTo(BigDecimal value) { + addCriterion("price_cost <=", value, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostIn(List values) { + addCriterion("price_cost in", values, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostNotIn(List values) { + addCriterion("price_cost not in", values, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_cost between", value1, value2, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_cost not between", value1, value2, "priceCost"); + return (Criteria) this; + } + public Criteria andOilTypeIsNull() { addCriterion("oil_type is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/JinZhuJiaYouOilNo.java b/hai-service/src/main/java/com/hai/enum_type/JinZhuJiaYouOilNo.java index 9105de6b..bf095719 100644 --- a/hai-service/src/main/java/com/hai/enum_type/JinZhuJiaYouOilNo.java +++ b/hai-service/src/main/java/com/hai/enum_type/JinZhuJiaYouOilNo.java @@ -3,7 +3,7 @@ package com.hai.enum_type; import java.util.Objects; /** - * 金猪加油 油号枚举 + * 油号枚举 */ public enum JinZhuJiaYouOilNo { @@ -34,6 +34,13 @@ public enum JinZhuJiaYouOilNo { return null; } + public static JinZhuJiaYouOilNo getDataByOilNo(Integer oilNo) { + for (JinZhuJiaYouOilNo ele : values()) { + if(Objects.equals(oilNo,ele.getOilNo())) return ele; + } + return null; + } + public String getOilNoCode() { return oilNoCode; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java index 87ba3b26..5a60fa15 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java @@ -297,7 +297,8 @@ public class HighGasServiceImpl implements HighGasService { highGasOilPrice.setPreferentialMargin(new BigDecimal("0")); highGasOilPrice.setGasStationDrop(oilPriceObject.getBigDecimal("guidancePrice").subtract(oilPriceObject.getBigDecimal("listingPrice"))); - highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("guidancePrice")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); @@ -321,7 +322,8 @@ public class HighGasServiceImpl implements HighGasService { } else { highGasOilPrice.setGasStationDrop(oilPriceObject.getBigDecimal("guidancePrice").subtract(oilPriceObject.getBigDecimal("listingPrice"))); - highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("guidancePrice")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); @@ -386,7 +388,8 @@ public class HighGasServiceImpl implements HighGasService { highGasOilPrice.setPreferentialMargin(new BigDecimal("0")); highGasOilPrice.setGasStationDrop(oilPriceObject.getBigDecimal("guidancePrice").subtract(oilPriceObject.getBigDecimal("listingPrice"))); - highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("merchantStrikePrice")); + highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("listingPrice")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("guidancePrice")); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index a9671209..415ba2e5 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -166,6 +166,9 @@ public class HighOrderServiceImpl implements HighOrderService { @Resource private ShellGroupService shellGroupService; + @Resource + private JinZhuJiaYouService jinZhuJiaYouService; + @Override @Transactional( isolation = Isolation.SERIALIZABLE, @@ -255,6 +258,34 @@ public class HighOrderServiceImpl implements HighOrderService { } } + if (childOrder.getGoodsType() == 3) { + // 加油站详情 + HighMerchantStore store = highMerchantStoreService.getDetailById(childOrder.getGoodsId()); + if (store == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); + } + + if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { + // 查询金猪油品数据 + JinZhuJiaYouOilNo jzOilNo = JinZhuJiaYouOilNo.getDataByOilNo(Integer.valueOf(childOrder.getGasOilNo())); + if (jzOilNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法提交订单,未知的油品"); + } + // 创建金猪订单 + JSONObject jzOrderObject = jinZhuJiaYouService.createOrder(highOrder.getOrderNo(), + highOrder.getTotalPrice(), + store.getStoreKey(), + jzOilNo.getOilNoCode(), + childOrder.getGasGunNo(), + highOrder.getMemPhone() + ); + childOrder.setGasOrderNo(jzOrderObject.getJSONObject("data").getString("systemOrderNo")); + childOrder.setGasPriceChannelPay(jzOrderObject.getJSONObject("data").getBigDecimal("paymentAmount")); + highChildOrderMapper.updateByPrimaryKey(childOrder); + } + + } + if (childOrder.getGoodsType() == 7) { // 查询库存 List list = discountPackageActualService.getListByPackageId(childOrder.getGoodsId().intValue(), 1); @@ -515,14 +546,24 @@ public class HighOrderServiceImpl implements HighOrderService { } } else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { - // 推送壳牌 - JSONObject syncPayment = shellGroupService.gasSyncPayment(highOrder.getOrderNo(), + // 推送加好油 + shellGroupService.gasSyncPayment(highOrder.getOrderNo(), store.getStoreKey(), highOrder.getPayTime(), highChildOrder.getGasPriceGun(), highChildOrder.getGasOilNo(), highChildOrder.getGasGunNo(), highOrder.getTotalPrice()); + + + } else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { + // 推送金猪加油 + JSONObject jzOrderObject = jinZhuJiaYouService.payOrder(highOrder.getOrderNo(), highChildOrder.getGasPriceChannelPay()); + if (jzOrderObject == null + || !jzOrderObject.getString("type").equals("OK") + || !jzOrderObject.getInteger("status").equals(200)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jzOrderObject.getString("title")); + } } }