| | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate != null && goodsEvaluate.getImgList() != null && goodsEvaluate.getImgList().size() > 0) { |
| | | activityUrl = goodsEvaluate.getJumpLink(); |
| | | |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList(); |
| | | for (ImgInfo imgInfo : imgList) { |
| | | ImgEnum type = imgInfo.getType(); |
| | |
| | | videoUrl = imgInfo.getVideoUrl(); |
| | | } else { |
| | | list.add(imgInfo.getUrl()); |
| | | if (StringUtil.isNullOrEmpty(activityUrl) && !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | activityUrl = imgInfo.getActivityUrl(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialCardException;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key
|
| | | * 模糊查询:说明、标识
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryActivity")
|
| | | public void queryActivity(String callback, Integer pageIndex, Integer pageSize, String key, Integer sort, |
| | | PrintWriter out) {
|
| | | |
| | | List<Long> listPid = new ArrayList<Long>();
|
| | | listPid.add(15L);
|
| | | listPid.add(16L);
|
| | | listPid.add(17L);
|
| | | queryList(callback, pageIndex, pageSize, key, sort, listPid, out);
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sort, PrintWriter out) {
|
| | | queryList(callback, pageIndex, pageSize, key, sort, null, out);
|
| | | }
|
| | |
|
| | | public void queryList(String callback, Integer pageIndex, Integer pageSize, String key, Integer sort, |
| | | List<Long> listPid, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | List<SpecialCard> list = specialCardService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sort);
|
| | | List<SpecialCard> list = specialCardService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sort, listPid);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = specialCardService.countlistQuery(key);
|
| | | long count = specialCardService.countlistQuery(key, listPid);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveSpecial")
|
| | | public void saveSpecial(String callback, Special record, String jumpType, SpecialExtra extra, HttpServletRequest request,
|
| | | public void saveSpecial(String callback, Special record, String jumpType, CommonShareInfo extra, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private AdActivityVersionControlService adActivityVersionControlService;
|
| | | |
| | | @Resource
|
| | | private CommonShareInfoService commonShareInfoService;
|
| | | |
| | |
|
| | | /**
|
| | | * 新增
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | List<SwiperPicture> list = swiperPictureService.queryByBannerID((pageIndex - 1) * pageSize, pageSize,
|
| | | List<BannerVO> list = swiperPictureService.queryByBannerID((pageIndex - 1) * pageSize, pageSize,
|
| | | bannerId);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | |
| | |
|
| | | // 跳转链接
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | for (SwiperPicture swiperPicture : list) {
|
| | | for (BannerVO swiperPicture : list) {
|
| | | if (swiperPicture.getState() != null && swiperPicture.getState() == 0) {
|
| | | swiperPicture.setState(1);
|
| | | } else {
|
| | |
| | | jumpDetailV2.setName("-未选择-");
|
| | | jumpDetailV2.setType("default");
|
| | | swiperPicture.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | | |
| | | // 分享补充信息
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(swiperPicture.getId(),
|
| | | CommonShareInfoEnum.banner.name());
|
| | | if (info == null) {
|
| | | swiperPicture.setNeedSpin(false);
|
| | | swiperPicture.setComment("");
|
| | | } else {
|
| | | swiperPicture.setNeedSpin(info.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | swiperPicture.setComment("");
|
| | | } else {
|
| | | swiperPicture.setComment(info.getComment());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "savePicInfo")
|
| | | public void savePicInfo(String callback, SwiperPicture record, String jumpType, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | public void savePicInfo(String callback, SwiperPicture record, String jumpType, CommonShareInfo extra, |
| | | HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | swiperPictureService.saveObject(fileRequest.getFile("file"), record, jumpType);
|
| | | swiperPictureService.saveObject(fileRequest.getFile("file"), record, jumpType, extra);
|
| | | } else {
|
| | | swiperPictureService.saveObject(null, record, jumpType);
|
| | | swiperPictureService.saveObject(null, record, jumpType, extra);
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | List<SwiperPicture> list = swiperPictureService.getByBannerCard(card);
|
| | | List<BannerVO> list = swiperPictureService.getByBannerCard(card);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | for (SwiperPicture swiperPicture: list) {
|
| | | for (BannerVO swiperPicture: list) {
|
| | | swiperPicture.setBannerId(null);
|
| | | swiperPicture.setCreatetime(null);
|
| | | swiperPicture.setUpdatetime(null);
|
| | |
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoods;
|
| | |
| | | import com.yeshi.fanli.util.email.MailSenderUtil;
|
| | | import com.yeshi.fanli.util.factory.shop.BanLiShopOrderGoodsVOFactory;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.shop.BanLiShopOrderVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | Constant.PAGE_SIZE);
|
| | | long count = banLiShopGoodsService.countGoods(null, BanLiShopGoods.STATE_ONLINE);
|
| | | // 获取banner
|
| | | List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("hongbao_exchange_goods_list",
|
| | | List<BannerVO> pictureList = swiperPictureService.getByBannerCardAndVersion("hongbao_exchange_goods_list",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.user.UserDialogBtnVO;
|
| | | import com.yeshi.fanli.vo.user.UserDialogVO;
|
| | | import com.yeshi.fanli.vo.user.VIPUpgradedNotifyVO;
|
| | |
| | | data.put("banner", new JSONArray());
|
| | | } else {
|
| | | // 我的界面banner
|
| | | List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | List<BannerVO> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banner == null)
|
| | | banner = new ArrayList<SwiperPicture>();
|
| | | banner = new ArrayList<BannerVO>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | |
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | }
|
| | |
|
| | | // 轮播图
|
| | | List<SwiperPicture> picList = null;
|
| | | List<BannerVO> picList = null;
|
| | | if (swpid != null) {
|
| | | picList = swiperPictureService.getByBannerId(swpid, acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | | if (picList == null) {
|
| | | picList = new ArrayList<SwiperPicture>();
|
| | | picList = new ArrayList<BannerVO>();
|
| | | }
|
| | |
|
| | | List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1,
|
| | |
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | data.put("activityRules", valueBr);
|
| | | data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html",
|
| | | Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
|
| | | List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",
|
| | | List<BannerVO> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (pictureList != null && pictureList.size() > 0) {
|
| | | SwiperPicture picture = pictureList.get(0);
|
| | | BannerVO picture = pictureList.get(0);
|
| | | com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject();
|
| | | pictureJson.put("src", picture.getSrc());
|
| | | pictureJson.put("jumpDetail", picture.getJumpDetail());
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | | import com.yeshi.fanli.vo.goods.taobao.TLJBuyHongBaoVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<SwiperPicture> listswiper = null;
|
| | | List<BannerVO> listswiper = null;
|
| | | if (!StringUtil.isNullOrEmpty(specialCard)) {
|
| | | try {
|
| | |
|
| | | listswiper = swiperPictureService.getByBannerCardAndVersion(swiperCard, acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | if (listswiper == null) {
|
| | | listswiper = new ArrayList<SwiperPicture>();
|
| | | listswiper = new ArrayList<BannerVO>();
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | Special miaoShaSpecial = null;
|
| | | List<Special> honestList = new ArrayList<Special>();
|
| | | List<Special> specialList = new ArrayList<Special>();
|
| | | List<SpecialVO> honestList = new ArrayList<SpecialVO>();
|
| | | List<SpecialVO> specialList = new ArrayList<SpecialVO>();
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialCard)) {
|
| | | try {
|
| | | List<Special> listSpecial = specialService.listBySystemAndCard(specialCard, system.getId());
|
| | |
|
| | | List<SpecialVO> listSpecial = specialService.listBySystemAndCard(specialCard, system.getId());
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special : listSpecial) {
|
| | |
|
| | | for (SpecialVO special : listSpecial) {
|
| | | if ("限时秒杀".equals(special.getName())) {
|
| | | miaoShaSpecial = special;
|
| | | continue;
|
| | |
| | | // 其他专题
|
| | | specialList.add(special);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /* 限时秒杀 - 时间处理 */
|
| | |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> topPicList = getSwiperByCard("index_top", acceptData);
|
| | | List<BannerVO> topPicList = getSwiperByCard("index_top", acceptData);
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | topPicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | |
|
| | | // 3、邀请有奖
|
| | | List<SwiperPicture> invitePicList = null;
|
| | | List<BannerVO> invitePicList = null;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | |
| | | }
|
| | |
|
| | | if (invitePicList == null) {
|
| | | invitePicList = new ArrayList<SwiperPicture>();
|
| | | invitePicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
|
| | |
|
| | |
| | | * @param acceptData
|
| | | * @return
|
| | | */
|
| | | public List<SwiperPicture> getInvitePicList(Long uid, AcceptData acceptData) {
|
| | | public List<BannerVO> getInvitePicList(Long uid, AcceptData acceptData) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | List<SwiperPicture> invitePicList = getSwiperByCard("index_invite", acceptData);
|
| | | List<BannerVO> invitePicList = getSwiperByCard("index_invite", acceptData);
|
| | |
|
| | | return invitePicList;
|
| | | }
|
| | |
|
| | | public List<SwiperPicture> getSwiperByCard(String card, AcceptData acceptData) {
|
| | | List<SwiperPicture> swiperList = null;
|
| | | public List<BannerVO> getSwiperByCard(String card, AcceptData acceptData) {
|
| | | List<BannerVO> swiperList = null;
|
| | | try {
|
| | | swiperList = swiperPictureService.getByBannerCardAndVersion(card, acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
| | | */
|
| | | @RequestMapping(value = "getSpecialActivities")
|
| | | public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out, String callback) {
|
| | | List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "special_activities",
|
| | | List<SpecialVO> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "special_activities",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | List<Special> list = new ArrayList<Special>();
|
| | | List<SpecialVO> list = new ArrayList<SpecialVO>();
|
| | | if (listSpecial != null) {
|
| | | list.addAll(listSpecial);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Special special = list.get(i);
|
| | |
|
| | | SpecialVO special = list.get(i);
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail.setNeedLogin(special.isJumpLogin());
|
| | | special.setJumpDetail(jumpDetail);
|
| | | }
|
| | |
|
| | | String name = special.getName();
|
| | | if (StringUtil.isNullOrEmpty(name)) {
|
| | | continue;
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.user.UserSystemCouponException;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponVO;
|
| | |
|
| | |
| | | // 福利中心图片
|
| | | String topPicture = null;
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (listswiper != null && listswiper.size() > 0) {
|
| | | topPicture = listswiper.get(0).getSrc();
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.brand.BrandInfoRecord;
|
| | | import com.yeshi.fanli.entity.brand.BrandShopCahe;
|
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | |
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | }
|
| | |
|
| | | List<TaoBaoShop> shopList = new ArrayList<TaoBaoShop>();
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | List<BannerVO> topPicList = new ArrayList<>();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(id);
|
| | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1 && cid == null) { // 精选页banner
|
| | | List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("brand_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> banners = swiperPictureService.getByBannerCardAndVersion("brand_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banners == null)
|
| | | banners = new ArrayList<>();
|
| | | data.put("banners", JsonUtil.getApiCommonGson().toJson(banners));
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1 && array.size() > 0) {
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> topPicList = new ArrayList<>();
|
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> bannerList = null;
|
| | | List<BannerVO> bannerList = null;
|
| | | if (Constant.IS_TEST) {
|
| | | bannerList = swiperPictureService.getByBannerCardAndVersion("index_top", acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | |
|
| | | if (bannerList == null) {
|
| | | bannerList = new ArrayList<SwiperPicture>();
|
| | | bannerList = new ArrayList<BannerVO>();
|
| | | }
|
| | |
|
| | | data.put("bannerList", new Gson().toJson(bannerList));
|
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo; |
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; |
| | |
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService; |
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService; |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService; |
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.vo.dynamic.ArticleVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.homemodule.BannerVO; |
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO; |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | |
| | |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | @Resource |
| | | private SpecialExtraService specialExtraService; |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | |
| | | |
| | |
| | | listKey.add("special_channel_pdd"); |
| | | } |
| | | |
| | | List<Special> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, |
| | | List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, |
| | | listKey, platformCode, Integer.parseInt(acceptData.getVersion())); |
| | | |
| | | long time = System.currentTimeMillis(); |
| | | |
| | | // 删除尚未启用的过期的 |
| | | List<SpecialVO> listVo = new ArrayList<SpecialVO>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | |
| | | } |
| | | } |
| | | |
| | | SpecialVO specialVO = new SpecialVO(); |
| | | try { |
| | | PropertyUtils.copyProperties(specialVO, special); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 设置标签 |
| | | List<SpecialLabel> listLabels = specialVO.getListLabels(); |
| | | List<SpecialLabel> listLabels = special.getListLabels(); |
| | | if (listLabels != null && !listLabels.isEmpty()) { |
| | | List<ClientTextStyleVO> labels = new ArrayList<>(); |
| | | for (SpecialLabel specialLabel : listLabels) { |
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor())); |
| | | } |
| | | specialVO.setLabels(labels); |
| | | special.setLabels(labels); |
| | | } |
| | | |
| | | // 评论信息 |
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId()); |
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getComment())) { |
| | | specialVO.setComment(extra.getComment()); |
| | | } |
| | | } |
| | | listVo.add(specialVO); |
| | | } |
| | | |
| | | long count = specialService.countByPlaceKeyList(listKey, platformCode, |
| | |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(listVo)); |
| | | data.put("list", gson.toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (page == 1 && !search) { |
| | | List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("article_banners", |
| | | List<BannerVO> banners = swiperPictureService.getByBannerCardAndVersion("article_banners", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())); |
| | | if (banners == null) |
| | | banners = new ArrayList<>(); |
| | | data.put("banners", gson.toJson(banners)); |
| | | |
| | | List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "article_specials", |
| | | List<SpecialVO> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "article_specials", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())); |
| | | if (listSpecial == null) |
| | | listSpecial = new ArrayList<>(); |
| | | |
| | | for (Special special : listSpecial) { |
| | | for (SpecialVO special : listSpecial) { |
| | | boolean needLogin = special.isJumpLogin(); |
| | | JumpDetailV2 jumpDetail = special.getJumpDetail(); |
| | | if (jumpDetail != null) { |
| | |
| | | */ |
| | | @RequestMapping(value = "getDynamicList", method = RequestMethod.POST) |
| | | public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, PrintWriter out) { |
| | | |
| | | try { |
| | | int type = 1; |
| | | if (cid == TYPE_FAQUAN) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 评论复制 |
| | | * 评论复制-H5 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | |
| | | return; |
| | | } |
| | | |
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(id); |
| | | if (extra == null || StringUtil.isNullOrEmpty(extra.getComment())) { |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(id, CommonShareInfoEnum.special.name()); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | String text = extra.getComment(); |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (extra.getNeedSpin() != null && extra.getNeedSpin()) { |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "getActivityDetail") |
| | | public void getActivityDetail(String callback, AcceptData acceptData, Long uid, String type, String id, PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | String title = ""; |
| | | String comment = ""; |
| | | String params = ""; |
| | | JumpDetailV2 jumpDetail = null; |
| | | List<String> imgs = new ArrayList<>(); |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | GoodsEvaluate evaluate = goodsEvaluateService.getById(id); |
| | | if (evaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | |
| | | title = evaluate.getTitle(); |
| | | List<CommentInfo> comments = evaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | comment = comments.get(0).getContent(); |
| | | } |
| | | |
| | | String jumpLink = null; |
| | | if (!StringUtil.isNullOrEmpty(evaluate.getJumpLink())) { |
| | | jumpLink = evaluate.getJumpLink(); |
| | | } |
| | | |
| | | List<ImgInfo> imgList = evaluate.getImgList(); |
| | | if (imgList != null && imgList.size() > 0) { |
| | | for (ImgInfo imgInfo : imgList) { |
| | | if (imgInfo.getType() == ImgEnum.img && !StringUtil.isNullOrEmpty(imgInfo.getUrl())) { |
| | | imgs.add(imgInfo.getUrl()); |
| | | } |
| | | |
| | | if (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.video) { |
| | | if (StringUtil.isNullOrEmpty(jumpLink) && !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | jumpLink = imgInfo.getActivityUrl(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode, Integer.parseInt(acceptData.getVersion())); |
| | | JSONObject inner = new JSONObject(); |
| | | inner.put("url", jumpLink); |
| | | params = inner.toString(); |
| | | } else { |
| | | long pid = Long.parseLong(id); |
| | | if (CommonShareInfoEnum.special.name().equalsIgnoreCase(type)) { |
| | | Special special = specialService.selectByPrimaryKey(pid); |
| | | if (special == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | |
| | | params = special.getParams(); |
| | | jumpDetail = special.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(special.getPicture())) { |
| | | imgs.add(special.getPicture()); |
| | | } |
| | | } else if (CommonShareInfoEnum.banner.name().equalsIgnoreCase(type)) { |
| | | SwiperPicture swiper = swiperPictureService.selectByPrimaryKey(pid); |
| | | if (swiper == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | params = swiper.getParams(); |
| | | jumpDetail = swiper.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(swiper.getSrc())) { |
| | | imgs.add(swiper.getSrc()); |
| | | } |
| | | } |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo != null && !StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | comment = shareInfo.getComment(); |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("title", title); |
| | | data.put("comment", comment); |
| | | data.put("params", params); |
| | | data.put("jumpDetail", jumpDetail); |
| | | data.put("imgs", imgs); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copyShareComment") |
| | | public void copyShareComment(String callback, AcceptData acceptData, Long uid, String id, |
| | | String type, PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | copyActivityComment(callback, acceptData, uid, id, out); |
| | | return; |
| | | } |
| | | |
| | | long pid = Long.parseLong(id); |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 评论复制 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | private void copyActivityComment(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | String text = ""; |
| | | CommentInfo comment = null; |
| | | List<CommentInfo> comments = goodsEvaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | CommentInfo info = comments.get(0); |
| | | text = info.getContent(); |
| | | comment = info; |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback,JsonUtil.loadTrueResult(data)); |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | 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;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.jd.JDGoodsException;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | public void getGoodsInfo(AcceptData acceptData, Long cid, Integer page, PrintWriter out) {
|
| | | JSONObject root = new JSONObject();
|
| | | if (cid == 1 && page == 1) {
|
| | | List<SwiperPicture> topPicList = swiperPictureService.getByBannerCardAndVersion("jingdong_special_index",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> topPicList = swiperPictureService.getByBannerCardAndVersion("jingdong_special_index",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | topPicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("listPic", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.exception.pdd.PDDOrderException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | public void getGoodsInfo(AcceptData acceptData, Long cid, Integer page, PrintWriter out) {
|
| | | JSONObject root = new JSONObject();
|
| | | if (cid == 1 && page == 1) {
|
| | | List<SwiperPicture> topPicList = swiperPictureService.getByBannerCardAndVersion("pinduoduo_special_index",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> topPicList = swiperPictureService.getByBannerCardAndVersion("pinduoduo_special_index",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | topPicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("listPic", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.PreviewInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.PreviewInfo.PreviewEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount;
|
| | | import com.yeshi.fanli.exception.user.PreviewInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneyDailyCountService;
|
| | | import com.yeshi.fanli.service.inter.user.PreviewInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.money.MoneyPredictVO;
|
| | | import com.yeshi.fanli.vo.money.MoneyStatisticVO;
|
| | | import com.yeshi.fanli.vo.user.MineInfoVO;
|
| | |
|
| | |
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyControllerV2 userMoneyControllerV2;
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | | |
| | | @Resource
|
| | | private OrderMoneyDailyCountService orderMoneyDailyCountService;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | if (previewInfo != null && !StringUtil.isNullOrEmpty(previewInfo.getContent())) {
|
| | | dto = new Gson().fromJson(previewInfo.getContent(), MoneyStatisticVO.class);
|
| | | } else {
|
| | | dto = userMoneyControllerV2.createMoneyStatistic(uid);
|
| | | dto = createMoneyStatistic(uid);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(dto));
|
| | | }
|
| | |
|
| | | private MoneyStatisticVO createMoneyStatistic(Long uid) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | MoneyStatisticVO vo = new MoneyStatisticVO();
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | Date minDate = null;
|
| | | Date maxDate = null;
|
| | | long timeStamp = System.currentTimeMillis();
|
| | | List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
|
| | |
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(timeStamp);
|
| | |
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.extract);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractVerify);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractVerifyNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractReject);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractAutoWX);
|
| | |
|
| | | // 本月提现
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | // 上月提现
|
| | | maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | vo.setLastMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | minDate = new Date(0L);
|
| | | maxDate = new Date(timeStamp);
|
| | | // 累计成功提现
|
| | | vo.setTotalExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | // 累计自购返利
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanli);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderReward);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderRewardNew);
|
| | | vo.setTotalFanLiMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 累计分享赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.share);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | vo.setTotalShareMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 累计邀请赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.invite);
|
| | | typeList.add(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.inviteAndShare);
|
| | | typeList.add(UserMoneyDetailTypeEnum.subsidy);
|
| | | typeList.add(UserMoneyDetailTypeEnum.teamReward);
|
| | | vo.setTotalInviteMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 本月收货
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | |
|
| | | // 上月收货
|
| | | maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | vo.setLastMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | |
|
| | | // 待确认收货(180天内)
|
| | | vo.setNotSettleMoney(hongBaoV2CountService.sumMoneyByANotSettleAndUid(uid));
|
| | |
|
| | | // 今日预估
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | minDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | vo.setTodayPredict(cratePredictVO(orderMoneyDailyCountService.query(uid, minDate, null)));
|
| | |
|
| | | // 本月预估
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthPredict(cratePredictVO(orderMoneyDailyCountService.query(uid, minDate, maxDate)));
|
| | | return vo;
|
| | | }
|
| | | |
| | | private MoneyPredictVO cratePredictVO(List<OrderMoneyDailyCount> list) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO();
|
| | | predictVO.setMineNum(0);
|
| | | predictVO.setTeamNum(0);
|
| | | predictVO.setMineMoney(BigDecimal.valueOf(0));
|
| | | predictVO.setTeamMoney(BigDecimal.valueOf(0));
|
| | | BigDecimal hundred = BigDecimal.valueOf(100);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (OrderMoneyDailyCount dailyCount : list) {
|
| | | if (dailyCount.getOrderNum() != null)
|
| | | predictVO.setMineNum(predictVO.getMineNum() + dailyCount.getOrderNum());
|
| | | if (dailyCount.getOrderNumTeam() != null)
|
| | | predictVO.setTeamNum(predictVO.getTeamNum() + dailyCount.getOrderNumTeam());
|
| | | if (dailyCount.getIncome() != null)
|
| | | predictVO.setMineMoney(predictVO.getMineMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | if (dailyCount.getIncomeTeam() != null)
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred)));
|
| | | }
|
| | | }
|
| | | predictVO.setTotalNum(predictVO.getTeamNum() + predictVO.getMineNum());
|
| | | predictVO.setTotalMoney(predictVO.getMineMoney().add(predictVO.getTeamMoney()));
|
| | | return predictVO;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 保存提现记录
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveExtractRecord")
|
| | | public void saveExtractRecord(String callback, AcceptData acceptData, Long uid, String time, BigDecimal money,
|
| | | public void saveExtractRecord(String callback, AcceptData acceptData, Long uid, String dayTime, BigDecimal money,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | previewInfoService.saveExtractRecord(uid, time, money);
|
| | | previewInfoService.saveExtractRecord(uid, dayTime, money);
|
| | | } catch (PreviewInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | |
| | | list = new ArrayList<>();
|
| | |
|
| | | JSONArray JSONArray = new JSONArray();
|
| | | |
| | | if (list.size() > 0) {
|
| | | for (Extract extract : list) {
|
| | | Date receiveTime = extract.getReceiveTime();
|
| | | if (receiveTime == null) {
|
| | | receiveTime = new Date(extract.getExtractTime());
|
| | | continue;
|
| | | }
|
| | | String account = "支付宝:" + UserUtil.filterAlipayAccount(extract.getAccount());
|
| | | account = account + "-姓名:" + UserUtil.filterAlipayName(extract.getName());
|
| | |
| | | object.put("money", "¥" + extract.getMoney().setScale(2).toString());
|
| | | JSONArray.add(object);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("count", JSONArray.size());
|
| | | json.put("list", JSONArray);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
|
| | | }
|
| | | |
| | | /**
|
| | | * 删除提现记录
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param vo
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "previewExtractRecord")
|
| | | public void previewExtractRecord(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | previewInfoService.previewExtractRecord(uid);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("已添加预览"));
|
| | | } catch (PreviewInfoException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveMoneyArrival")
|
| | | public void saveMoneyArrival(String callback, AcceptData acceptData, Long uid, BigDecimal money, String time,
|
| | | public void saveMoneyArrival(String callback, AcceptData acceptData, Long uid, BigDecimal money, String dayTime,
|
| | | String orderNo, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | String link = previewInfoService.saveMoneyArrival(uid, money, time, orderNo);
|
| | | String link = previewInfoService.saveMoneyArrival(uid, money, dayTime, orderNo);
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("link", link);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(object));
|
| | | } catch (PreviewInfoException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(object));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 推送预览
|
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param vo
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveOrderInfo")
|
| | | public void saveOrderInfo(String callback, AcceptData acceptData, Long uid, Integer type, Integer num, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (type == null || num == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请完善数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.goods.SpikeTimeVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyTOPVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyVO;
|
| | |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top",
|
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | List<BannerVO> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
|
| | | root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | |
|
| | | // 3、邀请有奖
|
| | | List<SwiperPicture> invitePicList = null;
|
| | | List<BannerVO> invitePicList = null;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | |
| | | }
|
| | |
|
| | | if (invitePicList == null) {
|
| | | invitePicList = new ArrayList<SwiperPicture>();
|
| | | invitePicList = new ArrayList<BannerVO>();
|
| | | }
|
| | | root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
|
| | |
|
| | |
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.goods.taobao.TLJBuyHongBaoVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.redpack.TaoLiJinWinDetailVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | |
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | List<BannerVO> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | if (bannerList != null && bannerList.size() > 0)
|
| | |
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | List<BannerVO> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | if (bannerList != null && bannerList.size() > 0)
|
| | |
| | | }
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion(
|
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion(
|
| | | "redpack_win_detail_banner", acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | List<BannerVO> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | // 福利中心图片
|
| | | List<SwiperPicture> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top_1.6.5",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<BannerVO> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top_1.6.5",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (listswiper != null && listswiper.size() > 0) {
|
| | | String topPicture = listswiper.get(0).getSrc();
|
| | | data.put("topPicture", topPicture);
|
| | |
| | |
|
| | | import com.yeshi.fanli.dto.WXMPAcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.homemodule.FloatImgDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | data.put("privacyProtocolLink", privacyProtocol);
|
| | |
|
| | | // 我的界面banner
|
| | | List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | List<BannerVO> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banner == null)
|
| | | banner = new ArrayList<SwiperPicture>();
|
| | | banner = new ArrayList<BannerVO>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.JumpDetailUtil;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | listKey.add("special_channel_jd");
|
| | | listKey.add("special_channel_pdd");
|
| | |
|
| | | List<Special> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | long time = System.currentTimeMillis();
|
| | |
|
| | | // 删除尚未启用的过期的
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Special special = list.get(i);
|
| | | SpecialVO special = list.get(i);
|
| | | if (special.getJumpDetail() != null) {
|
| | | special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(special.getJumpDetail()));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.vo.goods.RewardCouponVO;
|
| | | import com.yeshi.fanli.vo.goods.ShareVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | // 轮播图
|
| | | String platform = acceptData.getPlatform();
|
| | | int version = Integer.parseInt(acceptData.getVersion());
|
| | | List<SwiperPicture> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
|
| | | List<BannerVO> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
|
| | | version);
|
| | | if (picList == null) {
|
| | | picList = new ArrayList<>();
|
| | | }
|
| | |
|
| | | for (SwiperPicture swiper : picList) {
|
| | | for (BannerVO swiper : picList) {
|
| | | JSONObject params = null;
|
| | | if (StringUtil.isNullOrEmpty(swiper.getParams())) {
|
| | | params = JSONObject.fromObject(swiper.getParams());
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | int version = Integer.parseInt(acceptData.getVersion());
|
| | |
|
| | | // 轮播图
|
| | | List<SwiperPicture> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
|
| | | List<BannerVO> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
|
| | | version);
|
| | | if (picList == null) {
|
| | | picList = new ArrayList<>();
|
| | | }
|
| | |
|
| | | for (SwiperPicture swiper : picList) {
|
| | | JSONObject params = null;
|
| | | if (StringUtil.isNullOrEmpty(swiper.getParams())) {
|
| | | params = JSONObject.fromObject(swiper.getParams());
|
| | | }
|
| | | for (BannerVO swiper : picList) {
|
| | | // JSONObject params = null;
|
| | | // if (StringUtil.isNullOrEmpty(swiper.getParams())) {
|
| | | // params = JSONObject.fromObject(swiper.getParams());
|
| | | // }
|
| | | swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
|
| | | }
|
| | |
|
| | | // 圆形专题
|
| | | List<Special> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version);
|
| | | List<SpecialVO> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version);
|
| | | if (specials == null)
|
| | | specials = new ArrayList<>();
|
| | |
|
| | | for (Special special : specials) {
|
| | | for (SpecialVO special : specials) {
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | if (special.isJumpLogin() && jumpDetail != null) {
|
| | | jumpDetail.setNeedLogin(true);
|
| | | }
|
| | |
|
| | | JSONObject params = null;
|
| | | if (StringUtil.isNullOrEmpty(special.getParams())) {
|
| | | params = JSONObject.fromObject(special.getParams());
|
| | | }
|
| | | |
| | | // JSONObject params = null;
|
| | | // if (StringUtil.isNullOrEmpty(special.getParams())) {
|
| | | // params = JSONObject.fromObject(special.getParams());
|
| | | // }
|
| | | special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail));
|
| | | }
|
| | |
|
| | | // 活动
|
| | | List<SwiperPicture> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
|
| | | List<BannerVO> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
|
| | | version);
|
| | | if (activitys == null)
|
| | | activitys = new ArrayList<>();
|
| | |
|
| | | for (SwiperPicture swiper : activitys) {
|
| | | JSONObject params = null;
|
| | | if (StringUtil.isNullOrEmpty(swiper.getParams())) {
|
| | | params = JSONObject.fromObject(swiper.getParams());
|
| | | }
|
| | | for (BannerVO swiper : activitys) {
|
| | | // JSONObject params = null;
|
| | | // if (StringUtil.isNullOrEmpty(swiper.getParams())) {
|
| | | // params = JSONObject.fromObject(swiper.getParams());
|
| | | // }
|
| | | swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.homemodule; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo; |
| | | |
| | | public interface CommonShareInfoMapper extends BaseMapper<CommonShareInfo> { |
| | | |
| | | /** |
| | | * 根据上级id 和类型查询 |
| | | * @param pid |
| | | * @param type |
| | | * @return |
| | | */ |
| | | CommonShareInfo getByPidAndType(@Param("pid") Long pid, @Param("type") String type); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param pid |
| | | * @param type |
| | | */ |
| | | void deleteByPidAndType(@Param("pid") Long pid, @Param("type") String type); |
| | | |
| | | |
| | | } |
| | |
| | | int deleteBatchByPrimaryKey(List<Long> list);
|
| | |
|
| | |
|
| | | List<SpecialCard> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
|
| | | List<SpecialCard> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("listPid")List<Long> listPid);
|
| | |
|
| | | long countlistQuery(@Param("key") String key);
|
| | | long countlistQuery(@Param("key") String key, @Param("listPid")List<Long> listPid);
|
| | |
|
| | |
|
| | | String getbottomPicture(@Param("placeKey") String placeKey);
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 分享信息
|
| | | * |
| | | */
|
| | | @Table("yeshi_ec_common_share_info")
|
| | | public class CommonShareInfo {
|
| | |
|
| | | public enum CommonShareInfoEnum {
|
| | | special("专题"), banner("轮播图");
|
| | | private final String desc;
|
| | |
|
| | | private CommonShareInfoEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | |
|
| | | @Column(name = "csi_id")
|
| | | private Long id;
|
| | |
|
| | | // 相关id
|
| | | @Column(name = "csi_pid")
|
| | | private Long pid;
|
| | |
|
| | | // 类型
|
| | | @Column(name = "csi_type")
|
| | | private CommonShareInfoEnum type;
|
| | |
|
| | | // 是否转链
|
| | | @Column(name = "csi_need_spin")
|
| | | private Boolean needSpin;
|
| | |
|
| | | // 评论语
|
| | | @Column(name = "csi_comment")
|
| | | private String comment;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "csi_createtime")
|
| | | private Date createTime;
|
| | |
|
| | | // 更新时间
|
| | | @Column(name = "csi_updatetime")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getPid() {
|
| | | return pid;
|
| | | }
|
| | |
|
| | | public void setPid(Long pid) {
|
| | | this.pid = pid;
|
| | | }
|
| | |
|
| | | public CommonShareInfoEnum getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(CommonShareInfoEnum type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Boolean getNeedSpin() {
|
| | | return needSpin;
|
| | | }
|
| | |
|
| | | public void setNeedSpin(Boolean needSpin) {
|
| | | this.needSpin = needSpin;
|
| | | }
|
| | |
|
| | | public String getComment() {
|
| | | return comment;
|
| | | }
|
| | |
|
| | | public void setComment(String comment) {
|
| | | this.comment = comment;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | |
| | | orderRebateDescLink("order_rebate_desc_link", "订单返利计算说明链接"), |
| | | |
| | | teamStatisticsLink("team_statistics_link", "推送发圈活动页面"), |
| | | teamStatisticsLink("team_statistics_link", "队员统计页面链接"), |
| | | activityDetailLink("activity_detail_link", "活动详情过渡页"), |
| | | |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.CommonShareInfoMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo"> |
| | | <id column="csi_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="csi_pid" property="pid" jdbcType="BIGINT"/> |
| | | <result column="csi_need_spin" property="needSpin" jdbcType="BOOLEAN"/> |
| | | <result column="csi_comment" property="comment" jdbcType="VARCHAR"/> |
| | | <result column="csi_createtime" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="csi_updatetime" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="csi_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.CommonShareInfoEnumHandler"/> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">csi_id,csi_pid,csi_type,csi_need_spin,csi_comment,csi_createtime,csi_updatetime</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_common_share_info where csi_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_common_share_info where csi_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_share_info (csi_id,csi_pid,csi_type,csi_need_spin,csi_comment,csi_createtime,csi_updatetime) values (#{id,jdbcType=BIGINT},#{pid,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{needSpin,jdbcType=BOOLEAN},#{comment,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_share_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">csi_id,</if> |
| | | <if test="pid != null">csi_pid,</if> |
| | | <if test="type != null">csi_type,</if> |
| | | <if test="needSpin != null">csi_need_spin,</if> |
| | | <if test="comment != null">csi_comment,</if> |
| | | <if test="createTime != null">csi_createtime,</if> |
| | | <if test="updateTime != null">csi_updatetime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="pid != null">#{pid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="needSpin != null">#{needSpin,jdbcType=BOOLEAN},</if> |
| | | <if test="comment != null">#{comment,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo">update yeshi_ec_common_share_info set csi_pid = #{pid,jdbcType=BIGINT},csi_type = #{type,jdbcType=VARCHAR},csi_need_spin = #{needSpin,jdbcType=BOOLEAN},csi_comment = #{comment,jdbcType=VARCHAR},csi_createtime = #{createTime,jdbcType=TIMESTAMP},csi_updatetime = #{updateTime,jdbcType=TIMESTAMP} where csi_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo">update yeshi_ec_common_share_info |
| | | <set> |
| | | <if test="pid != null">csi_pid=#{pid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">csi_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="needSpin != null">csi_need_spin=#{needSpin,jdbcType=BOOLEAN},</if> |
| | | <if test="comment != null">csi_comment=#{comment,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">csi_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">csi_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where csi_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByPidAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_common_share_info |
| | | WHERE csi_pid = #{pid} AND csi_type = #{type} |
| | | ORDER BY csi_id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <delete id="deleteByPidAndType"> |
| | | delete from yeshi_ec_common_share_info where csi_pid = #{pid} AND csi_type = #{type} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | <if test='key != null and key != ""'>
|
| | | AND cd_name like '%${key}%'
|
| | | </if>
|
| | | <if test="listPid != null">
|
| | | AND cd_place_id in
|
| | | <foreach collection="listPid" item="item" open="(" close=")" separator=",">#{item}</foreach>
|
| | | </if>
|
| | | ORDER BY cd_place_id,cd_state DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
| | | <if test='key != null and key != ""'>
|
| | | AND cd_name like '%${key}%'
|
| | | </if>
|
| | | <if test="listPid != null">
|
| | | AND cd_place_id in
|
| | | <foreach collection="listPid" item="item" open="(" close=")" separator=",">#{item}</foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
|
| | |
| | | } |
| | | } |
| | | |
| | | String activityUrl = imgInfo.getActivityUrl(); |
| | | // 编辑图片 |
| | | List<ImgInfo> tempList = new ArrayList<ImgInfo>(); |
| | | if (!StringUtil.isNullOrEmpty(picUrls)) { |
| | |
| | | if (listOld != null) { |
| | | for (ImgInfo info: listOld) { |
| | | if (info.getUrl().equals(picLink)) { |
| | | info.setActivityUrl(activityUrl); |
| | | tempList.add(info); |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | |
| | | imgInfo0.setType(ImgEnum.img); |
| | | imgInfo0.setW(info.getW()); |
| | | imgInfo0.setH(info.getH()); |
| | | |
| | | imgInfo0.setActivityUrl(activityUrl); |
| | | if (i < tempList.size()) { |
| | | tempList.set(i, imgInfo0); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | resultObj.setJumpLink(imgInfo.getActivityUrl()); |
| | | resultObj.setJumpLink(activityUrl); |
| | | resultObj.setLineNum(lineNum); |
| | | resultObj.setImgList(listImg); |
| | | goodsEvaluateDao.save(resultObj); |
| | |
| | | } |
| | | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | evaluateNew.setPublishTime(evaluateNew.getStartTime()); |
| | | |
| | | |
| | | // 活动链接跳转过渡页 |
| | | EvaluateEnum evaluateEnum = evaluateNew.getType(); |
| | | if (evaluateEnum != null && evaluateEnum == EvaluateEnum.activity) { |
| | | if (evaluateNew.getComments() != null && evaluateNew.getComments().size() > 0) { |
| | | String jumpLink = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s"; |
| | | jumpLink = String.format(jumpLink, "circle", evaluateNew.getId()); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(evaluateNew.getJumpLink())) { |
| | | evaluateNew.setJumpLink(jumpLink); |
| | | } |
| | | List<ImgInfo> imgListNew = new ArrayList<>(); |
| | | |
| | | List<ImgInfo> imgList = evaluateNew.getImgList(); |
| | | if (imgList != null && imgList.size() > 0) { |
| | | for (ImgInfo imgInfo: imgList) { |
| | | if (imgInfo.getType() != ImgEnum.img || imgInfo.getType() == ImgEnum.activity) { |
| | | ImgInfo imgInfoNew = new ImgInfo(); |
| | | try { |
| | | PropertyUtils.copyProperties(imgInfoNew, imgInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(imgInfoNew.getActivityUrl())) { |
| | | imgInfoNew.setActivityUrl(jumpLink); |
| | | } |
| | | |
| | | imgListNew.add(imgInfoNew); |
| | | continue; |
| | | } |
| | | imgListNew.add(imgInfo); |
| | | } |
| | | } |
| | | evaluateNew.setImgList(imgListNew); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<CommentInfo> comments = evaluateNew.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.CommonShareInfoMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class CommonShareInfoServiceImpl implements CommonShareInfoService {
|
| | |
|
| | | @Resource
|
| | | private CommonShareInfoMapper commonShareInfoMapper;
|
| | | |
| | | @Resource
|
| | | private ConvertLinkManager convertLinkManager;
|
| | |
|
| | | @Override
|
| | | public void save(CommonShareInfo record) throws SpecialException {
|
| | | if (record == null || record.getPid() == null || record.getType() == null)
|
| | | throw new SpecialException(1, "参数不完整");
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(record.getComment())) {
|
| | | if (record.getNeedSpin() == null)
|
| | | record.setNeedSpin(false);
|
| | | |
| | | if (record.getNeedSpin()) {
|
| | | try {
|
| | | convertLinkManager.convertLinkFromText(record.getComment(), Constant.LINK_TOKEN_VERIFY_UID, true);
|
| | | } catch (ConvertLinkExceptionException e) {
|
| | | if (ConvertLinkExceptionException.CODE_NONE != e.getCode()) {
|
| | | throw new SpecialException(1, "包含不可转链的口令与链接");
|
| | | }
|
| | | } catch (Exception e) {
|
| | | throw new SpecialException(1, "包含不可转链的口令与链接");
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | CommonShareInfo info = commonShareInfoMapper.getByPidAndType(record.getPid(), record.getType().name());
|
| | | if (info == null) {
|
| | | commonShareInfoMapper.insertSelective(record);
|
| | | } else {
|
| | | record.setId(info.getId());
|
| | | commonShareInfoMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public CommonShareInfo getByPidAndType(Long pid, String type) {
|
| | | return commonShareInfoMapper.getByPidAndType(pid, type);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void deleteByPidAndType(Long pid, String type) {
|
| | | commonShareInfoMapper.deleteByPidAndType(pid, type);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort) {
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort, List<Long> listPid) {
|
| | |
|
| | | List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key);
|
| | | List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key, listPid);
|
| | | if (listObj == null || listObj.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countlistQuery(String key) {
|
| | | return specialCardMapper.countlistQuery(key);
|
| | | public long countlistQuery(String key, List<Long> listPid) {
|
| | | return specialCardMapper.countlistQuery(key, listPid);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | private SpecialCardService specialCardService;
|
| | |
|
| | | @Resource
|
| | | private SpecialExtraService specialExtraService;
|
| | | private CommonShareInfoService commonShareInfoService;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
|
| | | String jumpType, SpecialExtra extra) throws SpecialException, Exception {
|
| | | String jumpType, CommonShareInfo shareInfo) throws SpecialException, Exception {
|
| | |
|
| | | Long cardId = record.getCardId();
|
| | | if (cardId == null) {
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.insert(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | shareInfo.setPid(record.getId());
|
| | |
|
| | | Special s = new Special();
|
| | | s.setId(record.getId());
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.updateByPrimaryKey(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | shareInfo.setPid(record.getId());
|
| | | }
|
| | |
|
| | | // 添加补充信息
|
| | | specialExtraService.saveExtraInfo(extra);
|
| | | shareInfo.setType(CommonShareInfoEnum.special);
|
| | | commonShareInfoService.save(shareInfo);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (!StringUtil.isNullOrEmpty(subPicture)) {
|
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | |
| | | commonShareInfoService.deleteByPidAndType(special.getId(), CommonShareInfoEnum.special.name());
|
| | | }
|
| | |
|
| | | if (listSpecial != null)
|
| | |
| | | if (!StringUtil.isNullOrEmpty(subPicture)) {
|
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | |
| | | commonShareInfoService.deleteByPidAndType(special.getId(), CommonShareInfoEnum.special.name());
|
| | | }
|
| | |
|
| | | return specialMapper.deleteBatchByCardID(list);
|
| | |
| | | specialVO.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | |
|
| | | // 补充信息
|
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId());
|
| | | if (extra == null) {
|
| | | // 分享补充信息
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(specialVO.getId(),
|
| | | CommonShareInfoEnum.special.name());
|
| | | if (info == null) {
|
| | | specialVO.setNeedSpin(false);
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setNeedSpin(extra.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(extra.getComment())) {
|
| | | specialVO.setNeedSpin(info.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setComment(extra.getComment());
|
| | | specialVO.setComment(info.getComment());
|
| | | }
|
| | | }
|
| | | |
| | | listvo.add(specialVO);
|
| | | }
|
| | | return listvo;
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
|
| | | public List<Special> listBySystemAndCard(String card, Long systemId) {
|
| | | return specialMapper.listBySystemAndCard(card, systemId);
|
| | | public List<SpecialVO> listBySystemAndCard(String card, Long systemId) {
|
| | | List<Special> specialList = specialMapper.listBySystemAndCard(card, systemId);
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
|
| | | public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
|
| | | return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
|
| | | public List<SpecialVO> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
|
| | | List<Special> specialList = specialMapper.listPageBySystemAndCard(start, count, card, systemId);
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByVersion-'+#start+'-'+#count+'-'+#card+'-'+#platform+'-'+#versionCode")
|
| | | public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode) {
|
| | | public List<SpecialVO> listByVersion(long start, int count, String card, String platform, Integer versionCode) {
|
| | | List<Special> specialList = specialMapper.listByPlaceKey(card, null, null, null);
|
| | | filterSpecial(specialList, platform, versionCode);
|
| | | return specialList;
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | // 数据处理
|
| | | // handlelist(listArc);
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listArc)));
|
| | |
|
| | | // 首页-活动区域(女王节)
|
| | | JSONObject activityMap = new JSONObject();
|
| | |
| | |
|
| | | handlelist(listActivity);
|
| | |
|
| | | activityMap.put("list", JsonUtil.getApiCommonGson().toJson(listActivity));
|
| | | activityMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listActivity)));
|
| | |
|
| | | // 首页-方形专题(品牌券、母婴...)
|
| | | String indexBlock = "index_block";
|
| | |
| | |
|
| | | // 数据处理
|
| | | handlelist(listBlock);
|
| | | blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(listBlock));
|
| | | blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listBlock)));
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("arcArea", arcMap);
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByPlaceKeyHasLabel'+#start+'-'+#platform+'-'+#versionCode+'-'+#list")
|
| | | public List<Special> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform,
|
| | | public List<SpecialVO> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform,
|
| | | Integer versionCode) {
|
| | | return specialMapper.listByPlaceKeyHasLabel(start, count, list, null, platform, versionCode);
|
| | | List<Special> listSpecial = specialMapper.listByPlaceKeyHasLabel(start, count, list, null,
|
| | | platform, versionCode);
|
| | | return transformVO(listSpecial);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 转换VO
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | private List<SpecialVO> transformVO(List<Special> list) {
|
| | | List<SpecialVO> listVo = new ArrayList<SpecialVO>();
|
| | | if (list != null && list.size() > 0) {
|
| | | for (Special special: list) {
|
| | | SpecialVO specialVO = new SpecialVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(specialVO, special);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | | |
| | | // 跳转活动过渡页
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(specialVO.getId(), |
| | | CommonShareInfoEnum.special.name());
|
| | | if (info != null && !StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | String link = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
|
| | | link = String.format(link, CommonShareInfoEnum.special.name(),specialVO.getId());
|
| | | |
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", link);
|
| | | |
| | | specialVO.setComment(info.getComment());
|
| | | specialVO.setParams(params.toString());
|
| | | specialVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | }
|
| | | listVo.add(specialVO);
|
| | | }
|
| | | }
|
| | | return listVo;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 处理 数据
|
| | | *
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class SwiperPictureServiceImpl implements SwiperPictureService {
|
| | |
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | | |
| | | @Resource
|
| | | private CommonShareInfoService commonShareInfoService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Override
|
| | | public int insertSelective(SwiperPicture record) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SwiperPicture> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException {
|
| | | return swiperPictureMapper.queryByBannerID(start, count, bannerId);
|
| | | public List<BannerVO> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException {
|
| | | List<SwiperPicture> list = swiperPictureMapper.queryByBannerID(start, count, bannerId);
|
| | | return transformVO(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, SwiperPicture record, String jumpType)
|
| | | public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo)
|
| | | throws SwiperPictureException, Exception {
|
| | |
|
| | | if (record == null) {
|
| | | throw new SwiperPictureException(1, "参数不能为空");
|
| | | }
|
| | |
| | | if (id == null) {
|
| | | int maxOrder = swiperPictureMapper.getMaxOrderByBannerID(bannerId);
|
| | | record.setOrder(maxOrder + 1);
|
| | |
|
| | | Integer state = record.getState();
|
| | | // 默认停用
|
| | | if (state == null) {
|
| | |
| | | record.setCreatetime(new Date());
|
| | | record.setUpdatetime(new Date());
|
| | | record.setSrc(picture);
|
| | |
|
| | | swiperPictureMapper.insert(record);
|
| | | |
| | | shareInfo.setPid(record.getId());
|
| | | } else {
|
| | | // 修改
|
| | | SwiperPicture resultObj = swiperPictureMapper.selectByPrimaryKey(id);
|
| | |
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | // 删除已存在图片
|
| | | removePicture(resultObj);
|
| | |
|
| | | record.setSrc(picture);
|
| | | } else {
|
| | | record.setSrc(resultObj.getSrc());
|
| | |
| | | record.setOrder(resultObj.getOrder());
|
| | | record.setCreatetime(resultObj.getCreatetime());
|
| | | record.setUpdatetime(new Date());
|
| | |
|
| | | swiperPictureMapper.updateByPrimaryKey(record);
|
| | | |
| | | shareInfo.setPid(record.getId());
|
| | | }
|
| | | |
| | | // 添加补充信息
|
| | | shareInfo.setType(CommonShareInfoEnum.banner);
|
| | | commonShareInfoService.save(shareInfo);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (!StringUtil.isNullOrEmpty(src)) {
|
| | | COSManager.getInstance().deleteFile(src);
|
| | | }
|
| | | |
| | | commonShareInfoService.deleteByPidAndType(swiperPicture.getId(), CommonShareInfoEnum.banner.name());
|
| | | }
|
| | |
|
| | | if (listSwiper != null)
|
| | |
| | |
|
| | | @Override
|
| | | public int deleteBatchByBannerID(List<Long> list) throws SwiperPictureException {
|
| | | if (list != null) {
|
| | | for (Long id : list) {
|
| | | commonShareInfoService.deleteByPidAndType(id, CommonShareInfoEnum.banner.name());
|
| | | }
|
| | | }
|
| | | return swiperPictureMapper.deleteBatchByBannerID(list);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
|
| | | public List<SwiperPicture> getByBannerCard(String card) {
|
| | | public List<BannerVO> getByBannerCard(String card) {
|
| | | List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (SwiperPicture swiperPicture : list) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | return list;
|
| | | return transformVO(list);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerCardAndVersion-'+#card+'-'+#platform+'-'+#version")
|
| | | @Override
|
| | | public List<SwiperPicture> getByBannerCardAndVersion(String card, String platform, int version) {
|
| | | public List<BannerVO> getByBannerCardAndVersion(String card, String platform, int version) {
|
| | | List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
|
| | | filterSwipePicture(list, platform, version);
|
| | | for (SwiperPicture picture : list) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | return list;
|
| | | return transformVO(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId")
|
| | | public List<SwiperPicture> getByBannerId(Long bannerId) {
|
| | | return swiperPictureMapper.getByBannerId(bannerId);
|
| | | public List<BannerVO> getByBannerId(Long bannerId) {
|
| | | List<SwiperPicture> pictureList = swiperPictureMapper.getByBannerId(bannerId);
|
| | | return transformVO(pictureList);
|
| | | }
|
| | |
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId+'-'+#platform+'-'+#version")
|
| | | @Override
|
| | | public List<SwiperPicture> getByBannerId(Long bannerId, String platform, int version)
|
| | | public List<BannerVO> getByBannerId(Long bannerId, String platform, int version)
|
| | | throws SwiperPictureException {
|
| | | List<SwiperPicture> pictureList = swiperPictureMapper.getByBannerId(bannerId);
|
| | | filterSwipePicture(pictureList, platform, version);
|
| | | return pictureList;
|
| | | return transformVO(pictureList);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | throw new SwiperPictureException(2, e.getMessage());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 转换VO
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | private List<BannerVO> transformVO(List<SwiperPicture> list) {
|
| | | List<BannerVO> listVo = new ArrayList<BannerVO>();
|
| | | if (list != null && list.size() > 0) {
|
| | | for (SwiperPicture swiperPicture: list) {
|
| | | BannerVO bannerVO = new BannerVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(bannerVO, swiperPicture);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | | |
| | | // 跳转活动过渡页
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(bannerVO.getId(), |
| | | CommonShareInfoEnum.banner.name());
|
| | | if (info != null && !StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | String link = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
|
| | | link = String.format(link, CommonShareInfoEnum.banner.name(),bannerVO.getId());
|
| | | |
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", link);
|
| | | |
| | | bannerVO.setComment(info.getComment());
|
| | | bannerVO.setParams(params.toString());
|
| | | bannerVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | }
|
| | | listVo.add(bannerVO);
|
| | | }
|
| | | }
|
| | | return listVo;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void save(Long createUid, Long preUid, PreviewEnum type, String content) { |
| | | String id = StringUtil.Md5(createUid + "#" + type.name()); |
| | | |
| | | PreviewInfo info = new PreviewInfo(); |
| | | info.setId(id); |
| | | info.setUid(preUid); |
| | |
| | | info.setUpdateTime(new Date()); |
| | | previewInfoDao.save(info); |
| | | |
| | | if (type == PreviewEnum.extractRecord) { |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(content)) { |
| | | removePreview(preUid, type); |
| | | } else { |
| | | adddPreview(preUid, type, content); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 缓存10分钟 |
| | | String key = StringUtil.Md5("preview" + preUid + "#" + type.name()); |
| | | redisManager.cacheCommonString(key, info.getContent(), 60 * 10); |
| | | private void adddPreview(Long uid, PreviewEnum type, String content) { |
| | | String key = StringUtil.Md5("preview" + uid + "#" + type.name()); |
| | | redisManager.cacheCommonString(key, content, 60 * 10); |
| | | } |
| | | |
| | | // 缓存10分钟 |
| | | private void removePreview(Long uid, PreviewEnum type) { |
| | | String key = StringUtil.Md5("preview" + uid + "#" + type.name()); |
| | | redisManager.removeCommonString(key); |
| | | } |
| | | |
| | | |
| | |
| | | BindingAccount alipay = bindingAccountService.getBindingAccountByUidAndType(uid, BindingAccount.TYPE_ALIPAY); |
| | | if (alipay == null) |
| | | throw new PreviewInfoException(1, "未绑定提现账号"); |
| | | if (money == null || money.compareTo(BigDecimal.ZERO) <= 0) |
| | | throw new PreviewInfoException(1, "请输入正确的金额"); |
| | | if (StringUtil.isNullOrEmpty(time)) |
| | | throw new PreviewInfoException(1, "提现时间不能为空"); |
| | | if (money.compareTo(BigDecimal.ZERO) <= 0) |
| | | throw new PreviewInfoException(1, "提现金额不能小于0"); |
| | | |
| | | Date parse = TimeUtil.parseDotCommon2(time); |
| | | if (parse == null) |
| | | throw new PreviewInfoException(1, "请输入正确的时间格式,如:2020.01.01 01:01"); |
| | | |
| | | |
| | | Gson gson = new Gson(); |
| | | List<Extract> list = null; |
| | | List<Extract> list = new ArrayList<Extract>(); |
| | | |
| | | Extract extract = new Extract(); |
| | | extract.setName(alipay.getName()); |
| | | extract.setAccount(alipay.getAccount()); |
| | | extract.setMoney(money); |
| | | extract.setReceiveTime(TimeUtil.parseDotCommon(time)); |
| | | extract.setReceiveTime(TimeUtil.parseDotCommon2(time)); |
| | | extract.setId(java.lang.System.currentTimeMillis()); |
| | | |
| | | String id = StringUtil.Md5(uid + "#" + PreviewEnum.extractRecord.name()); |
| | | PreviewInfo previewInfo = previewInfoDao.get(id); |
| | | if (previewInfo == null) { |
| | | list = new ArrayList<Extract>(); |
| | | list.add(extract); |
| | | } else { |
| | | String content = previewInfo.getContent(); |
| | |
| | | |
| | | |
| | | @Override |
| | | public void previewExtractRecord(Long uid) throws PreviewInfoException{ |
| | | String id = StringUtil.Md5(uid + "#" + PreviewEnum.extractRecord.name()); |
| | | PreviewInfo previewInfo = previewInfoDao.get(id); |
| | | if (previewInfo == null) { |
| | | throw new PreviewInfoException(1, "请添加提现记录信息"); |
| | | } |
| | | |
| | | String content = previewInfo.getContent(); |
| | | if (StringUtil.isNullOrEmpty(content)) { |
| | | throw new PreviewInfoException(1, "请添加提现记录信息"); |
| | | } |
| | | |
| | | adddPreview(uid, PreviewEnum.extractRecord, content); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void deleteExtractRecord(Long uid, long tid) { |
| | | String id = StringUtil.Md5(uid + "#" + PreviewEnum.extractRecord.name()); |
| | | PreviewInfo previewInfo = previewInfoDao.get(id); |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | save(uid, uid, PreviewEnum.extractRecord, gson.toJson(list)); |
| | | |
| | | // 取消预览 |
| | | removePreview(uid, PreviewEnum.extractRecord); |
| | | } |
| | | |
| | | |
| | |
| | | if (money == null ) |
| | | throw new PreviewInfoException(1, "请输入金额"); |
| | | if(StringUtil.isNullOrEmpty(time)) |
| | | throw new PreviewInfoException(1, "请输入创建时间"); |
| | | if(StringUtil.isNullOrEmpty(time)) |
| | | throw new PreviewInfoException(1, "请输入订单号"); |
| | | if(StringUtil.isNullOrEmpty(time)) |
| | | throw new PreviewInfoException(1, "请输入创建时间"); |
| | | Date parse = TimeUtil.parseDotCommon2(time); |
| | | if (parse == null) |
| | | throw new PreviewInfoException(1, "请输入正确的时间格式,如:2020.01.01 01:01"); |
| | | |
| | | |
| | | String content = ""; // TODO |
| | | // save(uid, PreviewEnum.moneyArrival, gson.toJson(infoVO)); |
| | | return content; |
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | |
|
| | | /**
|
| | | * 专题额外
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface CommonShareInfoService{
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * @param record
|
| | | */
|
| | | public void save(CommonShareInfo record) throws SpecialException;
|
| | |
|
| | | |
| | | /**
|
| | | * 根据上级id +
|
| | | * @param pid
|
| | | * @param infoEnum
|
| | | * @return
|
| | | */
|
| | | public CommonShareInfo getByPidAndType(Long pid, String type);
|
| | |
|
| | |
|
| | | public void deleteByPidAndType(Long pid, String type);
|
| | |
|
| | | |
| | | }
|
| | |
| | | */
|
| | | public interface SpecialCardService {
|
| | |
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort);
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort, List<Long> listPid);
|
| | |
|
| | | public long countlistQuery(String key);
|
| | | public long countlistQuery(String key, List<Long> listPid);
|
| | |
|
| | | /**
|
| | | * 根据id批量删除
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | |
| | | * @param systemId
|
| | | * @return
|
| | | */
|
| | | public List<Special> listBySystemAndCard(String card, Long systemId);
|
| | | public List<SpecialVO> listBySystemAndCard(String card, Long systemId);
|
| | |
|
| | | /**
|
| | | * 活动列表-分页
|
| | |
| | | * @param systemId
|
| | | * @return
|
| | | */
|
| | | public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId);
|
| | | public List<SpecialVO> listPageBySystemAndCard(long start, int count, String card, Long systemId);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @throws SpecialException
|
| | | * @throws Exception
|
| | | */
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType, SpecialExtra extra) throws SpecialException, Exception;
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record
|
| | | , String jumpType, CommonShareInfo shareInfo) throws SpecialException, Exception;
|
| | |
|
| | | /**
|
| | | * 更换顺序
|
| | |
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode);
|
| | | public List<SpecialVO> listByVersion(long start, int count, String card, String platform, Integer versionCode);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | public List<Special> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform, Integer versionCode);
|
| | | public List<SpecialVO> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform, Integer versionCode);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | |
|
| | | public interface SwiperPictureService {
|
| | |
|
| | |
| | | * @return
|
| | | * @throws SwiperPictureException
|
| | | */
|
| | | public List<SwiperPicture> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException;
|
| | | public List<BannerVO> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException;
|
| | |
|
| | | public long countQueryByBannerID(Long bannerId) throws SwiperPictureException;
|
| | |
|
| | |
| | | * 唯一标识
|
| | | * @return
|
| | | */
|
| | | public List<SwiperPicture> getByBannerCard(String card);
|
| | | public List<BannerVO> getByBannerCard(String card);
|
| | |
|
| | | /**
|
| | | * 根据标识与版本查询
|
| | |
| | | * @param version
|
| | | * @return
|
| | | */
|
| | | public List<SwiperPicture> getByBannerCardAndVersion(String card, String platform, int version);
|
| | | public List<BannerVO> getByBannerCardAndVersion(String card, String platform, int version);
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | |
| | | * @param record
|
| | | * @throws SwiperPictureException
|
| | | */
|
| | | public void saveObject(MultipartFile file, SwiperPicture record, String jumpType)
|
| | | public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo)
|
| | | throws SwiperPictureException, Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws SwiperPictureException
|
| | | */
|
| | | public List<SwiperPicture> getByBannerId(Long bannerId) throws SwiperPictureException;
|
| | | public List<BannerVO> getByBannerId(Long bannerId) throws SwiperPictureException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws SwiperPictureException
|
| | | */
|
| | | public List<SwiperPicture> getByBannerId(Long bannerId,String platform,int version) throws SwiperPictureException;
|
| | | public List<BannerVO> getByBannerId(Long bannerId,String platform,int version) throws SwiperPictureException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param money
|
| | | * @throws PreviewInfoException
|
| | | */
|
| | | public void saveExtractRecord(Long uid, String time, BigDecimal money) throws PreviewInfoException;
|
| | | public void saveExtractRecord(Long uid, String dayTime, BigDecimal money) throws PreviewInfoException;
|
| | |
|
| | | /**
|
| | | * 删除提现记录
|
| | |
| | | * @return
|
| | | */
|
| | | public String getRedisContent(Long uid, PreviewEnum previewEnum);
|
| | |
|
| | | /**
|
| | | * 预览提现记录
|
| | | * @param uid
|
| | | * @throws PreviewInfoException
|
| | | */
|
| | | public void previewExtractRecord(Long uid) throws PreviewInfoException;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static Date parseDotCommon2(String st) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | try {
|
| | | return sdf.parse(st);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | public static long convertAllTimeToTemp(String st) {
|
| | | Date date = new Date();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | |
|
| | | public class CommonShareInfoEnumHandler extends BaseTypeHandler<CommonShareInfoEnum> {
|
| | |
|
| | | @Override
|
| | | public CommonShareInfoEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return CommonShareInfoEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonShareInfoEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return CommonShareInfoEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonShareInfoEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return CommonShareInfoEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, CommonShareInfoEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.homemodule;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | |
|
| | | public class BannerVO extends SwiperPicture{
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | private Boolean needSpin;
|
| | | |
| | | @Expose
|
| | | private String comment;
|
| | |
|
| | | public String getComment() {
|
| | | return comment;
|
| | | }
|
| | |
|
| | | public void setComment(String comment) {
|
| | | this.comment = comment;
|
| | | }
|
| | |
|
| | | public Boolean getNeedSpin() {
|
| | | return needSpin;
|
| | | }
|
| | |
|
| | | public void setNeedSpin(Boolean needSpin) {
|
| | | this.needSpin = needSpin;
|
| | | }
|
| | | |
| | | |
| | | }
|