| | |
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoKeGoodsService taoKeGoodsService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | |
|
| | | private static List<CommonContentNav> getCommonNav() {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | |
| | | navList.add(new CommonContentNav(gc.getId() + "", gc.getName()));
|
| | | }
|
| | | } else if (type == CommonContentTypeEnum.chaoSheng) {
|
| | | navList.add(new CommonContentNav("1", "5%~10%返利"));
|
| | | navList.add(new CommonContentNav("2", "10%~20%返利"));
|
| | | navList.add(new CommonContentNav("3", "20%~30%返利"));
|
| | | navList.add(new CommonContentNav("4", "30%~40%返利"));
|
| | | navList.add(new CommonContentNav("5", "40%以上返利"));
|
| | | navList.add(new CommonContentNav("1", "1-5元返利"));
|
| | | navList.add(new CommonContentNav("2", "5-10元返利 "));
|
| | | navList.add(new CommonContentNav("3", "10-15元返利"));
|
| | | navList.add(new CommonContentNav("4", "15-20元返利"));
|
| | | navList.add(new CommonContentNav("5", "20元以上返利"));
|
| | | } else if (type == CommonContentTypeEnum.haoQuan) {
|
| | | navList.add(new CommonContentNav("1", "5~10元券"));
|
| | | navList.add(new CommonContentNav("2", "10~30元券"));
|
| | | navList.add(new CommonContentNav("3", "30~50元券"));
|
| | | navList.add(new CommonContentNav("4", "50元以上券"));
|
| | | navList.add(new CommonContentNav("1", "1-5元券"));
|
| | | navList.add(new CommonContentNav("2", "5-10元券"));
|
| | | navList.add(new CommonContentNav("3", "10-20元券"));
|
| | | navList.add(new CommonContentNav("4", "20-30元券"));
|
| | | navList.add(new CommonContentNav("5", "30-50元券"));
|
| | | navList.add(new CommonContentNav("6", "50元以上券"));
|
| | | } else if (type == CommonContentTypeEnum.juJia) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.meiShi) {
|
| | |
| | | return getQiCheHuWaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoPinReMai) {
|
| | | return getChaoPinReMaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoSheng) {
|
| | | return getCaoShengContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.haoQuan) {
|
| | | return getHaoQuanContent(cid, page, pageSize);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 9快9包邮
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult get9K9Content(String cid, int page, int pageSize) {
|
| | | if (pageSize == 20)
|
| | | pageSize = 50;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 超级省钱
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getCaoShengContent(String cid, int page, int pageSize) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | Integer startAmount = null;
|
| | | Integer endAmount = null;
|
| | |
|
| | | if (cid.equalsIgnoreCase(1 + "")) {
|
| | | startAmount = 1;
|
| | | endAmount = 5;
|
| | | } else if (cid.equalsIgnoreCase(2 + "")) {
|
| | | startAmount = 5;
|
| | | endAmount = 10;
|
| | | } else if (cid.equalsIgnoreCase(3 + "")) {
|
| | | startAmount = 10;
|
| | | endAmount = 15;
|
| | | } else if (cid.equalsIgnoreCase(4 + "")) {
|
| | | startAmount = 15;
|
| | | endAmount = 20;
|
| | | } else if (cid.equalsIgnoreCase(5 + "")) {
|
| | | startAmount = 20;
|
| | | endAmount = 10000;
|
| | | }
|
| | |
|
| | | double tkRate = 20.00;
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listQueryByRebateAmount((page - 1) * pageSize, pageSize,
|
| | | proportion.toString(), startAmount, endAmount, tkRate);
|
| | |
|
| | | long count = qualityGoodsService.countQueryByRebateAmount(proportion.toString(), startAmount, endAmount,
|
| | | tkRate);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | // 遍历列表数据
|
| | | if (listQuery != null)
|
| | | for (QualityFactory quality : listQuery) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | int biz30day = taoBaoGoodsBrief.getBiz30day();
|
| | | if (biz30day >= 10000) {
|
| | | double sales = biz30day;
|
| | | String salesCountMidea = String.format("%.1f", sales / 10000);
|
| | | taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
|
| | | } else {
|
| | | taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | }
|
| | | goodsList.add(taoBaoGoodsBrief);
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 高额好券
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getHaoQuanContent(String cid, int page, int pageSize) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | Integer startAmount = null;
|
| | | Integer endAmount = null;
|
| | |
|
| | | if (cid.equalsIgnoreCase(1 + "")) {
|
| | | startAmount = 1;
|
| | | endAmount = 5;
|
| | | } else if (cid.equalsIgnoreCase(2 + "")) {
|
| | | startAmount = 5;
|
| | | endAmount = 10;
|
| | | } else if (cid.equalsIgnoreCase(3 + "")) {
|
| | | startAmount = 10;
|
| | | endAmount = 20;
|
| | | } else if (cid.equalsIgnoreCase(4 + "")) {
|
| | | startAmount = 20;
|
| | | endAmount = 30;
|
| | | } else if (cid.equalsIgnoreCase(5 + "")) {
|
| | | startAmount = 30;
|
| | | endAmount = 50;
|
| | | } else if (cid.equalsIgnoreCase(6 + "")) {
|
| | | startAmount = 50;
|
| | | endAmount = 10000;
|
| | | }
|
| | |
|
| | | Integer startPropor = 20;
|
| | |
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listQueryByCouponAmount((page - 1) * pageSize, pageSize,
|
| | | startAmount, endAmount, startPropor);
|
| | |
|
| | | long count = qualityGoodsService.countQueryByCouponAmount(startAmount, endAmount, startPropor);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | |
|
| | | // 遍历列表数据
|
| | |
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
|
| | |
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | int biz30day = taoBaoGoodsBrief.getBiz30day();
|
| | | if (biz30day >= 10000) {
|
| | | double sales = biz30day;
|
| | | String salesCountMidea = String.format("%.1f", sales / 10000);
|
| | | taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
|
| | | } else {
|
| | | taoBaoGoodsBrief.setSalesCount(biz30day + "");
|
| | | }
|
| | | goodsList.add(taoBaoGoodsBrief);
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 居家生活
|
| | | *
|
| | | * @param cid
|