提交代码

new-dev
胡锐 1 year ago
parent bfe36261de
commit 67cd88e026
  1. 25
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  2. 5
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java
  3. 2
      hai-order/src/main/java/com/web/config/AuthConfig.java
  4. 41
      hai-order/src/main/java/com/web/controller/OrderController.java
  5. 191
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  6. 30
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java
  7. 14
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java
  8. 16
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java
  9. 70
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java
  10. 3
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  11. 20
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  12. 1
      hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java
  13. 7
      hai-service/src/main/java/com/hai/service/HighMerchantTripartitePlatformService.java
  14. 11
      hai-service/src/main/java/com/hai/service/impl/HighMerchantTripartitePlatformServiceImpl.java

@ -5,11 +5,13 @@ import com.bweb.excelListener.ImportStoreListener;
import com.bweb.model.ImportStoreModel; import com.bweb.model.ImportStoreModel;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.QRCodeGenerator;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
@ -29,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -370,15 +373,27 @@ public class HighMerchantStoreController {
@RequestMapping(value = "/getQrCode", method = RequestMethod.GET) @RequestMapping(value = "/getQrCode", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "生成推广二维码") @ApiOperation(value = "生成推广二维码")
public ResponseData getQrCode(@RequestParam(name = "storeKey", required = false) String storeKey) { public ResponseData getQrCode(@RequestParam(name = "storeKey", required = true) String storeKey) {
try { try {
/* Map<String, Object> params = new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("type", "2"); params.put("type", "2");
params.put("code", storeKey); params.put("code", storeKey);
return ResponseMsgUtil.success(HttpsUtils.doGet("https://hsg.dctpay.com/v1/wxMsg/createQrcode", params).getString("return_data")); return ResponseMsgUtil.success(HttpsUtils.doGet("https://hsg.dctpay.com/v1/wxMsg/createQrcode", params).getString("return_data"));
*/
// 生成二维码
String qrCodeImg = storeKey + ".png";
String qrCodeUrl = CommonSysConst.getSysConfig().getFileUrl() + "/oil_img/" + qrCodeImg;
// 参数
String url = CommonSysConst.getSysConfig().getHsgDomainName()+ "/hsgH5?accountId=0000019&key=&code=" + storeKey;
File file = new File(qrCodeImg);
// 文件是否存在
if (!file.exists()) {
// 不存在生成二维码
QRCodeGenerator.generateQRCodeImage(url, 350, 350, qrCodeUrl);
}
return ResponseMsgUtil.success(CommonSysConst.getSysConfig().getHsgDomainName() + "/filesystem/oil_img/" + qrCodeImg);
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e); log.error("HighOrderController --> getBackendToken() error!", e);

@ -61,7 +61,7 @@ public class HighMerchantTripartitePlatformController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
HighMerchantTripartitePlatform platform = tripartitePlatformService.getDetail(body.getLong("merId"), body.getInteger("platformType")); HighMerchantTripartitePlatform platform = tripartitePlatformService.getDetail(body.getLong("merId"));
if (platform == null) { if (platform == null) {
platform = new HighMerchantTripartitePlatform(); platform = new HighMerchantTripartitePlatform();
} }
@ -69,6 +69,7 @@ public class HighMerchantTripartitePlatformController {
platform.setPlatformType(body.getInteger("platformType")); platform.setPlatformType(body.getInteger("platformType"));
platform.setPlatformMerName(body.getString("platformMerName")); platform.setPlatformMerName(body.getString("platformMerName"));
platform.setPlatformMerNumber(body.getString("platformMerNumber")); platform.setPlatformMerNumber(body.getString("platformMerNumber"));
platform.setPlatformMerKey(body.getString("platformMerKey"));
platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus")); platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus"));
platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio")); platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio"));
platform.setProfitSharingReceiversNumber(body.getString("profitSharingReceiversNumber")); platform.setProfitSharingReceiversNumber(body.getString("profitSharingReceiversNumber"));
@ -98,6 +99,8 @@ public class HighMerchantTripartitePlatformController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, postData.get("err_code_des")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, postData.get("err_code_des"));
} }
} }
tripartitePlatformService.editDate(platform); tripartitePlatformService.editDate(platform);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

