Commit 61b9e60c authored by libin's avatar libin

旅游标签

parent fd87710c
......@@ -19,23 +19,28 @@ import lombok.Data;
public class TourGoodSite implements Serializable {
private static final long serialVersionUID = 1L;
//
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("")
private Integer id;
//路线id
/**
* 路线id
*/
@Column(name = "good_id")
@ApiModelProperty(value = "路线id")
private Integer goodId;
//站点名称
/**
* 站点名称
*/
@Column(name = "name")
@ApiModelProperty(value = "站点名称")
private String name;
//站点地址
/**
* 站点地址
*/
@Column(name = "address")
@ApiModelProperty(value = "站点地址")
private String address;
......@@ -73,8 +78,6 @@ public class TourGoodSite implements Serializable {
@ApiModelProperty("地址-市(名称)")
private Integer cityName;
//出发时间
@Column(name = "depart_time")
@ApiModelProperty(value = "出发时间")
......
package com.xxfc.platform.tour.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -16,6 +17,7 @@ import lombok.Data;
*/
@Data
@Table(name = "tour_good_verification")
@ApiModel("旅游线路核销明细")
public class TourGoodVerification implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -28,7 +30,7 @@ public class TourGoodVerification implements Serializable {
private Integer id;
/**
* 分公司id
* 日期规格
*/
@Column(name = "spe_id")
@ApiModelProperty(value = "日期规格id")
......@@ -42,12 +44,19 @@ public class TourGoodVerification implements Serializable {
private Integer goodId;
/**
* 旅游路线id
* 出发路线id
*/
@Column(name = "site_id")
@ApiModelProperty(value = "出发路线id")
private Integer siteId;
/**
* 出发时间
*/
@Column(name = "depart_time")
@ApiModelProperty("出发时间")
private Long departTime;
/**
* 总人数
......@@ -77,5 +86,4 @@ public class TourGoodVerification implements Serializable {
@ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel;
}
......@@ -8,15 +8,25 @@ import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import tk.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
/**
* @author libin
* @version 1.0
* @description 旅游
* @data 2019/6/14 11:19
*/
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.github.wxiaoqi.security.admin.feign","com.xxfc.platform"})
@EnableAceCache
@EnableCaching
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.tour.mapper")
@MapperScan(basePackages = "com.xxfc.platform.tour.mapper")
public class TourApplication {
public static void main(String[] args) {
......
......@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.dto.TourTagBannerDTO;
import com.xxfc.platform.tour.mapper.TourTagBannerMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
......@@ -108,7 +109,11 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
@Transactional(rollbackFor = Exception.class)
public void updateTourBannerByBatch(List<TourTagBannerDTO> tourTagBannerDTOS,UserDTO userDTO) {
List<Long> tourTagBannerIds = tourTagBannerDTOS.stream().filter(tourTagBannerDTO -> Objects.nonNull(tourTagBannerDTO.getId())).map(TourTagBannerDTO::getId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(tourTagBannerIds)){
mapper.updateTourBannerStatusByTagannerIdsAndTagId(tourTagBannerIds,tourTagBannerDTOS.get(0).getTagId(),1);
}else {
mapper.updateTourTagBannerStatusByTagId(tourTagBannerDTOS.get(0).getTagId(),1,Instant.now().toEpochMilli());
}
tourTagBannerDTOS.stream().filter(tourTagBannerDTO -> Objects.isNull(tourTagBannerDTO.getId())).peek(tourTagBannerDTO -> {
save(tourTagBannerDTO,userDTO);
}).count();
......
......@@ -198,8 +198,8 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
* @param name
* @return
*/
public boolean checkTagNameExist(String name) {
List<TourTag> tourTags = mapper.findByTagName(name);
public boolean checkTagNameExist(String name,Integer id) {
List<TourTag> tourTags = mapper.findByTagName(name,id);
return CollectionUtils.isNotEmpty(tourTags);
}
......
......@@ -17,9 +17,20 @@ import java.util.List;
*/
@Repository
public interface TourTagMapper extends Mapper<TourTag> {
/**
* 根据热度查询标签
* @param tag
* @return
*/
@Select("select * from tour_tag where is_del=#{isDel} and is_hot=#{isHot} order by rank ASC")
List<TourTag> findHotListTag(TourTag tag);
/**
* 根据删除状态查询标签
* @param tagBanner
* @return
*/
@Select("select * from tour_tag where is_del=#{isDel} order by rank ASC")
@ResultMap(value = "tourTagMap")
List<TourTag> findAllByIsDel(TourTag tagBanner);
......@@ -49,16 +60,37 @@ public interface TourTagMapper extends Mapper<TourTag> {
@Update("update tour_tag set `is_del`=#{status} where `id`=#{id}")
int updateTourTagStatusById(@Param("id") Integer id, @Param("status") int status);
/**
* 编辑标签
* @param tourTagDTO
* @return
*/
@Update("update tour_tag set `name`=#{name},`img`=#{img},`describe`=#{describe},`link`=#{link}" +
",`rank`=#{rank},`upd_time`=#{updTime} where `id`=#{id}")
int updateTourTag(TourTagDTO tourTagDTO);
/**
* 更新标签热度
* @param id
* @param state
* @return
*/
@Update("update tour_tag set `is_hot`=#{state} where `id`=#{id}")
int updateTourTagHotSate(@Param("id") Integer id, @Param("state") Integer state);
@Select("select * from tour_tag where name=#{name}")
List<TourTag> findByTagName(String name);
/**
* 检测标签名是否存在
* @param name
* @param id
* @return
*/
List<TourTag> findByTagName(@Param("name") String name,@Param("id") Integer id);
/**
*根据状态查询 标签
* @param status
* @return
*/
@Select("select `id`,`name` from tour_tag where `is_del`=#{status}")
List<TourTag> selectByStuatus(Integer status);
}
......@@ -125,8 +125,8 @@ public class TourTagAdminController extends TourBaseController<TourTagBiz> {
*/
@GetMapping("/exist")
@ApiOperation("校验标签名是否存在")
public ObjectRestResponse checkTagNameExists(@RequestParam("name") String name){
boolean exist = getBaseBiz().checkTagNameExist(name);
public ObjectRestResponse checkTagNameExists(@RequestParam("name") String name,@RequestParam(value = "id",required = false) Integer id){
boolean exist = getBaseBiz().checkTagNameExist(name,id);
return ObjectRestResponse.succ(exist);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="package com.xxfc.platform.tour.mapper.TourGoodVerificationMapper">
<mapper namespace="com.xxfc.platform.tour.mapper.TourGoodVerificationMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="package com.xxfc.platform.tour.entity.TourGoodVerification" id="tourGoodVerificationMap">
<resultMap type="com.xxfc.platform.tour.entity.TourGoodVerification" id="tourGoodVerificationMap">
<result property="id" column="id"/>
<result property="companyId" column="company_id"/>
<result property="speId" column="spe_id"/>
<result property="siteId" column="site_id"/>
<result property="goodId" column="good_id"/>
<result property="departTime" column="depart_time"/>
<result property="totalPerson" column="total_person"/>
......
......@@ -23,4 +23,9 @@
values(#{name},#{img},#{describe},#{rank},#{ctrTime})
</insert>
<select id="findByTagName" resultMap="tourTagMap">
select * from tour_tag where name=#{name} <if test="id!=null">
AND `id` not in (#{id})
</if>;
</select>
</mapper>
\ No newline at end of file
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