Browse Source

用户增加可查看设备类型字段

master
review512jwy@163.com 3 weeks ago
parent
commit
ebee3ce9a1
  1. 24
      dongjian-center-admin-dao/src/main/java/com/dongjian/datacenter/admin/dao/auto/BasicUserMapper.java
  2. 122
      dongjian-center-admin-dao/src/main/resources/mappers/auto/BasicUserMapper.xml
  3. 1
      dongjian-center-admin-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml
  4. 8
      dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/dto/user/OptUserParam.java
  5. 34
      dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/model/BasicUser.java
  6. 3
      dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/vo/user/UserPageDTO.java
  7. 7
      dongjian-center-admin-service/src/main/java/com/dongjian/datacenter/admin/service/impl/UserServiceImpl.java

24
dongjian-center-admin-dao/src/main/java/com/dongjian/datacenter/admin/dao/auto/BasicUserMapper.java

@ -46,6 +46,14 @@ public interface BasicUserMapper {
*/
int insertSelective(BasicUser record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
*
* @mbg.generated
*/
List<BasicUser> selectByExampleWithBLOBs(BasicUserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
@ -70,6 +78,14 @@ public interface BasicUserMapper {
*/
int updateByExampleSelective(@Param("record") BasicUser record, @Param("example") BasicUserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") BasicUser record, @Param("example") BasicUserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
@ -86,6 +102,14 @@ public interface BasicUserMapper {
*/
int updateByPrimaryKeySelective(BasicUser record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(BasicUser record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user

122
dongjian-center-admin-dao/src/main/resources/mappers/auto/BasicUserMapper.xml

@ -30,6 +30,13 @@
<result column="first_name" jdbcType="VARCHAR" property="firstName" />
<result column="adsc_flag" jdbcType="INTEGER" property="adscFlag" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.dongjian.datacenter.admin.model.BasicUser">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="authorized_device_category_type" jdbcType="LONGVARCHAR" property="authorizedDeviceCategoryType" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
@ -105,6 +112,34 @@
mfa_bind, mobile_number, last_login_time, flag, expire_time, create_time, creator_id,
modify_time, modifier_id, super_role, create_platform, last_name, first_name, adsc_flag
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
authorized_device_category_type
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.dongjian.datacenter.admin.model.BasicUserExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from basic_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.dongjian.datacenter.admin.model.BasicUserExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
@ -124,13 +159,15 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from basic_user
where id = #{id,jdbcType=BIGINT}
</select>
@ -167,7 +204,8 @@
expire_time, create_time, creator_id,
modify_time, modifier_id, super_role,
create_platform, last_name, first_name,
adsc_flag)
adsc_flag, authorized_device_category_type
)
values (#{userType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR},
#{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{mfaSecret,jdbcType=VARCHAR}, #{mfaBind,jdbcType=INTEGER},
@ -175,7 +213,8 @@
#{expireTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
#{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{superRole,jdbcType=INTEGER},
#{createPlatform,jdbcType=INTEGER}, #{lastName,jdbcType=VARCHAR}, #{firstName,jdbcType=VARCHAR},
#{adscFlag,jdbcType=INTEGER})
#{adscFlag,jdbcType=INTEGER}, #{authorizedDeviceCategoryType,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.dongjian.datacenter.admin.model.BasicUser">
<!--
@ -253,6 +292,9 @@
<if test="adscFlag != null">
adsc_flag,
</if>
<if test="authorizedDeviceCategoryType != null">
authorized_device_category_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userType != null">
@ -321,6 +363,9 @@
<if test="adscFlag != null">
#{adscFlag,jdbcType=INTEGER},
</if>
<if test="authorizedDeviceCategoryType != null">
#{authorizedDeviceCategoryType,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.dongjian.datacenter.admin.model.BasicUserExample" resultType="java.lang.Long">
@ -409,11 +454,48 @@
<if test="record.adscFlag != null">
adsc_flag = #{record.adscFlag,jdbcType=INTEGER},
</if>
<if test="record.authorizedDeviceCategoryType != null">
authorized_device_category_type = #{record.authorizedDeviceCategoryType,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update basic_user
set id = #{record.id,jdbcType=BIGINT},
user_type = #{record.userType,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
username = #{record.username,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
`password` = #{record.password,jdbcType=VARCHAR},
salt = #{record.salt,jdbcType=VARCHAR},
email = #{record.email,jdbcType=VARCHAR},
mfa_secret = #{record.mfaSecret,jdbcType=VARCHAR},
mfa_bind = #{record.mfaBind,jdbcType=INTEGER},
mobile_number = #{record.mobileNumber,jdbcType=VARCHAR},
last_login_time = #{record.lastLoginTime,jdbcType=BIGINT},
flag = #{record.flag,jdbcType=INTEGER},
expire_time = #{record.expireTime,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=BIGINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
modify_time = #{record.modifyTime,jdbcType=BIGINT},
modifier_id = #{record.modifierId,jdbcType=BIGINT},
super_role = #{record.superRole,jdbcType=INTEGER},
create_platform = #{record.createPlatform,jdbcType=INTEGER},
last_name = #{record.lastName,jdbcType=VARCHAR},
first_name = #{record.firstName,jdbcType=VARCHAR},
adsc_flag = #{record.adscFlag,jdbcType=INTEGER},
authorized_device_category_type = #{record.authorizedDeviceCategoryType,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
@ -520,9 +602,43 @@
<if test="adscFlag != null">
adsc_flag = #{adscFlag,jdbcType=INTEGER},
</if>
<if test="authorizedDeviceCategoryType != null">
authorized_device_category_type = #{authorizedDeviceCategoryType,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.dongjian.datacenter.admin.model.BasicUser">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update basic_user
set user_type = #{userType,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
username = #{username,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
salt = #{salt,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
mfa_secret = #{mfaSecret,jdbcType=VARCHAR},
mfa_bind = #{mfaBind,jdbcType=INTEGER},
mobile_number = #{mobileNumber,jdbcType=VARCHAR},
last_login_time = #{lastLoginTime,jdbcType=BIGINT},
flag = #{flag,jdbcType=INTEGER},
expire_time = #{expireTime,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=BIGINT},
creator_id = #{creatorId,jdbcType=BIGINT},
modify_time = #{modifyTime,jdbcType=BIGINT},
modifier_id = #{modifierId,jdbcType=BIGINT},
super_role = #{superRole,jdbcType=INTEGER},
create_platform = #{createPlatform,jdbcType=INTEGER},
last_name = #{lastName,jdbcType=VARCHAR},
first_name = #{firstName,jdbcType=VARCHAR},
adsc_flag = #{adscFlag,jdbcType=INTEGER},
authorized_device_category_type = #{authorizedDeviceCategoryType,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.dongjian.datacenter.admin.model.BasicUser">
<!--
WARNING - @mbg.generated

1
dongjian-center-admin-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml

@ -30,6 +30,7 @@
buser.mobile_number mobileNumber,
buser.create_time createTime,
buser.adsc_flag,
buser.authorized_device_category_type,
any_value(brole.id) roleId,
any_value(brole.role_name) roleName
FROM

8
dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/dto/user/OptUserParam.java

@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author zhc
* @time 2022年6月14日10:56:38
@ -45,6 +47,8 @@ public class OptUserParam {
@Schema(description = "adsc标识, 0-不是, 1-是",example = "1", required = true)
private Integer adscFlag;
@Schema(description = "可查看数据的设备类型,f10=キング通信,csdj=コルソス,main=中央監視", example = "[f10,main]")
private List<String> authorizedDeviceCategoryType;
}

34
dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/model/BasicUser.java

@ -210,6 +210,15 @@ public class BasicUser implements Serializable {
*/
private Integer adscFlag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_user.authorized_device_category_type
*
* @mbg.generated
*/
private String authorizedDeviceCategoryType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table basic_user
@ -770,6 +779,30 @@ public class BasicUser implements Serializable {
this.adscFlag = adscFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_user.authorized_device_category_type
*
* @return the value of basic_user.authorized_device_category_type
*
* @mbg.generated
*/
public String getAuthorizedDeviceCategoryType() {
return authorizedDeviceCategoryType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_user.authorized_device_category_type
*
* @param authorizedDeviceCategoryType the value for basic_user.authorized_device_category_type
*
* @mbg.generated
*/
public void setAuthorizedDeviceCategoryType(String authorizedDeviceCategoryType) {
this.authorizedDeviceCategoryType = authorizedDeviceCategoryType == null ? null : authorizedDeviceCategoryType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
@ -805,6 +838,7 @@ public class BasicUser implements Serializable {
sb.append(", lastName=").append(lastName);
sb.append(", firstName=").append(firstName);
sb.append(", adscFlag=").append(adscFlag);
sb.append(", authorizedDeviceCategoryType=").append(authorizedDeviceCategoryType);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

3
dongjian-center-admin-model/src/main/java/com/dongjian/datacenter/admin/vo/user/UserPageDTO.java

@ -57,5 +57,8 @@ public class UserPageDTO {
@Schema(description = "adsc标识, 0-不是, 1-是",example = "1", required = true)
private Integer adscFlag;
@Schema(description = "可查看数据的设备类型,f10=キング通信,csdj=コルソス,main=中央監視", example = "[f10,main]")
private String authorizedDeviceCategoryType;
}

7
dongjian-center-admin-service/src/main/java/com/dongjian/datacenter/admin/service/impl/UserServiceImpl.java

@ -1,6 +1,7 @@
package com.dongjian.datacenter.admin.service.impl;
import com.dongjian.datacenter.admin.common.Constants;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper;
import com.dongjian.datacenter.admin.common.exception.MsgCodeException;
import com.dongjian.datacenter.admin.common.language.msg.MsgLanguageChange;
@ -61,6 +62,8 @@ public class UserServiceImpl implements UserService {
//同时含大写字母、小写字母、数字和特殊字符且长度大于8
private static final String pwdPattern = "^(?=.*\\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\\da-zA-Z~!@#$%^&*]{12,}$";
private static final ObjectMapper objectMapper = new ObjectMapper();
@Autowired
@Qualifier("redisTemplateForBusiness")
private RedisTemplate<String, Serializable> redisTemplateForBusiness;
@ -124,6 +127,7 @@ public class UserServiceImpl implements UserService {
long currentUnix = System.currentTimeMillis();
BasicUser basicUser = new BasicUser();
BeanUtils.copyProperties(param, basicUser);
basicUser.setAuthorizedDeviceCategoryType(objectMapper.writeValueAsString(param.getAuthorizedDeviceCategoryType()));
basicUser.setCreatorId(userId);
basicUser.setCreateTime(currentUnix);
basicUser.setModifierId(userId);
@ -261,6 +265,9 @@ public class UserServiceImpl implements UserService {
long currentUnix = System.currentTimeMillis();
BasicUser basicUser = new BasicUser();
BeanUtils.copyProperties(param, basicUser);
if (null != param.getAuthorizedDeviceCategoryType()){
basicUser.setAuthorizedDeviceCategoryType(objectMapper.writeValueAsString(param.getAuthorizedDeviceCategoryType()));
}
basicUser.setId(param.getUserId());
basicUser.setModifierId(userId);
basicUser.setModifyTime(currentUnix);

Loading…
Cancel
Save