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 1159a6d9..b39f0e67 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -9,7 +9,10 @@ import com.hai.common.utils.CoordCommonUtil; import com.hai.common.utils.PageUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.TuanYouConfig; +import com.hai.entity.HighGasDiscountOilPrice; +import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighOrder; +import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.ResponseData; import com.hai.service.HighGasOilPriceService; import com.hai.service.HighOrderService; @@ -22,10 +25,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Controller @@ -41,6 +41,58 @@ public class HighGasController { @Resource private HighOrderService highOrderService; + @RequestMapping(value="/disabledOil",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用油品") + public ResponseData disabledOil(@RequestBody JSONObject body) { + try { + if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) { + log.error("HighGasController -> disabledOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询油品价格 + HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo")); + if (oilNo == null) { + log.error("HighGasController -> disabledOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + oilNo.setStatus(GasOilPriceStatusEnum.status2.getStatus()); + highGasOilPriceService.editGasOilPrice(oilNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasController -> disabledOil() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/enableOil",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "启用油品") + public ResponseData enableOil(@RequestBody JSONObject body) { + try { + if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) { + log.error("HighGasController -> enableOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询油品价格 + HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo")); + if (oilNo == null) { + log.error("HighGasController -> enableOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + oilNo.setStatus(GasOilPriceStatusEnum.status1.getStatus()); + highGasOilPriceService.editGasOilPrice(oilNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasController -> enableOil() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询加油站列表") diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java index 5e5de0d6..e4dcf5d7 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java @@ -66,7 +66,8 @@ public class HighTyAgentPriceController { for (Object obj : bodyArray) { JSONObject body = (JSONObject)JSONObject.toJSON(obj); - if (body.getLong("tyAgentOilStationId") == null + if (body.getInteger("belongType") == null + || body.getLong("tyAgentOilStationId") == null || StringUtils.isBlank(body.getString("oilNoName")) || StringUtils.isBlank(body.getString("oilNo")) || body.getBigDecimal("priceRate") == null) { @@ -74,9 +75,10 @@ public class HighTyAgentPriceController { } // 查询油站 - HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getLong("tyAgentOilStationId"), body.getString("oilNo")); + HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getInteger("belongType"),body.getLong("tyAgentOilStationId"), body.getString("oilNo")); if (agentOilStation == null) { agentOilStation = new HighTyAgentPrice(); + agentOilStation.setBelongType(body.getInteger("belongType")); agentOilStation.setTyAgentOilStationId(body.getLong("tyAgentOilStationId")); agentOilStation.setOilNoName(body.getString("oilNoName")); agentOilStation.setOilNo(body.getString("oilNo")); @@ -87,7 +89,6 @@ public class HighTyAgentPriceController { tyAgentPriceService.editTyAgentPrice(agentOilStation); } - return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { @@ -99,7 +100,8 @@ public class HighTyAgentPriceController { @RequestMapping(value = "/getOilStationPrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油站价格") - public ResponseData getOilStationPrice(@RequestParam(name = "oilStationId", required = true) Long oilStationId) { + public ResponseData getOilStationPrice(@RequestParam(name = "belongType", required = true) Integer belongType, + @RequestParam(name = "oilStationId", required = true) Long oilStationId) { try { HighTyAgentOilStation station = tyAgentOilStationService.getDetailByOilStationId(oilStationId); @@ -117,12 +119,14 @@ public class HighTyAgentPriceController { for (HighGasOilPrice price : oilPriceList) { oilPriceMap = new HashMap<>(); oilPriceMap.put("tyAgentOilStationId", station.getId()); + oilPriceMap.put("oilStationId", price.getMerchantStoreId()); oilPriceMap.put("oilNo", price.getOilNo()); oilPriceMap.put("oilNoName", price.getOilNoName()); + oilPriceMap.put("status", price.getStatus()); oilPriceMap.put("lowPrice", commonService.getDictionaryCodeName("TY_AGENT_OIL_STATION_LOW_PRICE", price.getOilNo().toString())); // 价格 - HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString()); + HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(belongType, station.getId(), price.getOilNo().toString()); if (priceRate == null) { oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate()); } else { 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 fed3e400..8e7c0339 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -113,7 +113,7 @@ public class HighGasController { // 查询是否配置了优惠比例 HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(MapUtils.getLong(map, "id")); if (tyAgentOilStation != null) { - HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no")); + HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(2,tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no")); if (tyAgentPrice != null) { // 优惠比例 / 100 = 最终优惠比例 BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); @@ -147,7 +147,7 @@ public class HighGasController { HighTyAgentOilStation oilStation = tyAgentOilStationService.getDetailByOilStationId(goodsId); if (oilStation != null) { // 价格 - HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), oilNo); + HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(1, oilStation.getId(), oilNo); if (priceRate == null) { discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate(); } else { @@ -205,7 +205,7 @@ public class HighGasController { // 查询是否配置了优惠比例 HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(store.getId()); if (tyAgentOilStation != null) { - HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), price.getString("oilNo")); + HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, tyAgentOilStation.getId(), price.getString("oilNo")); if (tyAgentPrice != null) { // 优惠比例 / 100 = 最终优惠比例 BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); 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 dc489a66..507ca929 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -246,7 +246,7 @@ public class HighOrderController { childOrder.setGasOrgName(oilStation.getOrganizationName()); // 价格 - HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), childOrder.getGasOilNo()); + HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(1, oilStation.getId(), childOrder.getGasOilNo()); if (priceRate == null) { discount = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo()).getPriceRate(); } else { diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index bae704b1..42c9b486 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode; import com.hai.config.TuanYouConfig; import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighMerchantStore; +import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.service.HighGasOilPriceService; @@ -88,6 +89,7 @@ public class HighGasSchedule { highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); 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 974f905d..011939e4 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -62,6 +62,34 @@ public class CommonSysConfig { private String CzUrl; private String CzAppSecret; + private String unionAppId; + private String unionSecret; + private String unionRsaKey; + + public String getUnionAppId() { + return unionAppId; + } + + public void setUnionAppId(String unionAppId) { + this.unionAppId = unionAppId; + } + + public String getUnionSecret() { + return unionSecret; + } + + public void setUnionSecret(String unionSecret) { + this.unionSecret = unionSecret; + } + + public String getUnionRsaKey() { + return unionRsaKey; + } + + public void setUnionRsaKey(String unionRsaKey) { + this.unionRsaKey = unionRsaKey; + } + public String getTuanYouUrl() { return tuanYouUrl; } diff --git a/hai-service/src/main/java/com/hai/config/UnionUserConfig.java b/hai-service/src/main/java/com/hai/config/UnionUserConfig.java index 1ebe4997..8a17cd52 100644 --- a/hai-service/src/main/java/com/hai/config/UnionUserConfig.java +++ b/hai-service/src/main/java/com/hai/config/UnionUserConfig.java @@ -1,16 +1,13 @@ package com.hai.config; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hai.common.pay.util.sdk.WXPayConstants; -import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.RedisUtil; import com.hai.common.utils.UnionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import javax.ws.rs.core.MediaType; import javax.xml.bind.DatatypeConverter; import java.security.KeyPair; import java.security.KeyPairGenerator; @@ -28,12 +25,13 @@ import java.util.*; public class UnionUserConfig { private static String requestUrl = "https://open.95516.com/open/access/1.0/"; - private static String appId = "cf56ac6f9f6b4744bfba9e5587db147c"; - private static String secret = "665193ddd44248acb461594cfe0ded5b"; - private static String rsaKey = "df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7"; + private static String appId = CommonSysConst.getSysConfig().getUnionAppId(); + private static String secret = CommonSysConst.getSysConfig().getUnionSecret(); + private static String rsaKey = CommonSysConst.getSysConfig().getUnionRsaKey(); @Resource private RedisUtil redisUtil; + /** * 获取应用访问令牌backendToken * @return 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 92370fec..c466a009 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java @@ -43,12 +43,14 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { "oil_no_name, price_vip, ", "price_gun, price_official, ", "oil_type, oil_type_name, ", - "ext_1, ext_2, ext_3)", + "`status`, ext_1, ext_2, ", + "ext_3)", "values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ", "#{oilNoName,jdbcType=VARCHAR}, #{priceVip,jdbcType=DECIMAL}, ", "#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ", "#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighGasOilPrice record); @@ -68,6 +70,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Result(column="price_official", property="priceOfficial", 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), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) @@ -77,7 +80,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Select({ "select", "id, merchant_store_id, oil_no, oil_no_name, price_vip, price_gun, price_official, ", - "oil_type, oil_type_name, ext_1, ext_2, ext_3", + "oil_type, oil_type_name, `status`, ext_1, ext_2, ext_3", "from high_gas_oil_price", "where id = #{id,jdbcType=BIGINT}" }) @@ -91,6 +94,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { @Result(column="price_official", property="priceOfficial", 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), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) @@ -116,6 +120,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt { "price_official = #{priceOfficial,jdbcType=DECIMAL},", "oil_type = #{oilType,jdbcType=INTEGER},", "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_3 = #{ext3,jdbcType=VARCHAR}", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java index b404f35d..d065c26e 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java @@ -25,6 +25,7 @@ public interface HighGasOilPriceMapperExt { " WHERE" + " a.merchant_store_id = b.id " + " AND b.`status` = 1 " + + " AND a.`status` = 1 " + " AND b.region_id = #{regionId} " + " AND a.oil_no_name = #{oilNoName}" + " and b.store_name like '%${storeName}%'" + 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 7742a3f2..0a028dea 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("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); } + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -90,6 +94,7 @@ public class HighGasOilPriceSqlProvider { sql.SELECT("price_official"); sql.SELECT("oil_type"); sql.SELECT("oil_type_name"); + sql.SELECT("`status`"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -146,6 +151,10 @@ public class HighGasOilPriceSqlProvider { sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); } + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -175,6 +184,7 @@ public class HighGasOilPriceSqlProvider { sql.SET("price_official = #{record.priceOfficial,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}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); @@ -220,6 +230,10 @@ public class HighGasOilPriceSqlProvider { sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); } + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java b/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java index 7dbf717d..25285ba3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java @@ -39,16 +39,16 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_ty_agent_price (ty_agent_oil_station_id, oil_no_name, ", - "oil_no, price_rate, ", - "`status`, create_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", - "values (#{tyAgentOilStationId,jdbcType=BIGINT}, #{oilNoName,jdbcType=VARCHAR}, ", - "#{oilNo,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ", - "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into high_ty_agent_price (belong_type, ty_agent_oil_station_id, ", + "oil_no_name, oil_no, ", + "price_rate, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{belongType,jdbcType=INTEGER}, #{tyAgentOilStationId,jdbcType=BIGINT}, ", + "#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ", + "#{priceRate,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighTyAgentPrice record); @@ -60,6 +60,7 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt { @SelectProvider(type=HighTyAgentPriceSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER), @Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @@ -75,13 +76,14 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt { @Select({ "select", - "id, ty_agent_oil_station_id, oil_no_name, oil_no, price_rate, `status`, create_time, ", - "update_time, ext_1, ext_2, ext_3", + "id, belong_type, ty_agent_oil_station_id, oil_no_name, oil_no, price_rate, `status`, ", + "create_time, update_time, ext_1, ext_2, ext_3", "from high_ty_agent_price", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER), @Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @@ -106,7 +108,8 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt { @Update({ "update high_ty_agent_price", - "set ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},", + "set belong_type = #{belongType,jdbcType=INTEGER},", + "ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},", "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", "oil_no = #{oilNo,jdbcType=VARCHAR},", "price_rate = #{priceRate,jdbcType=DECIMAL},", diff --git a/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java index 77c7fbe8..266b2c93 100644 --- a/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java @@ -28,6 +28,10 @@ public class HighTyAgentPriceSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("high_ty_agent_price"); + if (record.getBelongType() != null) { + sql.VALUES("belong_type", "#{belongType,jdbcType=INTEGER}"); + } + if (record.getTyAgentOilStationId() != null) { sql.VALUES("ty_agent_oil_station_id", "#{tyAgentOilStationId,jdbcType=BIGINT}"); } @@ -78,6 +82,7 @@ public class HighTyAgentPriceSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("belong_type"); sql.SELECT("ty_agent_oil_station_id"); sql.SELECT("oil_no_name"); sql.SELECT("oil_no"); @@ -109,6 +114,10 @@ public class HighTyAgentPriceSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getBelongType() != null) { + sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}"); + } + if (record.getTyAgentOilStationId() != null) { sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}"); } @@ -158,6 +167,7 @@ public class HighTyAgentPriceSqlProvider { sql.UPDATE("high_ty_agent_price"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}"); sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); @@ -178,6 +188,10 @@ public class HighTyAgentPriceSqlProvider { SQL sql = new SQL(); sql.UPDATE("high_ty_agent_price"); + if (record.getBelongType() != null) { + sql.SET("belong_type = #{belongType,jdbcType=INTEGER}"); + } + if (record.getTyAgentOilStationId() != null) { sql.SET("ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT}"); } 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 86d468b6..cc422ef4 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 String oilTypeName; + /** + * 状态 0:删除 1:正常 2:禁用 + */ + private Integer status; + private String ext1; private String ext2; @@ -138,6 +143,14 @@ public class HighGasOilPrice implements Serializable { this.oilTypeName = oilTypeName; } + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + public String getExt1() { return ext1; } @@ -183,6 +196,7 @@ public class HighGasOilPrice implements Serializable { && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) && (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())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); @@ -201,6 +215,7 @@ public class HighGasOilPrice implements Serializable { result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().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()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); @@ -222,6 +237,7 @@ public class HighGasOilPrice implements Serializable { sb.append(", priceOfficial=").append(priceOfficial); sb.append(", oilType=").append(oilType); sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", status=").append(status); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); 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 76109a29..1212ee50 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java @@ -685,6 +685,66 @@ public class HighGasOilPriceExample { return (Criteria) this; } + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java b/hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java index e173b643..7335748f 100644 --- a/hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java +++ b/hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java @@ -16,6 +16,11 @@ import java.util.Date; public class HighTyAgentPrice implements Serializable { private Long id; + /** + * 类型 1:平台 2:代理商 + */ + private Integer belongType; + /** * 代理油站id */ @@ -67,6 +72,14 @@ public class HighTyAgentPrice implements Serializable { this.id = id; } + public Integer getBelongType() { + return belongType; + } + + public void setBelongType(Integer belongType) { + this.belongType = belongType; + } + public Long getTyAgentOilStationId() { return tyAgentOilStationId; } @@ -160,6 +173,7 @@ public class HighTyAgentPrice implements Serializable { } HighTyAgentPrice other = (HighTyAgentPrice) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getBelongType() == null ? other.getBelongType() == null : this.getBelongType().equals(other.getBelongType())) && (this.getTyAgentOilStationId() == null ? other.getTyAgentOilStationId() == null : this.getTyAgentOilStationId().equals(other.getTyAgentOilStationId())) && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) @@ -177,6 +191,7 @@ public class HighTyAgentPrice implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getBelongType() == null) ? 0 : getBelongType().hashCode()); result = prime * result + ((getTyAgentOilStationId() == null) ? 0 : getTyAgentOilStationId().hashCode()); result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); @@ -197,6 +212,7 @@ public class HighTyAgentPrice implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", belongType=").append(belongType); sb.append(", tyAgentOilStationId=").append(tyAgentOilStationId); sb.append(", oilNoName=").append(oilNoName); sb.append(", oilNo=").append(oilNo); diff --git a/hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java b/hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java index 90f115cb..a1e1b167 100644 --- a/hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java @@ -186,6 +186,66 @@ public class HighTyAgentPriceExample { return (Criteria) this; } + public Criteria andBelongTypeIsNull() { + addCriterion("belong_type is null"); + return (Criteria) this; + } + + public Criteria andBelongTypeIsNotNull() { + addCriterion("belong_type is not null"); + return (Criteria) this; + } + + public Criteria andBelongTypeEqualTo(Integer value) { + addCriterion("belong_type =", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeNotEqualTo(Integer value) { + addCriterion("belong_type <>", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeGreaterThan(Integer value) { + addCriterion("belong_type >", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("belong_type >=", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeLessThan(Integer value) { + addCriterion("belong_type <", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeLessThanOrEqualTo(Integer value) { + addCriterion("belong_type <=", value, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeIn(List values) { + addCriterion("belong_type in", values, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeNotIn(List values) { + addCriterion("belong_type not in", values, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeBetween(Integer value1, Integer value2) { + addCriterion("belong_type between", value1, value2, "belongType"); + return (Criteria) this; + } + + public Criteria andBelongTypeNotBetween(Integer value1, Integer value2) { + addCriterion("belong_type not between", value1, value2, "belongType"); + return (Criteria) this; + } + public Criteria andTyAgentOilStationIdIsNull() { addCriterion("ty_agent_oil_station_id is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/GasOilPriceStatusEnum.java b/hai-service/src/main/java/com/hai/enum_type/GasOilPriceStatusEnum.java new file mode 100644 index 00000000..a4ae3aa5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasOilPriceStatusEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 油站油品价格状态 + * @author hurui + */ +public enum GasOilPriceStatusEnum { + status0(0 , "删除"), + status1(1 , "正常"), + status2(2 , "禁用"), + ; + + private Integer status; + private String name; + + GasOilPriceStatusEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java b/hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java index 9b3d2c2e..840ee274 100644 --- a/hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java +++ b/hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java @@ -16,9 +16,11 @@ public interface HighTyAgentPriceService { /** * 根据代理油站id 查询详情 + * @param belongType * @param tyAgentOilStationId + * @param oilNo * @return */ - HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo); + HighTyAgentPrice getDetail(Integer belongType, Long tyAgentOilStationId, String oilNo); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java index b601cb90..56ed3aba 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java @@ -3,6 +3,7 @@ package com.hai.service.impl; import com.hai.dao.HighGasOilPriceMapper; import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighGasOilPriceExample; +import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.service.HighGasOilPriceService; import org.springframework.stereotype.Service; @@ -21,6 +22,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService { if (highGasOilPrice.getId() != null) { highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice); } else { + highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); highGasOilPriceMapper.insert(highGasOilPrice); } } @@ -39,7 +41,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService { @Override public List getGasOilPriceByStore(Long storeId) { HighGasOilPriceExample example = new HighGasOilPriceExample(); - example.createCriteria().andMerchantStoreIdEqualTo(storeId); + example.createCriteria().andMerchantStoreIdEqualTo(storeId).andStatusNotEqualTo(0); return highGasOilPriceMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java index 85e5bb32..34275f6d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java @@ -30,9 +30,10 @@ public class HighTyAgentPriceServiceImpl implements HighTyAgentPriceService { } @Override - public HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo) { + public HighTyAgentPrice getDetail(Integer belongType, Long tyAgentOilStationId, String oilNo) { HighTyAgentPriceExample example = new HighTyAgentPriceExample(); example.createCriteria() + .andBelongTypeEqualTo(belongType) .andStatusEqualTo(1) .andTyAgentOilStationIdEqualTo(tyAgentOilStationId) .andOilNoEqualTo(oilNo); diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index ac35f2e5..9842dcac 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -56,3 +56,8 @@ CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback CzAppKey = eaomqcbpdz7yjfih CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/ CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8 + + +unionAppId=7113783e75354df2a985efd3f31b9528 +unionSecret=e2c731d2a026469aa6d218432f361653 +unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c diff --git a/hai-service/src/main/resources/pre/commonConfig.properties b/hai-service/src/main/resources/pre/commonConfig.properties index a97d4c4f..a21ce8f3 100644 --- a/hai-service/src/main/resources/pre/commonConfig.properties +++ b/hai-service/src/main/resources/pre/commonConfig.properties @@ -42,3 +42,8 @@ wx_cert=/home/project/wx_cert/ TelApiKey=2d01f6b520254b1a80f6b167832cea18 TelApiSecret=d11ee9b41e014a039f030e53ae6f5295 TelMemberId=d13091df65d64aafbf0f35d2093157b7 + + +unionAppId=7113783e75354df2a985efd3f31b9528 +unionSecret=e2c731d2a026469aa6d218432f361653 +unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c diff --git a/hai-service/src/main/resources/prod-9401/commonConfig.properties b/hai-service/src/main/resources/prod-9401/commonConfig.properties index 80e38a1e..ab28d1d7 100644 --- a/hai-service/src/main/resources/prod-9401/commonConfig.properties +++ b/hai-service/src/main/resources/prod-9401/commonConfig.properties @@ -51,3 +51,7 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback CzAppKey = p429mlj3cvn5hb07 CzUrl = https://jj.dmjvip.com/index.php/third/mobile/ CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij + +unionAppId=cf56ac6f9f6b4744bfba9e5587db147c +unionSecret=665193ddd44248acb461594cfe0ded5b +unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7 diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 69a7bfff..47b6ade2 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -51,3 +51,8 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback CzAppKey = p429mlj3cvn5hb07 CzUrl = https://jj.dmjvip.com/index.php/third/mobile/ CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij + + +unionAppId=cf56ac6f9f6b4744bfba9e5587db147c +unionSecret=665193ddd44248acb461594cfe0ded5b +unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7