old mode 100644
new mode 100755
| | |
| | | package com.java110.fee.bmo.feeReceipt.impl; |
| | | |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.feeReceipt.FeeReceiptDto; |
| | | import com.java110.dto.feeReceipt.FeeReceiptDtoNew; |
| | | import com.java110.dto.fee.FeeReceiptDto; |
| | | import com.java110.dto.fee.FeeReceiptDtoNew; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.fee.bmo.feeReceipt.IGetFeeReceiptBMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeReceiptInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Service("getFeeReceiptBMOImpl") |
| | | public class GetFeeReceiptBMOImpl implements IGetFeeReceiptBMO { |
| | |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param feeReceiptDto |
| | |
| | | int count = feeReceiptInnerServiceSMOImpl.queryFeeReceiptsCount(feeReceiptDto); |
| | | |
| | | List<FeeReceiptDto> feeReceiptDtos = null; |
| | | List<FeeReceiptDto> feeReceiptList = new ArrayList<>(); |
| | | if (count > 0) { |
| | | feeReceiptDtos = feeReceiptInnerServiceSMOImpl.queryFeeReceipts(feeReceiptDto); |
| | | for (FeeReceiptDto feeReceipt : feeReceiptDtos) { |
| | | feeReceipt.setStoreName(feeReceiptDto.getStoreName()); |
| | | feeReceiptList.add(feeReceipt); |
| | | //查询小区名称 |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(feeReceipt.getCommunityId()); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | if(!CollectionUtils.isEmpty(communityDtos)){ |
| | | feeReceipt.setCommunityName(communityDtos.get(0).getName()); |
| | | } |
| | | feeReceipt.setOfficialSeal(""); |
| | | feeReceiptDto.setFinancialAccountant(""); |
| | | feeReceiptDto.setFinancialCashier(""); |
| | | } |
| | | //输入房屋信息 |
| | | freshRoomInfo(feeReceiptDtos); |
| | | } else { |
| | | feeReceiptDtos = new ArrayList<>(); |
| | | feeReceiptList.addAll(feeReceiptDtos); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) feeReceiptDto.getRow()), count, feeReceiptList); |
| | | |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) feeReceiptDto.getRow()), count, feeReceiptDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷入房屋信息 |
| | |
| | | |
| | | for (FeeReceiptDto feeReceiptDto : feeReceiptDtos) { |
| | | if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeReceiptDto.getObjType())) { |
| | | feeReceiptDto.setRoomName(feeReceiptDto.getObjName()); |
| | | feeReceiptDto.setCarNum("-"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | * @param feeReceiptDto |
| | | */ |
| | | private void doFreshRoomInfo(FeeReceiptDto feeReceiptDto) { |
| | | feeReceiptDto.setCarNum(feeReceiptDto.getObjName()); |
| | | OwnerCarDto ownerCarDto = new OwnerCarDto(); |
| | | ownerCarDto.setCarId(feeReceiptDto.getObjId()); |
| | | ownerCarDto.setCommunityId(feeReceiptDto.getCommunityId()); |
| | | List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | |
| | | if (ownerCarDtos == null || ownerCarDtos.size() < 1) { |
| | | feeReceiptDto.setRoomName("-"); |
| | | return; |
| | | } |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | |
| | | |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) { |
| | | feeReceiptDto.setRoomName("-"); |
| | | return; |
| | | } |
| | | |
| | |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | String roomName = ""; |
| | | for (RoomDto tRoomDto : roomDtos) { |
| | | roomName += (tRoomDto.getFloorNum() + "栋" + tRoomDto.getUnitNum() + "单元" + roomDto.getRoomNum() + "室" + "/"); |
| | | roomName += (tRoomDto.getFloorNum() + "栋" + tRoomDto.getUnitNum() + "单元" + tRoomDto.getRoomNum() + "室" + "/"); |
| | | } |
| | | |
| | | roomName = roomName.endsWith("/") ? roomName.substring(0, roomName.length() - 1) : roomName; |
| | | feeReceiptDto.setCarNum(feeReceiptDto.getObjName()); |
| | | feeReceiptDto.setObjName(roomName); |
| | | feeReceiptDto.setRoomName(roomName); |
| | | } |
| | | |
| | | |