Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.push.OPPOPushUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "insertShop")
|
| | | public void insertShop(PrintWriter out) {
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadInviteMaterial2")
|
| | | public void uploadInviteMaterial2(PrintWriter out) {
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | | dynamicInfoService.insertTimeHotSale();
|
| | | dynamicInfoService.insertTimeRecommend();
|
| | | List<InviteMaterial> list = new ArrayList<InviteMaterial>();
|
| | | File picfile = new File("E:\\Invite\\pic.txt");// Text文件
|
| | | BufferedReader brp = new BufferedReader(new FileReader(picfile));// 构造一个BufferedReader类来读取文件
|
| | | String fileUrl = "";
|
| | | while ((fileUrl = brp.readLine()) != null) {// 使用readLine方法,一次读一行
|
| | | if (StringUtil.isNullOrEmpty(fileUrl)) {
|
| | | continue;
|
| | | }
|
| | | InviteMaterial inviteMaterial = new InviteMaterial();
|
| | | inviteMaterial.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | inviteMaterial.setState(0);
|
| | | inviteMaterial.setPicture(fileUrl);
|
| | | list.add(inviteMaterial);
|
| | | }
|
| | | brp.close();
|
| | |
|
| | | List<String> listTxt = new ArrayList<String>();
|
| | | File textfile = new File("E:\\Invite\\content.txt");// Text文件
|
| | | BufferedReader br = new BufferedReader(new FileReader(textfile));// 构造一个BufferedReader类来读取文件
|
| | | String s = "";
|
| | | while ((s = br.readLine()) != null) {// 使用readLine方法,一次读一行
|
| | | if (StringUtil.isNullOrEmpty(s)) {
|
| | | continue;
|
| | | }
|
| | | listTxt.add(s);
|
| | | }
|
| | | br.close();
|
| | |
|
| | | if (list.size() == 0 || listTxt.size() == 0 || listTxt.size() < list.size()) {
|
| | | return;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | InviteMaterial invite = list.get(i);
|
| | | invite.setText(listTxt.get(i));
|
| | | inviteMaterialService.insert(invite);
|
| | | }
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("上传失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInvite")
|
| | | public void saveInvite(InviteMaterial inviteMaterial, PrintWriter out) {
|
| | | try {
|
| | | inviteMaterial.setState(0);
|
| | | inviteMaterialService.insert(inviteMaterial);
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("上传失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "insertTimeInvite")
|
| | | public void insertTimeInvite(PrintWriter out) {
|
| | | try {
|
| | | dynamicInfoService.insertTimeInvite();
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getJingFenList")
|
| | | public void getJingFenList(String callback, Integer page, Integer eliteId, PrintWriter out) {
|
| | | try {
|
| | | JDSearchResult result = JDApiUtil.getJingFenGoods(page, eliteId);
|
| | | long count = 0;
|
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | | if (result != null) {
|
| | | PageEntity pageEntity = result.getPageEntity();
|
| | | if (pageEntity != null) {
|
| | | count = pageEntity.getTotalCount();
|
| | | }
|
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("count", count);
|
| | | data.put("list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getWaitingThreadsCount")
|
| | | public void getWaitingThreadsCount(PrintWriter out) {
|
| | |
| | |
|
| | | out.print("success");
|
| | | }
|
| | |
|
| | |
|
| | | |
| | |
|
| | | @RequestMapping("getLocalTime")
|
| | | public void getLocalTime(PrintWriter out) {
|
| | |
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenOPPO;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenVIVO;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsGroup;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsRecord;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.push.PushGoodsGroupService;
|
| | | import com.yeshi.fanli.service.inter.push.PushGoodsRecordService;
|
| | |
| | |
|
| | | @Resource
|
| | | private DeviceTokenVIVOService deviceTokenVIVOService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | @RequestMapping(value = "callback", method = RequestMethod.POST)
|
| | | public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | @RequestMapping("registerXM")
|
| | | public void registerXM(AcceptData acceptData, String regId, Long uid, PrintWriter out) {
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DeviceTokenXM xm = new DeviceTokenXM();
|
| | | xm.setDeviceActiveId(deviceActive.getId());
|
| | | xm.setRegisterId(regId);
|
| | | xm.setUid(uid);
|
| | | deviceTokenXMService.addDeviceToken(xm);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | |
| | |
|
| | | @Resource
|
| | | private DeviceTokenOPPOService deviceTokenOPPOService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenVIVOService deviceTokenVIVOService;
|
| | |
|
| | |
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenXMService.bindUid(active.getId(), uuser.getId());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | | deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
|
| | | // 解绑VIVO推送的用户绑定
|
| | | deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
|
| | | // 解绑XM推送的用户绑定
|
| | | deviceTokenXMService.unBindUid(deviceActive.getId());
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | |
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenXMService.bindUid(active.getId(), uuser.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | |
| | | private DeviceTokenOPPOService deviceTokenOPPOService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenVIVOService deviceTokenVIVOService;
|
| | |
|
| | | @Resource
|
| | |
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | |
| | | /**
|
| | | * 新版登录 V1.5.3
|
| | | *
|
| | |
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenXMService.bindUid(active.getId(), uuser.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | vo.setHelpLink(userVipConfigService.getValueByKey("help_link_vip_h5"));
|
| | | vo.setCsdLink(configService.get("customer_service_link"));
|
| | |
|
| | | |
| | | Date now = new Date();
|
| | | Date start = new Date(0);
|
| | | |
| | |
|
| | | // 返利订单、奖励券提成
|
| | | List<UserMoneyDetailTypeEnum> typeFanli = new ArrayList<>();
|
| | | typeFanli.add(UserMoneyDetailTypeEnum.fanli);
|
| | | typeFanli.add(UserMoneyDetailTypeEnum.orderReward);
|
| | | BigDecimal finishMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeFanli, start, now).abs();
|
| | | |
| | | BigDecimal finishMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeFanli, start, now)
|
| | | .abs();
|
| | |
|
| | | // 邀请订单、分享订单、补贴
|
| | | List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
|
| | | typeList.add(UserMoneyDetailTypeEnum.share);
|
| | |
| | | }
|
| | | });
|
| | | Gson gson = gsonBuilder.create();
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(gson.toJson(vo))));
|
| | | } else {
|
New file |
| | |
| | | package com.yeshi.fanli.dao.push;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.domain.Sort.Direction;
|
| | | import org.springframework.data.domain.Sort.Order;
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.BasicQuery;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.mongodb.BasicDBObject;
|
| | | import com.mongodb.DBObject;
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | |
|
| | | @Repository
|
| | | public class DeviceTokenXMDao extends MongodbBaseDao<DeviceTokenXM> {
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | public List<DeviceTokenXM> listByUid(Long uid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | return mongoTemplate.find(query, DeviceTokenXM.class);
|
| | | }
|
| | |
|
| | | public DeviceTokenXM selectByDeviceActiveId(Long deviceActiveId) {
|
| | | return mongoTemplate.findById(deviceActiveId, DeviceTokenXM.class);
|
| | | }
|
| | |
|
| | | public List<String> listRegId(int start, int count) {
|
| | | DBObject fieldsObject = new BasicDBObject();
|
| | | fieldsObject.put("registerId", true);
|
| | | BasicDBObject dbObject = new BasicDBObject();
|
| | | Query query = new BasicQuery(dbObject, fieldsObject);
|
| | | query.limit(count);
|
| | | query.skip(start);
|
| | | List<Order> orders = new ArrayList<>();
|
| | | orders.add(new Order(Direction.DESC, "updateTime"));
|
| | | query.with(new Sort(orders));
|
| | | List<DeviceTokenXM> resultList = mongoTemplate.find(query, DeviceTokenXM.class);
|
| | | List<String> regList = new ArrayList<>();
|
| | | if (resultList != null) {
|
| | | for (DeviceTokenXM xm : resultList)
|
| | | regList.add(xm.getRegisterId());
|
| | | }
|
| | | return regList;
|
| | | }
|
| | |
|
| | | public long countRegId() {
|
| | | return mongoTemplate.count(new Query(), DeviceTokenXM.class);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.push;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * XM推送
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "deviceTokenXM")
|
| | | public class DeviceTokenXM {
|
| | | @Id
|
| | | private Long deviceActiveId;// 设备活跃ID
|
| | | @Field
|
| | | private String registerId;
|
| | | @Indexed
|
| | | @Field
|
| | | private Long uid;
|
| | | @Field
|
| | | private Date createTime;
|
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public String getRegisterId() {
|
| | | return registerId;
|
| | | }
|
| | |
|
| | | public void setRegisterId(String registerId) {
|
| | | this.registerId = registerId;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Long getDeviceActiveId() {
|
| | | return deviceActiveId;
|
| | | }
|
| | |
|
| | | public void setDeviceActiveId(Long deviceActiveId) {
|
| | | this.deviceActiveId = deviceActiveId;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | DaTaoKeGoodsResult result = null;
|
| | | if ("-1".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null,
|
| | | new BigDecimal("10"),null, page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | result.setGoodsList(
|
| | | daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | |
|
| | | } else if ("0".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_CREATETIME);
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null,
|
| | | new BigDecimal("10"),"createTime", page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), "createTime",
|
| | | page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | | } else {
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(Integer.parseInt(cid));
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, new BigDecimal("10"), page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result =
|
| | | DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(Integer.parseInt(cid),
|
| | | new BigDecimal("10"),null, page, pageSize));
|
| | | new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(Integer.parseInt(cid), new BigDecimal("10")));
|
| | | }
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(4);// 居家生活
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(6);// 美食
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | if ("1".equalsIgnoreCase(cid)) {// 大淘客数据
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(2);// 母婴
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(1);// 女装
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | cidList.add(7);
|
| | | cidList.add(13);
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | |
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, null);
|
| | | uid, "若需再返请使用返利奖励券");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.push.DeviceTokenXMDao;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | |
|
| | | @Service
|
| | | public class DeviceTokenXMServiceImpl implements DeviceTokenXMService {
|
| | | @Resource
|
| | | private DeviceTokenXMDao deviceTokenXMDao;
|
| | |
|
| | | @Override
|
| | | public void addDeviceToken(DeviceTokenXM deviceToken) {
|
| | | if (deviceToken.getDeviceActiveId() == null)
|
| | | return;
|
| | | DeviceTokenXM xm = selectByDeviceActiveId(deviceToken.getDeviceActiveId());
|
| | | if (xm != null) {
|
| | | deviceToken.setCreateTime(xm.getCreateTime());
|
| | | }
|
| | |
|
| | | if (deviceToken.getUpdateTime() == null)
|
| | | deviceToken.setUpdateTime(new Date());
|
| | | deviceTokenXMDao.save(deviceToken);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DeviceTokenXM> listByUid(Long uid) {
|
| | | return deviceTokenXMDao.listByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public DeviceTokenXM selectByDeviceActiveId(Long deviceActiveId) {
|
| | | return deviceTokenXMDao.selectByDeviceActiveId(deviceActiveId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<String> listRegId(int page, int count) {
|
| | | return deviceTokenXMDao.listRegId((page - 1) * count, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countRegId() {
|
| | | return deviceTokenXMDao.countRegId();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void bindUid(Long deviceActiveId, Long uid) {
|
| | | DeviceTokenXM xm = selectByDeviceActiveId(deviceActiveId);
|
| | | if (xm != null) {
|
| | | xm.setUid(uid);
|
| | | xm.setUpdateTime(new Date());
|
| | | deviceTokenXMDao.save(xm);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void unBindUid(Long deviceActiveId) {
|
| | | DeviceTokenXM xm = selectByDeviceActiveId(deviceActiveId);
|
| | | if (xm != null) {
|
| | | xm.setUid(null);
|
| | | xm.setUpdateTime(new Date());
|
| | | deviceTokenXMDao.save(xm);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private List<DeviceTokenHW> filterDeviceToken(List<DeviceTokenHW> hwDeviceList, int hour) {
|
| | | // TODO 暂时不处理消息免打扰
|
| | | if (1 > 0)
|
| | | return hwDeviceList;
|
| | | // 处理消息免打扰
|
| | | if (hour >= 20 || hour < 8) {
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | |
| | |
|
| | | Calendar now = Calendar.getInstance();
|
| | | int hour = now.get(Calendar.HOUR_OF_DAY);
|
| | | if (hour >= 8 && hour < 20) {
|
| | | ispush = true; // 可推送
|
| | | } else {
|
| | | listNotPushId = validateNotDisturb();
|
| | | }
|
| | | // if (hour >= 8 && hour < 20) {
|
| | | // ispush = true; // 可推送
|
| | | // } else {
|
| | | // listNotPushId = validateNotDisturb();
|
| | | // }
|
| | | |
| | | ispush=true;//TODO 处理消息免打扰
|
| | |
|
| | | for (DeviceTokenIOS ios : list) {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | private List<DeviceTokenOPPO> filterDeviceToken(List<DeviceTokenOPPO> deviceList, int hour) {
|
| | |
|
| | | // TODO 消息免打扰关闭
|
| | | if (1 > 0)
|
| | | return deviceList;
|
| | |
|
| | | // 处理消息免打扰
|
| | | if (hour >= 20 || hour < 8) {
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | |
| | | }
|
| | |
|
| | | private List<DeviceTokenVIVO> filterDeviceToken(List<DeviceTokenVIVO> deviceList, int hour) {
|
| | | // TODO 消息免打扰关闭
|
| | | if (1 > 0)
|
| | | return deviceList;
|
| | | // 处理消息免打扰
|
| | | if (hour >= 20 || hour < 8) {
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | |
| | | contentJson.put("id", id);
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("type",PushTypeEnum.ZNX.name());
|
| | | json.put("type", PushTypeEnum.ZNX.name());
|
| | | json.put("content", contentJson);
|
| | | json.put("miPushUrl", String.format("%s.ui.main.MainActivity",
|
| | | Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | | json.put("miPushUrl",
|
| | | String.format("%s.ui.main.MainActivity", Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | |
|
| | | // 版本推送
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("type", PushTypeEnum.ZNX.name());
|
| | | json.put("content", contentJson);
|
| | | json.put("miPushUrl", String.format("%s.ui.main.MainActivity",
|
| | | Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | | json.put("miPushUrl",
|
| | | String.format("%s.ui.main.MainActivity", Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | |
|
| | | // 版本推送
|
| | | if (versions != null && versions.trim().length() > 0) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.push;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenXM;
|
| | |
|
| | | /**
|
| | | * XM的设备绑定
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface DeviceTokenXMService {
|
| | |
|
| | | /**
|
| | | * 添加regId
|
| | | * |
| | | * @param deviceToken
|
| | | */
|
| | | public void addDeviceToken(DeviceTokenXM deviceToken);
|
| | |
|
| | | /**
|
| | | * 根据用户ID查询
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<DeviceTokenXM> listByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 根据DeviceActiveId查询
|
| | | * |
| | | * @param deviceActiveId
|
| | | * @return
|
| | | */
|
| | | public DeviceTokenXM selectByDeviceActiveId(Long deviceActiveId);
|
| | |
|
| | | /**
|
| | | * 根据最小更新时间查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param minUpdateTime
|
| | | * @return
|
| | | */
|
| | | public List<String> listRegId(int page, int count);
|
| | |
|
| | | /**
|
| | | * 根据最小更新时间查询
|
| | | * |
| | | * @param minUpdateTime
|
| | | * @return
|
| | | */
|
| | | public long countRegId();
|
| | |
|
| | | /**
|
| | | * 绑定用户ID
|
| | | * |
| | | * @param deviceActiveId
|
| | | * @param uid
|
| | | */
|
| | | public void bindUid(Long deviceActiveId, Long uid);
|
| | |
|
| | | /**
|
| | | * 解绑用户ID
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void unBindUid(Long deviceActiveId);
|
| | |
|
| | | }
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private void saveHongBao(CommonOrder commonOrder, int type, boolean vip, Map<Integer, HongBaoOrder> notificationMap)
|
| | | throws HongBaoException, UserAccountException {
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | |
| | |
|
| | | if (shareRate.compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | | HongBaoV2 hongBao = createShareHongBao(commonOrder, shareRate,vip);
|
| | | HongBaoV2 hongBao = createShareHongBao(commonOrder, shareRate, vip);
|
| | | if (hongBao == null)
|
| | | return;
|
| | | addFanLiOrShareHongBao(hongBao, commonOrder, notificationMap);
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | public static DaTaoKeDetailV2 getGoodsDetailByGoodsId(Long goodsId) {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | |
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "";
|
| | | params.put("keyWords", key);
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | public static DaTaoKeGoodsResult search(String key, List<Integer> cidList, BigDecimal priceLowerLimit,
|
| | | BigDecimal priceUpperLimit, Integer couponPriceLowerLimit, int page, int pageSize, Integer sort) {
|
| | |
|
| | |
| | | params.put("priceLowerLimit", priceLowerLimit + "");
|
| | | if (priceUpperLimit != null)
|
| | | params.put("priceUpperLimit", priceUpperLimit + "");
|
| | | |
| | |
|
| | | if (couponPriceLowerLimit != null)
|
| | | params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
|
| | | |
| | |
|
| | | String cids = "";
|
| | | if (cidList != null && cidList.size() > 0)
|
| | | for (Integer cid : cidList) {
|
| | |
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "%";
|
| | | params.put("keyWords", key);
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
| | |
|
| | | /**
|
| | | * 商品列表
|
| | | * |
| | | * @param key
|
| | | * @param cidList
|
| | | * @param priceLowerLimit
|
| | |
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", pageSize + "");
|
| | | params.put("pageId", pageId + "");
|
| | | |
| | |
|
| | | if (priceLowerLimit != null)
|
| | | params.put("priceLowerLimit", priceLowerLimit + "");
|
| | | if (priceUpperLimit != null)
|
| | | params.put("priceUpperLimit", priceUpperLimit + "");
|
| | | |
| | |
|
| | | if (couponPriceLowerLimit != null)
|
| | | params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
|
| | | |
| | |
|
| | | if (sort != null)
|
| | | params.put("sort", sort +"");
|
| | | |
| | | params.put("sort", sort + "");
|
| | |
|
| | | if (cidList != null && cidList.size() > 0) {
|
| | | String cids = "";
|
| | | for (int cid : cidList)
|
| | | cids += cid + ",";
|
| | | cids = cids.endsWith(",") ? cids.substring(0, cids.length() - 1) : cids;
|
| | | |
| | | params.put("cids", cids + "");
|
| | | }
|
| | |
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-goods-list", params, new HashMap<>());
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + drawBack.getOrderId());
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.shareWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.shareWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + UserUtil.filterOrderId(drawBack.getOrderId()));
|
| | |
| | | .Md5(UserMoneyDetailTypeEnum.inviteWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
|
| | | detail.setMoney(new BigDecimal("0").subtract(money));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.inviteWeiQuan.getDesc());
|
| | | detail.setSubTitle("订单维权");
|
| | | detail.setSubTitle("订单售后");
|
| | | detail.setType(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | detail.setSourceIdentifyId(drawBack.getId());
|
| | | detail.setDescInfo("订单号:" + UserUtil.filterOrderId(drawBack.getOrderId()));
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("订单维权", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("订单售后", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("扣除说明", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | public static String allPushIOS(List<String> deviceTokenList, MessageInfo info, String url, int type)
|
| | | throws Exception {
|
| | |
|
| | | if (Constant.IS_TEST)
|
| | | return null;
|
| | | // if (Constant.IS_TEST)
|
| | | // return null;
|
| | |
|
| | | Gson gson = new Gson();
|
| | | PushLogHelper.iosInfo("IOS推送设备数为:" + deviceTokenList.size());
|
| | |
| | | throw new Exception("获取短链出错");
|
| | | json = IOSPushFactory.createWEEXPush(shortUrl, info.getTitle(), info.getContent());
|
| | | } else if (type == PushTypeEnum.baichuan.getCode()) {
|
| | | String shortUrl = HttpUtil.getShortLink(url);
|
| | | if (StringUtil.isNullOrEmpty(shortUrl))
|
| | | throw new Exception("获取短链出错");
|
| | | String shortUrl = url;
|
| | | // HttpUtil.getShortLink(url);
|
| | | // if (StringUtil.isNullOrEmpty(shortUrl))
|
| | | // throw new Exception("获取短链出错");
|
| | | json = IOSPushFactory.createBaiChuanPush(shortUrl, info.getTitle(), info.getContent());
|
| | | } else if (type == PushTypeEnum.welfare.getCode()) {
|
| | | json = IOSPushFactory.createWelfarePush(info.getTitle(), info.getContent());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static int singlePushXiaoMiByRegisterId(MessageInfo info, JSONObject json, PushRecord pushRecord,
|
| | | String regId) {
|
| | | if (Constant.IS_TEST)
|
| | | return 1;
|
| | |
|
| | | JSONObject mapXm = JSONObject.fromObject(json);
|
| | |
|
| | | List<String> regIdList = new ArrayList<>();
|
| | | regIdList.add(regId);
|
| | | String android = XiaoMiPushUtil.pushBatchAndroidForXM(info, mapXm, regIdList);
|
| | |
|
| | | LogHelper.userInfo("安卓推送测试:" + android);
|
| | | pushRecord.setAndroidPushId(android);
|
| | |
|
| | | if (android != null) {
|
| | | return 1;
|
| | | } else {
|
| | | return 4;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * IOS 单推
|
| | | *
|
| | |
| | | package com.yeshi.fanli.util.push;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.PostConstruct;
|
| | |
| | | message = builder.build();
|
| | | try {
|
| | | Result result = sender.broadcastAll(message, 3);
|
| | | return result.getMessageId();// 成功 返回消息的Id, 失败返回null
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 批量推送
|
| | | * |
| | | * @param info
|
| | | * @param map
|
| | | * @param regList
|
| | | * 最大个数为1000
|
| | | * @return
|
| | | */
|
| | | public static String pushBatchAndroidForXM(MessageInfo info, Map<String, Object> map, List<String> regList) {
|
| | | if (Constant.IS_TEST)
|
| | | return null;
|
| | | if (regList == null || regList.size() == 0)
|
| | | return "";
|
| | |
|
| | | String name = info.getPackageName();
|
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name)
|
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | // 从info中取页面传来的值
|
| | | Constants.useOfficial(); // 启动推送方法
|
| | | String PackageName = info.getPackageName();
|
| | | Sender sender = new Sender(XIAOMI_F_ANDROID_APP_SECERT); // 申请的AppSecert
|
| | | String title = info.getTitle();
|
| | | String payload = info.getContent();
|
| | | String description = info.getContent();
|
| | |
|
| | | Message message = null; // 做循环传来的key
|
| | | Builder builder = new Message.Builder().restrictedPackageName(PackageName).title(title).payload(payload)
|
| | | .description(description).passThrough(0) // 设置消息是否通过透传方式至App,
|
| | | // 1表示透传,0表示通知栏消息(默认)
|
| | | .notifyType(1); // 设置通知类型, type类型(1-默认提示音, 2-使用默认震动提示,
|
| | | // 3-使用默认led灯光提示)
|
| | | // 将extra放入MessageInfo对象中, 循环遍历extra中的key 和 value
|
| | | if (map != null) {
|
| | | for (String key : map.keySet()) {
|
| | | builder.extra(key, map.get(key).toString());
|
| | | }
|
| | | }
|
| | | message = builder.build();
|
| | | try {
|
| | | Result result = sender.send(message, regList, 3);
|
| | | return result.getMessageId();// 成功 返回消息的Id, 失败返回null
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | |
| | | // jsonXm 转换为 map
|
| | | JSONObject mapXm = JSONObject.fromObject(json);
|
| | | String android = allPushAndroidForXM(info, mapXm);
|
| | | LogHelper.userInfo("安卓推送测试:" + android);
|
| | | LogHelper.userInfo("小米推送:" + android);
|
| | | pushRecord.setAndroidPushId(android);
|
| | | if (android != null) {
|
| | | return 1;
|
| | |
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getMsgID(),message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getMsgID(), message.getTopic(),
|
| | | message.getTag(), new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | |
|
| | | if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.useSystemCoupon.name())) {
|
| | | }
|
| | | } else if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.useSystemCoupon.name())) {
|
| | | UserSystemCouponUseMQMsg dto = new Gson().fromJson(new String(message.getBody()),
|
| | | UserSystemCouponUseMQMsg.class);
|
| | | if (dto != null && dto.getCouponType()
|
| | |
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | //
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
| | | */
|
| | | private boolean sendOrderSubsidyUpdateLater(OrderMoneyRecievedMQMsg dto, int day) {
|
| | |
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderFanLiDelay,
|
| | | dto);
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderFanLiDelay, dto);
|
| | | msg.setKey(dto.getSourceType() + "_" + dto.getOrderId());
|
| | | long delayTime = System.currentTimeMillis() + (Constant.IS_TEST ? 1000 * 30L : 1000 * 60 * 60 * 24L * day);
|
| | | msg.setStartDeliverTime(delayTime);
|
| | |
| | | task =false
|
| | | outnetwork =false
|
| | | test =true |
| | | test=true |
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27016
|
| | | mongo.port=27017
|
| | | #开发环境
|
| | | #mongo.host=192.168.1.253
|
| | | #mongo.username=admin
|
| | | #mongo.password=123456
|
| | | mongo.host=192.168.1.253
|
| | | mongo.username=admin
|
| | | mongo.password=123456
|
| | |
|
| | | mongo.host=193.112.35.168
|
| | | mongo.username=yeshi
|
| | | mongo.password=Yeshi2016@
|
| | | #mongo.host=193.112.35.168
|
| | | #mongo.username=yeshi
|
| | | #mongo.password=Yeshi2016@
|
| | |
|
| | | mongo.connectionsPerHost=8
|
| | | mongo.threadsAllowedToBlockForConnectionMultiplier=4
|
| | |
| | |
|
| | | #返利到账
|
| | | money_fanli_recieved_title=返利到账
|
| | | money_fanli_recieved_msg=[订单类型]订单[订单号],返利[金额]元,已存入到你的账户余额中,请注意查收。
|
| | | money_fanli_recieved_msg=[订单类型]订单[订单号],返利[金额]元,已存入到你的账户余额中,需再返请使用返利奖励券。
|
| | |
|
| | | #分享奖金到账
|
| | | money_share_recieved_title=分享奖金到账
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | // TaoBaoUtil.getTBDetailImageWithSize(597016140493L);
|
| | | // System.out.println(goods);
|
| | | // DaTaoKeApiUtil.getGoodsDetailByGoodsId(558195316187L);
|
| | | try {
|
| | | TaoKeApiUtil.specialConvertCoupon(608512721647L, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | // try {
|
| | | // TaoKeApiUtil.specialConvertCoupon(608512721647L, new
|
| | | // TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | // TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | // } catch (Exception e) {
|
| | | // // TODO Auto-generated catch block
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | // String link = TaoKeApiUtil.officialActivityConvert(87140050199L + "", "1571715733668", "513796574");
|
| | | // System.out.println(link);
|
| | | |
| | | // String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", 6396582L, "share");
|
| | | // System.out.println(link);
|
| | | |
| | | try {
|
| | | TaoKeApiUtil.searchGoodsDetail(608512721647L);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
|
| | | @Test
|
| | | public void test2() {
|
| | | String link = TaoKeApiUtil.officialActivityConvert("87140050199", "1571120794546", "20211660");
|
| | | System.out.println(TaoKeApiUtil.getTKToken("http://", "母婴预售", link));
|
| | | String link = TaoKeApiUtil.officialActivityConvert("87140050199", "1571715733668", "20211660");
|
| | | System.out.println(link);
|
| | | // https://s.click.taobao.com/t?e=m%3D2%26s%3DW%2Fys7R71JXMcQipKwQzePCperVdZeJviyK8Cckff7TVRAdhuF14FMXC%2FEJQELlNo5x%2BIUlGKNpVpS9y0ojX%2FfMsvmRQfeMsreH9%2FasRClvq63GoCXmcqkTiRUN2xVR4GdesO8XD8dsNdITvXwTxvKDqJgCOacH%2BU%2FVJqtNeEg5OOvkjnk315zzvflh4%2Fhqj8BmyXDtEFdgwjGkouqJtJeds5wF0j1Yhhp1953%2FcnpLUV6UUID4c8TeTEWJdP8jmRdTEuB5K8MGvkLv1nNhnYz%2FB0z8qlrv%2Bjr%2B%2FiM5RbEEle7auY0HPYWszlTEcWhO9mli2vZjCuAmyG1kYtrC7hgcEnE%2FQxigjMfFc2hYciEyAdpuz3kb9JWJVVX36lFeRKtwLUkdbL0syg%2BG8%2FlCRQJ1YlOPkYHNIul3paqKYwK75NNUki5Nwcg2GYz3Bez8Z8OusR9%2BDFlSU%2BcenL13XDY2hrrfx7OMbmkUtLKDKbz1CCoC2zoKs%2FmnEqY%2Bakgpmw&pvid=24980167&union_lens=lensId:0b013a8d_0cec_16df214d979_38a1
|
| | |
|
| | | }
|