|
|
@ -33,7 +33,6 @@ import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
@ -69,31 +68,6 @@ public class BusDeliveredApplyDetailsService extends MybatisBaseService<BusDeliv |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public void saveOrUpdateDto(BusDeliveredApplyDetailsDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
this.insertByDto(dto); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.updateByDto(dto); |
|
|
|
} |
|
|
|
|
|
|
|
public void insertByDto(BusDeliveredApplyDetailsDto dto) { |
|
|
|
BusDeliveredApplyDetails entity = new BusDeliveredApplyDetails(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateByDto(BusDeliveredApplyDetailsDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
BusDeliveredApplyDetails entity = fetchBySid(dtoSid); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public BusDeliveredApplyDetailsDetailsVo fetchDetailsVoBySid(String sid) { |
|
|
|
BusDeliveredApplyDetails entity = fetchBySid(sid); |
|
|
|
BusDeliveredApplyDetailsDetailsVo vo = new BusDeliveredApplyDetailsDetailsVo(); |
|
|
@ -110,4 +84,23 @@ public class BusDeliveredApplyDetailsService extends MybatisBaseService<BusDeliv |
|
|
|
public List<BusDeliveredApplyDetailsVo> detailsList(String sid) { |
|
|
|
return baseMapper.detailsList(sid); |
|
|
|
} |
|
|
|
|
|
|
|
public void saveList(List<BusDeliveredApplyDetailsDto> dtoList, String sid) { |
|
|
|
for (int i = 0; i < dtoList.size(); i++) { |
|
|
|
BusDeliveredApplyDetails busDeliveredApplyDetails = new BusDeliveredApplyDetails(); |
|
|
|
BeanUtil.copyProperties(dtoList.get(i), busDeliveredApplyDetails, "sid"); |
|
|
|
busDeliveredApplyDetails.setApplySid(sid); |
|
|
|
save(busDeliveredApplyDetails); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据出库申请sid删除车辆关联的信息 |
|
|
|
* |
|
|
|
* @param dtoSid 出库申请sid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public int deleteByApplySid(String dtoSid) { |
|
|
|
return baseMapper.deleteByApplySid(dtoSid); |
|
|
|
} |
|
|
|
} |