Commit 52e5015294ca2ee6980a345cef1e9e9f7fa46210
1 parent
4db44e6f
fix: 签到一行返回601
Showing
3 changed files
with
50 additions
and
18 deletions
ruoyi-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
| @@ -5,6 +5,7 @@ import java.util.List; | @@ -5,6 +5,7 @@ import java.util.List; | ||
| 5 | import javax.servlet.http.HttpServletResponse; | 5 | import javax.servlet.http.HttpServletResponse; |
| 6 | 6 | ||
| 7 | import com.ruoyi.common.exception.file.FileUploadException; | 7 | import com.ruoyi.common.exception.file.FileUploadException; |
| 8 | +import com.ruoyi.pojo.request.FaceUpdateReqVo; | ||
| 8 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| 10 | import io.swagger.annotations.ApiParam; | 11 | import io.swagger.annotations.ApiParam; |
| @@ -29,15 +30,14 @@ import com.ruoyi.common.core.page.TableDataInfo; | @@ -29,15 +30,14 @@ import com.ruoyi.common.core.page.TableDataInfo; | ||
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * 签到Controller | 32 | * 签到Controller |
| 32 | - * | 33 | + * |
| 33 | * @author guzijian | 34 | * @author guzijian |
| 34 | * @date 2023-07-05 | 35 | * @date 2023-07-05 |
| 35 | */ | 36 | */ |
| 36 | @RestController | 37 | @RestController |
| 37 | @RequestMapping("/in/in") | 38 | @RequestMapping("/in/in") |
| 38 | @Api(tags = "签到管理") | 39 | @Api(tags = "签到管理") |
| 39 | -public class SignInController extends BaseController | ||
| 40 | -{ | 40 | +public class SignInController extends BaseController { |
| 41 | @Autowired | 41 | @Autowired |
| 42 | private ISignInService signInService; | 42 | private ISignInService signInService; |
| 43 | 43 | ||
| @@ -47,8 +47,7 @@ public class SignInController extends BaseController | @@ -47,8 +47,7 @@ public class SignInController extends BaseController | ||
| 47 | // @PreAuthorize("@ss.hasPermi('in:in:list')") | 47 | // @PreAuthorize("@ss.hasPermi('in:in:list')") |
| 48 | @GetMapping("/list") | 48 | @GetMapping("/list") |
| 49 | @ApiOperation("查询签到列表") | 49 | @ApiOperation("查询签到列表") |
| 50 | - public TableDataInfo list(SignIn signIn) | ||
| 51 | - { | 50 | + public TableDataInfo list(SignIn signIn) { |
| 52 | startPage(); | 51 | startPage(); |
| 53 | List<SignIn> list = signInService.selectSignInList(signIn); | 52 | List<SignIn> list = signInService.selectSignInList(signIn); |
| 54 | return getDataTable(list); | 53 | return getDataTable(list); |
| @@ -61,21 +60,28 @@ public class SignInController extends BaseController | @@ -61,21 +60,28 @@ public class SignInController extends BaseController | ||
| 61 | @Log(title = "签到", businessType = BusinessType.EXPORT) | 60 | @Log(title = "签到", businessType = BusinessType.EXPORT) |
| 62 | @PostMapping("/export") | 61 | @PostMapping("/export") |
| 63 | @ApiOperation("导出签到列表") | 62 | @ApiOperation("导出签到列表") |
| 64 | - public void export(HttpServletResponse response, SignIn signIn) | ||
| 65 | - { | 63 | + public void export(HttpServletResponse response, SignIn signIn) { |
| 66 | List<SignIn> list = signInService.selectSignInList(signIn); | 64 | List<SignIn> list = signInService.selectSignInList(signIn); |
| 67 | ExcelUtil<SignIn> util = new ExcelUtil<SignIn>(SignIn.class); | 65 | ExcelUtil<SignIn> util = new ExcelUtil<SignIn>(SignIn.class); |
| 68 | util.exportExcel(response, list, "签到数据"); | 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 | // @PreAuthorize("@ss.hasPermi('in:in:query')") | 81 | // @PreAuthorize("@ss.hasPermi('in:in:query')") |
| 75 | @GetMapping(value = "/{id}") | 82 | @GetMapping(value = "/{id}") |
| 76 | @ApiOperation("获取签到详细信息") | 83 | @ApiOperation("获取签到详细信息") |
| 77 | - public AjaxResult getInfo(@PathVariable("id") Long id) | ||
| 78 | - { | 84 | + public AjaxResult getInfo(@PathVariable("id") Long id) { |
| 79 | return success(signInService.selectSignInById(id)); | 85 | return success(signInService.selectSignInById(id)); |
| 80 | } | 86 | } |
| 81 | 87 | ||
| @@ -86,13 +92,14 @@ public class SignInController extends BaseController | @@ -86,13 +92,14 @@ public class SignInController extends BaseController | ||
| 86 | @Log(title = "签到", businessType = BusinessType.INSERT) | 92 | @Log(title = "签到", businessType = BusinessType.INSERT) |
| 87 | @PostMapping | 93 | @PostMapping |
| 88 | @ApiOperation("新增签到(通过后台管理页面)") | 94 | @ApiOperation("新增签到(通过后台管理页面)") |
| 89 | - public AjaxResult add(@ApiParam @RequestBody SignIn signIn) | ||
| 90 | - { | 95 | + public AjaxResult add(@ApiParam @RequestBody SignIn signIn) { |
| 91 | return signInService.insertSignIn(signIn); | 96 | return signInService.insertSignIn(signIn); |
| 92 | } | 97 | } |
| 93 | 98 | ||
| 99 | + | ||
| 94 | /** | 100 | /** |
| 95 | * 新增签到 | 101 | * 新增签到 |
| 102 | + * | ||
| 96 | * @param signIn | 103 | * @param signIn |
| 97 | * @return | 104 | * @return |
| 98 | * @throws FileUploadException | 105 | * @throws FileUploadException |
| @@ -110,8 +117,7 @@ public class SignInController extends BaseController | @@ -110,8 +117,7 @@ public class SignInController extends BaseController | ||
| 110 | @Log(title = "签到", businessType = BusinessType.UPDATE) | 117 | @Log(title = "签到", businessType = BusinessType.UPDATE) |
| 111 | @PutMapping | 118 | @PutMapping |
| 112 | @ApiOperation("修改签到") | 119 | @ApiOperation("修改签到") |
| 113 | - public AjaxResult edit(@RequestBody SignIn signIn) | ||
| 114 | - { | 120 | + public AjaxResult edit(@RequestBody SignIn signIn) { |
| 115 | return toAjax(signInService.updateSignIn(signIn)); | 121 | return toAjax(signInService.updateSignIn(signIn)); |
| 116 | } | 122 | } |
| 117 | 123 | ||
| @@ -120,10 +126,9 @@ public class SignInController extends BaseController | @@ -120,10 +126,9 @@ public class SignInController extends BaseController | ||
| 120 | */ | 126 | */ |
| 121 | // @PreAuthorize("@ss.hasPermi('in:in:remove')") | 127 | // @PreAuthorize("@ss.hasPermi('in:in:remove')") |
| 122 | @Log(title = "签到", businessType = BusinessType.DELETE) | 128 | @Log(title = "签到", businessType = BusinessType.DELETE) |
| 123 | - @DeleteMapping("/{ids}") | 129 | + @DeleteMapping("/{ids}") |
| 124 | @ApiOperation("删除签到") | 130 | @ApiOperation("删除签到") |
| 125 | - public AjaxResult remove(@PathVariable Long[] ids) | ||
| 126 | - { | 131 | + public AjaxResult remove(@PathVariable Long[] ids) { |
| 127 | return toAjax(signInService.deleteSignInByIds(ids)); | 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,7 +194,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 194 | return result; | 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 | private SignInResponseVo getSignInResponseVo(SignIn signIn, Equipment equipment) { | 200 | private SignInResponseVo getSignInResponseVo(SignIn signIn, Equipment equipment) { |
| @@ -219,7 +219,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -219,7 +219,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 219 | } | 219 | } |
| 220 | if (SIGN_IN_ERROR_COUNT.compareTo(count) <= 0) { | 220 | if (SIGN_IN_ERROR_COUNT.compareTo(count) <= 0) { |
| 221 | // TODO | 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 | return null; | 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 | +} |