Commit ad0b7117 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 216cdda5 33b00814
...@@ -2,15 +2,16 @@ package com.xxfc.platform.app; ...@@ -2,15 +2,16 @@ package com.xxfc.platform.app;
import com.ace.cache.EnableAceCache; import com.ace.cache.EnableAceCache;
import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient; import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
import com.spring4all.swagger.EnableSwagger2Doc;
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.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;
@SpringBootApplication @SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @EnableAceAuthClient
......
...@@ -10,7 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -10,7 +10,10 @@ 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;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
},exclude = DataSourceAutoConfiguration.class)
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @EnableAceAuthClient
......
...@@ -10,7 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -10,7 +10,10 @@ 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;
@SpringBootApplication @SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @EnableAceAuthClient
......
...@@ -19,28 +19,35 @@ import lombok.Data; ...@@ -19,28 +19,35 @@ import lombok.Data;
public class TourGoodSite implements Serializable { public class TourGoodSite implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@ApiModelProperty("") @ApiModelProperty("主键")
private Integer id; private Integer id;
//路线id /**
* 路线id
*/
@Column(name = "good_id") @Column(name = "good_id")
@ApiModelProperty(value = "路线id") @ApiModelProperty(value = "路线id")
private Integer goodId; private Integer goodId;
//站点名称 /**
* 站点名称
*/
@Column(name = "name") @Column(name = "name")
@ApiModelProperty(value = "站点名称") @ApiModelProperty(value = "站点名称")
private String name; private String name;
//站点地址 /**
* 站点地址
*/
@Column(name = "address") @Column(name = "address")
@ApiModelProperty(value = "站点地址") @ApiModelProperty(value = "站点地址")
private String address; private String address;
//分公司id /**
* 分公司id
*/
@Column(name = "company_id") @Column(name = "company_id")
@ApiModelProperty(value = "分公司id") @ApiModelProperty(value = "分公司id")
private String companyId; private String companyId;
...@@ -73,54 +80,72 @@ public class TourGoodSite implements Serializable { ...@@ -73,54 +80,72 @@ public class TourGoodSite implements Serializable {
@ApiModelProperty("地址-市(名称)") @ApiModelProperty("地址-市(名称)")
private Integer cityName; private Integer cityName;
/**
* 出发时间
//出发时间 */
@Column(name = "depart_time") @Column(name = "depart_time")
@ApiModelProperty(value = "出发时间") @ApiModelProperty(value = "出发时间")
private Long departTime; private Long departTime;
//站点经度 /**
* 站点经度
*/
@Column(name = "longitude") @Column(name = "longitude")
@ApiModelProperty(value = "站点经度") @ApiModelProperty(value = "站点经度")
private Double longitude; private Double longitude;
//站点纬度 /**
* 站点纬度
*/
@Column(name = "latitude") @Column(name = "latitude")
@ApiModelProperty(value = "站点纬度") @ApiModelProperty(value = "站点纬度")
private Double latitude; private Double latitude;
//类型:0起点,1-途径点;2-终点 /**
* 类型:0起点,1-途径点;2-终点
*/
@Column(name = "type") @Column(name = "type")
@ApiModelProperty(value = "类型:0起点,1-途径点;2-终点") @ApiModelProperty(value = "类型:0起点,1-途径点;2-终点")
private Integer type; private Integer type;
//排序 /**
* 排序
*/
@Column(name = "rank") @Column(name = "rank")
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private Integer rank; private Integer rank;
//状态 0正常 1关闭 /**
* 状态 0正常 1关闭
*/
@Column(name = "status") @Column(name = "status")
@ApiModelProperty(value = "状态 0正常 1关闭") @ApiModelProperty(value = "状态 0正常 1关闭")
private Integer status; private Integer status;
//创建时间 /**
* 创建时间
*/
@Column(name = "crt_time") @Column(name = "crt_time")
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Long crtTime; private Long crtTime;
//更新时间 /**
* 更新时间
*/
@Column(name = "upd_time") @Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true ) @ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime; private Long updTime;
//站点介绍 /**
* 站点介绍
*/
@Column(name = "intro") @Column(name = "intro")
@ApiModelProperty(value = "站点介绍") @ApiModelProperty(value = "站点介绍")
private String intro; private String intro;
//是否删除;0-正常;1-删除 /**
* 是否删除;0-正常;1-删除
*/
@Column(name = "is_del") @Column(name = "is_del")
@ApiModelProperty(value = "是否删除;0-正常;1-删除") @ApiModelProperty(value = "是否删除;0-正常;1-删除")
private Integer isDel; private Integer isDel;
......
...@@ -19,38 +19,48 @@ import lombok.Data; ...@@ -19,38 +19,48 @@ import lombok.Data;
public class TourGoodSpe implements Serializable { public class TourGoodSpe implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@ApiModelProperty("")
private Integer id; private Integer id;
//商品id /**
* 商品id
*/
@Column(name = "good_id") @Column(name = "good_id")
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品id")
private Integer goodId; private Integer goodId;
//规格名 /**
* 规格名
*/
@Column(name = "title") @Column(name = "title")
@ApiModelProperty(value = "规格名") @ApiModelProperty(value = "规格名")
private String title; private String title;
//父id /**
* 父id
*/
@Column(name = "parent_id") @Column(name = "parent_id")
@ApiModelProperty(value = "父id") @ApiModelProperty(value = "父id")
private Integer parentId; private Integer parentId;
//创建时间 /**
* 创建时间
*/
@Column(name = "crt_time") @Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true ) @ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime; private Long crtTime;
//更新时间 /**
* 更新时间
*/
@Column(name = "upd_time") @Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true ) @ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime; private Long updTime;
//是否删除:0-正常;1-删除 /**
* 是否删除:0-正常;1-删除
*/
@Column(name = "is_del") @Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0-正常;1-删除") @ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel; private Integer isDel;
......
...@@ -20,66 +20,85 @@ import lombok.Data; ...@@ -20,66 +20,85 @@ import lombok.Data;
public class TourGoodSpePrice implements Serializable { public class TourGoodSpePrice implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@ApiModelProperty("")
private Integer id; private Integer id;
//商品id /**
* 商品id
*/
@Column(name = "good_id") @Column(name = "good_id")
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品id")
private Integer goodId; private Integer goodId;
//出行时间 /**
* 出行时间
*/
@Column(name = "start_time") @Column(name = "start_time")
@ApiModelProperty(value = "出行时间") @ApiModelProperty(value = "出行时间")
private Date startTime; private Date startTime;
//结束时间 /**
* 结束时间
*/
@Column(name = "end_time") @Column(name = "end_time")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private Date endTime; private Date endTime;
//规格id /**
* 规格id
*/
@Column(name = "spe_id") @Column(name = "spe_id")
@ApiModelProperty(value = "规格id") @ApiModelProperty(value = "规格id")
private String speId; private String speId;
//价格 /**
* 价格
*/
@Column(name = "price") @Column(name = "price")
@ApiModelProperty(value = "价格") @ApiModelProperty(value = "价格")
private BigDecimal price; private BigDecimal price;
//儿童价格 /**
* 儿童价格
*/
@Column(name = "child_price") @Column(name = "child_price")
@ApiModelProperty(value = "儿童价格") @ApiModelProperty(value = "儿童价格")
private BigDecimal childPrice; private BigDecimal childPrice;
//会员价格 /**
* 会员价格
*/
@Column(name = "member_price") @Column(name = "member_price")
@ApiModelProperty(value = "会员价格") @ApiModelProperty(value = "会员价格")
private String memberPrice; private String memberPrice;
//库存 /**
* 库存
*/
@Column(name = "stock") @Column(name = "stock")
@ApiModelProperty(value = "库存") @ApiModelProperty(value = "库存")
private Integer stock; private Integer stock;
//创建时间 /**
* 创建时间
*/
@Column(name = "crt_time") @Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true ) @ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime; private Long crtTime;
//更新时间 /**
* 更新时间
*/
@Column(name = "upd_time") @Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true ) @ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime; private Long updTime;
//是否删除:0-正常;1-删除 /**
* 是否删除:0-正常;1-删除
*/
@Column(name = "is_del") @Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0-正常;1-删除") @ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel; private Integer isDel;
} }
package com.xxfc.platform.tour.entity; package com.xxfc.platform.tour.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import javax.persistence.*; import javax.persistence.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -16,6 +17,7 @@ import lombok.Data; ...@@ -16,6 +17,7 @@ import lombok.Data;
*/ */
@Data @Data
@Table(name = "tour_good_verification") @Table(name = "tour_good_verification")
@ApiModel("旅游线路核销明细")
public class TourGoodVerification implements Serializable { public class TourGoodVerification implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -28,7 +30,7 @@ public class TourGoodVerification implements Serializable { ...@@ -28,7 +30,7 @@ public class TourGoodVerification implements Serializable {
private Integer id; private Integer id;
/** /**
* 分公司id * 日期规格
*/ */
@Column(name = "spe_id") @Column(name = "spe_id")
@ApiModelProperty(value = "日期规格id") @ApiModelProperty(value = "日期规格id")
...@@ -42,7 +44,7 @@ public class TourGoodVerification implements Serializable { ...@@ -42,7 +44,7 @@ public class TourGoodVerification implements Serializable {
private Integer goodId; private Integer goodId;
/** /**
* 旅游路线id * 出发路线id
*/ */
@Column(name = "site_id") @Column(name = "site_id")
@ApiModelProperty(value = "出发路线id") @ApiModelProperty(value = "出发路线id")
...@@ -77,5 +79,4 @@ public class TourGoodVerification implements Serializable { ...@@ -77,5 +79,4 @@ public class TourGoodVerification implements Serializable {
@ApiModelProperty(value = "是否删除:0-正常;1-删除") @ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel; private Integer isDel;
} }
...@@ -8,15 +8,25 @@ import org.springframework.cache.annotation.EnableCaching; ...@@ -8,15 +8,25 @@ 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;
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 @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @EnableAceAuthClient
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.github.wxiaoqi.security.admin.feign","com.xxfc.platform"}) @EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.github.wxiaoqi.security.admin.feign","com.xxfc.platform"})
@EnableAceCache @EnableAceCache
@EnableCaching @EnableCaching
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.tour.mapper") @MapperScan(basePackages = "com.xxfc.platform.tour.mapper")
public class TourApplication { public class TourApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -46,6 +46,8 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -46,6 +46,8 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
private TourGoodTagBiz tagBiz; private TourGoodTagBiz tagBiz;
@Autowired @Autowired
private TourGoodSpeBiz speBiz; private TourGoodSpeBiz speBiz;
@Autowired
private TourGoodVerificationBiz verificationBiz;
@Autowired @Autowired
private UserFeign userFeign; private UserFeign userFeign;
...@@ -107,6 +109,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -107,6 +109,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
mapper.updateByPrimaryKeySelective(good); mapper.updateByPrimaryKeySelective(good);
} }
if(goodId>0){ if(goodId>0){
List<GoodBannerDTO> bannerList=dto.getBannerDTOS(); List<GoodBannerDTO> bannerList=dto.getBannerDTOS();
if(bannerList.size()>0){ if(bannerList.size()>0){
List<Integer> bannerIds=new ArrayList<>(); List<Integer> bannerIds=new ArrayList<>();
...@@ -130,6 +133,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -130,6 +133,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
bannerBiz.delGoodBanner(goodId,null); bannerBiz.delGoodBanner(goodId,null);
} }
List<GoodSiteDTO> siteDTOList=dto.getSiteDTOS(); List<GoodSiteDTO> siteDTOList=dto.getSiteDTOS();
List<Integer> sites=new ArrayList<>();
if(siteDTOList.size()>0){ if(siteDTOList.size()>0){
List<Integer> siteIds=new ArrayList<>(); List<Integer> siteIds=new ArrayList<>();
for (GoodSiteDTO siteDTO:siteDTOList){ for (GoodSiteDTO siteDTO:siteDTOList){
...@@ -139,10 +143,14 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -139,10 +143,14 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
site.setGoodId(goodId); site.setGoodId(goodId);
if(siteId==null||siteId==0){ if(siteId==null||siteId==0){
siteBiz.insertSelective(site); siteBiz.insertSelective(site);
siteId=site.getId();
}else { }else {
siteBiz.updateById(site); siteBiz.updateById(site);
siteIds.add(siteId); siteIds.add(siteId);
} }
if(site.getType()==0){
sites.add(siteId);
}
} }
if(siteIds.size()>0){ if(siteIds.size()>0){
siteBiz.delGoodSite(null,siteIds); siteBiz.delGoodSite(null,siteIds);
...@@ -170,6 +178,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -170,6 +178,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
tagBiz.delGoodTag(goodId,null); tagBiz.delGoodTag(goodId,null);
} }
List<GoodSpePriceDTO> priceDTOList=dto.getPriceDTOS(); List<GoodSpePriceDTO> priceDTOList=dto.getPriceDTOS();
List<Integer> prices=new ArrayList<>();
if(siteDTOList.size()>0){ if(siteDTOList.size()>0){
List<Integer> priceIds=new ArrayList<>(); List<Integer> priceIds=new ArrayList<>();
for (GoodSpePriceDTO priceDTO:priceDTOList){ for (GoodSpePriceDTO priceDTO:priceDTOList){
...@@ -204,15 +213,52 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -204,15 +213,52 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
} }
if(priceId==null||priceId==0){ if(priceId==null||priceId==0){
speBiz.insertSelective(spePrice); speBiz.insertSelective(spePrice);
priceId=spePrice.getId();
}else { }else {
speBiz.updateById(spePrice); speBiz.updateById(spePrice);
priceIds.add(priceId); priceIds.add(priceId);
} }
prices.add(priceId);
} }
if(priceIds.size()>0){ if(priceIds.size()>0){
speBiz.delGoodSpe(null,priceIds); speBiz.delGoodSpe(null,priceIds);
} }
} }
if(sites.size()>0){
List<Integer> vids=new ArrayList<>();
List<TourGoodVerification> verifications=new ArrayList<>();
for (Integer siteId:sites){
if(prices.size()>0){
for(Integer priceId:prices){
TourGoodVerification verification=new TourGoodVerification();
verification.setGoodId(goodId);
verification.setSiteId(siteId);
verification.setSpeId(priceId);
verification.setIsDel(0);
TourGoodVerification verification1=verificationBiz.selectOne(verification);
if(verification1==null){
verification.setTotalPerson(0);
verification.setVerificationPerson(0);
verification.setStatus(0);
verifications.add(verification);
}else {
vids.add(verification1.getId());
}
}
}
}
if(vids.size()>0){
verificationBiz.delGoodVerification(vids);
}
if(verifications.size()>0){
verificationBiz.addBathTourGoodVerification(verifications);
}
}
List<TourGoodVerification> verifications=new ArrayList<>();
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -4,6 +4,7 @@ import org.springframework.stereotype.Service; ...@@ -4,6 +4,7 @@ import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper; import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 旅游线路核销明细 * 旅游线路核销明细
...@@ -14,4 +15,17 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -14,4 +15,17 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,TourGoodVerification> { public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,TourGoodVerification> {
//删除线路核销
public void delGoodVerification(List<Integer> ids){ mapper.delVerification(ids);}
/**
* 批量插入核销
* @param tourGoodVerifications
*/
public void addBathTourGoodVerification(List<TourGoodVerification> tourGoodVerifications){
for (TourGoodVerification tourGoodVerification:tourGoodVerifications){
mapper.insertTourGoodVerification(tourGoodVerification);
}
}
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; ...@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.dto.TourTagBannerDTO; import com.xxfc.platform.tour.dto.TourTagBannerDTO;
import com.xxfc.platform.tour.mapper.TourTagBannerMapper; import com.xxfc.platform.tour.mapper.TourTagBannerMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -108,7 +109,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner> ...@@ -108,7 +109,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateTourBannerByBatch(List<TourTagBannerDTO> tourTagBannerDTOS,UserDTO userDTO) { 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()); 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); mapper.updateTourBannerStatusByTagannerIdsAndTagId(tourTagBannerIds,tourTagBannerDTOS.get(0).getTagId(),1);
}else {
if (CollectionUtils.isNotEmpty(tourTagBannerDTOS)){
mapper.updateTourTagBannerStatusByTagId(tourTagBannerDTOS.get(0).getTagId(),1,Instant.now().toEpochMilli());
}
}
tourTagBannerDTOS.stream().filter(tourTagBannerDTO -> Objects.isNull(tourTagBannerDTO.getId())).peek(tourTagBannerDTO -> { tourTagBannerDTOS.stream().filter(tourTagBannerDTO -> Objects.isNull(tourTagBannerDTO.getId())).peek(tourTagBannerDTO -> {
save(tourTagBannerDTO,userDTO); save(tourTagBannerDTO,userDTO);
}).count(); }).count();
......
...@@ -198,8 +198,8 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> { ...@@ -198,8 +198,8 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
* @param name * @param name
* @return * @return
*/ */
public boolean checkTagNameExist(String name) { public boolean checkTagNameExist(String name,Integer id) {
List<TourTag> tourTags = mapper.findByTagName(name); List<TourTag> tourTags = mapper.findByTagName(name,id);
return CollectionUtils.isNotEmpty(tourTags); return CollectionUtils.isNotEmpty(tourTags);
} }
......
...@@ -2,8 +2,12 @@ package com.xxfc.platform.tour.mapper; ...@@ -2,8 +2,12 @@ package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGoodVerification; import com.xxfc.platform.tour.entity.TourGoodVerification;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/** /**
* 旅游线路核销明细 * 旅游线路核销明细
* *
...@@ -13,4 +17,15 @@ import tk.mybatis.mapper.common.Mapper; ...@@ -13,4 +17,15 @@ import tk.mybatis.mapper.common.Mapper;
*/ */
public interface TourGoodVerificationMapper extends Mapper<TourGoodVerification> { public interface TourGoodVerificationMapper extends Mapper<TourGoodVerification> {
//删除线路核销
public int delVerification( @Param("list") List<Integer> ids);
/**
* 保存线路核销
* @param tourGoodVerification
* @return
*/
@Insert("insert into tour_good_verification(`spe_id`,`site_id`,`good_id`)values(#{speId} ,#{siteId} ,#{goodId}) where `spe_id`<>#{spId} and `site_id`<>#{siteId} and `good_id`<>#{goodId}")
int insertTourGoodVerification(TourGoodVerification tourGoodVerification);
} }
...@@ -17,9 +17,20 @@ import java.util.List; ...@@ -17,9 +17,20 @@ import java.util.List;
*/ */
@Repository @Repository
public interface TourTagMapper extends Mapper<TourTag> { 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") @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);
/**
* 根据删除状态查询标签
* @param tagBanner
* @return
*/
@Select("select * from tour_tag where is_del=#{isDel} order by rank ASC") @Select("select * from tour_tag where is_del=#{isDel} order by rank ASC")
@ResultMap(value = "tourTagMap") @ResultMap(value = "tourTagMap")
List<TourTag> findAllByIsDel(TourTag tagBanner); List<TourTag> findAllByIsDel(TourTag tagBanner);
...@@ -49,16 +60,37 @@ public interface TourTagMapper extends Mapper<TourTag> { ...@@ -49,16 +60,37 @@ public interface TourTagMapper extends Mapper<TourTag> {
@Update("update tour_tag set `is_del`=#{status} where `id`=#{id}") @Update("update tour_tag set `is_del`=#{status} where `id`=#{id}")
int updateTourTagStatusById(@Param("id") Integer id, @Param("status") int status); 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}" + @Update("update tour_tag set `name`=#{name},`img`=#{img},`describe`=#{describe},`link`=#{link}" +
",`rank`=#{rank},`upd_time`=#{updTime} where `id`=#{id}") ",`rank`=#{rank},`upd_time`=#{updTime} where `id`=#{id}")
int updateTourTag(TourTagDTO tourTagDTO); int updateTourTag(TourTagDTO tourTagDTO);
/**
* 更新标签热度
* @param id
* @param state
* @return
*/
@Update("update tour_tag set `is_hot`=#{state} where `id`=#{id}") @Update("update tour_tag set `is_hot`=#{state} where `id`=#{id}")
int updateTourTagHotSate(@Param("id") Integer id, @Param("state") Integer state); 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}") @Select("select `id`,`name` from tour_tag where `is_del`=#{status}")
List<TourTag> selectByStuatus(Integer status); List<TourTag> selectByStuatus(Integer status);
} }
...@@ -125,8 +125,8 @@ public class TourTagAdminController extends TourBaseController<TourTagBiz> { ...@@ -125,8 +125,8 @@ public class TourTagAdminController extends TourBaseController<TourTagBiz> {
*/ */
@GetMapping("/exist") @GetMapping("/exist")
@ApiOperation("校验标签名是否存在") @ApiOperation("校验标签名是否存在")
public ObjectRestResponse checkTagNameExists(@RequestParam("name") String name){ public ObjectRestResponse checkTagNameExists(@RequestParam("name") String name,@RequestParam(value = "id",required = false) Integer id){
boolean exist = getBaseBiz().checkTagNameExist(name); boolean exist = getBaseBiz().checkTagNameExist(name,id);
return ObjectRestResponse.succ(exist); return ObjectRestResponse.succ(exist);
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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="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="goodId" column="good_id"/>
<result property="departTime" column="depart_time"/>
<result property="totalPerson" column="total_person"/> <result property="totalPerson" column="total_person"/>
<result property="verificationPerson" column="verification_person"/> <result property="verificationPerson" column="verification_person"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="isDel" column="is_del"/> <result property="isDel" column="is_del"/>
</resultMap> </resultMap>
<update id="delVerification">
update tour_good_verification set is_del=1
where total_person=0 and verification_person=0
<if test="list!=null ">
and id not in (
<trim suffixOverrides=",">
<foreach collection="list" item="id">
#{id},
</foreach>
</trim>
)
</if>
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -23,4 +23,9 @@ ...@@ -23,4 +23,9 @@
values(#{name},#{img},#{describe},#{rank},#{ctrTime}) values(#{name},#{img},#{describe},#{rank},#{ctrTime})
</insert> </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> </mapper>
\ No newline at end of file
...@@ -9,7 +9,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -9,7 +9,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableAceAuthClient @EnableAceAuthClient
@EnableAceCache @EnableAceCache
......
...@@ -8,15 +8,16 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -8,15 +8,16 @@ 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;
@SpringBootApplication @SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableScheduling @EnableScheduling
@EnableAceAuthClient @EnableAceAuthClient
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.github.wxiaoqi.security.admin.feign","com.xxfc.platform.vehicle.feign"}) @EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.github.wxiaoqi.security.admin.feign","com.xxfc.platform.vehicle.feign"})
@EnableAceCache @EnableAceCache
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper") @tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper")
//@MapperScan("com.xxfc.platform.vehicle.mapper")
public class VehicleApplication { public class VehicleApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
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