Commit e9a61fa8 authored by youjj's avatar youjj

修改线路标签.banner和出游人信息表

parent 0361322c
package com.xxfc.platform.tour.comstnt;
public class RedisKey {
/**
*旅游标签的前缀
*/
public static final String CONSTANT_CODE_PREFIX ="cache:Tag:";
/**
*旅游标签的key
*/
public static final String CONSTANT_CODE_PREFIX_HOTTAG =CONSTANT_CODE_PREFIX+"hotTag";
/**
*首页banner的key
*/
public static final String CONSTANT_CODE_PREFIX_BANNER ="cache:banner:";
}
...@@ -6,6 +6,7 @@ import com.spring4all.swagger.EnableSwagger2Doc; ...@@ -6,6 +6,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
...@@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAceAuthClient @EnableAceAuthClient
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.admin.feign","com.xxfc.platform.tour.feign"}) @EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.admin.feign","com.xxfc.platform.tour.feign"})
@EnableAceCache @EnableAceCache
@EnableCaching
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.tour.mapper") @tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.tour.mapper")
public class TourApplication { public class TourApplication {
......
package com.xxfc.platform.tour.biz; package com.xxfc.platform.tour.biz;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.xxfc.platform.tour.comstnt.RedisKey;
import com.xxfc.platform.tour.mapper.TourBannerMapper; import com.xxfc.platform.tour.mapper.TourBannerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourBanner; import com.xxfc.platform.tour.entity.TourBanner;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 首页banner图 * 首页banner图
* *
...@@ -15,5 +22,27 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,5 +22,27 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
@Service @Service
public class TourBannerBiz extends BaseBiz<TourBannerMapper,TourBanner> { public class TourBannerBiz extends BaseBiz<TourBannerMapper,TourBanner> {
@Autowired
private RedisTemplate redisTemplate;
@Cache(key = RedisKey.CONSTANT_CODE_PREFIX_BANNER)
public List<TourBanner> findBannerList() {
TourBanner banner = new TourBanner();
banner.setIsDel(0);
return mapper.findBannerListByisDelOrderByRank(banner);
}
@CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_BANNER)
public void update(TourBanner banner) {
this.updateSelectiveById(banner);
}
@CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_BANNER)
public void remove(int id) {
this.deleteById(id);
}
} }
\ No newline at end of file
package com.xxfc.platform.tour.biz; package com.xxfc.platform.tour.biz;
import com.xxfc.platform.tour.mapper.TourTagBannerMapper; import com.xxfc.platform.tour.mapper.TourTagBannerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourTagBanner; import com.xxfc.platform.tour.entity.TourTagBanner;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 标签轮播图 * 标签轮播图
* *
...@@ -15,4 +18,13 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,4 +18,13 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner> { public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner> {
public List<TourTagBanner> findById(long tid) {
TourTagBanner tourTagBanner = new TourTagBanner();
tourTagBanner.setId(tid);
tourTagBanner.setIsDel(0);
return mapper.select(tourTagBanner);
}
} }
\ No newline at end of file
package com.xxfc.platform.tour.biz; package com.xxfc.platform.tour.biz;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.comstnt.RedisKey;
import com.xxfc.platform.tour.entity.TourBanner;
import com.xxfc.platform.tour.mapper.TourTagMapper; import com.xxfc.platform.tour.mapper.TourTagMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourTag; import com.xxfc.platform.tour.entity.TourTag;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
import java.util.Map;
/** /**
* 旅游路线标签 * 旅游路线标签
* *
...@@ -15,4 +27,44 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,4 +27,44 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> { public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private TourTagBiz tagBiz;
@Cache(key = RedisKey.CONSTANT_CODE_PREFIX_HOTTAG)
public List<TourTag> getHotTag() {
TourTag tag = new TourTag();
tag.setIsDel(0);
tag.setIsHot(1);
return mapper.findHotListTag(tag);
}
public PageDataVO<TourTag> findAll(Map map) {
TourTag tag = new TourTag();
tag.setIsDel(0);
return PageDataVO.pageInfo((Integer)map.get("page"),(Integer)map.get("limit"),() -> mapper.findAllByIsDel(tag));
}
@CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_HOTTAG)
public void update(TourTag banner) {
this.updateSelectiveById(banner);
}
@CacheClear(key = RedisKey.CONSTANT_CODE_PREFIX_HOTTAG)
public void remove(int id) {
this.deleteById(id);
}
} }
\ No newline at end of file
package com.xxfc.platform.tour.biz; package com.xxfc.platform.tour.biz;
import com.xxfc.platform.tour.mapper.TourUserMapper; import com.xxfc.platform.tour.mapper.TourUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourUser; import com.xxfc.platform.tour.entity.TourUser;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 出游人信息表 * 出游人信息表
* *
...@@ -15,4 +18,15 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,4 +18,15 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourUserBiz extends BaseBiz<TourUserMapper,TourUser> { public class TourUserBiz extends BaseBiz<TourUserMapper,TourUser> {
public List<TourUser> getTourUser(Integer id, Integer isChild) {
TourUser user = new TourUser();
user.setUserid(id);
user.setIsdel(0);
user.setIsChild(isChild);
return mapper.findListByTourUser(user);
}
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository; ...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 旅游路线标签 * 旅游路线标签
......
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.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourBannerBiz; import com.xxfc.platform.tour.biz.TourBannerBiz;
import com.xxfc.platform.tour.entity.TourBanner; import com.xxfc.platform.tour.entity.TourBanner;
import com.xxfc.platform.tour.service.TourBannerService; import io.swagger.annotations.ApiOperation;
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;
...@@ -20,7 +19,7 @@ import java.util.List; ...@@ -20,7 +19,7 @@ import java.util.List;
public class TourBannerController extends BaseController<TourBannerBiz,TourBanner> { public class TourBannerController extends BaseController<TourBannerBiz,TourBanner> {
@Autowired @Autowired
private TourBannerService bannerService; private TourBannerBiz bannerBiz;
/** /**
...@@ -30,10 +29,34 @@ public class TourBannerController extends BaseController<TourBannerBiz,TourBanne ...@@ -30,10 +29,34 @@ public class TourBannerController extends BaseController<TourBannerBiz,TourBanne
@GetMapping("/app/unauth/findBannerlist") @GetMapping("/app/unauth/findBannerlist")
public ListRestResponse findBannerlist(){ public ListRestResponse findBannerlist(){
List<TourBanner> bannerList = bannerService.findBannerList(); List<TourBanner> bannerList = bannerBiz.findBannerList();
return new ListRestResponse().result(bannerList).count(bannerList.size()); return new ListRestResponse().result(bannerList).count(bannerList.size());
} }
@Override
@ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT)
public ObjectRestResponse<TourBanner> update(@RequestBody TourBanner banner){
bannerBiz.update(banner);
return new ObjectRestResponse<TourBanner>();
}
@Override
@ApiOperation("删除")
@RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
public ObjectRestResponse<TourBanner> remove(@PathVariable int id){
bannerBiz.remove(id);
return new ObjectRestResponse<TourBanner>();
}
} }
\ No newline at end of file
...@@ -4,9 +4,6 @@ import com.github.wxiaoqi.security.common.msg.ListRestResponse; ...@@ -4,9 +4,6 @@ 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 com.xxfc.platform.tour.service.TourTagBannerService;
import com.xxfc.platform.tour.service.TourTagService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -19,12 +16,12 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou ...@@ -19,12 +16,12 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou
@Autowired @Autowired
private TourTagBannerService tagBannerService; private TourTagBannerBiz tagBannerBiz;
@GetMapping("/app/unauth/findById/{tid}") @GetMapping("/app/unauth/findById/{tid}")
public ListRestResponse findById(@PathVariable long tid){ public ListRestResponse findById(@PathVariable long tid){
List<TourTagBanner> tourTagBanners = tagBannerService.findById(tid); List<TourTagBanner> tourTagBanners = tagBannerBiz.findById(tid);
return new ListRestResponse().result(tourTagBanners).count(tourTagBanners.size()); return new ListRestResponse().result(tourTagBanners).count(tourTagBanners.size());
} }
......
...@@ -3,12 +3,11 @@ package com.xxfc.platform.tour.rest; ...@@ -3,12 +3,11 @@ package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.msg.ListRestResponse; import com.github.wxiaoqi.security.common.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourGoodTagBiz; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourTagBiz; import com.xxfc.platform.tour.biz.TourTagBiz;
import com.xxfc.platform.tour.entity.TourBanner;
import com.xxfc.platform.tour.entity.TourTag; import com.xxfc.platform.tour.entity.TourTag;
import com.xxfc.platform.tour.entity.TourTagBanner; import io.swagger.annotations.ApiOperation;
import com.xxfc.platform.tour.service.TourTagBannerService;
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.*; import org.springframework.web.bind.annotation.*;
...@@ -20,28 +19,48 @@ import java.util.Map; ...@@ -20,28 +19,48 @@ import java.util.Map;
public class TourTagController extends BaseController<TourTagBiz,TourTag> { public class TourTagController extends BaseController<TourTagBiz,TourTag> {
@Autowired @Autowired
private TourTagService tagService; private TourTagBiz tagBiz;
@GetMapping("/app/unauth/getTagList") @GetMapping("/app/unauth/getTagList")
public ListRestResponse getTagList(@RequestBody Map map){ public ListRestResponse getTagList(@RequestBody Map<Object,Integer> map){
if (map==null||map.keySet().size()==0) { if (map==null||map.keySet().size()==0) {
new ListRestResponse<>().result("错误"); new ListRestResponse<>().result("错误");
} }
int hot = (int) map.get("hot"); Integer hot = map.get("hot");
if (hot==1){ if (hot==1){
List<TourTag> hotTag = tagService.getHotTag(); List<TourTag> hotTag = tagBiz.getHotTag();
return new ListRestResponse().result(hotTag).count(hotTag.size()); return new ListRestResponse().result(hotTag).count(hotTag.size());
} }
PageDataVO<TourTag> all = tagBiz.findAll(map);
return new ListRestResponse().result(all).count(all.getData().size());
}
@Override
@ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT)
public ObjectRestResponse<TourTag> update(@RequestBody TourTag tag){
tagBiz.update(tag);
return new ObjectRestResponse<TourTag>();
}
List<TourTag> Tags= tagService.findAll(map);
return new ListRestResponse().result(Tags).count(Tags.size());
@Override
@ApiOperation("删除")
@RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
public ObjectRestResponse<TourTag> remove(@PathVariable int id){
tagBiz.remove(id);
return new ObjectRestResponse<TourTag>();
} }
......
...@@ -6,7 +6,6 @@ import com.github.wxiaoqi.security.common.rest.BaseController; ...@@ -6,7 +6,6 @@ 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.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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -20,14 +19,14 @@ import java.util.List; ...@@ -20,14 +19,14 @@ import java.util.List;
public class TourUserController extends TourBaseController<TourUserBiz> { public class TourUserController extends TourBaseController<TourUserBiz> {
@Autowired @Autowired
private TourUserService userService; private TourUserBiz userBiz;
@GetMapping("/app/unauth/getTourUser/{isChild}") @GetMapping("/app/unauth/getTourUser/{isChild}")
public ListRestResponse getTourUser(@PathVariable int isChild){ public ListRestResponse getTourUser(@PathVariable int isChild){
// AppUserDTO userInfo = getUserInfo(); // AppUserDTO userInfo = getUserInfo();
// Integer id = userInfo.getId(); // Integer id = userInfo.getId();
Integer id =14; Integer id =14;
List<TourUser> tourUsers= userService.getTourUser(id,isChild); List<TourUser> tourUsers= userBiz.getTourUser(id,isChild);
return new ListRestResponse().result(tourUsers).count(tourUsers.size()); return new ListRestResponse().result(tourUsers).count(tourUsers.size());
} }
......
package com.xxfc.platform.tour.service;
import com.github.wxiaoqi.security.common.service.impl.BaseServiceImpl;
import com.xxfc.platform.tour.entity.TourBanner;
import com.xxfc.platform.tour.mapper.TourBannerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Administrator
*/
@Service
public class TourBannerService extends BaseServiceImpl<TourBannerMapper,TourBanner> {
@Autowired
private TourBannerMapper bannerMapper;
@Autowired
private RedisTemplate redisTemplate;
public List<TourBanner> findBannerList() {
TourBanner banner = new TourBanner();
banner.setIsDel(0);
List<TourBanner> bannerList = (List<TourBanner>) redisTemplate.opsForValue().get("homeBanner");
if (bannerList==null||bannerList.size()==0) {
bannerList = bannerMapper.findBannerListByisDelOrderByRank(banner);
redisTemplate.opsForValue().set("homeBanner",bannerList);
}
return bannerList;
}
}
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);
}
}
package com.xxfc.platform.tour.service;
import com.github.pagehelper.PageInfo;
import com.xxfc.platform.tour.biz.TourTagBiz;
import com.xxfc.platform.tour.entity.TourTag;
import com.xxfc.platform.tour.mapper.TourTagMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.awt.print.Pageable;
import java.util.List;
import java.util.Map;
@Service
public class TourTagService {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private TourTagMapper tagMapper;
@Autowired
private TourTagBiz tagBiz;
public List<TourTag> getHotTag() {
List<TourTag> hotTagList = (List<TourTag>) redisTemplate.opsForValue().get("hotTag");
if (hotTagList==null||hotTagList.size()==0) {
System.out.println("mysql");
TourTag tag = new TourTag();
tag.setIsDel(0);
tag.setIsHot(1);
List<TourTag> tagList=tagMapper.findHotListTag(tag);
redisTemplate.opsForValue().set("hotTag",tagList);
}
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