| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | |
| | | import com.yeshi.fanli.entity.dynamic.ListComment; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.manger.ClipboardAnalysisManager; |
| | | import com.yeshi.fanli.service.manger.IClipboardAnalysisResult; |
| | | import com.yeshi.fanli.tag.PageEntity; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TimeUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "switchState") |
| | | public void switchState(String callback, String id, PrintWriter out) { |
| | | public void switchState(AdminAcceptData acceptData,String callback, String id, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.switchState(id); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveHead") |
| | | public void saveHead(String callback, GoodsEvaluate evaluate, HttpServletRequest request, PrintWriter out) { |
| | | public void saveHead(AdminAcceptData acceptData,String callback, GoodsEvaluate evaluate, HttpServletRequest request, PrintWriter out) { |
| | | try { |
| | | String id = null; |
| | | if (request instanceof MultipartHttpServletRequest) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSingleGoodsinfo") |
| | | public void getSingleGoodsinfo(String callback, String pid, PrintWriter out) { |
| | | public void getSingleGoodsinfo(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | try { |
| | | String goodsId = ""; |
| | | String goodsType = ""; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodsComment") |
| | | public void getGoodsComment(String callback, String id, PrintWriter out) { |
| | | public void getGoodsComment(AdminAcceptData acceptData,String callback, String id, PrintWriter out) { |
| | | try { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请先保存推荐语信息")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveCurrencyCoupon") |
| | | public void saveCurrencyCoupon(String callback, String pid, int kind, CommentInfo commentInfo, PrintWriter out) { |
| | | public void saveCurrencyCoupon(AdminAcceptData acceptData,String callback, String pid, int kind, CommentInfo commentInfo, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.saveCurrencyCoupon(pid, kind, commentInfo); |
| | | goodsEvaluateService.saveCurrencyCoupon(acceptData.getSystem(),pid, kind, commentInfo); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getCurrencyCoupon") |
| | | public void getCurrencyCoupon(String callback, String pid, PrintWriter out) { |
| | | public void getCurrencyCoupon(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | try { |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | if (!StringUtil.isNullOrEmpty(pid)) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveMultipleGoods") |
| | | public void saveMultipleGoods(String callback, String pid, String videoUrl, String goodsList, |
| | | public void saveMultipleGoods(AdminAcceptData acceptData,String callback, String pid, String videoUrl, String goodsList, |
| | | HttpServletRequest request, PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getMultipleGoods") |
| | | public void getMultipleGoods(String callback, String pid, PrintWriter out) { |
| | | public void getMultipleGoods(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | try { |
| | | String videoUrl = ""; |
| | | String videoPic = ""; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveActivityPic") |
| | | public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, String picUrls, HttpServletRequest request, |
| | | public void saveActivityPic(AdminAcceptData acceptData,String callback, String pid, ImgInfo imgInfo, String picUrls, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getActivityPic") |
| | | public void getActivityPic(String callback, String pid, PrintWriter out) { |
| | | public void getActivityPic(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | try { |
| | | String videoPic = ""; |
| | | String videoUrl = ""; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveSuCai") |
| | | public void saveSuCai(String callback, String pid, String videoUrl, String picUrls, HttpServletRequest request, |
| | | public void saveSuCai(AdminAcceptData acceptData,String callback, String pid, String videoUrl, String picUrls, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSuCaiPic") |
| | | public void getSuCaiPic(String callback, String pid, PrintWriter out) { |
| | | public void getSuCaiPic(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | try { |
| | | String videoUrl = ""; |
| | | String videoPic = ""; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getEvaluate") |
| | | public void getEvaluate(String callback, String id, PrintWriter out) { |
| | | public void getEvaluate(AdminAcceptData acceptData,String callback, String id, PrintWriter out) { |
| | | try { |
| | | GoodsEvaluate goodsEvaluate = null; |
| | | if (!StringUtil.isNullOrEmpty(id)) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "delete") |
| | | public void delete(String callback, String idArray, PrintWriter out) { |
| | | public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) { |
| | | try { |
| | | if (StringUtil.isNullOrEmpty(idArray)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "query") |
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, String typeEnum, PrintWriter out) { |
| | | public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer state, String typeEnum, PrintWriter out) { |
| | | if (pageIndex == null || pageIndex < 1) { |
| | | pageIndex = 1; |
| | | } |
| | |
| | | } |
| | | |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1, typeEnum); |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1, typeEnum,acceptData.getSystem()); |
| | | if (list == null || list.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据")); |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | long count = goodsEvaluateService.count(key, state, 1, typeEnum); |
| | | long count = goodsEvaluateService.count(key, state, 1, typeEnum,acceptData.getSystem()); |
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "querySuCai") |
| | | public void querySuCai(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, |
| | | public void querySuCai(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer state, |
| | | PrintWriter out) { |
| | | if (pageIndex == null || pageIndex < 1) { |
| | | pageIndex = 1; |
| | |
| | | } |
| | | |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2, null); |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2, null,acceptData.getSystem()); |
| | | if (list == null || list.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据")); |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | long count = goodsEvaluateService.count(key, state, 2, null); |
| | | long count = goodsEvaluateService.count(key, state, 2, null,acceptData.getSystem()); |
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodsByUrl") |
| | | public void getGoodsByUrl(String callback, String link, PrintWriter out) { |
| | | public void getGoodsByUrl(AdminAcceptData acceptData,String callback, String link, PrintWriter out) { |
| | | try { |
| | | //CommonGoods commonGoods = clipboardAnalysisManager.parseLink(link); |
| | | // 根据口令链接获取商品 |
| | |
| | | return; |
| | | } |
| | | GoodsDetailVO goodsDetail = null; |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem()); |
| | | GoodsMoneyConfigParamsDTO params = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | |
| | | if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveComment") |
| | | public void saveComment(String callback, String pid, CommentInfo commentInfo, PrintWriter out) { |
| | | public void saveComment(AdminAcceptData acceptData,String callback, String pid, CommentInfo commentInfo, PrintWriter out) { |
| | | try { |
| | | goodsEvaluateService.saveComment(pid, commentInfo); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "deleteComment") |
| | | public void deleteComment(String callback, String pid, String idArray, PrintWriter out) { |
| | | public void deleteComment(AdminAcceptData acceptData,String callback, String pid, String idArray, PrintWriter out) { |
| | | try { |
| | | if (StringUtil.isNullOrEmpty(idArray)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "release") |
| | | public void release(String callback, String id, PrintWriter out) { |
| | | public void release(AdminAcceptData acceptData,String callback, String id, PrintWriter out) { |
| | | try { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "queryComment") |
| | | public void queryComment(String callback, String pid, PrintWriter out) { |
| | | public void queryComment(AdminAcceptData acceptData,String callback, String pid, PrintWriter out) { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该动态信息已不存在")); |