| | |
| | | t.start_time startTime, |
| | | t.end_time endTime, |
| | | t.create_time createTime, |
| | | t.room_id roomId |
| | | t.room_id roomId, |
| | | t.status_cd statusCd |
| | | FROM |
| | | building_owner_room_rel t |
| | | INNER JOIN building_owner bo ON t.owner_id = bo.owner_id AND bo.status_cd = '0' AND bo.community_id = |
| | | #{communityId} |
| | | INNER JOIN building_owner bo ON t.owner_id = bo.owner_id AND bo.status_cd = '0' |
| | | WHERE |
| | | bo.owner_type_cd = '1001' |
| | | AND t.room_id = #{roomId} |
| | |
| | | select COUNT(1) count |
| | | from building_owner_room_rel t |
| | | inner join building_owner bo |
| | | on t.owner_id = bo.owner_id and bo.status_cd = '0' and bo.community_id = #{communityId} |
| | | on t.owner_id = bo.owner_id and bo.status_cd = '0' |
| | | where bo.owner_type_cd = '1001' |
| | | and t.room_id = #{roomId} |
| | | </select> |
| New file |
| | |
| | | package com.java110.community.cmd.ownerRepair; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import com.java110.vo.api.junkRequirement.PhotoVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "ownerRepair.listAdminOwnerRepairs") |
| | | public class ListAdminOwnerRepairsCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class); |
| | | //todo 处理时间 |
| | | ifHasTime(ownerRepairDto); |
| | | if (!StringUtil.isEmpty(ownerRepairDto.getRoomId()) && ownerRepairDto.getRoomId().contains(",")) { |
| | | String[] roomIds = ownerRepairDto.getRoomId().split(","); |
| | | ownerRepairDto.setRoomIds(roomIds); |
| | | ownerRepairDto.setRoomId(""); |
| | | } |
| | | |
| | | int count = repairInnerServiceSMOImpl.queryRepairsCount(ownerRepairDto); |
| | | List<RepairDto> ownerRepairs = new ArrayList<>(); |
| | | if (count > 0) { |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(ownerRepairDto); |
| | | for (RepairDto repairDto : repairDtos) { |
| | | //获取综合评价得分 |
| | | String appraiseScoreNumber = repairDto.getAppraiseScore(); |
| | | Double appraiseScoreNum = 0.0; |
| | | if (!StringUtil.isEmpty(appraiseScoreNumber)) { |
| | | appraiseScoreNum = Double.parseDouble(appraiseScoreNumber); |
| | | } |
| | | int appraiseScore = (int) Math.ceil(appraiseScoreNum); |
| | | //获取上门速度评分 |
| | | String doorSpeedScoreNumber = repairDto.getDoorSpeedScore(); |
| | | Double doorSpeedScoreNum = 0.0; |
| | | if (!StringUtil.isEmpty(doorSpeedScoreNumber)) { |
| | | doorSpeedScoreNum = Double.parseDouble(doorSpeedScoreNumber); |
| | | } |
| | | int doorSpeedScore = (int) Math.ceil(doorSpeedScoreNum); |
| | | //获取维修员服务评分 |
| | | String repairmanServiceScoreNumber = repairDto.getRepairmanServiceScore(); |
| | | Double repairmanServiceScoreNum = 0.0; |
| | | if (!StringUtil.isEmpty(repairmanServiceScoreNumber)) { |
| | | repairmanServiceScoreNum = Double.parseDouble(repairmanServiceScoreNumber); |
| | | } |
| | | int repairmanServiceScore = (int) Math.ceil(repairmanServiceScoreNum); |
| | | //取得平均分 |
| | | double averageNumber = (appraiseScoreNum + doorSpeedScoreNum + repairmanServiceScoreNum) / 3.0; |
| | | BigDecimal averageNum = new BigDecimal(averageNumber); |
| | | Double average = averageNum.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | repairDto.setAppraiseScore(String.valueOf(appraiseScore)); |
| | | repairDto.setDoorSpeedScore(String.valueOf(doorSpeedScore)); |
| | | repairDto.setRepairmanServiceScore(String.valueOf(repairmanServiceScore)); |
| | | repairDto.setAverage(String.valueOf(average)); |
| | | ownerRepairs.add(repairDto); |
| | | } |
| | | refreshRepair(ownerRepairs); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | private void ifHasTime(RepairDto ownerRepairDto) { |
| | | |
| | | if (StringUtil.isEmpty(ownerRepairDto.getEndTime())) { |
| | | return; |
| | | } |
| | | |
| | | String endTime = ownerRepairDto.getEndTime(); |
| | | if (endTime.contains(":")) { |
| | | return; |
| | | } |
| | | |
| | | endTime += " 23:59:59"; |
| | | ownerRepairDto.setEndTime(endTime); |
| | | } |
| | | |
| | | private void refreshRepair(List<RepairDto> ownerRepairs) { |
| | | List<String> repairIds = new ArrayList<>(); |
| | | for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | repairIds.add(apiOwnerRepairDataVo.getRepairId()); |
| | | } |
| | | if (ListUtil.isNull(repairIds)) { |
| | | return; |
| | | } |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairIds(repairIds.toArray(new String[repairIds.size()])); |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | for (RepairUserDto tmpRepairUserDto : repairUserDtos) { |
| | | for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | if (tmpRepairUserDto.getRepairId().equals(apiOwnerRepairDataVo.getRepairId())) { |
| | | apiOwnerRepairDataVo.setStaffId(tmpRepairUserDto.getUserId()); |
| | | //apiOwnerRepairDataVo.setStatmpRepairUserDto.getUserName()); |
| | | } |
| | | } |
| | | } |
| | | //刷入图片信息 |
| | | List<PhotoVo> photoVos = null; |
| | | List<PhotoVo> repairPhotos = null; //业主上传维修图片 |
| | | List<PhotoVo> beforePhotos = null; //维修前图片 |
| | | List<PhotoVo> afterPhotos = null; //维修后图片 |
| | | PhotoVo photoVo = null; |
| | | String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH"); |
| | | for (RepairDto repairDto : ownerRepairs) { |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(repairDto.getRepairId()); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | photoVos = new ArrayList<>(); |
| | | repairPhotos = new ArrayList<>(); |
| | | beforePhotos = new ArrayList<>(); |
| | | afterPhotos = new ArrayList<>(); |
| | | for (FileRelDto tmpFileRelDto : fileRelDtos) { |
| | | photoVo = new PhotoVo(); |
| | | photoVo.setUrl(tmpFileRelDto.getFileRealName()); |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | photoVos.add(photoVo); |
| | | if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.REL_TYPE_CD_REPAIR)) { //维修图片 |
| | | photoVo = new PhotoVo(); |
| | | if (!tmpFileRelDto.getFileRealName().startsWith("http")) { |
| | | photoVo.setUrl(imgUrl + tmpFileRelDto.getFileRealName()); |
| | | } else { |
| | | photoVo.setUrl(tmpFileRelDto.getFileRealName()); |
| | | } |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | repairPhotos.add(photoVo); //维修图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.BEFORE_REPAIR_PHOTOS)) { //维修前图片 |
| | | photoVo = new PhotoVo(); |
| | | if (!tmpFileRelDto.getFileRealName().startsWith("http")) { |
| | | photoVo.setUrl(imgUrl + tmpFileRelDto.getFileRealName()); |
| | | } else { |
| | | photoVo.setUrl(tmpFileRelDto.getFileRealName()); |
| | | } |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | beforePhotos.add(photoVo); //维修前图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.AFTER_REPAIR_PHOTOS)) { //维修后图片 |
| | | photoVo = new PhotoVo(); |
| | | if (!tmpFileRelDto.getFileRealName().startsWith("http")) { |
| | | photoVo.setUrl(imgUrl + tmpFileRelDto.getFileRealName()); |
| | | } else { |
| | | photoVo.setUrl(tmpFileRelDto.getFileRealName()); |
| | | } |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | afterPhotos.add(photoVo); |
| | | } |
| | | } |
| | | repairDto.setPhotos(photoVos); |
| | | repairDto.setRepairPhotos(repairPhotos); |
| | | repairDto.setBeforePhotos(beforePhotos); |
| | | repairDto.setAfterPhotos(afterPhotos); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.cmd.room; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.bmo.room.IQueryRoomStatisticsBMO; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.intf.community.IFloorInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.api.ApiRoomDataVo; |
| | | import com.java110.vo.api.ApiRoomVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "room.queryAdminOwnerRooms") |
| | | public class QueryAdminOwnerRoomsCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IFloorInnerServiceSMO floorInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IQueryRoomStatisticsBMO queryRoomStatisticsBMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validateAdmin(context); |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson,"ownerId","未包含业主编号"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | |
| | | RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class); |
| | | hasRoomNum(reqJson, roomDto); |
| | | |
| | | ApiRoomVo apiRoomVo = new ApiRoomVo(); |
| | | List<RoomDto> roomDtoList = roomInnerServiceSMOImpl.queryRoomsByOwner(roomDto); |
| | | roomDtoList = queryRoomStatisticsBMOImpl.queryRoomOweFee(roomDtoList); |
| | | |
| | | apiRoomVo.setTotal(roomDtoList.size()); |
| | | apiRoomVo.setRooms(BeanConvertUtil.covertBeanList(roomDtoList, ApiRoomDataVo.class)); |
| | | apiRoomVo.setRecords(1); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiRoomVo), HttpStatus.OK); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 判断是否存在房屋编号 |
| | | * @param reqJson |
| | | * @param roomDto |
| | | */ |
| | | private void hasRoomNum(JSONObject reqJson, RoomDto roomDto) { |
| | | if (!reqJson.containsKey("roomNum")) { |
| | | return; |
| | | } |
| | | String roomNum = reqJson.getString("roomNum"); |
| | | if (StringUtil.isEmpty(roomNum)) { |
| | | return; |
| | | } |
| | | String[] roomNums = reqJson.getString("roomNum").split("-"); |
| | | |
| | | if (roomNums != null && roomNums.length == 3) { |
| | | roomDto.setFloorNum(roomNums[0]); |
| | | roomDto.setUnitNum(roomNums[1]); |
| | | roomDto.setRoomNum(roomNums[2]); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.cmd.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.CommunitySettingFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.*; |
| | | import com.java110.vo.api.fee.ApiFeeDataVo; |
| | | import com.java110.vo.api.fee.ApiFeeVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Java110Cmd(serviceCode = "fee.listAdminFee") |
| | | public class ListAdminFeeCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ListAdminFeeCmd.class); |
| | | |
| | | @Autowired |
| | | private IFeeInnerServiceSMO feeInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IComputeFeeSMO computeFeeSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | FeeDto feeDto = BeanConvertUtil.covertBean(reqJson, FeeDto.class); |
| | | List<ApiFeeDataVo> fees = new ArrayList<>(); |
| | | int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto); |
| | | if (count > 0) { |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//查询费用项目 |
| | | //todo 计算费用 |
| | | computeFeePrice(feeDtos); |
| | | List<ApiFeeDataVo> apiFeeDataVos = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class); |
| | | for (ApiFeeDataVo apiFeeDataVo : apiFeeDataVos) { |
| | | //获取付费对象类型 |
| | | String payerObjType = apiFeeDataVo.getPayerObjType(); |
| | | if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(payerObjType)) { |
| | | apiFeeDataVo.setCarTypeCd("1001"); |
| | | } |
| | | fees.add(apiFeeDataVo); |
| | | } |
| | | freshFeeAttrs(fees, feeDtos); |
| | | } else { |
| | | fees = new ArrayList<>(); |
| | | } |
| | | ApiFeeVo apiFeeVo = new ApiFeeVo(); |
| | | apiFeeVo.setTotal(count); |
| | | apiFeeVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiFeeVo.setFees(fees); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFeeVo), HttpStatus.OK); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | private void freshFeeAttrs(List<ApiFeeDataVo> fees, List<FeeDto> feeDtos) { |
| | | for (ApiFeeDataVo apiFeeDataVo : fees) { |
| | | for (FeeDto feeDto : feeDtos) { |
| | | if (apiFeeDataVo.getFeeId().equals(feeDto.getFeeId())) { |
| | | apiFeeDataVo.setFeeAttrs(feeDto.getFeeAttrDtos()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void computeFeePrice(List<FeeDto> feeDtos) { |
| | | if (ListUtil.isNull(feeDtos)) { |
| | | return; |
| | | } |
| | | |
| | | for (FeeDto feeDto : feeDtos) { |
| | | try { |
| | | // 轮数 * 周期 * 30 + 开始时间 = 目标 到期时间 |
| | | Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto); |
| | | Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate"); |
| | | double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth"); |
| | | feeDto.setCycle(feeDto.getPaymentCycle()); |
| | | //todo 这里考虑 账单模式的场景 |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { |
| | | feeDto.setCycle(oweMonth + ""); |
| | | } |
| | | feeDto.setDeadlineTime(targetEndDate); |
| | | //todo 算费 |
| | | doComputeFeePrice(feeDto, oweMonth); |
| | | |
| | | } catch (Exception e) { |
| | | logger.error("查询费用信息 ,费用信息错误", e); |
| | | } |
| | | //去掉多余0 |
| | | feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + ""); |
| | | feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount()) + ""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据房屋来算单价 |
| | | * |
| | | * @param feeDto |
| | | */ |
| | | private void doComputeFeePrice(FeeDto feeDto, double oweMonth) { |
| | | String computingFormula = feeDto.getComputingFormula(); |
| | | Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); |
| | | //BigDecimal feeTotalPrice = new BigDecimal(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString())); |
| | | feeDto.setFeeTotalPrice(MoneyUtil.computePriceScale(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()), |
| | | feeDto.getScale(), |
| | | Integer.parseInt(feeDto.getDecimalPlace()))); |
| | | BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice()); |
| | | curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth)); |
| | | feeDto.setAmountOwed(MoneyUtil.computePriceScale(curFeePrice.doubleValue(), feeDto.getScale(), Integer.parseInt(feeDto.getDecimalPlace())) + ""); |
| | | //动态费用 |
| | | if ("4004".equals(computingFormula) |
| | | && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) |
| | | && !FeeDto.STATE_FINISH.equals(feeDto.getState()) |
| | | && feeDto.getDeadlineTime() == null) { |
| | | feeDto.setDeadlineTime(DateUtil.getCurrentDate()); |
| | | } |
| | | //考虑租金递增 |
| | | computeFeeSMOImpl.dealRentRate(feeDto); |
| | | } |
| | | |
| | | } |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | if (reqJson.containsKey("roomNum") && !StringUtil.isEmpty(reqJson.getString("roomNum"))) { |
| | | String[] roomNums = reqJson.getString("roomNum").split("-"); |
| | | if (roomNums == null || roomNums.length != 3) { |
| | | if (roomNums.length != 3) { |
| | | throw new IllegalArgumentException("房屋编号格式不对!"); |
| | | } |
| | | RoomDto roomDto = new RoomDto(); |
| New file |
| | |
| | | package com.java110.fee.cmd.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.fee.FeeAccountDetailDto; |
| | | import com.java110.dto.fee.FeeDetailDto; |
| | | import com.java110.dto.payFee.PayFeeDetailDiscountDto; |
| | | import com.java110.intf.fee.IFeeAccountDetailServiceSMO; |
| | | import com.java110.intf.fee.IFeeDetailInnerServiceSMO; |
| | | import com.java110.intf.fee.IPayFeeDetailDiscountInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.api.ApiFeeDetailDataVo; |
| | | import com.java110.vo.api.ApiFeeDetailVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询缴费历史 |
| | | */ |
| | | @Java110Cmd(serviceCode = "fee.queryAdminFeeDetail") |
| | | public class QueryAdminFeeDetailCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IFeeDetailInnerServiceSMO feeDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFeeAccountDetailServiceSMO feeAccountDetailServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IPayFeeDetailDiscountInnerServiceSMO payFeeDetailDiscountInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | if (!StringUtil.isEmpty(reqJson.getString("startTime"))) { |
| | | String startTime = reqJson.getString("startTime") + " 00:00:00"; |
| | | reqJson.put("startTime", startTime); |
| | | } else { |
| | | reqJson.put("startTime", null); |
| | | } |
| | | //获取结束时间 |
| | | if (!StringUtil.isEmpty(reqJson.getString("endTime"))) { |
| | | String endTime = reqJson.getString("endTime") + " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } else { |
| | | reqJson.put("endTime", null); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | |
| | | //查询总记录数 |
| | | ApiFeeDetailVo apiFeeDetailVo = new ApiFeeDetailVo(); |
| | | FeeDetailDto feeDetailDto = BeanConvertUtil.covertBean(reqJson, FeeDetailDto.class); |
| | | |
| | | int total = feeDetailInnerServiceSMOImpl.queryFeeDetailsCount(feeDetailDto); |
| | | apiFeeDetailVo.setTotal(total); |
| | | if (total > 0) { |
| | | List<FeeDetailDto> feeDetailDtos = feeDetailInnerServiceSMOImpl.queryFeeDetails(BeanConvertUtil.covertBean(reqJson, FeeDetailDto.class)); |
| | | List<FeeDetailDto> feeDetailList = new ArrayList<>(); |
| | | for (FeeDetailDto feeDetail : feeDetailDtos) { |
| | | //获取状态 |
| | | String state = feeDetail.getState(); |
| | | if ("1300".equals(state) || "1100".equals(state) || "1200".equals(state)) { //退费单、已退费、退费失败状态 |
| | | //获取周期 |
| | | String cycles = feeDetail.getCycles(); |
| | | if (!StringUtil.isEmpty(cycles) && cycles.contains("-")) { |
| | | feeDetail.setCycles(cycles.substring(1)); |
| | | } |
| | | //获取应收金额 |
| | | String receivableAmount = feeDetail.getReceivableAmount(); |
| | | if (!StringUtil.isEmpty(receivableAmount) && receivableAmount.contains("-")) { |
| | | feeDetail.setReceivableAmount(receivableAmount.substring(1)); |
| | | } |
| | | //获取实收金额 |
| | | String receivedAmount = feeDetail.getReceivedAmount(); |
| | | if (!StringUtil.isEmpty(receivedAmount) && receivedAmount.contains("-")) { |
| | | feeDetail.setReceivedAmount(receivedAmount.substring(1)); |
| | | } |
| | | } |
| | | FeeAccountDetailDto feeAccountDetailDto = new FeeAccountDetailDto(); |
| | | feeAccountDetailDto.setDetailId(feeDetail.getDetailId()); |
| | | List<FeeAccountDetailDto> feeAccountDetailDtos = feeAccountDetailServiceSMOImpl.queryFeeAccountDetails(feeAccountDetailDto); |
| | | feeDetail.setFeeAccountDetailDtoList(feeAccountDetailDtos); |
| | | PayFeeDetailDiscountDto payFeeDetailDiscountDto = new PayFeeDetailDiscountDto(); |
| | | payFeeDetailDiscountDto.setDetailId(feeDetail.getDetailId()); |
| | | List<PayFeeDetailDiscountDto> payFeeDetailDiscountDtos = payFeeDetailDiscountInnerServiceSMOImpl.queryPayFeeDetailDiscounts(payFeeDetailDiscountDto); |
| | | feeDetail.setPayFeeDetailDiscountDtoList(payFeeDetailDiscountDtos); |
| | | feeDetailList.add(feeDetail); |
| | | } |
| | | List<ApiFeeDetailDataVo> feeDetails = BeanConvertUtil.covertBeanList(feeDetailList, ApiFeeDetailDataVo.class); |
| | | |
| | | |
| | | apiFeeDetailVo.setFeeDetails(feeDetails); |
| | | } |
| | | int row = reqJson.getInteger("row"); |
| | | apiFeeDetailVo.setRecords((int) Math.ceil((double) total / (double) row)); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFeeDetailVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright 2017-2020 吴学文 and java110 team. |
| | | * |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.java110.fee.cmd.meterWater; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.meter.MeterWaterDto; |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IMeterWaterInnerServiceSMO; |
| | | import com.java110.intf.fee.IMeterWaterV1InnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 类表述:查询 |
| | | * 服务编码:meterWater.listMeterWater |
| | | * 请求路劲:/app/meterWater.ListMeterWater |
| | | * add by 吴学文 at 2022-07-21 09:17:10 mail: 928255095@qq.com |
| | | * open source address: https://gitee.com/wuxw7/MicroCommunity |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | @Java110Cmd(serviceCode = "meterWater.listAdminMeterWaters") |
| | | public class ListAdminMeterWatersCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ListAdminMeterWatersCmd.class); |
| | | |
| | | @Autowired |
| | | private IMeterWaterV1InnerServiceSMO meterWaterV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMeterWaterInnerServiceSMO meterWaterInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(cmdDataFlowContext); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | MeterWaterDto meterWaterDto = BeanConvertUtil.covertBean(reqJson, MeterWaterDto.class); |
| | | |
| | | int count = meterWaterInnerServiceSMOImpl.queryMeterWatersCount(meterWaterDto); |
| | | |
| | | List<MeterWaterDto> meterWaterDtos = null; |
| | | |
| | | if (count > 0) { |
| | | meterWaterDtos = meterWaterInnerServiceSMOImpl.queryMeterWaters(meterWaterDto); |
| | | } else { |
| | | meterWaterDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, meterWaterDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.cmd.receipt; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.fee.FeeReceiptDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | 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.exception.CmdException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "receipt.queryAdminFeeReceipt") |
| | | public class QueryAdminFeeReceiptCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IFeeReceiptInnerServiceSMO feeReceiptInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validateAdmin(context); |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | FeeReceiptDto feeReceiptDto = BeanConvertUtil.covertBean(reqJson, FeeReceiptDto.class); |
| | | |
| | | |
| | | if (!StringUtil.isEmpty(feeReceiptDto.getQstartTime())) { |
| | | feeReceiptDto.setQstartTime(feeReceiptDto.getQstartTime() + " 00:00:00"); |
| | | } |
| | | if (!StringUtil.isEmpty(feeReceiptDto.getQendTime())) { |
| | | feeReceiptDto.setQendTime(feeReceiptDto.getQendTime() + " 23:59:59"); |
| | | } |
| | | |
| | | int count = feeReceiptInnerServiceSMOImpl.queryFeeReceiptsCount(feeReceiptDto); |
| | | |
| | | List<FeeReceiptDto> feeReceiptDtos = null; |
| | | if (count > 0) { |
| | | feeReceiptDtos = feeReceiptInnerServiceSMOImpl.queryFeeReceipts(feeReceiptDto); |
| | | for (FeeReceiptDto feeReceipt : feeReceiptDtos) { |
| | | feeReceipt.setStoreName(feeReceiptDto.getStoreName()); |
| | | } |
| | | //输入房屋信息 |
| | | freshRoomInfo(feeReceiptDtos); |
| | | } else { |
| | | feeReceiptDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) feeReceiptDto.getRow()), count, feeReceiptDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷入房屋信息 |
| | | * |
| | | * @param feeReceiptDtos |
| | | */ |
| | | private void freshRoomInfo(List<FeeReceiptDto> feeReceiptDtos) { |
| | | |
| | | for (FeeReceiptDto feeReceiptDto : feeReceiptDtos) { |
| | | if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeReceiptDto.getObjType())) { |
| | | feeReceiptDto.setRoomName(feeReceiptDto.getObjName()); |
| | | feeReceiptDto.setCarNum("-"); |
| | | continue; |
| | | } |
| | | |
| | | doFreshRoomInfo(feeReceiptDto); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 车位信息刷入房屋信息 |
| | | * |
| | | * @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 (ListUtil.isNull(ownerCarDtos)) { |
| | | feeReceiptDto.setRoomName("-"); |
| | | return; |
| | | } |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setOwnerId(ownerCarDtos.get(0).getOwnerId()); |
| | | |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | if (ListUtil.isNull(ownerRoomRelDtos)) { |
| | | feeReceiptDto.setRoomName("-"); |
| | | return; |
| | | } |
| | | |
| | | List<String> roomIds = new ArrayList<>(); |
| | | for (OwnerRoomRelDto tOwnerRoomRelDto : ownerRoomRelDtos) { |
| | | roomIds.add(tOwnerRoomRelDto.getRoomId()); |
| | | } |
| | | |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setCommunityId(feeReceiptDto.getCommunityId()); |
| | | roomDto.setRoomIds(roomIds.toArray(new String[roomIds.size()])); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | String roomName = ""; |
| | | for (RoomDto tRoomDto : roomDtos) { |
| | | roomName += (tRoomDto.getFloorNum() + "-" + tRoomDto.getUnitNum() + "-" + tRoomDto.getRoomNum() + "/"); |
| | | } |
| | | |
| | | roomName = roomName.endsWith("/") ? roomName.substring(0, roomName.length() - 1) : roomName; |
| | | feeReceiptDto.setRoomName(roomName); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | logger.debug("查询费用明细信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessFeeDetailInfos = sqlSessionTemplate.selectList("feeDetailServiceDaoImpl.getBusinessFeeDetailInfo",info); |
| | | List<Map> infos = sqlSessionTemplate.selectList("feeDetailServiceDaoImpl.getBusinessFeeDetailInfo",info); |
| | | |
| | | return businessFeeDetailInfos; |
| | | return infos; |
| | | } |
| | | |
| | | |
| | |
| | | public int queryFeeDetailsCount(Map info) { |
| | | logger.debug("查询费用明细数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessFeeDetailInfos = sqlSessionTemplate.selectList("feeDetailServiceDaoImpl.queryFeeDetailsCount", info); |
| | | if (businessFeeDetailInfos.size() < 1) { |
| | | List<Map> infos = sqlSessionTemplate.selectList("feeDetailServiceDaoImpl.queryFeeDetailsCount", info); |
| | | if (infos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessFeeDetailInfos.get(0).get("count").toString()); |
| | | return Integer.parseInt(infos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | @Override |
| New file |
| | |
| | | package com.java110.store.cmd.complaint; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.complaint.ComplaintDto; |
| | | import com.java110.dto.complaint.ComplaintTypeUserDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.intf.common.IComplaintUserInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.store.IComplaintTypeUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IComplaintV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import com.java110.vo.api.junkRequirement.PhotoVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "complaint.listAdminComplaints") |
| | | public class ListAdminComplaintsCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IComplaintV1InnerServiceSMO complaintV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IComplaintUserInnerServiceSMO complaintUserInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | |
| | | ComplaintDto complaintDto = BeanConvertUtil.covertBean(reqJson, ComplaintDto.class); |
| | | int count = complaintV1InnerServiceSMOImpl.queryComplaintsCount(complaintDto); |
| | | List<ComplaintDto> complaintDtos = null; |
| | | if (count > 0) { |
| | | complaintDtos = complaintV1InnerServiceSMOImpl.queryComplaints(complaintDto); |
| | | refreshPhotos(complaintDtos); |
| | | } else { |
| | | complaintDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | //todo 查询类型员工 |
| | | toQueryStaff(complaintDtos); |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, complaintDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | |
| | | private void toQueryStaff(List<ComplaintDto> complaintDtos) { |
| | | |
| | | if (ListUtil.isNull(complaintDtos)) { |
| | | return; |
| | | } |
| | | |
| | | List<String> typeCds = new ArrayList<>(); |
| | | for (ComplaintDto complaintDto : complaintDtos) { |
| | | typeCds.add(complaintDto.getTypeCd()); |
| | | } |
| | | |
| | | if (ListUtil.isNull(typeCds)) { |
| | | return; |
| | | } |
| | | |
| | | ComplaintTypeUserDto complaintTypeUserDto = new ComplaintTypeUserDto(); |
| | | complaintTypeUserDto.setTypeCds(typeCds.toArray(new String[typeCds.size()])); |
| | | |
| | | List<ComplaintTypeUserDto> complaintTypeUserDtos = complaintTypeUserV1InnerServiceSMOImpl.queryComplaintTypeUsers(complaintTypeUserDto); |
| | | |
| | | if (ListUtil.isNull(complaintTypeUserDtos)) { |
| | | return; |
| | | } |
| | | List<ComplaintTypeUserDto> staffs = null; |
| | | for (ComplaintDto complaintDto : complaintDtos) { |
| | | staffs = new ArrayList<>(); |
| | | if (ComplaintDto.STATE_FINISH.equals(complaintDto.getState())) { |
| | | continue; |
| | | } |
| | | for (ComplaintTypeUserDto complaintTypeUserDto1 : complaintTypeUserDtos) { |
| | | if (complaintDto.getTypeCd().equals(complaintTypeUserDto1.getTypeCd())) { |
| | | staffs.add(complaintTypeUserDto1); |
| | | } |
| | | } |
| | | complaintDto.setStaffs(staffs); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void refreshPhotos(List<ComplaintDto> complaints) { |
| | | List<PhotoVo> photoVos = null; |
| | | PhotoVo photoVo = null; |
| | | for (ComplaintDto complaintDataVo : complaints) { |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(complaintDataVo.getComplaintId()); |
| | | fileRelDto.setRelTypeCd("13000"); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | photoVos = new ArrayList<>(); |
| | | for (FileRelDto tmpFileRelDto : fileRelDtos) { |
| | | photoVo = new PhotoVo(); |
| | | photoVo.setUrl(tmpFileRelDto.getFileRealName()); |
| | | photoVos.add(photoVo); |
| | | } |
| | | complaintDataVo.setPhotos(photoVos); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.cmd.contract; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.contract.ContractAttrDto; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.intf.common.IContractApplyUserInnerServiceSMO; |
| | | import com.java110.intf.common.IContractChangeUserInnerServiceSMO; |
| | | import com.java110.intf.store.IContractAttrInnerServiceSMO; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | 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 java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "contract.queryAdminOwnerContract") |
| | | public class QueryAdminOwnerContractCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IContractAttrInnerServiceSMO contractAttrInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IContractApplyUserInnerServiceSMO contractApplyUserInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IContractChangeUserInnerServiceSMO contractChangeUserInnerServiceSMO; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(cmdDataFlowContext); |
| | | Assert.hasKeyAndValue(reqJson,"ownerId","未包含业主ID"); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | ContractDto contractDto = BeanConvertUtil.covertBean(reqJson, ContractDto.class); |
| | | contractDto.setObjId(reqJson.getString("ownerId")); |
| | | |
| | | int count = contractInnerServiceSMOImpl.queryContractsCount(contractDto); |
| | | |
| | | List<ContractDto> contractDtos = null; |
| | | if (count > 0) { |
| | | contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | refreshAttr(contractDtos); |
| | | } else { |
| | | contractDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) contractDto.getRow()), count, contractDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 属性属性 |
| | | * |
| | | * @param contractDtos |
| | | */ |
| | | private void refreshAttr(List<ContractDto> contractDtos) { |
| | | List<String> contractIds = new ArrayList<>(); |
| | | for (ContractDto contractDto : contractDtos) { |
| | | contractIds.add(contractDto.getContractId()); |
| | | } |
| | | |
| | | |
| | | if (ListUtil.isNull(contractIds)) { |
| | | return; |
| | | } |
| | | |
| | | ContractAttrDto contractAttrDto = new ContractAttrDto(); |
| | | contractAttrDto.setContractIds(contractIds.toArray(new String[contractIds.size()])); |
| | | List<ContractAttrDto> contractAttrDtos = contractAttrInnerServiceSMOImpl.queryContractAttrs(contractAttrDto); |
| | | |
| | | List<ContractAttrDto> attrs = null; |
| | | for (ContractDto contractDto : contractDtos) { |
| | | attrs = new ArrayList<>(); |
| | | for (ContractAttrDto tmpContractAttrDto : contractAttrDtos) { |
| | | if (contractDto.getContractId().equals(tmpContractAttrDto.getContractId())) { |
| | | attrs.add(tmpContractAttrDto); |
| | | } |
| | | } |
| | | contractDto.setAttrs(attrs); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.user.bmo.owner.IQueryOwnerStatisticsBMO; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class QueryOwnerStatisticsBMOImpl implements IQueryOwnerStatisticsBMO { |
| | | |
| | | public static final int MAX_LINE_COUNT = 15; |
| | | |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl; |
| | | |
| | |
| | | @Override |
| | | public List<OwnerDto> query(List<OwnerDto> ownerDtos) { |
| | | |
| | | if(ownerDtos == null || ownerDtos.size() < 1){ |
| | | if (ListUtil.isNull(ownerDtos)) { |
| | | return ownerDtos; |
| | | } |
| | | |
| | | //这里限制行数,以免影响系统性能 |
| | | if(ownerDtos.size() > MAX_LINE_COUNT){ |
| | | if (ownerDtos.size() > MAX_LINE_COUNT) { |
| | | return ownerDtos; |
| | | } |
| | | List<String> ownerIds = new ArrayList<>(); |
| | | List<String> memberIds = new ArrayList<>(); |
| | | List<String> ownerTels = new ArrayList<>(); |
| | | for(OwnerDto ownerDto : ownerDtos){ |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | ownerIds.add(ownerDto.getOwnerId()); |
| | | ownerTels.add(ownerDto.getLink()); |
| | | memberIds.add(ownerDto.getMemberId()); |
| | |
| | | |
| | | |
| | | // 查询 房屋数量 |
| | | queryRoomCount(ownerIds,ownerDtos); |
| | | queryRoomCount(ownerIds, ownerDtos); |
| | | |
| | | // 查询 家庭成员数 |
| | | queryOwnerMemberCount(ownerIds,ownerDtos); |
| | | queryOwnerMemberCount(ownerIds, ownerDtos); |
| | | |
| | | // 查询 车辆数 |
| | | queryCarCount(memberIds,ownerDtos); |
| | | queryCarCount(memberIds, ownerDtos); |
| | | |
| | | // 查询 投诉数 |
| | | //queryComplaintCount(ownerTels,ownerDtos); |
| | |
| | | //queryRepairCount(ownerTels,ownerDtos); |
| | | |
| | | // 查询业主欠费 |
| | | queryOwnerOweFee(ownerIds,ownerDtos); |
| | | queryOwnerOweFee(ownerIds, ownerDtos); |
| | | |
| | | // 查询业主合同 |
| | | //queryOwnerContractCount(ownerIds,ownerDtos); |
| | |
| | | |
| | | private void queryOwnerContractCount(List<String> ownerIds, List<OwnerDto> ownerDtos) { |
| | | Map info = new HashMap(); |
| | | info.put("communityId",ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerIds",ownerIds.toArray(new String[ownerIds.size()])); |
| | | info.put("communityId", ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerIds", ownerIds.toArray(new String[ownerIds.size()])); |
| | | List<Map> contractsCount = contractInnerServiceSMOImpl.queryContractsByOwnerIds(info); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : contractsCount) { |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId"))){ |
| | | if (ownerDto.getOwnerId().equals(count.get("ownerId"))) { |
| | | ownerDto.setContractCount(count.get("contractCount").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询业主欠费 |
| | | * |
| | | * @param ownerIds |
| | | * @param ownerDtos |
| | | */ |
| | | private void queryOwnerOweFee(List<String> ownerIds, List<OwnerDto> ownerDtos) { |
| | | Map info = new HashMap(); |
| | | info.put("communityId",ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerIds",ownerIds.toArray(new String[ownerIds.size()])); |
| | | info.put("communityId", ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerIds", ownerIds.toArray(new String[ownerIds.size()])); |
| | | List<Map> repairCounts = reportOweFeeInnerServiceSMOImpl.queryOweFeesByOwnerIds(info); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : repairCounts) { |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId"))){ |
| | | if (ownerDto.getOwnerId().equals(count.get("ownerId"))) { |
| | | ownerDto.setOweFee(count.get("oweFee").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询业主投诉数 |
| | | * |
| | | * @param ownerTels |
| | | * @param ownerDtos |
| | | */ |
| | |
| | | |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("communityId",ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerTels",ownerTels.toArray(new String[ownerTels.size()])); |
| | | info.put("communityId", ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerTels", ownerTels.toArray(new String[ownerTels.size()])); |
| | | List<Map> repairCounts = repairPoolV1InnerServiceSMOImpl.queryRepairCountByOwnerTels(info); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : repairCounts) { |
| | | if(ownerDto.getLink().equals(count.get("ownerTel"))){ |
| | | if (ownerDto.getLink().equals(count.get("ownerTel"))) { |
| | | ownerDto.setRepairCount(count.get("repairCount").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询业主投诉数 |
| | | * |
| | | * @param ownerTels |
| | | * @param ownerDtos |
| | | */ |
| | |
| | | |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("communityId",ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerTels",ownerTels.toArray(new String[ownerTels.size()])); |
| | | info.put("communityId", ownerDtos.get(0).getCommunityId()); |
| | | info.put("ownerTels", ownerTels.toArray(new String[ownerTels.size()])); |
| | | List<Map> complaintCounts = complaintV1InnerServiceSMOImpl.queryComplaintCountByOwnerTels(info); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : complaintCounts) { |
| | | if(ownerDto.getLink().equals(count.get("ownerTel"))){ |
| | | if (ownerDto.getLink().equals(count.get("ownerTel"))) { |
| | | ownerDto.setComplaintCount(count.get("complaintCount").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询业主车辆数 |
| | | * |
| | | * @param memberIds |
| | | * @param ownerDtos |
| | | */ |
| | |
| | | |
| | | List<Map> memberCounts = ownerCarV1InnerServiceSMOImpl.queryOwnerCarCountByOwnerIds(memberIds); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : memberCounts) { |
| | | if(ownerDto.getMemberId().equals(count.get("ownerId"))){ |
| | | if (ownerDto.getMemberId().equals(count.get("ownerId"))) { |
| | | ownerDto.setCarCount(count.get("carCount").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询 业主成员数 |
| | | * |
| | | * @param ownerIds |
| | | * @param ownerDtos |
| | | */ |
| | |
| | | |
| | | List<Map> memberCounts = ownerV1InnerServiceSMOImpl.queryOwnerMembersCount(ownerIds); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | if(OwnerDto.OWNER_TYPE_CD_MEMBER.equals(ownerDto.getOwnerTypeCd())){ |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | if (OwnerDto.OWNER_TYPE_CD_MEMBER.equals(ownerDto.getOwnerTypeCd())) { |
| | | ownerDto.setMemberCount("0"); |
| | | continue; |
| | | } |
| | | for (Map count : memberCounts) { |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId"))){ |
| | | if (ownerDto.getOwnerId().equals(count.get("ownerId"))) { |
| | | ownerDto.setMemberCount(count.get("memberCount").toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询 房屋数量 |
| | | * |
| | | * @param ownerIds |
| | | * @param ownerDtos |
| | | */ |
| | |
| | | //查询业主房屋数 |
| | | List<Map> ownerRoomCounts = ownerRoomRelV1InnerServiceSMOImpl.queryRoomCountByOwnerIds(ownerIds); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : ownerRoomCounts) { |
| | | if(StringUtil.isEmpty(ownerDto.getOwnerId())){ |
| | | if (StringUtil.isEmpty(ownerDto.getOwnerId())) { |
| | | continue; |
| | | } |
| | | if(StringUtil.isEmpty(count.get("ownerId").toString())){ |
| | | if (StringUtil.isEmpty(count.get("ownerId").toString())) { |
| | | continue; |
| | | } |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId").toString())){ |
| | | if (ownerDto.getOwnerId().equals(count.get("ownerId").toString())) { |
| | | ownerDto.setRoomCount(count.get("roomCount").toString()); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.user.cmd.owner; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.dto.privilege.BasePrivilegeDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.intf.common.IMachineTranslateV1InnerServiceSMO; |
| | | import com.java110.intf.community.IMenuInnerServiceSMO; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Java110Cmd(serviceCode = "owner.queryAdminOwnerCars") |
| | | public class QueryAdminOwnerCarsCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMenuInnerServiceSMO menuInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMachineTranslateV1InnerServiceSMO machineTranslateV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | super.validateAdmin(cmdDataFlowContext); |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson,"ownerId","未包含业主ID"); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class); |
| | | int row = reqJson.getIntValue("row"); |
| | | //查询总记录数 |
| | | int total = ownerCarInnerServiceSMOImpl.queryOwnerCarsCount(ownerCarDto); |
| | | // int count = 0; |
| | | List<OwnerCarDto> ownerCarDtoList = null; |
| | | if (total > 0) { |
| | | ownerCarDtoList = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | //小区20条时刷房屋和车位信息 |
| | | if (row < 20) { |
| | | freshPs(ownerCarDtoList); |
| | | freshRoomInfo(ownerCarDtoList); |
| | | //刷入同步物联网状态 |
| | | freshTransactionIotState(ownerCarDtoList); |
| | | } |
| | | } else { |
| | | ownerCarDtoList = new ArrayList<>(); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerCarDtoList); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | private void freshTransactionIotState(List<OwnerCarDto> ownerCarDtoList) { |
| | | if (ownerCarDtoList == null || ownerCarDtoList.size() < 1) { |
| | | return; |
| | | } |
| | | List<String> memberIds = new ArrayList<>(); |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtoList) { |
| | | if (StringUtil.isEmpty(ownerCarDto.getPsId())) { |
| | | continue; |
| | | } |
| | | memberIds.add(ownerCarDto.getMemberId()); |
| | | } |
| | | |
| | | MachineTranslateDto machineTranslateDto = new MachineTranslateDto(); |
| | | machineTranslateDto.setObjIds(memberIds.toArray(new String[memberIds.size()])); |
| | | List<MachineTranslateDto> machineTranslateDtos = machineTranslateV1InnerServiceSMOImpl.queryObjStateInMachineTranslates(machineTranslateDto); |
| | | |
| | | if (ListUtil.isNull(machineTranslateDtos)) { |
| | | return; |
| | | } |
| | | |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtoList) { |
| | | for (MachineTranslateDto tmpMachineTranslateDto : machineTranslateDtos) { |
| | | if (!ownerCarDto.getMemberId().equals(tmpMachineTranslateDto.getObjId())) { |
| | | continue; |
| | | } |
| | | ownerCarDto.setIotStateName(tmpMachineTranslateDto.getStateName()); |
| | | ownerCarDto.setIotRemark(tmpMachineTranslateDto.getRemark()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void freshPs(List<OwnerCarDto> ownerCarDtoList) { |
| | | if (ownerCarDtoList == null || ownerCarDtoList.size() < 1) { |
| | | return; |
| | | } |
| | | List<String> psIds = new ArrayList<>(); |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtoList) { |
| | | if (StringUtil.isEmpty(ownerCarDto.getPsId())) { |
| | | continue; |
| | | } |
| | | psIds.add(ownerCarDto.getPsId()); |
| | | } |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | | parkingSpaceDto.setCommunityId(ownerCarDtoList.get(0).getCommunityId()); |
| | | parkingSpaceDto.setPsIds(psIds.toArray(new String[psIds.size()])); |
| | | List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); |
| | | for (ParkingSpaceDto tmpParkingSpaceDto : parkingSpaceDtos) { |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtoList) { |
| | | if (tmpParkingSpaceDto.getPsId().equals(ownerCarDto.getPsId())) { |
| | | ownerCarDto.setAreaNum(tmpParkingSpaceDto.getAreaNum()); |
| | | ownerCarDto.setNum(tmpParkingSpaceDto.getNum()); |
| | | ownerCarDto.setParkingType(tmpParkingSpaceDto.getParkingType()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷入房屋信息 |
| | | * |
| | | * @param ownerCarDtos |
| | | */ |
| | | private void freshRoomInfo(List<OwnerCarDto> ownerCarDtos) { |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtos) { |
| | | doFreshRoomInfo(ownerCarDto); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车位信息刷入房屋信息 |
| | | * |
| | | * @param ownerCarDto |
| | | */ |
| | | private void doFreshRoomInfo(OwnerCarDto ownerCarDto) { |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setOwnerId(ownerCarDto.getOwnerId()); |
| | | ownerRoomRelDto.setPage(1); |
| | | ownerRoomRelDto.setRow(3); //只展示3个房屋以内 不然页面太乱 |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | if (ListUtil.isNull(ownerRoomRelDtos)) { |
| | | ownerCarDto.setRoomName("-"); |
| | | return; |
| | | } |
| | | List<String> roomIds = new ArrayList<>(); |
| | | for (OwnerRoomRelDto tOwnerRoomRelDto : ownerRoomRelDtos) { |
| | | roomIds.add(tOwnerRoomRelDto.getRoomId()); |
| | | } |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setCommunityId(ownerCarDto.getCommunityId()); |
| | | roomDto.setRoomIds(roomIds.toArray(new String[roomIds.size()])); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | String roomName = ""; |
| | | for (RoomDto tRoomDto : roomDtos) { |
| | | roomName += (tRoomDto.getFloorNum() + "-" + tRoomDto.getUnitNum() + "-" + tRoomDto.getRoomNum() + "-" + "/"); |
| | | } |
| | | roomName = roomName.endsWith("/") ? roomName.substring(0, roomName.length() - 1) : roomName; |
| | | ownerCarDto.setRoomName(roomName); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.user.cmd.owner; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.privilege.BasePrivilegeDto; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.IMenuInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Java110Cmd(serviceCode = "owner.queryAdminOwnerMembers") |
| | | public class QueryAdminOwnerMembersCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMenuInnerServiceSMO menuInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求中未包含ownerId信息"); |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | String userId = context.getReqHeaders().get("user-id"); |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | int row = reqJson.getInteger("row"); |
| | | //查询总记录数 |
| | | int total = ownerInnerServiceSMOImpl.queryOwnersMemberCount(ownerDto); |
| | | |
| | | List<OwnerDto> ownerDtos = null; |
| | | if (total > 0) { |
| | | ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | } else { |
| | | ownerDtos = new ArrayList<>(); |
| | | } |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerDtos); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.user.cmd.owner; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "owner.queryAdminRoomHisOwner") |
| | | public class QueryAdminRoomHisOwnerCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | Assert.hasKeyAndValue(reqJson, "roomId", "未包含房屋编号"); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | int count = ownerInnerServiceSMOImpl.queryOwnerLogsCountByRoom(ownerDto); |
| | | |
| | | List<OwnerDto> ownerDtos = null; |
| | | if (count > 0) { |
| | | ownerDtos = ownerInnerServiceSMOImpl.queryOwnerLogsByRoom(ownerDto); |
| | | } else { |
| | | ownerDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) ownerDto.getRow()), count, ownerDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.user.cmd.owner; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.user.bmo.owner.IQueryOwnerStatisticsBMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * admin query room owner |
| | | */ |
| | | @Java110Cmd(serviceCode = "owner.queryAdminRoomOwner") |
| | | public class QueryAdminRoomOwnerCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | @Autowired |
| | | private IQueryOwnerStatisticsBMO queryOwnerStatisticsBMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validateAdmin(context); |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "roomId", "未包含房屋编号"); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | //todo 根据房屋查询时 先用 房屋信息查询 业主ID |
| | | |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | |
| | | int row = reqJson.getInteger("row"); |
| | | //查询总记录数 |
| | | int total = ownerInnerServiceSMOImpl.queryOwnersCount(ownerDto); |
| | | List<OwnerDto> ownerDtos = null; |
| | | if (total > 0) { |
| | | ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | // 查询统计数据 |
| | | ownerDtos = queryOwnerStatisticsBMOImpl.query(ownerDtos); |
| | | } else { |
| | | ownerDtos = new ArrayList<>(); |
| | | } |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerDtos); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |