add 企业联系人登录
This commit is contained in:
+123
@@ -0,0 +1,123 @@
|
||||
package com.jero.modules.pay.company.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.modules.system.volid.group.CreateGroup;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_contacts_management")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_contacts_management对象", description="pay_contacts_management")
|
||||
public class PayContactsManagement implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**企业id*/
|
||||
@ApiModelProperty(value = "企业id")
|
||||
@Size(max = 32, message = "企业id长度不能大于32个字符")
|
||||
private String companyId;
|
||||
/**企业名称*/
|
||||
@Excel(name = "企业名称", width = 15)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@Size(max = 200, message = "企业名称长度不能大于200个字符")
|
||||
private String companyName;
|
||||
/**姓名*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
@NotEmpty(message = "姓名不能为空!")
|
||||
@Size(max = 20, message = "姓名长度不能大于20个字符")
|
||||
private String name;
|
||||
/**性别(1:男,2:女)*/
|
||||
@Excel(name = "性别", width = 15,dicCode="sex")
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Dict(dicCode = "sex")
|
||||
private Integer gender;
|
||||
/**职务*/
|
||||
@Excel(name = "职务", width = 15)
|
||||
@ApiModelProperty(value = "职务")
|
||||
@Size(max = 20, message = "职务长度不能大于20个字符")
|
||||
private String post;
|
||||
/**手机号*/
|
||||
@Excel(name = "手机号", width = 15)
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空!")
|
||||
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号码格式错误")
|
||||
private String phone;
|
||||
/**邮箱*/
|
||||
@Excel(name = "邮箱", width = 15)
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Pattern(regexp = "^\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}$",message = "邮箱格式有误")
|
||||
@NotEmpty(message = "邮箱不能为空!")
|
||||
private String email;
|
||||
/**通讯地址*/
|
||||
@Excel(name = "通讯地址", width = 15)
|
||||
@ApiModelProperty(value = "通讯地址")
|
||||
@Size(max = 50, message = "通讯地址长度不能大于50个字符")
|
||||
@NotEmpty(message = "通讯地址不能为空!")
|
||||
private String contactAddress;
|
||||
/**邮政编码*/
|
||||
@Excel(name = "邮政编码", width = 15)
|
||||
@Size(min=6,max = 6,message = "邮政编码长度必须为6个字符")
|
||||
@ApiModelProperty(value = "邮政编码")
|
||||
@Pattern(regexp = "^[0-9]\\d{5}$",message = "邮编格式错误")
|
||||
@NotEmpty(message = "邮政编码不能为空!")
|
||||
private String postalCode;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Size(max = 200, message = "备注长度不能大于200个字符")
|
||||
private String remarks;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* md5密码盐
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String salt;
|
||||
}
|
||||
+3
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.pay.company.entity.PayContactsManagement;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.vo.SysUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -162,4 +163,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
List<SysRole> getRoleNameByUserIds(@Param("userIds") List<String> userIds);
|
||||
|
||||
PayContactsManagement getPayContactsManagementByPhone(@Param("username") String username);
|
||||
}
|
||||
|
||||
+5
@@ -199,4 +199,9 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getPayContactsManagementByPhone" resultType="com.jero.modules.pay.company.entity.PayContactsManagement">
|
||||
select *
|
||||
from pay_contacts_management where phone = #{username};
|
||||
</select>
|
||||
</mapper>
|
||||
+11
-5
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.jero.modules.oss.mapper.OSSFileMapper;
|
||||
import com.jero.modules.pay.company.entity.PayContactsManagement;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -95,7 +96,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
private SysPermissionMapper sysPermissionMapper;
|
||||
@Autowired
|
||||
private ISysPermissionDataRuleService sysPermissionDataRuleService;
|
||||
|
||||
@Override
|
||||
@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
|
||||
public LoginUser getUserByName(String username) {
|
||||
@@ -105,11 +105,17 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = userMapper.getUserByName(username);
|
||||
if(sysUser==null) {
|
||||
return null;
|
||||
PayContactsManagement contactsManagement = userMapper.getPayContactsManagementByPhone(username);
|
||||
if (contactsManagement == null){
|
||||
return null;
|
||||
}else {
|
||||
BeanUtils.copyProperties(contactsManagement, loginUser);
|
||||
}
|
||||
}else {
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
List<String> roleByUserName = sysUserRoleMapper.getRoleByUserName(username);
|
||||
loginUser.setRoleCode(roleByUserName.get(0));
|
||||
}
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
List<String> roleByUserName = sysUserRoleMapper.getRoleByUserName(username);
|
||||
loginUser.setRoleCode(roleByUserName.get(0));
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user