Merge branch 'new-dev' into 2.0-dev

# Conflicts:
#	hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java
#	hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
master
袁野 8 months ago
parent 37f768ac18
commit 54e0b04eb6
  1. 279
      hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java
  2. 78
      hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 4
      hai-bweb/src/main/resources/prod/application.yml
  5. 2
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  6. 38
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  7. 4
      hai-cweb/src/main/resources/prod-9401/application.yml
  8. 4
      hai-cweb/src/main/resources/prod/application.yml
  9. 2
      hai-msg/src/main/resources/pre/application.yml
  10. 4
      hai-order/src/main/java/com/web/controller/OrderController.java
  11. 2
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  12. 4
      hai-order/src/main/resources/prod/application.yml
  13. 12
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  14. 4
      hai-schedule/src/main/resources/prod/application.yml
  15. 6
      hai-service/pom.xml
  16. 462
      hai-service/src/main/java/com/hai/common/utils/RSAUtil.java
  17. 9
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  18. 236
      hai-service/src/main/java/com/hai/config/EtcService.java
  19. 71
      hai-service/src/main/java/com/hai/config/PetroConfig.java
  20. 13
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  21. 2
      hai-service/src/main/java/com/hai/enum_type/TripartiteReqLogType.java
  22. 72
      hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java
  23. 68
      hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java
  24. 81
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java
  25. 72
      hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java
  26. 97
      hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java
  27. 11
      hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java
  28. 53
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java
  29. 24
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
  30. 2
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  31. 29
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  32. 67
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  33. 9
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  34. 1
      hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java
  35. 1
      hai-service/src/main/java/com/hai/order/type/OrderProductType.java
  36. 1
      hai-service/src/main/java/com/hai/order/type/RechargePlatformType.java
  37. 4
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java
  38. 2
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  39. 231
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  40. 49
      hai-service/src/main/resources/dev/commonConfig.properties
  41. 2
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  42. 11
      hai-service/src/main/resources/prod/commonConfig.properties
  43. 4
      hai-user/src/main/resources/prod/application.yml
  44. 66
      v1/src/main/java/com/v1/controller/business/ApiCouponController.java
  45. 9
      v1/src/main/java/com/v1/controller/business/GzSinopecController.java
  46. 9
      v1/src/main/java/com/v1/controller/orderController.java
  47. 2
      v1/src/main/resources/pre/application.yml
  48. 4
      v1/src/main/resources/prod/application.yml

