| | |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | |
| | | import com.yeshi.fanli.util.aitaoker.AitaokerApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.user.cloud.CloudOrderMenuVO;
|
| | | import com.yeshi.fanli.vo.user.cloud.UserCloudInfoVO;
|
| | |
|
| | |
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | /**
|
| | | * 查询开通记录
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(cloudInfoVO));
|
| | | |
| | | // 教程
|
| | | List<BannerVO> listBanner = swiperPictureService.getByBannerCard("cloud_course");
|
| | | if (listBanner != null && listBanner.size() > 0) {
|
| | | cloudInfoVO.setCourse(listBanner.get(0));
|
| | | }
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(gsonBuilder.create().toJson(cloudInfoVO)));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchCircleState")
|
| | | public void switchCircleState(String callback, AcceptData acceptData, Long uid, Boolean state, PrintWriter out) {
|
| | | public void switchCircleState(String callback, AcceptData acceptData, Long uid, Integer state, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "状态不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | boolean reslut = false;
|
| | | if (state == 1) {
|
| | | reslut = true;
|
| | | }
|
| | | |
| | | try {
|
| | | userCloudGroupService.switchCircleState(uid, state);
|
| | | userCloudGroupService.switchCircleState(uid, reslut);
|
| | | } catch (UserCloudGroupException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchGroupState")
|
| | | public void switchGroupState(String callback, AcceptData acceptData, Long uid, Long id, Boolean state,
|
| | | public void switchGroupState(String callback, AcceptData acceptData, Long uid, Long id, Integer state,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | boolean reslut = false;
|
| | | if (state == 1) {
|
| | | reslut = true;
|
| | | }
|
| | | |
| | | try {
|
| | | userCloudGroupService.switchGroupState(uid, id, state);
|
| | | userCloudGroupService.switchGroupState(uid, id, reslut);
|
| | | // 获取最新群
|
| | | List<UserCloudGroup> list = userCloudGroupService.listGroupByUid(uid);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("listGroup", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (UserCloudGroupException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 设置状态
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteGroup")
|
| | | public void switchGroupState(String callback, AcceptData acceptData, Long uid, Long id, |
| | | PrintWriter out) {
|
| | | if (uid == null || id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数不完整"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | userCloudGroupService.deleteGroup(uid, id);
|
| | | |
| | | // 获取最新群
|
| | | List<UserCloudGroup> list = userCloudGroupService.listGroupByUid(uid);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("listGroup", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (UserCloudGroupException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | commonGoods.setState(2);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (state != null && state == UserCloudGoods.STATE_INVALID) {
|
| | | commonGoods.setState(1);
|
| | | }
|
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | | detailVO.setId(commonGoods.getId());
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, AcceptData acceptData, Long uid, Integer type, Boolean state,
|
| | | public void switchState(String callback, AcceptData acceptData, Long uid, Integer type, Integer state,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | if (uid == null || type == null || state == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数不完整"));
|
| | | return;
|
| | | }
|
| | | if (type == 1) {
|
| | | userCloudManageService.save(uid, state, null);
|
| | | } else {
|
| | | userCloudManageService.save(uid, null, state);
|
| | | |
| | | boolean reslut = false;
|
| | | if (state == 1) {
|
| | | reslut = true;
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | |
| | | if (type == 1) {
|
| | | userCloudManageService.save(uid, reslut, null);
|
| | | } else {
|
| | | userCloudManageService.save(uid, null, reslut);
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", reslut);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | key = StringUtil.Md5(key);
|
| | | redisManager.cacheCommonString(key , builder.toString() , 60*10);
|
| | |
|
| | | String link = configService.get(ConfigKeyEnum.cloudAlipayNotifyLink.getKey()) +"?key=%s";
|
| | | String link = configService.get(ConfigKeyEnum.cloudAlipayJumpLink.getKey()) +"?key=%s";
|
| | | JSONObject dataObject = new JSONObject();
|
| | | dataObject.put("link", String.format(link, key));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(dataObject));
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 支付完成
|
| | | * |
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "payEnd")
|
| | | public void payEnd(String callback, AcceptData acceptData, Long uid, Long id, PrintWriter out) {
|
| | | if (uid == null || id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "参数信息缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | // 检测是否支付完成
|
| | | userCloudAlipayManager.tradeQueryByOrderId(id);
|
| | | |
| | | UserCloudOrder cloudOrder = userCloudOrderService.selectByPrimaryKey(id);
|
| | | JSONObject dataObject = new JSONObject();
|
| | | dataObject.put("money", cloudOrder.getMoney());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(dataObject));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "回调信息失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 动态一键发单
|
| | | * @param callback
|
| | | * @param acceptData
|