@ -90,9 +90,11 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/**/springfox-swagger-ui/**") .excludePathPatterns("/**/springfox-swagger-ui/**")
.excludePathPatterns("/**/swagger-ui.html") .excludePathPatterns("/**/swagger-ui.html")
.excludePathPatterns("/login/*") .excludePathPatterns("/login/*")
.excludePathPatterns("/createNL")
.excludePathPatterns("/cqNotify/*") .excludePathPatterns("/cqNotify/*")
.excludePathPatterns("/mobileRechargeNotify/*") .excludePathPatterns("/mobileRechargeNotify/*")
.excludePathPatterns("/payNotify/*") .excludePathPatterns("/payNotify/*")
.excludePathPatterns("/orderPay/*")
.excludePathPatterns("/telChargeCallback/*") .excludePathPatterns("/telChargeCallback/*")
.excludePathPatterns("/huiPayNotify/*") .excludePathPatterns("/huiPayNotify/*")
; ;

@ -167,6 +167,47 @@ public class OrderController {
} }
} }
@RequestMapping(value="/createNL",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建订单【免登陆】")
public ResponseData createNL(@RequestBody CreateOrderModel body) {
try {
System.out.println("=================" + JSONObject.toJSONString(body));
if (body.getChildOrderList() == null || body.getChildOrderList().size() == 0) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
for (CreateOrderChildModel childModel : body.getChildOrderList()) {
// 校验子订单参数
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, "");
}
if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE3.getNumber())) {
if (childModel.getGoodsPrice() == null) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写充值金额");
}
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知交易业务");
}
}
body.setOrderNo(OrderUtil.generateOrderNo());
return ResponseMsgUtil.success(orderService.createOrder(body));
} catch (Exception e) {
log.error("OrderController -> create() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/createCombine",method = RequestMethod.POST) @RequestMapping(value="/createCombine",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "创建合单订单") @ApiOperation(value = "创建合单订单")

@ -238,15 +238,27 @@ public class OrderPayController {
// 预存类型 0:非预存 1:预存门店 // 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType().equals(0)) { if (store.getPrestoreType().equals(0)) {
// 第三方平台 // 第三方平台
HighMerchantTripartitePlatform merTripartitePlatform = merTripartitePlatformService.getDetail(store.getMerchantId(), 1); HighMerchantTripartitePlatform merTripartitePlatform = merTripartitePlatformService.getDetail(store.getMerchantId());
if (merTripartitePlatform != null) { // 微信直连
if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(1)) {
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber()); weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true) ? "Y" : "N"; } else if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(2)) {
payPlatformType = merTripartitePlatform.getPlatformType();
payPlatformKey = merTripartitePlatform.getPlatformMerKey();
payPlatformMerNo = merTripartitePlatform.getPlatformMerNumber();
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
} }
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true) ? "Y" : "N";
} }
} }
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { } else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询支付配置 // 查询支付配置
@ -417,6 +429,177 @@ public class OrderPayController {
} }
} }
@RequestMapping(value = "/alipay", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "支付宝支付")
public ResponseData alipay(@RequestBody JSONObject body) {
try {
System.out.println("支付宝支付===================" + body);
if (body == null
|| StringUtils.isBlank(body.getString("orderNo"))
|| StringUtils.isBlank(body.getString("userId"))
) {
log.error("wxPay error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询订单
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
log.error("wxPay ERROR", "订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
}
// 是否分账
String profitSharing = "N";
// 订单标题
String orderTitle = "购买商品";
Integer payPlatformType = null;
String payPlatformKey = null;
String payPlatformMerNo = null;
if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) {
// 查询油站
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
}
if (store.getPrestoreType().equals(1)) {
if (order.getTotalPrice().compareTo(gasService.getMerPriceByMerId(store.getMerchantId())) == 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法进行支付,请联系平台客服");
}
}
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type1, GasChannelPayPlatformType.type2);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
// 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType().equals(0)) {
// 第三方平台
HighMerchantTripartitePlatform merTripartitePlatform = merTripartitePlatformService.getDetail(store.getMerchantId());
if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(GasChannelPayPlatformType.type2.getType())) {
payPlatformType = merTripartitePlatform.getPlatformType();
payPlatformKey = merTripartitePlatform.getPlatformMerKey();
payPlatformMerNo = merTripartitePlatform.getPlatformMerNumber();
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true) ? "Y" : "N";
}
}
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询支付配置
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();
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
// 查询支付配置
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();
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
// 查询支付配置
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();
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) {
// 查询支付配置
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();
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
// 查询支付配置
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();
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();
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
}
JSONObject payParam = new JSONObject();
payParam.put("outTradeNo" , order.getOrderNo());
payParam.put("transType" , "JSAPI");
payParam.put("payMode" , "ALIPAY");
payParam.put("totalAmount" , order.getTotalPrice());
payParam.put("profitSharing" , profitSharing.equals("Y")?1:0);
payParam.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify());
payParam.put("subject" , orderTitle);
payParam.put("userId" , body.getString("userId"));
SortedMap<Object, Object> sortedMap = huiConfig.preorder(payParam, payPlatformKey, payPlatformMerNo);
order.setAccountMerchantNum(payPlatformMerNo);
order.setProfitSharingStatus(false);
order.setPayChannel(payPlatformType);
orderService.updateOrderData(order);
return ResponseMsgUtil.success(sortedMap);
} catch (Exception e) {
log.error("OrderController -> create() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/cardPay", method = RequestMethod.POST) @RequestMapping(value = "/cardPay", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "卡支付") @ApiOperation(value = "卡支付")

@ -41,18 +41,18 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Insert({ @Insert({
"insert into high_merchant_tripartite_platform (mer_id, platform_type, ", "insert into high_merchant_tripartite_platform (mer_id, platform_type, ",
"platform_mer_name, platform_mer_number, ", "platform_mer_name, platform_mer_number, ",
"profit_sharing_status, profit_sharing_ratio, ", "platform_mer_key, profit_sharing_status, ",
"profit_sharing_receivers_number, profit_sharing_receivers_name, ", "profit_sharing_ratio, profit_sharing_receivers_number, ",
"`status`, create_time, ", "profit_sharing_receivers_name, `status`, ",
"update_time, ext_1, ", "create_time, update_time, ",
"ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ", "values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{platformMerName,jdbcType=VARCHAR}, #{platformMerNumber,jdbcType=VARCHAR}, ", "#{platformMerName,jdbcType=VARCHAR}, #{platformMerNumber,jdbcType=VARCHAR}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{profitSharingRatio,jdbcType=DECIMAL}, ", "#{platformMerKey,jdbcType=VARCHAR}, #{profitSharingStatus,jdbcType=BIT}, ",
"#{profitSharingReceiversNumber,jdbcType=VARCHAR}, #{profitSharingReceiversName,jdbcType=VARCHAR}, ", "#{profitSharingRatio,jdbcType=DECIMAL}, #{profitSharingReceiversNumber,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{profitSharingReceiversName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighMerchantTripartitePlatform record); int insert(HighMerchantTripartitePlatform record);
@ -68,6 +68,7 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR), @Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR), @Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_key", property="platformMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT), @Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL), @Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR), @Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR),
@ -83,9 +84,10 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Select({ @Select({
"select", "select",
"id, mer_id, platform_type, platform_mer_name, platform_mer_number, profit_sharing_status, ", "id, mer_id, platform_type, platform_mer_name, platform_mer_number, platform_mer_key, ",
"profit_sharing_ratio, profit_sharing_receivers_number, profit_sharing_receivers_name, ", "profit_sharing_status, profit_sharing_ratio, profit_sharing_receivers_number, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3", "profit_sharing_receivers_name, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from high_merchant_tripartite_platform", "from high_merchant_tripartite_platform",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -95,6 +97,7 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR), @Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR), @Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_key", property="platformMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT), @Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL), @Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR), @Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR),
@ -123,6 +126,7 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
"platform_type = #{platformType,jdbcType=INTEGER},", "platform_type = #{platformType,jdbcType=INTEGER},",
"platform_mer_name = #{platformMerName,jdbcType=VARCHAR},", "platform_mer_name = #{platformMerName,jdbcType=VARCHAR},",
"platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR},", "platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR},",
"platform_mer_key = #{platformMerKey,jdbcType=VARCHAR},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},", "profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},", "profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",
"profit_sharing_receivers_number = #{profitSharingReceiversNumber,jdbcType=VARCHAR},", "profit_sharing_receivers_number = #{profitSharingReceiversNumber,jdbcType=VARCHAR},",

