'提交代码'

dev-discount
胡锐 4 years ago
parent 109b0657c5
commit b25db8264c
  1. 9
      hai-cweb/src/main/java/com/cweb/config/SysConfig.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  3. 1
      hai-cweb/src/main/resources/dev/config.properties
  4. 9
      hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java
  5. 3
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -16,6 +16,7 @@ public class SysConfig {
private String wxApiKey;
private String wxMchId;
private String wxMchAppId;
private String wxSubAppId;
private String wxSubMchId;
private String wxUnifiedOrderUrl;
private String couponCodePath;
@ -100,4 +101,12 @@ public class SysConfig {
public void setWxMchAppId(String wxMchAppId) {
this.wxMchAppId = wxMchAppId;
}
public String getWxSubAppId() {
return wxSubAppId;
}
public void setWxSubAppId(String wxSubAppId) {
this.wxSubAppId = wxSubAppId;
}
}

@ -130,6 +130,7 @@ public class OrderController {
WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo();
weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxMchAppId()); //公众号id
weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号
weChatPayReqInfo.setSub_appid(SysConst.getSysConfig().getWxSubAppId()); //商户号
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId()); //子商户号
weChatPayReqInfo.setOpenid(openId);
@ -143,7 +144,7 @@ public class OrderController {
// weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型
Map<String,String> payMap = new HashMap<>();
payMap.put("app_id",SysConst.getSysConfig().getWxAppId());
payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId());
payMap.put("api_key",SysConst.getSysConfig().getWxApiKey());
payMap.put("unified_order_url",SysConst.getSysConfig().getWxUnifiedOrderUrl());
SortedMap<Object, Object> sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap);

@ -6,6 +6,7 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxApiKey=HfkjWxPayHaiShengGuang0123456789
wxMchAppId=wx637bd6f7314daa46
wxMchId=1289663601
wxSubAppId=wx8d49e2f83025229d
wxSubMchId=1603942866
wxUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder

@ -9,6 +9,7 @@ public class WeChatPayReqInfo implements Serializable {
private static final long serialVersionUID = -7642108447915413137L;
private String appid; // 公众号id 必填
private String mch_id; // 商户号 必填
private String sub_appid; // 微信支付分配的子商户号 必填
private String sub_mch_id; // 微信支付分配的子商户号 必填
private String nonce_str; // 随机字符串 必填
private String sign; // 签名 必填
@ -210,4 +211,12 @@ public class WeChatPayReqInfo implements Serializable {
public void setSub_mch_id(String sub_mch_id) {
this.sub_mch_id = sub_mch_id;
}
public String getSub_appid() {
return sub_appid;
}
public void setSub_appid(String sub_appid) {
this.sub_appid = sub_appid;
}
}

@ -78,7 +78,8 @@ public class HighOrderServiceImpl implements HighOrderService {
highCouponCodeService.updateCouponCode(list.get(0));
// 生成二维码
String qrCodeUrl = "/home/project/hsg/filesystem/couponCode/"+DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png";
//String qrCodeUrl = "/home/project/hsg/filesystem/couponCode/"+DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png";
String qrCodeUrl = "F:\\"+DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png";
QRCodeGenerator.generateQRCodeImage(list.get(0).getSalesCode(), 350, 350, qrCodeUrl);
childOrder.setExt1(qrCodeUrl);
highChildOrderMapper.updateByPrimaryKey(childOrder);

Loading…
Cancel
Save