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;
import com.ace.cache.EnableAceCache;
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.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
......
......@@ -10,7 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
},exclude = DataSourceAutoConfiguration.class)
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
......
......@@ -10,7 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
......
......@@ -19,28 +19,35 @@ import lombok.Data;
public class TourGoodSite implements Serializable {
private static final long serialVersionUID = 1L;
//
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("")
@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;
//分公司id
/**
* 分公司id
*/
@Column(name = "company_id")
@ApiModelProperty(value = "分公司id")
private String companyId;
......@@ -73,54 +80,72 @@ public class TourGoodSite implements Serializable {
@ApiModelProperty("地址-市(名称)")
private Integer cityName;
//出发时间
/**
* 出发时间
*/
@Column(name = "depart_time")
@ApiModelProperty(value = "出发时间")
private Long departTime;
//站点经度
/**
* 站点经度
*/
@Column(name = "longitude")
@ApiModelProperty(value = "站点经度")
private Double longitude;
//站点纬度
/**
* 站点纬度
*/
@Column(name = "latitude")
@ApiModelProperty(value = "站点纬度")
private Double latitude;
//类型:0起点,1-途径点;2-终点
/**
* 类型:0起点,1-途径点;2-终点
*/
@Column(name = "type")
@ApiModelProperty(value = "类型:0起点,1-途径点;2-终点")
private Integer type;
//排序
/**
* 排序
*/
@Column(name = "rank")
@ApiModelProperty(value = "排序")
private Integer rank;
//状态 0正常 1关闭
/**
* 状态 0正常 1关闭
*/
@Column(name = "status")
@ApiModelProperty(value = "状态 0正常 1关闭")
private Integer status;
//创建时间
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间")
private Long crtTime;
//更新时间
/**
* 更新时间
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
//站点介绍
/**
* 站点介绍
*/
@Column(name = "intro")
@ApiModelProperty(value = "站点介绍")
private String intro;
//是否删除;0-正常;1-删除
/**
* 是否删除;0-正常;1-删除
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除;0-正常;1-删除")
private Integer isDel;
......
......@@ -19,38 +19,48 @@ import lombok.Data;
public class TourGoodSpe 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 = "title")
@ApiModelProperty(value = "规格名")
private String title;
//父id
/**
* 父id
*/
@Column(name = "parent_id")
@ApiModelProperty(value = "父id")
private Integer parentId;
//创建时间
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
//更新时间
/**
* 更新时间
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
//是否删除:0-正常;1-删除
/**
* 是否删除:0-正常;1-删除
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel;
......
......@@ -20,66 +20,85 @@ import lombok.Data;
public class TourGoodSpePrice 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 = "start_time")
@ApiModelProperty(value = "出行时间")
private Date startTime;
//结束时间
/**
* 结束时间
*/
@Column(name = "end_time")
@ApiModelProperty(value = "结束时间")
private Date endTime;
//规格id
/**
* 规格id
*/
@Column(name = "spe_id")
@ApiModelProperty(value = "规格id")
private String speId;
//价格
/**
* 价格
*/
@Column(name = "price")
@ApiModelProperty(value = "价格")
private BigDecimal price;
//儿童价格
/**
* 儿童价格
*/
@Column(name = "child_price")
@ApiModelProperty(value = "儿童价格")
private BigDecimal childPrice;
//会员价格
/**
* 会员价格
*/
@Column(name = "member_price")
@ApiModelProperty(value = "会员价格")
private String memberPrice;
//库存
/**
* 库存
*/
@Column(name = "stock")
@ApiModelProperty(value = "库存")
private Integer stock;
//创建时间
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
//更新时间
/**
* 更新时间
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
//是否删除:0-正常;1-删除
/**
* 是否删除:0-正常;1-删除
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel;
}
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,7 +44,7 @@ public class TourGoodVerification implements Serializable {
private Integer goodId;
/**
* 旅游路线id
* 出发路线id
*/
@Column(name = "site_id")
@ApiModelProperty(value = "出发路线id")
......@@ -77,5 +79,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) {
......
......@@ -46,6 +46,8 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
private TourGoodTagBiz tagBiz;
@Autowired
private TourGoodSpeBiz speBiz;
@Autowired
private TourGoodVerificationBiz verificationBiz;
@Autowired
private UserFeign userFeign;
......@@ -107,6 +109,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
mapper.updateByPrimaryKeySelective(good);
}
if(goodId>0){
List<GoodBannerDTO> bannerList=dto.getBannerDTOS();
if(bannerList.size()>0){
List<Integer> bannerIds=new ArrayList<>();
......@@ -130,6 +133,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
bannerBiz.delGoodBanner(goodId,null);
}
List<GoodSiteDTO> siteDTOList=dto.getSiteDTOS();
List<Integer> sites=new ArrayList<>();
if(siteDTOList.size()>0){
List<Integer> siteIds=new ArrayList<>();
for (GoodSiteDTO siteDTO:siteDTOList){
......@@ -139,10 +143,14 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
site.setGoodId(goodId);
if(siteId==null||siteId==0){
siteBiz.insertSelective(site);
siteId=site.getId();
}else {
siteBiz.updateById(site);
siteIds.add(siteId);
}
if(site.getType()==0){
sites.add(siteId);
}
}
if(siteIds.size()>0){
siteBiz.delGoodSite(null,siteIds);
......@@ -170,6 +178,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
tagBiz.delGoodTag(goodId,null);
}
List<GoodSpePriceDTO> priceDTOList=dto.getPriceDTOS();
List<Integer> prices=new ArrayList<>();
if(siteDTOList.size()>0){
List<Integer> priceIds=new ArrayList<>();
for (GoodSpePriceDTO priceDTO:priceDTOList){
......@@ -204,15 +213,52 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
}
if(priceId==null||priceId==0){
speBiz.insertSelective(spePrice);
priceId=spePrice.getId();
}else {
speBiz.updateById(spePrice);
priceIds.add(priceId);
}
prices.add(priceId);
}
if(priceIds.size()>0){
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) {
e.printStackTrace();
......
......@@ -4,6 +4,7 @@ import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodVerification;
import com.xxfc.platform.tour.mapper.TourGoodVerificationMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/**
* 旅游线路核销明细
......@@ -14,4 +15,17 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/
@Service
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;
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,13 @@ 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 {
if (CollectionUtils.isNotEmpty(tourTagBannerDTOS)){
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);
}
......
......@@ -2,8 +2,12 @@ package com.xxfc.platform.tour.mapper;
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 java.util.List;
/**
* 旅游线路核销明细
*
......@@ -13,4 +17,15 @@ import tk.mybatis.mapper.common.Mapper;
*/
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;
*/
@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"/>
<result property="verificationPerson" column="verification_person"/>
<result property="status" column="status"/>
<result property="isDel" column="is_del"/>
</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>
\ No newline at end of file
......@@ -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
......@@ -9,7 +9,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.*"
})
@EnableDiscoveryClient
@EnableAceAuthClient
@EnableAceCache
......
......@@ -8,15 +8,16 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@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.vehicle.feign"})
@EnableAceCache
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.vehicle.mapper")
//@MapperScan("com.xxfc.platform.vehicle.mapper")
public class VehicleApplication {
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