¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | |
| | | import com.ruoyi.system.service.UserService; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/newUser") |
| | | public class UserController { |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @TableName("custom") |
| | | public class Custom implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String company; |
| | | |
| | | @ApiModelProperty(value = "åä½å°å") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "å·¥åå") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "客æ·ç¼å·") |
| | | private String code2; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "客æ·åä½EN") |
| | | private String companyEn; |
| | | |
| | | @ApiModelProperty(value = "åä½å°åEN") |
| | | private String addressEn; |
| | | |
| | | @ApiModelProperty(value = "å æ¥é¢åº¦") |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "åä½çµè¯") |
| | | private String phone; |
| | | } |
| | |
| | | |
| | | /** |
| | | * ç¨æ·å¯¹è±¡ sys_user |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUser extends BaseEntity |
| | |
| | | @Excel(name = "ç¨æ·åç§°") |
| | | private String nickName; |
| | | |
| | | /** è±æåç§° */ |
| | | private String nameEn; |
| | | |
| | | /** ç¨æ·é®ç®± */ |
| | | @Excel(name = "ç¨æ·é®ç®±") |
| | | private String email; |
| | |
| | | |
| | | /** ç¨æ·å¤´å */ |
| | | private String avatar; |
| | | |
| | | /** ç¾åå°å */ |
| | | private String signatureUrl; |
| | | |
| | | /** åä½id */ |
| | | private String company; |
| | | |
| | | /** å¯ç */ |
| | | private String password; |
| | |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public String getNameEn() |
| | | { |
| | | return nameEn; |
| | | } |
| | | |
| | | public void setNameEn(String nameEn) |
| | | { |
| | | this.nameEn = nameEn; |
| | | } |
| | | |
| | | public String getSignatureUrl() |
| | | { |
| | | return signatureUrl; |
| | | } |
| | | |
| | | public void setSignatureUrl(String signatureUrl) |
| | | { |
| | | this.signatureUrl = signatureUrl; |
| | | } |
| | | |
| | | public String getCompany() |
| | | { |
| | | return company; |
| | | } |
| | | |
| | | public void setCompany(String company) |
| | | { |
| | | this.company = company; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | @Data |
| | | @TableName("user") |
| | | public class User { |
| | | |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "é¨é¨ID") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·è´¦å·") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·æµç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "è±æå") |
| | | private String nameEn; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ç±»åï¼00ç³»ç»ç¨æ·ï¼") |
| | | private String userType; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·é®ç®±") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "ææºå·ç ") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·æ§å«ï¼0ç· 1女 2æªç¥ï¼") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "å¹´é¾") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "ç¾åå°å") |
| | | private String signatureUrl; |
| | | |
| | | @ApiModelProperty(value = "头åå°å") |
| | | private String pictureUrl; |
| | | |
| | | @ApiModelProperty(value = "å¯ç ") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "å¸å·ç¶æï¼0æ£å¸¸ 1åç¨ï¼") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼") |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "æåç»å½IP") |
| | | private String loginIp; |
| | | |
| | | @ApiModelProperty(value = "æåç»å½æ¶é´") |
| | | private Date loginDate; |
| | | |
| | | @ApiModelProperty(value = "cnaså®éªå®¤id") |
| | | private String departLimsId; |
| | | |
| | | @ApiModelProperty(value = "åä½id") |
| | | private String company; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å®¢æ· 0: å¦, 1:æ¯") |
| | | private Integer isCustom; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建è
") |
| | | private String createBy; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°è
") |
| | | private String updateBy; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.entity.Custom; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | public interface CustomMapper extends BaseMapper<Custom> { |
| | | |
| | | IPage<Custom> selectCustomPageList(IPage<Custom> page, QueryWrapper<Custom> ew); |
| | | |
| | | int delCustomById(Integer id); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | public interface UserMapper extends BaseMapper<User> { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.Custom; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãuser(ç¨æ·id)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024å¹´3æ7æ¥09:21:59 |
| | | */ |
| | | public interface CustomService extends IService<Custom> { |
| | | |
| | | Map<String, Object> selectCustomPageList(IPage<Custom> page, Custom custom); |
| | | |
| | | int delCustomById(Long id); |
| | | |
| | | int addCustom(Custom custom); |
| | | |
| | | int upCustom(Custom custom); |
| | | |
| | | List<Custom> selectCustomEnum(); |
| | | |
| | | Custom getCustomId(String company); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | public interface UserService extends IService<User> { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.Custom; |
| | | import com.ruoyi.system.mapper.CustomMapper; |
| | | import com.ruoyi.system.service.CustomService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãpower(ç¨æ·id)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2023-12-27 02:37:38 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> |
| | | implements CustomService { |
| | | |
| | | private CustomMapper customMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectCustomPageList(IPage<Custom> page, Custom custom) { |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public int delCustomById(Long id) { |
| | | return customMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int addCustom(Custom custom) { |
| | | return customMapper.insert(custom); |
| | | } |
| | | |
| | | @Override |
| | | public int upCustom(Custom custom) { |
| | | return customMapper.updateById(custom); |
| | | } |
| | | |
| | | @Override |
| | | public List<Custom> selectCustomEnum() { |
| | | return customMapper.selectList(Wrappers.<Custom>lambdaQuery().select(Custom::getId,Custom::getCompany)); |
| | | } |
| | | |
| | | @Override |
| | | public Custom getCustomId(String company) { |
| | | return customMapper.selectOne(Wrappers.<Custom>lambdaQuery().eq(Custom::getCompany, company).last("limit 1")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import com.ruoyi.system.service.UserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | @Service |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { |
| | | |
| | | } |
| | | |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="nameEn" column="name_en" /> |
| | | <result property="signatureUrl" column="signature_url" /> |
| | | <result property="company" column="company" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.picture_url, u.phone, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.picture_url, u.phone, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.name_en, u.signature_url, u.company, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from user u |
| | |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="nameEn != null and nameEn != ''">name_en,</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">signature_url,</if> |
| | | <if test="company != null and company != ''">company,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="nameEn != null and nameEn != ''">#{nameEn},</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">#{signatureUrl},</if> |
| | | <if test="company != null and company != ''">#{company},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if> |
| | | <if test="signatureUrl != null and signatureUrl != ''">signature_url = #{signatureUrl},</if> |
| | | <if test="company != null and company != ''">company = #{company},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where id = #{userId} |