|
@@ -8,7 +8,9 @@ import com.caimei365.user.model.ResponseJson;
|
|
|
import com.caimei365.user.components.RedisService;
|
|
|
import com.caimei365.user.model.dto.MobileDto;
|
|
|
import com.caimei365.user.model.dto.PasswordDto;
|
|
|
+import com.caimei365.user.model.dto.SuperVipDto;
|
|
|
import com.caimei365.user.model.po.ShopPo;
|
|
|
+import com.caimei365.user.model.po.SuperVipPo;
|
|
|
import com.caimei365.user.model.po.VipPayHistoryPo;
|
|
|
import com.caimei365.user.model.vo.ClubTemporaryVo;
|
|
|
import com.caimei365.user.model.vo.ShopVo;
|
|
@@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -456,10 +459,39 @@ public class BaseServiceImpl implements BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson findVipHistory(Integer userId,Integer pageNum,Integer pageSize) {
|
|
|
+ public ResponseJson findVipHistory(Integer userId, Integer pageNum, Integer pageSize) {
|
|
|
+ if (null == userId) {
|
|
|
+ return ResponseJson.error("参数异常:用户Id不能为空!", null);
|
|
|
+ }
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<VipPayHistoryPo> vipHistory = vipMapper.findVipHistory(userId);
|
|
|
PageInfo<VipPayHistoryPo> pageInfo = new PageInfo<>(vipHistory);
|
|
|
return ResponseJson.success(pageInfo);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> superCenter(Integer userId) {
|
|
|
+ if (null == userId) {
|
|
|
+ return ResponseJson.error("参数异常:用户Id不能为空!", null);
|
|
|
+ }
|
|
|
+ //1.封装vipDto看超级会员是否过期,0未开通,-1过期,1未过期
|
|
|
+ SuperVipPo superVip = vipMapper.findSuperVip(userId);
|
|
|
+ SuperVipDto superVipDto = new SuperVipDto();
|
|
|
+ if (superVip == null) {
|
|
|
+ superVipDto.setEndFlag("0");
|
|
|
+ }
|
|
|
+ SuperVipPo endTime = vipMapper.findEndTime(userId);
|
|
|
+ if (endTime == null) {
|
|
|
+ superVipDto.setEndFlag("-1");
|
|
|
+ superVipDto.setEndTime(superVip.getEndTime());
|
|
|
+ }
|
|
|
+ superVipDto.setEndFlag("1");
|
|
|
+ superVipDto.setEndTime(endTime.getEndTime());
|
|
|
+ Map<String, Object> map = new HashMap(3);
|
|
|
+ map.put("vip", superVipDto);
|
|
|
+ //todo 2.查专属优惠卷
|
|
|
+
|
|
|
+ //todo 3.查专属商品
|
|
|
+ return ResponseJson.success(map);
|
|
|
+ }
|
|
|
}
|