Merge remote-tracking branch 'origin/master'

master
luoyang 6 years ago
commit e3016f1025

@ -9,13 +9,15 @@ import java.util.List;
*/
public interface EstimateAnalysisService {
List<JSONObject> listFurtureInfo() throws Exception;
List<JSONObject> listFutureInfo() throws Exception;
void clearEstimateFutureCache();
void generateSettleAmount();
void generateTransactionData();
List<JSONObject> listEstimateLog(int logType);
List<JSONObject> listEstimateLog(int logType, String date);
void initSettleAmount(String date) throws Exception;

@ -0,0 +1,6 @@
package au.com.royalpay.payment.manage.analysis.core;
public interface EstimateCacheSupport {
void clearEstimateFutureCache();
}

@ -5,22 +5,29 @@ import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.channels.wechat.runtime.beans.SettlementLog;
import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService;
import au.com.royalpay.payment.manage.analysis.core.EstimateCacheSupport;
import au.com.royalpay.payment.manage.analysis.mappers.EstimateAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.PlatformSettlementMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.jsoup.helper.DataUtil;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
@ -51,6 +58,10 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
@Resource
private ClearingDetailMapper clearingDetailMapper;
@Resource
private EstimateCacheSupport estimateCacheSupport;
@Resource
private TransactionMapper transactionMapper;
public static List<String> t1client;
@ -71,10 +82,16 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
private EstimateAnalysisMapper estimateAnalysisMapper;
@Override
public List<JSONObject> listFurtureInfo() throws Exception {
@Cacheable(value = ":estimate_analysis_future:", key = "''")
public List<JSONObject> listFutureInfo() throws Exception {
return listSettlementInfo();
}
@Override
public void clearEstimateFutureCache() {
estimateCacheSupport.clearEstimateFutureCache();
}
public List<JSONObject> listSettlementInfo() throws Exception {
initClient();
@ -102,6 +119,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
today.put("t2", realToday.getBigDecimal("t2"));
today.put("t3", realToday.getBigDecimal("t3"));
today.put("total", realToday.getBigDecimal("total"));
today.put("net_amount", realToday.getBigDecimal("net_amount"));
} catch (Exception e) {
logger.error("今日清算记录未生成,使用自助查询!");
}
@ -138,13 +156,13 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
dayInfo.put("t1", new BigDecimal(0.00));
dayInfo.put("t2", new BigDecimal(0.00));
dayInfo.put("t3", new BigDecimal(0.00));
dayInfo.put("net_amount", new BigDecimal(0.00));
//todo 支持多个清算记录
List<JSONObject> logs = clearingLogMapper.findByDate(settleDate);
if (logs == null || logs.size() <= 0) {
throw new NotFoundException();
}
for (JSONObject log : logs) {
dayInfo.put("total", log.getBigDecimal("net_amount"));
JSONObject details = clearingDetailMapper.listReportsOfSettleCleanDay(log.getIntValue("clearing_id"), t1client);
dayInfo.put("t1", dayInfo.getBigDecimal("t1").add(details.getBigDecimal("total_amount")));
details.clear();
@ -155,7 +173,10 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
details = clearingDetailMapper.listReportsOfSettleCleanDay(log.getIntValue("clearing_id"), t3client);
dayInfo.put("t3", dayInfo.getBigDecimal("t3").add(details.getBigDecimal("total_amount")));
dayInfo.put("net_amount", dayInfo.getBigDecimal("net_amount").add(log.getBigDecimal("net_amount")));
}
dayInfo.put("total", dayInfo.getBigDecimal("t1").add(dayInfo.getBigDecimal("t2")).add(dayInfo.getBigDecimal("t3")));
return dayInfo;
}
@ -202,6 +223,30 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
}
dayInfo.put("estimate_date", endStr);
dayInfo.put("total", dayInfo.getBigDecimal("t1").add(dayInfo.getBigDecimal("t2")).add(dayInfo.getBigDecimal("t3")));
//预计到账金额
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)-1, 0, 0, 0);
Date datefrom = cal.getTime();
if (new Date().getDate() == datefrom.getDate()) {
JSONObject params = new JSONObject();
params.put("datefrom", DateFormatUtils.format(datefrom, "yyyy-MM-dd HH:mm:ss"));
params.put("dateto", DateFormatUtils.format(DateUtils.addDays(datefrom, 1),"yyyy-MM-dd HH:mm:ss"));
List<JSONObject> lastDayClearingAmount = transactionMapper.getLastDaytransAmount(params);
BigDecimal total_clearing = BigDecimal.ZERO;
BigDecimal total_surcharge = BigDecimal.ZERO;
for (JSONObject e : lastDayClearingAmount) {
total_clearing = total_clearing.add(e.getBigDecimal("clearing_amount"));
total_surcharge = total_surcharge.add(e.getBigDecimal("channel_surcharge"));
}
dayInfo.put("total_clearing", total_clearing.subtract(total_surcharge));
dayInfo.put("clearing", lastDayClearingAmount);
}
return dayInfo;
}
@ -277,7 +322,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
@Override
public void generateSettleAmount() {
String report_date = DateFormatUtils.format(new Date(), "yyyy/MM/dd");
String report_date = DateFormatUtils.format(DateUtils.addDays(new Date(),-1), "yyyy/MM/dd");
logger.info("系统开始生成[ " + report_date + " ]清算总额");
JSONObject isClearDay = estimateAnalysisMapper.checkIsClearDay(report_date);
@ -327,8 +372,19 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
}
@Override
public List<JSONObject> listEstimateLog(int logType) {
return estimateAnalysisMapper.listEstimateLog(logType);
public List<JSONObject> listEstimateLog(int logType, String date) {
Date monthDate;
try {
monthDate = DateUtils.parseDate(date, new String[] { "yyyy-MM" });
} catch (ParseException e) {
throw new BadRequestException("Invalid month format");
}
Calendar monthCal = Calendar.getInstance();
monthCal.setTime(monthDate);
int year = monthCal.get(Calendar.YEAR);
int month = monthCal.get(Calendar.MONTH) + 1;
return estimateAnalysisMapper.listEstimateLog(logType, year, month);
}

@ -0,0 +1,14 @@
package au.com.royalpay.payment.manage.analysis.core.impls;
import au.com.royalpay.payment.manage.analysis.core.EstimateCacheSupport;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
@Service
public class EstimateCacheSupportImpl implements EstimateCacheSupport {
@Override
@CacheEvict(value = ":estimate_analysis_future:", key = "''")
public void clearEstimateFutureCache() {
}
}

@ -5,6 +5,7 @@ import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig;
import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.channels.wechat.runtime.beans.SettlementLog;
import au.com.royalpay.payment.core.exceptions.ChannelNetworkException;
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
import au.com.royalpay.payment.manage.analysis.mappers.EstimateAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.PlatformSettlementMapper;
@ -103,6 +104,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
doVerifyAlipayOnlineSettleLog(sdfClear.parse(end_date));
} catch (Exception e) {
logger.error("PlatformClearAnalysisServiceImpl.verifySettleLogByDate ==> 校验" + end_date + "支付宝Online到账失败", e);
throw new ChannelNetworkException("校验失败:",e);
}
}
if (StringUtils.equals("Wechat", channel)) {
@ -352,6 +354,13 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
wechat_rate = new BigDecimal("0.005");
}
// 2018-09-01后Alipay_Online手续费0.006
BigDecimal alipay_online_rate;
if (end_date.compareTo("2018-09-01 02:00:00") <= 0) {
alipay_online_rate = new BigDecimal("0.018");
} else {
alipay_online_rate = new BigDecimal("0.006");
}
try {
JSONObject creditLogs = platformSettlementMapper.calculateSysSettleLog(start_date, end_date, channel, "Credit", wechat_rate);
sysLogs.put("sys_pay_fee", creditLogs.getBigDecimal("aud_amount"));
@ -363,7 +372,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
if (StringUtils.equals("Alipay", channel)) {
sysLogs.put("sys_surcharge", platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel, new BigDecimal(0.006)));
} else if (StringUtils.equals("AlipayOnline", channel)) {
sysLogs.put("sys_surcharge", platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel, new BigDecimal(0.018)));
sysLogs.put("sys_surcharge", platformSettlementMapper.calculateRmbCharge(start_date, end_date, channel, alipay_online_rate));
} else {
sysLogs.put("sys_surcharge", creditLogs.getBigDecimal("charge_amount").subtract(debitLogs.getBigDecimal("charge_amount")));
}

