| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContracQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.ContractAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ContractUpdateDTO; |
| | | import com.by4cloud.platformx.business.dto.DelayOutApprovalDTO; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param contract 合同管理 |
| | | * @param queryDTO 合同管理 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_contract_view')" ) |
| | | public R getContractPage(@ParameterObject Page page, @ParameterObject Contract contract) { |
| | | public R getContractPage(@ParameterObject Page page, @ParameterObject ContracQueryDTO queryDTO) { |
| | | LambdaQueryWrapper<Contract> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StringUtils.isNotBlank(contract.getContractName()),Contract::getContractName,contract.getContractName()); |
| | | wrapper.like(StringUtils.isNotBlank(contract.getPartyA()),Contract::getPartyA,contract.getPartyA()); |
| | | wrapper.eq(ObjUtil.isNotNull(contract.getContractStatus()),Contract::getContractStatus,contract.getContractStatus()); |
| | | wrapper.orderByDesc(BaseModel::getCreateTime); |
| | | return R.ok(contractService.pageByScope(page, wrapper)); |
| | | // wrapper.like(StringUtils.isNotBlank(contract.getContractName()),Contract::getContractName,contract.getContractName()); |
| | | // wrapper.like(StringUtils.isNotBlank(contract.getPartyA()),Contract::getPartyA,contract.getPartyA()); |
| | | // wrapper.eq(ObjUtil.isNotNull(contract.getContractStatus()),Contract::getContractStatus,contract.getContractStatus()); |
| | | // wrapper.orderByDesc(Contract::getCreateTime); |
| | | return R.ok(contractService.pageScope(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | @GetMapping("/listByBusId/{busId}" ) |
| | | public R listByBusId(@PathVariable("busId" ) Long busId) { |
| | | return R.ok(contractService.listByScope(Wrappers.<Contract>lambdaQuery().eq(Contract::getPartyAId,busId) |
| | | .gt(Contract::getBillingAmout,new BigDecimal("0")))); |
| | | .eq(Contract::getPartyBId,SecurityUtils.getUser().getCompId()) |
| | | .gt(Contract::getBillingAmout,new BigDecimal("0")) |
| | | .apply("paid_amount < billing_amout"))); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void exportContractYMJJGCLWord(@PathVariable("id" ) Long id, HttpServletResponse response) { |
| | | contractService.exportContractYMJJGCLWord(id,response); |
| | | } |
| | | |
| | | /** |
| | | * 根据模版生成word一煤机工业品买卖合同 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "根据模版生成word合同" , description = "根据模版生成word合同" ) |
| | | @GetMapping("/exportContractYMJGYPMMWord/{id}" ) |
| | | public void exportContractYMJGYPMMWord(@PathVariable("id" ) Long id, HttpServletResponse response) { |
| | | contractService.exportContractYMJGYPMMWord(id,response); |
| | | } |
| | | |
| | | /** |
| | | * 根据模版生成word一煤机工矿产品买卖合同 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "根据模版生成word合同" , description = "根据模版生成word合同" ) |
| | | @GetMapping("/exportContractYMJGKCPMMWord/{id}" ) |
| | | public void exportContractYMJGKCPMMWord(@PathVariable("id" ) Long id, HttpServletResponse response) { |
| | | contractService.exportContractYMJGKCPMMWord(id,response); |
| | | } |
| | | |
| | | /** |
| | | * 根据模版生成word一煤机采购合同 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "根据模版生成word合同" , description = "根据模版生成word合同" ) |
| | | @GetMapping("/exportContractYMJCGWord/{id}" ) |
| | | public void exportContractYMJCGWord(@PathVariable("id" ) Long id, HttpServletResponse response) { |
| | | contractService.exportContractYMJCGWord(id,response); |
| | | } |
| | | |
| | | /** |
| | | * 延期出货审批 |
| | | */ |
| | | |
| | | @PostMapping("/delayOutApproval") |
| | | public R delayOutApproval(@RequestBody DelayOutApprovalDTO dto) { |
| | | return contractService.delayOutApproval(dto); |
| | | } |
| | | |
| | | } |