Commit 4f6a1b6ae5a28207a349d6767b799e7a05079e0c
1 parent
72330b78
fix: resolve bug
Showing
6 changed files
with
15 additions
and
21 deletions
ruoyi-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
| @@ -2,6 +2,9 @@ package com.ruoyi.in.controller; | @@ -2,6 +2,9 @@ package com.ruoyi.in.controller; | ||
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | + | ||
| 6 | +import io.swagger.annotations.Api; | ||
| 7 | +import io.swagger.annotations.ApiOperation; | ||
| 5 | import org.springframework.security.access.prepost.PreAuthorize; | 8 | import org.springframework.security.access.prepost.PreAuthorize; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.web.bind.annotation.GetMapping; | 10 | import org.springframework.web.bind.annotation.GetMapping; |
| @@ -29,6 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo; | @@ -29,6 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo; | ||
| 29 | */ | 32 | */ |
| 30 | @RestController | 33 | @RestController |
| 31 | @RequestMapping("/in/in") | 34 | @RequestMapping("/in/in") |
| 35 | +@Api(tags = "签到管理") | ||
| 32 | public class SignInController extends BaseController | 36 | public class SignInController extends BaseController |
| 33 | { | 37 | { |
| 34 | @Autowired | 38 | @Autowired |
| @@ -39,6 +43,7 @@ public class SignInController extends BaseController | @@ -39,6 +43,7 @@ public class SignInController extends BaseController | ||
| 39 | */ | 43 | */ |
| 40 | // @PreAuthorize("@ss.hasPermi('in:in:list')") | 44 | // @PreAuthorize("@ss.hasPermi('in:in:list')") |
| 41 | @GetMapping("/list") | 45 | @GetMapping("/list") |
| 46 | + @ApiOperation("查询签到列表") | ||
| 42 | public TableDataInfo list(SignIn signIn) | 47 | public TableDataInfo list(SignIn signIn) |
| 43 | { | 48 | { |
| 44 | startPage(); | 49 | startPage(); |
| @@ -52,6 +57,7 @@ public class SignInController extends BaseController | @@ -52,6 +57,7 @@ public class SignInController extends BaseController | ||
| 52 | // @PreAuthorize("@ss.hasPermi('in:in:export')") | 57 | // @PreAuthorize("@ss.hasPermi('in:in:export')") |
| 53 | @Log(title = "签到", businessType = BusinessType.EXPORT) | 58 | @Log(title = "签到", businessType = BusinessType.EXPORT) |
| 54 | @PostMapping("/export") | 59 | @PostMapping("/export") |
| 60 | + @ApiOperation("导出签到列表") | ||
| 55 | public void export(HttpServletResponse response, SignIn signIn) | 61 | public void export(HttpServletResponse response, SignIn signIn) |
| 56 | { | 62 | { |
| 57 | List<SignIn> list = signInService.selectSignInList(signIn); | 63 | List<SignIn> list = signInService.selectSignInList(signIn); |
| @@ -64,6 +70,7 @@ public class SignInController extends BaseController | @@ -64,6 +70,7 @@ public class SignInController extends BaseController | ||
| 64 | */ | 70 | */ |
| 65 | // @PreAuthorize("@ss.hasPermi('in:in:query')") | 71 | // @PreAuthorize("@ss.hasPermi('in:in:query')") |
| 66 | @GetMapping(value = "/{id}") | 72 | @GetMapping(value = "/{id}") |
| 73 | + @ApiOperation("获取签到详细信息") | ||
| 67 | public AjaxResult getInfo(@PathVariable("id") Long id) | 74 | public AjaxResult getInfo(@PathVariable("id") Long id) |
| 68 | { | 75 | { |
| 69 | return success(signInService.selectSignInById(id)); | 76 | return success(signInService.selectSignInById(id)); |
| @@ -75,6 +82,7 @@ public class SignInController extends BaseController | @@ -75,6 +82,7 @@ public class SignInController extends BaseController | ||
| 75 | // @PreAuthorize("@ss.hasPermi('in:in:add')") | 82 | // @PreAuthorize("@ss.hasPermi('in:in:add')") |
| 76 | @Log(title = "签到", businessType = BusinessType.INSERT) | 83 | @Log(title = "签到", businessType = BusinessType.INSERT) |
| 77 | @PostMapping | 84 | @PostMapping |
| 85 | + @ApiOperation("新增签到") | ||
| 78 | public AjaxResult add(@RequestBody SignIn signIn) | 86 | public AjaxResult add(@RequestBody SignIn signIn) |
| 79 | { | 87 | { |
| 80 | return toAjax(signInService.insertSignIn(signIn)); | 88 | return toAjax(signInService.insertSignIn(signIn)); |
| @@ -86,6 +94,7 @@ public class SignInController extends BaseController | @@ -86,6 +94,7 @@ public class SignInController extends BaseController | ||
| 86 | // @PreAuthorize("@ss.hasPermi('in:in:edit')") | 94 | // @PreAuthorize("@ss.hasPermi('in:in:edit')") |
| 87 | @Log(title = "签到", businessType = BusinessType.UPDATE) | 95 | @Log(title = "签到", businessType = BusinessType.UPDATE) |
| 88 | @PutMapping | 96 | @PutMapping |
| 97 | + @ApiOperation("修改签到") | ||
| 89 | public AjaxResult edit(@RequestBody SignIn signIn) | 98 | public AjaxResult edit(@RequestBody SignIn signIn) |
| 90 | { | 99 | { |
| 91 | return toAjax(signInService.updateSignIn(signIn)); | 100 | return toAjax(signInService.updateSignIn(signIn)); |
| @@ -97,6 +106,7 @@ public class SignInController extends BaseController | @@ -97,6 +106,7 @@ public class SignInController extends BaseController | ||
| 97 | // @PreAuthorize("@ss.hasPermi('in:in:remove')") | 106 | // @PreAuthorize("@ss.hasPermi('in:in:remove')") |
| 98 | @Log(title = "签到", businessType = BusinessType.DELETE) | 107 | @Log(title = "签到", businessType = BusinessType.DELETE) |
| 99 | @DeleteMapping("/{ids}") | 108 | @DeleteMapping("/{ids}") |
| 109 | + @ApiOperation("删除签到") | ||
| 100 | public AjaxResult remove(@PathVariable Long[] ids) | 110 | public AjaxResult remove(@PathVariable Long[] ids) |
| 101 | { | 111 | { |
| 102 | return toAjax(signInService.deleteSignInByIds(ids)); | 112 | return toAjax(signInService.deleteSignInByIds(ids)); |
ruoyi-admin/src/main/java/com/ruoyi/in/domain/SignIn.java
| @@ -31,25 +31,6 @@ public class SignIn extends BaseEntity | @@ -31,25 +31,6 @@ public class SignIn extends BaseEntity | ||
| 31 | /** 图片 */ | 31 | /** 图片 */ |
| 32 | @Excel(name = "图片") | 32 | @Excel(name = "图片") |
| 33 | private String image; | 33 | private String image; |
| 34 | - | ||
| 35 | - private byte [] content; | ||
| 36 | - | ||
| 37 | - public byte[] getContent(){ | ||
| 38 | - if(image==null){ | ||
| 39 | - return null; | ||
| 40 | - } | ||
| 41 | - try { | ||
| 42 | - return image.getBytes("UTF-8"); | ||
| 43 | - } catch (UnsupportedEncodingException e) { | ||
| 44 | - e.printStackTrace(); | ||
| 45 | - } | ||
| 46 | - return null; | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - public void setContent(byte [] content) { | ||
| 50 | - this.content = content; | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | /** 签到结果 */ | 34 | /** 签到结果 */ |
| 54 | @Excel(name = "签到结果") | 35 | @Excel(name = "签到结果") |
| 55 | private Integer status; | 36 | private Integer status; |
ruoyi-admin/src/main/java/com/ruoyi/in/mapper/SignInMapper.java
ruoyi-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
ruoyi-admin/src/main/resources/mapper/in/SignInMapper.xml
| @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 21 | </resultMap> | 21 | </resultMap> |
| 22 | 22 | ||
| 23 | <sql id="selectSignInVo"> | 23 | <sql id="selectSignInVo"> |
| 24 | - select id, create_time, jobCode, ip, image, status, update_by, singn_in, alcohol_flag, type, update_time, alcohol_intake, remark from sign_in | 24 | + select id, create_time, jobCode, ip,image, status, update_by, singn_in, alcohol_flag, type, update_time, alcohol_intake, remark from sign_in |
| 25 | </sql> | 25 | </sql> |
| 26 | 26 | ||
| 27 | <select id="selectSignInList" parameterType="SignIn" resultMap="SignInResult"> | 27 | <select id="selectSignInList" parameterType="SignIn" resultMap="SignInResult"> |
| @@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 42 | <include refid="selectSignInVo"/> | 42 | <include refid="selectSignInVo"/> |
| 43 | where id = #{id} | 43 | where id = #{id} |
| 44 | </select> | 44 | </select> |
| 45 | - | 45 | + |
| 46 | <insert id="insertSignIn" parameterType="SignIn" useGeneratedKeys="true" keyProperty="id"> | 46 | <insert id="insertSignIn" parameterType="SignIn" useGeneratedKeys="true" keyProperty="id"> |
| 47 | insert into sign_in | 47 | insert into sign_in |
| 48 | <trim prefix="(" suffix=")" suffixOverrides=","> | 48 | <trim prefix="(" suffix=")" suffixOverrides=","> |