@ -0,0 +1,279 @@
package com.bweb.controller.Etc;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.EtcService;
import com.hai.entity.*;
import com.hai.etc.EtcCarMsgService;
import com.hai.etc.EtcCustMsgService;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value="/etcCustomer")
@Api(value="etc客户信息")
public class EtcCustomerController {
Logger log = LoggerFactory.getLogger(EtcCustomerController.class);
@Resource
private UserCenter userCenter;
@Resource
private EtcCustMsgService etcCustMsgService;
@Resource
private EtcCarMsgService etcCarMsgService;
@RequestMapping(value = "/getEtcCustList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户列表")
public ResponseData getEtcCustList(
@RequestParam(value = "custName", required = false) String custName,
@RequestParam(value = "phone", required = false) String phone, HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(5);
map.put("userId", userInfoModel.getSecUser().getId());
map.put("custName", custName);
map.put("phone", phone);
return ResponseMsgUtil.success(etcCustMsgService.getEtcCustList(map));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "insertCustomer" , method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增客户基本信息")
public ResponseData insertCustomer(@RequestBody EtcCustMsg etcCustMsg , HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (etcCustMsg == null
|| etcCustMsg.getPhone() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
etcCustMsg.setUserId(userInfoModel.getSecUser().getId());
etcCustMsg.setUserName(userInfoModel.getSecUser().getUserName());
etcCustMsg.setCreateTime(new Date());
etcCustMsg.setUpdateTime(new Date());
etcCustMsg.setStatus(0);
etcCustMsgService.insertEtcCust(etcCustMsg);
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findByCustomer", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData findByCustomer(@RequestParam(value = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(etcCustMsgService.findEtcCustById(id));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "editCustomer" , method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑客户基本信息")
public ResponseData editCustomer(@RequestBody EtcCustMsg etcCustMsg , HttpServletRequest request) {
try {
if (etcCustMsg == null
|| etcCustMsg.getBankPhone() == null
|| etcCustMsg.getAccountNo() == null
|| etcCustMsg.getAddress() == null
|| etcCustMsg.getCustAgentIdBront() == null
|| etcCustMsg.getCustAgentIdFront() == null
|| etcCustMsg.getBankCard() == null
|| etcCustMsg.getBankName() == null
|| etcCustMsg.getCustIdNo() == null
|| etcCustMsg.getCustName() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
etcCustMsg.setUpdateTime(new Date());
etcCustMsgService.updateEtcCust(etcCustMsg);
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "editCarMsg" , method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑基本信息")
public ResponseData editCarMsg(@RequestBody EtcCarMsg etcCarMsg , HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (etcCarMsg == null
|| etcCarMsg.getCustId() == null
|| etcCarMsg.getProductId() == null
|| etcCarMsg.getCardVarietyId() == null
|| etcCarMsg.getVehPlateNo() == null
|| etcCarMsg.getVehPlateColor() == null
|| etcCarMsg.getVehType() == null
|| etcCarMsg.getAxlesNum() == null
|| etcCarMsg.getWheelsNum() == null
|| etcCarMsg.getDrivlicMainFro() == null
|| etcCarMsg.getDrivlicSubFro() == null
|| etcCarMsg.getHeadStockPhoto() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
etcCarMsg.setUserId(userInfoModel.getSecUser().getId());
etcCarMsg.setUserName(userInfoModel.getSecUser().getUserName());
etcCarMsg.setUpdateTime(new Date());
etcCarMsg.setVehStatus(11);
etcCarMsgService.insertEtcCar(etcCarMsg);
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询车辆列表")
public ResponseData getEtcCarMsgList(
@RequestParam(value = "vehPlateNo", required = false) String vehPlateNo, HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(5);
map.put("userId", userInfoModel.getSecUser().getId());
map.put("vehPlateNo", vehPlateNo);
return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/sendRealNameCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "请求实名认证")
public ResponseData sendRealNameCode(@RequestParam(value = "id", required = true) Long id) {
try {
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustById(id);
if (etcCustMsg == null || etcCustMsg.getCustId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!");
}
JSONObject object = EtcService.sendRealNameCode(etcCustMsg.getCustId());
if (object.getString("errCode").equals("0")) {
return ResponseMsgUtil.success("请求成功!");
}
return ResponseMsgUtil.success(object.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/checkRealNameCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "验证实名认证编码")
public ResponseData checkRealNameCode(@RequestParam(value = "id", required = true) Long id ,
@RequestParam(value = "verifyCode", required = true) String verifyCode ) {
try {
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustById(id);
if (etcCustMsg == null || etcCustMsg.getCustId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!");
}
JSONObject object = EtcService.checkRealNameCode(etcCustMsg.getCustId() , verifyCode);
if (object.getString("errCode").equals("0")) {
return ResponseMsgUtil.success("请求成功!");
}
return ResponseMsgUtil.success(object.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findByCarMsg", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData findByCarMsg(@RequestParam(value = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(etcCarMsgService.findEtcCarById(id));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,78 @@
package com.bweb.controller.Etc;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.model.ResponseData;
import com.hai.ocr.AliYunOcrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
@Controller
@RequestMapping(value = "/ocr")
@Api(value = "ocr识别")
public class OcrController {
private static Logger log = LoggerFactory.getLogger(OcrController.class);
@Resource
private UserCenter userCenter;
@RequestMapping(value="/recognizeIdCard",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "身份证识别")
public ResponseData recognizeIdCard(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeIdCard(CommonSysConst.getSysConfig().getFilesystem()+ url));
} catch (Exception e) {
log.error("recognizeIdCard error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/recognizeBankCard",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "银行卡识别")
public ResponseData recognizeBankCard(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeBankCard(CommonSysConst.getSysConfig().getFilesystem()+ url));
} catch (Exception e) {
log.error("recognizeBankCard error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/recognizeBankAccount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "银行开户许可证识别")
public ResponseData recognizeBankAccount(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeBankAccount(CommonSysConst.getSysConfig().getFilesystem()+ url));
} catch (Exception e) {
log.error("recognizeBankCard error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/recognizeBusinessLicense",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "营业执照识别")
public ResponseData recognizeBusinessLicense(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeBusinessLicense(CommonSysConst.getSysConfig().getFilesystem()+ url));
} catch (Exception e) {
log.error("recognizeBusinessLicense error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

File diff suppressed because one or more lines are too long

@ -42,7 +42,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -67,7 +67,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

@ -277,6 +277,7 @@ public class HighCouponController {
// 类型: 1 贵州中石化 2 重庆中石油
if (couponCodeOther.getType() != null && couponCodeOther.getType().equals(2)) {
// 获取动态核销码
JSONObject code = ChongQingCNPCService.getCNPCCheckCode(couponCodeOther.getCouNo(), order.getOrderNo());
@ -284,6 +285,7 @@ public class HighCouponController {
String qrCodeImgUrl = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(1) +".jpg";
QRCodeGenerator.generateQRCodeImage(code.getString("checkCode"), 350, 350, SysConst.getSysConfig().getFileUrl()+"/temporary/"+qrCodeImgUrl);
return ResponseMsgUtil.success(qrCodeImgUrl);
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "生成失败");

@ -175,6 +175,7 @@ public class HighGasController {
}
} else if (MapUtils.getInteger(map, "source_type").equals(2)) {
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
@ -216,43 +217,6 @@ public class HighGasController {
}
}
@RequestMapping(value="/oilPriceCompute",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "油价计算")
public ResponseData oilPriceCompute(@RequestParam(name = "price", required = true) BigDecimal price,
@RequestParam(name = "goodsId", required = true) Long goodsId,
@RequestParam(name = "oilNo", required = true) String oilNo,
@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) {
try {
BigDecimal discount = new BigDecimal("1");
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, goodsId, oilNo);
if (tyAgentPrice != null) {
discount = tyAgentPrice.getPriceRate();
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(oilNo);
if (gasDiscountOilPrice != null) {
discount = gasDiscountOilPrice.getPriceRate();
}
}
if (isTyAgent != null && isTyAgent.equals(true)) {
// 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(2, goodsId, oilNo);
if (priceRate == null) {
discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate();
} else {
discount = priceRate.getPriceRate();
}
}
return ResponseMsgUtil.success(price.multiply(discount.divide(new BigDecimal("100"))).setScale(2,BigDecimal.ROUND_HALF_UP));
} catch (Exception e) {
log.error("HighGasController -> oilPriceCompute() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/oilPriceDiscountCompute",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "油价优惠计算")

@ -43,7 +43,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -68,7 +68,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

@ -43,7 +43,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -68,7 +68,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://122.9.135.148:3306/hsg_prod?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://1.95.43.71:3306/hsg_prod?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -120,7 +120,9 @@ public class OrderController {
// 校验子订单参数
if (childModel.getGoodsType() == null
|| OrderChildGoodsType.getDataByType(childModel.getGoodsType()) == null
|| childModel.getGoodsId() == null
|| childModel.getSaleCount() == null) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

@ -387,7 +387,7 @@ public class OrderPayController {
weChatPayReqInfo.setBody(orderTitle); // 商品描述
weChatPayReqInfo.setOut_trade_no(order.getOrderNo()); // 商户订单号
weChatPayReqInfo.setTotal_fee(total_fee); // 总金额
weChatPayReqInfo.setSpbill_create_ip("122.9.135.148"); // 终端ip
weChatPayReqInfo.setSpbill_create_ip("1.95.43.71"); // 终端ip
weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getWxPayNotifyUrl()); // 通知url
weChatPayReqInfo.setTrade_type("JSAPI"); // 交易类型
weChatPayReqInfo.setAttach(null); // 附件参数

@ -42,7 +42,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -61,7 +61,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
access-key: huifu
secret-key: huifukeji2013@!

@ -107,7 +107,7 @@ public class HighGasSchedule {
// }
// } else {
// highMerchantStore = new HighMerchantStore();
// highMerchantStore.setType(1);
// highMerchantStore.setType(1);DDD
// highMerchantStore.setSourceType(2);
// highMerchantStore.setMerchantId(merchant.getId());
// highMerchantStore.setCompanyId(merchant.getCompanyId());
@ -158,12 +158,12 @@ public class HighGasSchedule {
// gasService.getPayloAllStation();
// }
// @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
// public void getDianAllStation() throws Exception {
// gasService.getDianAllStation();
// }
@Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
public void getDianAllStation() throws Exception {
gasService.getDianAllStation();
}
@Scheduled(cron = "0 5 0 * * ?") // 每日凌晨00:00:7执行一次
@Scheduled(cron = "0 0 1 * * ?") // 每日凌晨00:00:7执行一次
public void deleteOilNo() {
gasService.deleteOilNo();
}

@ -43,7 +43,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -68,7 +68,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

@ -314,6 +314,12 @@
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>ocr_api20210707</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.gavaghan</groupId>
<artifactId>geodesy</artifactId>

@ -0,0 +1,462 @@
package com.hai.common.utils;
import org.apache.commons.lang3.ArrayUtils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.crypto.Cipher;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
/**
* @Description RSAUtil
* @Author aili
**/
public class RSAUtil {
public static final String KEY_ALGORTHM = "RSA";
public static final String SIGNATURE_ALGORITHM = "MD5withRSA";
private static final int MAX_ENCRYPT_BLOCK = 117;
/**
* 用公钥加密
*
* @param data 加密数据
* @param key 密钥
* @return
* @throws Exception
*/
public static byte[] encryptByPublicKey(byte[] data, String key) throws Exception {
//对公钥解密
byte[] keyBytes = decryptBASE64(key);
//取公钥
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM);
Key publicKey = keyFactory.generatePublic(x509EncodedKeySpec);
//对数据解密
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
//return cipher.doFinal(data);
byte[] enBytes = null;
for (int i = 0; i < data.length; i += MAX_ENCRYPT_BLOCK) {
// 注意要使用2的倍数,否则会出现加密后的内容再解密时为乱码
byte[] doFinal = cipher.doFinal(ArrayUtils.subarray(data, i, i + MAX_ENCRYPT_BLOCK));
enBytes = ArrayUtils.addAll(enBytes, doFinal);
}
return enBytes;
}
/**
* 用私钥对信息生成数字签名
*
* @param data //加密数据
* @param privateKey //私钥
* @return
* @throws Exception
*/
public static String sign(byte[] data, String privateKey) throws Exception {
//解密私钥
byte[] keyBytes = decryptBASE64(privateKey);
//构造PKCS8EncodedKeySpec对象
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(keyBytes);
//指定加密算法
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM);
//取私钥匙对象
PrivateKey privateKey2 = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
//用私钥对信息生成数字签名
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
signature.initSign(privateKey2);
signature.update(data);
return encryptBASE64(signature.sign());
}
/**
* 私钥解密
* @param str
* @param key
* @return
* @throws Exception
*/
public static String decryptByPrivate(String str, String key) throws Exception{
//64位解码加密后的字符串
byte[] inputByte = decryptBASE64(str);
//base64编码的私钥
byte[] decoded = decryptBASE64(key);
RSAPrivateKey priKey = (RSAPrivateKey) KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(decoded));
//RSA解密
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, priKey);
String outStr = new String(cipher.doFinal(inputByte));
return outStr;
}
/**
* BASE64解密
*
* @param key
* @return
* @throws Exception
*/
public static byte[] decryptBASE64(String key) throws Exception {
return (new BASE64Decoder()).decodeBuffer(key);
}
/**
* BASE64加密
*
* @param key
* @return
* @throws Exception
*/
public static String encryptBASE64(byte[] key) throws Exception {
return (new BASE64Encoder()).encodeBuffer(key);
}
/**
* 解密动态核销码 dynamicCode
* @param data
* @param key
* @return
* @throws Exception
*/
public static String decryptByPrivateKey(String data, String key) throws Exception {
//对私钥解密
byte[] keyBytes = decryptBASE64(key);
//64位解码加密后的字符串
byte[] inputByte = decryptBASE64(data);
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM);
Key privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
//对数据解密
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, privateKey);
int decryptBlock = 1024 / 8;
byte[] deBytes = null;
for (int i = 0; i < inputByte.length; i += decryptBlock) {
byte[] doFinal = cipher.doFinal(ArrayUtils.subarray(inputByte, i, i + decryptBlock));
deBytes = ArrayUtils.addAll(deBytes, doFinal);
}
return new String(deBytes);
}
/**
* 校验数字签名
*
* @param data 加密数据
* @param publicKey 公钥
* @param sign 数字签名
* @return
* @throws Exception
*/
public static boolean verify(byte[] data, String publicKey, String sign) throws Exception {
//解密公钥
byte[] keyBytes = decryptBASE64(publicKey);
//构造PKCS8EncodedKeySpec对象
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes);
//指定加密算法
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM);
//取公钥匙对象
PublicKey publicKey2 = keyFactory.generatePublic(x509EncodedKeySpec);
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
signature.initVerify(publicKey2);
signature.update(data);
//验证签名是否正常
return signature.verify(decryptBASE64(sign));
}
/**
* Base64 编码和解码
*/
static class Base64 {
static private final int BASELENGTH = 128;
static private final int LOOKUPLENGTH = 64;
static private final int TWENTYFOURBITGROUP = 24;
static private final int EIGHTBIT = 8;
static private final int SIXTEENBIT = 16;
static private final int FOURBYTE = 4;
static private final int SIGN = -128;
static private final char PAD = '=';
static private final boolean fDebug = false;
static final private byte[] base64Alphabet = new byte[BASELENGTH];
static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
static {
for (int i = 0; i < BASELENGTH; ++i) {
base64Alphabet[i] = -1;
}
for (int i = 'Z'; i >= 'A'; i--) {
base64Alphabet[i] = (byte) (i - 'A');
}
for (int i = 'z'; i >= 'a'; i--) {
base64Alphabet[i] = (byte) (i - 'a' + 26);
}
for (int i = '9'; i >= '0'; i--) {
base64Alphabet[i] = (byte) (i - '0' + 52);
}
base64Alphabet['+'] = 62;
base64Alphabet['/'] = 63;
for (int i = 0; i <= 25; i++) {
lookUpBase64Alphabet[i] = (char) ('A' + i);
}
for (int i = 26, j = 0; i <= 51; i++, j++) {
lookUpBase64Alphabet[i] = (char) ('a' + j);
}
for (int i = 52, j = 0; i <= 61; i++, j++) {
lookUpBase64Alphabet[i] = (char) ('0' + j);
}
lookUpBase64Alphabet[62] = (char) '+';
lookUpBase64Alphabet[63] = (char) '/';
}
private static boolean isWhiteSpace(char octect) {
return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
}
private static boolean isPad(char octect) {
return (octect == PAD);
}
private static boolean isData(char octect) {
return (octect < BASELENGTH && base64Alphabet[octect] != -1);
}
/**
* Encodes hex octects into Base64
*
* @param binaryData Array containing binaryData
* @return Encoded Base64 array
*/
public static String encode(byte[] binaryData) {
if (binaryData == null) {
return null;
}
int lengthDataBits = binaryData.length * EIGHTBIT;
if (lengthDataBits == 0) {
return "";
}
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
char encodedData[] = null;
encodedData = new char[numberQuartet * 4];
byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
int encodedIndex = 0;
int dataIndex = 0;
if (fDebug) {
System.out.println("number of triplets = " + numberTriplets);
}
for (int i = 0; i < numberTriplets; i++) {
b1 = binaryData[dataIndex++];
b2 = binaryData[dataIndex++];
b3 = binaryData[dataIndex++];
if (fDebug) {
System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
}
l = (byte) (b2 & 0x0f);
k = (byte) (b1 & 0x03);
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
if (fDebug) {
System.out.println("val2 = " + val2);
System.out.println("k4 = " + (k << 4));
System.out.println("vak = " + (val2 | (k << 4)));
}
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
}
// form integral number of 6-bit groups
if (fewerThan24bits == EIGHTBIT) {
b1 = binaryData[dataIndex];
k = (byte) (b1 & 0x03);
if (fDebug) {
System.out.println("b1=" + b1);
System.out.println("b1<<2 = " + (b1 >> 2));
}
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
encodedData[encodedIndex++] = PAD;
encodedData[encodedIndex++] = PAD;
} else if (fewerThan24bits == SIXTEENBIT) {
b1 = binaryData[dataIndex];
b2 = binaryData[dataIndex + 1];
l = (byte) (b2 & 0x0f);
k = (byte) (b1 & 0x03);
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
encodedData[encodedIndex++] = PAD;
}
return new String(encodedData);
}
/**
* Decodes Base64 data into octects
*
* @param encoded string containing Base64 data
* @return Array containind decoded data.
*/
public static byte[] decode(String encoded) {
if (encoded == null) {
return null;
}
char[] base64Data = encoded.toCharArray();
// remove white spaces
int len = removeWhiteSpace(base64Data);
if (len % FOURBYTE != 0) {
return null;//should be divisible by four
}
int numberQuadruple = (len / FOURBYTE);
if (numberQuadruple == 0) {
return new byte[0];
}
byte decodedData[] = null;
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
int i = 0;
int encodedIndex = 0;
int dataIndex = 0;
decodedData = new byte[(numberQuadruple) * 3];
for (; i < numberQuadruple - 1; i++) {
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|| !isData((d3 = base64Data[dataIndex++]))
|| !isData((d4 = base64Data[dataIndex++]))) {
return null;
}//if found "no data" just return null
b1 = base64Alphabet[d1];
b2 = base64Alphabet[d2];
b3 = base64Alphabet[d3];
b4 = base64Alphabet[d4];
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
}
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
return null;//if found "no data" just return null
}
b1 = base64Alphabet[d1];
b2 = base64Alphabet[d2];
d3 = base64Data[dataIndex++];
d4 = base64Data[dataIndex++];
if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
if (isPad(d3) && isPad(d4)) {
if ((b2 & 0xf) != 0)//last 4 bits should be zero
{
return null;
}
byte[] tmp = new byte[i * 3 + 1];
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
return tmp;
} else if (!isPad(d3) && isPad(d4)) {
b3 = base64Alphabet[d3];
if ((b3 & 0x3) != 0)//last 2 bits should be zero
{
return null;
}
byte[] tmp = new byte[i * 3 + 2];
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
return tmp;
} else {
return null;
}
} else { //No PAD e.g 3cQl
b3 = base64Alphabet[d3];
b4 = base64Alphabet[d4];
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
}
return decodedData;
}
/**
* remove WhiteSpace from MIME containing encoded Base64 data.
*
* @param data the byte array of base64 data (with WS)
* @return the new length
*/
private static int removeWhiteSpace(char[] data) {
if (data == null) {
return 0;
}
// count characters that's not whitespace
int newSize = 0;
int len = data.length;
for (int i = 0; i < len; i++) {
if (!isWhiteSpace(data[i])) {
data[newSize++] = data[i];
}
}
return newSize;
}
}
}

@ -159,4 +159,13 @@ public class CommonSysConfig {
private String GzPetroAppKey;
private String GzPetroAesKey;
private String EtcPostUrl;
private String EtcChannelCode;
private String EtcPublicKey;
private String EtcPrivateKey;
private String NdPostUrl;
private String NdOrgCode;
private String NdKey;
}

@ -0,0 +1,236 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.WxUtils;
import com.hai.entity.EtcCarMsg;
import com.hai.entity.EtcCustMsg;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.context.annotation.Configuration;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
/**
* @serviceName QrCodeUtilsConfig.java
* @author Sum1Dream
* @version 1.0.0
* @Description // Etc申请管理
* @createTime 09:54 2022/4/13
**/
@Configuration
public class EtcService {
/**
* @Author Sum1Dream
* @Name submitCustInfo
* @Description // 客户信息提交
* @Date 16:31 2024/3/25
* @Param etcCustMsg
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject submitCustInfo(EtcCustMsg etcCustMsg) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custName" , etcCustMsg.getCustName());
jsonObject.put("custIdNo" , etcCustMsg.getCustIdNo());
jsonObject.put("accountNo" , etcCustMsg.getAccountNo());
jsonObject.put("bankName" , etcCustMsg.getBankName());
jsonObject.put("address" , etcCustMsg.getAddress());
jsonObject.put("phone" , etcCustMsg.getPhone());
jsonObject.put("custAgentIdFront" , convertToBase64(etcCustMsg.getCustAgentIdFront()));
jsonObject.put("custAgentIdBack" , convertToBase64(etcCustMsg.getCustAgentIdBront()));
jsonObject.put("bankCard" , convertToBase64(etcCustMsg.getCustAgentIdBront()));
if (etcCustMsg.getCustId() != null) {
jsonObject.put("custId" , etcCustMsg.getCustId());
}
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitCustInfo" , map);
}
/**
* @Author Sum1Dream
* @Name submitVehInfo
* @Description // 车辆信息提交接口
* @Date 11:28 2024/3/26
* @Param etcCustMsg
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject submitVehInfo(EtcCarMsg etcCarMsg) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("productId" , etcCarMsg.getProductId());
jsonObject.put("custId" , etcCarMsg.getCustId());
jsonObject.put("cardVarietyId" , etcCarMsg.getCardVarietyId());
List<JSONObject> vehInfoList = new ArrayList<>();
JSONObject vehInfoListObject = new JSONObject();
vehInfoListObject.put("vehPlateNo" , etcCarMsg.getVehPlateNo());
vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor());
vehInfoListObject.put("vehType" , etcCarMsg.getVehType());
vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum());
jsonObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro()));
jsonObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro()));
jsonObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto()));
if (etcCarMsg.getVehId() != null) {
jsonObject.put("vehId" , etcCarMsg.getVehId());
}
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitVehInfo" , map);
}
/**
* @Author Sum1Dream
* @Name getVehStatus
* @Description // 查询车辆状态
* @Date 13:54 2024/3/26
* @Param etcCarMsg
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject getVehStatus(EtcCarMsg etcCarMsg) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , etcCarMsg.getCustId());
jsonObject.put("vehId" , etcCarMsg.getVehId());
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/getVehStatus" , map);
}
/**
* @Author Sum1Dream
* @Name sendRealNameCode
* @Description // 实名认证发送认证码接口
* @Date 14:14 2024/3/26
* @Param JSONObject
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject sendRealNameCode(String custId) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendRealNameCode" , map);
}
/**
* @Author Sum1Dream
* @Name checkRealNameCode
* @Description // 实名认证核验验证码接口
* @Date 14:16 2024/3/26
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject checkRealNameCode(String custId , String verifyCode) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
jsonObject.put("verifyCode" , verifyCode);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkRealNameCode" , map);
}
/**
* @Author Sum1Dream
* @Name sendSignVerifyCode
* @Description // 签约验证码发送接口
* @Date 14:37 2024/3/26
* @Param custId
* @Param verifyCode
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject sendSignVerifyCode(String custId) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendSignVerifyCode" , map);
}
public static JSONObject checkSignVerifyCode(String custId , String verifyCode) throws Exception {
// 组装数据
Map<String , Object> map = new HashMap<>();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis());
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
jsonObject.put("verifyCode" , verifyCode);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkSignVerifyCode" , map);
}
/**
* @Author Sum1Dream
* @Name convertToBase64
* @Description // 转换base64
* @Date 16:32 2024/3/25
* @Param imagePath
* @return java.lang.String
*/
public static String convertToBase64(String imagePath) {
String base64Image = "";
try {
Path path = Paths.get( CommonSysConst.getSysConfig().getFileUrl() + imagePath);
byte[] imageBytes = Files.readAllBytes(path);
base64Image = Base64.getEncoder().encodeToString(imageBytes);
} catch (Exception e) {
e.printStackTrace();
}
return base64Image;
}
}

@ -284,7 +284,7 @@ public class PetroConfig {
* @Param phone
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject cancelCouponsYt(String ticketNum , String phone) throws Exception{
public JSONObject cancelCouponsYt(String ticketNum , String phone) throws Exception{
log.info("========================请求任务Start=========================");
Map<String, Object> req = new HashMap<>();
req.put("appId", petroAppid);
@ -299,7 +299,6 @@ public class PetroConfig {
jsonData.put("vouchers" , vouchers);
jsonData.put("businessId" , phone);
//业务内容加密
String bizContent = JSONObject.toJSONString(jsonData);
bizContent = encrypt(bizContent);
@ -334,6 +333,74 @@ public class PetroConfig {
return object;
}
/**
* @Author Sum1Dream
* @Name memberCards
* @Description // ETC卡券下发接口
* @Date 14:17 2024/2/28
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject etcOrder(Map<String , Object> object) {
log.info("========================请求任务Start=========================");
log.info("卡券下发接口-请求参数: " + JSON.toJSONString(object));
// 请求接口
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getEtcPostUrl() + "channel/order" , object);
log.info("卡券下发接口-回调参数: " + JSON.toJSONString(jsonObject));
return jsonObject;
}
/**
* @Author Sum1Dream
* @Name etcCardStatus
* @Description // etc卡券状态查询接口
* @Date 14:22 2024/2/28
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject etcCardStatus(Map<String , Object> object) {
log.info("========================请求任务Start=========================");
log.info("卡券状态查询接口-请求参数: " + JSON.toJSONString(object));
// 请求接口
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getEtcPostUrl() + "/channel/cardStatus" , object);
log.info("卡券状态查询接口-回调参数: " + JSON.toJSONString(jsonObject));
return jsonObject;
}
/**
* @Author Sum1Dream
* @Name etcDestroy
* @Description // 卡券退款接口
* @Date 14:23 2024/2/28
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject etcDestroy(Map<String , Object> object) {
log.info("========================请求任务Start=========================");
log.info(" 卡券退款接口-请求参数: " + JSON.toJSONString(object));
// 请求接口
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getEtcPostUrl() + "/channel/order/destroy" , object);
log.info(" 卡券退款接口-回调参数: " + JSON.toJSONString(jsonObject));
return jsonObject;
}
/**
* @Author Sum1Dream
* @Name etcQueryStock
* @Description // 查询卡券库存接口
* @Date 14:23 2024/2/28
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject etcQueryStock(Map<String , Object> object) {
log.info("========================请求任务Start=========================");
log.info(" 查询卡券库存接口-请求参数: " + JSON.toJSONString(object));
// 请求接口
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getEtcPostUrl() + "/channel/queryStock" , object);
log.info(" 查询卡券库存接口-回调参数: " + JSON.toJSONString(jsonObject));
return jsonObject;
}
/**
* @Author Sum1Dream
* @Name generateRandomString

@ -43,61 +43,50 @@ import java.util.Map;
public class WxOrderConfig {
private static final Logger log = LoggerFactory.getLogger(WxOrderConfig.class);
/**
* 微信支付商户号
* 个体户黎杨珍
*/
public static final String MCH_ID_1609882817 = "1609882817";
/**
* 微信支付商户号
* 青岛简牛网络科技有限公司
*/
public static final String MCH_ID_1667177808 = "1667177808";
/**
* 微信支付商户号
* 惠兑礼品 (重庆) 有限公司
*/
public static final String MCH_ID_1614670195 = "1614670195";
/**
* 微信支付商户号
* 惠昕贵州能源有限公司
*/
public static final String MCH_ID_1619676214 = "1619676214";
/**
* 微信支付商户号
* 惠昕贵州能源有限公司
*/
public static final String MCH_ID_1634835264 = "1634835264";
/**
* 微信支付商户号
* 渝北区浩联物资经营部
*/
public static final String MCH_ID_1624126902 = "1624126902";
/**
* 微信支付商户号
* 贵州紫凌电子商务有限公司
*/
public static final String MCH_ID_1648729281 = "1648729281";
/**
* 微信支付商户号
* 贵州普惠GO紫凌电子商务有限公司
*/
public static final String MCH_ID_1665668540 = "1665668540";
/**
* 嗨森逛公众号APPID
*/
public static final String APPID_HSG_MP = "wxa075e8509802f826";
/**
* 嗨森逛小程序APPID
*/
@ -106,13 +95,11 @@ public class WxOrderConfig {
* 黔印象公众号APPID
*/
public static final String APPID_QYX_MP = "wxf846cf24e87420a2";
/**
* 黔印象小程序APPID
*/
public static final String APPID_QYX_MINI = "wx5e0cac96ea91c01f";
public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception {
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");

@ -4,7 +4,7 @@ package com.hai.enum_type;
* 三方日志 - 日志类型
*/
public enum TripartiteReqLogType {
type1(1, "团油"),
type1(1, ""),
type2(2, "壳牌"),
type3(3, "汇联通工会卡"),
type4(4, "贵州中石化"),

@ -0,0 +1,72 @@
package com.hai.etc;
import com.hai.entity.BlxCarInfo;
import com.hai.entity.EtcCarMsg;
import com.hai.entity.EtcCustMsg;
import java.util.List;
import java.util.Map;
/**
* @serviceName .java
* @author Sum1Dream
* @version 1.0.0
* @Description // etc业务
* @createTime 15:15 2024/3/22
**/
public interface EtcCarMsgService {
/**
* @Author Sum1Dream
* @Name insertCar
* @Description // 新增车辆信息
* @Date 11:29 2023/9/5
* @Param carInfo
* @return void
*/
void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception;
/**
* @Author Sum1Dream
* @Name updateCar
* @Description // 更新车辆信息
* @Date 11:29 2023/9/5
* @Param carInfo
* @return void
*/
void updateEtcCar(EtcCarMsg etcCarMsg);
/**
* @Author Sum1Dream
* @Name getCarInfoList
* @Description // 查询车辆信息列表
* @Date 11:30 2023/9/5
* @Param map
* @return java.util.List<com.hai.entity.BlxCarInfo>
*/
List<EtcCarMsg> getEtcCarList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name findCarInfoByMap
* @Description //TODO
* @Date 14:14 2023/9/5
* @Param map
* @return com.hai.entity.BlxCarInfo
*/
EtcCarMsg findEtcCarByMap(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name findCarInfoById
* @Description // 根据ID查询详情
* @Date 15:13 2023/9/5
* @Param id
* @return com.hai.entity.BlxCarInfo
*/
EtcCarMsg findEtcCarById(Long id);
}

@ -0,0 +1,68 @@
package com.hai.etc;
import com.hai.entity.EtcCustMsg;
import java.util.List;
import java.util.Map;
/**
* @serviceName .java
* @author Sum1Dream
* @version 1.0.0
* @Description // etc客户信息
* @createTime 16:03 2024/3/22
**/
public interface EtcCustMsgService {
/**
* @Author Sum1Dream
* @Name insertCust
* @Description // 新增客户信息
* @Date 11:29 2023/9/5
* @Param CustInfo
* @return void
*/
void insertEtcCust(EtcCustMsg etcCustMsg);
/**
* @Author Sum1Dream
* @Name updateCust
* @Description // 更新客户信息
* @Date 11:29 2023/9/5
* @Param CustInfo
* @return void
*/
void updateEtcCust(EtcCustMsg etcCustMsg) throws Exception;
/**
* @Author Sum1Dream
* @Name getCustInfoList
* @Description // 查询客户信息列表
* @Date 11:30 2023/9/5
* @Param map
* @return java.util.List<com.hai.entity.BlxCustInfo>
*/
List<EtcCustMsg> getEtcCustList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name findCustInfoByMap
* @Description //TODO
* @Date 14:14 2023/9/5
* @Param map
* @return com.hai.entity.BlxCustInfo
*/
EtcCustMsg findEtcCustByMap(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name findCustInfoById
* @Description // 根据ID查询详情
* @Date 15:13 2023/9/5
* @Param id
* @return com.hai.entity.BlxCustInfo
*/
EtcCustMsg findEtcCustById(Long id);
}

@ -0,0 +1,81 @@
package com.hai.etc.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.EtcService;
import com.hai.dao.EtcCarMsgMapper;
import com.hai.entity.EtcCarMsg;
import com.hai.entity.EtcCarMsgExample;
import com.hai.entity.EtcCustMsg;
import com.hai.entity.EtcCustMsgExample;
import com.hai.etc.EtcCarMsgService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("etcCarMsgService")
public class EtcCarMsgServiceImpl implements EtcCarMsgService {
@Resource
private EtcCarMsgMapper etcCarMsgMapper;
@Override
public void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception {
// 提交车辆审核
JSONObject jsonObject = EtcService.submitVehInfo(etcCarMsg);
if (jsonObject.getString("errCode").equals("0")) {
JSONObject object = (JSONObject) jsonObject.getJSONArray("result").get(0);
etcCarMsg.setVehId(object.getString("custId"));
JSONObject car = EtcService.getVehStatus(etcCarMsg);
if (car.getString("errCode").equals("0")) {
etcCarMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus"));
etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus"));
etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus"));
etcCarMsg.setExt2(car.getJSONObject("result").getString("docException"));
}
etcCarMsg.setExt3(car.getString("errMsg"));
}
etcCarMsg.setExt1(jsonObject.getString("errMsg"));
etcCarMsgMapper.insert(etcCarMsg);
}
@Override
public void updateEtcCar(EtcCarMsg etcCarMsg) {
etcCarMsgMapper.updateByPrimaryKey(etcCarMsg);
}
@Override
public List<EtcCarMsg> getEtcCarList(Map<String, Object> map) {
EtcCarMsgExample example = new EtcCarMsgExample();
EtcCarMsgExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getString(map , "vehPlateNo") != null) {
criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo"));
}
return etcCarMsgMapper.selectByExample(example);
}
@Override
public EtcCarMsg findEtcCarByMap(Map<String, Object> map) {
EtcCustMsgExample example = new EtcCustMsgExample();
EtcCustMsgExample.Criteria criteria = example.createCriteria();
return null;
}
@Override
public EtcCarMsg findEtcCarById(Long id) {
return etcCarMsgMapper.selectByPrimaryKey(id);
}
}

@ -0,0 +1,72 @@
package com.hai.etc.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.EtcService;
import com.hai.dao.EtcCustMsgMapper;
import com.hai.entity.BsMsgExample;
import com.hai.entity.EtcCustMsg;
import com.hai.entity.EtcCustMsgExample;
import com.hai.etc.EtcCustMsgService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service("etcCustMsgService")
public class EtcCustMsgServiceImpl implements EtcCustMsgService {
@Resource
private EtcCustMsgMapper etcCustMsgMapper;
@Override
public void insertEtcCust(EtcCustMsg etcCustMsg) {
etcCustMsgMapper.insert(etcCustMsg);
}
@Override
public void updateEtcCust(EtcCustMsg etcCustMsg) throws Exception {
// 提交实名认证
JSONObject jsonObject = EtcService.submitCustInfo(etcCustMsg);
if (jsonObject.getString("errCode").equals("0")) {
etcCustMsg.setCustId(jsonObject.getJSONObject("result").getString("custId"));
etcCustMsg.setCustIdNo(jsonObject.getJSONObject("result").getString("custIdNo"));
etcCustMsg.setStatus(jsonObject.getJSONObject("result").getInteger("realStatus"));
}
etcCustMsg.setExt1(jsonObject.getString("errMsg"));
etcCustMsgMapper.updateByPrimaryKey(etcCustMsg);
}
@Override
public List<EtcCustMsg> getEtcCustList(Map<String, Object> map) {
EtcCustMsgExample example = new EtcCustMsgExample();
EtcCustMsgExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getString(map , "custName") != null) {
criteria.andCustNameEqualTo(MapUtils.getString(map , "custName"));
}
if (MapUtils.getString(map , "phone") != null) {
criteria.andPhoneEqualTo(MapUtils.getString(map , "phone"));
}
return etcCustMsgMapper.selectByExample(example);
}
@Override
public EtcCustMsg findEtcCustByMap(Map<String, Object> map) {
return null;
}
@Override
public EtcCustMsg findEtcCustById(Long id) {
return etcCustMsgMapper.selectByPrimaryKey(id);
}
}

@ -0,0 +1,97 @@
package com.hai.ocr;
import com.aliyun.ocr_api20210707.Client;
import com.aliyun.ocr_api20210707.models.*;
import com.aliyun.teaopenapi.models.Config;
/**
* 阿里云识别
* @author hurui
*/
public class AliYunOcrService {
/**
* 创建请求
* @return
* @throws Exception
*/
private static Client createClient() throws Exception {
Config config = new Config()
// 您的AccessKey ID
.setAccessKeyId("LTAI5tAu96cTs6b87vdfZivT")
// 您的AccessKey Secret
.setAccessKeySecret("67SmjGewt0zKGrhQeDKGbbk5lE3tAi");
// 访问的域名
config.endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
return new Client(config);
}
/**
* 身份证识别
* @param url 访问地址
* @return
*/
public static RecognizeIdcardResponseBody recognizeIdCard(String url) {
try {
Client client = createClient();
RecognizeIdcardRequest recognizeIdcardRequest = new RecognizeIdcardRequest().setUrl(url);
RecognizeIdcardResponse response = client.recognizeIdcard(recognizeIdcardRequest);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 银行卡识别
* @param url 访问地址
* @return
*/
public static RecognizeBankCardResponseBody recognizeBankCard(String url) {
try {
Client client = createClient();
RecognizeBankCardRequest recognizeBankCardRequest = new RecognizeBankCardRequest().setUrl(url);
RecognizeBankCardResponse response = client.recognizeBankCard(recognizeBankCardRequest);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 银行开户许可证识别
* @param url 访问地址
* @return
*/
public static RecognizeBankAccountLicenseResponseBody recognizeBankAccount(String url) {
try {
Client client = createClient();
RecognizeBankAccountLicenseRequest recognizeBankAccountLicenseRequest = new RecognizeBankAccountLicenseRequest().setUrl(url);
RecognizeBankAccountLicenseResponse response = client.recognizeBankAccountLicense(recognizeBankAccountLicenseRequest);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 营业执照识别
* @param url 访问地址
* @return
*/
public static RecognizeBusinessLicenseResponseBody recognizeBusinessLicense(String url) {
try {
Client client = createClient();
RecognizeBusinessLicenseRequest request = new RecognizeBusinessLicenseRequest().setUrl(url);
RecognizeBusinessLicenseResponse response = client.recognizeBusinessLicense(request);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

@ -98,4 +98,15 @@ public interface ApiOrderCreateHandleService {
*/
ApiOrder petroCouponOrder(JSONObject object) throws Exception;
/**
* @Author Sum1Dream
* @Name cqPetroCouponOrder
* @Description // 中石油卡券下单业务
* @Date 11:05 2024/3/4
* @Param object
* @return com.hai.entity.ApiOrder
*/
ApiOrder cqPetroCouponOrder(JSONObject object) throws Exception;
}

@ -535,4 +535,57 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ
return apiOrder;
}
@Override
public ApiOrder cqPetroCouponOrder(JSONObject object) throws Exception {
// 获取下单内容
JSONObject dataObject = JSONObject.parseObject(object.getString("content"));
// 查询api商户
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
ApiCoupon apiCoupon = apiCouponService.findCoupon(dataObject.getString("couponCode"));
if (apiCoupon == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前卡券已停用!");
}
// 查询折扣比例
Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE19.getNumber());
ApiMchProduct mchProduct = apiMchProductService.findByMap(mapProduct);
// 计算成本价格
BigDecimal price = priceComputeConfig.computationPriceCost(mchProduct.getDiscount() , new BigDecimal(apiCoupon.getPrice()));
// 判断金额是否充足
if (apiMerchants.getAmounts().compareTo(price) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.INSUFFICIENT_BALANCE);
}
// 组装内容
JSONObject jsonObject = new JSONObject();
jsonObject.put("name" ,apiCoupon.getName());
jsonObject.put("couponCode" , apiCoupon.getCode());
jsonObject.put("receiverPhone" , dataObject.getString("userMobile"));
// 组装api订单
ApiOrder apiOrder = new ApiOrder();
apiOrder.setCreateTime(new Date());
apiOrder.setTitle(apiMerchants.getMerchantName() + "|" + OrderProductType.PRODUCT_TYPE19.getName() + "|扣款" + price);
apiOrder.setFacePrice(new BigDecimal(apiCoupon.getPrice()));
apiOrder.setCostPrice(price);
apiOrder.setOrderPrice(price);
apiOrder.setMchId(object.getString("merchId"));
apiOrder.setMchName(apiMerchants.getMerchantName());
apiOrder.setUpdateTime(new Date());
apiOrder.setProductType(object.getInteger("productType"));
apiOrder.setMchOrderNo(object.getString("orderNo"));
apiOrder.setNotifyUrl(object.getString("notifyUrl"));
apiOrder.setContent(jsonObject.toJSONString());
return apiOrder;
}
}

@ -286,6 +286,30 @@ public class ApiOrderServiceImpl implements ApiOrderService {
orderService.createOrder(createOrderModel);
}
// 处理重庆中石油卡券
if (OrderProductType.PRODUCT_TYPE19.getNumber().equals(object.getInteger("productType"))) {
apiOrder = orderCreateHandleService.cqPetroCouponOrder(object);
// 组装子订单内容
CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel();
createOrderChildModel.setMemName("接口用户");
createOrderChildModel.setMemPhone(dataObject.getString("userMobile"));
createOrderChildModel.setCompanyId(2L);
createOrderChildModel.setCouponCode(dataObject.getString("couponCode"));
createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE19.getNumber());
createOrderChildModel.setSaleCount(1);
createOrderChildModel.setIsTyAgent(false);
createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice());
createOrderChildModel.setPrice(apiOrder.getCostPrice());
createOrderModel.setMemName("接口用户");
createOrderModel.setMemPhone(dataObject.getString("userMobile"));
// 组装订单
createOrderModel.getChildOrderList().add(createOrderChildModel);
orderService.createOrder(createOrderModel);
}

@ -139,4 +139,6 @@ public interface OrderCreateHandleService {
HighChildOrder petroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
}

@ -1297,4 +1297,33 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder;
}
@Override
public HighChildOrder cpPetroCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception {
ApiCoupon apiCoupon = apiCouponService.findCoupon(createOrderChildModel.getCouponCode());
// 生成交易子订单
HighChildOrder childOrder = new HighChildOrder();
childOrder.setOrderNo(order.getOrderNo());
childOrder.setMemId(order.getMemId());
childOrder.setMemName(order.getMemName());
childOrder.setMemPhone(order.getMemPhone());
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo());
childOrder.setGoodsType(OrderChildGoodsType.TYPE19.getNumber());
childOrder.setGoodsId(apiCoupon.getId());
childOrder.setGoodsName(apiCoupon.getName());
childOrder.setGoodsSpecName(apiCoupon.getCode());
childOrder.setGoodsPrice(new BigDecimal(apiCoupon.getPrice()));
childOrder.setGoodsActualPrice(createOrderChildModel.getPrice());
childOrder.setSaleCount(createOrderChildModel.getSaleCount());
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount())));
childOrder.setTotalActualPrice(childOrder.getGoodsActualPrice().multiply(new BigDecimal(childOrder.getSaleCount())));
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
return childOrder;
}
}

@ -1,10 +1,12 @@
package com.hai.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.config.*;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*;
@ -53,6 +55,10 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource
private RocketMQTemplate rocketMQTemplate;
@Resource
private HighGasOilPriceService highGasOilPriceService;
@Resource
private OrderService orderService;
@ -138,6 +144,12 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource
private PetroConfig petroConfig;
@Resource
private HighCouponCodeOtherService couponCodeOtherService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard, Map<String,Object> other) {
@ -268,6 +280,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
group(order);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE18.getNumber())) {
petroCoupon(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE19.getNumber())) {
cpPetroCoupon(order , childOrder);
}
}
}
@ -359,13 +373,16 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), gasOrder, false);
} else if (gasOrder.getChannelType().equals(MerchantStoreSourceType.type2.getNumber())) {
HighGasOilPrice gasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId() , gasOrder.getGasOilNo());
// 推送团油订单
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("gasId", store.getStoreKey());
paramMap.put("oilNo", gasOrder.getGasOilNo());
paramMap.put("gunNo", gasOrder.getGasGunNo());
paramMap.put("priceGun", gasOrder.getGasPriceGun()); // 枪单价
paramMap.put("priceVip", gasOrder.getGasPriceVip()); // 优惠
paramMap.put("priceVip", gasOilPrice.getPriceCost()); // 成本
paramMap.put("driverPhone", gasOrder.getMemPhone());
paramMap.put("thirdSerialNo", gasOrder.getOrderNo());
paramMap.put("refuelingAmount", gasOrder.getGasRefuelPrice());
@ -377,6 +394,15 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount());
}
JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap);
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type10.getType());
highGasOrderPush.setOrderNo(gasOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(paramMap.toString());
highGasOrderPush.setReturnContent(orderPushObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
gasOrder.setChannelOrderNo(orderPushObject.getJSONObject("result").getString("orderNo"));
gasOrderService.updateGasOrder(gasOrder);
@ -720,4 +746,43 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
}
private void cpPetroCoupon(HighOrder order , HighChildOrder childOrder) throws Exception {
ApiCoupon apiCoupon = apiCouponService.findCoupon(childOrder.getGoodsSpecName());
if (apiCoupon == null || apiCoupon.getStatus() != 1) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买");
}
if (!apiCoupon.getType().equals(3)) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买");
}
// 预发码
JSONObject preSendCoupon = ChongQingCNPCService.preSendCoupon(apiCoupon.getCode(), childOrder.getChildOrderNo(), childOrder.getSaleCount(), order.getMemPhone());
if (preSendCoupon.getInteger("status").equals(1)) {
// 给用户发码
JSONObject response = ChongQingCNPCService.sendCNPCTicket(apiCoupon.getCode(), childOrder.getChildOrderNo(), childOrder.getSaleCount(), order.getMemPhone());
JSONObject couponDetail = response.getJSONObject("ticketDetail");
JSONArray codeList = response.getJSONArray("codeList");
for (Object data : codeList) {
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(2);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(childOrder.getId());
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode"));
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data)));
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd"));
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOtherService.insertCouponCodeOther(couponCodeOther);
}
}
}
}

