From f385c488a04bcb717ab6cbaee2f0101b1033be76 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Thu, 1 Mar 2018 12:10:28 +0800 Subject: [PATCH] fix bd String --- .../manage/bdprize/core/BDPrizeService.java | 2 +- .../bdprize/core/impls/BDPrizeServiceImpl.java | 6 +++--- .../manage/bdprize/web/BDPrizeController.java | 4 ++-- .../financial/FinancialBDPrizeLogMapper.java | 6 +++--- .../manage/merchants/beans/PartnerQuery.java | 14 +++++--------- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java index f4f27fd87..b9e1225d8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java +++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java @@ -21,7 +21,7 @@ public interface BDPrizeService { JSONObject findReport(String month) throws Exception; - JSONObject getBDReport(String month, int managerId); + JSONObject getBDReport(String month, String managerId); List getRateConfig(); diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java index 7a50584cd..8c8e53b1a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java @@ -246,7 +246,7 @@ public class BDPrizeServiceImpl implements BDPrizeService { } @Override - public JSONObject getBDReport(String month, int managerId) { + public JSONObject getBDReport(String month, String managerId) { try { Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"}); month = DateFormatUtils.format(mon, "yyyy-MM"); @@ -281,13 +281,13 @@ public class BDPrizeServiceImpl implements BDPrizeService { JSONObject totalDetail = financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), managerId); log.putAll(totalDetail); + JSONObject bdInfo = managerMapper.findById(managerId); - if (ManagerRole.BD_LEADER.hasRole(managerId)) { + if (ManagerRole.BD_LEADER.hasRole(bdInfo.getIntValue("role"))) { JSONObject groupPrizeLog = financialBDPrizeLogMapper.findByReportAndGroup(report.getString("record_id"), managerId); log.put("group_prize", groupPrizeLog); } - JSONObject bdInfo = managerMapper.findById(String.valueOf(managerId)); if (bdInfo == null) { log.put("leftCompany", true); } diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java index 1cf9e141c..5efff9290 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java +++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java @@ -45,13 +45,13 @@ public class BDPrizeController { } @ManagerMapping(value = "/records/{month}/bd_users/{managerId}", method = RequestMethod.GET, role = ManagerRole.FINANCIAL_STAFF) - public JSONObject getBDUserReportDetail(@PathVariable String month, @PathVariable int managerId) { + public JSONObject getBDUserReportDetail(@PathVariable String month, @PathVariable String managerId) { return bdPrizeService.getBDReport(month, managerId); } @ManagerMapping(value = "/records/{month}/bd_user_detail", method = RequestMethod.GET, role = ManagerRole.BD_USER) public JSONObject getBDUserReportDetailForBD(@PathVariable String month, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return bdPrizeService.getBDReport(month, manager.getIntValue("manager_id")); + return bdPrizeService.getBDReport(month, manager.getString("manager_id")); } @ManagerMapping(value = "/config/rates", method = RequestMethod.GET, role = {ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java index 0b3bc168d..adb0bc5a1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java @@ -30,21 +30,21 @@ public interface FinancialBDPrizeLogMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "prize_type=0") - List findByReportAndBD(@Param("record_id") String recordId, @Param("manager_id") int managerId); + List findByReportAndBD(@Param("record_id") String recordId, @Param("manager_id") String managerId); @Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount, " + "SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize, " + "SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " + "where fbpl.prize_type = 0 and fbpl.record_id = #{record_id} and fbpl.manager_id = #{manager_id} " + "GROUP BY fbpl.manager_id") - JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") int managerId); + JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId); @Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," + "SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," + "SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " + "where fbpl.prize_type = 1 and fbpl.manager_id = #{manager_id} " + "GROUP BY fbpl.manager_id ") - JSONObject findByReportAndGroup(@Param("record_id") String recordId, @Param("manager_id") int managerId); + JSONObject findByReportAndGroup(@Param("record_id") String recordId, @Param("manager_id") String managerId); @AutoSql(type = SqlType.DELETE) void clearLogsOfReport(@Param("record_id") String recordId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java index 44643a4bc..b6f442486 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/PartnerQuery.java @@ -23,7 +23,7 @@ public class PartnerQuery { private String sub_merchant_id; private String org_id; private String org_ids; - private Integer bd; + private String bd; private String business_structure; private String industry; private Integer clean_day; @@ -243,14 +243,6 @@ public class PartnerQuery { this.org_id = org_id; } - public Integer getBd() { - return bd; - } - - public void setBd(Integer bd) { - this.bd = bd; - } - public void setOnlyMe(boolean onlyMe) { this.onlyMe = onlyMe; } @@ -452,4 +444,8 @@ public class PartnerQuery { public void setOrg_ids(String org_ids) { this.org_ids = org_ids; } + + public void setBd(String bd) { + this.bd = bd; + } }