master
wangning 8 years ago
parent cf05d18db6
commit 2a55ed7198

@ -269,8 +269,8 @@ public class RedpackServiceImpl implements RedpackService {
ran -= prizeType.getIntValue("weight");
if (ran < 0) {
String lock = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(5, true, true);
int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId, orderAmount.doubleValue(),
new Date());
int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId,
orderAmount.doubleValue(), new Date());
if (lockedCount > 0) {
JSONObject invitationClient = actClientInvitationCodeMapper.getInvitationClient(act_id, client_id);
if (invitationClient != null && invitationClient.getBoolean("auto_send")) {
@ -301,8 +301,8 @@ public class RedpackServiceImpl implements RedpackService {
throw new RedPackException("ServerError", "Customer openid for redpack not available!");
}
String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey());
wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(act.getString("act_name"))
.setRemark("店长激励计划").setAmount(totalAmount).setWishing(wishing).setNotifyUrl(null);
wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(act.getString("act_name")).setRemark("店长激励计划")
.setAmount(totalAmount).setWishing(wishing).setNotifyUrl(null);
String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("redpack_id");
for (JSONObject prizeDetail : reallySend) {
@ -389,8 +389,8 @@ public class RedpackServiceImpl implements RedpackService {
ran -= prizeType.getIntValue("weight");
if (ran < 0) {
String lock = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(5, true, true);
int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId, orderAmount.doubleValue(),
new Date());
int lockedCount = actPartnerLMLogMapper.lockPrize(act_id, lock, prizeType.getString("type_id"), open_id, client_id, orderId,
orderAmount.doubleValue(), new Date());
if (lockedCount > 0) {
JSONObject invitationClient = actClientInvitationCodeMapper.getInvitationClient(act_id, client_id);
if (invitationClient != null && invitationClient.getBoolean("auto_send")) {
@ -412,8 +412,6 @@ public class RedpackServiceImpl implements RedpackService {
String wishing = "恭喜获得ROYALPAY店长福利红包";
String notifyUrl = "https://mpay.royalpay.com.au/sys/lucky_money/partner/" + red_packet_order_id + "notify";
WechatRedpack wechatRedpack = new WechatRedpack();
JSONObject customerRelation = customerMapper.findCustomerByOpenId(open_id);
MpWechatApi redpackApi = mpWechatApiProvider.getApi("Redpack");
@ -421,8 +419,8 @@ public class RedpackServiceImpl implements RedpackService {
throw new RedPackException("ServerError", "Customer openid for redpack not available!");
}
String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey());
wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(actName)
.setRemark("店长激励计划").setAmount(luckyMoeny).setWishing(wishing).setNotifyUrl(notifyUrl);
wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(actName).setRemark("店长激励计划").setAmount(luckyMoeny).setWishing(wishing)
.setNotifyUrl(notifyUrl);
String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("redpack_id");
logger.debug("kira-->>>>" + redPacketId);
prizeDetail.put("red_packet_id", redPacketId);
@ -448,9 +446,11 @@ public class RedpackServiceImpl implements RedpackService {
break;
}
AlipayRedpack alipayRedpack = new AlipayRedpack();
alipayRedpack.setPayeeAccount(alipayUserId).setAmount(prizeDetail.getBigDecimal("red_packet_amount")).setPayerShowName("RoyalPay福利社").
setRemark("RoyalPay店长活动-" + (rate.intValue() > 1 ? rate.intValue() + "倍" : "") + "红包奖励" + specialDocuments);
String redPacketId = mpAlipayRedpackApi.sendRedpack(alipayRedpack).getString("redpack_id");
alipayRedpack.setPayeeAccount(alipayUserId).setAmount(prizeDetail.getBigDecimal("red_packet_amount")).setPayerShowName("RoyalPay福利社")
.setRemark("RoyalPay店长活动-" + (rate.intValue() > 1 ? rate.intValue() + "倍" : "") + "红包奖励" + specialDocuments);
JSONObject mpAlipayJson = mpAlipayRedpackApi.sendRedpack(alipayRedpack);
logger.debug("mpAlipayJson------" + mpAlipayJson.toJSONString());
String redPacketId = mpAlipayJson.getString("redpack_id");
prizeDetail.put("red_packet_id", redPacketId);
prizeDetail.put("status", 5);
actPartnerLMLogMapper.update(prizeDetail);

Loading…
Cancel
Save