|
@@ -1,31 +1,38 @@
|
|
|
package com.ruoyi.web.controller.zhdd;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import javax.validation.constraints.*;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.GatewayUser;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.core.validate.AddGroup;
|
|
|
import com.ruoyi.common.core.validate.EditGroup;
|
|
|
import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
-import com.ruoyi.zhdd.domain.vo.DutyReportVo;
|
|
|
import com.ruoyi.zhdd.domain.bo.DutyReportBo;
|
|
|
+import com.ruoyi.zhdd.domain.vo.DutyReportVo;
|
|
|
import com.ruoyi.zhdd.service.IDutyReportService;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.NotEmpty;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 值班报告信息Controller
|
|
@@ -71,7 +78,7 @@ public class DutyReportController extends BaseController {
|
|
|
// @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:query')")
|
|
|
@GetMapping("/{id}")
|
|
|
public AjaxResult<DutyReportVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
- @PathVariable("id") String id) {
|
|
|
+ @PathVariable("id") String id) {
|
|
|
return AjaxResult.success(iDutyReportService.queryById(id));
|
|
|
}
|
|
|
|
|
@@ -84,6 +91,10 @@ public class DutyReportController extends BaseController {
|
|
|
@RepeatSubmit()
|
|
|
@PostMapping()
|
|
|
public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody DutyReportBo bo) {
|
|
|
+ GatewayUser user = getGateWayUser();
|
|
|
+ if (user != null) {
|
|
|
+ bo.setCreateBy(user.getUsername());
|
|
|
+ }
|
|
|
return toAjax(iDutyReportService.insertByBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|
|
@@ -104,10 +115,10 @@ public class DutyReportController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("删除值班报告信息")
|
|
|
// @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:remove')")
|
|
|
- @Log(title = "值班报告信息" , businessType = BusinessType.DELETE)
|
|
|
+ @Log(title = "值班报告信息", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
- @PathVariable String[] ids) {
|
|
|
+ @PathVariable String[] ids) {
|
|
|
return toAjax(iDutyReportService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
}
|
|
|
}
|