Merge remote-tracking branch 'origin/div' into div
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
|
| | | import com.yeshi.fanli.dao.mybatis.help.HelpCenterMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | | Long uid = exchange.getUid();
|
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | List<Long> listCount = redPackExchangeService.countState(uid);
|
| | | List<BigDecimal> listMoney = redPackExchangeService.countMoneyState(uid);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("exchange", exchange);
|
| | | data.put("userInfo", userInfo);
|
| | |
|
| | | data.put("countInit", listCount.get(0));
|
| | | data.put("countSucceed", listCount.get(1));
|
| | | data.put("countReject", listCount.get(2));
|
| | | data.put("countInit", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_INIT));
|
| | | data.put("countSucceed", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_SUCCESS));
|
| | | data.put("countReject", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_REJECT));
|
| | |
|
| | | data.put("balance", balance);
|
| | | data.put("moneyInit", listMoney.get(0));
|
| | | data.put("moneySucceed", listMoney.get(1));
|
| | | data.put("moneyReject", listMoney.get(2));
|
| | | data.put("moneyInit", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_INIT));
|
| | | data.put("moneySucceed", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_SUCCESS));
|
| | | data.put("moneyReject", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_REJECT));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | |
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (UserShareGoodsGroup goodsGroup : list) {
|
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | |
| | | }
|
| | | commonGoods.setState(state);
|
| | | }
|
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, configParamsDTO);
|
| | | if (!detailVO.isHasCoupon()) {
|
| | | detailVO.setState(1);; // 已抢光
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
|
| | |
| | | if (couplePrice.compareTo(new BigDecimal("9.9")) == 1) {
|
| | | continue; // 券后价大于10
|
| | | }
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | | BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | |
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE);
|
| | | for (TLJBuyGoods goods : goodsList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | |
|
| | | // 大于1.6.5的才会显示福利价
|
| | | if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | |
| | | for (ShareHotGoods hotGoods : goodsList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | |
|
| | | // 大于1.6.5的才会显示福利价
|
| | | if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.brand.BrandGoodsCahe;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | |
| | | continue;
|
| | | }
|
| | | }
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | |
| | | continue;
|
| | | }
|
| | | }
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | | 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);
|
| | | JSONArray array = new JSONArray();
|
| | | List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id);
|
| | | for (BrandGoodsCahe brandGoods: listGoods) {
|
| | | JDGoods goodsJD = brandGoods.getGoodsJD();
|
| | | if (goodsJD != null) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goodsJD, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goodsJD, paramsDTO)));
|
| | | continue;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goodsTB = brandGoods.getGoodsTB();
|
| | | if (goodsTB != null) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsTB, null, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsTB, paramsDTO)));
|
| | | continue;
|
| | | }
|
| | |
|
| | | PDDGoodsDetail goodsPDD = brandGoods.getGoodsPDD();
|
| | | if (goodsPDD != null) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, paramsDTO)));
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.common.CommonContentNav;
|
| | | import com.yeshi.fanli.dto.common.CommonContentResult;
|
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
|
| | |
| | | List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | if (type == CommonContentTypeEnum.mianDan)// 免单商品
|
| | | {
|
| | | vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
|
| | |
| | | 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);
|
| | | for (JDGoods goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 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);
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) {
|
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | |
| | | commonGoods.setState(state);
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | | detailVO.setId(commonGoods.getId());
|
| | | detailVO.setCreatetime(collectionGoodsV2.getCreateTime());
|
| | | list.add(detailVO);
|
| | |
| | | Gson gson = gsonBuilder.create();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (ScanHistoryV2 sh : list) {
|
| | | CommonGoods commonGoods = sh.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | |
|
| | | detailVO.setId(commonGoods.getId());
|
| | | detailVO.setCreatetime(sh.getCreateTime());
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | |
| | | // 精选库数据
|
| | | JSONArray array = new JSONArray();
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
| | | continue;
|
| | | }
|
| | | updateGoodsList.add(taoBaoGoodsBrief);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | |
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | if (resultGoodsList != null)
|
| | | if (resultGoodsList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (TaoBaoGoodsBrief goods : resultGoodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | array.add(gson2.toJson(goodsDetailVO));
|
| | | }
|
| | |
|
| | | }
|
| | | JSONObject result = new JSONObject();
|
| | | result.put("result", array);
|
| | | result.put("count", result.optLong("count") + count);
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCategoryInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | |
|
| | | if (TaoBaoUtil.isYUShou(goods)) {
|
| | | if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
|
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
|
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
|
| | |
|
| | | for (JDGoods goods : list) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate));
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO));
|
| | | }
|
| | |
|
| | | // 取偶数个数据
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate));
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | |
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) {
|
| | | // 获取详情
|
| | |
| | |
|
| | | if (taoBaoGoodsBrief != null) {
|
| | | listExtra.add(
|
| | | GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate));
|
| | | GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO));
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | | if (detailList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (DaTaoKeDetailV2 detail : detailList) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | if (cid == 2)
|
| | | detailVO.setSalesType(2);
|
| | | else if (cid == 3)
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | |
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | |
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE));
|
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", configService.get("spike_goods_link") + "?id=" + taoBaoGoodsBrief.getAuctionId());
|
| | |
| | | if (detailList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (DaTaoKeDetailV2 detail : detailList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), null, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), paramsDTO)));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | if (page < 3)
|
| | | detailVO.setRecommend(true);
|
| | |
|
| | |
| | |
|
| | | if (page == 1) {
|
| | | List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice());
|
| | | if (list != null && list.size() > 0)
|
| | | if (list != null && list.size() > 0) {
|
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE);
|
| | | for (int i = list.size() - 1; i >= 0; i--) {
|
| | | TLJBuyGoods goods = list.get(i);
|
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), null, rateBuy,
|
| | | rateBuy);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy);
|
| | |
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(goods.getGoods(),
|
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
|
| | |
| | | detailVO.setRecommend(true);
|
| | | array.add(0, gson.toJson(detailVO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | if (gList != null) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | for (TaoBaoGoodsBrief goods : gList) {
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0
|
| | | && goods.getBiz30day() > 1000
|
| | | && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) {
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | detailVO.setRecommend(true);
|
| | | goodsList.add(detailVO);
|
| | | }
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | | count = arrayKeys.size();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | int j = 1;
|
| | | for (int i = (page - 1) * 3; i < arrayKeys.size(); i++) {
|
| | |
| | | List<DaTaoKeDetailV2> listTaoKe = daTaoKeGoodsService.getSearchDiscoveryGoods(words);
|
| | | if (listTaoKe != null && listTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetailV2 daTaoKeDetailV2 : listTaoKe) {
|
| | | listGoods.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), null,
|
| | | fanLiRate, shareRate));
|
| | | listGoods.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), paramsDTO));
|
| | | if (listGoods.size() >= 3)
|
| | | break;
|
| | | }
|
| | |
| | | String giveMax = redPackConfigService.getValueByKey("give_money_max");
|
| | |
|
| | | // 正在提现金额
|
| | | BigDecimal extractingMoney = redPackExchangeService.countMoneyByState(uid, RedPackExchange.STATE_INIT);
|
| | | BigDecimal extractingMoney = redPackExchangeService.countMoneyByUidAndState(uid, RedPackExchange.STATE_INIT);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("balance", balance.setScale(2).toString());
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | | import com.yeshi.fanli.dto.jd.JDFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter;
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | data.put("type", type);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate)));
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 3);
|
| | | data.put("goods", gson
|
| | | .toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, null, fanLiRate, shareRate)));
|
| | | .toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE))));
|
| | | 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);
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate));
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
|
| | | }
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | |
| | | 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);
|
| | |
|
| | | for (JDGoods goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
|
| | | if (hasCoupon) {
|
| | | if (goodsDetailVO.isHasCoupon()) {
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | |
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | |
| | | dataObject.put("totalOrder", goodsGroup.getTotalOrder());
|
| | | dataObject.put("totalMoney", "¥" + goodsGroup.getTotalMoney());
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | | detailVO.setId(commonGoods.getId());
|
| | | dataObject.put("goods", gson.toJson(detailVO));
|
| | | array.add(dataObject);
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (UserGoodsStorage userGoodsStorage : listStorage) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | | detailVO.setId(commonGoods.getId());
|
| | |
|
| | | JSONObject dataObject = new JSONObject();
|
| | |
| | | import com.google.gson.TypeAdapter;
|
| | | import com.google.gson.stream.JsonReader;
|
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | |
|
| | | // 大于1.6.5的才会显示福利价
|
| | | if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE);
|
| | | for (TLJBuyGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | |
|
| | | // 大于1.6.5的才会显示福利价
|
| | | if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<Long> countState(@Param("uid") long uid); |
| | | Long countByUidAndState(@Param("uid") long uid, @Param("state") Integer state); |
| | | |
| | | |
| | | /** |
| | | * 统计各个状态金额 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<BigDecimal> countMoneyState(@Param("uid") long uid); |
| | | |
| | | /** |
| | | * 统计状态金额 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | BigDecimal countMoneyByState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | } |
| | |
| | | public interface UserSystemCouponActivateMapper extends BaseMapper<UserSystemCouponActivate> { |
| | | |
| | | /** |
| | | * 查询更新 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | UserSystemCouponActivate selectForUpdate(@Param("id")Long id); |
| | | |
| | | |
| | | /** |
| | | * 添加数量 |
| | | * @param id |
| | | * @param count |
| | |
| | | * @param source
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCoupon> getNeedActivateFreeCouponByType(@Param("uid") Long uid, @Param("type") String type);
|
| | | UserSystemCoupon getNeedActivateCouponByType(@Param("uid") Long uid, @Param("type") String type);
|
| | |
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class ConfigParamsDTO {
|
| | | // 返利比例
|
| | | private BigDecimal fanLiRate;
|
| | | // 分享比例
|
| | | private BigDecimal shareRate;
|
| | | // 奖励券最高返比例
|
| | | private BigDecimal maxRewardRate;
|
| | |
|
| | | public ConfigParamsDTO() {}
|
| | |
|
| | | public ConfigParamsDTO(BigDecimal fanLiRate, BigDecimal shareRate, BigDecimal maxRewardRate) {
|
| | | this.fanLiRate = fanLiRate;
|
| | | this.shareRate = shareRate;
|
| | | this.maxRewardRate = maxRewardRate;
|
| | | }
|
| | |
|
| | | public BigDecimal getFanLiRate() {
|
| | | return fanLiRate;
|
| | | }
|
| | |
|
| | | public void setFanLiRate(BigDecimal fanLiRate) {
|
| | | this.fanLiRate = fanLiRate;
|
| | | }
|
| | |
|
| | | public BigDecimal getShareRate() {
|
| | | return shareRate;
|
| | | }
|
| | |
|
| | | public void setShareRate(BigDecimal shareRate) {
|
| | | this.shareRate = shareRate;
|
| | | }
|
| | |
|
| | | public BigDecimal getMaxRewardRate() {
|
| | | return maxRewardRate;
|
| | | }
|
| | |
|
| | | public void setMaxRewardRate(BigDecimal maxRewardRate) {
|
| | | this.maxRewardRate = maxRewardRate;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.msg;
|
| | |
|
| | | /**
|
| | | * 红包提现相关消息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class MsgRedPackExchangeContentDTO {
|
| | |
|
| | | private String title; // 标题
|
| | | private String time; // 时间
|
| | | private String money; // 金额
|
| | | private String balance; // 余额
|
| | | private String reason; //原因
|
| | | private String handle; // 处理
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getTime() {
|
| | | return time;
|
| | | }
|
| | |
|
| | | public void setTime(String time) {
|
| | | this.time = time;
|
| | | }
|
| | |
|
| | | public String getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(String money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public String getBalance() {
|
| | | return balance;
|
| | | }
|
| | |
|
| | | public void setBalance(String balance) {
|
| | | this.balance = balance;
|
| | | }
|
| | |
|
| | | public String getReason() {
|
| | | return reason;
|
| | | }
|
| | |
|
| | | public void setReason(String reason) {
|
| | | this.reason = reason;
|
| | | }
|
| | |
|
| | | public String getHandle() {
|
| | | return handle;
|
| | | }
|
| | |
|
| | | public void setHandle(String handle) {
|
| | | this.handle = handle;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.msg;
|
| | |
|
| | | /**
|
| | | * 红包赠送相关消息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class MsgRedPackGiveContentDTO {
|
| | |
|
| | | private String title; // 标题
|
| | | private String userInfo; // 用户信息
|
| | | private String time; // 时间
|
| | | private String money; // 金额
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getUserInfo() {
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | | public void setUserInfo(String userInfo) {
|
| | | this.userInfo = userInfo;
|
| | | }
|
| | |
|
| | | public String getTime() {
|
| | | return time;
|
| | | }
|
| | |
|
| | | public void setTime(String time) {
|
| | | this.time = time;
|
| | | }
|
| | |
|
| | | public String getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(String money) {
|
| | | this.money = money;
|
| | | }
|
| | | }
|
| | |
| | | @Table("yeshi_ec_msg_money")
|
| | | public class MsgMoneyDetail {
|
| | | public enum MsgTypeMoneyTypeEnum {
|
| | |
|
| | | share("分享奖金"),
|
| | | invite("邀请奖金"),
|
| | | fanli("返利到账"),
|
| | |
| | | orderReward("返利奖励"),
|
| | | systemEqualize("系统补齐"),
|
| | | fanliElme("返利到账"),
|
| | | subSidy("额外补贴");
|
| | | subSidy("额外补贴"),
|
| | | redPackGiveOff("赠送红包完成"),
|
| | | redPackReceiveOff("赠送红包领取"),
|
| | | redPackExchangePass("红包提现成功"),
|
| | | redPackExchangeReject("红包提现失败");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeMoneyTypeEnum(String desc) {
|
| | |
| | | private Date updateTime;
|
| | | @Column(name = "mm_read")
|
| | | private Boolean read;
|
| | | @Column(name = "mm_content") // 消息内容
|
| | | private String content;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | public void setDesc(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getContent() {
|
| | | return content;
|
| | | }
|
| | |
|
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | | }
|
| | |
| | | orderReward("返利奖励金", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
|
| | | repeatStatistic("重复统计返利/奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | elmeFanli("饿了么返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
|
| | | redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
|
| | | redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", ""),
|
| | | extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
|
| | | subsidy("额外补贴", "http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", "");
|
| | |
| | | giveOthers("红包赠送待领取中", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
|
| | | giveOthersSucceed("红包赠送领取成功", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
|
| | | giveOthersFail("红包赠送超时退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
|
| | | giveOthersReceive("好友赠送", "http://img.flqapp.com/img/tlj/icon_tlj.png"), |
| | |
|
| | | redExchange("红包提现中", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
|
| | | redExchangePass("红包提现成功", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
|
| | | redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/money_detail/icon_score.png");
|
| | | redExchange("红包提现中", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
|
| | | redExchangePass("红包提现成功", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
|
| | | redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png");
|
| | |
|
| | | private final String desc;
|
| | | private final String picture;
|
| | |
| | | <result column="mm_read" property="read" jdbcType="BOOLEAN" /> |
| | | <result column="mm_order_type" property="orderType" jdbcType="INTEGER" /> |
| | | <result column="mm_desc" property="desc" jdbcType="VARCHAR" /> |
| | | <result column="mm_content" property="content" jdbcType="VARCHAR" /> |
| | | <association property="user" column="mm_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="mm_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | <association property="alipayAccountValid" column="mm_source_id_alipayvalid" |
| | | select="com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper.selectByPrimaryKey" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc |
| | | <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_money |
| | | (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc) |
| | | (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR}) |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="read != null">mm_read,</if> |
| | | <if test="orderType != null">mm_order_type,</if> |
| | | <if test="desc != null">mm_desc,</if> |
| | | <if test="content != null">mm_content,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="read != null">#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if> |
| | | <if test="desc != null">#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">update |
| | |
| | | #{createTime,jdbcType=TIMESTAMP},mm_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP},mm_read = #{read,jdbcType=BOOLEAN} |
| | | ,mm_order_type =#{orderType,jdbcType=INTEGER}, |
| | | mm_desc = #{desc,jdbcType=VARCHAR} where mm_id = |
| | | mm_desc = #{desc,jdbcType=VARCHAR}, |
| | | mm_content = #{content,jdbcType=VARCHAR} where mm_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"> |
| | |
| | | <if test="read != null">mm_read=#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="orderType !=null">mm_order_type =#{orderType,jdbcType=INTEGER},</if> |
| | | <if test="desc != null">mm_desc=#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="content != null">mm_content=#{content,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where mm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | </set> where rpd_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByIdentifyCode" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_red_pack_detail` t |
| | | WHERE t.`rpd_identify_code` = #{identifyCode} |
| | | </select> |
| | | |
| | | <select id="countUseMoneyByDate" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t |
| | | WHERE t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation' |
| | | WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation' |
| | | <if test="dateType == 1"> <!-- 今日 --> |
| | | AND TO_DAYS(t.`rpd_create_time`) = TO_DAYS(NOW()); |
| | | </if> |
| | |
| | | |
| | | <select id="countAddMoneyByDate" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t |
| | | WHERE t.`rpd_money` <![CDATA[>]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type`<![CDATA[<>]]>'refund' |
| | | WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[>]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type`<![CDATA[<>]]>'refund' |
| | | <if test="dateType == 1"> <!-- 今日 --> |
| | | AND TO_DAYS(t.`rpd_create_time`) = TO_DAYS(NOW()); |
| | | </if> |
| | |
| | | |
| | | <select id="selectByMaxCreateTime" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_red_pack_detail t |
| | | WHERE t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date} |
| | | WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date} |
| | | ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC |
| | | LIMIT #{count} |
| | | </select> |
| | | |
| | | <select id="selectByUidWithIndexId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_red_pack_detail t |
| | | WHERE t.`rpd_uid`=#{uid} |
| | | WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid} |
| | | AND t.`rpd_create_time`<![CDATA[<=]]>(SELECT rpd_create_time FROM yeshi_red_pack_detail WHERE rpd_id =#{id}) |
| | | ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC |
| | | LIMIT #{count} |
| | |
| | | FROM (SELECT #{item} AS `time`) c |
| | | LEFT JOIN (SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`)AS money |
| | | FROM `yeshi_red_pack_detail` d |
| | | WHERE d.`rpd_uid`=#{uid} AND d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item} |
| | | WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item} |
| | | GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') |
| | | ) a ON a.time=c.time |
| | | |
| | | LEFT JOIN(SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`) AS money |
| | | FROM `yeshi_red_pack_detail` d |
| | | WHERE d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item} |
| | | WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item} |
| | | GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') |
| | | ) b ON c.time=b.time |
| | | </trim> |
| | |
| | | |
| | | <select id="selectCountByUid" resultType="java.lang.Long" parameterType="java.lang.Long"> |
| | | SELECT count(rpd_id) FROM yeshi_red_pack_detail |
| | | WHERE rpd_uid=#{uid} |
| | | WHERE rpd_display = 1 AND rpd_uid=#{uid} |
| | | </select> |
| | | |
| | | <select id="selectMonthCountByUid" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM |
| | | (SELECT * FROM yeshi_red_pack_detail d |
| | | WHERE d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date} |
| | | WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date} |
| | | GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%y-%m') |
| | | ) a |
| | | </select> |
| | | |
| | | <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long"> |
| | | SELECT count(rpd_id) FROM yeshi_red_pack_detail |
| | | WHERE rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date} |
| | | WHERE rpd_display = 1 AND rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date} |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="state != null "> |
| | | AND d.rpe_state = #{state} |
| | | </if> |
| | | ORDER BY d.`rpe_state`,d.`rpe_create_time` |
| | | ORDER BY d.`rpe_state`,d.`rpe_create_time` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countState" resultType="Long"> |
| | | SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d |
| | | WHERE d.rpe_uid = #{uid} |
| | | GROUP BY d.`rpe_state` |
| | | ORDER BY d.`rpe_state` |
| | | <select id="countByUidAndState" resultType="Long"> |
| | | SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d |
| | | WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state} |
| | | </select> |
| | | |
| | | <select id="countMoneyState" resultType="BigDecimal"> |
| | | SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d |
| | | WHERE d.rpe_uid = #{uid} |
| | | GROUP BY d.`rpe_state` |
| | | ORDER BY d.`rpe_state` |
| | | </select> |
| | | |
| | | <select id="countMoneyByState" resultType="BigDecimal"> |
| | | <select id="countMoneyByUidAndState" resultType="BigDecimal"> |
| | | SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d |
| | | WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state} |
| | | </select> |
| | |
| | | </set> where usca_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="selectForUpdate" resultMap="BaseResultMap" > |
| | | SELECT * FROM yeshi_ec_user_system_coupon_activate |
| | | WHERE usca_id = #{id} FOR UPDATE |
| | | </select> |
| | | |
| | | <select id="addCount"> |
| | | UPDATE yeshi_ec_user_system_coupon_activate |
| | | SET usca_count = usca_count + #{count},usca_update_time = NOW() |
| | |
| | | javaType="com.yeshi.fanli.entity.system.SystemCoupon">
|
| | | <id column="usc_coupon_id" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | | |
| | | |
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserSystemCoupon">
|
| | | <id column="usc_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="usc_uid" property="uid" jdbcType="BIGINT"/>
|
| | | <result column="usc_source" property="source" jdbcType="VARCHAR"/>
|
| | | <result column="usc_give" property="give" jdbcType="VARCHAR"/>
|
| | | <result column="usc_state" property="state" jdbcType="INTEGER"/>
|
| | | <result column="usc_state_activate" property="stateActivated" jdbcType="INTEGER"/>
|
| | | <result column="usc_start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="usc_end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="usc_use_time" property="useTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="usc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="usc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | |
|
| | | <association property="systemCoupon" column="usc_coupon_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.SystemCouponMapper.BaseResultMap"/>
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.user.UserSystemCouponVO">
|
| | |
| | | WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type}
|
| | | </select>
|
| | |
|
| | | <select id="getNeedActivateFreeCouponByType" resultMap="BaseResultMap">
|
| | | <select id="getNeedActivateCouponByType" resultMap="AllResultMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` t
|
| | | LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
|
| | | WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type} AND (t.usc_state_activate = 0 OR t.usc_state_activate is null)
|
| | | WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type} AND t.`usc_state` = 1
|
| | | AND (t.usc_state_activate = 0 OR t.usc_state_activate is null)
|
| | | AND t.`usc_end_time` <![CDATA[>]]> NOW() |
| | | ORDER BY usc_id
|
| | | LIMIT 1
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandClassShopMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.BrandClassShop;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()),paramsDTO);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
|
| | |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), paramsDTO);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.brand.BrandShopCaheDao;
|
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.brand.BrandGoodsCahe;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BrandInfoVO brand = list.get(i);
|
| | |
| | | for (BrandGoodsCahe brandGoods : listGoods) {
|
| | | JDGoods goodsJD = brandGoods.getGoodsJD();
|
| | | if (goodsJD != null) {
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertJDGoods(goodsJD, fanLiRate, shareRate));
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertJDGoods(goodsJD, configParamsDTO));
|
| | | continue;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goodsTB = brandGoods.getGoodsTB();
|
| | | if (goodsTB != null) {
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertTaoBao(goodsTB, null, fanLiRate, shareRate));
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertTaoBao(goodsTB, configParamsDTO));
|
| | | continue;
|
| | | }
|
| | |
|
| | | PDDGoodsDetail goodsPDD = brandGoods.getGoodsPDD();
|
| | | if (goodsPDD != null) {
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, fanLiRate, shareRate));
|
| | | listGoodsVO.add(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, configParamsDTO));
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | | DynamicInfo dynamicNew = new DynamicInfo();
|
| | | try {
|
| | |
| | | goods.setCouponStartFee(goodsMap.get(goods.getAuctionId()).getCouponStartFee());
|
| | | goods.setTkRate(goodsMap.get(goods.getAuctionId()).getTkRate());
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, paramsDTO);
|
| | |
|
| | | goodsNew.setGoodsVO(detailVO);
|
| | | goodsNew.setGoods(null);
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.lable.LabelGoodsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.lable.QualityFactoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.bus.lable.Label;
|
| | | import com.yeshi.fanli.entity.bus.lable.LabelGoods;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | | }
|
| | |
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief,paramsDTO);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | if (fq == 0 && fh == 0 && !ft) {
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(bf, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(bf, paramsDTO);
|
| | | re.add(goodsDetailVO);
|
| | | }
|
| | | } else {
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | re.add(goodsDetailVO);
|
| | | }
|
| | | }
|
| | |
| | | update.setStateDesc(detail.getStateDesc());
|
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff
|
| | | || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass
|
| | | || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) {
|
| | | if (detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) {
|
| | | if (detail.getMoney() == null || detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | |
| | |
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Async
|
| | | @Override
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance) {
|
| | |
| | | package com.yeshi.fanli.service.impl.redpack;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.omg.CORBA.LongHolder;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.redpack.RedPackExchangeMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackExchange;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackExchangeException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | |
| | | @Resource
|
| | | private RedPackDetailService redPackDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | |
|
| | | @Override
|
| | | public List<RedPackExchange> query(Integer start, Integer count, String key, Integer state){
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Long> countState(long uid){
|
| | | return redPackExchangeMapper.countState(uid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<BigDecimal> countMoneyState(long uid){
|
| | | return redPackExchangeMapper.countMoneyState(uid);
|
| | | public Long countByUidAndState(long uid, Integer state) {
|
| | | return redPackExchangeMapper.countByUidAndState(uid, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal countMoneyByState(Long uid, Integer state){
|
| | | return redPackExchangeMapper.countMoneyByState(uid, state);
|
| | | public BigDecimal countMoneyByUidAndState(Long uid, Integer state){
|
| | | return redPackExchangeMapper.countMoneyByUidAndState(uid, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (record == null)
|
| | | throw new RedPackExchangeException(1,"申请记录已不存在");
|
| | |
|
| | | if (RedPackExchange.STATE_INIT == record.getState())
|
| | | if (RedPackExchange.STATE_INIT != record.getState())
|
| | | throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
|
| | |
|
| | | Date nowDate = new Date();
|
| | |
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
|
| | |
|
| | | // 更新红包提现明细
|
| | | try {
|
| | | String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchangePass.name() + ":" + record.getId());
|
| | | String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchange.name() + ":" + record.getId());
|
| | | RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
|
| | | // 创建明细更新
|
| | | RedPackDetail updateDetail = RedPackDetailFactory.updateExchangePass(redPackDetail.getId(), record);
|
| | | redPackDetailService.updateByPrimaryKeySelective(updateDetail);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new RedPackExchangeException(1,"更新提现明细出错");
|
| | | }
|
| | | |
| | | //消息
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | String beizu = "红包提现成功后请到“我的-账户余额”中查看";
|
| | | MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
|
| | | dto.setTitle("红包提现");
|
| | | dto.setTime(sd.format(record.getCreateTime()));
|
| | | dto.setHandle("人工审核" + sd.format(new Date())); |
| | | dto.setMoney("¥" + record.getMoney().setScale(2)); |
| | | dto.setBalance("¥" + redPackBalanceService.getBalance(record.getUid()));
|
| | | userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangePass, new Gson().toJson(dto), beizu);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | if (record == null)
|
| | | throw new RedPackExchangeException(1,"申请记录已不存在");
|
| | |
|
| | | if (RedPackExchange.STATE_INIT == record.getState())
|
| | | if (RedPackExchange.STATE_INIT != record.getState())
|
| | | throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
|
| | |
|
| | | record.setReason(reason);
|
| | |
| | |
|
| | | // 退回红包
|
| | | try {
|
| | | redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchange(record));
|
| | | redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchangeReject(record));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new RedPackExchangeException(1, "红包退回时出错");
|
| | | }
|
| | | |
| | | //消息
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
|
| | | dto.setTitle("红包提现");
|
| | | dto.setReason(reason);
|
| | | dto.setHandle(""); // TODO 处理方式待定
|
| | | dto.setTime(sd.format(record.getCreateTime()));
|
| | | userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangeReject, new Gson().toJson(dto), null);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.redpack.RedPackGiveRecordMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.factory.RedPackDetailFactory;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TokenRecordService tokenRecordService;
|
| | | |
| | | @Resource
|
| | | private RedPackDetailService redPackDetailService;
|
| | | |
| | | |
| | | @Override
|
| | | public RedPackGiveRecord selectByPrimaryKey(Long id) {
|
| | | return redPackGiveRecordMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void updateByPrimaryKeySelective(RedPackGiveRecord record) {
|
| | | redPackGiveRecordMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", token).replace("{下载链接}", redPackConfigService.getValueByKey("app_down_link")).replace("{面额}",
|
| | | amount.setScale(0).toString());
|
| | | amount.toString());
|
| | |
|
| | | // 减少红包
|
| | | try {
|
| | | redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord, null, RedPackDetailTypeEnum.giveOthers));
|
| | | redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord));
|
| | | } catch (Exception e) {
|
| | | throw new RedPackGiveRecordException(1, "红包创建失败");
|
| | | }
|
| | | return tips;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException{
|
| | | RedPackGiveRecord giveRecord = redPackGiveRecordMapper.selectByPrimaryKey(id);
|
| | | if (giveRecord == null || giveRecord.getState() != RedPackGiveRecord.STATE_INIT)
|
| | | throw new RedPackGiveRecordException(1, "赠送记录失效或已被领取");
|
| | | |
| | | Date now = new Date();
|
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new RedPackGiveRecordException(1, "红包已失效了");
|
| | | |
| | | giveRecord.setGiveUid(uid);
|
| | | giveRecord.setReceiveTime(now);
|
| | | giveRecord.setState(RedPackGiveRecord.STATE_RECEIVE);
|
| | | // 领取人增加红包
|
| | | try {
|
| | | redPackBalanceService.addRedPack(uid, giveRecord.getAmount(), RedPackDetailFactory.createGiveOthersReceive(giveRecord));
|
| | | } catch (Exception e) {
|
| | | throw new RedPackGiveRecordException(1, "红包领取失败");
|
| | | } |
| | | |
| | | // 更新赠送记录
|
| | | redPackGiveRecordMapper.updateByPrimaryKey(giveRecord);
|
| | | |
| | | try {
|
| | | String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId());
|
| | | RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
|
| | | |
| | | RedPackDetail updateDetail = RedPackDetailFactory.createGiveOthersSucceed(redPackDetail.getId(), giveRecord);
|
| | | redPackDetailService.updateByPrimaryKeySelective(updateDetail);
|
| | | } catch (Exception e) {
|
| | | throw new RedPackGiveRecordException(1,"更新提现明细出错");
|
| | | }
|
| | | return giveRecord;
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | for (TaoBaoShopVO taoBaoShopVO : list) {
|
| | |
|
| | | Integer userType = taoBaoShopVO.getUserType();
|
| | |
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | |
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.user.TokenRecordMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | @Resource
|
| | | private UserInviteMsgNotificationService userInviteMsgNotificationService;
|
| | |
|
| | | @Resource
|
| | | private RedPackGiveRecordService redPackGiveRecordService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | |
|
| | | @Override
|
| | | public void insertSelective(TokenRecord record) {
|
| | |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | |
|
| | | Integer num = 1;
|
| | | Integer num = 0;
|
| | | Integer type = 0;
|
| | | String money = null;
|
| | | boolean state = false;
|
| | | List<String> tips = new ArrayList<String>();
|
| | | String identify = rokenRecord.getIdentify();
|
| | |
| | | throw new TokenRecordException(1, "赠送记录不存在");
|
| | |
|
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "赠送记录已过期");
|
| | |
|
| | | // 用户券信息
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
|
| | | if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
|
| | | throw new TokenRecordException(1, "券不存在或非赠送状态");
|
| | |
|
| | | if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
|
| | | if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE || (endTime != null && endTime.getTime() < now.getTime())) {
|
| | | tips.add("哎呀,这张免单券已失效了!");
|
| | | } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
|
| | | tips.add("哎呀,这张免单券已被领取了!");
|
| | |
| | | throw new TokenRecordException(1, "赠送记录不存在");
|
| | |
|
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "赠送记录已过期");
|
| | |
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
|
| | | if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
|
| | | throw new TokenRecordException(1, "券不存在或非赠送状态");
|
| | |
|
| | |
|
| | | if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
|
| | | if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE|| (endTime != null && endTime.getTime() < now.getTime())) {
|
| | | tips.add("哎呀,这张返利奖励券已失效了!");
|
| | | } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
|
| | | tips.add("哎呀,这张返利奖励券已被领取了!");
|
| | |
| | | }
|
| | | } else {
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | type = 13;
|
| | | RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
|
| | | if (giveRecord == null)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | Date endTime = giveRecord.getEndTime();
|
| | | // 赠送面额
|
| | | money = giveRecord.getAmount().setScale(2).toString();
|
| | |
|
| | | if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE |
| | | || (endTime != null && endTime.getTime() < now.getTime())) {
|
| | | tips.add("哎呀,这个红包已失效了!");
|
| | | } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
|
| | | tips.add("哎呀,这个红包已被领取了!");
|
| | | } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_INIT) {
|
| | | if (uid == null || uid <= 0)
|
| | | throw new TokenRecordException(1001, "温馨提示,[红包]需要登录后领取");
|
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为增值的一级队员;");
|
| | | tips.add("红包可提现,可购买折扣商品;");
|
| | | tips.add("成功领取后,请到“我的-红包”中查看。");
|
| | | } else {
|
| | | tips.add("红包可提现,可购买折扣商品;");
|
| | | tips.add("成功领取后,请到“我的-红包”中查看。");
|
| | | }
|
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.taoLiJin) {
|
| | | throw new TokenRecordException(1, "推广红包相关功能已下线!");
|
| | |
| | |
|
| | | TokenVO tokenVO = new TokenVO();
|
| | | tokenVO.setAmount(num);
|
| | | tokenVO.setMoney(money);
|
| | | tokenVO.setToken(parseToken);
|
| | | tokenVO.setNickName(nickName + "赠送");
|
| | | tokenVO.setPortrait(portrait);
|
| | |
| | | String msg = "领取成功";
|
| | | TokenTypeEnum tokenType = rokenRecord.getType();
|
| | | if (tokenType == TokenTypeEnum.freeCoupon) {
|
| | |
|
| | | // 赠送记录
|
| | | UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService
|
| | | .selectByPrimaryKey(Long.parseLong(identify));
|
| | |
| | | addInviteMsg(uid, giveUid, "返利奖励券");
|
| | | }
|
| | | });
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | try {
|
| | | msg = "领取红包成功,请到[我的-红包]中查看";
|
| | | // 领取红包、更新记录
|
| | | RedPackGiveRecord giveRecord = redPackGiveRecordService.receiveFriendsGive(uidToken, Long.parseLong(identify));
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | |
| | | String beiZhu = "无";
|
| | | String giveBeiZhu = "无";
|
| | | if (addTeam) {
|
| | | beiZhu = "你已成为赠送人的一级队员";
|
| | | giveBeiZhu = "领取人已成为你的一级队员";
|
| | | // 激活邀请信息
|
| | | addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
|
| | | }
|
| | | |
| | | // 领取人消息
|
| | | String giveUserName = "无";
|
| | | UserInfo giveuser = userInfoService.selectByPKey(giveUid);
|
| | | if (giveuser != null && !StringUtil.isNullOrEmpty(giveuser.getNickName()))
|
| | | giveUserName = giveuser.getNickName();
|
| | | MsgRedPackGiveContentDTO dto = new MsgRedPackGiveContentDTO();
|
| | | dto.setTitle("红包领取");
|
| | | dto.setUserInfo("昵称:" + giveUserName + " ID:" + giveUid);
|
| | | dto.setTime(sd.format(giveRecord.getGiveTime()));
|
| | | dto.setMoney("¥" + giveRecord.getAmount().setScale(2));
|
| | | userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackReceiveOff, new Gson().toJson(dto), beiZhu);
|
| | | |
| | | // 赠送人消息
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
|
| | | userName = user.getNickName();
|
| | | MsgRedPackGiveContentDTO givedto = new MsgRedPackGiveContentDTO();
|
| | | givedto.setTitle("红包领取");
|
| | | givedto.setUserInfo("昵称:" + userName + " ID:" + uid);
|
| | | givedto.setTime(sd.format(new Date()));
|
| | | givedto.setMoney("¥" + giveRecord.getAmount().setScale(2));
|
| | | userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackGiveOff, new Gson().toJson(givedto), giveBeiZhu);
|
| | | }
|
| | | });
|
| | | } catch (RedPackGiveRecordException e) {
|
| | | throw new TokenRecordException(1, e.getMsg());
|
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.taoLiJin) {
|
| | | throw new TokenRecordException(1, "推广红包相关功能已下线!");
|
| | | } else {
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | private ConfigService configService;
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public boolean addActivateCount(Long cpid, int limitNum) {
|
| | | UserSystemCouponActivate coupon = userSystemCouponActivateMapper.selectByPrimaryKey(cpid);
|
| | | if (coupon != null) {
|
| | | userSystemCouponActivateMapper.addCount(cpid, 1); |
| | | coupon.setCount(coupon.getCount() + 1);
|
| | | } else {
|
| | | coupon = new UserSystemCouponActivate();
|
| | | coupon.setId(cpid);
|
| | | coupon.setCount(1);
|
| | | coupon.setState(UserSystemCouponActivate.STATE_INIT);
|
| | | coupon.setCreateTime(new Date());
|
| | | coupon.setUpdateTime(new Date());
|
| | | userSystemCouponActivateMapper.insertSelective(coupon);
|
| | | }
|
| | | |
| | | // 是否满足激活条件
|
| | | Integer state = coupon.getState();
|
| | | if (state != UserSystemCouponActivate.STATE_END && coupon.getCount().intValue() >= limitNum) {
|
| | | UserSystemCouponActivate record = new UserSystemCouponActivate();
|
| | | record.setId(coupon.getId());
|
| | | record.setState(UserSystemCouponActivate.STATE_END);
|
| | | userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | public UserSystemCouponActivate selectForUpdate(Long id) {
|
| | | return userSystemCouponActivateMapper.selectForUpdate(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserSystemCouponActivate record) {
|
| | | userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.exception.user.UserSystemCouponException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Override
|
| | | @Transactional
|
| | | public void activateFreeCoupon(Long uid) {
|
| | | List<UserSystemCoupon> list = userSystemCouponMapper.getNeedActivateFreeCouponByType(uid, CouponTypeEnum.freeCoupon.name());
|
| | | if (list == null || list.size() == 0)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void triggerFreeCouponActivate(Long uid) {
|
| | | UserSystemCoupon coupon = userSystemCouponMapper.getNeedActivateCouponByType(uid, CouponTypeEnum.freeCoupon.name());
|
| | | if (coupon == null)
|
| | | return;
|
| | | |
| | | UserSystemCoupon coupon = list.get(0);
|
| | | Date nowDate = new Date();
|
| | | Date endTime2 = coupon.getEndTime();
|
| | | if (endTime2 != null && endTime2.getTime() <= nowDate.getTime())
|
| | | return; // 已失效
|
| | |
|
| | | SystemCoupon systemCoupon = coupon.getSystemCoupon();
|
| | | if (systemCoupon == null)
|
| | | return; // 券已不存在
|
| | |
|
| | | systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
|
| | | if (systemCoupon == null || systemCoupon.getType() != CouponTypeEnum.freeCoupon)
|
| | | return; // 券类型不匹配
|
| | |
|
| | | Long id = coupon.getId();
|
| | | UserSystemCouponActivate couponActivate = userSystemCouponActivateService.selectForUpdate(id);
|
| | |
|
| | | // 添加激活数量
|
| | | String activateNum = configService.get("free_coupon_activate_num");
|
| | | boolean activate = userSystemCouponActivateService.addActivateCount(coupon.getId(), Integer.parseInt(activateNum));
|
| | | // 激活数量
|
| | | boolean result = false;
|
| | | int limitNum = Integer.parseInt(configService.get("free_coupon_activate_num"));
|
| | |
|
| | | // 激活券
|
| | | if (activate) {
|
| | | Integer state = couponActivate.getState();
|
| | | int count = couponActivate.getCount();
|
| | | count++;
|
| | | if(count >= limitNum) {
|
| | | result = true;
|
| | | state = UserSystemCouponActivate.STATE_END;
|
| | | }
|
| | |
|
| | | try {
|
| | | Integer expiryDay = systemCoupon.getExpiryDay();
|
| | | String endDay = DateUtil.plusDay(expiryDay - 1, nowDate);
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | if (endDay != null && endDay.trim().length() > 0) {
|
| | | endDay += " 23:59:59";
|
| | | }
|
| | | Date endTime = format.parse(endDay);
|
| | |
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setId(coupon.getId());
|
| | | userCoupon.setStateActivated(1);
|
| | | userCoupon.setEndTime(endTime);
|
| | | userCoupon.setStartTime(nowDate);
|
| | | userCoupon.setUpdateTime(new Date());
|
| | | userSystemCouponMapper.updateByPrimaryKeySelective(userCoupon);
|
| | |
|
| | | // 赠送记录
|
| | | UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getByReceiveId(coupon.getId());
|
| | | if (giveRecord == null)
|
| | | return;
|
| | |
|
| | | Long giveUid = giveRecord.getGiveUid();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(giveUid);
|
| | | if (userInfo == null)
|
| | | return;
|
| | |
|
| | | String beiZhu = "请到我的-福利中心中查看";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherCouponActivateDTO msgOther = new MsgOtherCouponActivateDTO();
|
| | | msgOther.setTitle("免单券激活");
|
| | | msgOther.setType("免单券系统已自动激活");
|
| | | msgOther.setExplain("满足" + systemCoupon.getActivateDay() + "天内产生" + activateNum + "笔已到账返利订单");
|
| | | msgOther.setGiveUser("昵称:" + userInfo.getNickName() + " ID:" + giveUid);
|
| | | msgOther.setReceiveTime(sd.format(giveRecord.getReceiveTime()));
|
| | | msgOther.setValidityTime(expiryDay + "天");
|
| | | userOtherMsgNotificationService.giveCouponActivateMsg(uid, beiZhu, msgOther);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | UserSystemCouponActivate updateActivate = new UserSystemCouponActivate();
|
| | | updateActivate.setId(id);
|
| | | updateActivate.setState(state);
|
| | | updateActivate.setCount(count);
|
| | | updateActivate.setUpdateTime(new Date());
|
| | | userSystemCouponActivateService.updateByPrimaryKeySelective(updateActivate);
|
| | | |
| | | // 激活奖励券
|
| | | if (result) {
|
| | | activateFreeCoupon(coupon, limitNum);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 激活券
|
| | | * @param coupon
|
| | | * @param activateNum
|
| | | */
|
| | | @Transactional
|
| | | private void activateFreeCoupon(UserSystemCoupon coupon, int limitNum) {
|
| | | try {
|
| | | Date nowDate = new Date();
|
| | | SystemCoupon systemCoupon = coupon.getSystemCoupon();
|
| | | |
| | | Integer expiryDay = systemCoupon.getExpiryDay();
|
| | | String endDay = DateUtil.plusDay(expiryDay - 1, nowDate);
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | if (endDay != null && endDay.trim().length() > 0) {
|
| | | endDay += " 23:59:59";
|
| | | }
|
| | | Date endTime = format.parse(endDay);
|
| | |
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setId(coupon.getId());
|
| | | userCoupon.setStateActivated(1);
|
| | | userCoupon.setEndTime(endTime);
|
| | | userCoupon.setStartTime(nowDate);
|
| | | userCoupon.setUpdateTime(new Date());
|
| | | userSystemCouponMapper.updateByPrimaryKeySelective(userCoupon);
|
| | | |
| | | // 消息
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getByReceiveId(coupon.getId());
|
| | | if (giveRecord == null)
|
| | | return;
|
| | |
|
| | | Long giveUid = giveRecord.getGiveUid();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(giveUid);
|
| | | if (userInfo == null)
|
| | | return;
|
| | |
|
| | | String beiZhu = "请到我的-福利中心中查看";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherCouponActivateDTO msgOther = new MsgOtherCouponActivateDTO();
|
| | | msgOther.setTitle("免单券激活");
|
| | | msgOther.setType("免单券系统已自动激活");
|
| | | msgOther.setExplain("满足" + systemCoupon.getActivateDay() + "天内产生" + limitNum + "笔已到账返利订单");
|
| | | msgOther.setGiveUser("昵称:" + userInfo.getNickName() + " ID:" + giveUid);
|
| | | msgOther.setReceiveTime(sd.format(giveRecord.getReceiveTime()));
|
| | | msgOther.setValidityTime(expiryDay + "天");
|
| | | userOtherMsgNotificationService.giveCouponActivateMsg(coupon.getUid(), beiZhu, msgOther);
|
| | | }
|
| | | });
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | |
| | | public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu);
|
| | |
|
| | | /**
|
| | | * 红包消息
|
| | | */
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu);
|
| | | |
| | | /**
|
| | | * 补贴消息
|
| | | *
|
| | | * @param uid
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<Long> countState(long uid);
|
| | | public Long countByUidAndState(long uid, Integer state);
|
| | |
|
| | | /**
|
| | | * 统计各个状态金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<BigDecimal> countMoneyState(long uid);
|
| | |
|
| | | /**
|
| | | * 获取申请
|
| | |
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countMoneyByState(Long uid, Integer state);
|
| | | public BigDecimal countMoneyByUidAndState(Long uid, Integer state);
|
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | |
|
| | | public interface RedPackGiveRecordService {
|
| | |
| | | */
|
| | | public String giving(Long uid, BigDecimal amount) throws RedPackGiveRecordException;
|
| | |
|
| | | /**
|
| | | * 查询记录
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public RedPackGiveRecord selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 更新记录
|
| | | * @param record
|
| | | */
|
| | | public void updateByPrimaryKeySelective(RedPackGiveRecord record);
|
| | |
|
| | | /**
|
| | | * 口令红包领取
|
| | | * @param uid
|
| | | * @param id
|
| | | * @throws RedPackGiveRecordException
|
| | | */
|
| | | public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException;
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | public interface UserSystemCouponActivateService {
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
|
| | |
|
| | | /**
|
| | | * 更新待激活数量,并返回是否可以激活
|
| | | * @param cpid 用户券id
|
| | | * @param num 限制数量
|
| | | * @return
|
| | | */
|
| | | public boolean addActivateCount(Long cpid, int num);
|
| | | public interface UserSystemCouponActivateService {
|
| | |
|
| | | /**
|
| | | * 查询满足条件的数量
|
| | |
| | | */
|
| | | public int getActivateCount(Long id);
|
| | |
|
| | | /**
|
| | | * 查询用于更新
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public UserSystemCouponActivate selectForUpdate(Long id);
|
| | |
|
| | | /**
|
| | | * 选择性更新
|
| | | * @param record
|
| | | */
|
| | | public void updateByPrimaryKeySelective(UserSystemCouponActivate record);
|
| | |
|
| | | }
|
| | |
| | | public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type);
|
| | |
|
| | | /**
|
| | | * 激活免单券---订单已到账 TODO 待调用
|
| | | * 激活免单券---订单已到账 触发激活免单券
|
| | | * @param uid
|
| | | */
|
| | | public void activateFreeCoupon(Long uid);
|
| | | public void triggerFreeCouponActivate(Long uid);
|
| | |
|
| | | }
|
| | |
| | |
|
| | |
|
| | |
|
| | | public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord, String desc, RedPackDetailTypeEnum type) throws RedPackDetailException {
|
| | | if (giveRecord == null || type == null)
|
| | | throw new RedPackDetailException(1, "提现记录、类型不能为空");
|
| | | |
| | | // 红包明细- 退回红包
|
| | | /**
|
| | | * 赠送好友明细
|
| | | * @param giveRecord
|
| | | * @return
|
| | | * @throws RedPackDetailException
|
| | | */
|
| | | public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord) throws RedPackDetailException {
|
| | | if (giveRecord == null)
|
| | | throw new RedPackDetailException(1, "赠送记录不能为空");
|
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setDisplay(true);
|
| | | detail.setUid(giveRecord.getGiveUid());
|
| | | detail.setMoney(new BigDecimal("-" + giveRecord.getAmount()));
|
| | | detail.setType(RedPackDetailTypeEnum.giveOthers);
|
| | | detail.setTitle(RedPackDetailTypeEnum.giveOthers.getDesc());
|
| | | detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId()));
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | | |
| | | /**
|
| | | * 赠送成功
|
| | | * @param id
|
| | | * @param giveRecord
|
| | | * @return
|
| | | * @throws RedPackDetailException
|
| | | */
|
| | | public static RedPackDetail createGiveOthersSucceed(Long id, RedPackGiveRecord giveRecord) throws RedPackDetailException {
|
| | | if (giveRecord == null)
|
| | | throw new RedPackDetailException(1, "赠送记录不能为空");
|
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setId(id);
|
| | | detail.setDisplay(true);
|
| | | detail.setType(RedPackDetailTypeEnum.giveOthersSucceed);
|
| | | detail.setTitle(RedPackDetailTypeEnum.giveOthersSucceed.getDesc());
|
| | | detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersSucceed.name() + ":" + giveRecord.getId()));
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 赠送失败
|
| | | * @param giveRecord
|
| | | * @return
|
| | | * @throws RedPackDetailException
|
| | | */
|
| | | public static RedPackDetail createGiveOthersFail(RedPackGiveRecord giveRecord) throws RedPackDetailException {
|
| | | if (giveRecord == null)
|
| | | throw new RedPackDetailException(1, "赠送记录不能为空");
|
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setDisplay(true);
|
| | | detail.setUid(giveRecord.getGiveUid());
|
| | | detail.setMoney(giveRecord.getAmount());
|
| | | detail.setDesc(desc);
|
| | | detail.setType(type);
|
| | | detail.setTitle(type.getDesc());
|
| | | detail.setIdentifyCode(StringUtil.Md5(type.name() + ":" + giveRecord.getId()));
|
| | | detail.setType(RedPackDetailTypeEnum.giveOthersFail);
|
| | | detail.setTitle(RedPackDetailTypeEnum.giveOthersFail.getDesc());
|
| | | detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersFail.name() + ":" + giveRecord.getId()));
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 赠送失败
|
| | | * @param giveRecord
|
| | | * @return
|
| | | * @throws RedPackDetailException
|
| | | */
|
| | | public static RedPackDetail createGiveOthersReceive(RedPackGiveRecord giveRecord) throws RedPackDetailException {
|
| | | if (giveRecord == null)
|
| | | throw new RedPackDetailException(1, "赠送记录不能为空");
|
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setDisplay(true);
|
| | | detail.setUid(giveRecord.getReceiveUid());
|
| | | detail.setMoney(giveRecord.getAmount());
|
| | | detail.setType(RedPackDetailTypeEnum.giveOthersReceive);
|
| | | detail.setTitle(RedPackDetailTypeEnum.giveOthersReceive.getDesc());
|
| | | detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersReceive.name() + ":" + giveRecord.getId()));
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | |
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | |
| | | * 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertCommonGoods(CommonGoods goods, String pid, BigDecimal fanLiRate,
|
| | | BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertCommonGoods(CommonGoods goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setGoodsId(goods.getGoodsId());
|
| | | goodsInfo.setTitle(goods.getTitle());
|
| | |
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | moneyInfoVO.setFanliMoney(CommonGoodsUtil.getCommissionInfo(goods, fanLiRate));
|
| | | moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, shareRate));
|
| | | |
| | | BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 券信息
|
| | |
| | | shop.setId(goods.getSellerId().toString());
|
| | | goodsInfo.setShopInfo(shop);
|
| | | }
|
| | |
|
| | | }
|
| | | |
| | | if (Constant.IS_TEST) {
|
| | | // 添加标签
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | if (labels == null) |
| | | labels = new ArrayList<>();
|
| | | |
| | | labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | |
| | | * 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, BigDecimal fanLiRate,
|
| | | BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setBaoyou(true);
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | |
| | | TaoBaoHongBaoInfo taoBaoHongBaoInfo = goods.getTaoBaoHongBaoInfo();
|
| | | moneyInfoVO.setFanliMoney("¥" + taoBaoHongBaoInfo.getHongbao());
|
| | | moneyInfoVO.setShareMoney("¥" + taoBaoHongBaoInfo.getHongbao());
|
| | | moneyInfoVO.setMaxMoney("¥" + taoBaoHongBaoInfo.getHongbao().add(MoneyBigDecimalUtil.mul(taoBaoHongBaoInfo.getHongbao(), params.getMaxRewardRate())));
|
| | | } else {
|
| | | moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
|
| | | BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
|
| | | }
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | |
| | | goodsInfo.setShopInfo(shop);
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | // 添加标签
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | if (labels == null) |
| | | labels = new ArrayList<>();
|
| | | |
| | | labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | |
| | | * 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, String pid, BigDecimal fanLiRate,
|
| | | BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setBaoyou(true);
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | |
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
|
| | | BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 券信息
|
| | |
| | | coupon.setStartTime(goods.getCouponEffectiveStartTime().replace("-", "."));
|
| | | }
|
| | |
|
| | | coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), pid, goods.getAuctionId() + ""));
|
| | | coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), null, goods.getAuctionId() + ""));
|
| | | coupon.setStartFee(goods.getCouponStartFee());
|
| | |
|
| | | goodsInfo.setHasCoupon(true);
|
| | |
| | | }
|
| | |
|
| | | if (TaoBaoUtil.isYUShou(goods)) {// 预售商品
|
| | | goodsInfo = loadYuShouInfo(goodsInfo, goods, pid, fanLiRate, shareRate);
|
| | | goodsInfo = loadYuShouInfo(goodsInfo, goods, null, params.getFanLiRate(), params.getShareRate());
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | |
| | | if (goodsInfo.getLabels() == null)
|
| | | goodsInfo.setLabels(new ArrayList<>());
|
| | | goodsInfo.getLabels().add(new ClientTextStyleVO("预售", "#FF2B4E"));
|
| | | |
| | | }
|
| | | return goodsInfo;
|
| | | }
|
| | |
| | | * 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, BigDecimal fanLiRate, BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD);
|
| | | goodsInfo.setGoodsId(goods.getSkuId());
|
| | |
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | moneyInfoVO.setFanliMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, fanLiRate));
|
| | | moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, shareRate));
|
| | | BigDecimal commission = JDUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | JDCouponInfo couponInfo = goods.getCouponInfo();
|
| | |
| | | if (isFreeShipping != null && isFreeShipping == 1) {
|
| | | goodsInfo.setBaoyou(true);
|
| | | }
|
| | | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | |
| | | * 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, BigDecimal fanLiRate, BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setBaoyou(true);
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD);
|
| | |
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | | moneyInfoVO.setFanliMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, fanLiRate));
|
| | | moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate));
|
| | | BigDecimal commission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
|
| | | moneyInfoVO.setFanliMoney("¥" + commission);
|
| | | moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
|
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | Boolean hasCoupon = goods.getHasCoupon();
|
| | |
| | | goodsInfo.setShopInfo(shop);
|
| | | }
|
| | |
|
| | | |
| | | if (Constant.IS_TEST) {
|
| | | // 添加标签
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | if (labels == null) |
| | | labels = new ArrayList<>();
|
| | | |
| | | labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
|
| | | labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class MsgMoneyDetailFactory {
|
| | |
|
| | |
| | | detail.setUser(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 红包相关信息
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param content
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgMoneyDetail createRedPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
|
| | | if (uid == null || type == null || StringUtil.isNullOrEmpty(content))
|
| | | return null;
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setRead(false);
|
| | | detail.setContent(content);
|
| | | detail.setMsgType(type);
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请订单补贴
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()), COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | |
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | }
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送人", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送时间", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取金额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取人", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取时间", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送金额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass) { // 红包提现成功
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getHandle() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("审核方式", COLOR_TITLE), contentList));
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现金额", COLOR_TITLE), contentList));
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getBalance() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | |
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getReason() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("失败原因", COLOR_TITLE), contentList));
|
| | | |
| | | String handle = dto.getHandle();
|
| | | if (StringUtil.isNullOrEmpty(handle))
|
| | | handle = "无";
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(handle, COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("处理", COLOR_TITLE), contentList));
|
| | | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.coupon;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.order.OrderMoneyRecievedMQMsgDTO;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Component
|
| | | public class SystemCouponMessageListener implements MessageListener {
|
| | | |
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
|
| | |
| | | && orderMoneyRecievedMQMsgDTO.getOrderFirst() == true) {
|
| | | // 首次到账返利
|
| | | // TODO 业务代码添加
|
| | |
|
| | | |
| | | // 激活免单券
|
| | | userSystemCouponService.triggerFreeCouponActivate(orderMoneyRecievedMQMsgDTO.getUid());
|
| | | |
| | | // 业务代码执行成功后返回
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
| | | private int moneyType;// 资金类型
|
| | | @Expose
|
| | | private String shareMoney;// 分享奖金
|
| | | @Expose
|
| | | private String maxMoney;// 最高返回
|
| | |
|
| | | public String getFanliMoney() {
|
| | | return fanliMoney;
|
| | |
| | | public void setShareMoney(String shareMoney) {
|
| | | this.shareMoney = shareMoney;
|
| | | }
|
| | |
|
| | | public String getMaxMoney() {
|
| | | return maxMoney;
|
| | | }
|
| | |
|
| | | public void setMaxMoney(String maxMoney) {
|
| | | this.maxMoney = maxMoney;
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | @Expose // 数量、面额
|
| | | private Integer amount;
|
| | |
|
| | | @Expose // 数量、面额--- V2
|
| | | private String money;
|
| | |
|
| | | @Expose // 提示语
|
| | | private List<String> tips;
|
| | |
| | | public void setState(Boolean state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(String money) {
|
| | | this.money = money;
|
| | | }
|
| | | }
|