Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

new-dev
袁野 1 year ago
commit 8dc1261ab0
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/HighGasChannelConfigController.java
  2. 99
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  5. 24
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  6. 45
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  7. 149
      hai-cweb/src/main/java/com/cweb/controller/group/GroupController.java
  8. 93
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  9. 23
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  10. 39
      hai-service/src/main/java/com/hai/config/KytcService.java
  11. 30
      hai-service/src/main/java/com/hai/dao/HighGasChannelConfigMapper.java
  12. 14
      hai-service/src/main/java/com/hai/dao/HighGasChannelConfigSqlProvider.java
  13. 20
      hai-service/src/main/java/com/hai/entity/HighGasChannelConfig.java
  14. 70
      hai-service/src/main/java/com/hai/entity/HighGasChannelConfigExample.java
  15. 1
      hai-service/src/main/java/com/hai/enum_type/GasChannel.java
  16. 1
      hai-service/src/main/java/com/hai/enum_type/GasChannelPayPlatformType.java
  17. 1
      hai-service/src/main/java/com/hai/enum_type/MerchantStoreSourceType.java
  18. 66
      hai-service/src/main/java/com/hai/group/GroupService.java
  19. 2
      hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java
  20. 11
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  21. 50
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  22. 37
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  23. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  24. 1
      hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java
  25. 1
      hai-service/src/main/java/com/hai/order/type/OrderProductType.java
  26. 54
      hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java
  27. 4
      hai-service/src/main/java/com/hai/service/HighGasChannelConfigService.java
  28. 41
      hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java
  29. 13
      hai-service/src/main/java/com/hai/service/HighOilCardOrderService.java
  30. 8
      hai-service/src/main/java/com/hai/service/HighUserService.java
  31. 26
      hai-service/src/main/java/com/hai/service/impl/HighGasChannelConfigServiceImpl.java
  32. 1
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  33. 3
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  34. 28
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  35. 43
      hai-service/src/main/java/com/hai/service/impl/HighOilCardOrderServiceImpl.java
  36. 29
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

@ -67,8 +67,7 @@ public class HighGasChannelConfigController {
// 查询平台
HighGasChannelConfig platform = gasChannelConfigService.getConfig(
GasChannel.getChannelByType(body.getInteger("channelId")),
GasChannelPayPlatformType.getPlatformByType(body.getInteger("payPlatformType")));
GasChannel.getChannelByType(body.getInteger("channelId")));
if (platform == null) {
platform = new HighGasChannelConfig();
@ -78,6 +77,7 @@ public class HighGasChannelConfigController {
platform.setPayPlatformType(body.getInteger("payPlatformType"));
platform.setPayPlatformMerName(body.getString("payPlatformMerName"));
platform.setPayPlatformMerNo(body.getString("payPlatformMerNo"));
platform.setPayPlatformMerKey(body.getString("payPlatformKey"));
platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus"));
platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio"));
platform.setProfitSharingReceiversNo(body.getString("profitSharingReceiversNo"));

@ -13,10 +13,7 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.BsCompany;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighMerchantStore;
import com.hai.entity.SecRegion;
import com.hai.entity.*;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.*;
import com.hai.service.*;
@ -135,7 +132,10 @@ public class HighMerchantStoreController {
highMerchantStore.setMerchantId(merchant.getId());
highMerchantStore.setOperatorId(userInfoModel.getSecUser().getId());
highMerchantStore.setOperatorName(userInfoModel.getSecUser().getUserName());
if (highMerchantStore.getSourceType() == null) {
highMerchantStore.setSourceType(MerchantStoreSourceType.type1.getNumber());
}
highMerchantStoreService.insertMerchantStore(highMerchantStore);
return ResponseMsgUtil.success(highMerchantStore);
@ -250,11 +250,14 @@ public class HighMerchantStoreController {
store.setTelephone(highMerchantStore.getTelephone());
store.setAddress(highMerchantStore.getAddress());
store.setLatitude(highMerchantStore.getLatitude());
store.setExt3(highMerchantStore.getExt3());
store.setLongitude(highMerchantStore.getLongitude());
store.setDeviceSn(highMerchantStore.getDeviceSn());
store.setDeviceKey(highMerchantStore.getDeviceKey());
store.setDeviceName(highMerchantStore.getDeviceName());
if (highMerchantStore.getSourceType() != null) {
store.setSourceType(highMerchantStore.getSourceType());
}
store.setUpdateTime(new Date());
store.setOperatorId(userInfoModel.getSecUser().getId());
store.setOperatorName(userInfoModel.getSecUser().getUserName());
@ -383,5 +386,91 @@ public class HighMerchantStoreController {
}
}
@RequestMapping(value="/insertStoreOilCard",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增门店油卡")
public ResponseData insertStoreOilCard(@RequestBody HighStoreOilCard highStoreOilCard, HttpServletRequest request) {
try {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getMerchant() == null) {
log.error("HighMerchantController -> insertMerchantStore() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
if (highStoreOilCard.getStoreId() == null
|| StringUtils.isBlank(highStoreOilCard.getOilCardNo())
) {
log.error("HighMerchantStoreController -> insertMerchantStore() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询门店
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highStoreOilCard.getStoreId());
if (store == null) {
log.error("BsStudentController --> addStudent() error!", "未找到门店信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息");
}
BsCompany company = bsCompanyService.getCompanyById(store.getCompanyId());
if (company == null) {
log.error("HighMerchantStoreController -> insertMerchantStore() error!","未找到分公司");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, "");
}
highStoreOilCard.setType(1);
highStoreOilCard.setStatus(1);
highStoreOilCard.setCreateTime(new Date());
highStoreOilCard.setUpdateTime(new Date());
highStoreOilCard.setOpId(userInfoModel.getSecUser().getId());
highStoreOilCard.setOpName(userInfoModel.getSecUser().getUserName());
highMerchantStoreService.insertStoreOilCard(highStoreOilCard);
return ResponseMsgUtil.success(highStoreOilCard);
} catch (Exception e) {
log.error("HighMerchantStoreController -> editMerchantStore() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/deleteStoreOilCard", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "删除油卡")
public ResponseData deleteStoreOilCard(@RequestParam(name = "id", required = false) Long id) {
try {
HighStoreOilCard highStoreOilCard = highMerchantStoreService.findStoreOilCard(id);
if (highStoreOilCard == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR, "未查到相关油卡");
}
highStoreOilCard.setUpdateTime(new Date());
highStoreOilCard.setStatus(0);
highMerchantStoreService.updateStoreOilCard(highStoreOilCard);
return ResponseMsgUtil.success("删除油卡");
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getStoreOilCardList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油卡")
public ResponseData getStoreOilCardList(@RequestParam(name = "storeId", required = false) Long storeId) {
try {
return ResponseMsgUtil.success(highMerchantStoreService.getStoreOilCardList(storeId));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

File diff suppressed because one or more lines are too long

@ -145,6 +145,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/outRechargePrice/*")
.excludePathPatterns("/userDiscount/*")
.excludePathPatterns("/highThirdParty/*")
.excludePathPatterns("/group/*")
;
}

@ -50,6 +50,9 @@ public class CommonController {
@Autowired
private RedisUtil redisUtil;
@Resource
private HighUserService highUserService;
@Resource
private BsIntegralRebateService bsIntegralRebateService;
@ -504,4 +507,25 @@ public class CommonController {
}
}
@RequestMapping(value = "/getLevelUserMsg", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户级别信息")
public ResponseData getLevelUserMsg(
@RequestParam(name = "userId", required = false) Long userId) {
try {
JSONObject object = new JSONObject();
object.put("userLeve" , highUserService.findUserLevel(userId));
object.put("price" , commonService.findSecConfigByType("LEVEL_PRICE").getCodeValue());
return ResponseMsgUtil.success(object);
} catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -49,17 +49,16 @@ public class HighGasController {
@Resource
private HighOrderService highOrderService;
@Resource
private CommonService commonService;
private HighMerchantStoreService highMerchantStoreService;
@Resource
private HighTyAgentOilStationService tyAgentOilStationService;
private CommonService commonService;
@Resource
private HighTyAgentPriceService tyAgentPriceService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Resource
private HighMerchantStoreService merchantStoreService;
@ -170,7 +169,7 @@ public class HighGasController {
}
}
} else if (MapUtils.getInteger(map, "source_type").equals(2)|| MapUtils.getInteger(map, "source_type").equals(6)) {
} 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) {
@ -287,7 +286,8 @@ public class HighGasController {
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) {
|| store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())) {
Map<String, Object> param = new HashMap<>();
param.put("provinceName", null);
param.put("provinceCode", null);
@ -387,6 +387,10 @@ public class HighGasController {
oilPriceMapList.add(oilPriceMap);
}
param.put("oilPriceList", oilPriceMapList);
if (store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())) {
param.put("oilCardList", highMerchantStoreService.getStoreOilCardList(store.getId()));
param.put("img", store.getExt3());
}
return ResponseMsgUtil.success(param);
@ -495,40 +499,13 @@ public class HighGasController {
price.put("priceOfficial" , price.getString("priceGun"));
price.put("oilNo" , price.getString("youhao"));
price.put("oilType" , price.getString("oiltype"));
price.put("priceVip" , price.getString("priceVip"));
// 查询油站油品状态
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), price.getString("youhao"));
if (oilNo != null && !oilNo.getStatus().equals(GasOilPriceStatusEnum.status1.getStatus())) {
continue;
}
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), price.getString("youhao"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(price.getString("youhao"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
// 查询是否配置了【代理商油站】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, store.getId(), price.getString("youhao"));
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
newOilPriceList.add(price);
}

@ -0,0 +1,149 @@
package com.cweb.controller.group;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.BsMsg;
import com.hai.group.GroupService;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.BsMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author sum1dream
*/
@Controller
@RequestMapping(value = "/group")
@Api(value = "团购")
public class GroupController {
Logger log = LoggerFactory.getLogger(GroupController.class);
@Resource
private GroupService groupService;
@RequestMapping(value="/getStoreList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "商户查询门店列表")
public ResponseData getStoreListByMer(
@RequestParam(value = "name" , required = false) String name,
@RequestParam(value = "childId" , required = false) Long childId,
@RequestParam(value = "parentId" , required = false) Long parentId,
@RequestParam(name = "longitude", required = false) String longitude,
@RequestParam(name = "latitude", required = false) String latitude
) {
try {
JSONObject map = new JSONObject();
map.put("name" , name);
map.put("childId" , childId);
map.put("parentId" , parentId);
map.put("longitude" , longitude);
map.put("latitude" , latitude);
JSONObject object = groupService.getStoreList(map);
if (object.getString("return_code").equals("000000")) {
return ResponseMsgUtil.success(object.getJSONArray("return_data"));
} else {
return ResponseMsgUtil.success(object.getString("return_msg"));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGroupContent",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询团购内容")
public ResponseData getGroupContent(@RequestParam(value = "groupId" , required = true) Long groupId) {
try {
JSONObject object = groupService.getGroupContent(groupId);
if (object.getString("return_code").equals("000000")) {
return ResponseMsgUtil.success(object.getJSONObject("return_data"));
} else {
return ResponseMsgUtil.success(object.getString("return_msg"));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getStoreMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询门店信息")
public ResponseData getStoreMsg(@RequestParam(value = "storeId" , required = true) Long storeId) {
try {
JSONObject object = groupService.getStoreMsg(storeId);
if (object.getString("return_code").equals("000000")) {
return ResponseMsgUtil.success(object.getJSONObject("return_data"));
} else {
return ResponseMsgUtil.success(object.getString("return_msg"));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getBsStoreImgByList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询门店图片列表")
public ResponseData getBsStoreImgByList(
@RequestParam(value = "type" , required = false) Integer type,
@RequestParam(value = "storeId" , required = false) Long storeId) {
try {
JSONObject map = new JSONObject();
map.put("storeId" , storeId);
map.put("type" , type);
JSONObject object = groupService.getBsStoreImgByList(map);
if (object.getString("return_code").equals("000000")) {
return ResponseMsgUtil.success(object.getJSONArray("return_data"));
} else {
return ResponseMsgUtil.success(object.getString("return_msg"));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -163,7 +163,11 @@ public class OrderPayController {
if (productType != null) {
orderTitle = productType.getName();
}
JSONObject objectGas = new JSONObject();
Integer payPlatformType = 1;
String payPlatformKey = null;
String payPlatformMerNo = null;
if (PlatformType.TYPE2.getNumber().equals(body.getInteger("platformType"))) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1648729281);
@ -246,48 +250,79 @@ public class OrderPayController {
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2, GasChannelPayPlatformType.type1);
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3, GasChannelPayPlatformType.type1);
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4, GasChannelPayPlatformType.type1);
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5, GasChannelPayPlatformType.type1);
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2, GasChannelPayPlatformType.type1);
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type6);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type7);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
@ -306,6 +341,17 @@ public class OrderPayController {
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE12.getNumber())) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE15.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type7);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
payPlatformType = gasChannelConfig.getPayPlatformType();
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817);
}
@ -328,7 +374,23 @@ public class OrderPayController {
SortedMap<Object, Object> sortedMap;
if (!order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) {
if (payPlatformType == 2) {
objectGas.put("outTradeNo" , order.getOrderNo());
objectGas.put("transType" , "JSAPI");
objectGas.put("payMode" , "WECHAT");
objectGas.put("totalAmount" , order.getTotalPrice());
objectGas.put("profitSharing" , 0);
objectGas.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify());
objectGas.put("subject" , orderTitle);
objectGas.put("userId" , body.getString("openId"));
sortedMap = huiConfig.preorder(objectGas , payPlatformKey , payPlatformMerNo);
order.setAccountMerchantNum(payPlatformMerNo);
order.setProfitSharingStatus(false);
order.setPayChannel(2);
orderService.updateOrderData(order);
} else {
//附加数据,区分订单类型
Map<String, String> payMap = new HashMap<>();
payMap.put("app_id", weChatPayReqInfo.getSub_appid());
@ -341,25 +403,6 @@ public class OrderPayController {
order.setProfitSharingStatus(profitSharing.equals("Y"));
order.setPayChannel(1);
orderService.updateOrderData(order);
} else {
JSONObject object = new JSONObject();
object.put("outTradeNo" , order.getOrderNo());
object.put("transType" , "JSAPI");
object.put("payMode" , "WECHAT");
object.put("totalAmount" , order.getPayPrice());
object.put("profitSharing" , 0);
object.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify());
object.put("subject" , orderTitle);
object.put("userId" , body.getString("openId"));
sortedMap = huiConfig.preorder(object);
order.setAccountMerchantNum(HuiConfig.hlMerNo);
order.setProfitSharingStatus(false);
order.setPayChannel(2);
orderService.updateOrderData(order);
}

@ -1,6 +1,5 @@
package com.hai.common.utils;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.pay.util.sdk.WXPayXmlUtil;
@ -10,7 +9,6 @@ import com.thoughtworks.xstream.io.xml.XppDriver;
import net.sf.cglib.beans.BeanMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.DigestUtils;
import javax.crypto.Mac;
@ -619,4 +617,25 @@ public class WxUtils {
}
}
public static String generateSignKytc(Map<String , Object> map , String key) throws Exception {
Set<String> keySet = map.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("key")) {
continue;
}
if (map.get(k) != null) // 参数值为空,则不参与签名
{
sb.append(k).append("=").append(map.get(k)).append("&");
}
}
sb.append("key=").append(key);
return MD5(sb.toString().toUpperCase() , true);
}
}

@ -0,0 +1,39 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.WxUtils;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Component
public class KytcService {
private final static String reqUrl = "https://kykh.dctpay.com";
private final static String key = "ad/s-kfa*#s!dkfjhjh";
public static JSONObject getOrderPay(String orderNo , BigDecimal price , String cardNo) throws Exception {
JSONObject paramMap = new JSONObject();
paramMap.put("Amount" ,price);
paramMap.put("OrderNo" , orderNo);
paramMap.put("CardNo" , cardNo);
paramMap.put("sign", WxUtils.generateSignKytc(paramMap , key));
return HttpsUtils.doPost(reqUrl + "/api/hf/order-pay", paramMap);
}
public static JSONObject getOrderInfo(String orderNo) throws Exception {
JSONObject paramMap = new JSONObject();
paramMap.put("OrderNo" , orderNo);
paramMap.put("sign", WxUtils.generateSignKytc(paramMap , key));
return HttpsUtils.doPost(reqUrl + "/api/hf/order-info", paramMap);
}
}

@ -41,18 +41,20 @@ public interface HighGasChannelConfigMapper extends HighGasChannelConfigMapperEx
@Insert({
"insert into high_gas_channel_config (channel_id, channel_name, ",
"pay_platform_type, pay_platform_mer_name, ",
"pay_platform_mer_no, profit_sharing_status, ",
"profit_sharing_receivers_no, profit_sharing_ratio, ",
"profit_sharing_receivers_name, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"pay_platform_mer_no, pay_platform_mer_key, ",
"profit_sharing_status, profit_sharing_receivers_no, ",
"profit_sharing_ratio, profit_sharing_receivers_name, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{channelId,jdbcType=INTEGER}, #{channelName,jdbcType=VARCHAR}, ",
"#{payPlatformType,jdbcType=INTEGER}, #{payPlatformMerName,jdbcType=VARCHAR}, ",
"#{payPlatformMerNo,jdbcType=VARCHAR}, #{profitSharingStatus,jdbcType=BIT}, ",
"#{profitSharingReceiversNo,jdbcType=VARCHAR}, #{profitSharingRatio,jdbcType=DECIMAL}, ",
"#{profitSharingReceiversName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{payPlatformMerNo,jdbcType=VARCHAR}, #{payPlatformMerKey,jdbcType=VARCHAR}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{profitSharingReceiversNo,jdbcType=VARCHAR}, ",
"#{profitSharingRatio,jdbcType=DECIMAL}, #{profitSharingReceiversName,jdbcType=VARCHAR}, ",
"#{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(HighGasChannelConfig record);
@ -69,6 +71,7 @@ public interface HighGasChannelConfigMapper extends HighGasChannelConfigMapperEx
@Result(column="pay_platform_type", property="payPlatformType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_platform_mer_name", property="payPlatformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_no", property="payPlatformMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_key", property="payPlatformMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_receivers_no", property="profitSharingReceiversNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@ -85,8 +88,9 @@ public interface HighGasChannelConfigMapper extends HighGasChannelConfigMapperEx
@Select({
"select",
"id, channel_id, channel_name, pay_platform_type, pay_platform_mer_name, pay_platform_mer_no, ",
"profit_sharing_status, profit_sharing_receivers_no, profit_sharing_ratio, profit_sharing_receivers_name, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"pay_platform_mer_key, profit_sharing_status, profit_sharing_receivers_no, profit_sharing_ratio, ",
"profit_sharing_receivers_name, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from high_gas_channel_config",
"where id = #{id,jdbcType=BIGINT}"
})
@ -97,6 +101,7 @@ public interface HighGasChannelConfigMapper extends HighGasChannelConfigMapperEx
@Result(column="pay_platform_type", property="payPlatformType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_platform_mer_name", property="payPlatformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_no", property="payPlatformMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_key", property="payPlatformMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_receivers_no", property="profitSharingReceiversNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@ -126,6 +131,7 @@ public interface HighGasChannelConfigMapper extends HighGasChannelConfigMapperEx
"pay_platform_type = #{payPlatformType,jdbcType=INTEGER},",
"pay_platform_mer_name = #{payPlatformMerName,jdbcType=VARCHAR},",
"pay_platform_mer_no = #{payPlatformMerNo,jdbcType=VARCHAR},",
"pay_platform_mer_key = #{payPlatformMerKey,jdbcType=VARCHAR},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_receivers_no = #{profitSharingReceiversNo,jdbcType=VARCHAR},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",

@ -48,6 +48,10 @@ public class HighGasChannelConfigSqlProvider {
sql.VALUES("pay_platform_mer_no", "#{payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerKey() != null) {
sql.VALUES("pay_platform_mer_key", "#{payPlatformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}");
}
@ -103,6 +107,7 @@ public class HighGasChannelConfigSqlProvider {
sql.SELECT("pay_platform_type");
sql.SELECT("pay_platform_mer_name");
sql.SELECT("pay_platform_mer_no");
sql.SELECT("pay_platform_mer_key");
sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_receivers_no");
sql.SELECT("profit_sharing_ratio");
@ -154,6 +159,10 @@ public class HighGasChannelConfigSqlProvider {
sql.SET("pay_platform_mer_no = #{record.payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerKey() != null) {
sql.SET("pay_platform_mer_key = #{record.payPlatformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
}
@ -208,6 +217,7 @@ public class HighGasChannelConfigSqlProvider {
sql.SET("pay_platform_type = #{record.payPlatformType,jdbcType=INTEGER}");
sql.SET("pay_platform_mer_name = #{record.payPlatformMerName,jdbcType=VARCHAR}");
sql.SET("pay_platform_mer_no = #{record.payPlatformMerNo,jdbcType=VARCHAR}");
sql.SET("pay_platform_mer_key = #{record.payPlatformMerKey,jdbcType=VARCHAR}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_receivers_no = #{record.profitSharingReceiversNo,jdbcType=VARCHAR}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
@ -248,6 +258,10 @@ public class HighGasChannelConfigSqlProvider {
sql.SET("pay_platform_mer_no = #{payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerKey() != null) {
sql.SET("pay_platform_mer_key = #{payPlatformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}");
}

@ -20,7 +20,7 @@ public class HighGasChannelConfig implements Serializable {
private Long id;
/**
* 渠道id 1自建站 2团油 3加好油 4金猪加油 6:点点网络
* 渠道id 1自建站 2团油 3加好油 4金猪加油
*/
private Integer channelId;
@ -30,7 +30,7 @@ public class HighGasChannelConfig implements Serializable {
private String channelName;
/**
* 平台类型 1微信
* 平台类型 1微信 2: 惠支付
*/
private Integer payPlatformType;
@ -44,6 +44,11 @@ public class HighGasChannelConfig implements Serializable {
*/
private String payPlatformMerNo;
/**
* 商户key
*/
private String payPlatformMerKey;
/**
* 是否分账
*/
@ -135,6 +140,14 @@ public class HighGasChannelConfig implements Serializable {
this.payPlatformMerNo = payPlatformMerNo;
}
public String getPayPlatformMerKey() {
return payPlatformMerKey;
}
public void setPayPlatformMerKey(String payPlatformMerKey) {
this.payPlatformMerKey = payPlatformMerKey;
}
public Boolean getProfitSharingStatus() {
return profitSharingStatus;
}
@ -233,6 +246,7 @@ public class HighGasChannelConfig implements Serializable {
&& (this.getPayPlatformType() == null ? other.getPayPlatformType() == null : this.getPayPlatformType().equals(other.getPayPlatformType()))
&& (this.getPayPlatformMerName() == null ? other.getPayPlatformMerName() == null : this.getPayPlatformMerName().equals(other.getPayPlatformMerName()))
&& (this.getPayPlatformMerNo() == null ? other.getPayPlatformMerNo() == null : this.getPayPlatformMerNo().equals(other.getPayPlatformMerNo()))
&& (this.getPayPlatformMerKey() == null ? other.getPayPlatformMerKey() == null : this.getPayPlatformMerKey().equals(other.getPayPlatformMerKey()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingReceiversNo() == null ? other.getProfitSharingReceiversNo() == null : this.getProfitSharingReceiversNo().equals(other.getProfitSharingReceiversNo()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
@ -255,6 +269,7 @@ public class HighGasChannelConfig implements Serializable {
result = prime * result + ((getPayPlatformType() == null) ? 0 : getPayPlatformType().hashCode());
result = prime * result + ((getPayPlatformMerName() == null) ? 0 : getPayPlatformMerName().hashCode());
result = prime * result + ((getPayPlatformMerNo() == null) ? 0 : getPayPlatformMerNo().hashCode());
result = prime * result + ((getPayPlatformMerKey() == null) ? 0 : getPayPlatformMerKey().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingReceiversNo() == null) ? 0 : getProfitSharingReceiversNo().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
@ -280,6 +295,7 @@ public class HighGasChannelConfig implements Serializable {
sb.append(", payPlatformType=").append(payPlatformType);
sb.append(", payPlatformMerName=").append(payPlatformMerName);
sb.append(", payPlatformMerNo=").append(payPlatformMerNo);
sb.append(", payPlatformMerKey=").append(payPlatformMerKey);
sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingReceiversNo=").append(profitSharingReceiversNo);
sb.append(", profitSharingRatio=").append(profitSharingRatio);

@ -516,6 +516,76 @@ public class HighGasChannelConfigExample {
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyIsNull() {
addCriterion("pay_platform_mer_key is null");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyIsNotNull() {
addCriterion("pay_platform_mer_key is not null");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyEqualTo(String value) {
addCriterion("pay_platform_mer_key =", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyNotEqualTo(String value) {
addCriterion("pay_platform_mer_key <>", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyGreaterThan(String value) {
addCriterion("pay_platform_mer_key >", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyGreaterThanOrEqualTo(String value) {
addCriterion("pay_platform_mer_key >=", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyLessThan(String value) {
addCriterion("pay_platform_mer_key <", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyLessThanOrEqualTo(String value) {
addCriterion("pay_platform_mer_key <=", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyLike(String value) {
addCriterion("pay_platform_mer_key like", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyNotLike(String value) {
addCriterion("pay_platform_mer_key not like", value, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyIn(List<String> values) {
addCriterion("pay_platform_mer_key in", values, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyNotIn(List<String> values) {
addCriterion("pay_platform_mer_key not in", values, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyBetween(String value1, String value2) {
addCriterion("pay_platform_mer_key between", value1, value2, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andPayPlatformMerKeyNotBetween(String value1, String value2) {
addCriterion("pay_platform_mer_key not between", value1, value2, "payPlatformMerKey");
return (Criteria) this;
}
public Criteria andProfitSharingStatusIsNull() {
addCriterion("profit_sharing_status is null");
return (Criteria) this;

@ -12,6 +12,7 @@ public enum GasChannel {
type4(4 , "金猪加油"),
type5(5 , "paylo系统"),
type6(6 , "点点网络"),
type7(7 , "烨歌百货"),
;
private Integer type;

@ -7,6 +7,7 @@ import java.util.Objects;
*/
public enum GasChannelPayPlatformType {
type1(1 , "微信"),
type2(2 , "惠支付"),
;
private Integer type;

@ -13,6 +13,7 @@ public enum MerchantStoreSourceType {
type4(4, "金猪加油", "金猪加油"),
type5(5, "paylo", "四川壳牌"),
type6(6, "点点网络", "团油"),
type7(7, "油卡站点", "自建站"),
;
private Integer number;

@ -0,0 +1,66 @@
package com.hai.group;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.HttpsUtils;
import com.hai.config.CommonSysConst;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@Component
public class GroupService {
/**
* @Author Sum1Dream
* @Name getStoreList
* @Description // 查询门店列表
* @Date 11:24 2023/11/1
* @Param params
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject getStoreList(JSONObject params) {
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getPayPostUrl() + "/openGroup/getStoreList" , params);
}
/**
* @Author Sum1Dream
* @Name getGroupContent
* @Description // 查询团购内容
* @Date 11:24 2023/11/1
* @Param groupId
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject getGroupContent(Long groupId) {
Map<String , Object> params = new HashMap<>();
params.put("groupId" , groupId);
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getPayPostUrl() + "/openGroup/getGroupContent" , params);
}
/**
* @Author Sum1Dream
* @Name getStoreMsg
* @Description // 查询门店信息
* @Date 11:24 2023/11/1
* @Param storeId
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject getStoreMsg(Long storeId) {
Map<String , Object> params = new HashMap<>();
params.put("storeId" , storeId);
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getPayPostUrl() + "/openGroup/getStoreMsg" , params);
}
/**
* @Author Sum1Dream
* @Name getBsStoreImgByList
* @Description // 门店查询图片
* @Date 10:00 2023/11/2
* @Param params
* @return com.alibaba.fastjson.JSONObject
*/
public JSONObject getBsStoreImgByList(JSONObject params) {
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getPayPostUrl() + "/openGroup/getBsStoreImgByList" , params);
}
}

@ -92,6 +92,8 @@ public class CreateOrderChildModel {
private String gasGunNo;
// 代理商价格
private Boolean isTyAgent;
// 油卡号
private String oilCardNo;
/** ======================= 油站所需参数 ======================== **/

@ -108,4 +108,15 @@ public interface OrderCreateHandleService {
*/
HighChildOrder blxOrder(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
/**
* @Author Sum1Dream
* @Name levelUp
* @Description // 升级会员
* @Date 11:02 2023/11/6
* @Param order
* @Param createOrderChildModel
* @return com.hai.entity.HighChildOrder
*/
HighChildOrder levelUp(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
}

@ -150,6 +150,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
@Resource
private ShoppingCartService shoppingCartService;
@Resource
private HighOilCardOrderService highOilCardOrderService;
@Override
public List<HighChildOrder> couponHandle(HighDiscountUserRel discountUserRel, CreateOrderChildModel createOrderChild) throws Exception {
if (createOrderChild.getSaleCount() != 1) {
@ -354,6 +357,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
}
if (store.getSourceType() == 7) {
if (createOrderChild.getOilCardNo() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡号不能为空!");
}
}
// 查询商户
HighMerchant merchant = merchantService.getDetailById(store.getMerchantId());
if (merchant == null) {
@ -549,6 +559,20 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
}
gasOrderService.addGasOrder(gasOrder);
if (store.getSourceType() == 7 ){
HighOilCardOrder oilCardOrder = new HighOilCardOrder();
oilCardOrder.setPrice(createOrderChild.getGoodsPrice());
oilCardOrder.setCardNo(createOrderChild.getOilCardNo());
oilCardOrder.setOrderNo(createOrderModel.getOrderNo());
oilCardOrder.setThirdOrderNo("HF" + OrderUtil.generateOrderNo());
oilCardOrder.setCreateTime(new Date());
oilCardOrder.setUpdateTime(new Date());
oilCardOrder.setStatus(1);
highOilCardOrderService.insertOilCardOrder(oilCardOrder);
}
return childOrder;
}
@ -1087,4 +1111,30 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder;
}
@Override
public HighChildOrder levelUp(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception {
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.TYPE14.getNumber());
childOrder.setGoodsId(order.getMemId());
childOrder.setGoodsName("升级会员");
childOrder.setGoodsSpecName("升级会员");
childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice());
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setSaleCount(createOrderChildModel.getSaleCount());
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(childOrder.getGoodsPrice());
childOrder.setTotalActualPrice(childOrder.getGoodsPrice());
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
return childOrder;
}
}

@ -120,6 +120,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource
private HighOrderService highOrderService;
@Resource
private HighOilCardOrderService highOilCardOrderService;
@Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) {
@ -241,6 +244,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
blxCouponHandle(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE13.getNumber())) {
blxOrderHandle(order);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) {
levelUp(order);
}
}
}
@ -393,6 +398,17 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
object.put("priceGun", gasOrder.getGasPriceGun()); // 枪单价
object.put("priceVip", gasOrder.getGasPriceVip()); // 优惠价
DianConfig.refuelingOrderPush(object);
} else if (gasOrder.getChannelType().equals(MerchantStoreSourceType.type7.getNumber())) {
HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(order.getOrderNo());
highOilCardOrder.setStatus(2);
JSONObject object = KytcService.getOrderPay(highOilCardOrder.getThirdOrderNo() , highOilCardOrder.getPrice() , highOilCardOrder.getCardNo());
highOilCardOrder.setExt1(object.toJSONString());
highOilCardOrderService.updateOilCardOrder(highOilCardOrder);
}
}
}
@ -600,4 +616,25 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
}
private void levelUp(HighOrder order) {
HighUserLevel userLevel = new HighUserLevel();
userLevel.setLevel("1");
userLevel.setCreateTime(new Date());
userLevel.setUserId(order.getMemId());
userLevel.setStatus(1);
userLevel.setUpdateTime(new Date());
userService.insertLevelUp(userLevel);
order.setOrderStatus(OrderStatus.STATUS3.getNumber());
order.setFinishTime(new Date());
for (HighChildOrder childOrder : order.getHighChildOrderList()) {
childOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber());
}
}
}

@ -357,6 +357,12 @@ public class OrderServiceImpl implements OrderService {
order.setTitle(order.getTitle() + "+" +childOrder.getGoodsName());
order.setExt6(order.getExt6() + "," +childOrder.getGoodsImg());
}
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.levelUp(order , child);
childOrderList.add(childOrder);
order.setProductType(OrderProductType.PRODUCT_TYPE15.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("升级会员");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");
}

@ -22,6 +22,7 @@ public enum OrderChildGoodsType {
TYPE11(11, "实物商品购买"),
TYPE12(12, "比邻星停车券"),
TYPE13(13, "比邻星停车"),
TYPE14(14, "升级会员"),
;
private Integer number;

@ -24,6 +24,7 @@ public enum OrderProductType {
PRODUCT_TYPE12(12, "实物商品" , "orderLogo/goods.png", "GOODS"),
PRODUCT_TYPE13(13, "比邻星停车券" , "orderLogo/coupon.png", "BLX_COUPON"),
PRODUCT_TYPE14(14, "比邻星停车业务" , "orderLogo/coupon.png", "BLX_PARK"),
PRODUCT_TYPE15(15, "升级会员" , "orderLogo/coupon.png", "LEVEL_UP"),
PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"),
PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
;

@ -8,10 +8,13 @@ import com.hai.common.pay.WechatPayUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.config.CommonSysConst;
import com.hai.dao.HighPayRecordMapper;
import com.hai.entity.HighGasChannelConfig;
import com.hai.entity.HighOrder;
import com.hai.entity.HighPayRecord;
import com.hai.enum_type.GasChannel;
import com.hai.order.utils.OrderUtil;
import com.hai.pay.channel.huipay.utils.SignatureUtil;
import com.hai.service.HighGasChannelConfigService;
import com.hai.service.HighOrderService;
import com.hai.service.pay.PayRecordService;
import org.slf4j.Logger;
@ -29,16 +32,18 @@ import java.util.TreeMap;
public class HuiConfig {
@Resource
private PayRecordService payRecordService;
private HighGasChannelConfigService gasChannelConfigService;
@Resource
private HighOrderService highOrderService;
private PayRecordService payRecordService;
private static Logger log = LoggerFactory.getLogger(HuiConfig.class);
// 请求地址
public final static String postUrl = "https://pay.dctpay.com/openApi/v1/";
public final static String hlSubAppid = "wx8d49e2f83025229d";
// 渝北区浩联物资经营部
public final static String hlMerNo = "2023090816465844909";
public final static String yFMerNo = "2023101109385455305";
@ -47,8 +52,6 @@ public class HuiConfig {
public final static String hlKey = "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt";
public final static String yFKey = "plfJ6Ohgj4OmPblknuMzoSeT8cvI5dTR";
public final static String hlSubAppid = "wx8d49e2f83025229d";
/**
* @Author Sum1Dream
* @Name preorder
@ -57,6 +60,43 @@ public class HuiConfig {
* @Param object
* @return java.util.SortedMap<java.lang.Object,java.lang.Object>
*/
public SortedMap<Object,Object> preorder(JSONObject object , String key , String payPlatformMerNo) throws Exception {
object.put("merchantNo" , payPlatformMerNo);
object.put("subAppid" , hlSubAppid);
object.put("sign" , SignatureUtil.createSign(object , key));
JSONObject jsonObject = HttpsUtils.doPost(postUrl + "trade/preorder", object, new HashMap<>());
// 签名校验
SortedMap<Object,Object> sortedMap;
if (jsonObject.getString("return_code").equals("000000")) {
JSONObject payParam = jsonObject.getJSONObject("return_data").getJSONObject("payParam");
sortedMap = new TreeMap<>();
sortedMap.put("appId", payParam.get("app_id"));
sortedMap.put("nonceStr", payParam.get("nonce_str"));
sortedMap.put("timeStamp", payParam.get("time_stamp"));
sortedMap.put("signType", "MD5");
sortedMap.put("package", payParam.get("package"));
sortedMap.put("sign", payParam.get("pay_sign"));
// 将支付请求存入支付纪录
HighPayRecord payRecord = new HighPayRecord();
payRecord.setBodyInfo(String.valueOf(payParam));
payRecord.setResType(1);
payRecord.setPayType(2);
payRecord.setPayMoney(object.getBigDecimal("totalAmount"));
payRecordService.addPayRecord(payRecord);
} else {
log.error("微信支付 -> 组装支付参数:支付信息错误");
log.error("错误信息:" + jsonObject.getString("return_msg"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,请稍后重新提交订单支付!");
}
return sortedMap;
}
public SortedMap<Object,Object> preorder(JSONObject object) throws Exception {
object.put("merchantNo" , yFMerNo);
object.put("subAppid" , hlSubAppid);
@ -104,12 +144,14 @@ public class HuiConfig {
*/
public JSONObject refund(HighOrder order) throws Exception {
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(order.getAccountMerchantNum());
JSONObject object = new JSONObject();
object.put("merchantNo" , hlMerNo);
object.put("merchantNo" , gasChannelConfig.getPayPlatformMerNo());
object.put("outTradeNo" , order.getOrderNo());
object.put("refundTradeNo" , OrderUtil.generateRefundOrderNo());
object.put("refundAmount" , order.getPayRealPrice());
object.put("sign" , SignatureUtil.createSign(object , hlKey));
object.put("sign" , SignatureUtil.createSign(object , gasChannelConfig.getPayPlatformMerKey()));
return HttpsUtils.doPost(postUrl + "trade/refund", object, new HashMap<>());

@ -23,4 +23,8 @@ public interface HighGasChannelConfigService {
*/
HighGasChannelConfig getConfig(GasChannel channelId, GasChannelPayPlatformType payPlatformType);
HighGasChannelConfig getConfig(GasChannel channelId);
HighGasChannelConfig getConfig(String merNo);
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.github.pagehelper.PageInfo;
import com.hai.entity.HighMerchantStore;
import com.hai.entity.HighStoreOilCard;
import com.hai.model.GasSelfBuiltStationModel;
import com.hai.model.HighMerchantStoreModel;
@ -105,4 +106,44 @@ public interface HighMerchantStoreService {
* @return
*/
List<GasSelfBuiltStationModel> getGasSelfBuiltStationList(Map<String, Object> map);
/**
* @Author Sum1Dream
* @Name insertStoreOilCard
* @Description // 新增门店油卡
* @Date 14:28 2023/11/2
* @Param highStoreOilCard
* @return void
*/
void insertStoreOilCard(HighStoreOilCard highStoreOilCard) throws Exception;
/**
* @Author 胡锐
* @Description 修改新增门店油卡
* @Date 2021/3/12 22:15
**/
void updateStoreOilCard(HighStoreOilCard highStoreOilCard) throws Exception;
/**
* @Author Sum1Dream
* @Name findStoreOilCard
* @Description // 查询门店油卡
* @Date 14:42 2023/11/2
* @Param id
* @return com.hai.entity.HighStoreOilCard
*/
HighStoreOilCard findStoreOilCard(Long id);
/**
* @Author Sum1Dream
* @Name getStoreOilCardList
* @Description //TODO
* @Date 14:32 2023/11/2
* @Param map
* @return java.util.List<com.hai.entity.HighStoreOilCard>
*/
List<HighStoreOilCard> getStoreOilCardList(Long storeId);
}

@ -0,0 +1,13 @@
package com.hai.service;
import com.hai.entity.HighOilCardOrder;
public interface HighOilCardOrderService {
void insertOilCardOrder(HighOilCardOrder highOilCardOrder);
void updateOilCardOrder(HighOilCardOrder highOilCardOrder);
HighOilCardOrder findOrder(String orderNo);
}

@ -3,6 +3,7 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.security.SessionObject;
import com.hai.entity.HighUser;
import com.hai.entity.HighUserLevel;
import com.hai.enum_type.LoginPlatform;
import com.hai.model.HighUserModel;
@ -161,5 +162,12 @@ public interface HighUserService {
*/
JSONObject userDistributionStatistics(Long userId);
void insertLevelUp(HighUserLevel highUserLevel);
void editLevelUp(HighUserLevel highUserLevel);
HighUserLevel findUserLevel(Long userId);
}

@ -45,4 +45,30 @@ public class HighGasChannelConfigServiceImpl implements HighGasChannelConfigServ
}
return null;
}
@Override
public HighGasChannelConfig getConfig(GasChannel channelId) {
HighGasChannelConfigExample example = new HighGasChannelConfigExample();
example.createCriteria()
.andChannelIdEqualTo(channelId.getType())
.andStatusEqualTo(1);
List<HighGasChannelConfig> list = gasChannelConfigMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public HighGasChannelConfig getConfig(String merNo) {
HighGasChannelConfigExample example = new HighGasChannelConfigExample();
example.createCriteria()
.andPayPlatformMerNoEqualTo(merNo)
.andStatusEqualTo(1);
List<HighGasChannelConfig> list = gasChannelConfigMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -156,6 +156,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
|| store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())
) {
// 嗨森逛平台价 油枪价 * 折扣

@ -503,6 +503,7 @@ public class HighGasServiceImpl implements HighGasService {
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.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
@ -515,6 +516,7 @@ public class HighGasServiceImpl implements HighGasService {
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"));
@ -555,6 +557,7 @@ public class HighGasServiceImpl implements HighGasService {
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"));

@ -10,6 +10,7 @@ import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.MD5Util;
import com.hai.config.SpPrinterConfig;
import com.hai.dao.HighMerchantStoreMapper;
import com.hai.dao.HighStoreOilCardMapper;
import com.hai.entity.*;
import com.hai.model.GasSelfBuiltStationModel;
import com.hai.model.HighMerchantStoreModel;
@ -44,6 +45,9 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
@Resource
private HighMerchantStoreAccountService merchantStoreAccountService;
@Resource
private HighStoreOilCardMapper highStoreOilCardMapper;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertMerchantStore(HighMerchantStoreModel highMerchantStore) throws Exception {
@ -255,5 +259,29 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
return highMerchantStoreMapper.selectGasSelfBuiltStationList(map);
}
@Override
public void insertStoreOilCard(HighStoreOilCard highStoreOilCard) throws Exception {
highStoreOilCardMapper.insert(highStoreOilCard);
}
@Override
public void updateStoreOilCard(HighStoreOilCard highStoreOilCard) throws Exception {
highStoreOilCardMapper.updateByPrimaryKey(highStoreOilCard);
}
@Override
public HighStoreOilCard findStoreOilCard(Long id) {
return highStoreOilCardMapper.selectByPrimaryKey(id);
}
@Override
public List<HighStoreOilCard> getStoreOilCardList(Long storeId) {
HighStoreOilCardExample example = new HighStoreOilCardExample();
HighStoreOilCardExample.Criteria criteria = example.createCriteria();
criteria.andStoreIdEqualTo(storeId).andStatusEqualTo(1);
return highStoreOilCardMapper.selectByExample(example);
}
}

@ -0,0 +1,43 @@
package com.hai.service.impl;
import com.hai.dao.HighOilCardOrderMapper;
import com.hai.entity.HighOilCardOrder;
import com.hai.entity.HighOilCardOrderExample;
import com.hai.service.HighOilCardOrderService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("highOilCardOrderService")
public class HighOilCardOrderServiceImpl implements HighOilCardOrderService {
@Resource
private HighOilCardOrderMapper highOilCardOrderMapper;
@Override
public void insertOilCardOrder(HighOilCardOrder highOilCardOrder) {
highOilCardOrderMapper.insert(highOilCardOrder);
}
@Override
public void updateOilCardOrder(HighOilCardOrder highOilCardOrder) {
highOilCardOrderMapper.updateByPrimaryKey(highOilCardOrder);
}
@Override
public HighOilCardOrder findOrder(String orderNo) {
HighOilCardOrderExample example = new HighOilCardOrderExample();
HighOilCardOrderExample.Criteria criteria = example.createCriteria();
criteria.andOrderNoEqualTo(orderNo);
List<HighOilCardOrder> list = highOilCardOrderMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -12,6 +12,7 @@ import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RequestUtils;
import com.hai.dao.HighGoldRecMapper;
import com.hai.dao.HighUserLevelMapper;
import com.hai.dao.HighUserLoginLogMapper;
import com.hai.dao.HighUserMapper;
import com.hai.entity.*;
@ -50,7 +51,7 @@ public class HighUserServiceImpl implements HighUserService {
private HighUserCouponService highUserCouponService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
private HighUserLevelMapper highUserLevelMapper;
@Resource
private HighUserCardService highUserCardService;
@ -420,6 +421,32 @@ public class HighUserServiceImpl implements HighUserService {
JSONObject object = new JSONObject();
return null;
}
@Override
public void insertLevelUp(HighUserLevel highUserLevel) {
highUserLevelMapper.insert(highUserLevel);
}
@Override
public void editLevelUp(HighUserLevel highUserLevel) {
highUserLevelMapper.updateByPrimaryKeySelective(highUserLevel);
}
@Override
public HighUserLevel findUserLevel(Long userId) {
HighUserLevelExample example = new HighUserLevelExample();
HighUserLevelExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId).andStatusEqualTo(1);
List<HighUserLevel> list = highUserLevelMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

Loading…
Cancel
Save