| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.device.entity.Contract; |
| | | import com.by4cloud.platformx.device.entity.PurchaseTendrOrderEntity; |
| | | import com.by4cloud.platformx.device.entity.PurchaseWinningLetterEntity; |
| | | import com.by4cloud.platformx.device.constant.MaxSizeContant; |
| | | import com.by4cloud.platformx.device.dto.PurchaseWinningLetterQueryDTO; |
| | | import com.by4cloud.platformx.device.entity.*; |
| | | import com.by4cloud.platformx.device.service.JcMaxSizeService; |
| | | import com.by4cloud.platformx.device.service.PurchaseWinningLetterService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; |
| | |
| | | public class PurchaseWinningLetterController { |
| | | |
| | | private final PurchaseWinningLetterService purchaseWinningLetterService; |
| | | private final JcMaxSizeService maxSizeService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param purchaseWinningLetter 中标通知书 |
| | | * @param queryDTO 中标通知书 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('device_purchaseWinningLetter_view')" ) |
| | | public R getPurchaseWinningLetterPage(@ParameterObject Page page, @ParameterObject PurchaseWinningLetterEntity purchaseWinningLetter) { |
| | | LambdaQueryWrapper<PurchaseWinningLetterEntity> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StringUtils.isNotEmpty(purchaseWinningLetter.getPurchasePlanCode()), PurchaseWinningLetterEntity::getPurchasePlanCode,purchaseWinningLetter.getPurchasePlanCode()); |
| | | wrapper.like(StringUtils.isNotEmpty(purchaseWinningLetter.getWinningCode()), PurchaseWinningLetterEntity::getWinningCode,purchaseWinningLetter.getWinningCode()); |
| | | wrapper.orderBy(true,false, PurchaseWinningLetterEntity::getCreateTime); |
| | | return R.ok(purchaseWinningLetterService.page(page, wrapper)); |
| | | public R getPurchaseWinningLetterPage(@ParameterObject Page page, PurchaseWinningLetterQueryDTO queryDTO) { |
| | | return R.ok(purchaseWinningLetterService.pageNew(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping |
| | | @PreAuthorize("@pms.hasPermission('device_purchaseWinningLetter_add')" ) |
| | | public R save(@RequestBody PurchaseWinningLetterEntity purchaseWinningLetter) { |
| | | return R.ok(purchaseWinningLetterService.save(purchaseWinningLetter)); |
| | | purchaseWinningLetter.setWinningCode(maxSizeService.nextNo(MaxSizeContant.WINNING_CODE)); |
| | | return purchaseWinningLetterService.saveNew(purchaseWinningLetter); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<PurchaseWinningLetterEntity> export(PurchaseWinningLetterEntity purchaseWinningLetter,Long[] ids) { |
| | | return purchaseWinningLetterService.list(Wrappers.lambdaQuery(purchaseWinningLetter).in(ArrayUtil.isNotEmpty(ids), PurchaseWinningLetterEntity::getId, ids)); |
| | | } |
| | | |
| | | /** |
| | | * 获取下拉列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDropdownnList") |
| | | public R<List<PurchaseWinningLetterEntity>> getDropdownnList() { |
| | | return R.ok(purchaseWinningLetterService.list()); |
| | | } |
| | | |
| | | /** |
| | | * 根据验收查询设备下拉 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDropdownnById/{id}") |
| | | public R<List<Device>> getDropdownnByWinningId(@PathVariable("id")Long id) { |
| | | return R.ok(purchaseWinningLetterService.getDropdownnByWinningId(id)); |
| | | } |
| | | } |