| | |
| | | */ |
| | | package me.zhengjie.modules.contract.rest; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.contract.domain.Contract; |
| | | import me.zhengjie.modules.contract.service.ContractService; |
| | | import me.zhengjie.modules.contract.service.dto.ContractQueryCriteria; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import org.springframework.data.domain.Pageable; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @GetMapping(value = "/download/old") |
| | | @PreAuthorize("@el.check('contract:download')") |
| | | public void exportContract(HttpServletResponse response, ContractQueryCriteria criteria) throws IOException { |
| | | criteria.setCompanys(SecurityUtils.getCompanyIds()); |
| | | contractService.download(contractService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @Log("导出数据(新)") |
| | | @ApiOperation("导出数据(新)") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('contract:download')") |
| | | public void exportContractNew(HttpServletResponse response, ContractQueryCriteria criteria) throws IOException { |
| | | contractService.download(criteria, response); |
| | | } |
| | | |
| | | @GetMapping |
| | |
| | | return new ResponseEntity<>(contractService.receivePaymentTotalMoney(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping(value = "/addWarningStatus") |
| | | @Log("添加预警") |
| | | @ApiOperation("添加预警") |
| | | @PreAuthorize("@el.check('contract:edit')") |
| | | public ResponseEntity<Object> addWarningStatus(@RequestBody Long[] ids) { |
| | | contractService.addWarningStatus(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping(value = "/upload") |
| | | @Log("批量导入合同详情") |
| | | @ApiOperation("批量导入合同详情") |
| | |
| | | public ResponseEntity<Object> batchUpload(@RequestParam MultipartFile file){ |
| | | return new ResponseEntity<>(contractService.batchUpload(file), HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/downloadContractAttachments") |
| | | @PreAuthorize("@el.check('contract:download')") |
| | | public void downloadContractAttachments(HttpServletResponse response, Long id) { |
| | | contractService.downloadContractAttachments(id, response); |
| | | } |
| | | |
| | | @Log("统计合同信息") |
| | | @ApiOperation("统计合同信息") |
| | | @GetMapping(value = "/statistics/{type}") |
| | | @PreAuthorize("@el.check('contract:list')") |
| | | public ResponseEntity<Object> contractStatistics(ContractQueryCriteria criteria, @PathVariable Integer type){ |
| | | return new ResponseEntity<>(contractService.contractStatistics(criteria, type), HttpStatus.OK); |
| | | } |
| | | } |