master
yixian 8 years ago
parent 6b6b26d540
commit e576c675fd

@ -68,9 +68,9 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
params.put("from", fromStr); params.put("from", fromStr);
params.put("to", toStr); params.put("to", toStr);
List<JSONObject> recentOrders = orderMapper.listOrdersNoPage(params); List<JSONObject> recentOrders = orderMapper.listOrdersNoPage(params);
int minOrders = config.getIntValue("cheat_monitor.min_orders"); int minOrders = config.getIntValue("cheat_monitor.mch_close_warning_min_orders");
if (recentOrders.size() < minOrders) { if (recentOrders.size() < minOrders) {
logger.debug("order count:" + recentOrders.size() + " is less than min orders, skip"); logger.debug("order count:{} is less than min orders, skip", recentOrders.size());
return; return;
} }
List<JSONObject> closed = new ArrayList<>(); List<JSONObject> closed = new ArrayList<>();
@ -88,13 +88,13 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
if (lastWarning != null) { if (lastWarning != null) {
long noDisturbingMinutes = config.getLongValue("cheat_monitor.no_disturbing"); long noDisturbingMinutes = config.getLongValue("cheat_monitor.no_disturbing");
if (System.currentTimeMillis() - lastWarning.getTime() < noDisturbingMinutes * 60_000) { if (System.currentTimeMillis() - lastWarning.getTime() < noDisturbingMinutes * 60_000) {
logger.debug("close order warning: no disturbing " + order.getString("order_id")); logger.debug("close order warning: no disturbing {}", order.getString("order_id"));
return; return;
} }
} }
warningList.put(moniker, new Date()); warningList.put(moniker, new Date());
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask()); List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask());
if(!StringUtils.isEmpty(client.getString("bd_user"))){ if (!StringUtils.isEmpty(client.getString("bd_user"))) {
String[] bds = client.getString("bd_user").split(","); String[] bds = client.getString("bd_user").split(",");
if (bds.length > 0) { if (bds.length > 0) {
List<Integer> ids = new LinkedList<>(); List<Integer> ids = new LinkedList<>();
@ -107,7 +107,6 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
} }
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
// List<JSONObject> accounts = clientAccountMapper.listAdminAccounts(clientId); // List<JSONObject> accounts = clientAccountMapper.listAdminAccounts(clientId);
// for (JSONObject account : accounts) { // for (JSONObject account : accounts) {
@ -131,7 +130,7 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
// } // }
for (JSONObject developer : developers) { for (JSONObject developer : developers) {
if(developer.getString("manager_id").equals("141")){ if (developer.getString("manager_id").equals("141")) {
continue; continue;
} }
try { try {

@ -304,9 +304,9 @@
<div class="panel-heading">商户关单率预警 (<span class="small text-red">检测当日订单,触发预警,将发送告警消息于开发者,商户所属BD</span>)</span></div> <div class="panel-heading">商户关单率预警 (<span class="small text-red">检测当日订单,触发预警,将发送告警消息于开发者,商户所属BD</span>)</span></div>
<div class="panel-body"> <div class="panel-body">
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label col-sm-5">最大订单数:</label> <label class="control-label col-sm-5">最小订单数:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="paymentconfig['cheat_monitor.min_orders']"> <input class="form-control" ng-model="paymentconfig['cheat_monitor.mch_close_warning_min_orders']">
</div> </div>
</div> </div>
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">

Loading…
Cancel
Save