Commit b6d56a8e by duanhq

技工审核列表修改,编辑角色bug修复 by duanht 2019/3/5

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18129 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent d990e7b7
...@@ -4,12 +4,11 @@ ...@@ -4,12 +4,11 @@
package com.glsx.usercenter.constants; package com.glsx.usercenter.constants;
/** /**
* @ClassName: Constants * @author Zheng Xiajun
* @Description: TODO(这里用一句话描述这个类的作用) * @ClassName: Constants
* @author Zheng Xiajun * @Description: TODO(这里用一句话描述这个类的作用)
* @date 2019年1月3日 * @date 2019年1月3日
* */
*/
public interface Constants { public interface Constants {
final static byte BUTTON = 1; final static byte BUTTON = 1;
final static byte MENU = 2; final static byte MENU = 2;
...@@ -56,4 +55,13 @@ public interface Constants { ...@@ -56,4 +55,13 @@ public interface Constants {
public static final int USER_TYPE_MERCHANT = 2; public static final int USER_TYPE_MERCHANT = 2;
public static final int USER_TYPE_MECHANIC = 3; public static final int USER_TYPE_MECHANIC = 3;
/**
* 技工列表类型(0:技工管理列表;1:技工审核列表;2:商户管理列表;3:服务商资源管理列表;4:技工资源管理列表)
*/
public static final String LIST_TYPE_MECHANIC_MANANGE = "0";
public static final String LIST_TYPE_MECHANIC_CHECK = "1";
public static final String LIST_TYPE_MERCHANT_MANANGE = "2";
public static final String LIST_TYPE_MERCHANT_RESOURCE = "3";
public static final String LIST_TYPE_MECHANIC_RESOURCE = "4";
} }
...@@ -30,5 +30,5 @@ public interface SysRoleMenuMapper { ...@@ -30,5 +30,5 @@ public interface SysRoleMenuMapper {
int updateByPrimaryKey(SysRoleMenu record); int updateByPrimaryKey(SysRoleMenu record);
int deleteByRoleId(Integer roleId); int deleteByRoleId(@Param("roleId")Integer roleId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -78,4 +78,6 @@ public interface SysUserMapper { ...@@ -78,4 +78,6 @@ public interface SysUserMapper {
* *
*/ */
List<SysMechanic> getServiceMechanicList(SysMechanic mechanic); List<SysMechanic> getServiceMechanicList(SysMechanic mechanic);
List<SysMechanic> getCheckSysMechanicList(UserQueryVo userQueryVo);
} }
\ No newline at end of file \ No newline at end of file
...@@ -138,7 +138,6 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -138,7 +138,6 @@ public class SysRoleServiceImpl implements SysRoleService {
return -1; return -1;
} }
} }
for (Integer userId : roleQueryVo.getIds()) { for (Integer userId : roleQueryVo.getIds()) {
sysRoleMenuMapper.deleteByRoleId(userId); sysRoleMenuMapper.deleteByRoleId(userId);
} }
......
...@@ -85,7 +85,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -85,7 +85,7 @@ public class SysUserServiceImpl implements SysUserService {
public Logger logger = LoggerFactory.getLogger(getClass()); public Logger logger = LoggerFactory.getLogger(getClass());
@Override @Override
public List<SysManager> getAllUserList(UserQueryVo userQueryVo,Page page) { public List<SysManager> getAllUserList(UserQueryVo userQueryVo, Page page) {
//根据传入的组织id获取下面所有组织 //根据传入的组织id获取下面所有组织
if (userQueryVo.getOrgId() != null) { if (userQueryVo.getOrgId() != null) {
List<Integer> orgIds = new ArrayList<>(); List<Integer> orgIds = new ArrayList<>();
...@@ -172,7 +172,14 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -172,7 +172,14 @@ public class SysUserServiceImpl implements SysUserService {
@Override @Override
public List<SysMechanic> getSysMechanicList(UserQueryVo userQueryVo) { public List<SysMechanic> getSysMechanicList(UserQueryVo userQueryVo) {
List<SysMechanic> sysMechanicList = sysUserMapper.getSysMechanicList(userQueryVo); List<SysMechanic> sysMechanicList = new ArrayList<>();
//技工列表
if (Constants.LIST_TYPE_MECHANIC_MANANGE.equals(userQueryVo.getListType())) {
sysMechanicList = sysUserMapper.getSysMechanicList(userQueryVo);
//技工审核列表
} else if (Constants.LIST_TYPE_MECHANIC_CHECK.equals(userQueryVo.getListType())) {
sysMechanicList = sysUserMapper.getCheckSysMechanicList(userQueryVo);
}
for (SysMechanic sysMechanic : sysMechanicList) { for (SysMechanic sysMechanic : sysMechanicList) {
//获取技工图片 //获取技工图片
...@@ -369,7 +376,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -369,7 +376,7 @@ public class SysUserServiceImpl implements SysUserService {
updateRole(userId, sysUser); updateRole(userId, sysUser);
updateServiceItem(userId, sysUser); updateServiceItem(userId, sysUser);
//编辑的时候userId为null //编辑的时候userId为null
if(userId == null){ if (userId == null) {
userId = sysMechanic.getId(); userId = sysMechanic.getId();
} }
updateImage(userId, sysMechanic.getImageKeyList(), sysMechanic.getUrlList()); updateImage(userId, sysMechanic.getImageKeyList(), sysMechanic.getUrlList());
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.usercenter.mapper.SysRoleMenuMapper"> <mapper namespace="com.glsx.usercenter.mapper.SysRoleMenuMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.role.SysRoleMenu"> <resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.role.SysRoleMenu">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="role_id" jdbcType="INTEGER" property="roleId" /> <result column="role_id" jdbcType="INTEGER" property="roleId"/>
<result column="menu_id" jdbcType="INTEGER" property="menuId" /> <result column="menu_id" jdbcType="INTEGER" property="menuId"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
...@@ -53,7 +54,8 @@ ...@@ -53,7 +54,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
...@@ -67,16 +69,17 @@ ...@@ -67,16 +69,17 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, role_id, menu_id id, role_id, menu_id
</sql> </sql>
<select id="selectByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample"
resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
'false' as QUERYID, 'false' as QUERYID,
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from sys_role_menu from sys_role_menu
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
<if test="orderByClause != null"> <if test="orderByClause != null">
order by ${orderByClause} order by ${orderByClause}
...@@ -84,18 +87,18 @@ ...@@ -84,18 +87,18 @@
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from sys_role_menu from sys_role_menu
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_role_menu DELETE FROM sys_role_menu
where id = #{id,jdbcType=INTEGER} WHERE id = #{id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample"> <delete id="deleteByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample">
delete from sys_role_menu delete from sys_role_menu
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu"> <insert id="insert" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
...@@ -127,10 +130,11 @@ ...@@ -127,10 +130,11 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample"
resultType="java.lang.Long">
select count(*) from sys_role_menu select count(*) from sys_role_menu
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
...@@ -147,7 +151,7 @@ ...@@ -147,7 +151,7 @@
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
...@@ -156,7 +160,7 @@ ...@@ -156,7 +160,7 @@
role_id = #{record.roleId,jdbcType=INTEGER}, role_id = #{record.roleId,jdbcType=INTEGER},
menu_id = #{record.menuId,jdbcType=INTEGER} menu_id = #{record.menuId,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu"> <update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
...@@ -172,13 +176,13 @@ ...@@ -172,13 +176,13 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu"> <update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
update sys_role_menu UPDATE sys_role_menu
set role_id = #{roleId,jdbcType=INTEGER}, SET role_id = #{roleId,jdbcType=INTEGER},
menu_id = #{menuId,jdbcType=INTEGER} menu_id = #{menuId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} WHERE id = #{id,jdbcType=INTEGER}
</update> </update>
<delete id="deleteByRoleId" parameterType="java.lang.Integer"> <delete id="deleteByRoleId">
DELETE FROM sys_role_menu DELETE FROM sys_role_menu
WHERE role_id = #{roleId,jdbcType=INTEGER} WHERE role_id = #{roleId,jdbcType=INTEGER}
</delete> </delete>
......
...@@ -693,7 +693,6 @@ ...@@ -693,7 +693,6 @@
sys_user_org suo sys_user_org suo
LEFT JOIN sys_organization so ON suo.org_id = so.id LEFT JOIN sys_organization so ON suo.org_id = so.id
LEFT JOIN sys_user u ON u.org_id = so.id LEFT JOIN sys_user u ON u.org_id = so.id
LEFT JOIN sys_manager sm ON sm.user_id = u.id
WHERE suo.user_id = #{userId,jdbcType=INTEGER} WHERE suo.user_id = #{userId,jdbcType=INTEGER}
</when> </when>
<otherwise> <otherwise>
...@@ -789,13 +788,13 @@ ...@@ -789,13 +788,13 @@
sm.work_time_start workTimeStart, sm.work_time_start workTimeStart,
sm.work_time_end workTimeEnd, sm.work_time_end workTimeEnd,
sm.dispatch_type dispatchType sm.dispatch_type dispatchType
<choose> <choose>
<when test="userId != 0 and userId!=''"> <when test="userId != 0 and userId!=''">
FROM FROM
sys_user_org suo sys_user_org suo
LEFT JOIN sys_organization so ON suo.org_id = so.id LEFT JOIN sys_organization so ON suo.org_id = so.id
LEFT JOIN sys_user u ON u.org_id = so.id LEFT JOIN sys_user u ON u.org_id = so.id
LEFT JOIN sys_manager sm ON sm.user_id = u.id
WHERE suo.user_id = #{userId,jdbcType=INTEGER} WHERE suo.user_id = #{userId,jdbcType=INTEGER}
</when> </when>
<otherwise> <otherwise>
...@@ -805,9 +804,10 @@ ...@@ -805,9 +804,10 @@
</otherwise> </otherwise>
</choose> </choose>
LEFT JOIN sys_mechanic sm ON sm.user_id = u.id LEFT JOIN sys_mechanic sm ON sm.user_id = u.id
LEFT JOIN sys_user_services sms ON sm.user_id = sms.user_id LEFT JOIN sys_user_services sus ON sm.user_id = sus.user_id
LEFT JOIN sys_dict_data sdd ON sms.service_key = sdd.data_key LEFT JOIN sys_dict_data sdd ON sus.service_key = sdd.data_key
WHERE u.user_type = 3 WHERE u.user_type = 3
<if test="id != null and id!=''"> <if test="id != null and id!=''">
and u.id = #{id,jdbcType=TINYINT} and u.id = #{id,jdbcType=TINYINT}
</if> </if>
...@@ -822,8 +822,6 @@ ...@@ -822,8 +822,6 @@
<if test="phoneNumber != null and phoneNumber!=''"> <if test="phoneNumber != null and phoneNumber!=''">
and u.phone_number like "%"#{phoneNumber,jdbcType=VARCHAR}"%" and u.phone_number like "%"#{phoneNumber,jdbcType=VARCHAR}"%"
</if> </if>
<if test="listType == 0">
<choose> <choose>
<when test="userStatus != null and userStatus!=''"> <when test="userStatus != null and userStatus!=''">
and u.user_status = #{userStatus,jdbcType=VARCHAR} and u.user_status = #{userStatus,jdbcType=VARCHAR}
...@@ -832,10 +830,49 @@ ...@@ -832,10 +830,49 @@
and u.user_status IN ('sys_user_status_normal','sys_user_status_nonuse') and u.user_status IN ('sys_user_status_normal','sys_user_status_nonuse')
</otherwise> </otherwise>
</choose> </choose>
</if> GROUP BY u.id
ORDER BY u.create_time DESC
</select>
<if test="listType == 1"> <select id="getCheckSysMechanicList" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"
resultType="com.glsx.usercenter.pojo.user.SysMechanic">
SELECT
u.id,
u.user_status userStatus,
u. NAME,
phone_number phoneNumber,
sm.district district,
sm.address address,
u.create_time createTime,
GROUP_CONCAT(sdd.data_value SEPARATOR '/') serviceItems,
GROUP_CONCAT(sdd.data_key ) serviceKey,
sm.service_type serviceType,
sm.IDCard,
sm.mechanic_status mechanicStatus,
sm.work_time_start workTimeStart,
sm.work_time_end workTimeEnd,
sm.dispatch_type dispatchType
FROM
sys_user u
LEFT JOIN sys_mechanic sm ON sm.user_id = u.id
LEFT JOIN sys_service_mechanic ssm ON u.id =ssm.mechanic_id
LEFT JOIN sys_user_services sus ON sm.user_id = sus.user_id
LEFT JOIN sys_dict_data sdd ON sus.service_key = sdd.data_key
WHERE u.user_type = 3
and u.user_status IN ('sys_user_status_normal') and u.user_status IN ('sys_user_status_normal')
and ssm.service_id = #{userId,jdbcType=TINYINT}
<if test="serviceType != null and serviceType!=''">
and sm.service_type like "%"#{serviceType,jdbcType=VARCHAR}"%"
</if>
<if test="name != null and name!=''">
and u.name like "%"#{name,jdbcType=VARCHAR}"%"
</if>
<if test="phoneNumber != null and phoneNumber!=''">
and u.phone_number like "%"#{phoneNumber,jdbcType=VARCHAR}"%"
</if>
<choose> <choose>
<when test="userStatus != null and userStatus!=''"> <when test="userStatus != null and userStatus!=''">
and sm.mechanic_status = #{userStatus,jdbcType=VARCHAR} and sm.mechanic_status = #{userStatus,jdbcType=VARCHAR}
...@@ -845,7 +882,6 @@ ...@@ -845,7 +882,6 @@
('sys_user_status_uncheck','sys_user_status_nopass_check','sys_user_status_pass_check') ('sys_user_status_uncheck','sys_user_status_nopass_check','sys_user_status_pass_check')
</otherwise> </otherwise>
</choose> </choose>
</if>
GROUP BY u.id GROUP BY u.id
ORDER BY u.create_time DESC ORDER BY u.create_time DESC
</select> </select>
...@@ -997,9 +1033,10 @@ ...@@ -997,9 +1033,10 @@
WHERE su.id = #{merchantId,jdbcType=INTEGER} WHERE su.id = #{merchantId,jdbcType=INTEGER}
</select> </select>
<select id="getServiceMechanicList" parameterType="com.glsx.usercenter.pojo.user.SysMechanic" resultType="com.glsx.usercenter.pojo.user.SysMechanic"> <select id="getServiceMechanicList" parameterType="com.glsx.usercenter.pojo.user.SysMechanic"
resultType="com.glsx.usercenter.pojo.user.SysMechanic">
<if test="queryContent != null and queryContent != ''"> <if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'" /> <bind name="queryContent" value="'%' + queryContent + '%'"/>
</if> </if>
select select
* *
...@@ -1023,7 +1060,8 @@ ...@@ -1023,7 +1060,8 @@
) d ) d
<where> <where>
<if test="queryContent != null and queryContent != ''"> <if test="queryContent != null and queryContent != ''">
and (d.name like #{queryContent} or d.phone_number like #{queryContent} or d.serviceItems like #{queryContent}) and (d.name like #{queryContent} or d.phone_number like #{queryContent} or d.serviceItems like
#{queryContent})
</if> </if>
</where> </where>
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!