diff --git a/pom.xml b/pom.xml index 8644ecb65..ddbda2b3a 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.0.21 + 1.0.22 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java index 539af2a67..a7b83e567 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java @@ -125,11 +125,23 @@ public class DailyReportImp implements DailyReport { kpi.put("compare_value",Math.abs(compare.doubleValue())); } } - kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); - for(JSONObject clientAmount :clientsAmount ){ - if(clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))){ - kpi.put("clients_month",clientAmount.getBigDecimal("clients_month")); - kpi.put("clients_yesterday",clientAmount.getBigDecimal("clients_yesterday")); + kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount, 4, BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0, 5) + "%"); + for (JSONObject clientAmount : clientsAmount) { + if (clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))) { + // sys_clients中查询出此bd创建并属于此bd的商户,并且时间是昨天和本月 + JSONObject countByBd = clientMapper.findCountByBd(clientAmount.getString("bd_group"), DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(DateUtils.addDays(dt, -1), Calendar.DATE), DateUtils.truncate(dt, Calendar.MONTH)); + if (countByBd.getInteger("month_count") == null){ + kpi.put("clients_month", 0); + }else { + kpi.put("clients_month", countByBd.getInteger("month_count")); + } + if (countByBd.getInteger("yesterday_count") == null){ + kpi.put("clients_yesterday", 0); + }else { + kpi.put("clients_yesterday", countByBd.getInteger("yesterday_count")); + } +// kpi.put("clients_month", clientAmount.getBigDecimal("clients_month")); +// kpi.put("clients_yesterday", clientAmount.getBigDecimal("clients_yesterday")); } } total_kpi_amount = total_kpi_amount.add(kpi_amount); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 2e2d9d93b..df5996629 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -126,4 +126,6 @@ public interface ClientMapper { List clientPayTypeInfoByClientIdRange(@Param("begin") int begin, @Param("end") int end); int getPartnercode(@Param("codes") String codes); + + JSONObject findCountByBd(@Param("bd_group") String bd_group, @Param("today") Date today, @Param("yesterday") Date yesterday, @Param("month") Date month); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index b8f804af5..2835f44e2 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -662,4 +662,32 @@ AND cb_bankpay_url IS NULL + + diff --git a/src/main/ui/static/css/common.css b/src/main/ui/static/css/common.css index 5f4889790..90b7f7930 100644 --- a/src/main/ui/static/css/common.css +++ b/src/main/ui/static/css/common.css @@ -125,10 +125,13 @@ transition: opacity 0.5s ease-in, margin-top 0.5s ease-in; } -[ui-view].ng-enter { +/* + 这里是渐进样式,safari12.1之后出现bug,删除 +*/ +/*[ui-view].ng-enter { margin-top: 10px; opacity: 0.5; -} +}*/ [ui-view], [ui-view].ng-enter.ng-enter-active { margin-top: 0; @@ -870,4 +873,4 @@ .menu-group .is-hide { display: none; -} \ No newline at end of file +} diff --git a/src/test/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriberTest.java b/src/test/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriberTest.java index 82cfcd2df..7ba990ab5 100644 --- a/src/test/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriberTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/support/abafile/SettleRemarkTemplateDescriberTest.java @@ -1,6 +1,8 @@ package au.com.royalpay.payment.manage.support.abafile; import com.alibaba.fastjson.JSONObject; +import org.joda.time.DateTime; +import org.junit.Assert; import org.junit.Test; import java.util.Date; @@ -16,8 +18,17 @@ public class SettleRemarkTemplateDescriberTest { public void compile() { JSONObject settle = new JSONObject(); settle.put("client_moniker", "PINE"); - SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("RoyalPay{date(MMdd)}{moniker}", settle, new Date()); + SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("RoyalPay{date(MMdd)}{moniker}", settle, DateTime.parse("2019-07-18").toDate()); String result = describer.compile(); - System.out.println(result); + Assert.assertEquals("RoyalPay0718PINE", result); + } + + @Test + public void compile2() { + JSONObject settle = new JSONObject(); + settle.put("client_moniker", "AUPO"); + SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("Pay By App {date(ddMMyy)}", settle, DateTime.parse("2019-07-18").toDate()); + String res = describer.compile(); + Assert.assertEquals("Pay By App 180719", res); } } \ No newline at end of file