修改导入人员重复bug
This commit is contained in:
parent
43aa1c638f
commit
d77643a3fb
|
|
@ -59,4 +59,18 @@ public interface ImportMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateLinkPerson(SysFileInfo personFace);
|
int updateLinkPerson(SysFileInfo personFace);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户是否存在
|
||||||
|
* @param arg
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getUserIsCz(ImportArg arg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟新用户信息
|
||||||
|
* @param arg
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateSysUserInfo(ImportArg arg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,11 +109,20 @@ public class ImportServiceImpl implements ImportService {
|
||||||
arg.setConsUuid(consUuid);
|
arg.setConsUuid(consUuid);
|
||||||
arg.setDeptId(mapper.getDeptId(bean.getUserType()));
|
arg.setDeptId(mapper.getDeptId(bean.getUserType()));
|
||||||
arg.setPassword(password);
|
arg.setPassword(password);
|
||||||
|
int num=mapper.getUserIsCz(arg);
|
||||||
|
if(num>0){
|
||||||
|
code = mapper.updateSysUserInfo(arg);
|
||||||
|
}else{
|
||||||
|
List<ImportArg> addList=new ArrayList<>();
|
||||||
|
addList.add(arg);
|
||||||
|
code = mapper.insertSysUser(bean.getUserType(),addList);
|
||||||
|
}
|
||||||
|
if (code == 0) {
|
||||||
|
throw new RuntimeException("人员账号新增失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
code = mapper.insertSysUser(bean.getUserType(),list);
|
// code = mapper.insertSysUser(bean.getUserType(),list);
|
||||||
if (code == 0) {
|
|
||||||
throw new RuntimeException("人员账号新增失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result = AjaxResult.success("导入成功");
|
result = AjaxResult.success("导入成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
pcp.person_type AS personType,
|
pcp.person_type AS personType,
|
||||||
pcp.create_time AS createTime,
|
pcp.create_time AS createTime,
|
||||||
pcp.update_time AS updateTime
|
pcp.update_time AS updateTime
|
||||||
FROM
|
FROM pt_cons_person pcp
|
||||||
pt_cons_person pcp
|
|
||||||
left join sys_user su on pcp.phone = su.phonenumber
|
left join sys_user su on pcp.phone = su.phonenumber
|
||||||
WHERE is_active = '1' and cons_user_id = #{consUserId}
|
WHERE is_active = '1' and cons_user_id = #{consUserId}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysUserInfo">
|
||||||
|
<if test="userType == '01'">
|
||||||
|
UPDATE sys_user
|
||||||
|
SET
|
||||||
|
<if test="deptId != null and deptId != ''">
|
||||||
|
dept_id=#{deptId},
|
||||||
|
</if>
|
||||||
|
<if test="arg5 != null and arg5 != ''">
|
||||||
|
user_name = #{arg5}, phonenumber = #{arg5},
|
||||||
|
</if>
|
||||||
|
<if test="arg1 != null and arg1 != ''">
|
||||||
|
nick_name = #{arg1},
|
||||||
|
</if>
|
||||||
|
<if test="type!=null and type!=''">
|
||||||
|
user_type=#{type},
|
||||||
|
</if>
|
||||||
|
<if test="arg4!=null and arg4!=''">
|
||||||
|
id_card=#{arg4},
|
||||||
|
</if>
|
||||||
|
<if test="consUuid != null and consUuid != ''">
|
||||||
|
parent_uuid = #{consUuid},
|
||||||
|
</if>
|
||||||
|
del_flag = '0'
|
||||||
|
WHERE phonenumber = #{arg5} and del_flag = '0'
|
||||||
|
</if>
|
||||||
|
<if test="userType == '02' or userType == '03'">
|
||||||
|
UPDATE sys_user
|
||||||
|
SET
|
||||||
|
<if test="deptId != null and deptId != ''">
|
||||||
|
dept_id=#{deptId},
|
||||||
|
</if>
|
||||||
|
<if test="arg4 != null and arg4 != ''">
|
||||||
|
user_name = #{arg4}, phonenumber = #{arg4},
|
||||||
|
</if>
|
||||||
|
<if test="arg1 != null and arg1 != ''">
|
||||||
|
nick_name = #{arg1},
|
||||||
|
</if>
|
||||||
|
<if test="type!=null and type!=''">
|
||||||
|
user_type=#{type},
|
||||||
|
</if>
|
||||||
|
<if test="arg7!=null and arg7!=''">
|
||||||
|
id_card=#{arg7},
|
||||||
|
</if>
|
||||||
|
<if test="consUuid != null and consUuid != ''">
|
||||||
|
parent_uuid = #{consUuid},
|
||||||
|
</if>
|
||||||
|
del_flag = '0'
|
||||||
|
WHERE phonenumber = #{arg4} and del_flag = '0'
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
|
||||||
<insert id="insertSysUser">
|
<insert id="insertSysUser">
|
||||||
<if test="userType == '01'">
|
<if test="userType == '01'">
|
||||||
insert into
|
insert into
|
||||||
|
|
@ -79,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<select id="getPersonList" resultType="com.bonus.project.domain.SubPerson">
|
<select id="getPersonList" resultType="com.bonus.project.domain.SubPerson">
|
||||||
<if test="userType == '02' || userType == '03'">
|
<if test="userType == '02' || userType == '03'">
|
||||||
select
|
select
|
||||||
|
|
@ -155,4 +208,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getUserIsCz" resultType="java.lang.Integer">
|
||||||
|
<if test="userType == '01'">
|
||||||
|
select count(1)
|
||||||
|
from sys_user
|
||||||
|
where phonenumber=#{arg5} and del_flag=0
|
||||||
|
</if>
|
||||||
|
<if test="userType == '02' or userType == '03'">
|
||||||
|
select count(1)
|
||||||
|
from sys_user
|
||||||
|
where phonenumber=#{arg4} and del_flag=0
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue