Commit 4f6a1b6ae5a28207a349d6767b799e7a05079e0c

Authored by guzijian
1 parent 72330b78

fix: resolve bug

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