@ -44,6 +44,10 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.VALUES("platform_mer_number", "#{platformMerNumber,jdbcType=VARCHAR}"); sql.VALUES("platform_mer_number", "#{platformMerNumber,jdbcType=VARCHAR}");
} }
if (record.getPlatformMerKey() != null) {
sql.VALUES("platform_mer_key", "#{platformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) { if (record.getProfitSharingStatus() != null) {
sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}"); sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}");
} }
@ -98,6 +102,7 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SELECT("platform_type"); sql.SELECT("platform_type");
sql.SELECT("platform_mer_name"); sql.SELECT("platform_mer_name");
sql.SELECT("platform_mer_number"); sql.SELECT("platform_mer_number");
sql.SELECT("platform_mer_key");
sql.SELECT("profit_sharing_status"); sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_ratio"); sql.SELECT("profit_sharing_ratio");
sql.SELECT("profit_sharing_receivers_number"); sql.SELECT("profit_sharing_receivers_number");
@ -145,6 +150,10 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}"); sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}");
} }
if (record.getPlatformMerKey() != null) {
sql.SET("platform_mer_key = #{record.platformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) { if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}"); sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
} }
@ -198,6 +207,7 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_mer_name = #{record.platformMerName,jdbcType=VARCHAR}"); sql.SET("platform_mer_name = #{record.platformMerName,jdbcType=VARCHAR}");
sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}"); sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}");
sql.SET("platform_mer_key = #{record.platformMerKey,jdbcType=VARCHAR}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}"); sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}"); sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
sql.SET("profit_sharing_receivers_number = #{record.profitSharingReceiversNumber,jdbcType=VARCHAR}"); sql.SET("profit_sharing_receivers_number = #{record.profitSharingReceiversNumber,jdbcType=VARCHAR}");
@ -234,6 +244,10 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR}"); sql.SET("platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR}");
} }
if (record.getPlatformMerKey() != null) {
sql.SET("platform_mer_key = #{platformMerKey,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) { if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}"); sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}");
} }

@ -36,6 +36,11 @@ public class HighMerchantTripartitePlatform implements Serializable {
*/ */
private String platformMerNumber; private String platformMerNumber;
/**
* 商户key
*/
private String platformMerKey;
/** /**
* 是否分账 * 是否分账
*/ */
@ -119,6 +124,14 @@ public class HighMerchantTripartitePlatform implements Serializable {
this.platformMerNumber = platformMerNumber; this.platformMerNumber = platformMerNumber;
} }
public String getPlatformMerKey() {
return platformMerKey;
}
public void setPlatformMerKey(String platformMerKey) {
this.platformMerKey = platformMerKey;
}
public Boolean getProfitSharingStatus() { public Boolean getProfitSharingStatus() {
return profitSharingStatus; return profitSharingStatus;
} }
@ -216,6 +229,7 @@ public class HighMerchantTripartitePlatform implements Serializable {
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) && (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformMerName() == null ? other.getPlatformMerName() == null : this.getPlatformMerName().equals(other.getPlatformMerName())) && (this.getPlatformMerName() == null ? other.getPlatformMerName() == null : this.getPlatformMerName().equals(other.getPlatformMerName()))
&& (this.getPlatformMerNumber() == null ? other.getPlatformMerNumber() == null : this.getPlatformMerNumber().equals(other.getPlatformMerNumber())) && (this.getPlatformMerNumber() == null ? other.getPlatformMerNumber() == null : this.getPlatformMerNumber().equals(other.getPlatformMerNumber()))
&& (this.getPlatformMerKey() == null ? other.getPlatformMerKey() == null : this.getPlatformMerKey().equals(other.getPlatformMerKey()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus())) && (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio())) && (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
&& (this.getProfitSharingReceiversNumber() == null ? other.getProfitSharingReceiversNumber() == null : this.getProfitSharingReceiversNumber().equals(other.getProfitSharingReceiversNumber())) && (this.getProfitSharingReceiversNumber() == null ? other.getProfitSharingReceiversNumber() == null : this.getProfitSharingReceiversNumber().equals(other.getProfitSharingReceiversNumber()))
@ -237,6 +251,7 @@ public class HighMerchantTripartitePlatform implements Serializable {
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformMerName() == null) ? 0 : getPlatformMerName().hashCode()); result = prime * result + ((getPlatformMerName() == null) ? 0 : getPlatformMerName().hashCode());
result = prime * result + ((getPlatformMerNumber() == null) ? 0 : getPlatformMerNumber().hashCode()); result = prime * result + ((getPlatformMerNumber() == null) ? 0 : getPlatformMerNumber().hashCode());
result = prime * result + ((getPlatformMerKey() == null) ? 0 : getPlatformMerKey().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode()); result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode()); result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
result = prime * result + ((getProfitSharingReceiversNumber() == null) ? 0 : getProfitSharingReceiversNumber().hashCode()); result = prime * result + ((getProfitSharingReceiversNumber() == null) ? 0 : getProfitSharingReceiversNumber().hashCode());
@ -261,6 +276,7 @@ public class HighMerchantTripartitePlatform implements Serializable {
sb.append(", platformType=").append(platformType); sb.append(", platformType=").append(platformType);
sb.append(", platformMerName=").append(platformMerName); sb.append(", platformMerName=").append(platformMerName);
sb.append(", platformMerNumber=").append(platformMerNumber); sb.append(", platformMerNumber=").append(platformMerNumber);
sb.append(", platformMerKey=").append(platformMerKey);
sb.append(", profitSharingStatus=").append(profitSharingStatus); sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingRatio=").append(profitSharingRatio); sb.append(", profitSharingRatio=").append(profitSharingRatio);
sb.append(", profitSharingReceiversNumber=").append(profitSharingReceiversNumber); sb.append(", profitSharingReceiversNumber=").append(profitSharingReceiversNumber);

@ -446,6 +446,76 @@ public class HighMerchantTripartitePlatformExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformMerKeyIsNull() {
addCriterion("platform_mer_key is null");
return (Criteria) this;
}
public Criteria andPlatformMerKeyIsNotNull() {
addCriterion("platform_mer_key is not null");
return (Criteria) this;
}
public Criteria andPlatformMerKeyEqualTo(String value) {
addCriterion("platform_mer_key =", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyNotEqualTo(String value) {
addCriterion("platform_mer_key <>", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyGreaterThan(String value) {
addCriterion("platform_mer_key >", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyGreaterThanOrEqualTo(String value) {
addCriterion("platform_mer_key >=", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyLessThan(String value) {
addCriterion("platform_mer_key <", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyLessThanOrEqualTo(String value) {
addCriterion("platform_mer_key <=", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyLike(String value) {
addCriterion("platform_mer_key like", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyNotLike(String value) {
addCriterion("platform_mer_key not like", value, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyIn(List<String> values) {
addCriterion("platform_mer_key in", values, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyNotIn(List<String> values) {
addCriterion("platform_mer_key not in", values, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyBetween(String value1, String value2) {
addCriterion("platform_mer_key between", value1, value2, "platformMerKey");
return (Criteria) this;
}
public Criteria andPlatformMerKeyNotBetween(String value1, String value2) {
addCriterion("platform_mer_key not between", value1, value2, "platformMerKey");
return (Criteria) this;
}
public Criteria andProfitSharingStatusIsNull() { public Criteria andProfitSharingStatusIsNull() {
addCriterion("profit_sharing_status is null"); addCriterion("profit_sharing_status is null");
return (Criteria) this; return (Criteria) this;

@ -360,6 +360,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
if (store == null) { if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
} }
if (!store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber()) && StringUtils.isBlank(order.getMemPhone())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.USE_VISIT_ILLEGAL, "");
}
if (store.getSourceType() == 7) { if (store.getSourceType() == 7) {
if (createOrderChild.getOilCardNo() == null) { if (createOrderChild.getOilCardNo() == null) {

@ -138,6 +138,7 @@ public class OrderServiceImpl implements OrderService {
public HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception { public HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception {
HighDiscountUserRel discountUserRel = null; HighDiscountUserRel discountUserRel = null;
HighOrder order = new HighOrder();
// 使用优惠券 // 使用优惠券
if (createOrderModel.getMemDiscountId() != null) { if (createOrderModel.getMemDiscountId() != null) {
@ -158,16 +159,17 @@ public class OrderServiceImpl implements OrderService {
discountAgentCodeService.updateCode(code); discountAgentCodeService.updateCode(code);
} }
// 查询推广员信息 // 推广码
Map<String, Object> mapUser = new HashMap<>(); order.setPromoteCode(createOrderModel.getPromoteCode());
mapUser.put("userId" , createOrderModel.getMemId()); if (createOrderModel.getMemId() != null) {
BsDistributionUserRel popularizeUser = bsDistributionUserRelService.findDistributionUserRel(mapUser); // 查询推广员信息
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("userId" , createOrderModel.getMemId());
BsDistributionUserRel popularizeUser = bsDistributionUserRelService.findDistributionUserRel(mapUser);
HighOrder order = new HighOrder(); if (popularizeUser != null && createOrderModel.getMemId() != null) {
if (popularizeUser != null && createOrderModel.getMemId() != null) { order.setPromoteCode(popularizeUser.getAgentId().toString());
order.setPromoteCode(popularizeUser.getAgentId().toString()); }
}else {
order.setPromoteCode(createOrderModel.getPromoteCode());
} }
order.setOrderNo(createOrderModel.getOrderNo()); order.setOrderNo(createOrderModel.getOrderNo());

@ -77,6 +77,7 @@ public class HuiConfig {
sortedMap.put("timeStamp", payParam.get("time_stamp")); sortedMap.put("timeStamp", payParam.get("time_stamp"));
sortedMap.put("signType", "MD5"); sortedMap.put("signType", "MD5");
sortedMap.put("package", payParam.get("package")); sortedMap.put("package", payParam.get("package"));
sortedMap.put("prepay_id", payParam.get("prepay_id"));
sortedMap.put("sign", payParam.get("pay_sign")); sortedMap.put("sign", payParam.get("pay_sign"));
// 将支付请求存入支付纪录 // 将支付请求存入支付纪录

@ -17,4 +17,11 @@ public interface HighMerchantTripartitePlatformService {
* @return * @return
*/ */
HighMerchantTripartitePlatform getDetail(Long merId,Integer platformType); HighMerchantTripartitePlatform getDetail(Long merId,Integer platformType);
/**
* 查询详情
* @param merId
* @return
*/
HighMerchantTripartitePlatform getDetail(Long merId);
} }

@ -39,4 +39,15 @@ public class HighMerchantTripartitePlatformServiceImpl implements HighMerchantTr
} }
return null; return null;
} }
@Override
public HighMerchantTripartitePlatform getDetail(Long merId) {
HighMerchantTripartitePlatformExample example = new HighMerchantTripartitePlatformExample();
example.createCriteria().andMerIdEqualTo(merId);
List<HighMerchantTripartitePlatform> list = merchantTripartitePlatformMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
} }

Loading…
Cancel
Save