个人中心接口
This commit is contained in:
parent
8c9757ea46
commit
c0f0a6b96a
@ -117,15 +117,7 @@ public class SystemUserController {
|
||||
@ApiImplicitParam(name = "id", value = "账号ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<SystemUser> queryById(@RequestBody Map<String, Object> map) {
|
||||
Result<SystemUser> result = new Result<SystemUser>();
|
||||
SystemUser systemUser = systemUserService.getById(MapUtils.getString(map, "id"));
|
||||
if (systemUser == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
result.setResult(systemUser);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
return Result.success(systemUserService.queryById(map));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "账号管理", operType = "修改用户密码", operDesc = "修改用户密码")
|
||||
|
||||
@ -138,6 +138,11 @@ public class SystemUser implements Serializable {
|
||||
private Long xzProjectOrgId;
|
||||
@ApiModelProperty(value = "星纵-项目组织机构对象")
|
||||
private String xzProjectOrgObj;
|
||||
@ApiModelProperty(value = "性别,1男,2女")
|
||||
private java.lang.Integer sex;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private java.lang.String personMail;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@ -174,6 +179,7 @@ public class SystemUser implements Serializable {
|
||||
private java.lang.String graphValidateCodeUuid;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "新用户或供应商的注册邮箱")
|
||||
private java.lang.String email;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -191,10 +197,8 @@ public class SystemUser implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private java.lang.Long enterpriseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private java.lang.String personMail;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "默认1,通过邮箱验证,0则不通过邮箱验证")
|
||||
private java.lang.Integer isCheckCode;
|
||||
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
List<SystemUser> getSecondComapnyProjectSystemUserList(Map<String, Object> map);
|
||||
|
||||
@DataScope(includeTable = "enterprise_info")
|
||||
List<SystemUser> getProjectChilderSystemUserList(Map<String, Object> map);
|
||||
List<SystemUser> getProjectChilderSystemUserList(@Param("param") Map<String, Object> map);
|
||||
|
||||
List<String> selectUserNameList(@Param("inspectUser") String inspectUser);
|
||||
|
||||
@ -112,4 +112,6 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
Page<SystemUser> getTenantListBySn(@Param("map") Map<String, Object> map, Page page);
|
||||
|
||||
List<SystemUser> getUsersByRegionId(Long id);
|
||||
|
||||
SystemUser queryById(@Param("param") Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1,6 +1,61 @@
|
||||
<?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.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper">
|
||||
<sql id="whereChildren">
|
||||
and t.sn = #{param.projectSn}
|
||||
and t.account_type = 6
|
||||
</sql>
|
||||
<sql id="where">
|
||||
<if test="param.userId != null and param.userId != ''">
|
||||
and t.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.id != null and param.id != ''">
|
||||
and t.user_id = #{param.id}
|
||||
</if>
|
||||
<if test="param.workerName != null and param.workerName != ''">
|
||||
and d.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
|
||||
</if>
|
||||
<if test="param.workerId != null and param.workerId != ''">
|
||||
and d.id = #{param.workerId}
|
||||
</if>
|
||||
<if test="param.enterpriseIdList != null and enterpriseIdList.param.size() > 0">
|
||||
and d.enterprise_id in
|
||||
<foreach collection="enterpriseIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{param.item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.enterpriseTypeId != null and param.enterpriseTypeId != ''">
|
||||
and pe.enterprise_type_id = #{param.enterpriseTypeId}
|
||||
</if>
|
||||
<if test="param.xzProjectOrgId != null and param.xzProjectOrgId != ''">
|
||||
and xpo.id = #{param.xzProjectOrgId}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="selectTable">
|
||||
SELECT t.worker_id as id,
|
||||
if(t.account_type=6,d.worker_name,t.real_name) as real_name,
|
||||
if(t.account_type=6,d.sex,t.sex) as sex,
|
||||
if(t.account_type=6,d.person_mail,t.person_mail) as person_mail,
|
||||
t.*,
|
||||
c.role_name,
|
||||
d.worker_name,
|
||||
b.role_id,
|
||||
po.dept_name as projectOrgName,
|
||||
d.enterprise_id,
|
||||
d.person_mail
|
||||
from system_user t
|
||||
LEFT JOIN base_role_user b ON t.user_id = b.user_id
|
||||
LEFT JOIN base_role c ON c.role_id = b.role_id
|
||||
LEFT JOIN worker_info d ON t.worker_id = d.id
|
||||
LEFT JOIN xz_project_org po on po.id=t.xz_project_org_id
|
||||
LEFT JOIN enterprise_info ei on ei.id=d.enterprise_id
|
||||
LEFT JOIN project_enterprise pe on pe.enterprise_id=ei.id and pe.project_sn=t.sn
|
||||
left join xz_project_org xpo on xpo.id=t.xz_project_org_id
|
||||
<if test="param.qualityRegionId != null and param.qualityRegionId != ''">
|
||||
JOIN quality_region_to_user qrtu on ei.id = qrtu.enterprise_id and t.user_id=qrtu.user_id and
|
||||
qrtu.quality_region_id = #{param.qualityRegionId}
|
||||
</if>
|
||||
</sql>
|
||||
<select id="getSystemUserBySn" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="map">
|
||||
SELECT a.*, jb.job_name
|
||||
from system_user a
|
||||
@ -27,43 +82,14 @@
|
||||
</select>
|
||||
<select id="getProjectChilderSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser"
|
||||
parameterType="map">
|
||||
SELECT a.worker_id as id, a.*, c.role_name, d.worker_name, b.role_id,po.dept_name
|
||||
projectOrgName,d.enterprise_id,d.person_mail
|
||||
from system_user a
|
||||
LEFT JOIN base_role_user b ON a.user_id = b.user_id
|
||||
LEFT JOIN base_role c ON c.role_id = b.role_id
|
||||
LEFT JOIN worker_info d ON a.worker_id = d.id
|
||||
LEFT JOIN xz_project_org po on po.id=a.xz_project_org_id
|
||||
LEFT JOIN enterprise_info ei on ei.id=d.enterprise_id
|
||||
LEFT JOIN project_enterprise pe on pe.enterprise_id=ei.id and pe.project_sn=a.sn
|
||||
left join xz_project_org xpo on xpo.id=a.xz_project_org_id
|
||||
<if test="qualityRegionId != null and qualityRegionId != ''">
|
||||
JOIN quality_region_to_user qrtu on ei.id = qrtu.enterprise_id and a.user_id=qrtu.user_id and
|
||||
qrtu.quality_region_id = #{qualityRegionId}
|
||||
</if>
|
||||
WHERE a.sn = #{projectSn}
|
||||
and a.account_type = 6
|
||||
<if test="workerName != null and workerName != ''">
|
||||
and d.worker_name like CONCAT(CONCAT('%', #{workerName}), '%')
|
||||
</if>
|
||||
<if test="workerId != null and workerId != ''">
|
||||
and d.id = #{workerId}
|
||||
</if>
|
||||
<if test="enterpriseIdList != null and enterpriseIdList.size() > 0">
|
||||
and d.enterprise_id in
|
||||
<foreach collection="enterpriseIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="enterpriseTypeId != null and enterpriseTypeId != ''">
|
||||
and pe.enterprise_type_id = #{enterpriseTypeId}
|
||||
</if>
|
||||
<if test="xzProjectOrgId != null and xzProjectOrgId != ''">
|
||||
and xpo.id = #{xzProjectOrgId}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and a.user_id = #{userId}
|
||||
</if>
|
||||
<include refid="selectTable">
|
||||
</include>
|
||||
<where>
|
||||
<include refid="whereChildren">
|
||||
</include>
|
||||
<include refid="where">
|
||||
</include>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findByUsername" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="string">
|
||||
select *
|
||||
@ -258,4 +284,13 @@
|
||||
join quality_region_to_user qrtu on su.user_id = qrtu.user_id
|
||||
where qrtu.quality_region_id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="queryById" resultMap="zjwjUserPage">
|
||||
<include refid="selectTable">
|
||||
</include>
|
||||
<where>
|
||||
<include refid="where">
|
||||
</include>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -126,4 +126,6 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
* 查找项目子账号列表
|
||||
*/
|
||||
List<SystemUser> getProjectChilderSystemUserList(Map<String, Object> map);
|
||||
|
||||
SystemUser queryById(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -818,6 +818,11 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
return systemUserMapper.getProjectChilderSystemUserList(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemUser queryById(Map<String, Object> map) {
|
||||
return baseMapper.queryById(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addProjectUser(SystemUser systemUser) {
|
||||
QueryWrapper<SystemUser> queryWrapper = new QueryWrapper<>();
|
||||
@ -1443,7 +1448,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
}
|
||||
for (SafetyHatDev dev : devs) {
|
||||
if (!dev.getWorkerName().equals(name)) {
|
||||
throw new OpenAlertException("人员姓名错误");
|
||||
throw new OpenAlertException("身份证号和人员姓名不匹配");
|
||||
}
|
||||
}
|
||||
result.put("devInfoList", devs);
|
||||
@ -1470,15 +1475,14 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
}
|
||||
List<WorkerInfo> workerInfos = workerInfoMapper.selectList(new LambdaQueryWrapper<WorkerInfo>()
|
||||
.eq(WorkerInfo::getIdCard, idCard)
|
||||
.eq(WorkerInfo::getWorkerName, name)
|
||||
.eq(StrUtil.isNotBlank(projectSn), WorkerInfo::getProjectSn, projectSn)
|
||||
);
|
||||
if (CollUtil.isEmpty(workerInfos)) {
|
||||
return null;
|
||||
if (CollUtil.isEmpty(workerInfos) || workerInfos.stream().anyMatch(workerInfo -> workerInfo.getInserviceType() != 1)) {
|
||||
throw new OpenAlertException("身份证号不存在");
|
||||
}
|
||||
for (WorkerInfo dev : workerInfos) {
|
||||
if (!dev.getWorkerName().equals(name)) {
|
||||
throw new OpenAlertException("人员姓名错误");
|
||||
throw new OpenAlertException("身份证号和人员姓名不匹配");
|
||||
}
|
||||
}
|
||||
return workerInfos.get(0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user