|
|
@@ -0,0 +1,69 @@
|
|
|
+package com.goldenwater.slaj.woas.controller;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
+import io.micrometer.common.util.StringUtils;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import com.goldenwater.common.annotation.Log;
|
|
|
+import com.goldenwater.common.core.controller.BaseController;
|
|
|
+import com.goldenwater.common.core.domain.AjaxResult;
|
|
|
+import com.goldenwater.common.core.page.TableDataInfo;
|
|
|
+import com.goldenwater.common.enums.BusinessType;
|
|
|
+import com.goldenwater.common.utils.poi.ExcelUtil;
|
|
|
+import com.goldenwater.slaj.woas.domain.ObjWoas;
|
|
|
+import com.goldenwater.slaj.woas.service.IObjWoasService;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/woas/objwoas")
|
|
|
+public class ObjWoasController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IObjWoasService objWoasService;
|
|
|
+
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(ObjWoas objWoas) {
|
|
|
+ startPage();
|
|
|
+ List<ObjWoas> list = objWoasService.selectObjWoasList(objWoas);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/{guid}")
|
|
|
+ public AjaxResult getInfo(@PathVariable String guid) {
|
|
|
+ return AjaxResult.success(objWoasService.selectObjWoasByGuid(guid));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody ObjWoas objWoas) {
|
|
|
+ if(StringUtils.isBlank(objWoas.getGuid())){
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ objWoas.setGuid(uuid);
|
|
|
+ }
|
|
|
+ objWoas.setCollTime(new Date());
|
|
|
+ objWoas.setUpdTime(new Date());
|
|
|
+ return toAjax(objWoasService.insertObjWoas(objWoas));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody ObjWoas objWoas) {
|
|
|
+ return toAjax(objWoasService.updateObjWoas(objWoas));
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/{guids}")
|
|
|
+ public AjaxResult remove(@PathVariable String[] guids) {
|
|
|
+ return toAjax(objWoasService.deleteObjWoasByGuids(guids));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Log(title = "工作考核通知对象管理", businessType = BusinessType.EXPORT)
|
|
|
+ @PreAuthorize("@ss.hasPermi('woas:objwoas:export')")
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, ObjWoas objWoas) {
|
|
|
+ List<ObjWoas> list = objWoasService.selectObjWoasList(objWoas);
|
|
|
+ ExcelUtil<ObjWoas> util = new ExcelUtil<>(ObjWoas.class);
|
|
|
+ util.exportExcel(response, list, "工作考核通知对象数据");
|
|
|
+ }
|
|
|
+}
|