| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private TCheckAcceptRecordService checkAcceptRecordService; |
| | | @Autowired |
| | | private TTenantService tenantService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private TContractRentTypeService contractRentTypeService; |
| | | /** |
| | | * 获取轮播图管理列表 |
| | | */ |
| | |
| | | return R.ok(myToDoVO); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "租户-当前在租房源") |
| | | @PostMapping(value = "/tenant/myHouse") |
| | | public R<List<MyHouseVO>> myHouse() { |
| | |
| | | myToDoVO.setHouseAddress(tHouse.getHouseAddress()); |
| | | myToDoVO.setMonthRent(contract.getMonthRent()); |
| | | myToDoVO.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE, contract.getPayType())); |
| | | myToDoVO.setMonth(bill.getPayFeesTime() == null ? bill.getPayableFeesTime().getMonth() + "月" : bill.getPayFeesTime().getMonth() + "月"); |
| | | myToDoVO.setMonth(bill.getPayFeesTime() == null ? bill.getPayableFeesTime().getMonth().getValue() + "月" : bill.getPayFeesTime().getMonth().getValue() + "月"); |
| | | myToDoVO.setHouseArea(tHouse.getHouseArea()); |
| | | myToDoVO.setHouseType(tHouse.getHouseType()); |
| | | myToDoVO.setEndTime(DateUtils.localDateTimeToStringYear(contract.getEndTime())); |
| | |
| | | myToDoVO.setHouseAddress(tHouse.getHouseAddress()); |
| | | myToDoVO.setMonthRent(contract.getMonthRent()); |
| | | myToDoVO.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE, contract.getPayType())); |
| | | myToDoVO.setMonth(bill.getPayFeesTime() == null ? bill.getPayableFeesTime().getMonth() + "月" : bill.getPayFeesTime().getMonth() + "月"); |
| | | myToDoVO.setMonth(bill.getPayFeesTime() == null ? bill.getPayableFeesTime().getMonth().getValue() + "月" : bill.getPayFeesTime().getMonth().getValue() + "月"); |
| | | myToDoVO.setHouseArea(tHouse.getHouseArea()); |
| | | myToDoVO.setHouseType(tHouse.getHouseType()); |
| | | myToDoVO.setEndTime(DateUtils.localDateTimeToStringYear(contract.getEndTime())); |
| | |
| | | * 获取报修管理列表 |
| | | */ |
| | | @ApiOperation(value = "管理员-房屋维修分页列表") |
| | | @PostMapping(value = "/houstPageList") |
| | | @PostMapping(value = "/housePageList") |
| | | public R<PageInfo<TFaultRepairMessageVO>> pageList(@RequestBody TFaultRepairMessageAppletQuery query) { |
| | | return R.ok(tFaultRepairMessageService.pageListApplet(query)); |
| | | } |
| | |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TenantVO>> pageList(@RequestBody TTenantAppletQuery query) { |
| | | return R.ok(tenantService.pageListApplet(query)); |
| | | } |
| | | /** |
| | | * 获取租户管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取租户详情") |
| | | @GetMapping(value = "/getTenantDetailById") |
| | | public R<TTenant> getTenantDetailById(@RequestParam String id) { |
| | | return R.ok(tenantService.getById(id)); |
| | | } |
| | | /** |
| | | * 租户详情-租房信息 |
| | |
| | | TContract contract = contractService.getById(bill.getContractId()); |
| | | THouse tHouse = houseService.getById(contract.getHouseId()); |
| | | res.setHouse(tHouse); |
| | | res.setConcatStartTime(contract.getStartTime()); |
| | | res.setConcatEndTime(contract.getEndTime()); |
| | | res.setPartyOnePhone(contract.getPartyOnePhone()); |
| | | res.setPartyOnePerson(contract.getPartyTwoPerson()); |
| | | res.setMonthRent(bill.getPayableFeesMoney()); |
| | | res.setPayType(contract.getPayType()); |
| | | return R.ok(res); |
| | | } |
| | | @ApiOperation(value = "管理员-我的审批分页列表") |
| | | @PostMapping("/listExamine") |
| | | public R examineList(@RequestBody TExamineAppletQuery dto){ |
| | | public R<PageInfo<ExamineVO>> examineList(@RequestBody TExamineAppletQuery dto){ |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (loginUser==null){ |
| | | return R.fail(401,"登录失效"); |
| | | } |
| | | SysUser sysUser = sysUserService.selectUserById(loginUser.getUserId()); |
| | | dto.setUserName(sysUser.getUserName()); |
| | | PageInfo<ExamineVO> pageInfo = tenantService.examineList(dto); |
| | | return R.ok(pageInfo); |
| | | } |
| | | @ApiOperation(value = "管理员-审批详情") |
| | | @GetMapping("/examineDetail") |
| | | public R<TContractVO> examineDetail(@RequestParam String id){ |
| | | TContractVO res = new TContractVO(); |
| | | TContract contract = contractService.getById(id); |
| | | BeanUtils.copyProperties(contract,res); |
| | | res.setPayType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_PAY_TYPE,res.getPayType())); |
| | | res.setStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CONTRACT_STATUS,res.getStatus())); |
| | | TContractRentType contractRentType = contractRentTypeService.lambdaQuery().eq(TContractRentType::getContractId, id).one(); |
| | | if (contractRentType!=null){ |
| | | BeanUtils.copyProperties(contractRentType,res); |
| | | } |
| | | TContract oldContract = contractService.getOne(new LambdaQueryWrapper<TContract>() |
| | | .eq(TContract::getHouseId,contract.getHouseId()) |
| | | .eq(TContract::getStatus, 4) |
| | | .le(TContract::getStartTime, LocalDateTime.now()) |
| | | .ge(TContract::getEndTime, LocalDateTime.now())); |
| | | THouse house = houseService.getById(contract.getHouseId()); |
| | | if (oldContract!=null){ |
| | | house.setTenantType(oldContract.getPayType()); |
| | | } |
| | | res.setHouse(house); |
| | | List<TBill> list = billService.lambdaQuery() |
| | | .eq(TBill::getContractId, id) |
| | | .in(TBill::getPayFeesStatus, Arrays.asList("1,4")) |
| | | .list(); |
| | | BigDecimal payMoney = new BigDecimal("0"); |
| | | for (TBill tBill : list) { |
| | | payMoney = payMoney.add(tBill.getPayFeesMoney()).add(tBill.getPayableFeesPenalty()); |
| | | } |
| | | TCheckAcceptRecord tCheckAcceptRecord = checkAcceptRecordService.lambdaQuery().eq(TCheckAcceptRecord::getContractId, id).one(); |
| | | res.setCheckResult(Objects.nonNull(tCheckAcceptRecord)?tCheckAcceptRecord.getCheckResult():false); |
| | | res.setPayMoney(payMoney); |
| | | |
| | | return R.ok(); |
| | | return R.ok(res); |
| | | } |
| | | @ApiOperation(value = "管理员-我的审批-撤销") |
| | | @GetMapping("/cancel") |