Merge branch 'mater-1.6.0' into div
Conflicts:
fanli/src/test/java/org/fanli/TaoKeTest.java
| | |
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTime(new Date(timeStamp));
|
| | | ca.add(Calendar.MONTH, 1);
|
| | | maxDate = new Date(ca.getTimeInMillis());
|
| | | maxDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy-MM"), "yyyy-MM"));
|
| | |
|
| | | // 本月未到账
|
| | | vo.setMonthUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithPreGetTime(uid, minDate, maxDate));
|
| | |
|
| | | // 全部未到账
|
| | | minDate = new Date(0);
|
| | | maxDate=new Date(timeStamp);
|
| | | vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<HongBaoV2> listCanBalanceHongBaoByTypeAndUid(@Param("types") List<Integer> type, @Param("uid") Long uid, |
| | | List<HongBaoV2> listCanBalanceHongBaoByTypeAndUid(@Param("types") List<Integer> type, @Param("uid") Long uid,@Param("start") long start, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 计算可以结算红包的数量 |
| | | * @param type |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countCanBalanceHongBaoByTypeAndUid(@Param("types") List<Integer> type, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据用户ID,订单状态和结算时间统计邀请赚的订单数量 |
| | |
| | | hb_pre_get_time IS NOT NULL AND |
| | | hb_pre_get_time>0 AND |
| | | NOW()>=hb_pre_get_time limit |
| | | #{count} |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countCanBalanceHongBaoByTypeAndUid" resultType="java.lang.Long"> |
| | | select |
| | | count(hb_id) |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{uid} and `hb_version`=2 |
| | | |
| | | <foreach collection="types" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | hb_type = |
| | | #{type} |
| | | </foreach> |
| | | |
| | | and |
| | | (hb_state=1 or hb_state=2) and |
| | | hb_pre_get_time IS NOT NULL AND |
| | | hb_pre_get_time>0 AND |
| | | NOW()>=hb_pre_get_time |
| | | </select> |
| | | |
| | | |
| | | <select id="countInviteOrderCountByUidAndSettleTime" resultType="java.lang.Long"> |
| | | SELECT COUNT(h.hb_id) FROM yeshi_ec_hongbao_v2 h LEFT JOIN |
| | |
| | | List<Integer> types = new ArrayList<>();
|
| | | types.add(HongBaoV2.TYPE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | List<HongBaoV2> hongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, 1000);
|
| | | long count= hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid);
|
| | | List<HongBaoV2> hongBaoList =new ArrayList<>();
|
| | | //1000条数据为1页
|
| | | int page=(int) (count%1000==0?count/1000:count/1000+1);
|
| | | for(int i=0;i<page;i++)
|
| | | {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, i*1000,1000);
|
| | | if(tempHongBaoList!=null&&tempHongBaoList.size()>0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | | // 灰度测试中,京东/拼多多订单分享/邀请订单不返利
|
| | | for (int i = 0; i < hongBaoList.size(); i++) {
|
| | | HongBaoV2 item = hongBaoList.get(i);
|
| | |
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | } else {// 上级用户不是正常用户,订单均不能到账
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKey(item.getUserInfo().getId());
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKey(co.getUserInfo().getId());
|
| | | if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | |
| | | types.clear();
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | List<HongBaoV2> hbList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, 10000);
|
| | | //TODO 需要处理超过1w条数据的订单
|
| | | List<HongBaoV2> hbList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid,0, 10000);
|
| | |
|
| | | if (hbList != null && hbList.size() > 0)
|
| | | totalHongBaoList.addAll(hbList);
|
| | |
| | | // 查询UID的分享赚订单
|
| | | types.clear();
|
| | | types.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | | List<HongBaoV2> hongBaoShareList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, 10000);
|
| | | //TODO 需要处理超过10000条数据的订单
|
| | | List<HongBaoV2> hongBaoShareList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid,0, 10000);
|
| | | for (HongBaoV2 hongBao : hongBaoShareList) {
|
| | | hongBao = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hongBao.getId());
|
| | | hongBao = filterWeiQuanINGHongBao(hongBao);
|
| | |
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | TaoKeApiUtil.taoKeContent();
|
| | | |
| | | }
|
| | |
|
| | | @Test
|
| | |
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | // try {
|
| | | // EmergencyUtil.baoJin("monitor-error-tb-app-limit-24980167",
|
| | | // "淘宝APPKey请求限制【24980167】", new String[] { "18581318252" });
|
| | | // } catch (Exception e1) {
|
| | | //
|
| | | // }
|
| | | // 0K6TBHS%2F84vpYy%2FzKPWwH6J7%2BkHL3AEW
|
| | | // 2PlyMHAEtzjJX3K6R73L5KJ7%2BkHL3AEW
|
| | | Long[] auctionIds = new Long[] { 528561708277L, 563689377074L, 570752677800L, 569281626446L, 567165767332L,
|
| | | 555437572417L, 534857332052L, 565233575889L, 565536124572L };
|
| | | Long auctionId = 598165623087L;
|
| | | String appKey = "27821872";
|
| | | String appSecret = "9277b7c40b753e142303eeabc1936c80";
|
| | | String pid = "mm_491980152_690500060_109327900051";
|
| | | TaoKeAppInfo app=new TaoKeAppInfo(appKey, appSecret, pid);
|
| | |
|
| | | // TaoKeApiUtil.getLiJinXG();
|
| | | // String
|
| | | // url="https://uland.taobao.com/taolijin/edetail?eh=aIrBfHZGd4iZuQF0XRz0iAXoB+DaBK5LQS0Flu/fbSp4QsdWMikAalrisGmre1Id0BFAqRODu114yl7QZ1qFyc7LbOC0oAuo+MUwzxYlSKECGml30RY8PBx5jSVkulpmRQIlrKaDNziGVmobyGguP+jgTFwOoHsRe9593cvcC9QGQASttHIRqdGO5qxVOPQ2buEoHk5wx6hxhsv5QYr1rbcOQrCzclRfPTIk7Z0myMWxZvcNeMU+E+L71lQF+6uZp7DLcYmoygrjfjYOW9fVleIg09jheaZgonv6QcvcARY=&union_lens=lensId:0b0b4505_0c2a_16af789993f_0880;traffic_flag=lm";
|
| | | // String token=
|
| | | // TaoKeApiUtil.getTKToken("https://img.alicdn.com/imgextra/i4/2256112408/O1CN01EKNifJ1TeuF9x4it9_!!2256112408.jpg_400x400.jpg",
|
| | | // "旗睿电风扇台式家用12寸16寸静音学生宿舍摇头定时节能台扇落地扇", url);
|
| | | // System.out.println(token);
|
| | | try {
|
| | | TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金", new BigDecimal(1), 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), app);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|