From ef3cd5d822d936705ff00d9dfb0ba4b1ca7b246a Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Thu, 12 Jul 2018 19:27:14 +0800 Subject: [PATCH 1/6] fix : ActChairty --- .../payment/manage/mappers/act/ActChairtyMapper.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml index dcf7d88f4..a958486dd 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml @@ -2,16 +2,16 @@ \ No newline at end of file From b182cb794bae11ebe1a7def083885dfa274426e0 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Fri, 13 Jul 2018 13:06:50 +0800 Subject: [PATCH 2/6] fix : ActChairty --- .../core/impls/ActChairtyServiceImp.java | 88 +++++++++---------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java index b7d86ffbf..494d041c8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java @@ -10,6 +10,9 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -26,7 +29,7 @@ import java.util.List; */ @Service public class ActChairtyServiceImp implements ActChairtyService { - + Logger logger = LoggerFactory.getLogger(getClass()); @Resource private ClientManager clientManager; @Resource @@ -64,54 +67,49 @@ public class ActChairtyServiceImp implements ActChairtyService { public List getWeekendAnalysis(JSONObject params) { List result = new ArrayList<>(); List getAnalysis = actChairtyMapper.getChairtyWeekAnalysis(params.getDate("begin"), params.getDate("end")); - SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); - Calendar cal = Calendar.getInstance(); - cal.setTime(params.getDate("begin")); - cal.add(cal.DAY_OF_MONTH, -1); - long beginTime = params.getDate("begin").getTime(); - long endTime = params.getDate("end").getTime(); - long betweenDays = (long)((endTime - beginTime) / (1000 * 60 * 60 *24)); - List weekStart = new ArrayList(); - for(int i=0;i<=betweenDays;i++){ - cal.add(cal.DAY_OF_MONTH, 1);//DATE=日 - if ((cal.get(Calendar.DAY_OF_WEEK)) == 2) { - weekStart.add(df.format(cal.getTime())); - } + DateFormatUtils df = new DateFormatUtils(); + Calendar cal = Calendar.getInstance(); + cal.setTime(params.getDate("begin")); + cal.add(cal.DAY_OF_MONTH, -1); + long beginTime = params.getDate("begin").getTime(); + long endTime = params.getDate("end").getTime(); + long betweenDays = (long)((endTime - beginTime) / (1000 * 60 * 60 *24)); + List weekStart = new ArrayList<>(); + for(int i=0;i<=betweenDays;i++){ + cal.add(cal.DAY_OF_MONTH, 1);//DATE=日 + if ((cal.get(Calendar.DAY_OF_WEEK)) == 2) { + weekStart.add(df.format(cal.getTime(),"yyyy-MM-dd")); } - for(int i=0;i= dateStar.getTime() && orderDate < dateEnd.getTime()) { - count_ordernum = count_ordernum.add(getAnalysis.get(b).getBigDecimal("count_ordernum")); - sum_ordernum = sum_ordernum.add(getAnalysis.get(b).getBigDecimal("sum_ordernum")); - } + } + for(int i=0;i= dateStar.getTime() && orderDate < dateEnd.getTime()) { + count_ordernum = count_ordernum.add(getAnalysis.get(b).getBigDecimal("count_ordernum")); + sum_ordernum = sum_ordernum.add(getAnalysis.get(b).getBigDecimal("sum_ordernum")); } - BigDecimal chairty = new BigDecimal(0.01); - BigDecimal chairty_amount = count_ordernum.multiply(chairty); - double f1 = sum_ordernum.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - double f2 = chairty_amount.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - - weekDay.put("weekstart", weekStart.get(i)); - weekDay.put("count_ordernum", count_ordernum); - weekDay.put("sum_ordernum", f1); - weekDay.put("chairty_amount",f2 ); - result.add(weekDay); - } catch (Exception e) { - e.printStackTrace(); - } + BigDecimal chairty = new BigDecimal(0.01); + BigDecimal chairty_amount = count_ordernum.multiply(chairty); + BigDecimal f1 = sum_ordernum.setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal f2 = chairty_amount.setScale(2, BigDecimal.ROUND_HALF_UP); + weekDay.put("weekstart", weekStart.get(i)); + weekDay.put("count_ordernum", count_ordernum); + weekDay.put("sum_ordernum", f1); + weekDay.put("chairty_amount",f2 ); + result.add(weekDay); + } catch (Exception e) { + logger.info("Act_Chairty Error:",e); + } + } return result; } From af40eff1b5a033ce190e2c31f5c02f9adc90376f Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Fri, 13 Jul 2018 14:03:39 +0800 Subject: [PATCH 3/6] fix : ActChairty --- .../ui/static/actchairty/templates/act_chairty_merchants.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html index b08680a38..b928a00ab 100644 --- a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html +++ b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html @@ -74,7 +74,11 @@ next-text="›" first-text="«" last-text="»"> +
+
Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}
+
+ From 77bb3ea3b5220d030a453374aafac0b7b50aabe5 Mon Sep 17 00:00:00 2001 From: eason Date: Fri, 13 Jul 2018 14:08:19 +0800 Subject: [PATCH 4/6] fix actChairty --- .../royalpay/payment/manage/mappers/act/ActChairtyMapper.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml index a958486dd..addc41843 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml @@ -6,7 +6,7 @@ from act_charity left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time - and pmt_transactions.transaction_time<'2018-09-01' + and pmt_transactions.transaction_time<'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09' and pmt_transactions.channel != 'Settlement' GROUP BY act_charity.client_id order by count_ordernum desc @@ -14,6 +14,7 @@ select count(DISTINCT order_id) as count_ordernum,date_format(pmt_transactions.transaction_time,'%Y-%m-%d') as orderdate,client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity inner JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end} and pmt_transactions.transaction_time>=act_charity.active_time and pmt_transactions.channel != 'Settlement' + and pmt_transactions.transaction_time<'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09' group by date_format(pmt_transactions.transaction_time,'%Y-%m-%d') @@ -21,6 +22,7 @@ \ No newline at end of file From 4f596ec1d330cf96e83e67658e9cb1e1aca75da5 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Fri, 13 Jul 2018 16:56:16 +0800 Subject: [PATCH 5/6] fix : ActChairty --- src/main/ui/static/actchairty/act_chairty.js | 6 ++++-- .../static/actchairty/templates/act_chairty_merchants.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/actchairty/act_chairty.js b/src/main/ui/static/actchairty/act_chairty.js index 4cd8fc7ef..3f9294646 100644 --- a/src/main/ui/static/actchairty/act_chairty.js +++ b/src/main/ui/static/actchairty/act_chairty.js @@ -29,15 +29,17 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $scope.new_conf = {}; $scope.ctrl = {dateInput: false}; $scope.submitClient = function () { - $scope.errmsg = null; + var client_moniker = $scope.new_conf.client_moniker; + $scope.msg = null; var conf = { date: $filter('date')($scope.new_conf.date, 'yyyy-MM-dd'), }; $http.put('/actchairty/clients/' + $scope.new_conf.client_moniker, conf).then(function () { $scope.new_conf = {}; $scope.loadClients(); + $scope.msg = "商户创建成功!商户ID:"+ client_moniker + " 参加时间:" + conf.date; }, function (resp) { - $scope.errmsg = resp.data.message; + $scope.msg = resp.data.message; }); }; }]); diff --git a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html index b928a00ab..4893f4e50 100644 --- a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html +++ b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html @@ -23,7 +23,7 @@