@ -383,7 +383,14 @@ public class OrderServiceImpl implements OrderService {
order.setProductType(OrderProductType.PRODUCT_TYPE18.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("中石油卡券");
} else {
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE19.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.cpPetroCoupon(order , child);
childOrderList.add(childOrder);
order.setProductType(OrderProductType.PRODUCT_TYPE19.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("重庆中石油卡券");
}
else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");
}
}

@ -26,6 +26,7 @@ public enum OrderChildGoodsType {
TYPE15(15, "个人油卡充值"),
TYPE17(17, "团购套餐"),
TYPE18(18, "中石油卡券"),
TYPE19(19, "重庆中石油卡券"),
;
private Integer number;

@ -29,6 +29,7 @@ public enum OrderProductType {
PRODUCT_TYPE16(16, "个人油卡充值" , "orderLogo/coupon.png", ""),
PRODUCT_TYPE17(17, "团购套餐" , "orderLogo/coupon.png", ""),
PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"),
PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"),
PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"),
PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
;

@ -14,6 +14,7 @@ public enum RechargePlatformType {
STATUS2(2, "龙阅"),
STATUS3(3, "城宇"),
STATUS4(4, "畅停"),
STATUS5(5, "简牛"),
STATUS100(100, "手动"),
;

@ -570,7 +570,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponService.insertUserCoupon(highUserCoupon);
} else {
} else if (coupon.getCouponSource().equals(9)) {
}else {
// 查询子订单的兑换码
HighCouponCode code = getCodeByChildOrderNo(childOrder.getChildOrderNo());
if (code == null) {

@ -224,7 +224,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
// 团油枪价
priceGun = priceDetail.getBigDecimal("priceGun");
// 团油优惠价
priceVip = priceDetail.getBigDecimal("priceVip");
priceVip = priceDetail.getBigDecimal("priceGun");
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);

@ -466,110 +466,151 @@ public class HighGasServiceImpl implements HighGasService {
@Override
public void getDianAllStation() throws Exception {
HighMerchantModel merchant = highMerchantService.getMerchantById(39L);
JSONObject jsonObject = DianConfig.getGasInfoAll();
JSONArray resultObject = jsonObject.getObject("result", JSONArray.class);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000);
JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class);
for (int i = 0; i < resultObject.size();i++) {
Object objectData = resultObject.get(i);
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData));
for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) {
JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000);
JSONObject resultObject = jsonObject.getObject("result", JSONObject.class);
JSONArray jsonArray = resultObject.getJSONArray("gasInfoList");
HighMerchantStore highMerchantStore;
HighGasOilPrice highGasOilPrice;
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid"));
SecRegion region = commonService.getRegionsByName(object.getString("province"));
if (store != null) {
store.setType(1);
store.setSourceType(6);
store.setMerchantId(merchant.getId());
store.setCompanyId(merchant.getCompanyId());
store.setStoreKey(object.getString("jyzid"));
store.setStoreName(object.getString("mingcheng"));
// store.setStoreLogo(object.getString("tupian"));
store.setRegionId(region.getRegionId());
store.setRegionName(object.getString("province"));
store.setAddress(object.getString("dizhi"));
store.setLongitude(object.getString("lng"));
store.setLatitude(object.getString("lat"));
store.setStatus(object.getInteger("zhuangtai"));
store.setPrestoreType(0);
store.setOperatorId(0L);
store.setOperatorName("系统创建");
store.setUpdateTime(new Date());
store.setExt1(object.getString("gasSourceId"));
highMerchantStoreService.updateMerchantStoreDetail(store);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao"));
if (highGasOilPrice == null) {
for (Object gasObject : jsonArray) {
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject));
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId"));
JSONArray gasGunList = object.getJSONArray("gasGunList");
if (store != null) {
store.setType(1);
store.setSourceType(2);
store.setMerchantId(merchant.getId());
store.setCompanyId(merchant.getCompanyId());
store.setStoreKey(object.getString("gasId"));
store.setStoreName(object.getString("gasName"));
store.setStoreLogo(object.getString("gasLogoSmall"));
store.setRegionId(object.getLong("provinceCode"));
store.setRegionName(object.getString("provinceName"));
store.setAddress(object.getString("gasAddress"));
store.setLongitude(object.getString("gasAddressLongitude"));
store.setLatitude(object.getString("gasAddressLatitude"));
store.setStatus(object.getInteger("gasStatus"));
store.setPrestoreType(0);
store.setOperatorId(0L);
store.setOperatorName("系统创建");
store.setUpdateTime(new Date());
store.setExt1(object.getString("gasSourceId"));
highMerchantStoreService.updateMerchantStoreDetail(store);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo"));
if (highGasOilPrice == null) {
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
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.getString("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
for (Object o : gasGunList) {
JSONObject gunNoObject = (JSONObject) o;
HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo"));
if (gasOilGunNo == null) {
gasOilGunNo = new HighGasOilGunNo();
gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId());
gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId());
gasOilGunNo.setOilNo(highGasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName());
gasOilGunNo.setOilType(highGasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(gunNoObject.getString("gunNo"));
gasOilGunNo.setStatus(1);
gasOilGunNoService.editGunNo(gasOilGunNo);
}
}
}
} else {
highMerchantStore = new HighMerchantStore();
highMerchantStore.setType(1);
highMerchantStore.setSourceType(2);
highMerchantStore.setMerchantId(merchant.getId());
highMerchantStore.setCompanyId(merchant.getCompanyId());
highMerchantStore.setStoreKey(object.getString("gasId"));
highMerchantStore.setStoreName(object.getString("gasName"));
highMerchantStore.setStoreLogo(object.getString("gasLogoSmall"));
highMerchantStore.setRegionId(object.getLong("provinceCode"));
highMerchantStore.setRegionName(object.getString("provinceName"));
highMerchantStore.setAddress(object.getString("gasAddress"));
highMerchantStore.setLongitude(object.getString("gasAddressLongitude"));
highMerchantStore.setLatitude(object.getString("gasAddressLatitude"));
highMerchantStore.setStatus(1);
highMerchantStore.setPrestoreType(0);
highMerchantStore.setOperatorId(0L);
highMerchantStore.setOperatorName("系统创建");
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setExt1(object.getString("gasSourceId"));
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel();
BeanUtils.copyProperties(highMerchantStore, merchantStoreModel);
highMerchantStoreService.insertMerchantStore(merchantStoreModel);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("youhao"));
highGasOilPrice.setPreferentialMargin(new BigDecimal(0));
highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
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.getString("youhao"));
highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPreferentialMargin(new BigDecimal(0));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
for (Object o : gasGunList) {
JSONObject gunNoObject = (JSONObject) o;
HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo"));
if (gasOilGunNo == null) {
gasOilGunNo = new HighGasOilGunNo();
gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId());
gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId());
gasOilGunNo.setOilNo(highGasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName());
gasOilGunNo.setOilType(highGasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(gunNoObject.getString("gunNo"));
gasOilGunNo.setStatus(1);
gasOilGunNoService.editGunNo(gasOilGunNo);
}
}
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
}
} else {
highMerchantStore = new HighMerchantStore();
highMerchantStore.setType(1);
highMerchantStore.setSourceType(6);
highMerchantStore.setMerchantId(merchant.getId());
highMerchantStore.setCompanyId(merchant.getCompanyId());
highMerchantStore.setStoreKey(object.getString("jyzid"));
highMerchantStore.setStoreName(object.getString("mingcheng"));
// highMerchantStore.setStoreLogo(object.getString("tupian"));
highMerchantStore.setRegionId(region.getRegionId());
highMerchantStore.setRegionName(object.getString("province"));
highMerchantStore.setAddress(object.getString("dizhi"));
highMerchantStore.setLongitude(object.getString("lng"));
highMerchantStore.setLatitude(object.getString("lat"));
highMerchantStore.setStatus(1);
highMerchantStore.setPrestoreType(0);
highMerchantStore.setOperatorId(0L);
highMerchantStore.setOperatorName("系统创建");
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setExt1(object.getString("gasSourceId"));
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel();
BeanUtils.copyProperties(highMerchantStore, merchantStoreModel);
highMerchantStoreService.insertMerchantStore(merchantStoreModel);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("youhao"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPreferentialMargin(new BigDecimal(0));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
}
}
}
}

