Commit 70dcffcd by zhangchen

1.活动字段添加

parent 0c03b26a
......@@ -199,19 +199,19 @@ public class WeiXinAtcion {
}
public static Map<String, String> weixinPlay1(String openId, BigDecimal amount, Long orderNo) throws UnsupportedEncodingException, DocumentException {
public static Map<String, String> weixinPlay1(String openId, String amount, Long orderNo, String actName, String sendName, String wishing) throws UnsupportedEncodingException, DocumentException {
SortedMap<Object, Object> paymentPo = new TreeMap<Object, Object>();
paymentPo.put("mch_billno",orderNo.toString());
paymentPo.put("mch_id",Configure.getMch_id());
paymentPo.put("wxappid", Configure.getAppID());
paymentPo.put("send_name","爱玩高尔夫");
paymentPo.put("send_name", sendName);
paymentPo.put("re_openid",openId);
paymentPo.put("total_amount",amount.multiply(new BigDecimal(100)).toString().substring(0, amount.multiply(new BigDecimal(100)).toString().length()-3));
paymentPo.put("total_amount", amount);
paymentPo.put("total_num", "1");
paymentPo.put("wishing", "恭喜发财");
paymentPo.put("wishing", wishing);
paymentPo.put("client_ip", "127.0.0.1");
paymentPo.put("act_name", "新年红包");
paymentPo.put("remark", "新年红包");
paymentPo.put("act_name", actName);
paymentPo.put("remark", "活动红包");
paymentPo.put("scene_id", "PRODUCT_1");
paymentPo.put("nonce_str", WXUtil.generate());
paymentPo.put("sign", WXUtil.createSign_ChooseWXPay("UTF-8", paymentPo, Configure.getKey()));
......
......@@ -44,6 +44,9 @@ public class BuyVoucherActivity implements java.io.Serializable {
private Date DataChange_LastTime;//最近修改时间
private Integer isSendRedPacket;//是否发放红包:0 不发放 1发放
private BigDecimal redPacketPrice;//红包金额
private String sendName;//发送方名称
private String actName;//活动名称
private String wishing;//祝福语
......@@ -208,5 +211,32 @@ public class BuyVoucherActivity implements java.io.Serializable {
this.redPacketPrice = redPacketPrice;
}
@Column(name = "sendName")
public String getSendName() {
return sendName;
}
public void setSendName(String sendName) {
this.sendName = sendName;
}
@Column(name = "actName")
public String getActName() {
return actName;
}
public void setActName(String actName) {
this.actName = actName;
}
@Column(name = "wishing")
public String getWishing() {
return wishing;
}
public void setWishing(String wishing) {
this.wishing = wishing;
}
}
......@@ -113,7 +113,9 @@ public class CommuneNotifyService extends AbstractNotifyService {
//给推荐人发现金红包
if(buyVoucherActivity.getIsSendRedPacket() != null && buyVoucherActivity.getIsSendRedPacket() == 1 && !StringUtils.isEmpty(communeOrderItem.getRecommendUid())){
UserExt user = userExtDao.getByUid(communeOrderItem.getRecommendUid());
WeiXinAtcion.weixinPlay1(user.getMiniAppOpenId(), buyVoucherActivity.getRedPacketPrice(), order.getOrderNo());
BigDecimal amount = buyVoucherActivity.getRedPacketPrice();
amount = amount.multiply(new BigDecimal(100));
WeiXinAtcion.weixinPlay1(user.getMiniAppOpenId(), amount.toString().substring(0, amount.toString().length() - 3), order.getOrderNo(), buyVoucherActivity.getSendName(), buyVoucherActivity.getActName(), buyVoucherActivity.getWishing());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment