From 77295c5b5b68fa0a97a66a1b627dfc4aaed50240 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 1 Jul 2021 22:49:56 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4diam'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cweb/controller/CommonController.java | 8 ++- .../cweb/controller/HighGasController.java | 2 +- .../cweb/controller/HighOrderController.java | 2 +- .../java/com/hai/config/CommonSysConfig.java | 18 ++++++ .../com/hai/dao/HighChildOrderMapper.java | 19 +++--- .../hai/dao/HighChildOrderSqlProvider.java | 14 +++++ .../java/com/hai/entity/HighChildOrder.java | 16 +++++ .../com/hai/entity/HighChildOrderExample.java | 60 +++++++++++++++++++ .../pay/impl/GoodsOrderServiceImpl.java | 7 +++ .../resources/dev/commonConfig.properties | 2 + .../resources/prod/commonConfig.properties | 2 + 11 files changed, 138 insertions(+), 12 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java index 111b3d5c..beb4cdc0 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java @@ -3,6 +3,7 @@ package com.cweb.controller; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.BsCompany; import com.hai.entity.SecConfig; +import com.hai.entity.SecRegion; import com.hai.model.ResponseData; import com.hai.service.BsCompanyService; import com.hai.service.CommonService; @@ -50,9 +51,12 @@ public class CommonController { for (BsCompany company : list) { map = new HashMap<>(); if (StringUtils.isNotBlank(company.getRegionId())) { - map.put("regionId", company.getRegionId()); - map.put("regionName", commonService.getRegionName(Long.parseLong(company.getRegionId()))); map.put("companyId", company.getId()); + map.put("regionId", company.getRegionId()); + SecRegion secRegion = commonService.getRegionsById(Long.parseLong(company.getRegionId())); + if (secRegion != null) { + map.put("regionName", secRegion.getRegionName()); + } mapList.add(map); } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 98a5c65c..b47f6043 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -96,7 +96,7 @@ public class HighGasController { result.put("distance", Math.round(distance/100d)/10d); return ResponseMsgUtil.success(jsonObject.get("result")); } - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油站信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message")); } catch (Exception e) { log.error("HighGasController -> getGasDetailByStoreKey() error!",e); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 89023f4f..10523c41 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -167,7 +167,7 @@ public class HighOrderController { } if (childOrder.getGoodsType() == 3) { - if (childOrder.getGoodsPrice() == null || StringUtils.isBlank(childOrder.getGasGunNo()) || StringUtils.isBlank(childOrder.getGasOilNo())) { + if (childOrder.getGoodsPrice() == null || StringUtils.isBlank(childOrder.getGasGunNo()) || StringUtils.isBlank(childOrder.getGasOilNo()) || childOrder.getGasOilType() == null) { log.error("HighOrderController --> addOrder() error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 032c1c93..19b21ed4 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -12,6 +12,8 @@ public class CommonSysConfig { private String tuanYouUrl; private String tuanYouAppKey; private String tuanYouAppSecret; + private String tuanYouDieselAccount; // 柴油账号 + private String tuanYouGasolineAccount; // 汽油账号 private String wx_cert; @@ -46,4 +48,20 @@ public class CommonSysConfig { public void setTuanYouAppSecret(String tuanYouAppSecret) { this.tuanYouAppSecret = tuanYouAppSecret; } + + public String getTuanYouDieselAccount() { + return tuanYouDieselAccount; + } + + public void setTuanYouDieselAccount(String tuanYouDieselAccount) { + this.tuanYouDieselAccount = tuanYouDieselAccount; + } + + public String getTuanYouGasolineAccount() { + return tuanYouGasolineAccount; + } + + public void setTuanYouGasolineAccount(String tuanYouGasolineAccount) { + this.tuanYouGasolineAccount = tuanYouGasolineAccount; + } } 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 0d8ed3c8..9594b6d3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -47,9 +47,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "total_price, giveaway_type, ", "child_orde_status, praise_status, ", "gas_oil_no, gas_gun_no, ", - "gas_order_no, gas_price_gun, ", - "gas_price_vip, ext_1, ", - "ext_2, ext_3)", + "gas_oil_type, gas_order_no, ", + "gas_price_gun, gas_price_vip, ", + "ext_1, ext_2, ext_3)", "values (#{orderId,jdbcType=BIGINT}, #{memId,jdbcType=BIGINT}, ", "#{goodsType,jdbcType=INTEGER}, #{goodsId,jdbcType=BIGINT}, ", "#{goodsName,jdbcType=VARCHAR}, #{goodsImg,jdbcType=VARCHAR}, ", @@ -58,9 +58,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "#{totalPrice,jdbcType=DECIMAL}, #{giveawayType,jdbcType=BIT}, ", "#{childOrdeStatus,jdbcType=INTEGER}, #{praiseStatus,jdbcType=INTEGER}, ", "#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ", - "#{gasOrderNo,jdbcType=VARCHAR}, #{gasPriceGun,jdbcType=DECIMAL}, ", - "#{gasPriceVip,jdbcType=DECIMAL}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{gasOilType,jdbcType=INTEGER}, #{gasOrderNo,jdbcType=VARCHAR}, ", + "#{gasPriceGun,jdbcType=DECIMAL}, #{gasPriceVip,jdbcType=DECIMAL}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighChildOrder record); @@ -88,6 +88,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="praise_status", property="praiseStatus", jdbcType=JdbcType.INTEGER), @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), @Result(column="gas_order_no", property="gasOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @@ -101,8 +102,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "select", "id, order_id, mem_id, goods_type, goods_id, goods_name, 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_order_no, gas_price_gun, gas_price_vip, ", - "ext_1, ext_2, ext_3", + "praise_status, gas_oil_no, gas_gun_no, gas_oil_type, gas_order_no, gas_price_gun, ", + "gas_price_vip, ext_1, ext_2, ext_3", "from high_child_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -124,6 +125,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="praise_status", property="praiseStatus", jdbcType=JdbcType.INTEGER), @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), @Result(column="gas_order_no", property="gasOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @@ -160,6 +162,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "praise_status = #{praiseStatus,jdbcType=INTEGER},", "gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},", "gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},", + "gas_oil_type = #{gasOilType,jdbcType=INTEGER},", "gas_order_no = #{gasOrderNo,jdbcType=VARCHAR},", "gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},", "gas_price_vip = #{gasPriceVip,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 2850133f..7b03f89a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -92,6 +92,10 @@ public class HighChildOrderSqlProvider { sql.VALUES("gas_gun_no", "#{gasGunNo,jdbcType=VARCHAR}"); } + if (record.getGasOilType() != null) { + sql.VALUES("gas_oil_type", "#{gasOilType,jdbcType=INTEGER}"); + } + if (record.getGasOrderNo() != null) { sql.VALUES("gas_order_no", "#{gasOrderNo,jdbcType=VARCHAR}"); } @@ -142,6 +146,7 @@ public class HighChildOrderSqlProvider { sql.SELECT("praise_status"); sql.SELECT("gas_oil_no"); sql.SELECT("gas_gun_no"); + sql.SELECT("gas_oil_type"); sql.SELECT("gas_order_no"); sql.SELECT("gas_price_gun"); sql.SELECT("gas_price_vip"); @@ -233,6 +238,10 @@ public class HighChildOrderSqlProvider { sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); } + if (record.getGasOilType() != null) { + sql.SET("gas_oil_type = #{record.gasOilType,jdbcType=INTEGER}"); + } + if (record.getGasOrderNo() != null) { sql.SET("gas_order_no = #{record.gasOrderNo,jdbcType=VARCHAR}"); } @@ -282,6 +291,7 @@ public class HighChildOrderSqlProvider { sql.SET("praise_status = #{record.praiseStatus,jdbcType=INTEGER}"); 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}"); sql.SET("gas_order_no = #{record.gasOrderNo,jdbcType=VARCHAR}"); sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); @@ -362,6 +372,10 @@ public class HighChildOrderSqlProvider { sql.SET("gas_gun_no = #{gasGunNo,jdbcType=VARCHAR}"); } + if (record.getGasOilType() != null) { + sql.SET("gas_oil_type = #{gasOilType,jdbcType=INTEGER}"); + } + if (record.getGasOrderNo() != null) { sql.SET("gas_order_no = #{gasOrderNo,jdbcType=VARCHAR}"); } 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 6e12b19d..3f817b21 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java @@ -98,6 +98,11 @@ public class HighChildOrder implements Serializable { */ private String gasGunNo; + /** + * 【加油站】油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer gasOilType; + /** * 【加油站】订单号 */ @@ -257,6 +262,14 @@ public class HighChildOrder implements Serializable { this.gasGunNo = gasGunNo; } + public Integer getGasOilType() { + return gasOilType; + } + + public void setGasOilType(Integer gasOilType) { + this.gasOilType = gasOilType; + } + public String getGasOrderNo() { return gasOrderNo; } @@ -334,6 +347,7 @@ public class HighChildOrder implements Serializable { && (this.getPraiseStatus() == null ? other.getPraiseStatus() == null : this.getPraiseStatus().equals(other.getPraiseStatus())) && (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())) && (this.getGasOrderNo() == null ? other.getGasOrderNo() == null : this.getGasOrderNo().equals(other.getGasOrderNo())) && (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun())) && (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip())) @@ -363,6 +377,7 @@ public class HighChildOrder implements Serializable { result = prime * result + ((getPraiseStatus() == null) ? 0 : getPraiseStatus().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()); result = prime * result + ((getGasOrderNo() == null) ? 0 : getGasOrderNo().hashCode()); result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode()); result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().hashCode()); @@ -395,6 +410,7 @@ public class HighChildOrder implements Serializable { sb.append(", praiseStatus=").append(praiseStatus); sb.append(", gasOilNo=").append(gasOilNo); sb.append(", gasGunNo=").append(gasGunNo); + sb.append(", gasOilType=").append(gasOilType); sb.append(", gasOrderNo=").append(gasOrderNo); sb.append(", gasPriceGun=").append(gasPriceGun); sb.append(", gasPriceVip=").append(gasPriceVip); 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 87bc2a78..ede47507 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java @@ -1195,6 +1195,66 @@ public class HighChildOrderExample { return (Criteria) this; } + public Criteria andGasOilTypeIsNull() { + addCriterion("gas_oil_type is null"); + return (Criteria) this; + } + + public Criteria andGasOilTypeIsNotNull() { + addCriterion("gas_oil_type is not null"); + return (Criteria) this; + } + + public Criteria andGasOilTypeEqualTo(Integer value) { + addCriterion("gas_oil_type =", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeNotEqualTo(Integer value) { + addCriterion("gas_oil_type <>", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeGreaterThan(Integer value) { + addCriterion("gas_oil_type >", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("gas_oil_type >=", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeLessThan(Integer value) { + addCriterion("gas_oil_type <", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("gas_oil_type <=", value, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeIn(List values) { + addCriterion("gas_oil_type in", values, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeNotIn(List values) { + addCriterion("gas_oil_type not in", values, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeBetween(Integer value1, Integer value2) { + addCriterion("gas_oil_type between", value1, value2, "gasOilType"); + return (Criteria) this; + } + + public Criteria andGasOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("gas_oil_type not between", value1, value2, "gasOilType"); + return (Criteria) this; + } + public Criteria andGasOrderNoIsNull() { addCriterion("gas_order_no is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index c923d44a..a5427cf7 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -7,6 +7,7 @@ import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.WxUtils; +import com.hai.config.CommonSysConst; import com.hai.config.TuanYouConfig; import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighUserCouponMapper; @@ -151,6 +152,12 @@ public class GoodsOrderServiceImpl implements PayService { paramMap.put("thirdSerialNo", order.getOrderNo()); paramMap.put("refuelingAmount", highChildOrder.getGoodsActualPrice()); + // 油品类型 1:汽油:2:柴油;3:天然气 + if (highChildOrder.getGasOilType() == 1) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); + } else if (highChildOrder.getGasOilType() == 2) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); + } JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); System.out.println(orderPushObject.toJSONString()); // 推送团油订单记录 diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 5ef1ac20..fc9c12f1 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -1,5 +1,7 @@ tuanYouUrl=https://test02-motorcade-hcs.czb365.com tuanYouAppKey=208241666939552 tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 +tuanYouDieselAccount =9b115eao4400 +tuanYouGasolineAccount =9b115e5g4400 wx_cert=/home/project/wx_cert/ \ No newline at end of file diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 85a33fc2..541ce55a 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -1,5 +1,7 @@ tuanYouUrl=https://test04-motorcade-hcs.czb365.com tuanYouAppKey=208241666939552 tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 +tuanYouDieselAccount=9b115eao4400 +tuanYouGasolineAccount=9b115e5g4400 wx_cert=/home/project/wx_cert/ \ No newline at end of file