@ -9,16 +9,16 @@ ChongQingCnpcMerKey=n2j30jxhl3rhuoci
ChongQingCnpcCouponSignKey=5ojldakiz343a6yk
# TuanYou configuration parameters
tuanYouUrl=https://test02-motorcade-hcs.czb365.com
tuanYouAppKey=231599775566496
tuanYouAppSecret=cbfab3c550d6142a779c5196c9416342
tuanYouDieselAccount=c009bidg4400
tuanYouGasolineAccount=c009bic04400
#tuanYouUrl=https://hcs.czb365.com
#tuanYouAppKey=210091174083104
#tuanYouAppSecret=f9811df6791d309bf48f4a8db9edaa45
#tuanYouDieselAccount=9hp52qgg4400
#tuanYouGasolineAccount=9hp52qf04400
#tuanYouUrl=https://test01-motorcade-hcs.czb365.com
#tuanYouAppKey=297046381248288
#tuanYouAppSecret=3ef5320dd36e178ce2502fae1a8acd2b
#tuanYouDieselAccount=je38a9944400
#tuanYouGasolineAccount=je38a9104400
tuanYouUrl=https://hcs.czb365.com
tuanYouAppKey=296780625346528
tuanYouAppSecret=3b1bca319f7296ec4fabf21eef0ded7d
tuanYouDieselAccount=9hp52qgg4400
tuanYouGasolineAccount=jd4b7lc44400
# JiaHaoYou configuration parameters
shellGroupUrl=http://openapi.ngrok.xinyebang.cn/gateway.html
@ -49,14 +49,14 @@ thirdAppSecret=cyQpQKMaGUG186iEZRt1uQ==
thirdPostUrl=http://mbsmemberwebapi.test.onfishes.com/
# ???????
huiliantongUrl=https://gzapitest.deepermobile.com.cn:441
huiliantongAppNo=guizhouhltcs
huiliantongAppkey=g%2BNnjR54YSUWM2iKg%2Fd82A9x9hg2kYV7
huiliantongAppsecret=FA28E95ACABFA4B2B8E25857437B07F1
huiliantongDistributorId=test
huiliantongSinopecUrl=fuelCouponsTest
# ????????
huiliantongUrl=https://gzapi.deepermobile.com.cn
huiliantongAppNo=guizhouhuilt
huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D
huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A
huiliantongSinopecDistributorId=aNId4A3X
huiliantongDistributorId=1JnL8YMV
huiliantongSinopecUrl=fuelCoupons
HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json
HuiLianTongUnionCardAccessCode=6FCAE1470CEF465988351BB65ABAA8AE
HuiLianTongUnionCardSignCode=F8E91A3C
@ -143,7 +143,7 @@ filesystem=https://hsgcs.dctpay.com/filesystem/
#payPostUrl=http://localhost:9601/crest/
#
blxPostUrl=https://vertical-formats-gateway.blx.bodata.cn:18443
blxPostUrl=https://zhctapplet.gyzhtc.com/gateway
#DianDian
diandianwPostUrl=http://www.diandianw.cn/youdianyou/
@ -161,3 +161,14 @@ GzPetroUrl = http://140.143.82.223:1588/gz
GzPetroAppid = F0bdoJRwt
GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
#ETC
EtcPostUrl = https://test.djien-qr.com/
EtcChannelCode = GZETCFXQD
EtcPublicKey = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMyQb5gR1rweB5oHKqRPJtJjLQKsn5PXOVfaNdGt/2kPkHvRdN3L9zOaAvFEXcEl2V0sg3D8a+2Sfy1YANAZvjscTQYOaoFl+LVyQZvgyyX8RQw+26Jmbqh8DwenUbNf7DFYVSDxIMBLOiWPkGsYGFONjsUVmfykSeVTcEgQB3VwIDAQAB
EtcPrivateKey = MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAO8+KWh/OmBahFk7TWOEjPl13BT5NdlbGvQ/311Yua6CQqul9w1DIR2TwFUUh/Bko/eVoLROfF2XVjHbw2bImTdJ7y9C3511HI59YPNzqyql0DHjLxbH0VW92eUgk8mG09wtrUMu1ImN0b7aFE3uqAgz6pwh3TUiQWsDWz+l/MG7AgMBAAECgYEA7nYsOd8OpbmzT2m/omEdTwz9993KocKgZDJCBj4InftyTrrXO93cZSm/PE6BjMgTcxUuIGpWpcbRgFLHOmzZ4Qd+k/6Yb1ErMTfdGlgrxv2B+vztWYfjmFzEiXpecFH47ED6iYrrqm14X3InpnBv4rUkGdqqNbyPGgTO2ncs/3kCQQD+xqRAQSb/TROlqJdO91y6z9v0PO2GLmokqYg444rKYZKhDE0tdJeLU/sfK8SMg5+SlwdQm4nlo8EDJ/w2CEn3AkEA8GRqVkKgIuH413/a6+luYDjlf30WY7Mi1sm3QPSZ6+eH35UwsL6mdX6mjRpUN9Hez6FMfE7s3XOldoPVMzR1XQJBAOa2VTkGhtz8HEWQZOySXfuhjSogHmu7Dk2C5CO4Eg/wycpjDGSUR0NZWnfAt60S6GbjszEQmJBGeNt10xPO78MCQQCWXwnRaZ3IFDhXfQfRWFSN5ilQ5UszFGQvnUB/ZkI+ObdZmXY6qRdxGcdPLnAN9r78fDZe7/Pk1qljCDY98IuVAkEAnSeO/221gDhL1wnbUhGuX1yo8f5Eo/wDTW5cBxXFGZeexhB8I4jnEV4E/xmikkb3jDFvmrnFk+XUtDqkrvicRQ==
#NUODE
NdPostUrl = http://nuode-test.yuetong18.cn/nuode-module-supplier/
NdOrgCode = 19181483-91e9-4e13-9236-fb917ed9529d
NdKey= 5df3f620-e269-458d-9556-87e26d30256a

