From 69b43a3a8502d14039f544885ff037ef3f5b89e6 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 24 五月 2019 17:32:39 +0800 Subject: [PATCH] 增加接口监控报警,增加违规订单处理,增加接口请求时间大于2s的统计 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java | 114 ++++++++++++++------------------------------------------- 1 files changed, 28 insertions(+), 86 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java index af7a424..ed7a701 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java @@ -62,7 +62,6 @@ @Resource private UserInfoCountService userInfoCountService; - @Resource private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService; @@ -74,13 +73,12 @@ @Resource private UserRankService userRankService; - + @Resource private UserMoneyDetailService userMoneyDetailService; - /** - * 鏌ヨ鐢ㄦ埛淇℃伅鍒楄〃 姝e父鐢ㄦ埛/寮傚父鐢ㄦ埛 + * 鏌ヨ鐢ㄦ埛淇℃伅鍒楄〃 姝e父鐢ㄦ埛/寮傚父鐢ㄦ埛 * * @param callback * @param pageIndex @@ -107,7 +105,7 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛绫诲瀷type涓嶈兘涓虹┖")); return; } - + if (pageIndex == null) pageIndex = 1; @@ -263,7 +261,6 @@ } } - /** * * @param data @@ -279,15 +276,15 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("娌℃湁鍙洿鏀圭殑鍐呭")); return; } - + Gson gson = new Gson(); - List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {}.getType()); + List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() { + }.getType()); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("娌℃湁鍙洿鏀圭殑鍐呭")); return; } - - + if (uid == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛id涓嶈兘涓虹┖")); return; @@ -298,9 +295,8 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("涓嶅瓨鍦ㄨ鐢ㄦ埛锛�")); return; } - - - for (Integer type: list) { + + for (Integer type : list) { String openid = find.getOpenid(); String wxUnionId = find.getWxUnionId(); String phone = find.getPhone(); @@ -327,7 +323,8 @@ } } else if (4 == type) { // 鏌ヨ鏀粯瀹濈粦瀹� - BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid, BindingAccount.TYPE_ALIPAY); + BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid, + BindingAccount.TYPE_ALIPAY); if (account == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("褰撳墠鐢ㄦ埛鏈粦瀹氭敮浠樺疂锛�")); return; @@ -350,6 +347,7 @@ /** * 灏佺鐢ㄦ埛ID + * * @param callback * @param uid * @param out @@ -369,72 +367,19 @@ return; } - currentInfo.setState(UserInfo.STATE_FORBIDDEN); - currentInfo.setStateDesc("绠$悊鍛樺皝绂�"); - userInfoService.updateByPrimaryKeySelective(currentInfo); - - // 鍔犲叆灏佺鐨勮处鍙峰垪琛� - ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode(); - forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId); - forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getWxUnionId()); - forbiddenUserIdentifyCode.setBeiZhu(currentInfo.getWxName()); - try { - forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode); - } catch (ForbiddenUserIdentifyCodeException e) { - e.printStackTrace(); - } + userInfoService.forbiddenUser(uid, "绠$悊鍛樺皝绂�"); - // 鐢佃瘽鍙风爜 - forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode(); - forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.phone); - forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getPhone()); - try { - forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode); - } catch (ForbiddenUserIdentifyCodeException e) { - e.printStackTrace(); - } - - // 娣樺疂 - UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid); - if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) { - forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode(); - forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid); - forbiddenUserIdentifyCode.setIdentifyCode(taoBao.getTaoBaoUid()); - try { - forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode); - } catch (ForbiddenUserIdentifyCodeException e) { - e.printStackTrace(); - } - } - - // 鏌ヨ鏀粯瀹濈粦瀹� - - List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid); - if (list != null) { - for (BindingAccount ba : list) { - forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode(); - forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount); - forbiddenUserIdentifyCode.setIdentifyCode(ba.getAccount()); - forbiddenUserIdentifyCode.setBeiZhu(ba.getName()); - try { - forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode); - } catch (ForbiddenUserIdentifyCodeException e) { - e.printStackTrace(); - } - } - } - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鐢ㄦ埛灏佺鎴愬姛")); - + } catch (Exception e) { e.printStackTrace(); JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触")); } } - - + /** * 瑙i櫎灏佺鐢ㄦ埛ID + * * @param callback * @param uid * @param out @@ -497,25 +442,26 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触")); } } - - + /** - * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝 + * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝 + * * @param callback * @param code - * @param type 1("寰俊unionId"), 2("娣樺疂ID"), 3("鎵嬫満鍙�"), 4("鏀粯瀹濊处鍙�"); + * @param type + * 1("寰俊unionId"), 2("娣樺疂ID"), 3("鎵嬫満鍙�"), 4("鏀粯瀹濊处鍙�"); * @param out */ @RequestMapping(value = "saveForbiddenInfo") public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) { try { - if (code == null || code.trim().length() == 0 || type == null ||"NULL".equalsIgnoreCase(code)) { + if (code == null || code.trim().length() == 0 || type == null || "NULL".equalsIgnoreCase(code)) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙傛暟涓嶈兘涓虹┖")); return; } - + forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type); - + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇敼鎴愬姛")); } catch (ForbiddenUserIdentifyCodeException e) { @@ -526,9 +472,10 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); } } - + /** - * 鍒犻櫎闃熷憳鍏崇郴 + * 鍒犻櫎闃熷憳鍏崇郴 + * * @param callback * @param id * @param out @@ -555,8 +502,7 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); } } - - + @RequestMapping(value = "queryMyFirstTeams") public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId, PrintWriter out) { @@ -678,7 +624,6 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); } } - /** * 闃熷憳鍏崇郴 @@ -1132,7 +1077,4 @@ } } - - - } -- Gitblit v1.8.0