|
|
@ -1,9 +1,16 @@ |
|
|
|
package com.yxt.anrui.buscenter.biz.busdiscountpackagehandover; |
|
|
|
|
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandover.BusDiscountpackageHandover; |
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandover.BusDiscountpackageHandoverDto; |
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandoverlist.BusDiscountpackageHandoverList; |
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandoverlist.BusDiscountpackageHandoverListDto; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdiscountpackagehandoverlist.BusDiscountpackageHandoverListService; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author Administrator |
|
|
|
* @description |
|
|
@ -12,15 +19,31 @@ import org.springframework.stereotype.Service; |
|
|
|
@Service |
|
|
|
public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDiscountpackageHandoverMapper, BusDiscountpackageHandover> { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BusDiscountpackageHandoverListService busDiscountpackageHandoverListService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
*/ |
|
|
|
public void saveOrUpdateDto(BusDiscountpackageHandoverDto dto) { |
|
|
|
String sid = dto.getSid(); |
|
|
|
BusDiscountpackageHandover entity = new BusDiscountpackageHandover(); |
|
|
|
entity.setSid(sid); |
|
|
|
String sid = entity.getSid(); |
|
|
|
dto.setSid(sid); |
|
|
|
dto.fillEntity(entity); |
|
|
|
this.saveOrUpdate(entity); |
|
|
|
List<BusDiscountpackageHandoverListDto> listDtos = dto.getBusDiscountpackageHandoverLists(); |
|
|
|
if (null != listDtos) { |
|
|
|
for (BusDiscountpackageHandoverListDto listDto : listDtos) { |
|
|
|
listDto.setMainSid(entity.getSid()); |
|
|
|
BusDiscountpackageHandoverList handoverList = new BusDiscountpackageHandoverList(); |
|
|
|
String listSid = handoverList.getSid(); |
|
|
|
listDto.setMainSid(sid); |
|
|
|
listDto.setSid(listSid); |
|
|
|
listDto.fillEntity(handoverList); |
|
|
|
busDiscountpackageHandoverListService.save(handoverList); |
|
|
|
} |
|
|
|
} |
|
|
|
this.save(entity); |
|
|
|
} |
|
|
|
} |
|
|
|