2023-02-22 15:59:13 +08:00
|
|
|
|
package com.cnbm.packing.controller;
|
|
|
|
|
|
|
|
|
|
import com.cnbm.admin.annotation.LogOperation;
|
|
|
|
|
import com.cnbm.common.constant.Constant;
|
|
|
|
|
import com.cnbm.common.page.PageData;
|
|
|
|
|
import com.cnbm.common.utils.ExcelUtils;
|
|
|
|
|
import com.cnbm.common.utils.Result;
|
|
|
|
|
import com.cnbm.common.validator.AssertUtils;
|
|
|
|
|
import com.cnbm.common.validator.ValidatorUtils;
|
|
|
|
|
import com.cnbm.common.validator.group.AddGroup;
|
|
|
|
|
import com.cnbm.common.validator.group.DefaultGroup;
|
|
|
|
|
import com.cnbm.common.validator.group.UpdateGroup;
|
|
|
|
|
import com.cnbm.packing.dto.WoCompensationPowerDTO;
|
|
|
|
|
import com.cnbm.packing.excel.WoCompensationPowerExcel;
|
|
|
|
|
import com.cnbm.packing.service.WoCompensationPowerServiceBiz;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 基板补偿功率 表 前端控制器
|
|
|
|
|
*
|
|
|
|
|
* @author packingGenerator
|
|
|
|
|
* @since 2023-02-20
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/packing/woCompensationPower")
|
|
|
|
|
@Api(tags="基板补偿功率 表")
|
|
|
|
|
public class WoCompensationPowerController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private WoCompensationPowerServiceBiz woCompensationPowerService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("page")
|
|
|
|
|
@ApiOperation("分页")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
|
|
|
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
|
|
|
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
|
|
|
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
|
|
|
|
@ApiImplicitParam(name = "lineBody", value = "线体", paramType = "query", dataTypeClass = Integer.class)
|
|
|
|
|
})
|
2023-02-24 14:21:25 +08:00
|
|
|
|
@PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:page')")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
public Result<PageData<WoCompensationPowerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
|
|
|
|
PageData<WoCompensationPowerDTO> page = woCompensationPowerService.page(params);
|
|
|
|
|
|
|
|
|
|
return new Result<PageData<WoCompensationPowerDTO>>().ok(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("{id}")
|
|
|
|
|
@ApiOperation("信息")
|
|
|
|
|
// @PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:info')")
|
|
|
|
|
public Result<WoCompensationPowerDTO> get(@PathVariable("id") Long id){
|
|
|
|
|
WoCompensationPowerDTO data = woCompensationPowerService.get(id);
|
|
|
|
|
|
|
|
|
|
return new Result<WoCompensationPowerDTO>().ok(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
|
|
@ApiOperation("保存")
|
2023-02-23 14:24:29 +08:00
|
|
|
|
// @LogOperation("保存")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
// @PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:save')")
|
|
|
|
|
public Result<Long> save(@RequestBody WoCompensationPowerDTO dto){
|
|
|
|
|
//效验数据
|
|
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
|
|
|
|
|
|
|
|
|
woCompensationPowerService.save(dto);
|
|
|
|
|
|
|
|
|
|
return new Result<Long>().ok(dto.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping
|
|
|
|
|
@ApiOperation("修改")
|
2023-02-23 14:24:29 +08:00
|
|
|
|
// @LogOperation("修改")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
// @PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:update')")
|
|
|
|
|
public Result<Long> update(@RequestBody WoCompensationPowerDTO dto){
|
|
|
|
|
//效验数据
|
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
|
|
|
|
|
|
|
|
|
woCompensationPowerService.update(dto);
|
|
|
|
|
|
|
|
|
|
return new Result<Long>().ok(dto.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping
|
|
|
|
|
@ApiOperation("删除")
|
2023-02-23 14:24:29 +08:00
|
|
|
|
// @LogOperation("删除")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
// @PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:delete')")
|
|
|
|
|
public Result delete(@RequestBody Long[] ids){
|
|
|
|
|
//效验数据
|
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id");
|
|
|
|
|
|
|
|
|
|
woCompensationPowerService.delete(ids);
|
|
|
|
|
|
|
|
|
|
return new Result();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("export")
|
|
|
|
|
@ApiOperation("导出")
|
2023-02-23 14:24:29 +08:00
|
|
|
|
// @LogOperation("导出")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
// @PreAuthorize("@ex.hasAuthority('packing:woCompensationPower:export')")
|
|
|
|
|
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
|
|
|
|
List<WoCompensationPowerDTO> list = woCompensationPowerService.list(params);
|
|
|
|
|
|
|
|
|
|
ExcelUtils.exportExcelToTarget(response, null, list, WoCompensationPowerExcel.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "list")
|
|
|
|
|
@ApiOperation(value = "获取基板补偿功率")
|
2023-02-23 14:24:29 +08:00
|
|
|
|
// @LogOperation("获取基板补偿功率")
|
2023-02-22 15:59:13 +08:00
|
|
|
|
public List<WoCompensationPowerDTO> list() { return woCompensationPowerService.list(); }
|
|
|
|
|
|
|
|
|
|
}
|