@ -129,7 +129,7 @@ payPostUrl=https://pay.dctpay.com/crest/
filesystem=https://hsg.dctpay.com/filesystem/
blxPostUrl=https://gateway.vf.bilinxing.com
blxPostUrl=https://zhctapplet.gyzhtc.com/gateway
#DianDian

@ -4,16 +4,17 @@ gasDefaultOilStationImg=https://hsg.dctpay.com/filesystem/default/default_oil_st
gasDefaultOilStationImg2=https://hsg.dctpay.com/filesystem/default/default_oil_station2.jpg
# ChongQingCNPC configuration parameters
ChongQingCnpcUrl=http://cqpingan.wisdomyt.cn/d/cross/api
ChongQingCnpcMerNo=7ygt1b2b8rpl7vttm6
ChongQingCnpcMerKey=5ojd0nkdqb1ff84t
ChongQingCnpcCouponSignKey=pzj69n2r8l1l3kry
*
tuanYouUrl=https://hcs.czb365.com
tuanYouAppKey=210091174083104
tuanYouAppSecret=f9811df6791d309bf48f4a8db9edaa45
tuanYouAppKey=296780625346528
tuanYouAppSecret=3b1bca319f7296ec4fabf21eef0ded7d
tuanYouDieselAccount=9hp52qgg4400
tuanYouGasolineAccount=9hp52qf04400
tuanYouGasolineAccount=jd4b7lc44400
# tuanYouAppKey=232373843366592
# tuanYouAppSecret=b07cca748a3b83e27e4821d2a8423d91
# tuanYouDieselAccount=c2qitcag4400
@ -133,7 +134,7 @@ payPostUrl=https://pay.dctpay.com/crest/
filesystem=https://hsg.dctpay.com/filesystem/
blxPostUrl=https://gateway.vf.bilinxing.com
blxPostUrl=https://zhctapplet.gyzhtc.com/gateway
#DianDian

