Commit c3de5602 authored by libin's avatar libin

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 61b9e60c 805ab780
...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service; ...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodBanner; import com.xxfc.platform.tour.entity.TourGoodBanner;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 商品轮播图 * 商品轮播图
* *
...@@ -15,4 +17,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,4 +17,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourGoodBannerBiz extends BaseBiz<TourGoodBannerMapper,TourGoodBanner> { public class TourGoodBannerBiz extends BaseBiz<TourGoodBannerMapper,TourGoodBanner> {
//删除轮播
public void delGoodBanner(Integer goodId, List<Integer> ids){ mapper.delBanner(goodId,ids); }
} }
\ No newline at end of file
...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -108,6 +109,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -108,6 +109,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
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<>();
for (GoodBannerDTO bannerDTO:bannerList){ for (GoodBannerDTO bannerDTO:bannerList){
Integer bannerId=bannerDTO.getId(); Integer bannerId=bannerDTO.getId();
TourGoodBanner goodBanner=new TourGoodBanner(); TourGoodBanner goodBanner=new TourGoodBanner();
...@@ -117,11 +119,19 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -117,11 +119,19 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
bannerBiz.insertSelective(goodBanner); bannerBiz.insertSelective(goodBanner);
}else { }else {
bannerBiz.updateSelectiveById(goodBanner); bannerBiz.updateSelectiveById(goodBanner);
bannerIds.add(bannerId);
} }
} }
if(bannerIds.size()>0){
bannerBiz.delGoodBanner(null,bannerIds);
}
}else{
bannerBiz.delGoodBanner(goodId,null);
} }
List<GoodSiteDTO> siteDTOList=dto.getSiteDTOS(); List<GoodSiteDTO> siteDTOList=dto.getSiteDTOS();
if(siteDTOList.size()>0){ if(siteDTOList.size()>0){
List<Integer> siteIds=new ArrayList<>();
for (GoodSiteDTO siteDTO:siteDTOList){ for (GoodSiteDTO siteDTO:siteDTOList){
Integer siteId=siteDTO.getId(); Integer siteId=siteDTO.getId();
TourGoodSite site=new TourGoodSite(); TourGoodSite site=new TourGoodSite();
...@@ -131,12 +141,16 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -131,12 +141,16 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
siteBiz.insertSelective(site); siteBiz.insertSelective(site);
}else { }else {
siteBiz.updateById(site); siteBiz.updateById(site);
siteIds.add(siteId);
} }
} }
if(siteIds.size()>0){
siteBiz.delGoodSite(null,siteIds);
}
} }
List<GoodTagDTO> tagList=dto.getTagDTOS(); List<GoodTagDTO> tagList=dto.getTagDTOS();
if(siteDTOList.size()>0){ if(siteDTOList.size()>0){
List<Integer> tagIds=new ArrayList<>();
for (GoodTagDTO tagDTO:tagList){ for (GoodTagDTO tagDTO:tagList){
Integer tagId=tagDTO.getId(); Integer tagId=tagDTO.getId();
TourGoodTag tag=new TourGoodTag(); TourGoodTag tag=new TourGoodTag();
...@@ -146,11 +160,18 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -146,11 +160,18 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
tagBiz.insertSelective(tag); tagBiz.insertSelective(tag);
}else { }else {
tagBiz.updateById(tag); tagBiz.updateById(tag);
tagIds.add(tagId);
} }
} }
if(tagIds.size()>0){
tagBiz.delGoodTag(null,tagIds);
}
}else{
tagBiz.delGoodTag(goodId,null);
} }
List<GoodSpePriceDTO> priceDTOList=dto.getPriceDTOS(); List<GoodSpePriceDTO> priceDTOList=dto.getPriceDTOS();
if(siteDTOList.size()>0){ if(siteDTOList.size()>0){
List<Integer> priceIds=new ArrayList<>();
for (GoodSpePriceDTO priceDTO:priceDTOList){ for (GoodSpePriceDTO priceDTO:priceDTOList){
Integer priceId=priceDTO.getId(); Integer priceId=priceDTO.getId();
TourGoodSpePrice spePrice=new TourGoodSpePrice(); TourGoodSpePrice spePrice=new TourGoodSpePrice();
...@@ -185,8 +206,12 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -185,8 +206,12 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
speBiz.insertSelective(spePrice); speBiz.insertSelective(spePrice);
}else { }else {
speBiz.updateById(spePrice); speBiz.updateById(spePrice);
priceIds.add(priceId);
} }
} }
if(priceIds.size()>0){
speBiz.delGoodSpe(null,priceIds);
}
} }
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
......
...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service; ...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodSite; import com.xxfc.platform.tour.entity.TourGoodSite;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 路线站点表 * 路线站点表
* *
...@@ -15,4 +17,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,4 +17,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/ */
@Service @Service
public class TourGoodSiteBiz extends BaseBiz<TourGoodSiteMapper,TourGoodSite> { public class TourGoodSiteBiz extends BaseBiz<TourGoodSiteMapper,TourGoodSite> {
//删除站点
public void delGoodSite(Integer goodId, List<Integer> ids){ mapper.delSite(goodId,ids);}
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -15,6 +15,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.List;
/** /**
* 旅游商品规格表 * 旅游商品规格表
...@@ -92,5 +93,8 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP ...@@ -92,5 +93,8 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP
} }
} }
//删除
public void delGoodSpe(Integer goodId, List<Integer> ids){ mapper.delSpe(goodId,ids);}
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service; ...@@ -6,6 +6,8 @@ import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodTag; import com.xxfc.platform.tour.entity.TourGoodTag;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List;
/** /**
* 商品标签表 * 商品标签表
* *
...@@ -16,4 +18,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -16,4 +18,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
@Service @Service
public class TourGoodTagBiz extends BaseBiz<TourGoodTagMapper,TourGoodTag> { public class TourGoodTagBiz extends BaseBiz<TourGoodTagMapper,TourGoodTag> {
//删除标签
public void delGoodTag(Integer goodId, List<Integer> ids){ mapper.delTag(goodId,ids);}
} }
\ No newline at end of file
...@@ -17,5 +17,8 @@ import java.util.List; ...@@ -17,5 +17,8 @@ import java.util.List;
public interface TourGoodBannerMapper extends Mapper<TourGoodBanner> { public interface TourGoodBannerMapper extends Mapper<TourGoodBanner> {
//查询旅游路线列表 //查询旅游路线列表
public List<GoodBannerDTO> getBannerList(@Param("goodId")Integer goodId); public List<GoodBannerDTO> getBannerList(@Param("goodId")Integer goodId);
//删除Banner
public int delBanner(@Param("goodId")Integer goodId,@Param("list")List<Integer> ids);
} }
...@@ -19,4 +19,7 @@ public interface TourGoodSiteMapper extends Mapper<TourGoodSite> { ...@@ -19,4 +19,7 @@ public interface TourGoodSiteMapper extends Mapper<TourGoodSite> {
public List<TourDepartVo> getlistByGoodId(@Param("goodId") Integer goodId); public List<TourDepartVo> getlistByGoodId(@Param("goodId") Integer goodId);
//删除站点
public int delSite(@Param("goodId")Integer goodId,@Param("list")List<Integer> ids);
} }
...@@ -21,6 +21,9 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> { ...@@ -21,6 +21,9 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
//减库存 //减库存
int updStockById(@Param("id") Integer id,@Param("number") Integer number); int updStockById(@Param("id") Integer id,@Param("number") Integer number);
//删除站点
public int delSpe(@Param("goodId")Integer goodId,@Param("list")List<Integer> ids);
} }
...@@ -20,6 +20,9 @@ public interface TourGoodTagMapper extends Mapper<TourGoodTag> { ...@@ -20,6 +20,9 @@ public interface TourGoodTagMapper extends Mapper<TourGoodTag> {
//查询旅游标签 //查询旅游标签
public List<GoodTagDTO> getGoodTagList(@Param("goodId") Integer goodId); public List<GoodTagDTO> getGoodTagList(@Param("goodId") Integer goodId);
//删除站点
public int delTag(@Param("goodId")Integer goodId,@Param("list")List<Integer> ids);
} }
...@@ -20,4 +20,22 @@ ...@@ -20,4 +20,22 @@
select * FROM tour_good_banner where good_id=#{goodId} and is_del=0 select * FROM tour_good_banner where good_id=#{goodId} and is_del=0
</select> </select>
<update id="delBanner">
update tour_good_banner set is_del=1
where 1=1
<if test="goodId !=null and goodId >0 ">
and good_id=#{goodId}
</if>
<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
...@@ -42,6 +42,22 @@ ...@@ -42,6 +42,22 @@
SELECT * FROM tour_good_site SELECT * FROM tour_good_site
WHERE good_id=#{goodId} and is_del=0 WHERE good_id=#{goodId} and is_del=0
</select> </select>
<update id="delSite">
update tour_good_site set is_del=1
where 1=1
<if test="goodId !=null and goodId >0 ">
and good_id=#{goodId}
</if>
<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
...@@ -46,6 +46,24 @@ ...@@ -46,6 +46,24 @@
update tour_good_spe_price set stock=stock-#{number} where id=#{id} update tour_good_spe_price set stock=stock-#{number} where id=#{id}
</update> </update>
<update id="delSpe">
update tour_good_spe_price set is_del=1
where 1=1
<if test="goodId !=null and goodId >0 ">
and good_id=#{goodId}
</if>
<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
...@@ -26,4 +26,22 @@ ...@@ -26,4 +26,22 @@
WHERE g.id=#{goodId} and tag.is_del=0 WHERE g.id=#{goodId} and tag.is_del=0
</select> </select>
<update id="delTag">
update tour_good_tag set is_del=1
where 1=1
<if test="goodId !=null and goodId >0 ">
and good_id=#{goodId}
</if>
<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
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