Commit ea84f5a5 authored by youjj's avatar youjj

增加出游人信息表和路线标签

parent 474460dd
...@@ -4,16 +4,14 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign; ...@@ -4,16 +4,14 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.rest.BaseController;
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 javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@Slf4j @Slf4j
public class TourBaseController<Biz extends BaseBiz> { public class TourBaseController<Biz extends BaseBiz>extends BaseController {
@Autowired
protected HttpServletRequest request;
@Autowired
protected Biz baseBiz;
@Autowired @Autowired
protected UserFeign userFeign; protected UserFeign userFeign;
@Autowired @Autowired
......
...@@ -64,6 +64,11 @@ public class TourUser implements Serializable { ...@@ -64,6 +64,11 @@ public class TourUser implements Serializable {
@Column(name = "isdel") @Column(name = "isdel")
@ApiModelProperty(value = "是否删除:0-正常;1-删除") @ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isdel; private Integer isdel;
@Column(name = "is_child")
@ApiModelProperty(value = "是否删除:0-儿童;1-大人")
private Integer isChild;
} }
...@@ -17,6 +17,6 @@ import java.util.List; ...@@ -17,6 +17,6 @@ import java.util.List;
@Repository @Repository
public interface TourBannerMapper extends Mapper<TourBanner> { public interface TourBannerMapper extends Mapper<TourBanner> {
@Select("select * from tour_banner where is_del=#{isDel} order by rank ASC") @Select("select * from tour_banner where is_del=${isDel} order by rank ASC")
List<TourBanner> findBannerListByisDelOrderByRank(TourBanner banner); List<TourBanner> findBannerListByisDelOrderByRank(TourBanner banner);
} }
...@@ -16,6 +16,9 @@ import java.util.List; ...@@ -16,6 +16,9 @@ import java.util.List;
*/ */
@Repository @Repository
public interface TourTagMapper extends Mapper<TourTag> { public interface TourTagMapper extends Mapper<TourTag> {
@Select("select * from tour_tag where is_del=#{isDel} and is_hot=#{isHot} order by rank ASC") @Select("select * from tour_tag where is_del=${isDel} and is_hot=${isHot} order by rank ASC")
List<TourTag> findHotListTag(TourTag tag); List<TourTag> findHotListTag(TourTag tag);
@Select("select * from tour_tag where is_del=${isDel} order by rank ASC")
List<TourTag> findAllByIsDel(TourTag tagBanner);
} }
...@@ -2,8 +2,13 @@ package com.xxfc.platform.tour.mapper; ...@@ -2,8 +2,13 @@ package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourUser; import com.xxfc.platform.tour.entity.TourUser;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/** /**
* 出游人信息 * 出游人信息
* *
...@@ -11,6 +16,9 @@ import tk.mybatis.mapper.common.Mapper; ...@@ -11,6 +16,9 @@ import tk.mybatis.mapper.common.Mapper;
* @email nishijjo@qq.com * @email nishijjo@qq.com
* @date 2019-06-06 11:41:51 * @date 2019-06-06 11:41:51
*/ */
@Repository
public interface TourUserMapper extends Mapper<TourUser> { public interface TourUserMapper extends Mapper<TourUser> {
@Select("select * from tour_user where userid=${userid} and is_child=${isChild} and isdel=${isdel}")
List<TourUser> findListByTourUser(TourUser user);
} }
...@@ -27,7 +27,7 @@ public class TourBannerController extends BaseController<TourBannerBiz,TourBanne ...@@ -27,7 +27,7 @@ public class TourBannerController extends BaseController<TourBannerBiz,TourBanne
*查询banner图 *查询banner图
* @return * @return
*/ */
@GetMapping("findBannerlist") @GetMapping("/app/unauth/findBannerlist")
public ListRestResponse findBannerlist(){ public ListRestResponse findBannerlist(){
List<TourBanner> bannerList = bannerService.findBannerList(); List<TourBanner> bannerList = bannerService.findBannerList();
......
package com.xxfc.platform.tour.rest; package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourTagBannerBiz; import com.xxfc.platform.tour.biz.TourTagBannerBiz;
import com.xxfc.platform.tour.entity.TourTagBanner; import com.xxfc.platform.tour.entity.TourTagBanner;
import org.springframework.web.bind.annotation.RequestMapping; import com.xxfc.platform.tour.service.TourTagBannerService;
import org.springframework.web.bind.annotation.RestController; import com.xxfc.platform.tour.service.TourTagService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController @RestController
@RequestMapping("tourTagBanner") @RequestMapping("tourTagBanner")
public class TourTagBannerController extends BaseController<TourTagBannerBiz,TourTagBanner> { public class TourTagBannerController extends BaseController<TourTagBannerBiz,TourTagBanner> {
@Autowired
private TourTagBannerService tagBannerService;
@GetMapping("/app/unauth/findById/{tid}")
public ListRestResponse findById(@PathVariable long tid){
List<TourTagBanner> tourTagBanners = tagBannerService.findById(tid);
return new ListRestResponse().result(tourTagBanners).count(tourTagBanners.size());
}
} }
\ No newline at end of file
...@@ -6,13 +6,14 @@ import com.github.wxiaoqi.security.common.rest.BaseController; ...@@ -6,13 +6,14 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourGoodTagBiz; import com.xxfc.platform.tour.biz.TourGoodTagBiz;
import com.xxfc.platform.tour.biz.TourTagBiz; import com.xxfc.platform.tour.biz.TourTagBiz;
import com.xxfc.platform.tour.entity.TourTag; import com.xxfc.platform.tour.entity.TourTag;
import com.xxfc.platform.tour.entity.TourTagBanner;
import com.xxfc.platform.tour.service.TourTagBannerService;
import com.xxfc.platform.tour.service.TourTagService; import com.xxfc.platform.tour.service.TourTagService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("tourTag") @RequestMapping("tourTag")
...@@ -21,12 +22,28 @@ public class TourTagController extends BaseController<TourTagBiz,TourTag> { ...@@ -21,12 +22,28 @@ public class TourTagController extends BaseController<TourTagBiz,TourTag> {
@Autowired @Autowired
private TourTagService tagService; private TourTagService tagService;
@GetMapping("/app/unauth/hotTag") @GetMapping("/app/unauth/getTagList")
public ListRestResponse getHotTag(){ public ListRestResponse getTagList(@RequestBody Map map){
List<TourTag> hotTag = tagService.getHotTag(); if (map==null||map.keySet().size()==0) {
new ListRestResponse<>().result("错误");
}
int hot = (int) map.get("hot");
if (hot==1){
List<TourTag> hotTag = tagService.getHotTag();
return new ListRestResponse().result(hotTag).count(hotTag.size());
}
List<TourTag> Tags= tagService.findAll(map);
return new ListRestResponse().result(Tags).count(Tags.size());
return new ListRestResponse().result(hotTag).count(hotTag.size());
} }
} }
\ No newline at end of file
package com.xxfc.platform.tour.rest; package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourUserBiz; import com.xxfc.platform.tour.biz.TourUserBiz;
import com.xxfc.platform.tour.common.TourBaseController;
import com.xxfc.platform.tour.entity.TourUser; import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.tour.service.TourUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController @RestController
@RequestMapping("tourUser") @RequestMapping("tourUser")
public class TourUserController extends BaseController<TourUserBiz,TourUser> { public class TourUserController extends TourBaseController<TourUserBiz> {
@Autowired
private TourUserService userService;
@GetMapping("/app/unauth/getTourUser/{isChild}")
public ListRestResponse getTourUser(@PathVariable int isChild){
// AppUserDTO userInfo = getUserInfo();
// Integer id = userInfo.getId();
Integer id =14;
List<TourUser> tourUsers= userService.getTourUser(id,isChild);
return new ListRestResponse().result(tourUsers).count(tourUsers.size());
}
} }
\ No newline at end of file
package com.xxfc.platform.tour.service;
import com.xxfc.platform.tour.biz.TourTagBannerBiz;
import com.xxfc.platform.tour.entity.TourTagBanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TourTagBannerService {
@Autowired
private TourTagBannerBiz tagBannerBiz;
public List<TourTagBanner> findById(long tid) {
TourTagBanner tourTagBanner = new TourTagBanner();
tourTagBanner.setId(tid);
tourTagBanner.setIsDel(0);
return tagBannerBiz.selectList(tourTagBanner);
}
}
...@@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class TourTagService { public class TourTagService {
...@@ -15,27 +16,37 @@ public class TourTagService { ...@@ -15,27 +16,37 @@ public class TourTagService {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired
private TourTagBiz tagBiz;
@Autowired @Autowired
private TourTagMapper tagMapper; private TourTagMapper tagMapper;
@Autowired
private TourTagBiz tagBiz;
public List<TourTag> getHotTag() { public List<TourTag> getHotTag() {
List<TourTag> hotTagList = (List<TourTag>) redisTemplate.opsForValue().get("hotTag"); List<TourTag> hotTagList = (List<TourTag>) redisTemplate.opsForValue().get("hotTag");
if (hotTagList==null||hotTagList.size()==0) { if (hotTagList==null||hotTagList.size()==0) {
System.out.println("mysql");
TourTag tag = new TourTag(); TourTag tag = new TourTag();
tag.setIsDel(0); tag.setIsDel(0);
tag.setIsHot(1); tag.setIsHot(1);
List<TourTag> tagList=tagMapper.findHotListTag(tag); List<TourTag> tagList=tagMapper.findHotListTag(tag);
redisTemplate.opsForValue().set("hotTag",tagList); redisTemplate.opsForValue().set("hotTag",tagList);
} }
return hotTagList; return hotTagList;
} }
public List<TourTag> findAll(Map map) {
TourTag tagBanner = new TourTag();
tagBanner.setIsDel(0);
return tagMapper.findAllByIsDel(tagBanner);
}
} }
package com.xxfc.platform.tour.service;
import com.github.wxiaoqi.security.admin.biz.UserBiz;
import com.xxfc.platform.tour.biz.TourUserBiz;
import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.tour.mapper.TourUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TourUserService {
@Autowired
private TourUserMapper userMapper;
public List<TourUser> getTourUser(Integer id, Integer isChild) {
TourUser user = new TourUser();
user.setUserid(id);
user.setIsdel(0);
user.setIsChild(isChild);
return userMapper.findListByTourUser(user);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment