增加接口监控报警,增加违规订单处理,增加接口请求时间大于2s的统计
| | |
| | |
|
| | | Object obj = null;
|
| | | try {
|
| | | long startTime = System.currentTimeMillis();
|
| | | obj = joinPoint.proceed(args);
|
| | | final long responseTime = System.currentTimeMillis() - startTime;
|
| | | // 记录大于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());
|
| | |
| | | @Resource
|
| | | private UserInfoCountService userInfoCountService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | *
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户类型type不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | *
|
| | | * @param data
|
| | |
| | | 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;
|
| | |
| | | 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();
|
| | |
| | | }
|
| | | } 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;
|
| | |
| | |
|
| | | /**
|
| | | * 封禁用户ID
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | 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("操作失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 解除封禁用户ID
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 用户账号- 封禁/解封 |
| | | * 用户账号- 封禁/解封
|
| | | * |
| | | * @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) {
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 删除队员关系
|
| | | * 删除队员关系
|
| | | * |
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "queryMyFirstTeams")
|
| | | public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
|
| | | PrintWriter out) {
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 队员关系
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | |
| | | }
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
|
| | | public void getTaoBaoCartConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | public void getTaoBaoCartConfig(AcceptData acceptData, String position, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户尚未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get("show_taobao_cart_convert")) ? false : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | String cartJS = configService.get("taobao_cart_js");
|
| | | String cartUrl = configService.get("taobao_cart_link");
|
| | | if (!convert)// 不转链
|
| | | {
|
| | | cartUrl = "http://";
|
| | | cartJS = "-";
|
| | | }
|
| | | String js = null;
|
| | | String link = null;
|
| | | try {
|
| | |
| | | */
|
| | | @RequestMapping(value = "getOrderParseConfig", method = RequestMethod.POST)
|
| | | public void getOrderParseConfig(AcceptData acceptData, PrintWriter out) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂不支持"));
|
| | | |
| | | // String orderJS = configService.get("taobao_order_parse_js");
|
| | | // JSONObject data = new JSONObject();
|
| | | // try {
|
| | | // data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | // StringUtil.getBase64String("*M#34f?,")));
|
| | | // data.put("orderUrl", DESUtil.encode("https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm",
|
| | | // StringUtil.getBase64String("YeShiFANLI889*+"), StringUtil.getBase64String("*M#34f?,")));
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | if ("0".equalsIgnoreCase(configService.get("auto_find_taobao_order")))
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂不支持"));
|
| | | else {
|
| | | String orderJS = configService.get("taobao_order_parse_js");
|
| | | JSONObject data = new JSONObject();
|
| | | try {
|
| | | data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,")));
|
| | | data.put("orderUrl",
|
| | | DESUtil.encode("https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm",
|
| | | StringUtil.getBase64String("YeShiFANLI889*+"), StringUtil.getBase64String("*M#34f?,")));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取订单配置
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "getOrderConfig", method = RequestMethod.POST)
|
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get("show_taobao_order").trim()) ? false : true);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoBuyRelationMapService taoBaoBuyRelationMapService;
|
| | | |
| | | @Resource
|
| | | private BusinessEmergent110Service businessEmergent110Service;
|
| | |
|
| | | /**
|
| | | * 获取淘宝的分享链接
|
| | |
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请求失败"));
|
| | | }
|
| | | |
| | | businessEmergent110Service.buyTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | // 搜索是否在营销主商品库
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | String numIds = "";
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | numIds += goods.getAuctionId() + ",";
|
| | | }
|
| | | if (numIds.endsWith(","))
|
| | | numIds = numIds.substring(0, numIds.length() - 1);
|
| | | try {
|
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getBatchGoodsInfos(numIds);
|
| | | Map<Long, Integer> map = new HashMap<>();
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | | map.put(g.getAuctionId(), g.getMaterialLibType());
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | goods.setMaterialLibType(map.get(goods.getAuctionId()));
|
| | | // 暂时放弃更新到营销商品库
|
| | | // String numIds = "";
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | // numIds += goods.getAuctionId() + ",";
|
| | | // }
|
| | | // if (numIds.endsWith(","))
|
| | | // numIds = numIds.substring(0, numIds.length() - 1);
|
| | | // try {
|
| | | // List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getBatchGoodsInfos(numIds);
|
| | | // Map<Long, Integer> map = new HashMap<>();
|
| | | // for (TaoBaoGoodsBrief g : goodsList)
|
| | | // map.put(g.getAuctionId(), g.getMaterialLibType());
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | // goods.setMaterialLibType(map.get(goods.getAuctionId()));
|
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | |
| | | taoBaoGoodsCacheUtil.saveCommonTaoBaoGoodsInfo(goods);
|
| | | }
|
| | | });
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ShareGoodsService shareGoodsService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ShareGoodsTextTemplateService shareGoodsTextTemplateService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SystemClientParamsService systemClientParamsService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DynamicInfoService dynamicInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private BusinessEmergent110Service businessEmergent110Service;
|
| | |
|
| | | // 获取商品分享链接
|
| | | @RequestMapping(value = "getGoodsShareUrl")
|
| | |
| | | // 添加分享记录
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate);
|
| | | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord= userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | //异步操作 添加分享记录
|
| | | // 异步操作 添加分享记录
|
| | | UserShareGoodsHistory history = new UserShareGoodsHistory();
|
| | | history.setUser(new UserInfo(uid));
|
| | | history.setHongbao(shareMoney);
|
| | |
| | | history.setQuanLink(taoBaoLink.getCouponLink());
|
| | | history.setGoodsId(taoBaoLink.getGoods().getAuctionId());
|
| | | history.setPostPicture(taoBaoLink.getGoods().getPictUrl());
|
| | | |
| | |
|
| | | List<String> imgList = taoBaoLink.getGoods().getImgList();
|
| | | if (imgList == null) {
|
| | | imgList = new ArrayList<>();
|
| | |
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | catch (ShareGoodsException e) {
|
| | | } catch (ShareGoodsException e) {
|
| | | // 分享出错报警
|
| | | try {
|
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错"));
|
| | | } catch (Exception e1) {
|
| | | }
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | businessEmergent110Service.shareTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | out.print(JsonUtil.loadTrueResult("分享成功")); |
| | | out.print(JsonUtil.loadTrueResult("分享成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 查询顶部分类
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param cid
|
| | |
| | | @RequestMapping(value = "shareDynamic", method = RequestMethod.POST)
|
| | | public void shareDynamic(AcceptData acceptData, String id, Long uid, PrintWriter out) {
|
| | | try {
|
| | | |
| | |
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
|
| | | if (dynamicInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该动态信息已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | // 分类id
|
| | | long cid = dynamicInfo.getClassId();
|
| | | |
| | | if (cid == 1 || cid == 2) { // 1 热销单品 2 推荐好货
|
| | |
|
| | | if (cid == 1 || cid == 2) { // 1 热销单品 2 推荐好货
|
| | | // 分享文字
|
| | | String title = null;
|
| | | List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle();
|
| | |
| | | }
|
| | | data.put("title", title);
|
| | | data.put("content", "我在返利券发现了一个很好的商品,快来看看~");
|
| | | |
| | |
|
| | | // 分享奖金
|
| | | ClientTextStyleVO desc = dynamicInfo.getDesc();
|
| | | String content = desc.getContent();
|
| | | int index = content.indexOf("¥");
|
| | | data.put("shareMoney", new BigDecimal(content.substring(index + 1, content.length())));
|
| | | |
| | |
|
| | | // 分享提醒
|
| | | data.put("notifyDesc", configService.get("goods_share_notify"));
|
| | | |
| | |
|
| | | // 分享提示语
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | |
| | | if (p < array.size()) {
|
| | | data.put("notifyPicture", array.optString(p));
|
| | | }
|
| | | |
| | |
|
| | | // 分享出去的图片
|
| | | String pictUrl = dynamicInfo.getImgs().get(0).getUrl();
|
| | | data.put("pictUrl", TbImgUtil.getTBSizeImg(pictUrl, 500));
|
| | | |
| | |
|
| | | // 帮助链接
|
| | | data.put("helpLink","http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
|
| | | |
| | | if (cid == 2) { // 2 推荐好货
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid, dynamicInfo.getListGoodsBrief());
|
| | | data.put("helpLink",
|
| | | "http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
|
| | |
|
| | | if (cid == 2) { // 2 推荐好货
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid,
|
| | | dynamicInfo.getListGoodsBrief());
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | data.put("clickUrl", shareRecord.getShareUrl());
|
| | | } else {
|
| | | // 分享id
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid, dynamicInfo.getListGoodsBrief());
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid,
|
| | | dynamicInfo.getListGoodsBrief());
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | |
| | |
|
| | | Long auctionId = dynamicInfo.getImgs().get(0).getGoods().getAuctionId();
|
| | | // 商品分享链接
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), auctionId + "");
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(),
|
| | | AESUtil.encrypt(uid + "", Constant.UIDAESKEY), auctionId + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | }
|
| | | data.put("clickUrl", url);
|
| | | |
| | |
|
| | | // 淘宝口令
|
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
|
| | | data.put("token", taoBaoLink.getTaoToken());
|
| | | }
|
| | | |
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | | |
| | |
|
| | | String inviteCode = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | |
| | | out.print(JsonUtil.loadFalseResult(9001, "邀请码未激活"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Integer showType = dynamicInfo.getShowType();
|
| | | if (showType == 0) { // 无图分享
|
| | | if (showType == 0) { // 无图分享
|
| | | String title = null;
|
| | | List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle();
|
| | | if (listTitle != null && listTitle.size() > 0) {
|
| | | title ="";
|
| | | title = "";
|
| | | for (ClientTextStyleVO textStyleVO : listTitle) {
|
| | | title += textStyleVO.getContent();
|
| | | }
|
| | |
| | | title = title.replace("【邀请码】", inviteCode);
|
| | | title = title.replace("【邀请链接】", UserUtil.getInviteShortLink(uid));
|
| | | data.put("title", title);
|
| | | |
| | |
|
| | | } else { // 有图分享
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | String bgUrl = imgs.get(0).getUrlOriginal();
|
| | |
| | | out.print(JsonUtil.loadFalseResult("图片路径不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 用户信息
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | String portrait = userInfo.getPortrait();
|
| | | // 画邀请图片
|
| | | if (StringUtil.isNullOrEmpty(dynamicInfo.getInviteMaterialId())) {
|
| | | String imgLink = spreadUserImgService.drawInviteQrCodeNew(bgUrl,uid, portrait, inviteCode);
|
| | | String imgLink = spreadUserImgService.drawInviteQrCodeNew(bgUrl, uid, portrait, inviteCode);
|
| | | data.put("imgLink", imgLink);
|
| | | } else {
|
| | | String title = imgs.get(0).getTitleOriginal();
|
| | | String imgLink = spreadUserImgService.getInviteImgToGreet(bgUrl,uid, portrait, inviteCode, title, new Date());
|
| | | String imgLink = spreadUserImgService.getInviteImgToGreet(bgUrl, uid, portrait, inviteCode,
|
| | | title, new Date());
|
| | | data.put("imgLink", imgLink);
|
| | | }
|
| | | |
| | | // 邀请规则
|
| | |
|
| | | // 邀请规则
|
| | | BusinessSystem system = new BusinessSystem();
|
| | | system.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | system.setPlatform(1);
|
| | | system.setId(4L);
|
| | | String key = "inviteRules"; // key值
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, key);
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
|
| | | key);
|
| | | String valueN = values.getValue();
|
| | | String valueBr = valueN.replace("\n", "<br><br>");
|
| | | data.put("inviteRules", valueBr);
|
| | | |
| | | |
| | |
|
| | | // 邀请链接
|
| | | String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/" |
| | | String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | data.put("inviteLink", shortLink);
|
| | | data.put("inviteCode", inviteCode);
|
| | |
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | |
|
| | | // 更新分享次数
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | |
| | | dynamicInfoService.updateShareCount(dynamicInfo);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("分享记录失败"));
|
| | | try {
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "暂不开放申请"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if ("share".equalsIgnoreCase(source)) {
|
| | | if (user != null && !StringUtil.isNullOrEmpty(user.getRelationId()) && user.getRelationValid()) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | boolean canParse = "0".equalsIgnoreCase(configService.get("auto_find_taobao_order")) ? false : true;
|
| | |
|
| | | String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
|
| | |
|
| | | String orderJS=configService.get("taobao_order_parse_js"); |
| | | String orderJS = configService.get("taobao_order_parse_js");
|
| | | if (!canParse)
|
| | | orderJS = "-";
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("authLink", link);
|
| | |
|
| | | try {
|
| | | data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,")));
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | data.put("orderUrl", "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm");
|
| | | if (!canParse)
|
| | | data.put("orderUrl", "http://");
|
| | | else
|
| | | data.put("orderUrl", "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm");
|
| | | if (first)
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadTrue(0, data, "淘宝授权未成功,请稍后再试"));
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap; |
| | | |
| | | public interface CommonOrderTradeIdMapMapper extends BaseMapper<CommonOrderTradeIdMap> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder; |
| | | |
| | | public interface TaoBaoPunishOrderMapper extends BaseMapper<TaoBaoPunishOrder> { |
| | | |
| | | /** |
| | | * 根据交易ID查询 |
| | | * @param tradeId |
| | | * @return |
| | | */ |
| | | TaoBaoPunishOrder selectByTradeId(String tradeId); |
| | | |
| | | } |
| | |
| | | private String smsExtractSuccess;
|
| | | @Map("sms_extract_fail")
|
| | | private String smsExtractFail;
|
| | | @Map("sms_service_emergency")
|
| | | private String serviceEmergency;
|
| | | @Map("sms_appid")
|
| | | private String smsAppId;
|
| | | @Map("sms_appkey")
|
| | |
| | | this.smsExtract = smsExtract;
|
| | | }
|
| | |
|
| | | public String getServiceEmergency() {
|
| | | return serviceEmergency;
|
| | | }
|
| | |
|
| | | public void setServiceEmergency(String serviceEmergency) {
|
| | | this.serviceEmergency = serviceEmergency;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | @Table("yeshi_ec_common_order_tradeid_map")
|
| | | public class CommonOrderTradeIdMap {
|
| | | @Column(name = "id")
|
| | | private Long id;
|
| | | @Column(name = "common_order_id")
|
| | | private Long commonOrderId;
|
| | | @Column(name = "trade_id")
|
| | | private String tradeId;
|
| | | @Column(name = "create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "source_type")
|
| | | private Integer sourceType;
|
| | |
|
| | | public CommonOrderTradeIdMap(Long commonOrderId, String tradeId, Date createTime, Integer sourceType) {
|
| | | this.commonOrderId = commonOrderId;
|
| | | this.tradeId = tradeId;
|
| | | this.createTime = createTime;
|
| | | this.sourceType = sourceType;
|
| | | }
|
| | |
|
| | | public CommonOrderTradeIdMap() {
|
| | |
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Integer getSourceType() {
|
| | | return sourceType;
|
| | | }
|
| | |
|
| | | public void setSourceType(Integer sourceType) {
|
| | | this.sourceType = sourceType;
|
| | | }
|
| | |
|
| | | public Long getCommonOrderId() {
|
| | | return commonOrderId;
|
| | | }
|
| | |
|
| | | public void setCommonOrderId(Long commonOrderId) {
|
| | | this.commonOrderId = commonOrderId;
|
| | | }
|
| | |
|
| | | public String getTradeId() {
|
| | | return tradeId;
|
| | | }
|
| | |
|
| | | public void setTradeId(String tradeId) {
|
| | | this.tradeId = tradeId;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | //淘宝处罚订单
|
| | | @Table("yeshi_ec_taobao_punish_order")
|
| | | public class TaoBaoPunishOrder {
|
| | | @Column(name = "id")
|
| | | private Long id;
|
| | | @Column(name = "relation_id")
|
| | | private String relationId;// 渠道关系id
|
| | | @Column(name = "settle_month")
|
| | | private String settleMonth;// 结算月份
|
| | | @Column(name = "punish_status")
|
| | | private String punishStatus;// 处罚状态,0 正常,1待处罚,2冻结
|
| | | @Column(name = "violation_type")
|
| | | private String violationType;// 处罚类型,1 店铺淘客,2其他
|
| | | @Column(name = "tk_trade_create_time")
|
| | | private String tkTradeCreateTime;// 淘客订单创建时间
|
| | | @Column(name = "tb_trade_id")
|
| | | private String tbTradeId;// 子订单号
|
| | | @Column(name = "tb_trade_parent_id")
|
| | | private String tbTradeParentId;// 父订单号
|
| | | @Column(name = "tk_adzone_id")
|
| | | private String tkAdzoneId;
|
| | | @Column(name = "tk_site_id")
|
| | | private String tkSiteId;
|
| | | @Column(name = "tk_pub_id")
|
| | | private String tkPubId;
|
| | | @Column(name = "special_id")
|
| | | private String specialId;// 会员运营id
|
| | | @Column(name = "union_id")
|
| | | private String unionId;
|
| | | @Column(name = "create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getRelationId() {
|
| | | return relationId;
|
| | | }
|
| | |
|
| | | public void setRelationId(String relationId) {
|
| | | this.relationId = relationId;
|
| | | }
|
| | |
|
| | | public String getSettleMonth() {
|
| | | return settleMonth;
|
| | | }
|
| | |
|
| | | public void setSettleMonth(String settleMonth) {
|
| | | this.settleMonth = settleMonth;
|
| | | }
|
| | |
|
| | | public String getPunishStatus() {
|
| | | return punishStatus;
|
| | | }
|
| | |
|
| | | public void setPunishStatus(String punishStatus) {
|
| | | this.punishStatus = punishStatus;
|
| | | }
|
| | |
|
| | | public String getViolationType() {
|
| | | return violationType;
|
| | | }
|
| | |
|
| | | public void setViolationType(String violationType) {
|
| | | this.violationType = violationType;
|
| | | }
|
| | |
|
| | | public String getTkTradeCreateTime() {
|
| | | return tkTradeCreateTime;
|
| | | }
|
| | |
|
| | | public void setTkTradeCreateTime(String tkTradeCreateTime) {
|
| | | this.tkTradeCreateTime = tkTradeCreateTime;
|
| | | }
|
| | |
|
| | | public String getTbTradeId() {
|
| | | return tbTradeId;
|
| | | }
|
| | |
|
| | | public void setTbTradeId(String tbTradeId) {
|
| | | this.tbTradeId = tbTradeId;
|
| | | }
|
| | |
|
| | | public String getTbTradeParentId() {
|
| | | return tbTradeParentId;
|
| | | }
|
| | |
|
| | | public void setTbTradeParentId(String tbTradeParentId) {
|
| | | this.tbTradeParentId = tbTradeParentId;
|
| | | }
|
| | |
|
| | | public String getTkAdzoneId() {
|
| | | return tkAdzoneId;
|
| | | }
|
| | |
|
| | | public void setTkAdzoneId(String tkAdzoneId) {
|
| | | this.tkAdzoneId = tkAdzoneId;
|
| | | }
|
| | |
|
| | | public String getTkSiteId() {
|
| | | return tkSiteId;
|
| | | }
|
| | |
|
| | | public void setTkSiteId(String tkSiteId) {
|
| | | this.tkSiteId = tkSiteId;
|
| | | }
|
| | |
|
| | | public String getTkPubId() {
|
| | | return tkPubId;
|
| | | }
|
| | |
|
| | | public void setTkPubId(String tkPubId) {
|
| | | this.tkPubId = tkPubId;
|
| | | }
|
| | |
|
| | | public String getSpecialId() {
|
| | | return specialId;
|
| | | }
|
| | |
|
| | | public void setSpecialId(String specialId) {
|
| | | this.specialId = specialId;
|
| | | }
|
| | |
|
| | | public String getUnionId() {
|
| | | return unionId;
|
| | | }
|
| | |
|
| | | public void setUnionId(String unionId) {
|
| | | this.unionId = unionId;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | private static Logger requestLogger = Logger.getLogger("requestLog");
|
| | |
|
| | | private static Logger requestTimeLogger = Logger.getLogger("requestTimeLog");
|
| | |
|
| | | public static void userInfo(Object obj) {
|
| | | userLogger.info(obj);
|
| | | }
|
| | |
| | | if (info != null)
|
| | | smsLogger.info(info);
|
| | | }
|
| | |
|
| | | public static void requestTime(String url, Map<String, Object> params, long time) {
|
| | | String paramsStr = "";
|
| | | try {
|
| | | Iterator<String> its = params.keySet().iterator();
|
| | | List<String> list = new ArrayList<>();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | Object value = params.get(key);
|
| | | Object[] values = (Object[]) value;
|
| | | list.add(key + "=" + values[0].toString());
|
| | | }
|
| | | for (String param : list)
|
| | | paramsStr += param + "&";
|
| | | if (paramsStr.endsWith("&"))
|
| | | paramsStr = paramsStr.substring(0, paramsStr.length() - 1);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | String content = String.format("链接:%s 参数:%s 响应时间:%s", url, paramsStr, time + "");
|
| | | requestTimeLogger.info(content);
|
| | | }
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.order.CommonOrderTradeIdMap"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="common_order_id" property="commonOrderId" |
| | | jdbcType="BIGINT" /> |
| | | <result column="trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="source_type" property="sourceType" jdbcType="INTEGER" /> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,common_order_id,trade_id,source_type,create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_order_tradeid_map where id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_order_tradeid_map where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderTradeIdMap" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_common_order_tradeid_map |
| | | (id,common_order_id,trade_id,create_time,source_type) values |
| | | (#{id,jdbcType=BIGINT},#{commonOrderId,jdbcType=BIGINT},#{tradeId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{sourceType,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderTradeIdMap" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_common_order_tradeid_map |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="commonOrderId != null">common_order_id,</if> |
| | | <if test="tradeId != null">trade_id,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="sourceType != null">source_type,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="commonOrderId != null">#{commonOrderId,jdbcType=BIGINT},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderTradeIdMap">update |
| | | yeshi_ec_common_order_tradeid_map set common_order_id = |
| | | #{commonOrderId,jdbcType=BIGINT},trade_id = |
| | | #{tradeId,jdbcType=VARCHAR},create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},source_type = |
| | | #{sourceType,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderTradeIdMap"> |
| | | update yeshi_ec_common_order_tradeid_map |
| | | <set> |
| | | <if test="commonOrderId != null">common_order_id=#{commonOrderId,jdbcType=BIGINT},</if> |
| | | <if test="tradeId != null">trade_id=#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sourceType != null">source_type=#{sourceType,jdbcType=INTEGER},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.taobao.TaoBaoPunishOrderMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="relation_id" property="relationId" jdbcType="VARCHAR" /> |
| | | <result column="settle_month" property="settleMonth" jdbcType="VARCHAR" /> |
| | | <result column="punish_status" property="punishStatus" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="violation_type" property="violationType" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="tk_trade_create_time" property="tkTradeCreateTime" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="tb_trade_id" property="tbTradeId" jdbcType="VARCHAR" /> |
| | | <result column="tb_trade_parent_id" property="tbTradeParentId" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="tk_adzone_id" property="tkAdzoneId" jdbcType="VARCHAR" /> |
| | | <result column="tk_site_id" property="tkSiteId" jdbcType="VARCHAR" /> |
| | | <result column="tk_pub_id" property="tkPubId" jdbcType="VARCHAR" /> |
| | | <result column="special_id" property="specialId" jdbcType="VARCHAR" /> |
| | | <result column="union_id" property="unionId" jdbcType="VARCHAR" /> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,relation_id,settle_month,punish_status,violation_type,tk_trade_create_time,tb_trade_id,tb_trade_parent_id,tk_adzone_id,tk_site_id,tk_pub_id,special_id,union_id,create_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_punish_order where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByTradeId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_punish_order where tb_trade_id = #{0} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_punish_order where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_taobao_punish_order |
| | | (id,relation_id,settle_month,punish_status,violation_type,tk_trade_create_time,tb_trade_id,tb_trade_parent_id,tk_adzone_id,tk_site_id,tk_pub_id,special_id,union_id,create_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{relationId,jdbcType=VARCHAR},#{settleMonth,jdbcType=VARCHAR},#{punishStatus,jdbcType=VARCHAR},#{violationType,jdbcType=VARCHAR},#{tkTradeCreateTime,jdbcType=VARCHAR},#{tbTradeId,jdbcType=VARCHAR},#{tbTradeParentId,jdbcType=VARCHAR},#{tkAdzoneId,jdbcType=VARCHAR},#{tkSiteId,jdbcType=VARCHAR},#{tkPubId,jdbcType=VARCHAR},#{specialId,jdbcType=VARCHAR},#{unionId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_taobao_punish_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="relationId != null">relation_id,</if> |
| | | <if test="settleMonth != null">settle_month,</if> |
| | | <if test="punishStatus != null">punish_status,</if> |
| | | <if test="violationType != null">violation_type,</if> |
| | | <if test="tkTradeCreateTime != null">tk_trade_create_time,</if> |
| | | <if test="tbTradeId != null">tb_trade_id,</if> |
| | | <if test="tbTradeParentId != null">tb_trade_parent_id,</if> |
| | | <if test="tkAdzoneId != null">tk_adzone_id,</if> |
| | | <if test="tkSiteId != null">tk_site_id,</if> |
| | | <if test="tkPubId != null">tk_pub_id,</if> |
| | | <if test="specialId != null">special_id,</if> |
| | | <if test="unionId != null">union_id,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="settleMonth != null">#{settleMonth,jdbcType=VARCHAR},</if> |
| | | <if test="punishStatus != null">#{punishStatus,jdbcType=VARCHAR},</if> |
| | | <if test="violationType != null">#{violationType,jdbcType=VARCHAR},</if> |
| | | <if test="tkTradeCreateTime != null">#{tkTradeCreateTime,jdbcType=VARCHAR},</if> |
| | | <if test="tbTradeId != null">#{tbTradeId,jdbcType=VARCHAR},</if> |
| | | <if test="tbTradeParentId != null">#{tbTradeParentId,jdbcType=VARCHAR},</if> |
| | | <if test="tkAdzoneId != null">#{tkAdzoneId,jdbcType=VARCHAR},</if> |
| | | <if test="tkSiteId != null">#{tkSiteId,jdbcType=VARCHAR},</if> |
| | | <if test="tkPubId != null">#{tkPubId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if> |
| | | <if test="unionId != null">#{unionId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder">update |
| | | yeshi_ec_taobao_punish_order set relation_id = |
| | | #{relationId,jdbcType=VARCHAR},settle_month = |
| | | #{settleMonth,jdbcType=VARCHAR},punish_status = |
| | | #{punishStatus,jdbcType=VARCHAR},violation_type = |
| | | #{violationType,jdbcType=VARCHAR},tk_trade_create_time = |
| | | #{tkTradeCreateTime,jdbcType=VARCHAR},tb_trade_id = |
| | | #{tbTradeId,jdbcType=VARCHAR},tb_trade_parent_id = |
| | | #{tbTradeParentId,jdbcType=VARCHAR},tk_adzone_id = |
| | | #{tkAdzoneId,jdbcType=VARCHAR},tk_site_id = |
| | | #{tkSiteId,jdbcType=VARCHAR},tk_pub_id = |
| | | #{tkPubId,jdbcType=VARCHAR},special_id = |
| | | #{specialId,jdbcType=VARCHAR},union_id = |
| | | #{unionId,jdbcType=VARCHAR},create_time = |
| | | #{createTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder"> |
| | | update yeshi_ec_taobao_punish_order |
| | | <set> |
| | | <if test="relationId != null">relation_id=#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="settleMonth != null">settle_month=#{settleMonth,jdbcType=VARCHAR},</if> |
| | | <if test="punishStatus != null">punish_status=#{punishStatus,jdbcType=VARCHAR},</if> |
| | | <if test="violationType != null">violation_type=#{violationType,jdbcType=VARCHAR},</if> |
| | | <if test="tkTradeCreateTime != null">tk_trade_create_time=#{tkTradeCreateTime,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="tbTradeId != null">tb_trade_id=#{tbTradeId,jdbcType=VARCHAR},</if> |
| | | <if test="tbTradeParentId != null">tb_trade_parent_id=#{tbTradeParentId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="tkAdzoneId != null">tk_adzone_id=#{tkAdzoneId,jdbcType=VARCHAR},</if> |
| | | <if test="tkSiteId != null">tk_site_id=#{tkSiteId,jdbcType=VARCHAR},</if> |
| | | <if test="tkPubId != null">tk_pub_id=#{tkPubId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">special_id=#{specialId,jdbcType=VARCHAR},</if> |
| | | <if test="unionId != null">union_id=#{unionId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | }
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | //测试
|
| | | // info.setAdzoneId("123");
|
| | | goods = TaoKeApiUtil.searchGoodsDetail(auctionId, info);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | throw new ShareGoodsException(4, "商品已下架");
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.monitor;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | 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;
|
| | |
|
| | | @Service
|
| | | public class BusinessEmergent110ServiceImpl implements BusinessEmergent110Service {
|
| | |
|
| | | String[] phones = new String[] { "18581318252", "15025351808", "18696787365" };
|
| | |
|
| | | private static Map<String, List<String>> map = new HashMap<>();
|
| | | private static long shareTime = 0L;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Override
|
| | | public void shareTaoBaoGoodsError(String identifyCode) {
|
| | | String key = "monitor-error-share-tb";
|
| | | int timeM = 5;
|
| | | int limitCount = 5;
|
| | | // 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) {// 触发报警
|
| | | baoJin(key, "返利券【分享赚】");
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void buyTaoBaoGoodsError(String identifyCode) {
|
| | | // 5分钟内错误 3次触发报警
|
| | | String key = "monitor-error-buy-tb";
|
| | | int timeM = 5;
|
| | | int limitCount = 5;
|
| | | // 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) {// 触发报警
|
| | | baoJin(key, "返利券【领券返利】");
|
| | | }
|
| | | }
|
| | |
|
| | | 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());
|
| | | // 发送短信
|
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderTradeIdMapMapper commonOrderTradeIdMapMapper;
|
| | |
|
| | | // 奖励订单图片
|
| | | public final static String PIC_REWARD = "http://img.flqapp.com/resource/order/order_state_reward.png";
|
| | |
| | | commonOrder.setStateWholeOrder(wholeOrderState);
|
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | |
|
| | | // 插入映射,保证交易ID的完整性
|
| | | commonOrderTradeIdMapMapper.insertSelective(
|
| | | new CommonOrderTradeIdMap(commonOrder.getId(), commonOrder.getTradeId(), new Date(),commonOrder.getSourceType()));
|
| | |
|
| | | commonOrderList.add(commonOrder);
|
| | | continue;
|
| | | } else {// 修改
|
| | |
| | | return hongBaoOrderMapper.countByOrderNoAndHongBaoType(orderNo, type, Constant.SOURCE_TYPE_TAOBAO);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public HongBaoOrder selectDetailByCommonOrderId(Long commonOrderId) {
|
| | | return hongBaoOrderMapper.selectByCommonOrderId(commonOrderId);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoPunishOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoPunishOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoPunishOrderServiceImpl implements TaoBaoPunishOrderService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoPunishOrderMapper taoBaoPunishOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void doPunishOrder(TaoBaoPunishOrder order, Set<Long> uidSets) {
|
| | | if (order == null)
|
| | | return;
|
| | | // 首先保存
|
| | | if (taoBaoPunishOrderMapper.selectByTradeId(order.getTbTradeId()) == null)
|
| | | savePunishOrder(order);
|
| | | // 然后
|
| | | CommonOrder co = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getTbTradeId());
|
| | | if (co != null) {
|
| | | uidSets.add(co.getUserInfo().getId());
|
| | | HongBaoOrder hongBaoOder = hongBaoOrderService.selectDetailByCommonOrderId(co.getId());
|
| | | if (hongBaoOder.getHongBaoV2() != null
|
| | | && (hongBaoOder.getHongBaoV2().getState() == HongBaoV2.STATE_BUKELINGQU
|
| | | || hongBaoOder.getHongBaoV2().getState() == HongBaoV2.STATE_KELINGQU)) {
|
| | | HongBaoV2 updateHongBao = new HongBaoV2(hongBaoOder.getHongBaoV2().getId());
|
| | | updateHongBao.setUpdateTime(new Date());
|
| | | updateHongBao.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | updateHongBao.setBeizhu("联盟违规");
|
| | | hongBaoV2Service.updateByPrimaryKeySelective(updateHongBao);
|
| | | // 查询是否有子红包
|
| | | List<HongBaoV2> childList = hongBaoV2Service.listChildrenById(hongBaoOder.getHongBaoV2().getId());
|
| | | for (HongBaoV2 child : childList) {
|
| | | if ((child.getState() == HongBaoV2.STATE_BUKELINGQU
|
| | | || child.getState() == HongBaoV2.STATE_KELINGQU)) {
|
| | | HongBaoV2 update = new HongBaoV2(child.getId());
|
| | | update.setUpdateTime(new Date());
|
| | | update.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | update.setBeizhu("联盟违规");
|
| | | hongBaoV2Service.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void savePunishOrder(TaoBaoPunishOrder order) {
|
| | | if (order == null)
|
| | | return;
|
| | | TaoBaoPunishOrder old = taoBaoPunishOrderMapper.selectByTradeId(order.getTbTradeId());
|
| | | if (old == null) {
|
| | | if (order.getCreateTime() == null)
|
| | | order.setCreateTime(new Date());
|
| | | }
|
| | | taoBaoPunishOrderMapper.insertSelective(order);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void doPunishOrder(List<TaoBaoPunishOrder> orderList) {
|
| | | Set<String> relationIdSets = new HashSet<>();
|
| | | 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 (Iterator<String> its = relationIdSets.iterator(); its.hasNext();) {
|
| | | String relationId = its.next();
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoService.getByRelationId(relationId);
|
| | | if (info != null && info.getUser() != null)
|
| | | uidSets.add(info.getUser().getId());
|
| | | }
|
| | |
|
| | | for (Iterator<String> its = specialIdSets.iterator(); its.hasNext();) {
|
| | | String specialId = its.next();
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoService.getBySpecialId(specialId);
|
| | | if (info != null && info.getUser() != null)
|
| | | uidSets.add(info.getUser().getId());
|
| | | }
|
| | | // 封禁用户
|
| | |
|
| | | for (Iterator<Long> its = uidSets.iterator(); its.hasNext();) {
|
| | | Long uid = its.next();
|
| | | userInfoService.forbiddenUser(uid, "产生违规订单自动封禁");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.share.ShareMapper;
|
| | | import com.yeshi.fanli.dao.user.UserInfoDao;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoDao userInfoDao;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
|
| | | List<UserInfo> list = null;
|
| | |
| | |
|
| | | @Override
|
| | | public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException {
|
| | | |
| | |
|
| | | UserInfo userInfo = userInfoMapper.selectByPKey(uid);
|
| | | if(userInfo == null) {
|
| | | if (userInfo == null) {
|
| | | throw new UserInfoException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | // 谷歌压缩图片
|
| | | String targetPath = FileUtil.getCacheDir() + "/uploadPortrait_" + uid + "_" + System.currentTimeMillis() + ".jpg";
|
| | | String targetPath = FileUtil.getCacheDir() + "/uploadPortrait_" + uid + "_" + System.currentTimeMillis()
|
| | | + ".jpg";
|
| | | Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
|
| | | |
| | |
|
| | | // 执行上传
|
| | | String filePath="/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink= COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | | |
| | | String filePath = "/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | |
|
| | | // 删除本地图片
|
| | | if (new File(targetPath).exists()) {
|
| | | new File(targetPath).delete();
|
| | | }
|
| | | |
| | |
|
| | | // 原头像
|
| | | String portrait = userInfo.getPortrait();
|
| | | |
| | |
|
| | | // 更新信息
|
| | | userInfo.setPortrait(fileLink);
|
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | | |
| | |
|
| | | // 删除原头像
|
| | | if (!StringUtil.isNullOrEmpty(portrait) && portrait.contains("/img/user/")) {
|
| | | COSManager.getInstance().deleteFile(portrait);
|
| | | }
|
| | | |
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | // 删除分享头像信息
|
| | | spreadUserImgService.deleteImgUrl(uid);
|
| | | spreadUserImgService.deleteImgUrl(uid);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void saveUserInfo(String nickName, Long uid) throws UserInfoException {
|
| | | UserInfo userInfo = userInfoMapper.selectByPKey(uid);
|
| | | if(userInfo == null) {
|
| | | if (userInfo == null) {
|
| | | throw new UserInfoException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | userInfo.setNickName(nickName);
|
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void forbiddenUser(Long uid, String reason) {
|
| | | UserInfo currentInfo = userInfoService.selectByPKey(uid);
|
| | | if (currentInfo == null) {
|
| | | return;
|
| | | }
|
| | | if (currentInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | return;
|
| | | }
|
| | |
|
| | | currentInfo.setState(UserInfo.STATE_FORBIDDEN);
|
| | | currentInfo.setStateDesc(reason);
|
| | | 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();
|
| | | }
|
| | |
|
| | | // 电话号码
|
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.monitor;
|
| | |
|
| | | /**
|
| | | * 报警服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface BusinessEmergent110Service {
|
| | |
|
| | | /**
|
| | | * 分享出错
|
| | | * |
| | | * @param identifyCode
|
| | | * 标识唯一编码
|
| | | */
|
| | | public void shareTaoBaoGoodsError(String identifyCode);
|
| | |
|
| | | /**
|
| | | * 自购淘宝商品出错
|
| | | * |
| | | * @param identifyCode
|
| | | */
|
| | | public void buyTaoBaoGoodsError(String identifyCode);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public long countByOrderNoAndHongBaoType(String orderNo, int type);
|
| | | |
| | | /**
|
| | | * 获取详情
|
| | | * @param commonOrderId
|
| | | * @return
|
| | | */
|
| | | public HongBaoOrder selectDetailByCommonOrderId(Long commonOrderId);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | |
|
| | | public interface TaoBaoPunishOrderService {
|
| | |
|
| | | /**
|
| | | * 处理处罚订单
|
| | | * |
| | | * @param order
|
| | | */
|
| | | public void doPunishOrder(TaoBaoPunishOrder order,Set<Long> uidSets);
|
| | |
|
| | | /**
|
| | | * 批量处理
|
| | | * |
| | | * @param orderList
|
| | | */
|
| | | public void doPunishOrder(List<TaoBaoPunishOrder> orderList);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param order
|
| | | */
|
| | | public void savePunishOrder(TaoBaoPunishOrder order);
|
| | |
|
| | | }
|
| | |
| | | public BigDecimal getNewPeopleHB(Long id);
|
| | |
|
| | | /**
|
| | | * 查询用户信息 -- 用户管理列表
|
| | | * 查询用户信息 -- 用户管理列表
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | |
| | | * @param orderMode
|
| | | * @return
|
| | | */
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType, String userRank,
|
| | | Integer days, String startTime, String endTime,Integer orderField, Integer orderMode);
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode);
|
| | |
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime, |
| | | String endTime);
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime);
|
| | |
|
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
|
| | | |
| | |
|
| | | /**
|
| | | * 选择性更新
|
| | | * |
| | | * @param record
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 其强制删除绑定信息
|
| | | * |
| | | * @param user
|
| | | * @param type
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 根据id查询用户信息
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public UserInfo selectByPKey(Long id);
|
| | |
|
| | | |
| | | /**
|
| | | * 超过 daysNum 天未登陆的用户
|
| | | * 超过 daysNum 天未登陆的用户
|
| | | * |
| | | * @param daysNum
|
| | | * @param list
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 根据电话号码、邀请码获取邀请用户
|
| | | * |
| | | * @param phone
|
| | | * @param inviteCode
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 根据电话号码 获取有效用户
|
| | | * |
| | | * @param phone
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | * @throws UserInfoException
|
| | |
| | |
|
| | | /**
|
| | | * 根据微信获取有效用户
|
| | | * |
| | | * @param unionId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getEffectiveUserInfoByWXUnionId(String unionId);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 获取用户余额
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 更换头像
|
| | | * |
| | | * @param file
|
| | | * @param uid
|
| | | * @throws UserInfoException
|
| | |
| | |
|
| | | /**
|
| | | * 保存头像
|
| | | * |
| | | * @param nickName
|
| | | * @param uid
|
| | | * @throws UserInfoException
|
| | | */
|
| | | public void saveUserInfo(String nickName, Long uid) throws UserInfoException;
|
| | |
|
| | | /**
|
| | | * 封禁用户
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void forbiddenUser(Long uid,String reason);
|
| | |
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | public static void getTaoKeContentEffective()
|
| | | {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.optimus.material");
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID.split("_")[3]);
|
| | | map.put("page_no", "1");
|
| | | map.put("page_size", "20");
|
| | | map.put("content_id", "8872035");
|
| | | |
| | | 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();
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | |
| | | public static void getTaoKeContent()
|
| | | {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.content.get");
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID.split("_")[3]);
|
| | | map.put("type", "1");
|
| | | |
| | | 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.dto.order.OrderQuery;
|
| | | import com.yeshi.fanli.dto.taobao.WeiQuanOrderResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | |
| | | return queryTaoBaoOrder(orderQuery, appKey, appSecret);
|
| | | }
|
| | |
|
| | | public static void punish() {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.punish.order.get");
|
| | | // map.put("start_time", "2019-01-01 00:00:00");
|
| | | map.put("span", "1800");
|
| | | map.put("page_no", "1");
|
| | | map.put("page_size", "20");
|
| | | // map.put("violation_type", "1");
|
| | | // map.put("relation_id", "550913878");
|
| | | |
| | | |
| | | // map.put("start_time", "2019-01-01 00:00:00");
|
| | | // map.put("tb_trade_parent_id", "370829441412331676");
|
| | | private static TaoBaoPunishOrder parsePunishOrder(JSONObject data) {
|
| | | TaoBaoPunishOrder order = new TaoBaoPunishOrder();
|
| | | order.setPunishStatus(data.optString("punish_status"));
|
| | | order.setRelationId(data.optString("relation_id"));
|
| | | order.setSettleMonth(data.optString("settle_month"));
|
| | | order.setSpecialId(data.optString("special_id"));
|
| | | order.setTbTradeId(data.optString("tb_trade_id"));
|
| | | order.setTbTradeParentId(data.optString("tb_trade_parent_id"));
|
| | | order.setTkAdzoneId(data.optString("tk_adzone_id"));
|
| | | order.setTkPubId(data.optString("tk_pub_id"));
|
| | | order.setTkSiteId(data.optString("tk_site_id"));
|
| | | order.setTkTradeCreateTime(data.optString("tk_trade_create_time"));
|
| | | order.setViolationType(data.optString("violation_type"));
|
| | | return order;
|
| | | }
|
| | |
|
| | | // map.put("start_time", "2019-01-01 00:00:00");
|
| | | public static List<TaoBaoPunishOrder> getPunishOrderList(Long startTime, Long endTime) {
|
| | | List<TaoBaoPunishOrder> resultList = new ArrayList<>();
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.punish.order.get");
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("page_no", 1);
|
| | | data.put("page_size", 100);
|
| | | int sub = (int) ((endTime - startTime) / 1000);
|
| | | int span = 1800;
|
| | | int count = sub % span == 0 ? sub / span : sub / span + 1;
|
| | | for (int i = 0; i < count; i++) {
|
| | | int totalSpanOrderCount = 0;
|
| | | List<TaoBaoPunishOrder> spanOrderList = new ArrayList<>();
|
| | | long startT = startTime + i * span*1000;
|
| | | data.put("start_time", TimeUtil.getGernalTime(startT, "yyyy-MM-dd HH:mm:ss"));
|
| | | data.put("span", 1800 + "");
|
| | | map.put("af_order_option", data.toString());
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | JSONObject dataJson = json.optJSONObject("tbk_dg_punish_order_get_response").optJSONObject("result").optJSONObject("data");
|
| | | JSONArray array = dataJson.optJSONObject("results").optJSONArray("result");
|
| | | if (array != null)
|
| | | for (int n = 0; n < array.size(); n++) {
|
| | | spanOrderList.add(parsePunishOrder(array.optJSONObject(n)));
|
| | | }
|
| | | totalSpanOrderCount = dataJson.optInt("total_count");
|
| | | int page = 2;
|
| | | while (totalSpanOrderCount > spanOrderList.size())// 存在下一页
|
| | | {
|
| | | data.put("page_no", page++);
|
| | | map.put("af_order_option", data.toString());
|
| | | json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | dataJson = json.optJSONObject("tbk_dg_punish_order_get_response").optJSONObject("data");
|
| | | array = dataJson.optJSONArray("results");
|
| | | if (array != null)
|
| | | for (int n = 0; n < array.size(); n++) {
|
| | | spanOrderList.add(parsePunishOrder(array.optJSONObject(n)));
|
| | | }
|
| | | totalSpanOrderCount = dataJson.optInt("total_count");
|
| | | }
|
| | | resultList.addAll(spanOrderList);
|
| | | System.out.println(json);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public static void test(String startTime, String appKey, String appSecret) {
|
| | | OrderQuery orderQuery = new OrderQuery();
|
| | | orderQuery.startTime = startTime;
|
| | | orderQuery.span = 1200;
|
| | | orderQuery.tkStatus = 1;
|
| | | orderQuery.orderQueryType = "create_time";
|
| | | orderQuery.orderScene = 1;
|
| | | orderQuery.pageNo = 1;
|
| | | orderQuery.pageSize = 100;
|
| | | List<TaoBaoOrder> list = queryTaoBaoOrder(orderQuery, appKey, appSecret);
|
| | | for (TaoBaoOrder order : list)
|
| | | System.out.println(order.getCreateTime() + "--" + order.getSettlementTime());
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | private static List<TaoBaoOrder> queryTaoBaoOrder(OrderQuery orderQuery, String appKey, String appSecret) {
|
| | |
| | | log4j.appender.loginLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.loginLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
|
| | | log4j.logger.requestTimeLog=info,requestTimeLog
|
| | | log4j.appender.requestTimeLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.requestTimeLog.File=logs/request/requestTimeLog.log
|
| | | log4j.appender.requestTimeLog.MaxFileSize=20MB
|
| | | log4j.appender.requestTimeLog.MaxBackupIndex=100
|
| | | log4j.appender.requestTimeLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.requestTimeLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
| | | #提现失败验证码
|
| | | sms_extract_fail=【[签名]】本次提现[金额]元未能成功,如有疑问请联系本APP人工客服。
|
| | |
|
| | | sms_service_emergency=【[签名]】您的服务器发生故障,[服务名字]业务不能正常使用,请及时修复故障!
|
| | |
|
| | | sms_appid=1400092621
|
| | | sms_appkey=a710f8995ceb7d1c7dacfaff730531e2
|
| | | sms_sign=返利券APP
|
| | |
| | | List<T> list = new ArrayList<>();
|
| | | JSONArray array = JSONArray.fromObject(jsonData);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | list.add(baseGson.fromJson(array.optJSONObject(i).toString(), beanType));
|
| | | try {
|
| | | list.add(baseGson.fromJson(array.optJSONObject(i).toString(), beanType));
|
| | | } catch (Exception e) {
|
| | | list.add(baseGson.fromJson(array.optString(i), beanType));
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
| | | package org.yeshi.utils.statistic.http;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | |
| | | private int stateCode;
|
| | | private int time;
|
| | | private Map<String, Object> params;
|
| | | private Date date;
|
| | | private String ip;
|
| | |
|
| | | public String getIp() {
|
| | | return ip;
|
| | | }
|
| | |
|
| | | public void setIp(String ip) {
|
| | | this.ip = ip;
|
| | | }
|
| | |
|
| | | public Date getDate() {
|
| | | return date;
|
| | | }
|
| | |
|
| | | public void setDate(Date date) {
|
| | | this.date = date;
|
| | | }
|
| | |
|
| | | public String getUrl() {
|
| | | return url;
|
| | |
| | | package org.yeshi.utils.statistic.http;
|
| | |
|
| | | import java.text.DateFormat;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Locale;
|
| | |
|
| | | public class LocalhostAccessLogUtil {
|
| | |
|
| | |
| | |
|
| | | try {
|
| | | HttpRequestInfo info = new HttpRequestInfo();
|
| | | info.setIp(content.split("- -")[0]);
|
| | | content = content.split("- -")[1];
|
| | | |
| | |
|
| | | int start = content.indexOf("\"");
|
| | | String time = content.substring(0, start).trim().replace("[", "").replace("]", "");
|
| | | info.setDate(parseDate(time));
|
| | | content = content.substring(start, content.length());
|
| | | start = content.indexOf("\"", 1);
|
| | | String url = content.substring(1, start);
|
| | |
| | | String[] sts = content.substring(start + 1, content.length()).trim().split(" ");
|
| | | info.setStateCode(Integer.parseInt(sts[0]));
|
| | | info.setTime(sts[1].trim().equalsIgnoreCase("-") ? Integer.MAX_VALUE : Integer.parseInt(sts[1]));
|
| | |
|
| | | return info;
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | private static Date parseDate(String timeDesc) {
|
| | | DateFormat format = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", Locale.US);
|
| | | try {
|
| | | Date date = format.parse(timeDesc);
|
| | | return date;
|
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 求请求时间的平均值
|
| | | *
|