Commit be859071 authored by hezhen's avatar hezhen

添加删除

parent c3de5602
......@@ -107,6 +107,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 +131,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){
......@@ -143,6 +145,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
siteBiz.updateById(site);
siteIds.add(siteId);
}
if(site.getType()==0){
sites.add(siteId);
}
}
if(siteIds.size()>0){
siteBiz.delGoodSite(null,siteIds);
......@@ -170,6 +175,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){
......@@ -206,13 +212,17 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
speBiz.insertSelective(spePrice);
}else {
speBiz.updateById(spePrice);
priceId=spePrice.getId();
priceIds.add(priceId);
}
prices.add(priceId);
}
if(priceIds.size()>0){
speBiz.delGoodSpe(null,priceIds);
}
}
List<TourGoodVerification> verifications=new ArrayList<>();
}
} catch (IllegalAccessException e) {
e.printStackTrace();
......
......@@ -5,6 +5,8 @@ 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 +16,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/
@Service
public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,TourGoodVerification> {
//删除线路核销
public void delGoodVerification(Integer goodId, List<Integer> ids){ mapper.delVerification(ids);}
}
\ No newline at end of file
......@@ -2,8 +2,11 @@ package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGoodVerification;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 旅游线路核销明细
*
......@@ -12,5 +15,8 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-06-14 09:36:50
*/
public interface TourGoodVerificationMapper extends Mapper<TourGoodVerification> {
//删除线路核销
public int delVerification( @Param("list") List<Integer> ids);
}
......@@ -9,11 +9,24 @@
<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
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