| | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | auctionId + "");
|
| | |
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.money; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<UserMonthMoneyVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat); |
| | | |
| | | |
| | | /** |
| | | * 根据用户ID获取资金明细(老版) |
| | | * |
| | | * @param uid |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | |
| | | List<UserMoneyDetail> selectByUidWithState(@Param("uid")Long uid,@Param("start") long start, @Param("count")int count); |
| | | |
| | | Long selectCountByUidWithState(@Param("uid")Long uid); |
| | | List<UserMoneyDetail> selectByUidWithState(@Param("uid") Long uid, @Param("start") long start, |
| | | @Param("count") int count); |
| | | |
| | | Long selectCountByUidWithState(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 统计某个用户某段时间内产生的明细之和 |
| | | * |
| | | * @param uid |
| | | * @param typeList |
| | | * @param minDate |
| | | * @param maxDate |
| | | * @return |
| | | */ |
| | | BigDecimal getTotalMoneyByTypeAndUidWithDate(@Param("uid") Long uid, @Param("typeList") List<String> typeList, |
| | | @Param("minDate") Date minDate, @Param("maxDate") Date maxDate); |
| | | |
| | | } |
| | |
| | | List<TaoBaoOrder> getStateByOrderIdAndPayment(@Param("orderId")String orderId, @Param("payment")String payment); |
| | | |
| | | |
| | | TaoBaoOrder selectLatestByAuctionId(long auctionId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.exception.push;
|
| | |
|
| | | public class VIVOPushException extends Exception {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | private int code;
|
| | | private String msg;
|
| | |
|
| | | public VIVOPushException() {}
|
| | | |
| | | public VIVOPushException(int code, String msg) {
|
| | | this.code = code;
|
| | | this.msg = msg;
|
| | | }
|
| | |
|
| | | public int getCode() {
|
| | | return code;
|
| | | }
|
| | |
|
| | | public String getMsg() {
|
| | | return msg;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getMessage() {
|
| | | return this.msg;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | cog_goods_type=#{goodsType} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listNoTitle" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_order_goods limit #{start},#{count} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_order_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectLatestByAuctionId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_auction_id = #{0} order by to_id desc limit 1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | |
| | | if (list.size() <= 0)
|
| | | return;
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderMapper.selectTaoBaoOrderByOrderId(orderId);
|
| | | if (orderList == null || orderList.size() != list.size()) {
|
| | | if (orderList == null || orderList.size() < list.size()) {
|
| | | System.out.println("红包数与订单数不对应");
|
| | | return;
|
| | | }
|
| | |
| | | commonOrder.setCommonOrderGoods(goods);
|
| | |
|
| | | commonOrder.setUserInfo(list.get(i).getUserInfo());
|
| | |
|
| | | commonOrder.setCreateTime(new Date(list.get(i).getCreatetime())); |
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | |
|
| | | // 插入红包
|
| | |
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleGiftMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderItemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.order.OrderItemDao;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.OrderItem;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleGift;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.OrderItemException;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | | @Resource
|
| | | private CommonGoodsMapper commonGoodsMapper;
|
| | |
|
| | | @Transactional(propagation = Propagation.REQUIRES_NEW)
|
| | | public void saveOrUpdate(List<OrderItem> list) {
|
| | |
| | | @Transactional
|
| | | @Override
|
| | | public OrderItem addOrderItem(TaoBaoOrder taoBaoOrder, Order order, BigDecimal rate) throws OrderItemException {
|
| | |
|
| | | |
| | | //如果下架则从CommonGoods里面获取图片
|
| | | List<String> imgList=redisManager.getTBImg(taoBaoOrder.getAuctionId());
|
| | | if(imgList.size()==0)
|
| | | {imgList=new ArrayList<>();
|
| | | CommonGoods commonGoods= commonGoodsMapper.selectByGoodsIdAndGoodsType(taoBaoOrder.getAuctionId(), CommonGoods.GOODS_TYPE_TB);
|
| | | if(commonGoods!=null)
|
| | | imgList.add(commonGoods.getPicture());
|
| | | |
| | | }
|
| | | OrderItem orderItem = TaoBaoOrderUtil.convert(taoBaoOrder, order, rate,
|
| | | redisManager.getTBImg(taoBaoOrder.getAuctionId()));
|
| | | imgList);
|
| | |
|
| | | orderItem.setFanTime(0L);
|
| | | orderItem.setIsGift(false);
|
| | |
| | | taoBaoOrderMapper.insertSelective(taoBaoOrder);
|
| | | }
|
| | | } else {
|
| | | //测试
|
| | | if(1>0)
|
| | | return;
|
| | | |
| | | boolean hasPayOrder = false;
|
| | | for (TaoBaoOrder order : oldOrderList)
|
| | | if (order.getOrderState().equalsIgnoreCase("订单付款")) {
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
| | | return userMoneyDetailMapper.selectCountByUidWithState(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal statisticUserTypeMoneyWithDate(Long uid, List<UserMoneyDetailTypeEnum> typeList, Date minDate,
|
| | | Date maxDate) {
|
| | | List<String> list = new ArrayList<>();
|
| | | if (typeList != null)
|
| | | for (UserMoneyDetailTypeEnum type : typeList) {
|
| | | list.add(type.name());
|
| | | }
|
| | | BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate);
|
| | | return money == null ? new BigDecimal(0) : money;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | /**
|
| | | * 资金明细详情列表(老版本)
|
| | | * |
| | | * @param uid
|
| | | * @param page
|
| | | * @param pageSize
|
| | |
| | |
|
| | | /**
|
| | | * 资金明细详情总数(老版本)
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countByUidWithState(Long uid);
|
| | |
|
| | | /**
|
| | | * 分类型与时间统计用户的资金总和
|
| | | * |
| | | * @param uid
|
| | | * @param typeList
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public BigDecimal statisticUserTypeMoneyWithDate(Long uid, List<UserMoneyDetailTypeEnum> typeList, Date minDate,
|
| | | Date maxDate);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import javax.servlet.ServletContextEvent;
|
| | | import javax.servlet.ServletContextListener;
|
| | | |
| | | public class ListenerTest implements ServletContextListener {
|
| | | |
| | | @Override
|
| | | public void contextInitialized(ServletContextEvent sce) {
|
| | | System.out.println("我启动了。。。。");
|
| | | }
|
| | | |
| | | @Override
|
| | | public void contextDestroyed(ServletContextEvent sce) {
|
| | | |
| | | }
|
| | | }
|
| | |
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractReject.name() + ":" + extract.getId()));
|
| | | detail.setMoney(extract.getMoney());
|
| | | detail.setSourceIdentifyId(extract.getId());
|
| | | detail.setSubTitle("原路退回");
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractReject.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractReject);
|
| | | detail.setUpdateTime(new Date());
|
New file |
| | |
| | | package com.yeshi.fanli.util.push;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | | 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.apache.commons.httpclient.methods.StringRequestEntity;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.exception.push.VIVOPushException;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * VIVO的推送帮助
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class VIVOPushUtil {
|
| | |
|
| | | /**
|
| | | * POST请求
|
| | | * |
| | | * @param url
|
| | | * @param body
|
| | | * @param headers
|
| | | * @return
|
| | | */
|
| | | private static String post(String url, String body, Map<String, String> headers) {
|
| | | HttpClient httpClient = new HttpClient();
|
| | | PostMethod pm = new PostMethod(url);
|
| | | try {
|
| | | pm.setRequestEntity(new StringRequestEntity(body, "application/json", "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (headers != null) {
|
| | | Iterator<String> its = headers.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | pm.setRequestHeader(key, headers.get(key));
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | httpClient.executeMethod(pm);
|
| | | return pm.getResponseBodyAsString();
|
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取授权码
|
| | | * |
| | | * @param appId
|
| | | * @param appKey
|
| | | * @param appSecret
|
| | | * @return
|
| | | * @throws VIVOPushException
|
| | | */
|
| | | public static String getAuthToken(String appId, String appKey, String appSecret) throws VIVOPushException {
|
| | | JSONObject params = new JSONObject();
|
| | | long timestamp = System.currentTimeMillis();
|
| | | params.put("appId", appId);
|
| | | params.put("appKey", appKey);
|
| | | params.put("timestamp", timestamp);
|
| | | params.put("sign", StringUtil.Md5(appId + appKey + timestamp + appSecret));
|
| | | String result = post("https://host:port/message/auth", params.toString(), null);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("result") != 0)
|
| | | throw new VIVOPushException(resultJson.optInt("result"), resultJson.optString("desc"));
|
| | | return resultJson.optString("authToken");
|
| | | }
|
| | | |
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | | goods.setProvcity(item.optString("provcity"));
|
| | | goods.setPictUrl(item.optString("pict_url"));
|
| | | goods.setShopTitle(item.optString("nick"));
|
| | | goods.setSellerId(item.optLong("seller_id"));
|
| | |
|
| | | String optString = item.optString("shop_dsr");
|
| | | if (!StringUtil.isNullOrEmpty(optString)) {
|
New file |
| | |
| | | package com.yeshi.fanli.util.wx;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 微信域名拦截
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class WXInterceptorUtil {
|
| | | |
| | | public static final int STATUS_NORMAL=1;//正常
|
| | | |
| | | public static final int STATUS_INTERCEPTOR=0;//被拦截
|
| | | |
| | | public static final int STATUS_UNKNOWN_=2;//检测失败
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 微信域名检测
|
| | | * @return
|
| | | */
|
| | | |
| | | public static int getDomainStatus(String domain)
|
| | | {
|
| | | Map<String,String> params=new HashMap<>(); |
| | | params.put("domain",domain);
|
| | | |
| | | Map<String,String> headers=new HashMap<>(); |
| | | headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36");
|
| | | headers.put("X-Requested-With","XMLHttpRequest");
|
| | | headers.put("Referer","http://www.yumingjiance.net/index.php?s=/weixin/index/cate/weixinjiance.html");
|
| | | |
| | | String result= HttpUtil.post("http://www.yumingjiance.net/index.php?s=/Index/ck_weixin", params,headers);
|
| | | JSONObject resultJson= JSONObject.fromObject(result);
|
| | | if(resultJson.optInt("status")==1)
|
| | | return STATUS_NORMAL;
|
| | | else if(resultJson.optInt("status")==0)
|
| | | return STATUS_INTERCEPTOR;
|
| | | else
|
| | | return STATUS_UNKNOWN_;
|
| | | |
| | | |
| | | |
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | /**
|
| | | * 渠道数据统计
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class ChannelDataStatisticVO {
|
| | | private String date;// 日期
|
| | | private BigDecimal estimate;// 佣金
|
| | | private BigDecimal payMoney;// 支付金额
|
| | | private int userCount;// 新增用户数量
|
| | | private int orderCount;// 订单数量
|
| | |
|
| | | public String getDate() {
|
| | | return date;
|
| | | }
|
| | |
|
| | | public void setDate(String date) {
|
| | | this.date = date;
|
| | | }
|
| | |
|
| | | public BigDecimal getEstimate() {
|
| | | return estimate;
|
| | | }
|
| | |
|
| | | public void setEstimate(BigDecimal estimate) {
|
| | | this.estimate = estimate;
|
| | | }
|
| | |
|
| | | public BigDecimal getPayMoney() {
|
| | | return payMoney;
|
| | | }
|
| | |
|
| | | public void setPayMoney(BigDecimal payMoney) {
|
| | | this.payMoney = payMoney;
|
| | | }
|
| | |
|
| | | public int getUserCount() {
|
| | | return userCount;
|
| | | }
|
| | |
|
| | | public void setUserCount(int userCount) {
|
| | | this.userCount = userCount;
|
| | | }
|
| | |
|
| | | public int getOrderCount() {
|
| | | return orderCount;
|
| | | }
|
| | |
|
| | | public void setOrderCount(int orderCount) {
|
| | | this.orderCount = orderCount;
|
| | | }
|
| | | }
|