Commit 52e5015294ca2ee6980a345cef1e9e9f7fa46210

Authored by guzijian
1 parent 4db44e6f

fix: 签到一行返回601

ruoyi-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
... ... @@ -5,6 +5,7 @@ import java.util.List;
5 5 import javax.servlet.http.HttpServletResponse;
6 6  
7 7 import com.ruoyi.common.exception.file.FileUploadException;
  8 +import com.ruoyi.pojo.request.FaceUpdateReqVo;
8 9 import io.swagger.annotations.Api;
9 10 import io.swagger.annotations.ApiOperation;
10 11 import io.swagger.annotations.ApiParam;
... ... @@ -29,15 +30,14 @@ import com.ruoyi.common.core.page.TableDataInfo;
29 30  
30 31 /**
31 32 * 签到Controller
32   - *
  33 + *
33 34 * @author guzijian
34 35 * @date 2023-07-05
35 36 */
36 37 @RestController
37 38 @RequestMapping("/in/in")
38 39 @Api(tags = "签到管理")
39   -public class SignInController extends BaseController
40   -{
  40 +public class SignInController extends BaseController {
41 41 @Autowired
42 42 private ISignInService signInService;
43 43  
... ... @@ -47,8 +47,7 @@ public class SignInController extends BaseController
47 47 // @PreAuthorize("@ss.hasPermi('in:in:list')")
48 48 @GetMapping("/list")
49 49 @ApiOperation("查询签到列表")
50   - public TableDataInfo list(SignIn signIn)
51   - {
  50 + public TableDataInfo list(SignIn signIn) {
52 51 startPage();
53 52 List<SignIn> list = signInService.selectSignInList(signIn);
54 53 return getDataTable(list);
... ... @@ -61,21 +60,28 @@ public class SignInController extends BaseController
61 60 @Log(title = "签到", businessType = BusinessType.EXPORT)
62 61 @PostMapping("/export")
63 62 @ApiOperation("导出签到列表")
64   - public void export(HttpServletResponse response, SignIn signIn)
65   - {
  63 + public void export(HttpServletResponse response, SignIn signIn) {
66 64 List<SignIn> list = signInService.selectSignInList(signIn);
67 65 ExcelUtil<SignIn> util = new ExcelUtil<SignIn>(SignIn.class);
68 66 util.exportExcel(response, list, "签到数据");
69 67 }
70 68  
71 69 /**
  70 + * 人脸数据更新接口
  71 + */
  72 + @PostMapping("/update/face")
  73 + public AjaxResult updateFaceByJob(FaceUpdateReqVo vo){
  74 + // TODO 人脸数据更新接口
  75 + return AjaxResult.success("签到成功");
  76 + }
  77 +
  78 + /**
72 79 * 获取签到详细信息
73 80 */
74 81 // @PreAuthorize("@ss.hasPermi('in:in:query')")
75 82 @GetMapping(value = "/{id}")
76 83 @ApiOperation("获取签到详细信息")
77   - public AjaxResult getInfo(@PathVariable("id") Long id)
78   - {
  84 + public AjaxResult getInfo(@PathVariable("id") Long id) {
79 85 return success(signInService.selectSignInById(id));
80 86 }
81 87  
... ... @@ -86,13 +92,14 @@ public class SignInController extends BaseController
86 92 @Log(title = "签到", businessType = BusinessType.INSERT)
87 93 @PostMapping
88 94 @ApiOperation("新增签到(通过后台管理页面)")
89   - public AjaxResult add(@ApiParam @RequestBody SignIn signIn)
90   - {
  95 + public AjaxResult add(@ApiParam @RequestBody SignIn signIn) {
91 96 return signInService.insertSignIn(signIn);
92 97 }
93 98  
  99 +
94 100 /**
95 101 * 新增签到
  102 + *
96 103 * @param signIn
97 104 * @return
98 105 * @throws FileUploadException
... ... @@ -110,8 +117,7 @@ public class SignInController extends BaseController
110 117 @Log(title = "签到", businessType = BusinessType.UPDATE)
111 118 @PutMapping
112 119 @ApiOperation("修改签到")
113   - public AjaxResult edit(@RequestBody SignIn signIn)
114   - {
  120 + public AjaxResult edit(@RequestBody SignIn signIn) {
115 121 return toAjax(signInService.updateSignIn(signIn));
116 122 }
117 123  
... ... @@ -120,10 +126,9 @@ public class SignInController extends BaseController
120 126 */
121 127 // @PreAuthorize("@ss.hasPermi('in:in:remove')")
122 128 @Log(title = "签到", businessType = BusinessType.DELETE)
123   - @DeleteMapping("/{ids}")
  129 + @DeleteMapping("/{ids}")
124 130 @ApiOperation("删除签到")
125   - public AjaxResult remove(@PathVariable Long[] ids)
126   - {
  131 + public AjaxResult remove(@PathVariable Long[] ids) {
127 132 return toAjax(signInService.deleteSignInByIds(ids));
128 133 }
129 134 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -194,7 +194,7 @@ public class SignInServiceImpl implements ISignInService {
194 194 return result;
195 195 }
196 196 }
197   - return SIGN_IN_SUCCESS.equals(signIn.getStatus()) ? AjaxResult.success(SIGN_IN_SUCCESS_STRING, vo) : AjaxResult.error(SIGN_IN_ERROR + signIn.getRemark(), vo);
  197 + return SIGN_IN_SUCCESS.equals(signIn.getStatus()) ? AjaxResult.success(SIGN_IN_SUCCESS_STRING, vo) : AjaxResult.warn(SIGN_IN_ERROR + signIn.getRemark(), vo);
198 198 }
199 199  
200 200 private SignInResponseVo getSignInResponseVo(SignIn signIn, Equipment equipment) {
... ... @@ -219,7 +219,7 @@ public class SignInServiceImpl implements ISignInService {
219 219 }
220 220 if (SIGN_IN_ERROR_COUNT.compareTo(count) <= 0) {
221 221 // TODO
222   - return AjaxResult.error(SIGN_IN_ERROR + signIn.getRemark() + ",酒精测试不通过" + count + "次请更换车辆驾驶员", vo);
  222 + return AjaxResult.warn(SIGN_IN_ERROR + signIn.getRemark() + ",酒精测试不通过" + count + "次请更换车辆驾驶员", vo);
223 223 }
224 224 return null;
225 225 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/pojo/request/FaceUpdateReqVo.java 0 → 100644
  1 +package com.ruoyi.pojo.request;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * 人脸更新数据
  7 + * @author 20412
  8 + */
  9 +@Data
  10 +public class FaceUpdateReqVo {
  11 + /**
  12 + * 工号
  13 + */
  14 + String jobCode;
  15 + /**
  16 + * 图片base64
  17 + */
  18 + String imageBase64;
  19 + /**
  20 + * 姓名
  21 + */
  22 + String name;
  23 + /**
  24 + * 工种
  25 + */
  26 + String posts;
  27 +}
... ...