初始化
This commit is contained in:
parent
d1726e0201
commit
131480306f
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.admin.controller;
|
||||||
import com.nflg.wms.admin.service.UserControllerService;
|
import com.nflg.wms.admin.service.UserControllerService;
|
||||||
import com.nflg.wms.common.pojo.ApiResult;
|
import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
import com.nflg.wms.common.pojo.PageData;
|
||||||
|
import com.nflg.wms.common.pojo.dto.UserDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.RoleSimpleVO;
|
import com.nflg.wms.common.pojo.vo.RoleSimpleVO;
|
||||||
import com.nflg.wms.common.pojo.vo.UserVO;
|
import com.nflg.wms.common.pojo.vo.UserVO;
|
||||||
|
|
@ -125,4 +126,12 @@ public class UserController extends BaseController {
|
||||||
userControllerService.sendForgetPasswordEmail(email);
|
userControllerService.sendForgetPasswordEmail(email);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户信息
|
||||||
|
*/
|
||||||
|
@GetMapping("getUserInfo")
|
||||||
|
public ApiResult<UserDTO> getUserInfo() {
|
||||||
|
return ApiResult.success(userControllerService.getUserInfo());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.nflg.wms.admin.service;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
@ -15,6 +16,7 @@ import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.pojo.dto.AdDTO;
|
import com.nflg.wms.common.pojo.dto.AdDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.SupplierExcelDTO;
|
import com.nflg.wms.common.pojo.dto.SupplierExcelDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.SupplierExcelExportDTO;
|
import com.nflg.wms.common.pojo.dto.SupplierExcelExportDTO;
|
||||||
|
import com.nflg.wms.common.pojo.dto.UserDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.RoleSimpleVO;
|
import com.nflg.wms.common.pojo.vo.RoleSimpleVO;
|
||||||
import com.nflg.wms.common.pojo.vo.UserSupplierVO;
|
import com.nflg.wms.common.pojo.vo.UserSupplierVO;
|
||||||
|
|
@ -80,14 +82,19 @@ public class UserControllerService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IDictionaryItemTranslateService dictionaryItemTranslateService;
|
private IDictionaryItemTranslateService dictionaryItemTranslateService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IUserSupplierService userSupplierService;
|
private IUserSupplierService userSupplierService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FileUploadService fileUploadService;
|
private FileUploadService fileUploadService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IVUserSupplierService vUserSupplierService;
|
private IVUserSupplierService vUserSupplierService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IVUserService vUserService;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void add(@Valid UserAddQO request) {
|
public void add(@Valid UserAddQO request) {
|
||||||
VUtil.trueThrowBusinessError(uService.lambdaQuery()
|
VUtil.trueThrowBusinessError(uService.lambdaQuery()
|
||||||
|
|
@ -510,4 +517,9 @@ public class UserControllerService {
|
||||||
public List<DictionaryItem> getTypeList() {
|
public List<DictionaryItem> getTypeList() {
|
||||||
return dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SUPPLIERS_CATEGORY);
|
return dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SUPPLIERS_CATEGORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserDTO getUserInfo() {
|
||||||
|
VUser vUser=vUserService.getById(UserUtil.getUserId());
|
||||||
|
return Convert.convert(UserDTO.class,vUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.nflg.wms.common.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserDTO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱地址
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态,1-启用,2:禁用
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户工号,登录号
|
||||||
|
*/
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认语言
|
||||||
|
*/
|
||||||
|
private String languageCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户类型,员工或者供应商
|
||||||
|
*/
|
||||||
|
private String userType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职位id
|
||||||
|
*/
|
||||||
|
private Long positionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职位名称
|
||||||
|
*/
|
||||||
|
private String positionName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商名称
|
||||||
|
*/
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商类别
|
||||||
|
*/
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商类别名称
|
||||||
|
*/
|
||||||
|
private String typeName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@TableName("v_user")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class VUser implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
private Short state;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
private String sourceId;
|
||||||
|
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private Boolean mustResetPwd;
|
||||||
|
|
||||||
|
private String languageCode;
|
||||||
|
|
||||||
|
private Long adId;
|
||||||
|
|
||||||
|
private Boolean enableMustResetPwd;
|
||||||
|
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
private Long positionId;
|
||||||
|
|
||||||
|
private String positionName;
|
||||||
|
|
||||||
|
private String supplierCode;
|
||||||
|
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
private String abbreviation;
|
||||||
|
|
||||||
|
private String abbreviation1;
|
||||||
|
|
||||||
|
private String abbreviation2;
|
||||||
|
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
private String userType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nflg.wms.repository.entity.VUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
|
public interface VUserMapper extends BaseMapper<VUser> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nflg.wms.repository.entity.VUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
|
public interface IVUserService extends IService<VUser> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -79,6 +79,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||||
public void delete(Long id) {
|
public void delete(Long id) {
|
||||||
User user = getById(id);
|
User user = getById(id);
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(user)).throwMessage("用户不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(user)).throwMessage("用户不存在");
|
||||||
|
removeById(id);
|
||||||
auditLogService.addDelete(User.class, user, UserUtil.getUserName());
|
auditLogService.addDelete(User.class, user, UserUtil.getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nflg.wms.repository.entity.VUser;
|
||||||
|
import com.nflg.wms.repository.mapper.VUserMapper;
|
||||||
|
import com.nflg.wms.repository.service.IVUserService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class VUserServiceImpl extends ServiceImpl<VUserMapper, VUser> implements IVUserService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nflg.wms.repository.mapper.VUserMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
||||||
)
|
)
|
||||||
.strategyConfig(builder -> {
|
.strategyConfig(builder -> {
|
||||||
builder
|
builder
|
||||||
.addInclude("v_user_supplier") //只生成指定表
|
.addInclude("v_user") //只生成指定表
|
||||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||||
.enableLombok()
|
.enableLombok()
|
||||||
.enableChainModel()
|
.enableChainModel()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue