Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
|
| | | Integer days, String startTime, String endTime, Integer orderMode, Integer type, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | List<UserInfoVO> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, type, key, keyType,
|
| | | userRank, days, startTime, endTime, orderField, orderMode);
|
| | | userRank, days, startTime, endTime, orderField, orderMode,userType);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime);
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime,userType);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> topPicList = getSwiperByCard("index_top",acceptData);
|
| | | List<SwiperPicture> topPicList = getSwiperByCard("index_top", acceptData);
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | | } else {
|
| | | invitePicList = getSwiperByCard("index_invite",acceptData);
|
| | | invitePicList = getSwiperByCard("index_invite", acceptData);
|
| | | }
|
| | |
|
| | | if (invitePicList == null) {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | List<SwiperPicture> invitePicList = getSwiperByCard("index_invite",acceptData);
|
| | | List<SwiperPicture> invitePicList = getSwiperByCard("index_invite", acceptData);
|
| | |
|
| | | return invitePicList;
|
| | | }
|
| | |
| | | */
|
| | | @RequestMapping(value = "getSpecialActivities")
|
| | | public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out, String callback) {
|
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
|
| | | List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "special_activities",
|
| | | platformCode, Integer.parseInt(acceptData.getVersion()));
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | List<Special> list = new ArrayList<Special>();
|
| | | if (listSpecial != null) {
|
| | |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | | if (!com.yeshi.fanli.util.VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))
|
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(configService.get("taobao_share_qrcode_text"), goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | data.put("commentTexts", commentTexts);
|
| | | data.put("wxErCode", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | | data.put("wxErCode", ShareControllerV2.getERCodeContent(configService.get("taobao_share_qrcode_text"), goods, taoBaoLink.getTaoToken()));
|
| | | }
|
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | |
| | |
|
| | | LogHelper.test("获取PID耗时:" + (java.lang.System.currentTimeMillis() - startTime));
|
| | |
|
| | | final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | // final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | // 是否在服务端进行转链
|
| | | boolean convertInServer = configService.isConvertTaoBaoLinkInServer();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | if (goods != null) {
|
| | | goodsList.add(goods);
|
| | | final TaoBaoGoodsBrief newGoods = goods;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief tb = null;
|
| | | if (goodsList.size() > 0) {
|
| | | tb = goodsList.get(0);
|
| | | }
|
| | | TaoBaoGoodsBrief tb = goods;
|
| | |
|
| | | if (tb == null) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | |
| | | tb.setImgList(new ArrayList<>());
|
| | | }
|
| | |
|
| | | tb.getImgList().add(0, tb.getPictUrl());
|
| | | // tb.getImgList().add(0, tb.getPictUrl());
|
| | |
|
| | | List<String> finalImgList = new ArrayList<>();
|
| | | for (String img : tb.getImgList()) {
|
| | | finalImgList.add(TbImgUtil.getTBSizeImg(img, 600));
|
| | | }
|
| | | |
| | | if (finalImgList.size() == 0) {
|
| | | finalImgList.add(tb.getPictUrl());
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
|
| | | finalImgList.add(0, tb.getPictUrlWhite());
|
| | |
|
| | | // 移除相同图片
|
| | | if (finalImgList.size() > 0)
|
| | | for (int i = 0; i < finalImgList.size(); i++) {
|
| | | if (i < finalImgList.size() - 1)
|
| | | if (TbImgUtil.getTBSizeImg(finalImgList.get(i), 600)
|
| | | .equalsIgnoreCase(TbImgUtil.getTBSizeImg(finalImgList.get(i + 1), 600))) {
|
| | | finalImgList.remove(i--);
|
| | | }
|
| | | }
|
| | |
|
| | | tb.setImgList(finalImgList);
|
| | |
|
| | | // 大淘客商品过滤
|
| | | try {
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralGetCacheManager integralGetCacheManager;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private BrandInfoService brandInfoService;
|
| | | |
| | |
|
| | | /**
|
| | | * 粘贴板信息推荐
|
| | |
| | | if (tb == null)// 淘宝是空值
|
| | | {
|
| | | String jdId = JDUtil.getJDGoodsId(text);
|
| | | |
| | |
|
| | | // 微信链接
|
| | | if (StringUtil.isNullOrEmpty(jdId)) {
|
| | | jdId = JDUtil.getJDGoodsIdByWeiXin(text);
|
| | | }
|
| | | |
| | |
|
| | | // 领券短连接
|
| | | if (StringUtil.isNullOrEmpty(jdId) && text.contains("u.jd.com")) {
|
| | | jdId = JDUtil.getJDGoodsIdByUJD(text);
|
| | | }
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | | JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
|
| | | if (goods != null) {
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | data.put("type", type);
|
| | | data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,
|
| | | new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()))));
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, new ConfigParamsDTO(fanLiRate,
|
| | | shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 3);
|
| | | data.put("goods", gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief,
|
| | | new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()))));
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief,
|
| | | new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return true;
|
| | | }
|
| | |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
|
| | |
| | | String version = acceptData.getVersion();
|
| | | if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_1(platform, version))
|
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) {
|
| | | BrandInfoVO brandInfoVO = brandInfoService.listByAlikeName(key);
|
| | | BrandInfoVO brandInfoVO = null;
|
| | | try {
|
| | | brandInfoVO = brandInfoService.listByAlikeName(key);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (brandInfoVO != null)
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(brandInfoVO));
|
| | | } else {
|
| | |
| | | && listShop.get(0).getListGoodsVO().size() > 2) {
|
| | | TaoBaoShopVO taoBaoShop = listShop.get(0);
|
| | | if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0(platform, version))
|
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_1(platform, version))) {
|
| | | || ("android".equalsIgnoreCase(platform)
|
| | | && VersionUtil.greaterThan_2_0_1(platform, version))) {
|
| | | BrandInfoVO brandInfoVO = new BrandInfoVO();
|
| | | brandInfoVO.setId(taoBaoShop.getId());
|
| | | brandInfoVO.setName(taoBaoShop.getShopName());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | |
| | | 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());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
|
| | | String content = String.format("【%s】%s元", goods.getUserType() == 1 ? "T猫价" : "T宝价",
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
|
| | | content += "\n\r";
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
|
| | | content += String.format("【券后价】%s元", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
|
| | | content += "\n\r";
|
| | | }
|
| | | content += "------------";
|
| | | content += "\n\r";
|
| | | content += "復制这条" + token + ",進入Tao宝即可购买";
|
| | | return content;
|
| | | public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) {
|
| | | return template.replace("[淘口令]", token);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
|
| | | ConfigParamsDTO dto = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
|
| | | shareInfo.setGoodsInfo(goodsInfo);
|
| | | }
|
| | |
| | | // 测试
|
| | | // 2.0.2之前
|
| | | if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setClickUrl(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | shareInfo.setWxErCode(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setWxErCode(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | // 提示图文内容
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | final TaoBaoLink taobaoLink = taoBaoLink;
|
| | | // 异步操作
|
| | |
| | | shareInfo.setCommentTexts(new ArrayList<>());
|
| | |
|
| | | if (needGoods)
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods, new ConfigParamsDTO(
|
| | | hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate())));
|
| | | shareInfo
|
| | | .setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate())));
|
| | |
|
| | | String shareText = "";
|
| | | boolean hasCoupon = false;
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | final JDGoods goods = jdGoods;
|
| | |
| | | shareInfo.setRule(configService.get("share_rule_link_pdd"));
|
| | | shareInfo.setPictUrl(goods.getGoodsImageUrl());
|
| | | if (needGoods) {
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, new ConfigParamsDTO(
|
| | | hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate())));
|
| | | shareInfo
|
| | | .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate())));
|
| | | }
|
| | |
|
| | | String template = "";
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
| | | List<UserInfoVO> query(@Param("start") long start, @Param("count") int count, @Param("userState") Integer userState,
|
| | | @Param("key") String key, @Param("keyType") Integer keyType, @Param("userRank") String userRank,
|
| | | @Param("days") Integer days, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode);
|
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode,@Param("userType") Integer userType);
|
| | |
|
| | | long queryCount(@Param("userState") Integer userState, @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("userRank") String userRank, @Param("days") Integer days, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime);
|
| | | @Param("endTime") String endTime,@Param("userType") Integer userType);
|
| | |
|
| | | /**
|
| | | * 统计当前查询结果总金额
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord; |
| | | |
| | | public interface UserOrderWeiQuanRecordMapper extends BaseMapper<UserOrderWeiQuanRecord> { |
| | | |
| | | /** |
| | | * 根据订单信息与用户ID检索 |
| | | * @param uid |
| | | * @param tradeId |
| | | * @param sourceType |
| | | * @return |
| | | */ |
| | | public UserOrderWeiQuanRecord selectByOrderInfoAndUid(@Param("uid") Long uid,@Param("tradeId") String tradeId,@Param("sourceType") int sourceType); |
| | | |
| | | } |
| | |
| | |
|
| | | import com.yeshi.fanli.dto.mq.user.body.IntegralTaskMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InterTokenMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InviteCodeActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserAccountBindingMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInviteMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserRedPackGiftMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserRegisterMQMsg;
|
| | |
| | | userRegister(UserRegisterMQMsg.class),//注册
|
| | | tokenOutOfDate(InterTokenMQMsg.class),//口令过期
|
| | | redPackGiftDrawback(UserRedPackGiftMQMsg.class),// 红包赠送退回
|
| | | userInfoUpdate(null); //用户信息修改
|
| | | inviteCodeActive(InviteCodeActiveMQMsg.class),//邀请码激活
|
| | | userInfoUpdate(UserInfoUpdateMQMsg.class); //用户信息修改
|
| | |
|
| | | private final Class<?> clazz;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dto.mq.user.body;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.dto.mq.BaseMQMsgBody;
|
| | |
|
| | | /**
|
| | | * 用户信息修改
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class InviteCodeActiveMQMsg extends BaseMQMsgBody {
|
| | | private Long uid;// 用户ID
|
| | | private Date createTime;// 时间
|
| | |
|
| | | public InviteCodeActiveMQMsg(Long uid, Date createTime) {
|
| | | this.uid = uid;
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public InviteCodeActiveMQMsg() {
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private Long uid;// 用户ID
|
| | | private UserInfoUpdateTypeEnum type;// 类型
|
| | | private String value;// 值
|
| | | private Date createTime;//时间
|
| | | private Date createTime;// 时间
|
| | |
|
| | | public UserInfoUpdateMQMsg(Long uid, UserInfoUpdateTypeEnum type, String value, Date createTime) {
|
| | | super();
|
| | | this.uid = uid;
|
| | | this.type = type;
|
| | | this.value = value;
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public UserInfoUpdateMQMsg() {
|
| | | super();
|
| | |
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | |
| | | private Date createTime;
|
| | | @Column(name = "eo_update_time")
|
| | | private Date updateTime;
|
| | | @Column(name = "eo_state")
|
| | | private Integer state;//0-失效 1-有效
|
| | |
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | private Long uid;
|
| | | private BigDecimal hongbao;
|
| | | private Integer hbState;
|
| | |
| | | */
|
| | | public void saveJDOrders(List<JDOrder> jdOrderList) {
|
| | | for (JDOrder order : jdOrderList) {
|
| | | LogHelper.orderInfo("京东订单:" + order.getOrderId()+"-"+order.getValidCode());
|
| | | LogHelper.orderInfo("京东订单:" + order.getOrderId() + "-" + order.getValidCode());
|
| | | if (order.getValidCode() == 15)// 过滤掉待付款
|
| | | continue;
|
| | |
|
| | | //防止多个商品拆单问题,爬取
|
| | | if (order.getOrderItemList().size() > 1
|
| | | && order.getOrderTime() > System.currentTimeMillis() - 1000 * 60 * 2L) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | try {
|
| | | jdOrderService.addJDOrder(order);
|
| | | /**
|
| | |
| | | */
|
| | | String key = "jd-order-" + order.getOrderId();
|
| | | String result = redisManager.getCommonString(key);
|
| | | // 判断
|
| | |
|
| | | JDOrderCMQManager.getInstance().addJDOrder(order.getOrderId() + "");
|
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 2小时内不再更新
|
| | |
| | | public void updateSoonOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.job("开始爬取京东订单"); |
| | | LogHelper.job("开始爬取京东订单");
|
| | | long now = System.currentTimeMillis();
|
| | |
|
| | | JDOrderResult result = JDApiUtil.getOrderList(1, 200, new Date(now), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | |
| | | where wx_union_id=#{unionId} AND state = 0
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="getEffectiveUserInfoByWXOpenId" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | |
| | | where wx_open_id=#{wxOpenId} AND state = 0
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getMaxUid" resultType="java.lang.Long">select max(id) from
|
| | | yeshi_ec_user
|
| | | </select>
|
| | |
| | | <if test="userState == 2">
|
| | | AND u.`state` =2 <!-- 封禁用户 -->
|
| | | </if>
|
| | |
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | |
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | | DATE_FORMAT(#{startTime},'%Y%m%d')
|
| | |
| | | </if>
|
| | | <if test="userState == 2">
|
| | | AND u.`state` =2 <!-- 封禁用户 -->
|
| | | </if>
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | |
| | | </select>
|
| | |
|
| | | <select id="getUserInfoByInviteCode" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` = u.`id`
|
| | | WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR uf.`uie_invite_code` = #{inviteCode}
|
| | | SELECT * FROM
|
| | | yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =
|
| | | u.`id`
|
| | | WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR
|
| | | uf.`uie_invite_code` = #{inviteCode}
|
| | | LIMIT 1
|
| | | </select>
|
| | |
|
| | |
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getAutoExtractUserTo1212" resultMap="BaseResultMap">
|
| | | SELECT u.* FROM (SELECT v2.`hb_uid` FROM `yeshi_ec_hongbao_v2` v2
|
| | | WHERE <![CDATA[v2.`hb_create_time` > '2019-01-01' AND v2.`hb_create_time` < '2019-06-18']]>
|
| | | GROUP BY hb_uid)h
|
| | | LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid` = h.hb_uid
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
|
| | | WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]> AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '') |
| | | AND u.`state` = 0 AND u.`my_hongBao`<![CDATA[> 1]]>
|
| | | AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid`
|
| | | = h.hb_uid
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
|
| | | WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]>
|
| | | AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
|
| | | AND u.`state` = 0 AND u.`my_hongBao`<![CDATA[> 1]]>
|
| | | AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
| | | WHERE sp.`b_state` = 0
|
| | | AND IF(sp.b_start_time IS NULL,TRUE, sp.b_start_time<![CDATA[<=]]> NOW())
|
| | | AND IF(sp.b_end_time IS NULL,TRUE, sp.b_end_time <![CDATA[>=]]> NOW())
|
| | | <if test="platform == 1 and versionCode!=null">
|
| | | |
| | | <if test="platform!=null and platform == 1 and versionCode!=null">
|
| | | AND IF(sp.`b_min_android_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_android_version_code,TRUE)
|
| | | </if>
|
| | | <if test="platform == 2 and versionCode!=null">
|
| | | <if test="platform!=null and platform == 2 and versionCode!=null">
|
| | | AND IF(sp.`b_min_ios_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_ios_version_code,TRUE)
|
| | | </if>
|
| | | <include refid="Sex_Screen" />
|
| | |
| | | <!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.UserOrderWeiQuanRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord"> |
| | | <id column="wr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="wr_source_type" property="sourceType" jdbcType="INTEGER"/> |
| | | <result column="wr_trade_id" property="tradeId" jdbcType="VARCHAR"/> |
| | | <result column="wr_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="wr_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="wr_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="wr_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="wr_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">wr_id,wr_source_type,wr_trade_id,wr_uid,wr_money,wr_state,wr_create_time,wr_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_order_weiquan_record where wr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_order_weiquan_record where wr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_order_weiquan_record (wr_id,wr_source_type,wr_trade_id,wr_uid,wr_money,wr_state,wr_create_time,wr_update_time) values (#{id,jdbcType=BIGINT},#{sourceType,jdbcType=INTEGER},#{tradeId,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_order_weiquan_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">wr_id,</if> |
| | | <if test="sourceType != null">wr_source_type,</if> |
| | | <if test="tradeId != null">wr_trade_id,</if> |
| | | <if test="uid != null">wr_uid,</if> |
| | | <if test="money != null">wr_money,</if> |
| | | <if test="state != null">wr_state,</if> |
| | | <if test="createTime != null">wr_create_time,</if> |
| | | <if test="updateTime != null">wr_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord">update yeshi_ec_user_order_weiquan_record set wr_source_type = #{sourceType,jdbcType=INTEGER},wr_trade_id = #{tradeId,jdbcType=VARCHAR},wr_uid = #{uid,jdbcType=BIGINT},wr_money = #{money,jdbcType=DECIMAL},wr_state = #{state,jdbcType=INTEGER},wr_create_time = #{createTime,jdbcType=TIMESTAMP},wr_update_time = #{updateTime,jdbcType=TIMESTAMP} where wr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord">update yeshi_ec_user_order_weiquan_record |
| | | <set> |
| | | <if test="sourceType != null">wr_source_type=#{sourceType,jdbcType=INTEGER},</if> |
| | | <if test="tradeId != null">wr_trade_id=#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">wr_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">wr_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">wr_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">wr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">wr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where wr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord"> |
| | | <id column="wr_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="wr_source_type" property="sourceType" jdbcType="INTEGER" /> |
| | | <result column="wr_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="wr_uid" property="uid" jdbcType="BIGINT" /> |
| | | <result column="wr_money" property="money" jdbcType="DECIMAL" /> |
| | | <result column="wr_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="wr_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="wr_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">wr_id,wr_source_type,wr_trade_id,wr_uid,wr_money,wr_state,wr_create_time,wr_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user_order_weiquan_record where wr_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByOrderInfoAndUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user_order_weiquan_record where wr_trade_id =#{tradeId} |
| | | and wr_source_type=#{sourceType} and wr_uid=#{uid} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_user_order_weiquan_record where wr_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_user_order_weiquan_record |
| | | (wr_id,wr_source_type,wr_trade_id,wr_uid,wr_money,wr_state,wr_create_time,wr_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{sourceType,jdbcType=INTEGER},#{tradeId,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_user_order_weiquan_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">wr_id,</if> |
| | | <if test="sourceType != null">wr_source_type,</if> |
| | | <if test="tradeId != null">wr_trade_id,</if> |
| | | <if test="uid != null">wr_uid,</if> |
| | | <if test="money != null">wr_money,</if> |
| | | <if test="state != null">wr_state,</if> |
| | | <if test="createTime != null">wr_create_time,</if> |
| | | <if test="updateTime != null">wr_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord">update |
| | | yeshi_ec_user_order_weiquan_record set wr_source_type = |
| | | #{sourceType,jdbcType=INTEGER},wr_trade_id = |
| | | #{tradeId,jdbcType=VARCHAR},wr_uid = #{uid,jdbcType=BIGINT},wr_money = |
| | | #{money,jdbcType=DECIMAL},wr_state = |
| | | #{state,jdbcType=INTEGER},wr_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},wr_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where wr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord"> |
| | | update yeshi_ec_user_order_weiquan_record |
| | | <set> |
| | | <if test="sourceType != null">wr_source_type=#{sourceType,jdbcType=INTEGER},</if> |
| | | <if test="tradeId != null">wr_trade_id=#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">wr_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">wr_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">wr_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">wr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">wr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where wr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | return activityUserMapper.selectList();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,
|
| | | RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
|
| | | int px, int py, int erCodeSize) throws ActivityException, Exception {
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
|
| | | RecommendActivity activity) throws ActivityException, Exception {
|
| | |
| | | return recommendActivityMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid,
|
| | | List<Long> goodsList, RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
|
| | | int px, int py, int erCodeSize) throws ActivityException , Exception{
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
|
| | | RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | return recommendActivityMapper.getRecommendActivityEffectiveCount();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void upgradeShareGoodsRecommendActivity(Long id) throws ActivityException {
|
| | | // 获取商品
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public String saveShopInfo(Long cid, List<Long> list) throws BrandClassShopException {
|
| | | if (list == null || list.size() == 0) {
|
| | | throw new BrandClassShopException(1, "请选择店铺");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,
|
| | | String key) throws BrandClassShopException {
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveAdd(SystemClientParams scp, List<Long> listId) throws Exception {
|
| | |
|
| | |
| | | @Resource
|
| | | private ElmeHongBaoOrderMapMapper elmeHongBaoOrderMapMapper;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addHongBaoOrderMap(ElmeHongBaoOrderMap map) throws ElmeHongBaoOrderMapException {
|
| | | if (map.getElmeOrder() == null || map.getElmeOrder().getId() == null || map.getHongBao() == null
|
| | |
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void processOrder(ElmeOrder elmeOrder) throws ElmeOrderException {
|
| | | try {
|
| | |
| | | new BigDecimal(100)));
|
| | | if (elmeOrder.getIsSettle() == true)
|
| | | hongBao.setPreGetTime(new Date(elmeOrder.getOrderDate().getTime() + 1000 * 60 * 60 * 24 * 15L));
|
| | | if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0)
|
| | | if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0||(elmeOrder.getState()!=null&&elmeOrder.getState()==0))
|
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | else {
|
| | | if (elmeOrder.getIsSettle() == true) {
|
| | |
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addCollection(Long uid, TaoBaoGoodsBrief goods) throws CollectionGoodsException {
|
| | | if (uid == null || uid == 0)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addJDCollection(Long uid, JDGoods jdGoods) throws CollectionGoodsException {
|
| | | if (uid == null || uid == 0)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addPDDCollection(Long uid, PDDGoodsDetail goods) throws CollectionGoodsException {
|
| | | if (uid == null || uid == 0)
|
| | |
| | | collectionGoodsV2Mapper.insertSelective(goods);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void cancelCollection(Long uid, Long id) throws CollectionGoodsException {
|
| | | if (uid == null || uid == 0)
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception {
|
| | |
|
| | | String name = record.getName();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateOrder(Long id, Integer moveType) throws GoodsClassException {
|
| | |
|
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByRootId(Long id) throws Exception {
|
| | |
|
| | | List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null, null);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByPrimaryKeyBatch(List<String> recordIds) throws Exception {
|
| | | if (recordIds != null && recordIds.size() > 0) {
|
| | | for (String recordId : recordIds) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteSub(Long recordId) throws Exception {
|
| | | GoodsSubClass goodsSubClass = goodsSubClassMapper.selectByPrimaryKey(recordId);
|
| | |
|
| | |
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addRecommend(Long uid, String device, String recommendDesc, List<CommonGoods> goodsList)
|
| | | throws RecommendUserGoodsException {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveCouponTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | // 格式验证
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveCouponTemplateJD(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | // 格式验证
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveCouponTemplatePDD(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | // 格式验证
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveTaoLiJinTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteInfoBatchById(List<String> idList) throws HelpCenterException {
|
| | | if (idList != null) {
|
| | | for (String id : idList) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateOrder(Long id, Integer moveType) throws FloatADException {
|
| | |
|
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
|
| | |
|
| | | List<FloatAD> listSwiper = floatADMapper.ListByPrimaryKey(list);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws Exception{
|
| | | specialService.deleteBatchByCardID(list);
|
| | | return specialCardMapper.deleteBatchByPrimaryKey(list);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
|
| | | return specialPlaceMapper.deleteByPrimaryKeyList(list);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateOrder(Long id, Integer moveType, Integer sex) throws SpecialException {
|
| | |
|
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1)) || sex == null) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws Exception {
|
| | | List<Special> listSpecial = specialMapper.queryByListPrimaryKey(list);
|
| | | for (Special special : listSpecial) {
|
| | |
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | }
|
| | | |
| | | if (listSpecial != null)
|
| | | for (Special special : listSpecial) {
|
| | | List<AdActivityVersionControl> versionList = adActivityVersionControlService
|
| | | .listByTypeAndSourceId(AdActivityType.special, special.getId());
|
| | | if (versionList != null)
|
| | | for (AdActivityVersionControl control : versionList)
|
| | | adActivityVersionControlService.deleteByPrimaryKey(control.getId());
|
| | | }
|
| | | return specialMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByVersion-'+#start+'-'+#count+'-'+#card+'-'+#platform+'-'+#versionCode")
|
| | | public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByVersion(start, count, card, platform, versionCode);
|
| | | public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode) {
|
| | | List<Special> specialList = specialMapper.listByPlaceKey(card, null, null, null);
|
| | | filterSpecial(specialList, platform, versionCode);
|
| | | return specialList;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws Exception {
|
| | |
|
| | | List<Long> listPicID = new ArrayList<Long>();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws SwiperPictureException {
|
| | |
|
| | | List<SwiperPicture> listSwiper = swiperPictureMapper.queryByListPrimaryKey(list);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (listSwiper != null)
|
| | | for (SwiperPicture picture : listSwiper) {
|
| | | List<AdActivityVersionControl> versionList = adActivityVersionControlService
|
| | | .listByTypeAndSourceId(AdActivityType.banner, picture.getId());
|
| | | if (versionList != null)
|
| | | for (AdActivityVersionControl control : versionList)
|
| | | adActivityVersionControlService.deleteByPrimaryKey(control.getId());
|
| | | }
|
| | | return swiperPictureMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | |
| | | public List<SwiperPicture> getByBannerCardAndVersion(String card, String platform, int version) {
|
| | | List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
|
| | | filterSwipePicture(list, platform, version);
|
| | | for (SwiperPicture picture : list) {
|
| | | if (picture.isJumpNeedLogin() && picture.getJumpDetail() != null) {
|
| | | picture.getJumpDetail().setNeedLogin(true);
|
| | | }
|
| | | }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Cacheable(value = "jdSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public List<JDGoods> specialSearch(Integer page, Long cid) throws JDGoodsException {
|
| | | if (cid == null) {
|
| | | throw new JDGoodsException(1, "分类id为空");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByPrimaryKey(Long id) throws BoutiqueAutoRuleException {
|
| | | boutiqueAutoRuleMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteBatchByPrimaryKey(List<Long> ids) throws BoutiqueAutoRuleException {
|
| | | for (Long id : ids) {
|
| | | boutiqueAutoRuleMapper.deleteByPrimaryKey(id);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addBatchClass(GoodsClass goodsClass,List<Long> labIdList) throws Exception {
|
| | |
|
| | | long recordId = goodsClass.getId();
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addBatchSubClass(GoodsSubClass goodsSubClass,List<Long> labIdList) throws Exception {
|
| | |
|
| | | long recordId = goodsSubClass.getId();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchById(long[] ids) throws LabelGoodsException{
|
| | | return labelGoodsMapper.deleteBatchByPrimaryKey(ids);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByGoodsId(List<String> ids) throws LabelGoodsException {
|
| | |
|
| | | if (ids != null && ids.size() > 0) {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addBatchByLabId(TaoBaoGoodsBrief taoBaoGoodsBrief, List<String> labIdList, AdminUser admin) throws Exception {
|
| | |
|
| | | List<LabelGoods> addList = new ArrayList<LabelGoods>();
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void batchGoodsAddLables(List<Long> goodsIdList, List<Long> labIdList, AdminUser admin) throws Exception {
|
| | |
|
| | | /* 商品id 为空 不处理 */
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void singleGoodsAddLables(Long goodsId, List<Long> labIdList, AdminUser admin) throws Exception {
|
| | |
|
| | | /* 商品id 为空 不处理 */
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void insertList(List<Label> records,AdminUser admin) throws LabelException{
|
| | | if (records != null && records.size() > 0) {
|
| | | for (Label label : records) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateList(List<Label> records) throws LabelException{
|
| | | if (records != null && records.size() > 0) {
|
| | | for (Label label : records) {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchById(long[] ids) throws LabelException{
|
| | | return labelMapper.deleteBatchByPrimaryKey(ids);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteBatchByPrimaryKey(List<Long> ids) throws LabelException {
|
| | | for (Long id : ids) {
|
| | | Label label = labelMapper.selectByPrimaryKey(id);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByGoodsId(List<String> ids) throws QualityFactoryException {
|
| | |
|
| | | if (ids != null && ids.size() > 0) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addBatchTaoBaoGoods(List<TaoBaoGoodsBrief> listTaoBaoGoods, String lableNames, AdminUser admin)
|
| | | throws Exception {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void setWeightBatch(List<Long> idList, AdminUser admin, Integer weight, Integer weightSmall,
|
| | | Integer weightLarge) throws Exception {
|
| | |
|
| | |
| | | @Resource
|
| | | private InviteOrderSubsidyDebtRepayHistoryMapper inviteOrderSubsidyDebtRepayHistoryMapper;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addDebt(InviteOrderSubsidyDebt debt) throws InviteOrderSubsidyDebtException {
|
| | | if (debt == null || debt.getOriginMoney() == null || debt.getOriginMoney() == null || debt.getUid() == null) {
|
| | |
| | | inviteOrderSubsidyDebtMapper.insertSelective(debt);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void repayDebt(Long debtId, BigDecimal money) throws InviteOrderSubsidyDebtException {
|
| | | InviteOrderSubsidyDebt debt = inviteOrderSubsidyDebtMapper.selectByPrimaryKeyForUpdate(debtId);
|
| | |
| | | inviteOrderSubsidyDebtRepayHistoryMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public BigDecimal repayDebtByUid(Long uid, BigDecimal money) throws InviteOrderSubsidyDebtException {
|
| | | // 还钱
|
| | |
| | | return userMoneyDebtMapper.selectByTypeAndSourceId(type, sourceId);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void repayDebt(UserMoneyDebt debt, BigDecimal money) throws UserMoneyDebtException {
|
| | | if (debt == null || debt.getId() == null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void repayDebt(Long uid) {
|
| | | // 查询是否有欠债
|
| | |
| | | return bindingAccountMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void validAlipayAccount(Long uid, String account, String name)
|
| | | throws AlipayTransferException, AlipayApiException, AlipayAccountException {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public BindingAccount changeAlipayBindingWithVerify(Long uid, String name, String account)
|
| | | throws AlipayTransferException, AlipayApiException, AlipayAccountException {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public synchronized void rejectExtract(long id, String reason, AdminUser admin)
|
| | | throws ObjectStateException, NotExistObjectException {
|
| | | Extract find = extractMapper.selectByPrimaryKey(id);
|
| | |
| | | return extractMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void checkExtract(Long uid) throws ExtractException {
|
| | | BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid);
|
| | |
| | | taoBaoWeiQuanDrawBack.getUser().getId());
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void addDebt(Long uid, Long hbId, BigDecimal money) throws UserMoneyDebtException {
|
| | | UserMoneyDebt debt = new UserMoneyDebt();
|
| | | debt.setBeiZhu(null);
|
| | |
| | | return money;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void doWeiQuanFanli(String orderId) throws TaoBaoWeiQuanException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | return mainHongBaoList;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void doWeiQuanShare(String orderId) throws TaoBaoWeiQuanException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void doWeiQuanInvite(String orderId) throws TaoBaoWeiQuanException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | @Resource
|
| | | private SystemZnxService systemZnxService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag,
|
| | | SystemZnx sz) throws UserSystemMsgException {
|
| | |
| | | return commonOrderMapper.listBySourceTypeAndOrderNo(sourceType, orderId);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrders, Long uid)
|
| | | throws CommonOrderException {
|
| | |
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid)
|
| | | throws CommonOrderException {
|
| | |
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
|
| | |
| | | *
|
| | | * @param commonOrder
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private CommonOrderAddResultDTO addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
|
| | | // 判断商品是否存在
|
| | | if (commonOrder == null)
|
| | |
| | | return hongBaoV2Mapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public int addHongBao(List<CommonOrder> commonOrderList, int type) throws HongBaoException, UserAccountException {
|
| | | Set<Integer> stateSet = new HashSet<>();// 订单状态Set
|
| | |
| | | return CommonOrder.STATE_SX;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
|
| | | Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException {
|
| | | System.out.println(commonOrder.getOrderNo());
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap)
|
| | | throws HongBaoException, UserAccountException {
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | |
| | | return inviteOrderSubsidyMapper.getByOrderNoAndTypeForUpdate(uid, orderNo, type);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void addOrderSubsidy(InviteOrderSubsidy orderSubsidy) throws InviteOrderSubsidyException {
|
| | | if (orderSubsidy.getMoney() == null || StringUtil.isNullOrEmpty(orderSubsidy.getOrderNo())
|
| | | || orderSubsidy.getSourceType() == null || orderSubsidy.getUid() == null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addOrUpdateByOrder(String orderId, int sourceType) throws InviteOrderSubsidyException {
|
| | | List<HongBaoOrder> list = hongBaoOrderService.listByOrderIdAndSourceType(orderId, sourceType);
|
| | |
| | | @Resource
|
| | | private HongBaoV2SettleTempService hongBaoV2SettleTempService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void inviteSettleTB(Long uid) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | |
| | | System.out.println(new Gson().toJson(mqMsg));
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void inviteSettleJD(Long uid) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void inviteSettlePDD(Long uid) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void shareSettleTB(Long uid) throws OrderMoneySettleException {
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void shareSettleJD(Long uid) throws OrderMoneySettleException {
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void shareSettlePDD(Long uid) throws OrderMoneySettleException {
|
| | | /**
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void ziGouSettle(String orderId, int sourceType, String taskKey) throws OrderMoneySettleException {
|
| | | // 查询同一订单号的红包
|
| | |
| | | * @param orderId
|
| | | * @param sourceType
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void inviteSubsidySettle(Long uid, String taskKey) throws OrderMoneySettleException {
|
| | | // 查询key
|
| | |
| | | elmeOrder.setIsSettle(true);
|
| | | else
|
| | | elmeOrder.setIsSettle(false);
|
| | |
|
| | | if (!taoBaoOrder.getOrderState().equalsIgnoreCase("订单失效"))
|
| | | elmeOrder.setState(1);
|
| | | else {
|
| | | elmeOrder.setState(0);
|
| | | elmeOrder.setPayMoney(new BigDecimal(0));
|
| | | }
|
| | | elmeOrder.setTrackPid(
|
| | | String.format("mm_124933865_%s_%s", taoBaoOrder.getSourceMediaId(), taoBaoOrder.getAdPositionId()));
|
| | | if (!StringUtil.isNullOrEmpty(taoBaoOrder.getRelationId())) {
|
| | |
| | | } catch (ElmeOrderException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | private HongBaoOrderMapper hongBaoOrderMapper;
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void fanli(HongBaoV2 hb1) throws TaoBaoWeiQuanException {
|
| | | // 查询最新的红包数据
|
| | | hb1 = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hb1.getId());
|
| | |
| | | @Resource
|
| | | private ElmeOrderService elmeOrderService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private ElmeOrderProcessService elmeOrderProcessService;
|
| | |
|
| | | /**
|
| | | * 获取饿了么可以返利的红包
|
| | | *
|
| | |
| | | @Resource
|
| | | private ExtractCheckCompensateMapper extractCheckCompensateMapper;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void repairOrder(String orderId) throws Exception {
|
| | | // 比较CommonOrder与TaoBaoOrder的预估收益
|
| | |
| | | }
|
| | |
|
| | | // 修改订单信息
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void updateOrderInfo(TaoBaoOrder taoBaoOrder, Long commonOrderId) throws Exception {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderService.selectDetailByCommonOrderId(commonOrderId);
|
| | | CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addOrder(CommonOrder commonOrder, int type, Long firstUid, Long secondUid) throws Exception {
|
| | | // 增加commonOrder
|
| | | commonOrder.setCreateTime(commonOrder.getThirdCreateTime());
|
| | |
| | | return orderInfoMap.get(orderId);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void repireFirstAndSecondLevel(String orderId) throws Exception {
|
| | | repireFirstShare(orderId);
|
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.math.RoundingMode;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.UserOrderWeiQuanRecordMapper;
|
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.service.inter.money.tb.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.UserOrderWeiQuanRecordService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | | public class UserOrderWeiQuanRecordServiceImpl implements UserOrderWeiQuanRecordService {
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserOrderWeiQuanRecordMapper userOrderWeiQuanRecordMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanDrawBackService taoBaoWeiQuanDrawBackService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Override
|
| | | public void syncPrevious() {
|
| | | BigDecimal zero = new BigDecimal(0);
|
| | | for (int page = 1; page < Integer.MAX_VALUE; page++) {
|
| | | List<TaoBaoWeiQuanOrder> list = taoBaoWeiQuanOrderService.listByBeginWeiQuan(page, 100);
|
| | | if (list == null || list.isEmpty()) |
| | | if (list == null || list.isEmpty())
|
| | | break;
|
| | | |
| | | for (TaoBaoWeiQuanOrder weiQuanOrder: list) {
|
| | |
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : list) {
|
| | | String orderItemId = weiQuanOrder.getOrderItemId();
|
| | | |
| | |
|
| | | List<HongBaoDTO> listV2 = hongBaoV2Service.listByOrderTradeId(orderItemId);
|
| | | for (HongBaoDTO hongBaoV2: listV2) {
|
| | | for (HongBaoDTO hongBaoV2 : listV2) {
|
| | | Long uid = hongBaoV2.getUserInfo().getId();
|
| | | TaoBaoWeiQuanDrawBack drawBack= taoBaoWeiQuanDrawBackService.selectByOrderItemIdAndUid(orderItemId, uid);
|
| | | |
| | | TaoBaoWeiQuanDrawBack drawBack = taoBaoWeiQuanDrawBackService.selectByOrderItemIdAndUid(orderItemId,
|
| | | uid);
|
| | |
|
| | | int state = 0;
|
| | | BigDecimal money = null;
|
| | | if (drawBack != null) {
|
| | |
| | | money = drawBackMoney;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (money == null) {
|
| | | // (维权金额/结算金额) * 返利金额 |
| | | // (维权金额/结算金额) * 返利金额
|
| | | BigDecimal wqmoney = weiQuanOrder.getMoney();
|
| | | money = wqmoney.multiply(hongBaoV2.getMoney())
|
| | | .divide(hongBaoV2.getSettlement(), 2, BigDecimal.ROUND_DOWN);
|
| | | |
| | | // 大于返利金额 则等于返利金额
|
| | | money = wqmoney.multiply(hongBaoV2.getMoney()).divide(hongBaoV2.getSettlement(), 2,
|
| | | BigDecimal.ROUND_UP);
|
| | |
|
| | | // 大于返利金额 则等于返利金额
|
| | | if (money.compareTo(hongBaoV2.getMoney()) > 0)
|
| | | money = hongBaoV2.getMoney();
|
| | | }
|
| | | |
| | |
|
| | | UserOrderWeiQuanRecord weiQuanRecord = new UserOrderWeiQuanRecord();
|
| | | weiQuanRecord.setUid(uid);
|
| | | weiQuanRecord.setSourceType(1); // 淘宝
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addTaoBaoWeiQuan(TaoBaoWeiQuanOrder order) {
|
| | | if (!order.getState().contains("维权成功"))
|
| | | return;
|
| | | // 查询是否存在红包
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getOrderItemId());
|
| | | if (commonOrder == null)
|
| | | return;
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderService.selectDetailByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder == null || hongBaoOrder.getHongBaoV2() == null)
|
| | | return;
|
| | |
|
| | | BigDecimal settleMoney = hongBaoOrder.getCommonOrder().getSettlement();
|
| | | HongBaoV2 mainHongBao = hongBaoOrder.getHongBaoV2();
|
| | | UserOrderWeiQuanRecord ur = userOrderWeiQuanRecordMapper.selectByOrderInfoAndUid(
|
| | | mainHongBao.getUserInfo().getId(), order.getOrderItemId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (ur == null) {
|
| | | UserOrderWeiQuanRecord record = new UserOrderWeiQuanRecord();
|
| | | record.setCreateTime(new Date());
|
| | | record.setMoney(hongBaoOrder.getHongBaoV2().getMoney().multiply(order.getMoney()).divide(settleMoney, 2,
|
| | | RoundingMode.UP));
|
| | | record.setSourceType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | record.setState(0);
|
| | | record.setTradeId(order.getOrderItemId());
|
| | | record.setUid(hongBaoOrder.getHongBaoV2().getUserInfo().getId());
|
| | |
|
| | | if (record.getMoney().compareTo(hongBaoOrder.getHongBaoV2().getMoney()) > 0)
|
| | | record.setMoney(hongBaoOrder.getHongBaoV2().getMoney());
|
| | |
|
| | | userOrderWeiQuanRecordMapper.insertSelective(record);
|
| | | }
|
| | | List<HongBaoV2> children = hongBaoV2Service.listChildrenById(mainHongBao.getId());
|
| | | for (HongBaoV2 v2 : children) {
|
| | | UserOrderWeiQuanRecord record = userOrderWeiQuanRecordMapper.selectByOrderInfoAndUid(
|
| | | v2.getUserInfo().getId(), order.getOrderItemId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (record == null) {
|
| | | record = new UserOrderWeiQuanRecord();
|
| | | record.setCreateTime(new Date());
|
| | | record.setMoney(v2.getMoney().multiply(order.getMoney()).divide(settleMoney, 2, RoundingMode.UP));
|
| | | record.setSourceType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | record.setState(0);
|
| | | record.setTradeId(order.getOrderItemId());
|
| | | record.setUid(v2.getUserInfo().getId());
|
| | |
|
| | | if (record.getMoney().compareTo(v2.getMoney()) > 0)
|
| | | record.setMoney(v2.getMoney());
|
| | |
|
| | | userOrderWeiQuanRecordMapper.insertSelective(record);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Resource
|
| | | private JDOrderMapper jdOrderMapper;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addJDOrder(JDOrder order) throws JDOrderException {
|
| | | if (order == null)
|
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.UserOrderWeiQuanRecordService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserOrderWeiQuanRecordService userOrderWeiQuanRecordService;
|
| | |
|
| | | @Override
|
| | | public void addWeiQuanOrder(TaoBaoWeiQuanOrder order) {
|
| | |
| | | updateCommonOrder.setState(CommonOrder.STATE_WQ);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | userOrderWeiQuanRecordService.addTaoBaoWeiQuan(taoBaoWeiQuanOrder);
|
| | | }
|
| | |
|
| | | List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId());
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Cacheable(value = "pddSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
|
| | | public List<PDDGoodsDetail> specialSearch(Integer page, Long cid) throws PDDOrderException {
|
| | | if (cid == null) {
|
| | |
| | | *
|
| | | * @param json
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addPushIOSQueue(MessageInfo info, String url, int type, String versionCodes) throws PushException {
|
| | |
|
| | | if (Constant.IS_TEST)
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void save(PushCoupon record) throws PushCouponException,Exception {
|
| | | if (record == null) {
|
| | | throw new PushCouponException(1, "参数不正确");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void executePush(Long id) throws Exception, PushCouponException, PushException {
|
| | |
|
| | | PushCoupon pushCoupon = selectByPrimaryKey(id);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void save(PushGoods record, List<Long> goodsIds) throws PushGoodsException, Exception {
|
| | |
|
| | | // 定时时间
|
| | |
| | | saveGoodsInfo(isAdd, pushId, goodsIds);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void saveGoodsInfo(boolean isAdd, Long pushId, List<Long> goodsIds) throws Exception {
|
| | |
|
| | | if (goodsIds == null || goodsIds.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws Exception {
|
| | |
|
| | | /*List<PushGoods> lisState = pushGoodsMapper.listByPushState(list);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void executePush(PushInfo record) throws Exception, PushInfoException, PushException {
|
| | |
|
| | | if (PushInfo.STATE_SUCCESS == record.getState()) {
|
| | |
| | | * @param orderNo
|
| | | * @param bossId
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void twoStageRewardToBoss(Long bossId, Long teamUid, Date oneStageTime, Integer source, String orderNo)
|
| | | throws Exception {
|
| | | // 第一阶段完成之后的90天内 ; 队友产生的订单中(自购+分享),邀请人累计产生≥1 元奖金
|
| | |
| | | * @param orderNo
|
| | | * @param bossId
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private void threeStageRewardToBoss(Long bossId, Long teamUid, Date twoStageTime, Integer source, String orderNo)
|
| | | throws Exception {
|
| | | // 二、三阶段不可同月
|
| | |
| | | return banLiShopGoodsSetsPayMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addSetPay(BanLiShopGoodsSetsPay pay) throws BanLiShopGoodsSetPayException {
|
| | | if (pay.getId() == null)// 新增
|
| | |
| | | return banLiShopGoodsSetsMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addSet(BanLiShopGoodsSets set) throws BanLiShopGoodsSetException, BanLiShopGoodsSetPayException {
|
| | | if (set.getId() == null)// 添加
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | private void paySuccess(BanLiShopOrder order) {
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void refund(Long orderId) throws BanLiShopOrderException {
|
| | | // 订单退款
|
| | |
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException {
|
| | | // 查询必要的参数是否添加
|
| | |
| | | banLiShopOrderMapper.updateByPrimaryKeySelective(order);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
|
| | | BanLiShopOrder order = banLiShopOrderMapper.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | @Resource
|
| | | private TaoBaoBuyRelationMapMapper taoBaoBuyRelationMapMapper;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public String getRelationId(Long uid) throws TaoBaoBuyRelationMapException {
|
| | | TaoBaoBuyRelationMap relationMap = taoBaoBuyRelationMapMapper.selectByUid(uid);
|
| | |
| | | shareHotGoodsService.deleteByGoodsId(auctionId);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) throws TaobaoGoodsUpdateException {
|
| | | if (goods == null)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private String createTaoLiJin(Long auctionId, BigDecimal perface, int totalNum, String pid) throws UserTaoLiJinNewbiesException {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | |
| | | return userTaoLiJinRecordMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public UserTaoLiJinRecord createSelfBuyTaoLiJin(Long uid, BigDecimal couplePrice, TaoBaoGoodsBrief goods)
|
| | | throws UserTaoLiJinRecordException {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public UserTaoLiJinRecord createShareTaoLiJin(Long uid, int totalNum, TaoBaoGoodsBrief goods)
|
| | | throws UserTaoLiJinRecordException {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum,
|
| | | String name, Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, String pid)
|
| | | throws UserTaoLiJinRecordException {
|
| | |
| | | String rootPath=Thread.currentThread().getContextClassLoader().getResource("").getPath();
|
| | | rootPath = rootPath.substring(1,rootPath.indexOf("WEB-INF"));
|
| | | return rootPath;
|
| | | }
|
| | | |
| | | } |
| | | }
|
| | |
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
|
| | | String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, int loginType) throws UserAccountException {
|
| | |
| | | connectUsers(mainUser, lessUser);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void connectUsers(UserInfo mainUser, UserInfo lessUser) throws UserAccountException {
|
| | | mainUser = userInfoMapper.selectByPrimaryKeyForUpdate(mainUser.getId());
|
| | |
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void register(UserInfo userInfo) throws UserAccountException {
|
| | | if (!StringUtil.isNullOrEmpty(userInfo.getPhone())) {
|
| | |
| | | return user.getPortrait();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public UserInfo loginPhone(HttpServletRequest request, int loginType, String vcode, String phone, String appId)
|
| | | throws UserAccountException {
|
| | |
| | | throw new UserAccountException(10, "请稍后再试");
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public UserInfo loginWinXin(HttpServletRequest request, AcceptData acceptData, int loginType, String code,
|
| | | String appId) throws UserAccountException {
|
| | |
| | | throw new UserAccountException(10, "请稍后再试");
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public UserInfo loginWeiXinNew(HttpServletRequest request, AcceptData acceptData, int loginType, String wxCode,
|
| | | String appId) throws UserAccountException {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addCommonGoods(Long uid, Set<Long> ids) throws UserGoodsStorageException {
|
| | |
|
| | | if (uid == null) {
|
| | |
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InviteCodeActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg.UserInfoUpdateTypeEnum;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | import com.yeshi.fanli.util.InviteCodeFilterUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInviteRecordService userInviteRecordService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Override
|
| | | public UserInfoExtraVO getRankInfo(Long uid) throws UserInfoExtraException, Exception {
|
| | |
| | | } else {
|
| | | extra.setUserInfo(new UserInfo(uid));
|
| | | }
|
| | | |
| | |
|
| | | // 更新等级
|
| | | if (isupdateRank) {
|
| | | List<UserRank> listRank = userRankService.getAllRank();
|
| | |
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public UserInfoExtra saveUserInfoExtra(UserInfoExtra userInfoExtra) throws UserInfoExtraException {
|
| | |
|
| | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException {
|
| | | if (uid == null || inviteCode == null) |
| | | if (uid == null || inviteCode == null)
|
| | | throw new UserInfoExtraException(1, "激活信息不能为空");
|
| | | |
| | |
|
| | | // 被邀请人信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null)
|
| | |
| | | UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
|
| | | if (inviter == null)
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | |
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByInviteCode(invitee, inviter);
|
| | |
| | |
|
| | | // 生成邀请码
|
| | | String mycode = createInviteCode(uid);
|
| | | if (StringUtil.isNullOrEmpty(mycode)) |
| | | if (StringUtil.isNullOrEmpty(mycode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | |
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | |
| | | userInfoExtra.setCreateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | |
|
| | | // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | | new Gson().toJson(new InviteCodeActiveMQMsg(uid, new Date())));
|
| | | producer.send(message);
|
| | |
|
| | | return mycode;
|
| | | }
|
| | |
|
| | |
| | | public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
|
| | | if (uid == null || code == null)
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | | |
| | |
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null)
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | |
| | |
|
| | | // 生成邀请码
|
| | | String inviteCode = createInviteCode(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) |
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(invitee);
|
| | | userInfoExtra.setInviteCode(inviteCode);
|
| | |
| | | userInfoExtra.setCreateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | | new Gson().toJson(new InviteCodeActiveMQMsg(uid, new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | // 生成邀请码
|
| | | String inviteCode = createInviteCode(uid);;
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) |
| | | String inviteCode = createInviteCode(uid);
|
| | | ;
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(invitee);
|
| | | userInfoExtra.setInviteCode(inviteCode);
|
| | |
| | | public void updateGoldCoin(Long id, Integer goldCoin) {
|
| | | userInfoExtraMapper.updateGoldCoin(id, goldCoin);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void addGoldCoinByUid(Long uid, Integer goldCoin) {
|
| | | userInfoExtraMapper.addGoldCoinByUid(uid, goldCoin);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserInfoExtra record) {
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(record);
|
| | |
| | | // vip邀请码优先
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip()))
|
| | | return userInfoExtra.getInviteCodeVip();
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
|
| | | return userInfoExtra.getInviteCode();
|
| | | |
| | |
|
| | | // 是否满足生产邀请码
|
| | | int relationshipNum = threeSaleSerivce.getSuccessRelationshipNum(uid);
|
| | | if (relationshipNum > 0) {
|
| | | try {
|
| | | String inviteCode = createInviteCode(uid);
|
| | | if (!StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | UserInfoExtra extra= new UserInfoExtra();
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setInviteCode(inviteCode);
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(extra);
|
| | |
| | |
|
| | | /**
|
| | | * 生产邀请码
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | private String createInviteCode(Long uid) {
|
| | | String inviteCode = null;
|
| | | for (int i = 1; i <= 5; i ++) {
|
| | | for (int i = 1; i <= 5; i++) {
|
| | | inviteCode = UserUtil.getInviteCode(i, uid);
|
| | | long countCode = userInfoExtraMapper.countByInviteCode(inviteCode);
|
| | | if (countCode <= 0)
|
| | |
| | | }
|
| | | return inviteCode;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public long countByRankId(Long rankId) {
|
| | | return userInfoExtraMapper.countByRankId(rankId);
|
| | |
| | | public UserInfo getUserByInviteCode(String inviteCode) throws UserInfoExtraException {
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserInfoExtraException(1, "邀请码不能为空");
|
| | | |
| | |
|
| | | UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
|
| | | if (inviter == null)
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | |
| | |
|
| | | return inviter;
|
| | | }
|
| | |
|
| | |
| | | userInfoExtraMapper.updateAutoExtract(days);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void updateInviteCodeVip(String inviteCodeVip, Long uid) throws UserInfoExtraException {
|
| | | if (inviteCodeVip == null || inviteCodeVip.length() < 4 || inviteCodeVip.length() > 12)
|
| | | throw new UserInfoExtraException(1, "邀请码必须为4到12位");
|
| | | |
| | |
|
| | | UserInfoExtra extra = getUserInfoExtra(uid);
|
| | | if (extra == null)
|
| | | throw new UserInfoExtraException(2, "用户信息不存在");
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(extra.getInviteCode()))
|
| | | throw new UserInfoExtraException(3, "邀请码尚未激活");
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(extra.getInviteCodeVip()))
|
| | | throw new UserInfoExtraException(4, "只能修改一次");
|
| | | |
| | |
|
| | | // 转换成大写
|
| | | inviteCodeVip = inviteCodeVip.toUpperCase();
|
| | | |
| | |
|
| | | // 验证特殊码
|
| | | if(InviteCodeFilterUtil.isSpecialCode(inviteCodeVip))
|
| | | if (InviteCodeFilterUtil.isSpecialCode(inviteCodeVip))
|
| | | throw new UserInfoExtraException(5, "邀请码已存在");
|
| | | |
| | |
|
| | | if (inviteCodeVip.equalsIgnoreCase(extra.getInviteCode()))
|
| | | throw new UserInfoExtraException(5, "不能为原邀请码");
|
| | | |
| | |
|
| | | long count = userInfoExtraMapper.countByInviteCode(inviteCodeVip);
|
| | | if (count > 0)
|
| | | throw new UserInfoExtraException(6, "邀请码已存在");
|
| | | |
| | |
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(extra.getId());
|
| | | update.setInviteCodeVip(inviteCodeVip);
|
| | | update.setUpdateTime(new Date());
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(update);
|
| | | //发送邀请码更改成功的消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userInfoUpdate,
|
| | | new Gson().toJson(new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.inviteCode, inviteCodeVip, new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.user.UserInfoModifyRecordMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserAccountBindingMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg.UserInfoUpdateTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | mqMsg = new UserAccountBindingMQMsg(uid, UserAccountBindingMQMsg.TYPE_ALIPAY, value,
|
| | | new Date());
|
| | | }
|
| | | Message message =MQMsgBodyFactory.create(MQTopicName.TOPIC_USER,
|
| | | UserTopicTagEnum.userAccountBinding,mqMsg);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER,
|
| | | UserTopicTagEnum.userAccountBinding, mqMsg);
|
| | | producer.send(message);
|
| | | } else {// 修改
|
| | | if (type == ModifyTypeEnum.portrait) {
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER,
|
| | | UserTopicTagEnum.userInfoUpdate, new Gson().toJson(new UserInfoUpdateMQMsg(uid,
|
| | | UserInfoUpdateTypeEnum.portrait, value, new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | @Override
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime);
|
| | | String startTime, String endTime,Integer userType) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime,userType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | 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) {
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,Integer userType) {
|
| | |
|
| | | List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
|
| | | startTime, endTime, orderField, orderMode);
|
| | | startTime, endTime, orderField, orderMode,userType);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | return null;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchById(Long id) throws UserRankingsException {
|
| | | return userRankingsMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> arrayID) throws UserRankingsException {
|
| | | for (Long id : arrayID) {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void setRewardtBatch(List<Long> idList, Integer type, Double reward, Double startReward, Double endReward) throws Exception {
|
| | |
|
| | | for (Long id : idList) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void setStateBatch(List<Long> idList, Integer type, Integer state) throws Exception {
|
| | |
|
| | | for (Long id : idList) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void uploadFile(File file) throws Exception {
|
| | |
|
| | | List<UserRankings> list = new ArrayList<UserRankings>();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateShowID(File file) throws Exception {
|
| | | List<String> listID = new ArrayList<String>();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void batchUpNickName(File file) throws Exception {
|
| | | List<String> listID = new ArrayList<String>();
|
| | |
|
| | |
| | | * @param userShareGoodsRecord
|
| | | * @param listGoods
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void multipleGoodsShareRecord(Long shareId, List<CommonGoods> listGoods)
|
| | | throws UserShareGoodsRecordException {
|
| | | // 分享记录
|
| | |
| | | * @param userShareGoodsRecord
|
| | | * @param listGoods
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public FileUploadResult multipleGoodsShare(UserShareGoodsRecord userShareGoodsRecord,
|
| | | List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent,
|
| | | Boolean needNotify) throws UserSystemCouponException, Exception {
|
| | |
|
| | |
| | | return userCoupon;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | | return hasCoupon;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception {
|
| | |
|
| | |
| | | return getEnableListByCouponId(uid, 1, couponList);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
|
| | | Order order) throws Exception {
|
| | | org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void updateStateByDrawback(String orderNo) throws Exception {
|
| | |
|
| | |
| | | sendBackCoupon(record.getUserSystemCoupon(), record);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void updateStateByArrivalAccount(String orderNo) throws Exception {
|
| | |
|
| | |
| | | return userSystemCouponMapper.getCounponNowInvalid(count);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
|
| | | throws Exception {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void copyLotteryPrize(Long uid, int platform, String device) throws Exception {
|
| | |
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void randomRewardCoupon(int num, Long uid, String source) throws Exception {
|
| | | if (num < 1) {
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (couponType == null || uid == null) {
|
| | |
| | | insertSelective(userCoupon);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getCouponList(AcceptData acceptData, long start, int count, Long uid)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public Integer finishedDailySign(long uid) throws Exception{
|
| | | IntegralTaskClass taskClass = getByUniqueKey(UniqueKeyEnum.dailySign.name());
|
| | | if (taskClass == null || taskClass.getState() == null || taskClass.getState() != 1)
|
| | |
| | | return totalGoldCoin + (userInfoExtra.getGoldCoin() == null ? 0 : userInfoExtra.getGoldCoin());
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public boolean addDetail(Long uid, IntegralTaskRecord record) throws IntegralTaskRecordException {
|
| | | Long uid2 = record.getUid();
|
| | | if (uid2 == null || uid.longValue() != uid2.longValue())
|
| | |
| | | return integralTaskRecordMapper.countGetCountByTaskIdAndDay(taskId, uid, minTime, maxTime);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public IntegralTaskRecord addRecord(IntegralTaskRecord record) throws IntegralTaskRecordException {
|
| | | if (record == null)
|
| | |
| | | return threeSaleMapper.selectBoss(uid);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void bind(UserInfo worker, UserInfo inviter) throws ThreeSaleException {
|
| | | if (worker == null || inviter == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
|
| | | if (invitee == null || inviter == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId)throws ThreeSaleException {
|
| | | if (invitee == null || inviterId == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | |
| | | return userGetIntegralFromOrderRecordMapper.countByRecordInfo(record);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addRecord(UserGetIntegralFromOrderRecord record) throws UserGetIntegralFromOrderRecordException {
|
| | | if (record == null || record.getUid() == null || record.getEventType() == null
|
| | |
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
|
| | | boolean valid) throws UserExtraTaoBaoInfoException {
|
| | |
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode);
|
| | | public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | |
|
| | | public interface UserOrderWeiQuanRecordService {
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | public void syncPrevious();
|
| | |
|
| | | /**
|
| | | * 添加淘宝维权
|
| | | * |
| | | * @param order
|
| | | */
|
| | | public void addTaoBaoWeiQuan(TaoBaoWeiQuanOrder order);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 用户分享图的数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | | String getUserSpreadImg(Long uid, String bgImg, int erCodePostionX, int erCodePostionY, int erCodeSize);
|
| | |
|
| | | /**
|
| | | * 根据图片画二维码
|
| | | * 根据图片画二维码
|
| | | * |
| | | * @param uid
|
| | | * @param bgImg
|
| | | * @param inviteCode
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | String drawInviteQrCodeNew(String bgImg, Long uid, String portrait, Integer pX, Integer pY, Integer size, String inviteCode) throws Exception;
|
| | | String drawInviteQrCodeNew(String bgImg, Long uid, String portrait, Integer pX, Integer pY, Integer size,
|
| | | String inviteCode) throws Exception;
|
| | |
|
| | | /**
|
| | | * 邀请图片 问候
|
| | | * |
| | | * @param bgImg
|
| | | * @param uid
|
| | | * @param portrait
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public String getInviteImgToGreet(String bgImg, Long uid, String portrait, String inviteCode, String content, Date date)
|
| | | throws Exception;
|
| | | public String getInviteImgToGreet(String bgImg, Long uid, String portrait, String inviteCode, String content,
|
| | | Date date) throws Exception;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取用户要求图列表
|
| | | * |
| | | * @param uid
|
| | | * @param page
|
| | | * @param count
|
| | |
| | | * @return
|
| | | */
|
| | | public List<String> getUserSpreadImgToPage(Long uid, int page, int count, HttpServletRequest request);
|
| | |
|
| | | }
|
| | |
| | | * @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);
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,Integer userType);
|
| | |
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime);
|
| | | String startTime, String endTime,Integer userType);
|
| | |
|
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
|
| | |
|
| | |
| | | return CommonOrder.STATE_SX;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
|
| | | Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException {
|
| | | System.out.println(commonOrder.getOrderNo());
|
| | |
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.GoodsClassDTO;
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | | import com.yeshi.fanli.dto.jd.JDCommissionInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.user;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InviteCodeActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg.UserInfoUpdateTypeEnum;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | /**
|
| | | * 用户邀请图改变
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class InvitePictureChangeMessageListener implements MessageListener {
|
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-InvitePictureChangeMessageListener", message.getMsgID(), message.getTopic(),
|
| | | message.getTag(), new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | if (tag == null)
|
| | | tag = "";
|
| | |
|
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.inviteCodeActive.name())) {// 邀请码激活
|
| | | InviteCodeActiveMQMsg inviteCodeActiveMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | InviteCodeActiveMQMsg.class);
|
| | | if (inviteCodeActiveMQMsg != null && inviteCodeActiveMQMsg.getUid() != null)
|
| | | spreadUserImgService.deleteImgUrl(inviteCodeActiveMQMsg.getUid());
|
| | |
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userInfoUpdate.name())) {// 订单统计
|
| | | UserInfoUpdateMQMsg userInfoUpdateMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | UserInfoUpdateMQMsg.class);
|
| | | if (userInfoUpdateMQMsg != null && (userInfoUpdateMQMsg.getType() == UserInfoUpdateTypeEnum.portrait
|
| | | || userInfoUpdateMQMsg.getType() == UserInfoUpdateTypeEnum.inviteCode)) {
|
| | | if (userInfoUpdateMQMsg.getUid() != null)
|
| | | spreadUserImgService.deleteImgUrl(userInfoUpdateMQMsg.getUid());
|
| | | }
|
| | |
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | |
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_ORDER" />
|
| | | <property name="expression" value="orderStatistic||orderFanLiActual||orderStatisticDelay||orderFanLiSeparateByOrderNo" />
|
| | | <property name="expression"
|
| | | value="orderStatistic||orderFanLiActual||orderStatisticDelay||orderFanLiSeparateByOrderNo" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | |
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression"
|
| | | value="inviteSuccess||userAccountBinding||integralTaskFinish||redPackGift" />
|
| | | value="inviteSuccess||userAccountBinding||integralTaskFinish||redPackGift||redPackGiftDrawback" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | |
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <!-- 订单到账消息订阅 -->
|
| | | <bean id="orderMoneyRecievedMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.order.OrderMoneyRecievedMessageListener"></bean>
|
| | |
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <!-- 邀请图修改消息订阅 -->
|
| | | <bean id="invitePictureChangeMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.user.InvitePictureChangeMessageListener"></bean>
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="invitePictureChangeConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_INVITE_PICTURE</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 邀请码激活,用户信息修改 -->
|
| | | <entry value-ref="invitePictureChangeMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression" value="inviteCodeActive||userInfoUpdate" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | </beans> |
| | |
| | | <entry value-ref="systemCouponMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="GID_SYSTEM_COUPON" />
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression" value="systemCouponDrawback" />
|
| | | </bean>
|
| | | </key>
|