@ -43,7 +43,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -77,7 +77,7 @@ spring:
mode: HTML5
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

@ -217,6 +217,72 @@ public class ApiCouponController {
}
}
@RequestMapping(value = "/couponCqDetail", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询重庆中石油卡券详情")
public ResponseData couponCqDetail(@RequestBody JSONObject object , HttpServletRequest request) {
try {
String ip;
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {
ip = request.getRemoteAddr();
} else {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
if (
StringUtils.isBlank(object.getString("mchOrderNo")) ||
StringUtils.isBlank(object.getString("sign")) ||
StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("merchId"))
) {
log.error("createOrder error!", "请求参数校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
}
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "帐户错误!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE18.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
}
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
Map<String , Object> map = new HashMap<>();
map.put("mchOrderNo" , object.getString("mchOrderNo"));
map.put("apiKey" , apiMerchants.getApiKey());
map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map, object.getString("sign"))) {
log.error("createOrder error!", "签名校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
}
return ResponseMsgUtil.success(apiOrderService.findByOrderNo(object.getString("mchOrderNo") , null));
} catch (Exception e) {
log.error("HighOpenApiController --> createOrder() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getCheckCode", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取核销码")

@ -137,10 +137,6 @@ public class GzSinopecController {
ip = request.getHeader("x-forwarded-for");
}
if (!secConfigService.isConfig("IP_WHITE", ip)) {
log.error("couJointDist error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!");
}
if (
StringUtils.isBlank(object.getString("orderNo")) ||
@ -176,11 +172,6 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
}
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);

@ -176,6 +176,14 @@ public class orderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写相关参数");
}
}
if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE19.getNumber())) {
if ( StringUtils.isBlank(dataObject.getString("userMobile"))
|| StringUtils.isBlank(dataObject.getString("couponCode"))
) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写相关参数");
}
}
return ResponseMsgUtil.success(apiOrderService.createOrder(object));
@ -381,6 +389,7 @@ public class orderController {
@ResponseBody
@ApiOperation(value = "对外订单退款接口")
public ResponseData externalOrderRefund(@RequestBody JSONObject object , HttpServletRequest request) {
try {
String ip = "";

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://1.95.43.71:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -42,7 +42,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
url: ws://1.95.43.71:8083/mqtt
#用户名
username: printer_provider
#密码
@ -67,7 +67,7 @@ spring:
write-dates-as-timestamps: true
rocketmq:
name-server: 122.9.135.148:9876
name-server: 1.95.43.71:9876
producer:
#必须指定group
group: default-group

Loading…
Cancel
Save