|
@@ -32,7 +32,7 @@ import java.util.List;
|
|
|
@RequestMapping("/sb/measure-logs")
|
|
|
public class SbMeasureLogController {
|
|
|
|
|
|
- private final SbMeasureLogService sbMeasureLogService;
|
|
|
+ private final SbMeasureLogService sbMeasureLogService;
|
|
|
|
|
|
/**
|
|
|
* 通过id查询标准
|
|
@@ -41,69 +41,69 @@ public class SbMeasureLogController {
|
|
|
* @return R
|
|
|
*/
|
|
|
@GetMapping("/{id}")
|
|
|
- public R<SbMeasureLog> getById(@PathVariable("id") String id){
|
|
|
+ public R<SbMeasureLog> getById(@PathVariable("id") String id) {
|
|
|
return new R<>(sbMeasureLogService.getModelById(id));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 新增记录
|
|
|
- *
|
|
|
- * @param checkStandardDTO 设备计量记录DTO
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @SysLog("新增设备计量记录")
|
|
|
- @PostMapping
|
|
|
- public R save(@Validated({AddGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
- return new R<>(sbMeasureLogService.saveModelByDTO(checkStandardDTO));
|
|
|
- }
|
|
|
-
|
|
|
- @SysLog("批量新增设备计量记录")
|
|
|
- @PostMapping("/batch")
|
|
|
- public R saveBatch(@Validated({AddGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
- sbMeasureLogService.saveBatchByDTO(checkStandardDTO);
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
-
|
|
|
- @SysLog("批量新增设备计量记录")
|
|
|
- @PostMapping("/longYan/batch")
|
|
|
- public R saveLongYanBatch(@RequestBody BatchSbMeasureLog batchSbMeasureLog) {
|
|
|
- sbMeasureLogService.saveBatchMeasureLog(batchSbMeasureLog);
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
-
|
|
|
- @SysLog("批量设备在库")
|
|
|
- @PostMapping("/longYan/in/batch")
|
|
|
- public R inLongYanBatch(@RequestBody BatchSbMeasureLog batchSbMeasureLog) {
|
|
|
- sbMeasureLogService.saveBatchIn(batchSbMeasureLog);
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改记录
|
|
|
- *
|
|
|
- * @param checkStandardDTO 设备计量记录DTO
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @SysLog("修改设备计量记录")
|
|
|
- @PutMapping("/{id}")
|
|
|
- @PreAuthorize("@pms.hasPermission('measure-log-edit')")
|
|
|
- public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
- sbMeasureLogService.modModelByDTO(checkStandardDTO);
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除一条记录
|
|
|
- *
|
|
|
- * @param id 主键
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @SysLog("删除设备计量记录")
|
|
|
- @DeleteMapping("/{id}")
|
|
|
- public R removeById(@PathVariable String id){
|
|
|
- sbMeasureLogService.deleteByPrimaryKey(id);
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 新增记录
|
|
|
+ *
|
|
|
+ * @param checkStandardDTO 设备计量记录DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("新增设备计量记录")
|
|
|
+ @PostMapping
|
|
|
+ public R save(@Validated({AddGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
+ return new R<>(sbMeasureLogService.saveModelByDTO(checkStandardDTO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @SysLog("批量新增设备计量记录")
|
|
|
+ @PostMapping("/batch")
|
|
|
+ public R saveBatch(@Validated({AddGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
+ sbMeasureLogService.saveBatchByDTO(checkStandardDTO);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ @SysLog("批量新增设备计量记录")
|
|
|
+ @PostMapping("/longYan/batch")
|
|
|
+ public R saveLongYanBatch(@RequestBody BatchSbMeasureLog batchSbMeasureLog) {
|
|
|
+ sbMeasureLogService.saveBatchMeasureLog(batchSbMeasureLog);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ @SysLog("批量设备在库")
|
|
|
+ @PostMapping("/longYan/in/batch")
|
|
|
+ public R inLongYanBatch(@RequestBody BatchSbMeasureLog batchSbMeasureLog) {
|
|
|
+ sbMeasureLogService.saveBatchIn(batchSbMeasureLog);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改记录
|
|
|
+ *
|
|
|
+ * @param checkStandardDTO 设备计量记录DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("修改设备计量记录")
|
|
|
+ @PutMapping("/{id}")
|
|
|
+ @PreAuthorize("@pms.hasPermission('measure-log-edit')")
|
|
|
+ public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbMeasureLogDTO checkStandardDTO) {
|
|
|
+ sbMeasureLogService.modModelByDTO(checkStandardDTO);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除一条记录
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("删除设备计量记录")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public R removeById(@PathVariable String id) {
|
|
|
+ sbMeasureLogService.deleteByPrimaryKey(id);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 批量记录
|
|
@@ -113,53 +113,53 @@ public class SbMeasureLogController {
|
|
|
*/
|
|
|
@SysLog("批量删除设备计量记录")
|
|
|
@DeleteMapping("")
|
|
|
- public R removeIds(@RequestBody List<String> ids){
|
|
|
- sbMeasureLogService.batchDelete(ids);
|
|
|
+ public R removeIds(@RequestBody List<String> ids) {
|
|
|
+ sbMeasureLogService.batchDelete(ids);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取分页
|
|
|
- *
|
|
|
- * @param pageNum 当前页码
|
|
|
- * @param pageSize 每页条数
|
|
|
- * @param checkStandardDTO 设备计量记录DTO
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @GetMapping("/page")
|
|
|
- public R<AbstractPageResultBean<SbMeasureLog>> query(SbMeasureLogDTO checkStandardDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
|
|
|
- return new R<>(sbMeasureLogService.selectPageInfo(checkStandardDTO, pageNum, pageSize));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取列表
|
|
|
- *
|
|
|
- * @param checkStandardDTO 设备计量记录DTO
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @GetMapping("")
|
|
|
- public R query(SbMeasureLogDTO checkStandardDTO) {
|
|
|
- return new R<>(sbMeasureLogService.selectList(checkStandardDTO));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
+ /**
|
|
|
+ * 获取分页
|
|
|
+ *
|
|
|
+ * @param pageNum 当前页码
|
|
|
+ * @param pageSize 每页条数
|
|
|
+ * @param checkStandardDTO 设备计量记录DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ public R<AbstractPageResultBean<SbMeasureLog>> query(SbMeasureLogDTO checkStandardDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
|
|
|
+ return new R<>(sbMeasureLogService.selectPageInfo(checkStandardDTO, pageNum, pageSize));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取列表
|
|
|
+ *
|
|
|
+ * @param checkStandardDTO 设备计量记录DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("")
|
|
|
+ public R query(SbMeasureLogDTO checkStandardDTO) {
|
|
|
+ return new R<>(sbMeasureLogService.selectList(checkStandardDTO));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 设备计量记录导出
|
|
|
*
|
|
|
* @param checkStandardDTO 设备计量记录DTO
|
|
|
* @return R
|
|
|
*/
|
|
|
- @GetMapping("/export")
|
|
|
- @SysLog("计量设备检定记录导出")
|
|
|
- @PreAuthorize("@pms.hasPermission('measure-log-export') or @pms.hasPermission('check-polling-standards-export')")
|
|
|
- public void export(HttpServletResponse response, SbMeasureLogDTO checkStandardDTO) {
|
|
|
- List<SbMeasureLogVO> list = sbMeasureLogService.selectList(checkStandardDTO);
|
|
|
- ExcelUtil.exportResponseDict(response, ExportSbMeasureLogVO.class, BeanConverterUtil.copyListProperties(list, ExportSbMeasureLogVO.class), "计量设备检定记录");
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/generate/init")
|
|
|
- public R generateInit() {
|
|
|
- sbMeasureLogService.generateInitLog();
|
|
|
- return new R<>();
|
|
|
- }
|
|
|
+ @GetMapping("/export")
|
|
|
+ @SysLog("计量设备检定记录导出")
|
|
|
+ @PreAuthorize("@pms.hasPermission('measure-log-export') or @pms.hasPermission('check-polling-standards-export')")
|
|
|
+ public void export(HttpServletResponse response, SbMeasureLogDTO checkStandardDTO) {
|
|
|
+ List<SbMeasureLogVO> list = sbMeasureLogService.selectList(checkStandardDTO);
|
|
|
+ ExcelUtil.exportResponseDict(response, ExportSbMeasureLogVO.class, BeanConverterUtil.copyListProperties(list, ExportSbMeasureLogVO.class), "计量设备检定记录");
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/generate/init")
|
|
|
+ public R generateInit() {
|
|
|
+ sbMeasureLogService.generateInitLog();
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
|
|
|
}
|