| | |
| | | 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.constant.MaxSizeContant; |
| | | import com.by4cloud.platformx.device.entity.DeviceDemandPlan; |
| | | import com.by4cloud.platformx.device.service.DeviceDemandPlanService; |
| | | import com.by4cloud.platformx.device.service.JcMaxSizeService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | |
| | | public class DeviceDemandPlanController { |
| | | |
| | | private final DeviceDemandPlanService deviceDemandPlanService; |
| | | private final JcMaxSizeService maxSizeService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | * @param deviceDemandPlan 设备需求计划主表 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @Operation(summary = "本单位分页查询" , description = "本单位分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_view')" ) |
| | | public R getDeviceDemandPlanPage(@ParameterObject Page page, @ParameterObject DeviceDemandPlan deviceDemandPlan) { |
| | | LambdaQueryWrapper<DeviceDemandPlan> wrapper = Wrappers.lambdaQuery(); |
| | | return R.ok(deviceDemandPlanService.page(page, wrapper)); |
| | | wrapper.eq(deviceDemandPlan.getDeclareCompId() !=null,DeviceDemandPlan::getDeclareCompId,deviceDemandPlan.getDeclareCompId()); |
| | | wrapper.eq(deviceDemandPlan.getReleasePerson() !=null,DeviceDemandPlan::getReleasePerson,deviceDemandPlan.getReleasePerson()); |
| | | wrapper.eq(deviceDemandPlan.getYear() !=null,DeviceDemandPlan::getYear,deviceDemandPlan.getYear()); |
| | | return R.ok(deviceDemandPlanService.pageByScope(page, wrapper)); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping |
| | | @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_add')" ) |
| | | public R save(@RequestBody DeviceDemandPlan deviceDemandPlan) { |
| | | deviceDemandPlan.setNumber(maxSizeService.nextNo(MaxSizeContant.PLAN_NUM)); |
| | | return R.ok(deviceDemandPlanService.save(deviceDemandPlan)); |
| | | } |
| | | |