添加淘宝APPKey使用次数警告,环境配置彻底properties文件化
| | |
| | | try {
|
| | | obj = joinPoint.proceed(args);
|
| | | } catch (Throwable e) {
|
| | | try {
|
| | | |
| | | LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | return obj;
|
| | |
| | | try {
|
| | | return joinPoint.proceed(args);
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | try {
|
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | |
| | | } finally {
|
| | | if (!StringUtil.isNullOrEmpty(cacheKey)) {
|
| | | Cache cache = cacheManager.getCache("rsCache");
|
| | |
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
|
| | | } finally {
|
| | | if (!StringUtil.isNullOrEmpty(cacheKey)) {
|
| | | Cache cache = cacheManager.getCache("rsCache");
|
| | |
| | | // 记录大于2s的请求
|
| | | if (responseTime >= 2000) {
|
| | | ThreadUtil.run(new Runnable() {
|
| | | |
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | LogHelper.requestTime(url, params, responseTime);
|
| | |
| | | }
|
| | |
|
| | | } catch (Throwable e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
|
| | | out.print(JsonUtil.loadFalseResult(90009, "服务器内部错误"));
|
| | | }
|
| | | return obj;
|
| | |
| | |
|
| | | } catch (Exception e) {
|
| | | errCode = 4;
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | try {
|
| | |
| | |
|
| | | @Resource
|
| | | private GoodsSecondClassService goodsSecondClassService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoCouponService taoBaoCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteRecordService userInviteRecordService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CustomerNameService customerNameService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CustomerContentService customerContentService;
|
| | |
|
| | |
| | | // request.setAttribute("error", "1");
|
| | | return "redirect:" + down;
|
| | | }
|
| | | |
| | |
|
| | | // 保存邀请记录
|
| | | userInviteRecordService.saveInviteRecord(code, uid);
|
| | |
|
| | |
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | JSONObject rdata = new JSONObject();
|
| | | rdata.put("uid", uid);
|
| | | rdata.put("id", id);
|
| | | LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | JSONObject rdata = new JSONObject();
|
| | | rdata.put("uid", uid);
|
| | | rdata.put("id", id);
|
| | | LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
|
| | | out.print(JsonUtil.loadFalseResult(1001, "未知错误"));
|
| | | }
|
| | |
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("uid", uid);
|
| | | data.put("id", id);
|
| | |
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | // 官宣任务
|
| | | if (uid != null) {
|
| | | MsgCommonDTO guanXuanMsg = msgConfigService.getGuanXuanMsg();
|
| | | if (guanXuanMsg != null) {
|
| | | if (guanXuanMsg != null&&guanXuanMsg.getShow()==true) {
|
| | | boolean read = false;
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | if (num != null && (num.getGuanXuanReadTime() != null
|
| | |
| | |
|
| | | // 返利券小助手
|
| | | MsgCommonDTO zhuShouMsg = msgConfigService.getZhuShouMsg();
|
| | | if (zhuShouMsg != null) {
|
| | | if (zhuShouMsg != null&&zhuShouMsg.getShow()==true) {
|
| | |
|
| | | boolean read = false;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.config;
|
| | |
|
| | | import org.yeshi.utils.annotation.Map;
|
| | |
|
| | | /**
|
| | | * 常规配置
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class ConstantConfig {
|
| | | @Map("test")
|
| | | private String test;
|
| | | @Map("task")
|
| | | private String task;
|
| | | @Map("outnetwork")
|
| | | private String outNetWork;
|
| | |
|
| | | public String getTest() {
|
| | | return test;
|
| | | }
|
| | |
|
| | | public void setTest(String test) {
|
| | | this.test = test;
|
| | | }
|
| | |
|
| | | public String getTask() {
|
| | | return task;
|
| | | }
|
| | |
|
| | | public void setTask(String task) {
|
| | | this.task = task;
|
| | | }
|
| | |
|
| | | public String getOutNetWork() {
|
| | | return outNetWork;
|
| | | }
|
| | |
|
| | | public void setOutNetWork(String outNetWork) {
|
| | | this.outNetWork = outNetWork;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | try {
|
| | | taoBaoOrderService.addTaoBaoOrderList(orderList);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | if (orderList != null)
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | qualityFactoryService.autoInsertOrUpadateStorage(listgoods, null, autoRule);
|
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }).start();
|
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | try {
|
| | | taoBaoOrderService.addTaoBaoOrderList(orderList);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
|
| | | }
|
| | |
|
| | | try {
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | |
| | | try {
|
| | | taoBaoOrderService.addTaoBaoOrderList(orderList);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | try {
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public void doJob3() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | // Calendar calendar = Calendar.getInstance();
|
| | | // int h = calendar.get(Calendar.HOUR_OF_DAY);
|
| | | // // 每个小时更新100页数据
|
| | | // int fromPage = h * 100;
|
| | | // if (fromPage <= 0)
|
| | | // fromPage = 11;
|
| | | // int toPage = h * 100 + 100;
|
| | | // Calendar calendar = Calendar.getInstance();
|
| | | // int h = calendar.get(Calendar.HOUR_OF_DAY);
|
| | | // // 每个小时更新100页数据
|
| | | // int fromPage = h * 100;
|
| | | // if (fromPage <= 0)
|
| | | // fromPage = 11;
|
| | | // int toPage = h * 100 + 100;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private QualityFlashSaleService qualityFlashSaleService;
|
| | | |
| | |
|
| | | // 动态商品更新 ,1个小时更新
|
| | | @Scheduled(cron = "0 0 */1 * * ?")
|
| | |
| | | qualityFactoryService.updateWeight(10, 3);
|
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | LogHelper.test("---addNeddUpdateTaoBaoGoods----execute ");
|
| | | |
| | |
|
| | | List<Long> list = qualityFactoryService.queryNeedUpdate(0, 3000, 4);
|
| | | if (list != null) {
|
| | | for (Long id : list) {
|
| | | try {
|
| | | CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 定时清理超过6个小时未更新的限时抢购商品
|
| | | */
|
| | | @Scheduled(cron = "0 15 0/6 * * ? ")
|
| | | public void removeFlashSaleGoods() {
|
| | | |
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | while (true) {
|
| | | List<Long> list = qualityFlashSaleService.queryNeedRemove(0, 100, 6);
|
| | | |
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | break;
|
| | | } |
| | | |
| | | }
|
| | | qualityFlashSaleService.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileOutputStream;
|
| | | import java.io.IOException;
|
| | | import java.io.OutputStream;
|
| | | import java.io.PrintStream;
|
| | | import java.util.ArrayList;
|
| | |
| | | loginLogger.info(obj);
|
| | | }
|
| | |
|
| | | public static void errorDetailInfo(Throwable e) throws Exception {
|
| | | public static void errorDetailInfo(Throwable e) {
|
| | | e.printStackTrace();
|
| | | String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
|
| | | String os = System.getProperty("os.name");
|
| | |
| | | } else
|
| | | filePath = String.format("/usr/local/tomcat8/logs/error_detail_%s.txt", date);
|
| | |
|
| | | OutputStream out = new FileOutputStream(new File(filePath), true);
|
| | | OutputStream out = null;
|
| | |
|
| | | try {
|
| | | out = new FileOutputStream(new File(filePath), true);
|
| | | PrintStream ps = new PrintStream(out);
|
| | | ps.print(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
| | | ps.print("\n");
|
| | | e.printStackTrace(ps);
|
| | | ps.flush();
|
| | | ps.close();
|
| | | } catch (Exception ee) {
|
| | |
|
| | | } finally {
|
| | | out.close();
|
| | | try {
|
| | | out.close();
|
| | | } catch (IOException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public static void errorDetailInfo(Throwable e, String params, String url) throws Exception {
|
| | | public static void errorDetailInfo(Throwable e, String params, String url) {
|
| | | e.printStackTrace();
|
| | | String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
|
| | | String os = System.getProperty("os.name");
|
| | |
| | | filePath = String.format("C:/logs/error_detail_%s.txt", date);
|
| | | } else
|
| | | filePath = String.format("/usr/local/tomcat8/logs/error_detail_%s.txt", date);
|
| | |
|
| | | OutputStream out = new FileOutputStream(new File(filePath), true);
|
| | | OutputStream out = null;
|
| | | try {
|
| | | out = new FileOutputStream(new File(filePath), true);
|
| | | PrintStream ps = new PrintStream(out);
|
| | | ps.print(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
| | | ps.print("\n");
|
| | |
| | | e.printStackTrace(ps);
|
| | | ps.flush();
|
| | | ps.close();
|
| | | } catch (Exception e1) {
|
| | |
|
| | | } finally {
|
| | | out.close();
|
| | | try {
|
| | | out.close();
|
| | | } catch (IOException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.exception.SMSException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TencentSMSUtil;
|
| | | import com.yeshi.fanli.util.EmergencyUtil;
|
| | |
|
| | | @Service
|
| | | public class BusinessEmergent110ServiceImpl implements BusinessEmergent110Service {
|
| | |
| | | if (!exist)
|
| | | stList.add(identifyCode);
|
| | | if (stList.size() >= limitCount) {// 触发报警
|
| | | baoJin(key, "返利券【分享赚】");
|
| | | if ("1".equalsIgnoreCase(configService.get("can_send_emergency_msg")))
|
| | | EmergencyUtil.baoJin(key, "返利券【分享赚】", phones);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (!exist)
|
| | | stList.add(identifyCode);
|
| | | if (stList.size() >= limitCount) {// 触发报警
|
| | | baoJin(key, "返利券【领券返利】");
|
| | | if ("1".equalsIgnoreCase(configService.get("can_send_emergency_msg")))
|
| | | EmergencyUtil.baoJin(key, "返利券【领券返利】", phones);
|
| | | }
|
| | | }
|
| | |
|
| | | static Map<String, Long> emergentTimeMap = new HashMap<>();
|
| | |
|
| | | private void baoJin(String key, String name) {
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 2)// 2分钟报警一次
|
| | | {
|
| | | emergentTimeMap.put(key, System.currentTimeMillis());
|
| | | // 发送短信
|
| | | @Override
|
| | | public void taoBaoAPPKeyLimitError(String appKey, String identifyCode) {
|
| | | // 2分钟内错误 3次触发报警
|
| | | String key = "monitor-error-tb-app-limit-" + appKey;
|
| | | int timeM = 2;
|
| | | int limitCount = 3;
|
| | | // 5分钟内错误 5次触发报警
|
| | | List<String> stList = map.get(key);
|
| | | if (stList == null) {
|
| | | stList = new ArrayList<>();
|
| | | map.put(key, stList);
|
| | | }
|
| | | if (System.currentTimeMillis() - shareTime > 1000 * 60 * timeM) {
|
| | | stList.clear();
|
| | | shareTime = System.currentTimeMillis();
|
| | | }
|
| | | boolean exist = false;
|
| | | for (String code : stList)
|
| | | if (identifyCode.equalsIgnoreCase(code)) {
|
| | | exist = true;
|
| | | break;
|
| | | }
|
| | | if (!exist)
|
| | | stList.add(identifyCode);
|
| | | if (stList.size() >= limitCount) {// 触发报警
|
| | | if ("1".equalsIgnoreCase(configService.get("can_send_emergency_msg")))
|
| | | for (String phone : phones) {
|
| | | try {
|
| | | TencentSMSUtil.sendSingleMsg(phone, Constant.smsConfig.getServiceEmergency()
|
| | | .replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[服务名字]", name));
|
| | | } catch (SMSException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | EmergencyUtil.baoJin(key, "淘宝APPKey请求限制【" + appKey + "】", phones);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | Set<String> specialIdSets = new HashSet<>();
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | |
|
| | | for (TaoBaoPunishOrder order : orderList) {
|
| | | if (!StringUtil.isNullOrEmpty(order.getRelationId()))
|
| | | relationIdSets.add(order.getRelationId());
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(order.getSpecialId()))
|
| | | specialIdSets.add(order.getSpecialId());
|
| | |
|
| | | doPunishOrder(order, uidSets);
|
| | | }
|
| | | // for (TaoBaoPunishOrder order : orderList) {
|
| | | // if (!StringUtil.isNullOrEmpty(order.getRelationId()))
|
| | | // relationIdSets.add(order.getRelationId());
|
| | | //
|
| | | // if (!StringUtil.isNullOrEmpty(order.getSpecialId()))
|
| | | // specialIdSets.add(order.getSpecialId());
|
| | | //
|
| | | // doPunishOrder(order, uidSets);
|
| | | // }
|
| | |
|
| | | for (Iterator<String> its = relationIdSets.iterator(); its.hasNext();) {
|
| | | String relationId = its.next();
|
| | |
| | | */
|
| | | public void buyTaoBaoGoodsError(String identifyCode);
|
| | |
|
| | | /**
|
| | | * 淘宝客API请求被限制
|
| | | * |
| | | * @param appKey
|
| | | * @param identifyCode
|
| | | */
|
| | | public void taoBaoAPPKeyLimitError(String appKey, String identifyCode);
|
| | |
|
| | | }
|
| | |
| | | import java.util.Properties;
|
| | |
|
| | | import com.yeshi.fanli.entity.config.AlipayConfig;
|
| | | import com.yeshi.fanli.entity.config.ConstantConfig;
|
| | | import com.yeshi.fanli.entity.config.SMSConfig;
|
| | | import com.yeshi.fanli.entity.config.SystemCommonConfig;
|
| | | import com.yeshi.fanli.entity.config.WXGZConfig;
|
| | |
| | | public class Constant {
|
| | | public static boolean IS_TASK = false;
|
| | | // 外网环境
|
| | | public static boolean IS_OUTNET = false;
|
| | | public static boolean IS_OUTNET = true;
|
| | |
|
| | | public static boolean IS_TEST = true;
|
| | | public static boolean IS_TEST = false;
|
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | | |
| | |
|
| | | public final static String UIDAESKEY = "WW782ss@8*px/%2v";
|
| | |
|
| | | public final static String ADMINH5_AESKEY = "WW782Ss@0*px/,2v";
|
| | |
| | | public static AlipayConfig alipayConfig;
|
| | |
|
| | | public static ZNXConfig znxConfig;
|
| | |
|
| | | public static ConstantConfig constantConfig;
|
| | |
|
| | | /**
|
| | | * 淘宝商品红包
|
| | |
| | | znxConfig = (ZNXConfig) MapUtil.parseMap(ZNXConfig.class, ps);
|
| | | }
|
| | |
|
| | | if (constantConfig == null) {
|
| | | Properties ps = org.yeshi.utils.PropertiesUtil
|
| | | .getProperties(TaoBaoUtil.class.getClassLoader().getResourceAsStream("constant.properties"));
|
| | | constantConfig = (ConstantConfig) MapUtil.parseMap(ConstantConfig.class, ps);
|
| | | IS_OUTNET = Boolean.parseBoolean(constantConfig.getOutNetWork());
|
| | | IS_TASK = Boolean.parseBoolean(constantConfig.getTask());
|
| | | IS_TEST = Boolean.parseBoolean(constantConfig.getTest());
|
| | | |
| | | System.out.println("IS_OUTNET:"+IS_OUTNET);
|
| | | System.out.println("IS_TASK:"+IS_TASK);
|
| | | System.out.println("IS_TEST:"+IS_TEST);
|
| | | }
|
| | |
|
| | | Extract_Activty = String.format("%s.ui.mine.MyRedPacketsActivity",
|
| | | Constant.systemCommonConfig.getAndroidBaseactivityName());
|
| | | HB_Activity = String.format("%s.ui.main.MainActivity",
|
New file |
| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.exception.SMSException;
|
| | |
|
| | | /**
|
| | | * 紧急告警
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class EmergencyUtil {
|
| | |
|
| | | static Map<String, Long> emergentTimeMap = new HashMap<>();
|
| | |
|
| | | public static void baoJin(String key, String name, String[] phones) {
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 2)// 2分钟报警一次
|
| | | {
|
| | | emergentTimeMap.put(key, System.currentTimeMillis());
|
| | | // 发送短信
|
| | | for (String phone : phones) {
|
| | | try {
|
| | | TencentSMSUtil.sendSingleMsg(phone, Constant.smsConfig.getServiceEmergency()
|
| | | .replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[服务名字]", name));
|
| | | } catch (SMSException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | | //淘礼金创建
|
| | | |
| | | public static void getLiJin()
|
| | | {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.create");
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
|
| | | map.put("item_id", "538982295340");
|
| | | map.put("total_num", "1");
|
| | | map.put("name", "返利券新人淘礼金红包");
|
| | | map.put("user_total_win_num_limit", "1");
|
| | | map.put("security_switch", "false");
|
| | | map.put("per_face", "1.00");
|
| | | map.put("send_start_time", "2019-05-27 00:00:00");
|
| | | map.put("send_end_time", "2019-06-01 00:00:00");
|
| | | map.put("use_end_time", "1");
|
| | | map.put("use_end_time_mode", "1");
|
| | | map.put("use_start_time", "2019-05-27 00:00:00");
|
| | | |
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey( TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret( TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map,app);
|
| | | System.out.println(json);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | //lCj1Alo8b9L4Ed6yJLq6iqJ7%2BkHL3AEW
|
| | | |
| | | |
| | | public static void getLiJinXG()
|
| | | {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.instance.report");
|
| | | JSONArray array=new JSONArray();
|
| | | array.add("ZrIIvF%2Fnd7SlL5Bg59eTK6J7%2BkHL3AEW");
|
| | | map.put("rights_id", array.toString());
|
| | | |
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey( TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret( TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map,app);
|
| | | System.out.println(json);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.TaoKeLogHelper;
|
| | | import com.yeshi.fanli.util.EmergencyUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoHttpUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | TaoKeLogHelper.error(e.getParams(), e.getMsg());
|
| | | if (e.getCode() == TaoKeApiException.CODE_API_ERROR) {
|
| | | result = e.getMsg();
|
| | | } else if (e.getCode() == TaoKeApiException.CODE_APPKEY_LIMIT) {
|
| | | try {
|
| | | EmergencyUtil.baoJin("monitor-error-tb-app-limit-" + params.get("app_key"),
|
| | | "淘宝APPKey请求限制【" + params.get("app_key") + "】", new String[] { "18581318252" });
|
| | | } catch (Exception e1) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | task =false
|
| | | outnetwork =false
|
| | | test =true |
New file |
| | |
| | | task =false
|
| | | outnetwork =true
|
| | | test =false |
New file |
| | |
| | | task =true
|
| | | outnetwork =true
|
| | | test false |
New file |
| | |
| | | task =false
|
| | | outnetwork =true
|
| | | test =false |