Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/xizang
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | |
| | | import com.ruoyi.system.service.impl.ScreenService; |
| | | import com.ruoyi.system.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | public R<ScreenTopStaticsDataVO> getTopStaticsData() { |
| | | return R.ok(screenService.getTopStaticsData()); |
| | | } |
| | | |
| | | @GetMapping("/rent-rank") |
| | | @ApiOperation("区域租金排名") |
| | | public R<List<ScreenRentRankVO>> rentRank() { |
| | | return R.ok(screenService.streetRentRank()); |
| | | } |
| | | |
| | | @GetMapping("/rent-income-trend") |
| | | @ApiOperation("租金收入趋势") |
| | | public R<ScreenRentIncomeTrendVO> rentIncomeTrend() { |
| | | return R.ok(screenService.rentIncomeTrend()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getTenantCountTrend") |
| | | @ApiModelProperty(value = "租户数量趋势统计") |
| | | @ApiOperation(value = "租户数量趋势统计") |
| | | public R<List<TenantCountTrendVO>> getTenantCountTrend() { |
| | | |
| | | Date currentDate = new Date(); |
| | |
| | | return R.ok(trendData); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 实时租赁数据 |
| | | */ |
| | | @GetMapping("/getRealTimeRentData") |
| | | @ApiOperation("获取实时租赁数据") |
| | | public R<List<RealTimeRentDataVO>> getRealTimeRentData() { |
| | | // 随机获取十条房源 |
| | | List<THouse> houses = houseService.list(new LambdaQueryWrapper<THouse>() |
| | |
| | | * 获取房屋地图分布 |
| | | */ |
| | | @GetMapping("/getHouseMapDistribution") |
| | | @ApiOperation("获取房屋地图分布") |
| | | public R<List<HouseMapDistributionVO>> getHouseMapDistribution() { |
| | | // 获取所有房屋信息 |
| | | List<THouse> houses = houseService.list(); |
| | |
| | | houseMapDistributionVO.setHouseName(house.getHouseName()); |
| | | houseMapDistributionVO.setHouseAddress(house.getHouseAddress()); |
| | | houseMapDistributionVO.setHouseStatus(house.getLeaseStatus()); |
| | | TContract contract = contractService.getOne(new LambdaQueryWrapper<TContract>() |
| | | .eq(TContract::getHouseId, house.getId())); |
| | | TBill bill = billService.getOne(new LambdaQueryWrapper<TBill>() |
| | | .eq(TBill::getContractId, contract.getId()) |
| | | .eq(TBill::getBillType, 1)); |
| | | |
| | | |
| | | houseMapDistributionVO.setTenant(contract.getPartyTwoName()); |
| | | |
| | | |
| | | LocalDateTime startTime = contract.getStartTime(); |
| | | LocalDateTime endTime = contract.getEndTime(); |
| | | BigDecimal monthRent = contract.getMonthRent(); |
| | | // 计算相差月份 |
| | | long monthsBetween = ChronoUnit.MONTHS.between(startTime, endTime); |
| | | BigDecimal payableFeesMoney = monthRent.multiply(new BigDecimal(monthsBetween)); |
| | | BigDecimal remainingPayment = bill.getPayableFeesMoney(); |
| | | BigDecimal paidAlready = payableFeesMoney.subtract(remainingPayment); |
| | | String rentStatus = String.format("%.2f/%.2f", paidAlready, payableFeesMoney); |
| | | houseMapDistributionVO.setRentStatus(rentStatus); |
| | | |
| | | String payType = contract.getPayType(); |
| | | String rent = ""; |
| | | LocalDateTime payFeesTime = bill.getPayFeesTime(); |
| | | switch (payType) { |
| | | case "1": |
| | | if (isCurrentMonth(payFeesTime)) { |
| | | rent = String.format("%.2f/%.2f", monthRent, monthRent); |
| | | } else { |
| | | rent = String.format("%.2f/%.2f", new BigDecimal("0"), monthRent); |
| | | } |
| | | break; |
| | | case "2": |
| | | // 季付价格 |
| | | BigDecimal quarterRent = monthRent.multiply(new BigDecimal(3)); |
| | | if (isCurrentQuarter(payFeesTime)) { |
| | | rent = String.format("%.2f/%.2f", quarterRent, quarterRent); |
| | | } else { |
| | | rent = String.format("%.2f/%.2f", new BigDecimal("0"), quarterRent); |
| | | } |
| | | break; |
| | | case "3": |
| | | // 年付价格 |
| | | BigDecimal yearRent = monthRent.multiply(new BigDecimal(12)); |
| | | if (isCurrentYear(payFeesTime)) { |
| | | rent = String.format("%.2f/%.2f", yearRent, yearRent); |
| | | } else { |
| | | rent = String.format("%.2f/%.2f", new BigDecimal("0"), yearRent); |
| | | } |
| | | break; |
| | | } |
| | | houseMapDistributionVO.setRent(rent); |
| | | houseMapDistributionVO.setLongitude(house.getLongitude()); |
| | | houseMapDistributionVO.setLatitude(house.getLatitude()); |
| | | TContract contract = contractService.getOne(new LambdaQueryWrapper<TContract>() |
| | | .gt(TContract::getEndTime, LocalDateTime.now()) |
| | | .eq(TContract::getHouseId, house.getId()) |
| | | .eq(TContract::getStatus, 4) |
| | | .last("limit 1")); |
| | | |
| | | if (contract != null){ |
| | | List<TBill> tBills = billService.list(new LambdaQueryWrapper<TBill>() |
| | | .eq(TBill::getContractId, contract.getId()) |
| | | .eq(TBill::getBillType, 1)); |
| | | houseMapDistributionVO.setTenant(contract.getPartyTwoName()); |
| | | LocalDateTime startTime = contract.getStartTime(); |
| | | LocalDateTime endTime = contract.getEndTime(); |
| | | BigDecimal monthRent = contract.getMonthRent(); |
| | | // 计算相差月份 |
| | | long monthsBetween = ChronoUnit.MONTHS.between(startTime, endTime); |
| | | BigDecimal payableFeesMoney = monthRent.multiply(new BigDecimal(monthsBetween)); |
| | | |
| | | BigDecimal paidAlready = tBills.stream() |
| | | .map(TBill::getPayableFeesMoney) |
| | | .reduce(BigDecimal::add) |
| | | .orElse(BigDecimal.ZERO); |
| | | String rentStatus = String.format("%.2f/%.2f", paidAlready, payableFeesMoney); |
| | | houseMapDistributionVO.setRentStatus(rentStatus); |
| | | |
| | | |
| | | TBill one = billService.getOne(new LambdaQueryWrapper<TBill>() |
| | | .le(TBill::getStartTime, LocalDateTime.now()) |
| | | .gt(TBill::getEndTime, LocalDateTime.now()) |
| | | .eq(TBill::getBillType, 1) |
| | | .eq(TBill::getContractId, contract.getId())); |
| | | |
| | | if ("4".equals(one.getPayFeesStatus())){ |
| | | houseMapDistributionVO.setHouseStatus("4"); |
| | | } |
| | | |
| | | |
| | | |
| | | BigDecimal payFeesMoney = one.getPayFeesMoney(); |
| | | BigDecimal payableFeesMoney1 = one.getPayableFeesMoney(); |
| | | String rent = String.format("%.2f/%.2f", payFeesMoney, payableFeesMoney1); |
| | | |
| | | houseMapDistributionVO.setRent(rent); |
| | | }else { |
| | | houseMapDistributionVO.setTenant("暂无"); |
| | | houseMapDistributionVO.setRentStatus("暂无"); |
| | | houseMapDistributionVO.setRent("暂无"); |
| | | } |
| | | result.add(houseMapDistributionVO); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否是当前月份 |
| | | * @param dateTime 日期时间 |
| | | * @return boolean |
| | | */ |
| | | public static boolean isCurrentMonth(LocalDateTime dateTime) { |
| | | YearMonth currentYearMonth = YearMonth.now(); |
| | | YearMonth targetYearMonth = YearMonth.from(dateTime); |
| | | return currentYearMonth.equals(targetYearMonth); |
| | | } |
| | | |
| | | public static boolean isCurrentQuarter(LocalDateTime dateTime) { |
| | | int currentMonth = LocalDateTime.now().getMonthValue(); |
| | | int targetMonth = dateTime.getMonthValue(); |
| | | |
| | | // 计算当前季度和目标时间所属季度 |
| | | int currentQuarter = (currentMonth - 1) / 3 + 1; |
| | | int targetQuarter = (targetMonth - 1) / 3 + 1; |
| | | |
| | | return LocalDateTime.now().getYear() == dateTime.getYear() && currentQuarter == targetQuarter; |
| | | } |
| | | |
| | | public static boolean isCurrentYear(LocalDateTime dateTime) { |
| | | return LocalDateTime.now().getYear() == dateTime.getYear(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TBusinessDept; |
| | | import com.ruoyi.system.service.ITBusinessDeptService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 营业部 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2025-03-24 |
| | | */ |
| | | @Api(tags = {"营业部相关接口"}) |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/t-business-dept") |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class TBusinessDeptController { |
| | | private final ITBusinessDeptService businessDeptService; |
| | | @ApiOperation(value = "获取营业部列表") |
| | | @GetMapping("/list/type") |
| | | public R<List<TBusinessDept>> list(@ApiParam(name = "type",value = "是否添加人员使用 1:是 0:否",required = true) Integer type ) { |
| | | List<TBusinessDept> list = businessDeptService.list(); |
| | | if (type == 1){ |
| | | TBusinessDept tBusinessDept = new TBusinessDept(); |
| | | tBusinessDept.setId("0"); |
| | | tBusinessDept.setName("领导层"); |
| | | list.add(0,tBusinessDept); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.ProcessCategoryEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | |
| | | @PreAuthorize("@ss.hasPermi('contract:list:add')") |
| | | public R<Boolean> addContract(@Validated @RequestBody TContractDTO dto) { |
| | | LocalDateTime changeTime = dto.getChangeTime(); |
| | | long count = contractService.count(new LambdaQueryWrapper<TContract>().eq(TContract::getContractNumber, dto.getContractNumber())); |
| | | long count = contractService.count(new LambdaQueryWrapper<TContract>() |
| | | .eq(TContract::getContractNumber, dto.getContractNumber())); |
| | | if (count!=0){ |
| | | return R.fail("合同编号不可重复"); |
| | | } |
| | | dto.setChangeRent(dto.getMonthRent()); |
| | | dto.setChangeTime(null); |
| | | //查询房产信息,获取所属营业部 |
| | | THouse house = houseService.getById(dto.getHouseId()); |
| | | if (Objects.isNull(house)) { |
| | | throw new ServiceException("房产信息不存在"); |
| | | } |
| | | dto.setBusinessDeptId(house.getBusinessDeptId()); |
| | | contractService.save(dto); |
| | | if (dto.getStatus().equals("2")){ |
| | | //发起合同新增审批 |
| | |
| | | new ImmutableMap.Builder<String, Long>(). |
| | | put("id", flwTask.getId()) |
| | | .build(); |
| | | QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps); |
| | | QuartzManager.addJob( |
| | | StateProcessJob.class, |
| | | (StateProcessJob.name+flwTask.getId()).toUpperCase(), |
| | | TimeJobType.AUTO_AUDIT, |
| | | new Date(new Date().getTime()+48*60*60*1000L), |
| | | maps |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | @PreAuthorize("@ss.hasPermi('contract:list:edit')") |
| | | public R<Boolean> updateContract(@Validated @RequestBody TContractDTO dto) { |
| | | dto.setChangeTime(null); |
| | | //查询房产信息,获取所属营业部 |
| | | THouse house = houseService.getById(dto.getHouseId()); |
| | | if (Objects.isNull(house)) { |
| | | throw new ServiceException("房产信息不存在"); |
| | | } |
| | | dto.setBusinessDeptId(house.getBusinessDeptId()); |
| | | contractService.updateById(dto); |
| | | contractRentTypeService.remove(new LambdaQueryWrapper<TContractRentType>() |
| | | .eq(TContractRentType::getContractId,dto.getId())); |
| | |
| | | new ImmutableMap.Builder<String, Long>(). |
| | | put("id", flwTask.getId()) |
| | | .build(); |
| | | QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps); |
| | | QuartzManager.addJob( |
| | | StateProcessJob.class, |
| | | (StateProcessJob.name + flwTask.getId()).toUpperCase(), |
| | | TimeJobType.AUTO_AUDIT, |
| | | new Date(new Date().getTime() + 48 * 60 * 60 * 1000L), |
| | | maps |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | TContractVO res = new TContractVO(); |
| | | TContract contract = contractService.getById(id); |
| | | BeanUtils.copyProperties(contract,res); |
| | | TContractRentType contractRentType = contractRentTypeService.lambdaQuery().eq(TContractRentType::getContractId, id).one(); |
| | | TContractRentType contractRentType = contractRentTypeService.lambdaQuery() |
| | | .eq(TContractRentType::getContractId, id) |
| | | .one(); |
| | | if (contractRentType!=null){ |
| | | BeanUtils.copyProperties(contractRentType,res); |
| | | } |
| | |
| | | for (TBill tBill : list) { |
| | | payMoney = payMoney.add(tBill.getOutstandingMoney()).add(tBill.getPayableFeesPenalty()); |
| | | } |
| | | TCheckAcceptRecord tCheckAcceptRecord = checkAcceptRecordService.lambdaQuery().eq(TCheckAcceptRecord::getContractId, id).one(); |
| | | res.setCheckResult(Objects.nonNull(tCheckAcceptRecord)&&Objects.nonNull(tCheckAcceptRecord.getCheckResult())?tCheckAcceptRecord.getCheckResult():null); |
| | | TCheckAcceptRecord tCheckAcceptRecord = checkAcceptRecordService.lambdaQuery() |
| | | .eq(TCheckAcceptRecord::getContractId, id) |
| | | .one(); |
| | | res.setCheckResult( |
| | | Objects.nonNull(tCheckAcceptRecord) |
| | | &&Objects.nonNull(tCheckAcceptRecord.getCheckResult()) |
| | | ?tCheckAcceptRecord.getCheckResult() |
| | | :null |
| | | ); |
| | | res.setPayMoney(payMoney); |
| | | |
| | | return R.ok(res); |
| | |
| | | @PreAuthorize("@ss.hasPermi('contract:list:export')") |
| | | @Log(title = "导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void exportOpticalInspection(@RequestBody TContractQuery query) |
| | | { |
| | | public void exportOpticalInspection(@RequestBody TContractQuery query) throws UnsupportedEncodingException { |
| | | List<ContractExport> contractExports = new ArrayList<>(); |
| | | List<TContract> exportList = contractService.contractExportList(query); |
| | | |
| | | for (TContract contract : exportList) { |
| | | ContractExport contractExport = new ContractExport(); |
| | | contractExport.setContractNumber(contract.getContractNumber()); |
| | |
| | | contractExport.setCreateTime(DateUtils.localDateTimeToStringYear(contract.getCreateTime())); |
| | | contractExport.setStartTime(DateUtils.localDateTimeToStringYear(contract.getStartTime())); |
| | | contractExport.setEndTime(DateUtils.localDateTimeToStringYear(contract.getEndTime())); |
| | | contractExport.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,contract.getPayType())); |
| | | contractExport.setDeposit(contract.getDeposit()+""); |
| | | contractExport.setStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS,contract.getStatus())); |
| | | contractExport.setDeposit(contract.getDeposit() + ""); |
| | | contractExports.add(contractExport); |
| | | contractExport.setPayType( |
| | | DictUtils.getDictLabel( |
| | | DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE, contract.getPayType()) |
| | | ); |
| | | contractExport.setStatus( |
| | | DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS, contract.getStatus())); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ContractExport.class, contractExports); |
| | | |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("合同列表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | response.setHeader("Content-Disposition", |
| | | "attachment;filename=" + URLEncoder.encode("合同列表.xls", "utf-8")); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | |
| | | try (Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ContractExport.class, contractExports); |
| | | ServletOutputStream outputStream = response.getOutputStream()) { |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | |
| | | @ApiOperation(value = "获取房屋分页列表") |
| | | @PostMapping(value = "/houseList") |
| | | @PreAuthorize("@ss.hasPermi('house:list')") |
| | | public R<PageInfo<THouse>> houseList(@RequestBody THouseQuery query) { |
| | | public R<IPage<THouse>> houseList(@RequestBody THouseQuery query) { |
| | | return R.ok(tHouseService.houseList(query)); |
| | | } |
| | | @ApiOperation(value = "历史租户列表") |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TRentalReturnRecord; |
| | | import com.ruoyi.system.query.RentalReturnAuditQuery; |
| | | import com.ruoyi.system.query.RentalReturnRecordQuery; |
| | | import com.ruoyi.system.service.ITRentalReturnRecordService; |
| | | import com.ruoyi.system.vo.RentalReturnRecordVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/rentalReturnRecord") |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | @Api(tags = {"房屋管理-退租申请"}) |
| | | public class TRentalReturnRecordController extends BaseController { |
| | | private final ITRentalReturnRecordService rentalReturnRecordService; |
| | | |
| | | /** |
| | | * 申请记录列表 |
| | | */ |
| | | @ApiOperation(value = "申请记录列表") |
| | | @GetMapping("list") |
| | | @PreAuthorize("@ss.hasPermi('houseManage:apply:list')") |
| | | public R<IPage<RentalReturnRecordVO>> list(Page<RentalReturnRecordVO> page, RentalReturnRecordQuery query) { |
| | | return R.ok(rentalReturnRecordService.queryRentalReturnRecordList(page, query)); |
| | | } |
| | | |
| | | /** |
| | | * 审核记录删除 |
| | | */ |
| | | @ApiOperation(value = "审核记录删除") |
| | | @GetMapping("delete") |
| | | @PreAuthorize("@ss.hasPermi('houseManage:apply:delete')") |
| | | public R<String> delete(@ApiParam (value = "id") String id) { |
| | | boolean remove = rentalReturnRecordService.update(new LambdaUpdateWrapper<TRentalReturnRecord>() |
| | | .set(TRentalReturnRecord::getIsAdminDelete, true) |
| | | .eq(TRentalReturnRecord::getId, id) |
| | | .ne(TRentalReturnRecord::getAuditStatus, 1)); |
| | | if (!remove){ |
| | | return R.fail("删除失败"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 申请记录详情 |
| | | */ |
| | | @ApiOperation(value = "申请记录详情") |
| | | @GetMapping("detail") |
| | | @PreAuthorize("@ss.hasPermi('houseManage:apply:detail')") |
| | | public R<RentalReturnRecordVO> detail(@ApiParam (value = "id") String id) { |
| | | RentalReturnRecordVO rentalReturnRecordVO = rentalReturnRecordService.queryRentalReturnRecordById(id); |
| | | return R.ok(rentalReturnRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 申请审核 |
| | | */ |
| | | @ApiOperation(value = "申请审核") |
| | | @PostMapping("audit") |
| | | @PreAuthorize("@ss.hasPermi('houseManage:apply:audit')") |
| | | public R<String> audit(@RequestBody RentalReturnAuditQuery returnAuditQuery) { |
| | | rentalReturnRecordService.audit(returnAuditQuery, getUserId(), getUsername()); |
| | | return R.ok("审核成功"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | myToDoVO.setStartTime(DateUtils.localDateTimeToStringYear(contract.getStartTime())); |
| | | myToDoVO.setPropertyRightPerson(tHouse.getPropertyRightPerson()); |
| | | myToDoVO.setPhone(tHouse.getPhone()); |
| | | myToDoVO.setRentalReturnStatus(tHouse.getRentalReturnStatus() == null ? "1" : tHouse.getRentalReturnStatus()); |
| | | List<TBill> billList = bills.stream().filter(e -> e.getContractId().equals(contract.getId())).collect(Collectors.toList()); |
| | | List<PayListVO> payList = new ArrayList<>(); |
| | | for (TBill tBill : billList) { |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.TRentalReturnRecord; |
| | | import com.ruoyi.system.service.ITRentalReturnRecordService; |
| | | import com.ruoyi.system.service.TContractService; |
| | | import com.ruoyi.system.vo.RentalRetureApplyVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @RestController |
| | | @RequestMapping("/rentalReturnRecord") |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | @Api(tags = {"房屋管理-退租申请"}) |
| | | public class TRentalReturnRecordController extends BaseController { |
| | | private final ITRentalReturnRecordService rentalReturnRecordService; |
| | | private final TokenService tokenService; |
| | | |
| | | /** |
| | | * 申请退租 |
| | | */ |
| | | @ApiOperation(value = "申请退租") |
| | | @PostMapping("/apply") |
| | | public R<?> apply(@RequestBody RentalRetureApplyVO rentalReture) { |
| | | rentalReturnRecordService.apply(rentalReture, tokenService.getLoginUserApplet().getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 申请详情 |
| | | */ |
| | | @ApiOperation(value = "申请详情") |
| | | @GetMapping("/detail") |
| | | public R<TRentalReturnRecord> detail(@ApiParam (value = "合同id") @RequestParam String contractId) { |
| | | TRentalReturnRecord rentalReturnRecord = rentalReturnRecordService.getOne(new LambdaQueryWrapper<TRentalReturnRecord>() |
| | | .eq(TRentalReturnRecord::getContractId, contractId) |
| | | .last("limit 1") |
| | | .orderByDesc(TRentalReturnRecord::getCreateTime)); |
| | | if (rentalReturnRecord == null){ |
| | | return R.fail("暂无申请记录"); |
| | | } |
| | | TRentalReturnRecord detail = rentalReturnRecordService.getOne(new LambdaQueryWrapper<TRentalReturnRecord>() |
| | | .eq(TRentalReturnRecord::getId, rentalReturnRecord.getId())); |
| | | return R.ok(detail); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.xss.Xss; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.xss.Xss; |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户对象 sys_user |
| | |
| | | @TableField(exist = false) |
| | | private List<String> deptIds; |
| | | |
| | | @ApiModelProperty(value = "营业部id") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | |
| | | throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取营业部ID |
| | | **/ |
| | | public static String getBusinessDeptId() |
| | | { |
| | | try |
| | | { |
| | | return getLoginUser().getUser().getBusinessDeptId(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new ServiceException("获取营业部ID异常", HttpStatus.UNAUTHORIZED); |
| | | } |
| | | } |
| | | /** |
| | | * 获取用户账户 |
| | | **/ |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.entity.TTenantResp; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.service.TTenantService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.TTenantResp; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.exception.user.BlackListException; |
| | | import com.ruoyi.common.exception.user.CaptchaException; |
| | |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TTenantService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 登录校验方法 |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "终止合同DTO") |
| | |
| | | |
| | | @ApiModelProperty(value = "终止日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date terminateTime; |
| | | private LocalDateTime terminateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.system.model.TBusinessDept; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 营业部 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2025-03-24 |
| | | */ |
| | | public interface TBusinessDeptMapper extends BaseMapper<TBusinessDept> { |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface TContractMapper extends BaseMapper<TContract> { |
| | | |
| | | List<TContract> contractList(@Param("query") TContractQuery query, @Param("pageInfo") PageInfo<TContract> pageInfo); |
| | | List<TContract> contractList(@Param("query") TContractQuery query, @Param("pageInfo") PageInfo<TContract> pageInfo,@Param("businessDeptId") String businessDeptId); |
| | | |
| | | List<TContract> contractAppletList(@Param("query")TContractAppletQuery query, @Param("pageInfo") PageInfo<TContract> pageInfo); |
| | | |
| | |
| | | |
| | | List<HouseVO> userHistoryList(@Param("req")TUserHistoryQuery query, @Param("pageInfo")PageInfo<HouseVO> pageInfo); |
| | | |
| | | Double getHouseRentedArea(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.system.model.TRentalReturnRecord; |
| | | import com.ruoyi.system.query.RentalReturnRecordQuery; |
| | | import com.ruoyi.system.vo.RentalReturnRecordVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TRentalReturnRecordMapper extends BaseMapper<TRentalReturnRecord> { |
| | | |
| | | IPage<RentalReturnRecordVO> queryRentalReturnRecordList(@Param("page") IPage<RentalReturnRecordVO> page, |
| | | @Param("query") RentalReturnRecordQuery query); |
| | | |
| | | RentalReturnRecordVO queryRentalReturnRecordById(@Param("id") String id); |
| | | } |
| | |
| | | |
| | | List<ExamineVO> examineList(@Param("query")TExamineAppletQuery dto, @Param("pageInfo")PageInfo<ExamineVO> pageInfo); |
| | | |
| | | /** |
| | | * 根据营业部id获取租户列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TenantVO> pageListByBusinessDeptId(@Param("query") TTenantQuery query, @Param("pageInfo")PageInfo<TenantVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 营业部 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2025-03-24 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_business_dept") |
| | | @ApiModel(value="TBusinessDept对象", description="营业部") |
| | | public class TBusinessDept extends BaseModel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "营业部名称") |
| | | private String name; |
| | | |
| | | } |
| | |
| | | @TableField("terminate_time") |
| | | private LocalDateTime terminateTime; |
| | | |
| | | @ApiModelProperty(value = "营业部id") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "故障因素: 1-人为因素 2-市政因素") |
| | | @TableField("fault_cause") |
| | | private Integer faultCause; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "租赁状态 1=待出租 2=已出租 3=维修中") |
| | | @TableField("lease_status") |
| | | private String leaseStatus; |
| | | |
| | | @ApiModelProperty(value = "退租状态 1=未退租 2=退租申请中 3=已退租") |
| | | @TableField("rental_return_status") |
| | | private String rentalReturnStatus; |
| | | |
| | | @ApiModelProperty(value = "楼栋") |
| | | @TableField("building") |
| | | private String building; |
| | |
| | | @ApiModelProperty(value = "纬度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | |
| | | @ApiModelProperty(value = "营业部id") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | } |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField(exist = false) |
| | | private Integer viewCount; |
| | | |
| | | @ApiModelProperty(value = "营业部id") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @TableName("t_rental_return_record") |
| | | @ApiModel("退租记录") |
| | | public class TRentalReturnRecord extends BaseModel { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "退租记录id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 租户id |
| | | */ |
| | | @ApiModelProperty(value = "租户id") |
| | | private String tenantId; |
| | | |
| | | /** |
| | | * 房屋id |
| | | */ |
| | | @ApiModelProperty(value = "房屋id") |
| | | private String houseId; |
| | | |
| | | /** |
| | | * 合同id |
| | | */ |
| | | @ApiModelProperty(value = "合同id") |
| | | private String contractId; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String images; |
| | | |
| | | |
| | | /** |
| | | * 退租说明 |
| | | */ |
| | | @ApiModelProperty(value = "退租说明") |
| | | private String reasonForReturn; |
| | | |
| | | /** |
| | | * 审批意见 |
| | | */ |
| | | @ApiModelProperty(value = "审批意见") |
| | | private String auditOpinion; |
| | | |
| | | /** |
| | | * 审批时间 |
| | | */ |
| | | @ApiModelProperty(value = "审批时间") |
| | | private LocalDateTime auditTime; |
| | | |
| | | /** |
| | | * 审批状态: 1-待审核 2-审核通过 3-审核驳回 |
| | | */ |
| | | @ApiModelProperty(value = "审批状态: 1-待审核 2-审核通过 3-审核驳回") |
| | | private Integer auditStatus; |
| | | |
| | | /** |
| | | * 审批人id |
| | | */ |
| | | @ApiModelProperty(value = "审批人id") |
| | | private Long auditUserId; |
| | | |
| | | /** |
| | | * 管理后台删除标识 |
| | | */ |
| | | @ApiModelProperty(value = "管理后台删除标识") |
| | | private Boolean isAdminDelete; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("退租审核查询") |
| | | public class RentalReturnAuditQuery { |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 审核结果:2-审核通过 3-审核驳回 |
| | | */ |
| | | @ApiModelProperty(value = "审核结果:2-审核通过 3-审核驳回") |
| | | private Integer auditResult; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | @ApiModelProperty(value = "审核意见") |
| | | private String auditOpinion; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("退租记录查询") |
| | | public class RentalReturnRecordQuery { |
| | | /** |
| | | * 申请开始日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "申请开始日期") |
| | | private LocalDateTime startDate; |
| | | |
| | | /** |
| | | * 申请结束日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "申请结束日期") |
| | | private LocalDateTime endDate; |
| | | |
| | | /** |
| | | * 房屋名称 |
| | | */ |
| | | @ApiModelProperty(value = "房屋名称") |
| | | private String houseName; |
| | | |
| | | /** |
| | | * 合同编号 |
| | | */ |
| | | @ApiModelProperty(value = "合同编号") |
| | | private String contractNumber; |
| | | |
| | | /** |
| | | * 提交人 |
| | | */ |
| | | @ApiModelProperty(value = "提交人") |
| | | private String submitter; |
| | | |
| | | private String businessDeptId; |
| | | |
| | | private Boolean isAdminDelete; |
| | | } |
| | |
| | | @ApiModelProperty(value = "状态 0=正常 1=停用") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "营业部id",hidden = true) |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "验收结果 1=合格 0=不合格") |
| | | private Boolean checkResult; |
| | | |
| | | @ApiModelProperty(value = "营业部id",hidden = true) |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @ApiModelProperty(value = "处理人") |
| | | private String handlePerson; |
| | | |
| | | @ApiModelProperty(value = "营业部id", hidden = true) |
| | | private String businessDeptId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "租赁状态 1=待出租 2=已出租 3=维修中") |
| | | private String leaseStatus; |
| | | |
| | | @ApiModelProperty(value = "所属营业部", hidden = true) |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "营业部id") |
| | | private String businessDeptId; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.system.model.TBusinessDept; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 营业部 服务类 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2025-03-24 |
| | | */ |
| | | public interface ITBusinessDeptService extends IService<TBusinessDept> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TRentalReturnRecord; |
| | | import com.ruoyi.system.query.RentalReturnAuditQuery; |
| | | import com.ruoyi.system.query.RentalReturnRecordQuery; |
| | | import com.ruoyi.system.vo.RentalRetureApplyVO; |
| | | import com.ruoyi.system.vo.RentalReturnRecordVO; |
| | | |
| | | public interface ITRentalReturnRecordService extends IService<TRentalReturnRecord> { |
| | | |
| | | IPage<RentalReturnRecordVO> queryRentalReturnRecordList(Page<RentalReturnRecordVO> page, RentalReturnRecordQuery query); |
| | | |
| | | RentalReturnRecordVO queryRentalReturnRecordById(String id); |
| | | |
| | | void apply(RentalRetureApplyVO rentalReture,String tenantId); |
| | | |
| | | void audit(RentalReturnAuditQuery returnAuditQuery, Long userId, String userName); |
| | | } |
| | |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.THouse; |
| | | import com.ruoyi.system.service.ITStreetService; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.ruoyi.system.service.TContractService; |
| | | import com.ruoyi.system.service.THouseService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Calendar; |
| | | import java.util.ArrayList; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | private final THouseService tHouseService; |
| | | private final TContractService tContractService; |
| | | private final TBillService tBillService; |
| | | private final ITStreetService tStreetService; |
| | | /** |
| | | * 获取顶部统计数据 |
| | | * @return |
| | |
| | | ScreenTopStaticsDataVO vo = new ScreenTopStaticsDataVO(); |
| | | //房屋总面积 |
| | | List<THouse> houseList = tHouseService.list(); |
| | | Double totalArea = houseList.stream().map(item -> Double.parseDouble(item.getHouseArea())).reduce(0D, Double::sum); |
| | | Double totalArea = houseList.stream() |
| | | .map(item -> Double.parseDouble(item.getHouseArea())) |
| | | .reduce(0D, Double::sum); |
| | | vo.setHouseTotalArea(totalArea); |
| | | //已出租面积 |
| | | Double totalRentedArea = houseList.stream().filter(item -> !item.getLeaseStatus().equals("1")) |
| | | .map(item -> Double.parseDouble(item.getHouseArea())).reduce(0D, Double::sum); |
| | | Double totalRentedArea = houseList.stream() |
| | | .filter(item -> !item.getLeaseStatus().equals("1")) |
| | | .map(item -> Double.parseDouble(item.getHouseArea())) |
| | | .reduce(0D, Double::sum); |
| | | vo.setHouseRentedArea(totalRentedArea); |
| | | //总计应收租金 |
| | | List<TBill> billList = tBillService.list(); |
| | | BigDecimal totalReceivableRent = billList.stream().filter(item -> !item.getPayFeesStatus().equals("5")) |
| | | .map(TBill::getPayableFeesMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalReceivableRent = billList.stream() |
| | | .filter(item -> !item.getPayFeesStatus().equals("5")) |
| | | .map(TBill::getPayableFeesMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); |
| | | vo.setTotalReceivableRent(totalReceivableRent); |
| | | //总计已收租金 |
| | | BigDecimal totalReceivedRent = billList.stream().map(TBill::getPayFeesMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalReceivedRent = billList.stream() |
| | | .map(TBill::getPayFeesMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); |
| | | vo.setTotalReceivedRent(totalReceivedRent); |
| | | //本月新增租户数 |
| | | Integer newTenantCount = tContractService.getCurrentMonthRentCount(); |
| | | vo.setNewTenantCount(newTenantCount); |
| | | //总计租户数 系统租户列表里有生效合同绑定的租户总数。 |
| | | Long count = tContractService.lambdaQuery().in(TContract::getStatus, "4", "5", "6", "7", "8", "9").groupBy(TContract::getTenantId).count(); |
| | | vo.setTotalTenantCount(count.intValue()); |
| | | List<TContract> tContracts = tContractService.lambdaQuery() |
| | | .in(TContract::getStatus, "4", "5", "6", "7", "8", "9") |
| | | .list(); |
| | | long count = tContracts.stream() |
| | | .map(TContract::getTenantId) |
| | | .distinct() |
| | | .count(); |
| | | vo.setTotalTenantCount((int) count); |
| | | Map<String, Date> quarterDate = DateUtils.getQuarterDate(new Date()); |
| | | Date first = quarterDate.get("first"); |
| | | Date last = quarterDate.get("last"); |
| | | List<TBill> currentQuarterBillList = tBillService.lambdaQuery().between(TBill::getPayableFeesTime, first, last).list(); |
| | | List<TBill> currentQuarterBillList = tBillService.lambdaQuery() |
| | | .between(TBill::getPayableFeesTime, first, last) |
| | | .list(); |
| | | //本季度已交租金 |
| | | BigDecimal totalRentPaid = currentQuarterBillList.stream().map(TBill::getPayFeesMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalRentPaid = currentQuarterBillList.stream() |
| | | .map(TBill::getPayFeesMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); |
| | | vo.setTotalRentPaid(totalRentPaid); |
| | | //本季度应交租金 |
| | | BigDecimal totalRentShould = currentQuarterBillList.stream().filter(item -> !item.getPayFeesStatus().equals("5")) |
| | | .map(TBill::getPayableFeesMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalRentShould = currentQuarterBillList.stream() |
| | | .filter(item -> !item.getPayFeesStatus().equals("5")) |
| | | .map(TBill::getPayableFeesMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); |
| | | vo.setTotalRentShould(totalRentShould); |
| | | //本季度欠费 |
| | | BigDecimal totalRentOwe = currentQuarterBillList.stream() |
| | | .map(TBill::getOutstandingMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); |
| | | vo.setTotalRentOwe(totalRentOwe); |
| | | //总计欠费 |
| | | List<TBill> allBillList = tBillService.lambdaQuery().le(TBill::getPayableFeesTime, last).list(); |
| | | BigDecimal totalRentOweAll = allBillList.stream() |
| | | .map(TBill::getOutstandingMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); |
| | | vo.setTotalRentOweAll(totalRentOweAll); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | |
| | | // 获取当前日期 |
| | | Date currentDate = new Date(); |
| | | List<String> quarterLabels = new ArrayList<>(); |
| | | List<BigDecimal> incomeData = new ArrayList<>(); |
| | | List<String> quarterLabels = new ArrayList<>(); // 季度标签列表 |
| | | List<BigDecimal> incomeData = new ArrayList<>(); //收入数据列表 |
| | | List<BigDecimal> outstandingData = new ArrayList<>(); // 欠费数据列表 |
| | | |
| | | // 获取最近7个季度的数据 |
| | | for (int i = 6; i >= 0; i--) { |
| | |
| | | Map<String, Date> quarterDate = DateUtils.getQuarterDate(targetDate); |
| | | Date quarterStart = quarterDate.get("first"); |
| | | Date quarterEnd = quarterDate.get("last"); |
| | | |
| | | // 获取该季度的账单数据并计算总和 |
| | | BigDecimal quarterIncome = tBillService.lambdaQuery() |
| | | .between(TBill::getPayableFeesTime, quarterStart, quarterEnd) |
| | | .list() |
| | | .stream() |
| | | .map(TBill::getPayFeesMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | |
| | | // 获取该季度的账单数据 |
| | | List<TBill> quarterBills = tBillService.lambdaQuery() |
| | | .between(TBill::getPayableFeesTime, quarterStart, quarterEnd) |
| | | .list(); |
| | | |
| | | // 计算季度租金收入总和 |
| | | BigDecimal quarterIncome = quarterBills.stream() |
| | | .map(TBill::getPayFeesMoney) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); |
| | | |
| | | // 计算季度欠费总和 |
| | | BigDecimal quarterOutstanding = quarterBills.stream() |
| | | .map(TBill::getOutstandingMoney) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); |
| | | |
| | | // 生成季度标签 (格式: YY-MM月) |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(quarterEnd); |
| | | String label = String.format("%02d-%d月", |
| | | cal.get(Calendar.YEAR) % 100, |
| | | cal.get(Calendar.MONTH) + 1); |
| | | |
| | | cal.get(Calendar.YEAR) % 100, |
| | | cal.get(Calendar.MONTH) + 1); |
| | | |
| | | quarterLabels.add(label); |
| | | incomeData.add(quarterIncome); |
| | | outstandingData.add(quarterOutstanding); // 添加欠费数据 |
| | | } |
| | | |
| | | vo.setQuarters(quarterLabels); |
| | | vo.setIncomeData(incomeData); |
| | | vo.setOutstandingData(outstandingData); // 设置欠费数据到VO |
| | | return vo; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.bo.ProcessTaskListBO; |
| | | import com.ruoyi.system.mapper.StateTaskCenterMapper; |
| | | import com.ruoyi.system.model.StateTaskCenter; |
| | | import com.ruoyi.system.model.TFaultAreaDic; |
| | | import com.ruoyi.system.service.StateTaskCenterService; |
| | | import com.ruoyi.system.vo.ProcessTaskListVO; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TDeptToUser; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.TDeptToUserService; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.mapper.TDeptToUserMapper; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TDeptToUser; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TDeptToUserService; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.validation.Validator; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 用户 业务层处理 |
| | |
| | | @Override |
| | | public PageInfo<SysUserVO> pageList(SysUserQuery query) { |
| | | PageInfo<SysUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | List<SysUserVO> list = userMapper.pageList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.system.model.TBusinessDept; |
| | | import com.ruoyi.system.mapper.TBusinessDeptMapper; |
| | | import com.ruoyi.system.service.ITBusinessDeptService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 营业部 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2025-03-24 |
| | | */ |
| | | @Service |
| | | public class TBusinessDeptServiceImpl extends ServiceImpl<TBusinessDeptMapper, TBusinessDept> implements ITBusinessDeptService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.mapper.TCheckAcceptRecordMapper; |
| | | import com.ruoyi.system.mapper.TContractMapper; |
| | | import com.ruoyi.system.mapper.THouseMapper; |
| | |
| | | import com.ruoyi.system.query.TCheckAcceptRecordAppletQuery; |
| | | import com.ruoyi.system.query.TCheckAcceptRecordQuery; |
| | | import com.ruoyi.system.service.TCheckAcceptRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import com.ruoyi.system.vo.TCheckAcceptRecordVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Override |
| | | public PageInfo<TCheckAcceptRecordVO> pageList(TCheckAcceptRecordQuery query) { |
| | | PageInfo<TCheckAcceptRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | List<TCheckAcceptRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | list.forEach(item -> { |
| | | item.setCleanSituation(StringUtils.hasLength(item.getCleanSituation()) ?(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,item.getCleanSituation())):""); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.ProcessCategoryEnum; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.bo.ProcessStartBO; |
| | | import com.ruoyi.system.dto.SignContractDTO; |
| | |
| | | @Override |
| | | public PageInfo<TContract> contractList(TContractQuery query) { |
| | | PageInfo<TContract> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TContract> list = this.baseMapper.contractList(query,pageInfo); |
| | | //获取当前登录用户信息 |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | List<TContract> list = this.baseMapper.contractList(query,pageInfo,businessDeptId); |
| | | for (TContract tContract : list) { |
| | | tContract.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,tContract.getPayType())); |
| | | tContract.setStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS,tContract.getStatus())); |
| | |
| | | PageInfo<TContract> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TContract> list = this.baseMapper.contractAppletList(query,pageInfo); |
| | | for (TContract tContract : list) { |
| | | tContract.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,tContract.getPayType())); |
| | | tContract.setPayType( |
| | | DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE, tContract.getPayType()) |
| | | ); |
| | | tContract.setStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS,tContract.getStatus())); |
| | | FlwHisTask flwHisTask = flwHisTaskMapper.selectOne(new LambdaQueryWrapper<FlwHisTask>() |
| | | .like(FlwHisTask::getVariable, tContract.getId()) |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.mapper.TFaultRepairMessageMapper; |
| | | import com.ruoyi.system.model.TFaultRepairMessage; |
| | | import com.ruoyi.system.query.TFaultRepairMessageAppletQuery; |
| | | import com.ruoyi.system.query.TFaultRepairMessageQuery; |
| | | import com.ruoyi.system.service.TFaultRepairMessageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.SysOperLogVO; |
| | | import com.ruoyi.system.vo.TFaultRepairMessageVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Override |
| | | public PageInfo<TFaultRepairMessageVO> pageList(TFaultRepairMessageQuery query) { |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | PageInfo<TFaultRepairMessageVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TFaultRepairMessageVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TContractMapper; |
| | | import com.ruoyi.system.mapper.THouseMapper; |
| | |
| | | private TContractMapper contractMapper; |
| | | @Override |
| | | public PageInfo<THouse> houseList(THouseQuery query) { |
| | | //查询当前登录用户所属部门 |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | PageInfo<THouse> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<THouse> list = this.baseMapper.houseList(query,pageInfo); |
| | | List<TContract> tContracts = contractMapper.selectList(new LambdaQueryWrapper<TContract>() |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.enums.ProcessCategoryEnum; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.bo.ProcessStartBO; |
| | | import com.ruoyi.system.mapper.TRentalReturnRecordMapper; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.THouse; |
| | | import com.ruoyi.system.model.TRentalReturnRecord; |
| | | import com.ruoyi.system.query.RentalReturnAuditQuery; |
| | | import com.ruoyi.system.query.RentalReturnRecordQuery; |
| | | import com.ruoyi.system.service.ITRentalReturnRecordService; |
| | | import com.ruoyi.system.service.StateProcessTemplateService; |
| | | import com.ruoyi.system.service.TContractService; |
| | | import com.ruoyi.system.service.THouseService; |
| | | import com.ruoyi.system.vo.RentalRetureApplyVO; |
| | | import com.ruoyi.system.vo.RentalReturnRecordVO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor(onConstructor_ = @__(@Lazy)) |
| | | public class TRentalReturnRecordServiceImpl extends ServiceImpl<TRentalReturnRecordMapper, TRentalReturnRecord> |
| | | implements ITRentalReturnRecordService { |
| | | private final TContractService contractService; |
| | | private final StateProcessTemplateService stateProcessTemplateService; |
| | | private final THouseService houseService; |
| | | |
| | | @Override |
| | | public IPage<RentalReturnRecordVO> queryRentalReturnRecordList(Page<RentalReturnRecordVO> page, RentalReturnRecordQuery query) { |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | query.setBusinessDeptId(businessDeptId); |
| | | query.setIsAdminDelete(true); |
| | | return this.baseMapper.queryRentalReturnRecordList(page, query); |
| | | } |
| | | |
| | | @Override |
| | | public RentalReturnRecordVO queryRentalReturnRecordById(String id) { |
| | | return this.baseMapper.queryRentalReturnRecordById(id); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void apply(RentalRetureApplyVO rentalReture,String tenantId) { |
| | | TContract contract = contractService.getById(rentalReture.getContractId()); |
| | | if (contract == null) { |
| | | throw new ServiceException("该房屋暂无合同"); |
| | | } |
| | | |
| | | TRentalReturnRecord tRentalReturnRecord = new TRentalReturnRecord(); |
| | | tRentalReturnRecord.setTenantId(tenantId); |
| | | tRentalReturnRecord.setHouseId(contract.getHouseId()); |
| | | tRentalReturnRecord.setContractId(contract.getId()); |
| | | tRentalReturnRecord.setReasonForReturn(rentalReture.getReasonForReturn()); |
| | | tRentalReturnRecord.setImages(rentalReture.getImages()); |
| | | tRentalReturnRecord.setAuditStatus(1); |
| | | save(tRentalReturnRecord); |
| | | boolean update = houseService.update(new LambdaUpdateWrapper<THouse>() |
| | | .set(THouse::getRentalReturnStatus, "2") |
| | | .eq(THouse::getId, contract.getHouseId())); |
| | | if (!update){ |
| | | throw new ServiceException("更新房屋状态失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void audit(RentalReturnAuditQuery returnAuditQuery, Long userId,String userName) { |
| | | TRentalReturnRecord record = getById(returnAuditQuery.getId()); |
| | | if (record == null){ |
| | | throw new ServiceException("申请记录不存在"); |
| | | } |
| | | if (record.getAuditStatus() != 1){ |
| | | throw new ServiceException("申请记录已审核"); |
| | | } |
| | | |
| | | THouse house = houseService.getById(record.getHouseId()); |
| | | if (returnAuditQuery.getAuditResult() == 2){ |
| | | TContract contract = contractService.getById(record.getContractId()); |
| | | contract.setTerminateRemark(returnAuditQuery.getAuditOpinion()); |
| | | contractService.updateById(contract); |
| | | // 进入合同提前终止审批流程 |
| | | ProcessStartBO processStartBO = new ProcessStartBO(); |
| | | processStartBO.setCategory(ProcessCategoryEnum.CATEGORY3.getValue().toString()); |
| | | processStartBO.setModuleName("房屋退租合同终止审批"); |
| | | processStartBO.setName(contract.getContractName()); |
| | | processStartBO.setRemark(""); |
| | | Map<String, Object> variable = new HashMap<>(); |
| | | variable.put("projectId", record.getContractId()); |
| | | processStartBO.setVariable(variable); |
| | | //开启工作流程 |
| | | stateProcessTemplateService.start(processStartBO); |
| | | house.setRentalReturnStatus("3"); |
| | | houseService.updateById(house); |
| | | }else { |
| | | house.setRentalReturnStatus("1"); |
| | | houseService.updateById(house); |
| | | } |
| | | record.setAuditTime(LocalDateTime.now()); |
| | | record.setAuditStatus(returnAuditQuery.getAuditResult()); |
| | | record.setAuditOpinion(returnAuditQuery.getAuditOpinion()); |
| | | record.setAuditUserId(userId); |
| | | record.setUpdateBy(userName); |
| | | record.setUpdateTime(LocalDateTime.now()); |
| | | updateById(record); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.TTenantDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TContractMapper; |
| | | import com.ruoyi.system.mapper.THouseMapper; |
| | | import com.ruoyi.system.mapper.TTenantMapper; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.THouse; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.query.TBillAppletQuery; |
| | |
| | | import com.ruoyi.system.vo.TBillVO; |
| | | import com.ruoyi.system.vo.TenantVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.token.TokenService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | @Override |
| | | public PageInfo<TenantVO> pageList(TTenantQuery query) { |
| | | PageInfo<TenantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TenantVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | List<TenantVO> list = null; |
| | | if (StringUtils.isBlank(businessDeptId) || "0".equals(businessDeptId)) { |
| | | list = this.baseMapper.pageList(query, pageInfo); |
| | | } else { |
| | | query.setBusinessDeptId(businessDeptId); |
| | | list = this.baseMapper.pageListByBusinessDeptId(query,pageInfo); |
| | | } |
| | | for (TenantVO tenantVO : list) { |
| | | tenantVO.setTenantAttributesName(StringUtils.isNotBlank(tenantVO.getTenantAttributes())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes()):""); |
| | | tenantVO.setTenantTypeName(StringUtils.isNotBlank(tenantVO.getTenantType())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType()):""); |
| | |
| | | @ApiModelProperty(value = "房屋地址") |
| | | private String houseAddress; |
| | | |
| | | @ApiModelProperty(value = "房屋状态 1=待出租 2=已出租 3=维修中") |
| | | @ApiModelProperty(value = "房屋状态 1=待出租 2=已出租 3=维修中 4=欠费") |
| | | private String houseStatus; |
| | | |
| | | @ApiModelProperty(value = "租户") |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.system.model.TBill; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private String propertyRightPerson; |
| | | @ApiModelProperty(value = "房东联系方式") |
| | | private String phone; |
| | | @ApiModelProperty(value = "退租状态 1=未退租 2=退租申请中 3=已退租") |
| | | private String rentalReturnStatus; |
| | | @ApiModelProperty(value = "交租记录") |
| | | private List<PayListVO> payList; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("退租申请") |
| | | public class RentalRetureApplyVO { |
| | | |
| | | |
| | | /** |
| | | * 合同id |
| | | */ |
| | | @ApiModelProperty(value = "合同id") |
| | | private String contractId; |
| | | |
| | | /** |
| | | * 退租说明 |
| | | */ |
| | | @ApiModelProperty(value = "退租说明") |
| | | private String reasonForReturn; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String images; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("退租记录") |
| | | public class RentalReturnRecordVO { |
| | | /** |
| | | * 退租记录id |
| | | */ |
| | | @ApiModelProperty(value = "退租记录id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 提交时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "提交时间") |
| | | private LocalDateTime applicationDate; |
| | | |
| | | /** |
| | | * 房屋名称 |
| | | */ |
| | | @ApiModelProperty(value = "房屋名称") |
| | | private String houseName; |
| | | |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | @ApiModelProperty(value = "房屋地址") |
| | | private String houseAddress; |
| | | |
| | | /** |
| | | * 租赁合同编号 |
| | | */ |
| | | @ApiModelProperty(value = "租赁合同编号") |
| | | private String contractNumber; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String images; |
| | | |
| | | /** |
| | | * 提交人 |
| | | */ |
| | | @ApiModelProperty(value = "提交人") |
| | | private String submitter; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String submitterPhone; |
| | | |
| | | /** |
| | | * 退租说明 |
| | | */ |
| | | @ApiModelProperty(value = "退租说明") |
| | | private String reasonForReturn; |
| | | |
| | | /** |
| | | * 验收状态 |
| | | */ |
| | | @ApiModelProperty(value = "验收状态: 1-待审核 2-审核通过 3-审核驳回") |
| | | private String auditStatus; |
| | | |
| | | /** |
| | | * 提交时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "提交时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 审批意见 |
| | | */ |
| | | @ApiModelProperty(value = "审批意见") |
| | | private String auditOpinion; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("x轴 时间列表") |
| | | private List<String> quarters; |
| | | |
| | | @ApiModelProperty("y轴 收入列表") |
| | | @ApiModelProperty("y轴 收入列表(万元)") |
| | | private List<BigDecimal> incomeData; |
| | | |
| | | @ApiModelProperty("y轴 欠费列表(万元)") |
| | | private List<BigDecimal> outstandingData; |
| | | } |
| | |
| | | @ApiModelProperty("已出租面积") |
| | | private Double houseRentedArea; |
| | | |
| | | @ApiModelProperty("总计应收租金") |
| | | @ApiModelProperty("总计应收租金(万元)") |
| | | private BigDecimal totalReceivableRent; |
| | | |
| | | @ApiModelProperty("总计已收租金") |
| | | @ApiModelProperty("总计已收租金(万元)") |
| | | private BigDecimal totalReceivedRent; |
| | | |
| | | @ApiModelProperty("本月新增租户数") |
| | |
| | | @ApiModelProperty("总计租户数") |
| | | private Integer totalTenantCount; |
| | | |
| | | @ApiModelProperty("本季度已交租金") |
| | | @ApiModelProperty("本季度已交租金(万元)") |
| | | private BigDecimal totalRentPaid; |
| | | |
| | | @ApiModelProperty("本季度应交租金") |
| | | @ApiModelProperty("本季度应交租金(万元)") |
| | | private BigDecimal totalRentShould; |
| | | |
| | | @ApiModelProperty("本季度欠费(万元)") |
| | | private BigDecimal totalRentOwe; |
| | | |
| | | @ApiModelProperty("总计欠费(万元)") |
| | | private BigDecimal totalRentOweAll; |
| | | } |
| | | |
| | |
| | | <result property="remark" column="remark" /> |
| | | <result property="ifBlack" column="ifBlack" /> |
| | | <result property="districtId" column="districtId" /> |
| | | <result property="businessDeptId" column="business_dept_id" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.business_dept_id, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | <select id="selectUserById" parameterType="Long" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId,u.business_dept_id AS businessDeptId, |
| | | ur.role_id AS roleId,sr.role_name AS roleName,u.deptName as deptName |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar,u.disable_remark AS disableRemark, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp,u.operating_time AS operatingTime,u.operating_person AS operatingPerson, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId, |
| | | r.role_id AS roleId, r.role_name AS roleName, r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status,u.deptName as deptName |
| | | r.role_id AS roleId, r.role_name AS roleName, r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status,u.deptName as deptName, |
| | | u.business_dept_id AS businessDeptId |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | |
| | | <foreach collection="query.roleIds" close=")" open="(" item="roleId" separator=","> |
| | | #{roleId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId != '' and query.businessDeptId != 0"> |
| | | AND u.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="businessDeptId != null">business_dept_id,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="districtId != null">#{districtId},</if> |
| | | <if test="businessDeptId != null">#{businessDeptId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="disableRemark != null">disable_remark = #{disableRemark},</if> |
| | | <if test="operatingTime != null">operating_time = #{operatingTime},</if> |
| | | <if test="operatingPerson != null">operating_person = #{operatingPerson},</if> |
| | | <if test="businessDeptId != null">business_dept_id = #{businessDeptId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TBusinessDeptMapper"> |
| | | |
| | | </mapper> |
| | |
| | | AND t.check_time >= #{query.startTime} |
| | | AND t.check_time <= #{query.endTime} |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId != '' and query.businessDeptId != 0"> |
| | | AND c.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | AND t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY t.create_time DESC |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="businessDeptId!=null and businessDeptId !='' and businessDeptId != 0"> |
| | | and t1.business_dept_id = #{businessDeptId} |
| | | </if> |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by t1.create_time desc |
| | |
| | | t.create_by, |
| | | t.update_by, |
| | | t.disabled, |
| | | t.fault_cause, |
| | | i.item_name AS itemName, |
| | | it.type_name AS itemTypeName, |
| | | tnt.resident_name AS residentName |
| | |
| | | LEFT JOIN t_item i ON t.item_id = i.id |
| | | LEFT JOIN t_item_type it ON t.item_type_id = it.id |
| | | LEFT JOIN t_tenant tnt ON t.tenant_id = tnt.id |
| | | LEFT JOIN t_contract tc ON t.contract_id = tc.id |
| | | <where> |
| | | <if test="query.residentName != null and query.residentName != ''"> |
| | | AND tnt.resident_name LIKE CONCAT('%', #{query.residentName}, '%') |
| | |
| | | <if test="query.handlePerson != null and query.handlePerson != ''"> |
| | | AND t.handle_person LIKE CONCAT('%', #{query.handlePerson}, '%') |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId != '' and query.businessDeptId != 0"> |
| | | AND tc.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | AND t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY t.create_time DESC |
| | |
| | | <if test="req.leaseStatus == 1"> |
| | | and (t2.start_time is null) and t1.lease_status = 1 |
| | | </if> |
| | | <if test="req.businessDeptId != null and req.businessDeptId != '' and req.businessDeptId!=0"> |
| | | and t1.business_dept_id = #{req.businessDeptId} |
| | | </if> |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by t1.create_time desc |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TRentalReturnRecordMapper"> |
| | | |
| | | |
| | | <select id="queryRentalReturnRecordList" resultType="com.ruoyi.system.vo.RentalReturnRecordVO"> |
| | | SELECT |
| | | trrr.id, |
| | | trrr.tenant_id, |
| | | trrr.house_id, |
| | | trrr.contract_id, |
| | | trrr.reason_for_return, |
| | | trrr.audit_status, |
| | | trrr.audit_user_id, |
| | | trrr.create_time applicationDate, |
| | | th.house_name, |
| | | th.house_address, |
| | | tc.contract_number, |
| | | tt.resident_name submitter, |
| | | tt.phone submitterPhone |
| | | FROM |
| | | t_rental_return_record trrr |
| | | LEFT JOIN t_house th ON trrr.house_id = th.id |
| | | LEFT JOIN t_contract tc ON trrr.contract_id = tc.id |
| | | LEFT JOIN t_tenant tt ON tt.id = trrr.tenant_id |
| | | <where> |
| | | trrr.disabled = 0 |
| | | <if test="query.startDate != null and query.endDate !=null"> |
| | | AND trrr.create_time BETWEEN #{query.startDate} AND DATE_ADD(#{query.endDate}, INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="query.isAdminDelete != null and query.isAdminDelete"> |
| | | AND trrr.is_admin_delete = 0 |
| | | </if> |
| | | <if test="query.houseName != null and query.houseName != ''"> |
| | | AND th.house_name LIKE CONCAT('%',#{query.houseName},'%') |
| | | </if> |
| | | <if test="query.contractNumber != null and query.contractNumber != ''"> |
| | | AND tc.contract_number LIKE CONCAT('%',#{query.contractNumber},'%') |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId != '' and query.businessDeptId != 0"> |
| | | AND tc.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | <if test="query.submitter != null and query.submitter != ''"> |
| | | AND tt.resident_name LIKE CONCAT('%',#{query.submitter},'%') |
| | | </if> |
| | | </where> |
| | | order by trrr.create_time desc |
| | | </select> |
| | | <select id="queryRentalReturnRecordById" resultType="com.ruoyi.system.vo.RentalReturnRecordVO" |
| | | parameterType="java.lang.String"> |
| | | SELECT |
| | | trrr.id, |
| | | trrr.tenant_id, |
| | | trrr.house_id, |
| | | trrr.contract_id, |
| | | trrr.reason_for_return, |
| | | trrr.audit_status, |
| | | trrr.audit_user_id, |
| | | trrr.images, |
| | | trrr.create_time, |
| | | trrr.audit_opinion, |
| | | th.house_name, |
| | | th.house_address, |
| | | tc.contract_number, |
| | | tt.resident_name submitter, |
| | | tt.phone submitterPhone |
| | | FROM |
| | | t_rental_return_record trrr |
| | | LEFT JOIN t_house th ON trrr.house_id = th.id |
| | | LEFT JOIN t_contract tc ON trrr.contract_id = tc.id |
| | | LEFT JOIN t_tenant tt ON tt.id = trrr.tenant_id |
| | | WHERE trrr.disabled = 0 AND trrr.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | <select id="pageListByBusinessDeptId" resultType="com.ruoyi.system.vo.TenantVO"> |
| | | SELECT * FROM ( |
| | | SELECT tt.id, tt.resident_name, tt.checkIn_time, tt.tenant_attributes, tt.tenant_type, tt.phone, |
| | | tt.id_card, tt.email, |
| | | tt.bank_number, tt.mail_address, tt.create_time, tt.disabled,tt.account |
| | | FROM t_tenant tt |
| | | WHERE EXISTS ( |
| | | SELECT 1 |
| | | FROM t_contract tc |
| | | WHERE tc.tenant_id = tt.id AND tc.business_dept_id = #{query.businessDeptId} |
| | | ) |
| | | ) AS te |
| | | <where> |
| | | <if test="query.residentName != null and query.residentName != ''"> |
| | | AND te.resident_name LIKE concat('%',#{query.residentName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | AND te.phone LIKE concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND te.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY te.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |