Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.CustomerContent;
|
| | |
| | | model.addAttribute("couponList", collection);
|
| | | model.addAttribute("proportion", proportion);
|
| | | return "coupon";
|
| | | }
|
| | |
|
| | | //该方法以及废弃
|
| | | @Deprecated
|
| | | @RequestMapping("findThreeFriendsCount")
|
| | | public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
|
| | | |
| | | }
|
| | |
|
| | | //该方法以及废弃
|
| | | @Deprecated
|
| | | @RequestMapping("findThreeFriends")
|
| | | public void findThreeFriends(long id, int type, int page, String callback, PrintWriter out) {
|
| | | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "getConpon", method = RequestMethod.POST)
|
| | |
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("pushVIVO")
|
| | | public void pushVIVO(PrintWriter out) {
|
| | | List<String> regList = new ArrayList<>();
|
| | | regList.add("15710270630271520610033");
|
| | | // regList.add("15711218630321520681531");
|
| | | // try {
|
| | | // VIVOPushUtil.pushUrl(regList, "标题", "网页内容", "http://www.baidu.com");
|
| | | // } catch (Exception e) {
|
| | | // }
|
| | |
|
| | | try {
|
| | | VIVOPushUtil.pushBaiChuanUrl(regList, "标题", "百川内容", "http://www.taobao.com");// 有bug
|
| | | // VIVOPushUtil.pushGoods(regList, "标题", "商品内容", 2, 100005625634L);
|
| | | // VIVOPushUtil.pushUserSignInNotification(regList, "标题", "签到");
|
| | | // VIVOPushUtil.pushWelfareCenter(regList,"标题", "福利中心");
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | @RequestMapping("getLocalTime")
|
| | | public void getLocalTime(PrintWriter out) {
|
| | | out.print(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
| | | }
|
| | |
|
| | | @RequestMapping("getSchedulerList")
|
| | |
| | | }
|
| | |
|
| | | // 邀请链接
|
| | | String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | data.put("inviteLink", shortLink);
|
| | | // String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
|
| | | // + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
|
| | | data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | |
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | |
| | | String inviteCode=null;
|
| | | UserInfoExtra extra= userInfoExtraService.getUserInfoExtra(uid);
|
| | | if(extra!=null)
|
| | | inviteCode=extra.getInviteCode();
|
| | | // 测试
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | commentTexts.add("口令1");
|
| | | commentTexts.add("口令2口令口令淘口令口令口令淘口令");
|
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | String commentTextStr= configService.get("share_single_goods_comment_text");
|
| | | if(!StringUtil.isNullOrEmpty(commentTextStr))
|
| | | {
|
| | | JSONArray arr= JSONArray.fromObject(commentTextStr);
|
| | | for(int i=0;i<arr.size();i++)
|
| | | {
|
| | | if(StringUtil.isNullOrEmpty(inviteCode))
|
| | | {
|
| | | if(arr.optString(i).contains("[邀请码]"))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | commentTexts.add(arr.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK).replace("[邀请码]", inviteCode).replace("[淘口令]", data.optString("token")));
|
| | | }
|
| | | }
|
| | | data.put("commentTexts", commentTexts);
|
| | | data.put("wxErCode", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | }
|
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | |
| | | @Resource
|
| | | private RedPackBalanceService redPackBalanceService;
|
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | | |
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | */
|
| | | public void createTaoBaoShare(AcceptData acceptData, Long uid, Long goodsId, Integer totalNum, String source,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | UserInfoExtra userExtraInfo = userInfoExtraService.getUserInfoExtra(uid);
|
| | | String inviteCode=null;
|
| | | if(userExtraInfo!=null)
|
| | | inviteCode=userExtraInfo.getInviteCode();
|
| | | |
| | | String relationId = null;
|
| | | if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
|
| | | && extraInfo.getRelationValid() == true)
|
| | |
| | |
|
| | | try {
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | |
| | | |
| | | |
| | | // 测试
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | commentTexts.add("口令1");
|
| | | commentTexts.add("口令2口令口令淘口令口令口令淘口令");
|
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | shareInfo.setCommentTexts(commentTexts);
|
| | | |
| | | |
| | |
|
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
|
| | |
|
| | |
| | | shareInfo.setToken(TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | shareInfo.setRule(configService.get("share_single_goods_rule"));
|
| | | shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
|
| | | |
| | | String commentTextStr= configService.get("share_single_goods_comment_text");
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | if(!StringUtil.isNullOrEmpty(commentTextStr))
|
| | | {
|
| | | JSONArray array= JSONArray.fromObject(commentTextStr);
|
| | | for(int i=0;i<array.size();i++)
|
| | | {
|
| | | if(StringUtil.isNullOrEmpty(inviteCode))
|
| | | {
|
| | | if(array.optString(i).contains("[邀请码]"))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | commentTexts.add(array.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK).replace("[邀请码]", inviteCode).replace("[淘口令]", shareInfo.getToken()));
|
| | | }
|
| | | }
|
| | | shareInfo.setCommentTexts(commentTexts);
|
| | | |
| | | |
| | |
|
| | | String shareText = "";
|
| | | // 无券
|
| | |
| | | shareInfo.setWxErCode(jumpLink);
|
| | | shareInfo.setRule(configService.get("share_rule_link_jd"));
|
| | | shareInfo.setPictUrl(jdGoods.getPicUrl());
|
| | | shareInfo.setCommentTexts(new ArrayList<>());
|
| | |
|
| | | String shareText = "";
|
| | | boolean hasCoupon = false;
|
| | |
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setClickUrl(jumpLink);
|
| | | shareInfo.setWxErCode(jumpLink);
|
| | | shareInfo.setCommentTexts(new ArrayList<>());
|
| | | shareInfo.setRule(configService.get("share_rule_link_pdd"));
|
| | | shareInfo.setPictUrl(goods.getGoodsImageUrl());
|
| | |
|
| | |
| | | </association>
|
| | |
|
| | | <association property="userRank" column="uie_rank_id"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserRank">
|
| | | <id column="uie_rank_id" property="id" jdbcType="BIGINT" />
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserRank" select="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.selectByPrimaryKey">
|
| | | </association>
|
| | | </resultMap>
|
| | |
|
| | |
| | | public static boolean IS_TEST = true;
|
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | | |
| | | public static String YINGYONGBAO_LINK="https://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate";
|
| | |
|
| | | public final static String UIDAESKEY = "WW782ss@8*px/%2v";
|
| | |
|
| | |
| | | try {
|
| | | banLiShopOrderPayService.refund(msg.getOrderId());
|
| | | } catch (BanLiShopOrderException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.order.OrderQuery;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoOrderResultDTO;
|
| | | import com.yeshi.fanli.dto.taobao.WeiQuanOrderResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
| | | }
|
| | | }
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | |
| | | @Deprecated
|
| | | private static List<TaoBaoOrder> queryTaoBaoOrder(OrderQuery orderQuery, String appKey, String appSecret) {
|
| | |
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.order.get");
|
| | | map.put("fields",
|
| | | "tb_trade_parent_id,tb_trade_id,num_iid,item_title,item_num,price,pay_price,seller_nick,seller_shop_title,commission,commission_rate,unid,create_time,earning_time,tk_status,tk3rd_pub_id,tk3rd_site_id,tk3rd_adzone_id,relation_id,tb_trade_parent_id,tb_trade_id,num_iid,item_title,item_num,price,pay_price,seller_nick,seller_shop_title,commission,commission_rate,unid,create_time,earning_time,tk3rd_pub_id,tk3rd_site_id,tk3rd_adzone_id,special_id,click_time,relation_id,special_id");
|
| | | if (orderQuery.startTime != null)
|
| | | map.put("start_time", orderQuery.startTime);
|
| | | if (orderQuery.span != null)
|
| | | map.put("span", orderQuery.span + "");
|
| | | map.put("page_no", orderQuery.pageNo + "");
|
| | | map.put("page_size", orderQuery.pageSize + "");
|
| | |
|
| | | if (orderQuery.tkStatus != null)
|
| | | map.put("tk_status", orderQuery.tkStatus + "");
|
| | | if (orderQuery.orderQueryType != null)
|
| | | map.put("order_query_type", orderQuery.orderQueryType);
|
| | | if (orderQuery.orderScene != null)
|
| | | map.put("order_scene", orderQuery.orderScene + "");
|
| | |
|
| | | if (orderQuery.orderCountType != null)
|
| | | map.put("order_count_type", orderQuery.orderCountType + "");
|
| | |
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(appKey);
|
| | | app.setAppSecret(appSecret);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | return parseTaoBaoOrder(json.toString());
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | Thread.sleep(1000);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | private static List<TaoBaoOrder> parseTaoBaoOrder(String response) {
|
| | |
| | | }
|
| | | return "";
|
| | | }
|
| | | |
| | | @SuppressWarnings("deprecation")
|
| | | public static String post(String url, String entity,String charset) {
|
| | | HttpClient client = new HttpClient();
|
| | | PostMethod method = new PostMethod(url);
|
| | | method.addRequestHeader("Content-Type", "text/html;charset="+charset);
|
| | | method.setRequestHeader("Content-Type", "text/html;charset="+charset);
|
| | | method.setRequestBody(entity);
|
| | | try {
|
| | | client.executeMethod(method);
|
| | | return convertInputStreamToString(method.getResponseBodyAsStream());
|
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return "";
|
| | | }
|
| | |
|
| | | public static String postInputStream(String url, File file) throws FileNotFoundException {
|
| | | HttpClient client = new HttpClient();
|
| | |
| | | package org.yeshi.utils.wx;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.HttpException;
|
| | | import org.apache.commons.httpclient.methods.PostMethod;
|
| | | import org.dom4j.DocumentException;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
| | | *
|
| | | */
|
| | | public class WXPayUtil {
|
| | | |
| | | private static String post(String url,String entity)
|
| | | {
|
| | | HttpClient client = new HttpClient();
|
| | | PostMethod method = new PostMethod(url);
|
| | | method.setRequestBody(entity);
|
| | | try {
|
| | | client.executeMethod(method);
|
| | | return method.getResponseBodyAsString();
|
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return "";
|
| | | }
|
| | |
|
| | | /**
|
| | | * 付款到零钱
|
| | |
| | |
|
| | | String entity = WXUtil.loadWXMessage(map);
|
| | |
|
| | | String result = HttpUtil.post("https://api.mch.weixin.qq.com/pay/unifiedorder", entity);
|
| | | String result = post("https://api.mch.weixin.qq.com/pay/unifiedorder", entity);
|
| | | try {
|
| | | System.out.println("统一下单结果:" + new String(result.getBytes("GBK"), "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | |
| | | map.put("nonce_str", StringUtil.getRandomCode(32));
|
| | | map.put("out_refund_no", refundOrderNo);
|
| | | map.put("sign", WXUtil.getSignMD5(map, app.getMchKey()));
|
| | | String result = HttpUtil.post("https://api.mch.weixin.qq.com/pay/refundquery", WXUtil.loadWXMessage(map));
|
| | | String result = post("https://api.mch.weixin.qq.com/pay/refundquery", WXUtil.loadWXMessage(map));
|
| | | System.out.println("订单查询结果:" + result);
|
| | | Map<String, String> resultMap = null;
|
| | | try {
|
| | | resultMap = WXUtil.parseXML(result);
|
| | | } catch (Exception e) {
|
| | | } catch (Throwable e) {
|
| | | try {
|
| | | result = new String(result.getBytes("GBK"), "UTF-8");
|
| | | } catch (UnsupportedEncodingException e1) {
|