|
|
@ -4,6 +4,7 @@ package co.yixiang.app.modules.user.rest; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.iocoder.yudao.framework.common.pojo.ApiResult; |
|
|
|
import cn.iocoder.yudao.framework.common.pojo.ApiResult; |
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
|
|
|
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; |
|
|
|
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; |
|
|
|
import co.yixiang.app.common.aop.NoRepeatSubmit; |
|
|
|
import co.yixiang.app.common.aop.NoRepeatSubmit; |
|
|
|
import co.yixiang.app.common.bean.LocalUser; |
|
|
|
import co.yixiang.app.common.bean.LocalUser; |
|
|
@ -12,33 +13,46 @@ import co.yixiang.app.modules.user.param.UserEditParam; |
|
|
|
import co.yixiang.logging.aop.log.AppLog; |
|
|
|
import co.yixiang.logging.aop.log.AppLog; |
|
|
|
import co.yixiang.constant.ShopConstants; |
|
|
|
import co.yixiang.constant.ShopConstants; |
|
|
|
import co.yixiang.enums.BillInfoEnum; |
|
|
|
import co.yixiang.enums.BillInfoEnum; |
|
|
|
|
|
|
|
import co.yixiang.modules.bbs.service.YxBbsService; |
|
|
|
import co.yixiang.modules.evaluation.service.YxEvaluationRelationService; |
|
|
|
import co.yixiang.modules.evaluation.service.YxEvaluationRelationService; |
|
|
|
import co.yixiang.modules.evaluation.vo.YxStoreEvaluationRelationQueryVo; |
|
|
|
import co.yixiang.modules.evaluation.vo.YxStoreEvaluationRelationQueryVo; |
|
|
|
import co.yixiang.modules.order.service.YxStoreOrderService; |
|
|
|
import co.yixiang.modules.order.service.YxStoreOrderService; |
|
|
|
import co.yixiang.modules.order.vo.UserOrderCountVo; |
|
|
|
import co.yixiang.modules.order.vo.UserOrderCountVo; |
|
|
|
|
|
|
|
import co.yixiang.modules.order.vo.YxStoreOrderQueryVo; |
|
|
|
|
|
|
|
import co.yixiang.modules.product.domain.YxStoreProductReply; |
|
|
|
import co.yixiang.modules.product.service.YxStoreProductRelationService; |
|
|
|
import co.yixiang.modules.product.service.YxStoreProductRelationService; |
|
|
|
|
|
|
|
import co.yixiang.modules.product.service.YxStoreProductReplyService; |
|
|
|
|
|
|
|
import co.yixiang.modules.product.service.dto.YxStoreProductReplyDto; |
|
|
|
|
|
|
|
import co.yixiang.modules.product.service.dto.YxStoreProductReplyQueryCriteria; |
|
|
|
import co.yixiang.modules.product.vo.YxStoreProductRelationQueryVo; |
|
|
|
import co.yixiang.modules.product.vo.YxStoreProductRelationQueryVo; |
|
|
|
import co.yixiang.modules.shop.service.YxSystemConfigService; |
|
|
|
import co.yixiang.modules.shop.service.YxSystemConfigService; |
|
|
|
import co.yixiang.modules.shop.service.YxSystemGroupDataService; |
|
|
|
import co.yixiang.modules.shop.service.YxSystemGroupDataService; |
|
|
|
import co.yixiang.modules.user.domain.YxUser; |
|
|
|
import co.yixiang.modules.user.domain.YxUser; |
|
|
|
import co.yixiang.modules.user.service.YxUserBillService; |
|
|
|
import co.yixiang.modules.user.domain.YxUserVTask; |
|
|
|
import co.yixiang.modules.user.service.YxUserService; |
|
|
|
import co.yixiang.modules.user.domain.YxUserVTaskCompleted; |
|
|
|
import co.yixiang.modules.user.service.YxUserSignService; |
|
|
|
import co.yixiang.modules.user.param.YxUserVTaskParam; |
|
|
|
|
|
|
|
import co.yixiang.modules.user.service.*; |
|
|
|
import co.yixiang.modules.user.vo.SignVo; |
|
|
|
import co.yixiang.modules.user.vo.SignVo; |
|
|
|
import co.yixiang.modules.user.vo.YxUserQueryVo; |
|
|
|
import co.yixiang.modules.user.vo.YxUserQueryVo; |
|
|
|
|
|
|
|
import co.yixiang.modules.user.vo.YxUserSignConfigQueryVo; |
|
|
|
|
|
|
|
import co.yixiang.utils.DateUtils; |
|
|
|
import co.yixiang.utils.StringUtils; |
|
|
|
import co.yixiang.utils.StringUtils; |
|
|
|
|
|
|
|
import co.yixiang.utils.YshopConstant; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.google.common.collect.Maps; |
|
|
|
import com.google.common.collect.Maps; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
import javafx.beans.binding.ObjectBinding; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.math.BigInteger; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
import static co.yixiang.constant.SystemConfigConstants.YSHOP_SHOW_RECHARGE; |
|
|
|
import static co.yixiang.constant.SystemConfigConstants.YSHOP_SHOW_RECHARGE; |
|
|
@ -65,6 +79,12 @@ public class LetterAppUserController { |
|
|
|
private final YxUserSignService userSignService; |
|
|
|
private final YxUserSignService userSignService; |
|
|
|
private final YxUserBillService userBillService; |
|
|
|
private final YxUserBillService userBillService; |
|
|
|
private final YxSystemConfigService systemConfigService; |
|
|
|
private final YxSystemConfigService systemConfigService; |
|
|
|
|
|
|
|
private final YxStoreProductReplyService storeProductReplyService; |
|
|
|
|
|
|
|
private final YxStoreOrderService storeOrderService; |
|
|
|
|
|
|
|
private final YxUserVTaskService userVTaskService; |
|
|
|
|
|
|
|
private final YxUserVTaskCompletedService userVTaskCompletedService; |
|
|
|
|
|
|
|
private final YxBbsService bbsService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -93,7 +113,7 @@ public class LetterAppUserController { |
|
|
|
* 获取各类轮播图 |
|
|
|
* 获取各类轮播图 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/menu/banner/{type}") |
|
|
|
@GetMapping("/menu/banner/{type}") |
|
|
|
@ApiOperation(value = "获取各种轮播图(0:首页 1:品牌馆 2:优惠券 3:活动专区 4:榜单列表)",notes = "获取轮播图") |
|
|
|
@ApiOperation(value = "获取各种轮播图(0:首页 1:眼部好物 2:线下门店 3:眼界生活 4:甄选评测 5:服务管家)",notes = "获取轮播图") |
|
|
|
public ApiResult<Map<String,Object>> bannerMenu(@PathVariable Integer type){ |
|
|
|
public ApiResult<Map<String,Object>> bannerMenu(@PathVariable Integer type){ |
|
|
|
Map<String,Object> map = new LinkedHashMap<>(); |
|
|
|
Map<String,Object> map = new LinkedHashMap<>(); |
|
|
|
// map.put("banner",systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_BANNER));
|
|
|
|
// map.put("banner",systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_BANNER));
|
|
|
@ -161,7 +181,6 @@ public class LetterAppUserController { |
|
|
|
return ApiResult.ok(relationService.userCollectProduct(page,limit,uid,type)); |
|
|
|
return ApiResult.ok(relationService.userCollectProduct(page,limit,uid,type)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取收藏评测 |
|
|
|
* 获取收藏评测 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -181,6 +200,8 @@ public class LetterAppUserController { |
|
|
|
// return ApiResult.ok(evaluationRelationService.userCollectEvaluation(page,limit,uid,type));
|
|
|
|
// return ApiResult.ok(evaluationRelationService.userCollectEvaluation(page,limit,uid,type));
|
|
|
|
return ApiResult.ok(list); |
|
|
|
return ApiResult.ok(list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 用户资金统计 |
|
|
|
* 用户资金统计 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -218,7 +239,14 @@ public class LetterAppUserController { |
|
|
|
@GetMapping("/sign/config") |
|
|
|
@GetMapping("/sign/config") |
|
|
|
@ApiOperation(value = "签到配置",notes = "签到配置") |
|
|
|
@ApiOperation(value = "签到配置",notes = "签到配置") |
|
|
|
public ApiResult<Object> signConfig(){ |
|
|
|
public ApiResult<Object> signConfig(){ |
|
|
|
return ApiResult.ok(systemGroupDataService.getDatas(ShopConstants.ZSW_SIGN_DAY_NUM)); |
|
|
|
List<JSONObject> datas = systemGroupDataService.getDatas(ShopConstants.ZSW_SIGN_DAY_NUM); |
|
|
|
|
|
|
|
ArrayList<String> futureDaysList = DateUtils.getFutureDaysList(6); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < datas.size(); i++) { |
|
|
|
|
|
|
|
JSONObject jsonObject = datas.get(i); |
|
|
|
|
|
|
|
jsonObject.put("dateNum",futureDaysList.get(i)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return ApiResult.ok(datas); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -241,7 +269,6 @@ public class LetterAppUserController { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 签到列表(年月) |
|
|
|
* 签到列表(年月) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
@AuthCheck |
|
|
|
@AuthCheck |
|
|
|
@GetMapping("/sign/month") |
|
|
|
@GetMapping("/sign/month") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParams({ |
|
|
@ -293,7 +320,57 @@ public class LetterAppUserController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthCheck |
|
|
|
|
|
|
|
@GetMapping("/user/myComment") |
|
|
|
|
|
|
|
@ApiOperation(value = "个人中心:我的评价",notes = "获取用户评价") |
|
|
|
|
|
|
|
public ApiResult<List<YxStoreProductReply>> myComment(@RequestParam(value = "page",defaultValue = "1")int page, |
|
|
|
|
|
|
|
@RequestParam(value = "limit",defaultValue = "10")int limit, |
|
|
|
|
|
|
|
YxStoreProductReplyQueryCriteria criteria){ |
|
|
|
|
|
|
|
//通过用户id查询用户评论
|
|
|
|
|
|
|
|
return ApiResult.ok(storeProductReplyService.queryAll(criteria)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthCheck |
|
|
|
|
|
|
|
@GetMapping("/user/CommonList") |
|
|
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
|
|
|
@ApiImplicitParam(name = "page", value = "页码,默认为1", paramType = "query", dataType = "int",dataTypeClass = Integer.class), |
|
|
|
|
|
|
|
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
@ApiOperation(value = "个人中心:常用清单",notes = "获取用户常用清单") |
|
|
|
|
|
|
|
public ApiResult<Object> CommonList(@RequestParam(value = "page", defaultValue = "1") int page, |
|
|
|
|
|
|
|
@RequestParam(value = "limit", defaultValue = "10") int limit){ |
|
|
|
|
|
|
|
Long uid = LocalUser.getUser().getUid(); |
|
|
|
|
|
|
|
Map<String, Object> map = storeOrderService.orderList(uid,-1, page, limit); |
|
|
|
|
|
|
|
Long total = (Long) map.get("total"); |
|
|
|
|
|
|
|
Long totalPage = (Long) map.get("totalPage"); |
|
|
|
|
|
|
|
List<YxStoreOrderQueryVo> list = (List<YxStoreOrderQueryVo>) map.get("list"); |
|
|
|
|
|
|
|
BigDecimal totalSave = storeOrderService.totalSave(list); //用户累计节省金额
|
|
|
|
|
|
|
|
Map<String, Object> map1 = new HashMap<>(); |
|
|
|
|
|
|
|
map1.put("data",map.get("list")); |
|
|
|
|
|
|
|
map1.put("totalSave",totalSave); |
|
|
|
|
|
|
|
return ApiResult.resultPage(total.intValue(), totalPage.intValue(), map1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthCheck |
|
|
|
|
|
|
|
@GetMapping("/sign/task") |
|
|
|
|
|
|
|
@ApiOperation(value = "签到v豆任务",notes = "签到v豆任务") |
|
|
|
|
|
|
|
public ApiResult<YxUserVTaskParam> tasks(){ |
|
|
|
|
|
|
|
YxUser user = LocalUser.getUser(); |
|
|
|
|
|
|
|
YxUserVTaskParam param = userVTaskService.selectTask(user); |
|
|
|
|
|
|
|
return ApiResult.ok(param); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthCheck |
|
|
|
|
|
|
|
@GetMapping("/sign/getIp") |
|
|
|
|
|
|
|
@ApiOperation(value = "获取ip",notes = "获取ip") |
|
|
|
|
|
|
|
public ApiResult ip(){ |
|
|
|
|
|
|
|
String clientIP = ServletUtils.getClientIP();//获取ip
|
|
|
|
|
|
|
|
String ipUrl = YshopConstant.Url.IP_URL;//获取ip归属地的接口
|
|
|
|
|
|
|
|
String cityInfo = StringUtils.getCityInfo(clientIP);//根据ip获取详细地址
|
|
|
|
|
|
|
|
return ApiResult.ok(cityInfo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|