Commit 81c8d8d797bf2088913011e65b7eb8baff1a4130
1 parent
43c6277e
fix: insert bug resolve
Showing
2 changed files
with
19 additions
and
23 deletions
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| 1 | 1 | package com.ruoyi.in.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | + | |
| 4 | 5 | import com.ruoyi.common.utils.DateUtils; |
| 5 | 6 | import com.ruoyi.common.SignInEnum; |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -11,88 +12,83 @@ import com.ruoyi.in.service.ISignInService; |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * 签到Service业务层处理 |
| 14 | - * | |
| 15 | + * | |
| 15 | 16 | * @author guzijian |
| 16 | 17 | * @date 2023-07-05 |
| 17 | 18 | */ |
| 18 | 19 | @Service |
| 19 | -public class SignInServiceImpl implements ISignInService | |
| 20 | -{ | |
| 20 | +public class SignInServiceImpl implements ISignInService { | |
| 21 | 21 | @Autowired |
| 22 | 22 | private SignInMapper signInMapper; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * 查询签到 |
| 26 | - * | |
| 26 | + * | |
| 27 | 27 | * @param id 签到主键 |
| 28 | 28 | * @return 签到 |
| 29 | 29 | */ |
| 30 | 30 | @Override |
| 31 | - public SignIn selectSignInById(Long id) | |
| 32 | - { | |
| 31 | + public SignIn selectSignInById(Long id) { | |
| 33 | 32 | return signInMapper.selectSignInById(id); |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | 35 | /** |
| 37 | 36 | * 查询签到列表 |
| 38 | - * | |
| 37 | + * | |
| 39 | 38 | * @param signIn 签到 |
| 40 | 39 | * @return 签到 |
| 41 | 40 | */ |
| 42 | 41 | @Override |
| 43 | - public List<SignIn> selectSignInList(SignIn signIn) | |
| 44 | - { | |
| 42 | + public List<SignIn> selectSignInList(SignIn signIn) { | |
| 45 | 43 | return signInMapper.selectSignInList(signIn); |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | 46 | /** |
| 49 | 47 | * 新增签到 |
| 50 | - * | |
| 48 | + * | |
| 51 | 49 | * @param signIn 签到 |
| 52 | 50 | * @return 结果 |
| 53 | 51 | */ |
| 54 | 52 | @Override |
| 55 | - public int insertSignIn(SignIn signIn) | |
| 56 | - { | |
| 53 | + public int insertSignIn(SignIn signIn) { | |
| 57 | 54 | signIn.setCreateTime(DateUtils.getNowDate()); |
| 58 | - signIn.setType(SignInEnum.SIGNIN); | |
| 55 | + if (signIn.getType() == null) { | |
| 56 | + signIn.setType(SignInEnum.SIGNIN); | |
| 57 | + } | |
| 59 | 58 | return signInMapper.insertSignIn(signIn); |
| 60 | 59 | } |
| 61 | 60 | |
| 62 | 61 | /** |
| 63 | 62 | * 修改签到 |
| 64 | - * | |
| 63 | + * | |
| 65 | 64 | * @param signIn 签到 |
| 66 | 65 | * @return 结果 |
| 67 | 66 | */ |
| 68 | 67 | @Override |
| 69 | - public int updateSignIn(SignIn signIn) | |
| 70 | - { | |
| 68 | + public int updateSignIn(SignIn signIn) { | |
| 71 | 69 | signIn.setUpdateTime(DateUtils.getNowDate()); |
| 72 | 70 | return signInMapper.updateSignIn(signIn); |
| 73 | 71 | } |
| 74 | 72 | |
| 75 | 73 | /** |
| 76 | 74 | * 批量删除签到 |
| 77 | - * | |
| 75 | + * | |
| 78 | 76 | * @param ids 需要删除的签到主键 |
| 79 | 77 | * @return 结果 |
| 80 | 78 | */ |
| 81 | 79 | @Override |
| 82 | - public int deleteSignInByIds(Long[] ids) | |
| 83 | - { | |
| 80 | + public int deleteSignInByIds(Long[] ids) { | |
| 84 | 81 | return signInMapper.deleteSignInByIds(ids); |
| 85 | 82 | } |
| 86 | 83 | |
| 87 | 84 | /** |
| 88 | 85 | * 删除签到信息 |
| 89 | - * | |
| 86 | + * | |
| 90 | 87 | * @param id 签到主键 |
| 91 | 88 | * @return 结果 |
| 92 | 89 | */ |
| 93 | 90 | @Override |
| 94 | - public int deleteSignInById(Long id) | |
| 95 | - { | |
| 91 | + public int deleteSignInById(Long id) { | |
| 96 | 92 | return signInMapper.deleteSignInById(id); |
| 97 | 93 | } |
| 98 | 94 | ... | ... |
ruoyi-admin/src/main/resources/mapper/in/SignInMapper.xml
| ... | ... | @@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 63 | 63 | <if test="createTime != null">#{createTime},</if> |
| 64 | 64 | <if test="jobCode != null">#{jobCode},</if> |
| 65 | 65 | <if test="ip != null">#{ip},</if> |
| 66 | - <if test="image != null">#{content},</if> | |
| 66 | + <if test="image != null">#{image},</if> | |
| 67 | 67 | <if test="status != null">#{status},</if> |
| 68 | 68 | <if test="updateBy != null">#{updateBy},</if> |
| 69 | 69 | <if test="singnIn != null">#{singnIn},</if> | ... | ... |