@ -34,7 +34,7 @@ public interface EstimateAnalysisMapper {
JSONObject getCleanAmount(@Param("start_date") String start_date, @Param("end") String end_date);
List<JSONObject> listEstimateLog(@Param("log_type") int log_type);
List<JSONObject> listEstimateLog(@Param("log_type") int log_type, @Param("year") int year, @Param("month") int month);
List<JSONObject> findCleanLogsByDate(@Param("start_date") String start_date, @Param("end_date") String end_date);

@ -3,10 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@ -23,17 +20,23 @@ public class EstimateAnalysisController {
@ManagerMapping(value = "/future",method = RequestMethod.GET)
public List<JSONObject> getFutureSettleInfo() throws Exception {
return estimateAnalysisService.listFurtureInfo();
return estimateAnalysisService.listFutureInfo();
}
@ManagerMapping(value = "/log",method = RequestMethod.GET)
public List<JSONObject> getEstimateLogInfo() throws Exception {
return estimateAnalysisService.listEstimateLog(1);
@ManagerMapping(value = "/future/refresh", method = RequestMethod.PUT)
public void clearEstimateFutureCache() {
estimateAnalysisService.clearEstimateFutureCache();
}
@ManagerMapping(value = "/transaction/log",method = RequestMethod.GET)
public List<JSONObject> getTransactionLogInfo() throws Exception {
return estimateAnalysisService.listEstimateLog(2);
@ManagerMapping(value = "/log/{date}", method = RequestMethod.GET)
public List<JSONObject> getEstimateLogInfo(@PathVariable String date) throws Exception {
return estimateAnalysisService.listEstimateLog(1, date);
}
@ManagerMapping(value = "/transaction/log/{date}",method = RequestMethod.GET)
public List<JSONObject> getTransactionLogInfo(@PathVariable String date) throws Exception {
return estimateAnalysisService.listEstimateLog(2,date);
}
@ManagerMapping(value = "/query", method = RequestMethod.GET)

@ -403,6 +403,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Override
public List<JSONObject> getXlsx(Date dt, String bank) throws IOException {
List<JSONObject> logs = clearingLogMapper.findByDate(dt);
logs = logs.stream().filter(log -> log.getBooleanValue("editable")).collect(Collectors.toList());
if (logs.isEmpty()) {
throw new NotFoundException();
}
@ -433,6 +434,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Override
public List<ABAFile> getAba(Date dt, String bank) {
List<JSONObject> logs = clearingLogMapper.findByDate(dt);
logs = logs.stream().filter(log -> log.getBooleanValue("editable")).collect(Collectors.toList());
if (logs.isEmpty()) {
throw new NotFoundException();
}

@ -174,5 +174,7 @@ public interface TransactionMapper {
List<JSONObject> getSettlementLogDetailList(@Param("clientOrders") List<Integer> clientOrders, @Param("client_id") int clientId);
List<JSONObject> getClientOrderByTransactionTime(JSONObject params);
List<JSONObject> getLastDaytransAmount(JSONObject params);
}

@ -239,6 +239,7 @@ public class SignInController {
String statusKey = signInStatusManager.addVerifyCode(capText);
HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey);
HttpUtils.setCookie(response, "code_expire_time", (System.currentTimeMillis() + 150_000) + "", false);
BufferedImage bi = captchaProducer.createImage(capText);
ServletOutputStream out = response.getOutputStream();
@ -352,20 +353,20 @@ public class SignInController {
return signInStatusManager.customerQRCode();
}
@WechatMapping(value = "/customer_wechat_qrcode/{codeId}", method = RequestMethod.GET,oauthType = WxOauthType.USERINFO)
@WechatMapping(value = "/customer_wechat_qrcode/{codeId}", method = RequestMethod.GET, oauthType = WxOauthType.USERINFO)
public ModelAndView scanCustomerQrcode(@PathVariable String codeId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechatUser) {
signInStatusManager.scanCustomerQrcode(codeId, wechatUser.getString("openid"));
return new ModelAndView("manager_bind_success");
}
@RequestMapping(value = "/customer_wechat_qrcode/{codeId}/check", method = RequestMethod.GET)
public JSONObject getCustomerID(@PathVariable String codeId, HttpServletResponse response,@RequestParam(value = "pay_info",defaultValue = "false") boolean pay_info) {
public JSONObject getCustomerID(@PathVariable String codeId, HttpServletResponse response, @RequestParam(value = "pay_info", defaultValue = "false") boolean pay_info) {
JSONObject result = new JSONObject();
String statusKey = signInStatusManager.getWechatCustomerId(codeId);
if(pay_info){
result = customerPaymentInfoService.selectPaymentInfoByOpenId(statusKey);
if (pay_info) {
result = customerPaymentInfoService.selectPaymentInfoByOpenId(statusKey);
}
HttpUtils.setCookie(response, "CustomerID", statusKey,false);
HttpUtils.setCookie(response, "CustomerID", statusKey, false);
return result;
}
}

@ -86,6 +86,7 @@
( IFNULL(one_clean_amount,0) + IFNULL(two_clean_amount,0) +IFNULL(three_clean_amount,0)) total_amount
FROM log_clearing_estimate
WHERE log_type = #{log_type}
AND year(log_date) = #{year} AND month(log_date) = #{month}
ORDER BY log_date DESC
</select>

@ -44,6 +44,9 @@
<if test="transaction_type!=null">and t.transaction_type=#{transaction_type}</if>
<if test="date!=null">and date(t.transaction_time)=date(#{date})</if>
<if test="clearing_status!=null">and t.clearing_status=#{clearing_status}</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
</if>
<if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
@ -130,6 +133,9 @@
<if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
</if>
<if test="channel!=null">
and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
@ -198,6 +204,9 @@
<if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
</if>
<if test="channel!=null">
and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
@ -1102,4 +1111,18 @@
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select>
<select id="getLastDaytransAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT ifnull(SUM(IF(transaction_type='Credit',clearing_amount,-clearing_amount)),0) clearing_amount,
ifnull(SUM(IF(transaction_type='Credit',total_surcharge,-total_surcharge)),0) total_surcharge,
ifnull(SUM(IF(transaction_type='Credit',channel_surcharge,-channel_surcharge)),0) channel_surcharge,
channel
FROM pmt_transactions
WHERE channel!='Settlement'
AND channel!='System'
AND system_generate = 0
AND transaction_time >= #{datefrom}
AND transaction_time &lt; #{dateto}
GROUP BY channel
</select>
</mapper>

@ -13,8 +13,8 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
})
}]);
app.controller('estimateCtrl', ['$scope', '$http', '$filter','chartParser',function ($scope, $http, $filter,chartParser) {
$scope.listLogs = function () {
$http.get('/analysis/estimate/log').then(function (resp) {
$scope.listLogs = function (month) {
$http.get('/analysis/estimate/log/' + $filter('date')(month, 'yyyy-MM')).then(function (resp) {
$scope.logs = resp.data;
$scope.logArray = {};
angular.forEach($scope.logs, function (item) {
@ -22,7 +22,6 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
});
});
}
$scope.listLogs();
$scope.future_loading = true;
$scope.listEsitimate = function () {
$http.get('/analysis/estimate/future').then(function (resp) {
@ -34,6 +33,13 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
}
$scope.listEsitimate();
$scope.refresh = function () {
$http.put('/analysis/estimate/future/refresh').then(function (resp) {
$scope.listEsitimate();
$scope.future_loading = true;
});
}
$scope.params = {};
$scope.today = new Date();
$scope.chooseToday = function () {

@ -51,6 +51,10 @@
<span>Total: </span>
<span ng-bind="fut.total|currency:'$'" class="text-green"></span>
</div>
<!--<div ng-if="fut.net_amount">-->
<!--<span>Net Amount: </span>-->
<!--<span ng-bind="fut.net_amount|currency:'$'" class="text-green"></span>-->
<!--</div>-->
</div>
</div>
<div class="box-header" style="border-top: solid #f06010 1px;"
@ -99,11 +103,61 @@
总到账金额:<a class="text-green"
ng-bind="fut.platformGetSettleFee|currency:'AUD'"></a></p>
</div>
<div ng-if="fut.clearing.length >0">
<div class="box-header">
<span class="text-bold">预计到账金额详情:</span>
</div>
<div class="box-body">
<div ng-repeat="clearing in fut.clearing">
<p class="text-bold col-sm-12" align="left"
ng-if="clearing.channel=='Wechat'"><img
src="/static/images/wechatpay_sign.png"
/>到账金额:<a
class="text-green"
ng-bind="(clearing.clearing_amount - clearing.channel_surcharge)|currency:'AUD'"></a></p>
<p class="text-bold col-sm-12" align="left"
ng-if="clearing.channel=='Alipay'"><img
src="/static/images/alipay_sign.png"
/>到账金额:<a
class="text-green"
ng-bind="(clearing.clearing_amount - clearing.channel_surcharge)|currency:'AUD'"></a></p>
<p class="text-bold col-sm-12" align="left"
ng-if="clearing.channel=='AlipayOnline'"><img
src="/static/images/alipay_sign.png"
/>Alipay Online到账金额:<a
class="text-green"
ng-bind="(clearing.clearing_amount - clearing.channel_surcharge)|currency:'AUD'"></a></p>
<p class="text-bold col-sm-12" align="left"
ng-if="clearing.channel=='hf'"><img
src="/static/images/hf_sign.png"
/>到账金额:<a
class="text-green"
ng-bind="(clearing.clearing_amount - clearing.channel_surcharge)|currency:'AUD'"></a></p>
<p class="text-bold col-sm-12" align="left"
ng-if="clearing.channel=='rpay'"><img
src="/static/images/r_logo.svg"
/>到账金额:<a
class="text-green"
ng-bind="(clearing.clearing_amount - clearing.channel_surcharge)|currency:'AUD'"></a></p>
</div>
<p class="text-bold col-sm-12" align="left">总到账金额:<a
class="text-green"
ng-bind="fut.total_clearing|currency:'AUD'"></a></p>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<div ng-if="future.length > 0">
<button class="btn btn-primary" ng-click="refresh()">
<i class="fa fa-refresh"></i>
</button>
</div>
</div>
</div>
<div ng-if="future.length > 0">
@ -183,7 +237,7 @@
<div class="box box-warning settle-forecast">
<div class="box-header">Settlement Logs</div>
<div class="box-body">
<div royal-calendar month-change="loadMonthLog($month)">
<div royal-calendar month-change="listLogs($month)">
<div ng-if="logArray[(day|date:'yyyy-MM-dd')]">
<span class="text-bold">总清算额:</span>
<span style="color: #f60;"

@ -256,7 +256,7 @@
<div class="box box-warning settle-forecast" ng-if="currentUser.org==null">
<div class="box-header">Transaction Logs</div>
<div class="box-body">
<div royal-calendar month-change="loadMonthLog($month)">
<div royal-calendar month-change="listTransLogs($month)">
<div ng-if="logArray[(day|date:'yyyy-MM-dd')]">
<span class="text-bold">总交易额:</span>
<span style="color: #f60;" ng-bind="logArray[(day|date:'yyyy-MM-dd')].total_amount|currency:'$'"></span>

@ -27,8 +27,8 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.switchScale = function (scale) {
$scope.currentScale = scale;
};
$scope.listTransLogs = function () {
$http.get('/analysis/estimate/transaction/log').then(function (resp) {
$scope.listTransLogs = function (month) {
$http.get('/analysis/estimate/transaction/log/' + $filter('date')(month, 'yyyy-MM')).then(function (resp) {
$scope.logs = resp.data;
$scope.logArray = {};
angular.forEach($scope.logs, function (item) {
@ -36,7 +36,6 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
});
});
}
$scope.listTransLogs();
$scope.params = {};
$scope.today = new Date(new Date().getTime() - 24*60*60*1000);

@ -202,7 +202,7 @@
<h4 class="text-blue">AlipayOnline Logs</h4>
</div>
<div class="box-body table-responsive">
<p ng-if="!aliLogs.length">No Data</p>
<p ng-if="!aliOnlineLogs.length">No Data</p>
<table class="table table-hover table-striped" ng-if="aliLogs.length">
<thead>
<tr>
@ -253,7 +253,7 @@
</table>
<div class="panel-footer">
<div class="row">
<uib-pagination ng-if="aliOnlieLogs.length"
<uib-pagination ng-if="aliOnlineLogs.length"
class="pagination"
total-items="aliOnlinePagination.totalCount"
boundary-links="true"

@ -368,12 +368,11 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="remark-input">Following
BD</label>
<label class="control-label col-sm-2" for="remark-input">Remark</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.remark"
name="remark"
id="remark-input" maxlength="50">
id="remark-input" maxlength="500">
</div>
</div>
<div class="form-group">

@ -166,13 +166,13 @@
<p class="form-control-static" ng-bind="partner.description"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Remark</label>
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">Remark</label>-->
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.remark"></p>
</div>
</div>
<!--<div class="col-sm-10">-->
<!--<p class="form-control-static" ng-bind="partner.remark"></p>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>

@ -168,19 +168,19 @@
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}">
<label class="control-label col-sm-2" for="desc-input">Remark</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.remark"
name="remark" id="remark-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.remark.$error"
ng-if="partnerForm.remark.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<!--<div class="form-group"-->
<!--ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}">-->
<!--<label class="control-label col-sm-2" for="desc-input">Remark</label>-->
<!--<div class="col-sm-8">-->
<!--<textarea class="form-control" ng-model="partner.remark"-->
<!--name="remark" id="remark-input" maxlength="200" required></textarea>-->
<!--<div ng-messages="partnerForm.remark.$error"-->
<!--ng-if="partnerForm.remark.$dirty">-->
<!--<p class="small text-danger" ng-message="maxlength">Less Than 200-->
<!--Characters(including symbols and spaces)</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>

@ -430,7 +430,7 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Following BD</label>
<label class="control-label col-sm-2">Remark</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.remark"></p>

@ -343,10 +343,10 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="remark-input">Following BD</label>
<label class="control-label col-sm-2" for="remark-input">Remark</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.remark" name="remark"
id="remark-input" maxlength="50">
id="remark-input" maxlength="500">
</div>
</div>
<div class="form-group">

@ -103,6 +103,17 @@
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="devices.length">
<label class="control-label col-xs-4 col-sm-2">Devices</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':device_isAll}" ng-click="chooseDevices('all')">All</a>
<label ng-repeat="device in devices">
|&nbsp;<a role="button" ng-class="{'bg-primary':device.dev_id==chooseDevice_id}" ng-click="chooseDevices(device.dev_id)">{{device.remark}}</a>&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">

@ -17,6 +17,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.pagination = {};
$scope.params.clearing_status = -1;
$scope.params.channel = 'ALL'
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.device_isAll = true;
$scope.params.trans_type = 0;
$scope.isAll = true;
$scope.clients = [$scope.currentUser.client];
@ -69,6 +71,26 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
$scope.params.dev_id = null;
$scope.device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
$scope.loadTradeLogs = function (page) {
var params = angular.copy($scope.params);
if (params.datefrom) {
@ -123,6 +145,10 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'trans_type=' + params.trans_type;
connectSymbol = '&';
}
if (params.dev_id) {
url += connectSymbol + 'dev_id=' + params.dev_id;
connectSymbol = '&'
}
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -137,6 +163,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'dateto=' + params.dateto;
connectSymbol = '&';
}
params.page = page || $scope.pagination.page || 1;
url += connectSymbol + 'page=' + params.page;
return url;

Loading…
Cancel
Save