| | |
| | | package com.java110.user.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerCarAttrDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.entity.assetImport.ImportCustomCreateFeeDto; |
| | | import com.java110.entity.assetImport.ImportRoomFee; |
| | | import com.java110.dto.importData.ImportCustomCreateFeeDto; |
| | | import com.java110.dto.importData.ImportRoomFee; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.user.dao.IOwnerCarAttrServiceDao; |
| | | import com.java110.user.dao.IOwnerCarServiceDao; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | private IOwnerCarServiceDao ownerCarServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerCarAttrServiceDao ownerCarAttrServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | |
| | | |
| | | List<OwnerCarDto> ownerCars = BeanConvertUtil.covertBeanList(ownerCarServiceDaoImpl.getOwnerCarInfo(BeanConvertUtil.beanCovertMap(ownerCarDto)), OwnerCarDto.class); |
| | | |
| | | if (ownerCars != null && ownerCars.size() > 0) { |
| | | String[] carIds = getCarIds(ownerCars); |
| | | Map attrParamInfo = new HashMap(); |
| | | attrParamInfo.put("carIds", carIds); |
| | | attrParamInfo.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<OwnerCarAttrDto> ownerCarAttrDtos = BeanConvertUtil.covertBeanList(ownerCarAttrServiceDaoImpl.getOwnerCarAttrInfo(attrParamInfo), OwnerCarAttrDto.class); |
| | | for (OwnerCarDto ownerCarDto1 : ownerCars) { |
| | | refreshOwnerCars(ownerCarDto1, ownerCarAttrDtos); |
| | | } |
| | | } |
| | | return ownerCars; |
| | | } |
| | | |
| | | /** |
| | | * 获取carId 信息 |
| | | * |
| | | * @param ownerCars 房屋信息 |
| | | * @return carId |
| | | */ |
| | | private String[] getCarIds(List<OwnerCarDto> ownerCars) { |
| | | List<String> carIds = new ArrayList<String>(); |
| | | for (OwnerCarDto ownerCarDto : ownerCars) { |
| | | carIds.add(ownerCarDto.getCarId()); |
| | | } |
| | | |
| | | return carIds.toArray(new String[carIds.size()]); |
| | | } |
| | | |
| | | /** |
| | | * @param ownerCarDto |
| | | * @param ownerCarAttrDtoList |
| | | */ |
| | | private void refreshOwnerCars(OwnerCarDto ownerCarDto, List<OwnerCarAttrDto> ownerCarAttrDtoList) { |
| | | |
| | | if (ownerCarAttrDtoList == null || ownerCarAttrDtoList.size() == 0) { |
| | | return; |
| | | } |
| | | List<OwnerCarAttrDto> tmpOwnerCarAttrDtos = new ArrayList<>(); |
| | | for (OwnerCarAttrDto ownerCarAttrDto : ownerCarAttrDtoList) { |
| | | if (!ownerCarAttrDto.getCarId().equals(ownerCarDto.getCarId())) { |
| | | continue; |
| | | } |
| | | if (StringUtil.isEmpty(ownerCarAttrDto.getValueName())) { |
| | | ownerCarAttrDto.setValueName(ownerCarAttrDto.getValue()); |
| | | } |
| | | tmpOwnerCarAttrDtos.add(ownerCarAttrDto); |
| | | } |
| | | ownerCarDto.setOwnerCarAttrDto(tmpOwnerCarAttrDtos); |
| | | } |
| | | |
| | | /** |
| | |
| | | carNums.add(importRoomFee.getCarNum()); |
| | | } |
| | | |
| | | if (carNums.size() < 1) { |
| | | if (ListUtil.isNull(carNums)) { |
| | | return tmpImportCarFees; |
| | | } |
| | | Map<String, Object> info = new HashMap<>(); |
| | |
| | | return tmpImportCarFees; |
| | | } |
| | | |
| | | public List<ImportCustomCreateFeeDto> freshCarIdsByImportCustomCreateFee(@RequestBody List<ImportCustomCreateFeeDto> tmpImportCarFees){ |
| | | public List<ImportCustomCreateFeeDto> freshCarIdsByImportCustomCreateFee(@RequestBody List<ImportCustomCreateFeeDto> tmpImportCarFees) { |
| | | List<String> carNums = new ArrayList<>(); |
| | | for (ImportCustomCreateFeeDto importRoomFee : tmpImportCarFees) { |
| | | if (StringUtil.isEmpty(importRoomFee.getCarNum())) { |