| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.SignContractDTO; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.query.TContractQuery; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.ruoyi.system.service.TContractRentTypeService; |
| | | import com.ruoyi.system.service.TContractService; |
| | | import com.ruoyi.system.service.THouseService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @RestController |
| | | @RequestMapping("/t-contract") |
| | | public class TContractController { |
| | | |
| | | @Autowired |
| | | private TContractService contractService; |
| | | @Autowired |
| | | private TContractRentTypeService contractRentTypeService; |
| | | @Autowired |
| | | private THouseService houseService; |
| | | @Autowired |
| | | private TBillService billService; |
| | | @ApiOperation(value = "签订合同") |
| | | @PostMapping(value = "/signContract") |
| | | public R signContract(@RequestBody SignContractDTO dto) { |
| | | TContract contract = contractService.getById(dto.getId()); |
| | | if (contract==null)return R.fail("合同不存在"); |
| | | if (contract.getStatus()==4)return R.fail("该合同已签订"); |
| | | contract.setSignature(dto.getSignature()); |
| | | contract.setStatus(2); |
| | | contractService.updateById(contract); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "我的合同") |
| | | @PostMapping(value = "/contractList") |
| | | public R<PageInfo<TContract>> contractList(@RequestBody TContractQuery query) { |
| | | return R.ok(contractService.contractList(query)); |
| | | } |
| | | } |
| | | |