| | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsername(); |
| | | String userName2 = SecurityUtils.getUsernameApplet(); |
| | | if (StringUtils.isNotBlank(userName)||StringUtils.isNotBlank(userName2)){ |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | this.setFieldValByName("createBy", userName2, metaObject); |
| | | this.setFieldValByName("updateBy", userName2, metaObject); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsername(); |
| | | String userName2 = SecurityUtils.getUsernameApplet(); |
| | | if (StringUtils.isNotBlank(userName)||StringUtils.isNotBlank(userName2)){ |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | this.setFieldValByName("createBy", userName2, metaObject); |
| | | this.setFieldValByName("updateBy", userName2, metaObject); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |