From e1d1409b28e75959e3b86099fa51254118f8a9fc Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 25 Dec 2017 22:52:18 +0800 Subject: [PATCH 1/9] logback cfg --- .../manage/dev/web/StatusCheckController.java | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/main/java/au/com/royalpay/payment/manage/dev/web/StatusCheckController.java diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/StatusCheckController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/StatusCheckController.java deleted file mode 100644 index 4a7a1f67c..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/StatusCheckController.java +++ /dev/null @@ -1,40 +0,0 @@ -package au.com.royalpay.payment.manage.dev.web; - -import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; -import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl; -import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; -import au.com.royalpay.payment.tools.env.PlatformEnvironment; -import au.com.royalpay.payment.tools.env.RequestEnvironment; -import au.com.royalpay.payment.tools.exceptions.ForbiddenException; -import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; -import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by davep on 2016-09-04. - */ -@RestController -@RequestMapping("/dev/status") -public class StatusCheckController { - - @RequestMapping(method = RequestMethod.GET) - public JSONObject checkSystemStatus(){ - return new JSONObject(); - } - - @WechatMapping(value = "wx_test",method = RequestMethod.GET,oauthType = WxOauthType.USERINFO,addonMp = {RedpackWechatApiImpl.class,KangaLandWechatApiImpl.class}) - public void checkWxTest(){ - - } - - @RequestMapping(value = "/stopping",method = RequestMethod.PUT) - public void beforeStop(){ - if (RequestEnvironment.getClientIp().equals("127.0.0.1")){ - PlatformEnvironment.getEnv().taskEnabled(false); - }else{ - throw new ForbiddenException(); - } - } -} From c6bd5aeea3589bf99e1e731d7d8488aa71218843 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 25 Dec 2017 23:08:51 +0800 Subject: [PATCH 2/9] cashier --- src/main/ui/static/templates/cashier_aggregate_payment.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/ui/static/templates/cashier_aggregate_payment.js b/src/main/ui/static/templates/cashier_aggregate_payment.js index 78c904f00..2ab527f50 100644 --- a/src/main/ui/static/templates/cashier_aggregate_payment.js +++ b/src/main/ui/static/templates/cashier_aggregate_payment.js @@ -174,7 +174,6 @@ $(function () { data.customerrate = true; } data.coupons = dataCache.coupons; - data.price = data.price*100; $.ajax({ url: '/partner/cashiers/payment/'+ window.client_moniker +'/'+window.cashier_id+'/orders/', method: 'post', From c86ac89229b0ae5b37ce58198dfcec8eecf5cb91 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 25 Dec 2017 23:31:09 +0800 Subject: [PATCH 3/9] update --- .../com/royalpay/payment/manage/task/RedPackTaskManager.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java index 76bc2607b..2d022a230 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/RedPackTaskManager.java @@ -31,9 +31,6 @@ public class RedPackTaskManager { @Scheduled(cron = "0 0/10 * * * ?") public void updateAlipayRedPackStatus() { - - logger.info("kira---------redpack Check"); - logger.debug("kira---------redpack Check"); redpackService.updateAlipayRedPacketsStatus("3"); } From 8021bc229356bf5efa0c2d3487dc03f2936f191f Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 25 Dec 2017 23:31:31 +0800 Subject: [PATCH 4/9] update --- .../refund/events/listeners/NoticeRefundAuditListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java index 2c06da71f..a24801b26 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/events/listeners/NoticeRefundAuditListener.java @@ -37,7 +37,7 @@ public class NoticeRefundAuditListener implements ApplicationListener Date: Mon, 25 Dec 2017 23:51:52 +0800 Subject: [PATCH 5/9] update --- .../payment/manage/redpack/core/impls/RedpackServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java index 807dbde2c..e2219641a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java @@ -424,6 +424,7 @@ public class RedpackServiceImpl implements RedpackService { 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); prizeDetail.put("status", 1); actPartnerLMLogMapper.update(prizeDetail); @@ -462,6 +463,7 @@ public class RedpackServiceImpl implements RedpackService { List redPacketOrders = actPartnerLMLogMapper.sendList(params); for (JSONObject redPack : redPacketOrders) { JSONObject supportRedPack = mpAlipayRedpackApi.redpackStatus(redPack.getString("red_packet_id")); + logger.debug("kiratest----------"+supportRedPack.toJSONString()); if (supportRedPack != null && !supportRedPack.isEmpty()) { switch (supportRedPack.getString("status")) { case "0": From 2a55ed71982ccbb5f31e1f47baf62adcab1234c9 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 25 Dec 2017 23:57:09 +0800 Subject: [PATCH 6/9] update --- .../core/impls/RedpackServiceImpl.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java index e2219641a..163b49c2e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java @@ -129,10 +129,10 @@ public class RedpackServiceImpl implements RedpackService { WechatRedpack redpack = newRedpack(config, orderOpenId); String redpackId = mpWechatApiProvider.getApi("Redpack").sendRedpack(redpack).getString("redpack_id"); JSONObject obj = redpack.toJSON(); - obj.put("redpack_id",redpackId); + obj.put("redpack_id", redpackId); obj.put("create_time", new Date()); obj.put("status", 0); - obj.put("order_id",orderId); + obj.put("order_id", orderId); obj.put("client_id", clientId); redPackLogMapper.saveLog(obj); } catch (RedPackException e) { @@ -186,7 +186,7 @@ public class RedpackServiceImpl implements RedpackService { for (int i = 0; i < redpack_counts; i++) { BigDecimal amount = amountFrom.equals(amountTo) ? amountFrom : amountFrom.add(BigDecimal.valueOf(RandomUtils.nextInt(amountTo.subtract(amountFrom).multiply(hundred).intValue())).divide(hundred, - 2, BigDecimal.ROUND_DOWN)); + 2, BigDecimal.ROUND_DOWN)); JSONObject prize = new JSONObject(); String prefix = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); String red_packet_order_id = prefix + RandomStringUtils.random(28 - prefix.length(), true, true); @@ -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,10 +419,10 @@ 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); + logger.debug("kira-->>>>" + redPacketId); prizeDetail.put("red_packet_id", redPacketId); prizeDetail.put("status", 1); actPartnerLMLogMapper.update(prizeDetail); @@ -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); @@ -463,7 +463,7 @@ public class RedpackServiceImpl implements RedpackService { List redPacketOrders = actPartnerLMLogMapper.sendList(params); for (JSONObject redPack : redPacketOrders) { JSONObject supportRedPack = mpAlipayRedpackApi.redpackStatus(redPack.getString("red_packet_id")); - logger.debug("kiratest----------"+supportRedPack.toJSONString()); + logger.debug("kiratest----------" + supportRedPack.toJSONString()); if (supportRedPack != null && !supportRedPack.isEmpty()) { switch (supportRedPack.getString("status")) { case "0": From 335829aa59cb6628af5f991505f14d3211fff878 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 26 Dec 2017 00:07:58 +0800 Subject: [PATCH 7/9] fixbug --- .../redpack/core/impls/ActRedPackServiceImpl.java | 2 +- .../redpack/core/impls/PartnerLMServiceImp.java | 2 +- .../manage/redpack/core/impls/RedpackServiceImpl.java | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java index 01d672b37..bd62b227d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/ActRedPackServiceImpl.java @@ -187,7 +187,7 @@ public class ActRedPackServiceImpl implements ActRedPackService { wechatRedpack.setWishing(wishing); wechatRedpack.setRemark("开业红包活动"); logger.info("==============Send RedPacket Service:" + wechatRedpack.toString() + "========="); - String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("redpack_id"); + String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("out_biz_no"); prizeDetail.put("red_packet_id", redPacketId); prizeDetail.put("status", 1); actRedPacketsCustomerOrdersMapper.update(prizeDetail); diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java index 8940e1214..a7a00d2f0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/PartnerLMServiceImp.java @@ -274,7 +274,7 @@ public class PartnerLMServiceImp implements PartnerLMService { String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); wechatRedpack.setSendName(sendName).setOpenId(rpOpenId).setActName(actName) .setRemark("商家激励计划").setAmount(new BigDecimal(luckyMoney).setScale(2, ROUND_DOWN)).setWishing(wishing).setNotifyUrl(notifyUrl); - String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("redpack_id"); + String redPacketId = redpackApi.sendRedpack(wechatRedpack).getString("out_biz_no"); send.put("red_packet_id", redPacketId); actPartnerLMLogMapper.saveLog(send); } diff --git a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java index 163b49c2e..c8338c05c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/redpack/core/impls/RedpackServiceImpl.java @@ -127,7 +127,7 @@ public class RedpackServiceImpl implements RedpackService { } try { WechatRedpack redpack = newRedpack(config, orderOpenId); - String redpackId = mpWechatApiProvider.getApi("Redpack").sendRedpack(redpack).getString("redpack_id"); + String redpackId = mpWechatApiProvider.getApi("Redpack").sendRedpack(redpack).getString("out_biz_no"); JSONObject obj = redpack.toJSON(); obj.put("redpack_id", redpackId); obj.put("create_time", new Date()); @@ -303,7 +303,7 @@ public class RedpackServiceImpl implements RedpackService { String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); 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"); + String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("out_biz_no"); for (JSONObject prizeDetail : reallySend) { prizeDetail.put("red_packet_id", redPacketId); @@ -421,8 +421,7 @@ public class RedpackServiceImpl implements RedpackService { String rpOpenId = customerRelation.getString(redpackApi.getOpenIdKey()); 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); + String redPacketId = mpWechatApiProvider.getApi("Redpack").sendRedpack(wechatRedpack).getString("out_biz_no"); prizeDetail.put("red_packet_id", redPacketId); prizeDetail.put("status", 1); actPartnerLMLogMapper.update(prizeDetail); @@ -449,8 +448,7 @@ public class RedpackServiceImpl implements RedpackService { 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"); + String redPacketId = mpAlipayJson.getString("out_biz_no"); prizeDetail.put("red_packet_id", redPacketId); prizeDetail.put("status", 5); actPartnerLMLogMapper.update(prizeDetail); @@ -463,7 +461,6 @@ public class RedpackServiceImpl implements RedpackService { List redPacketOrders = actPartnerLMLogMapper.sendList(params); for (JSONObject redPack : redPacketOrders) { JSONObject supportRedPack = mpAlipayRedpackApi.redpackStatus(redPack.getString("red_packet_id")); - logger.debug("kiratest----------" + supportRedPack.toJSONString()); if (supportRedPack != null && !supportRedPack.isEmpty()) { switch (supportRedPack.getString("status")) { case "0": From c2c7f87bc055a5bb3f9c8c280c65292099d43d84 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 26 Dec 2017 00:26:05 +0800 Subject: [PATCH 8/9] logo --- src/main/ui/partner_register.html | 2 +- src/main/ui/static/images/logo.svg | 255 +++++++++++++++++++++++++++++ 2 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 src/main/ui/static/images/logo.svg diff --git a/src/main/ui/partner_register.html b/src/main/ui/partner_register.html index e49474948..3a5dc375a 100644 --- a/src/main/ui/partner_register.html +++ b/src/main/ui/partner_register.html @@ -269,7 +269,7 @@ - + diff --git a/src/main/ui/static/images/logo.svg b/src/main/ui/static/images/logo.svg new file mode 100644 index 000000000..c79a7dbee --- /dev/null +++ b/src/main/ui/static/images/logo.svg @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2cb3f6ef3ddc45f283a31a516a611cb00dd7a53b Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 26 Dec 2017 00:51:36 +0800 Subject: [PATCH 9/9] update --- src/main/resources/templates/partner_apply_info.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/resources/templates/partner_apply_info.html b/src/main/resources/templates/partner_apply_info.html index a905b86b9..56454668e 100644 --- a/src/main/resources/templates/partner_apply_info.html +++ b/src/main/resources/templates/partner_apply_info.html @@ -244,7 +244,6 @@ -##Button(初审)

@@ -253,7 +252,5 @@

-##Button(分配BD后审批) -##待加 \ No newline at end of file