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
/**
*
*
*/
package com.glsx.usercenter.constants;
/**
* @ClassName: Constants
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年1月3日
*
*/
/**
* @author Zheng Xiajun
* @ClassName: Constants
* @Description: TODO(这里用一句话描述这个类的作用)
* @date 2019年1月3日
*/
public interface Constants {
final static byte BUTTON = 1;
final static byte MENU = 2;
final static byte CATALOG = 3;
/**
* shiro-redis中存储session的key前缀
*/
public static final String SESSION_KEYPREFIX = "carservice:shiro:session:";
/**
* redis中的key值
*/
/**
* 短信验证码前缀
*/
public static final String SMS_VERIFY_CODE_PREFIX = "carservice:sms:verifyCode";
/**
* 服务商二维码Key
*/
public static final String SYS_SERVICE_QRIMAGE = "sys_service_QRImage";
/**
* 用户状态(停用)
*/
public static final String SYS_USER_STATUS_NONUSE = "sys_user_status_nonuse";
/**
* 用户状态(使用)
*/
public static final String SYS_USER_STATUS_NORMAL = "sys_user_status_normal";
/**
* 用户状态(注销)
*/
public static final String SYS_USER_STATUS_LOGOUT = "sys_user_status_logout";
/**
* 用户类型(0:系统管理员,1:服务商,2:门店,3:技工)
*/
public static final int USER_TYPE_MANAGER = 0;
public static final int USER_TYPE_SP = 1;
public static final int USER_TYPE_MERCHANT = 2;
public static final int USER_TYPE_MECHANIC = 3;
final static byte BUTTON = 1;
final static byte MENU = 2;
final static byte CATALOG = 3;
/**
* shiro-redis中存储session的key前缀
*/
public static final String SESSION_KEYPREFIX = "carservice:shiro:session:";
/**
* redis中的key值
*/
/**
* 短信验证码前缀
*/
public static final String SMS_VERIFY_CODE_PREFIX = "carservice:sms:verifyCode";
/**
* 服务商二维码Key
*/
public static final String SYS_SERVICE_QRIMAGE = "sys_service_QRImage";
/**
* 用户状态(停用)
*/
public static final String SYS_USER_STATUS_NONUSE = "sys_user_status_nonuse";
/**
* 用户状态(使用)
*/
public static final String SYS_USER_STATUS_NORMAL = "sys_user_status_normal";
/**
* 用户状态(注销)
*/
public static final String SYS_USER_STATUS_LOGOUT = "sys_user_status_logout";
/**
* 用户类型(0:系统管理员,1:服务商,2:门店,3:技工)
*/
public static final int USER_TYPE_MANAGER = 0;
public static final int USER_TYPE_SP = 1;
public static final int USER_TYPE_MERCHANT = 2;
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 {
int updateByPrimaryKey(SysRoleMenu record);
int deleteByRoleId(Integer roleId);
int deleteByRoleId(@Param("roleId")Integer roleId);
}
\ No newline at end of file
......@@ -78,4 +78,6 @@ public interface SysUserMapper {
*
*/
List<SysMechanic> getServiceMechanicList(SysMechanic mechanic);
List<SysMechanic> getCheckSysMechanicList(UserQueryVo userQueryVo);
}
\ No newline at end of file
......@@ -138,7 +138,6 @@ public class SysRoleServiceImpl implements SysRoleService {
return -1;
}
}
for (Integer userId : roleQueryVo.getIds()) {
sysRoleMenuMapper.deleteByRoleId(userId);
}
......
......@@ -85,7 +85,7 @@ public class SysUserServiceImpl implements SysUserService {
public Logger logger = LoggerFactory.getLogger(getClass());
@Override
public List<SysManager> getAllUserList(UserQueryVo userQueryVo,Page page) {
public List<SysManager> getAllUserList(UserQueryVo userQueryVo, Page page) {
//根据传入的组织id获取下面所有组织
if (userQueryVo.getOrgId() != null) {
List<Integer> orgIds = new ArrayList<>();
......@@ -172,7 +172,14 @@ public class SysUserServiceImpl implements SysUserService {
@Override
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) {
//获取技工图片
......@@ -369,7 +376,7 @@ public class SysUserServiceImpl implements SysUserService {
updateRole(userId, sysUser);
updateServiceItem(userId, sysUser);
//编辑的时候userId为null
if(userId == null){
if (userId == null) {
userId = sysMechanic.getId();
}
updateImage(userId, sysMechanic.getImageKeyList(), sysMechanic.getUrlList());
......@@ -628,16 +635,16 @@ public class SysUserServiceImpl implements SysUserService {
System.out.println(new SysUserServiceImpl().encryptPassword("123456"));
}
@Override
public List<SysMechanic> getServiceMechanicList(SysMechanic mechanic, Page page) {
// TODO Auto-generated method stub
PageHelper.startPage(page.getPageIndex(), page.getPageSize(), true);
List<SysMechanic> list = sysUserMapper.getServiceMechanicList(mechanic);
for (SysMechanic sysMechanic : list) {
@Override
public List<SysMechanic> getServiceMechanicList(SysMechanic mechanic, Page page) {
// TODO Auto-generated method stub
PageHelper.startPage(page.getPageIndex(), page.getPageSize(), true);
List<SysMechanic> list = sysUserMapper.getServiceMechanicList(mechanic);
for (SysMechanic sysMechanic : list) {
if (StringUtils.isNotEmpty(sysMechanic.getDistrict())) {
sysMechanic.setSysArea(iAreaService.getAllChargeItems(Integer.valueOf(sysMechanic.getDistrict())));
}
}
return list;
}
}
}
return list;
}
}
......@@ -693,7 +693,6 @@
sys_user_org suo
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_manager sm ON sm.user_id = u.id
WHERE suo.user_id = #{userId,jdbcType=INTEGER}
</when>
<otherwise>
......@@ -789,13 +788,13 @@
sm.work_time_start workTimeStart,
sm.work_time_end workTimeEnd,
sm.dispatch_type dispatchType
<choose>
<when test="userId != 0 and userId!=''">
FROM
sys_user_org suo
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_manager sm ON sm.user_id = u.id
WHERE suo.user_id = #{userId,jdbcType=INTEGER}
</when>
<otherwise>
......@@ -805,9 +804,10 @@
</otherwise>
</choose>
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_dict_data sdd ON sms.service_key = sdd.data_key
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
<if test="id != null and id!=''">
and u.id = #{id,jdbcType=TINYINT}
</if>
......@@ -822,30 +822,66 @@
<if test="phoneNumber != null and phoneNumber!=''">
and u.phone_number like "%"#{phoneNumber,jdbcType=VARCHAR}"%"
</if>
<choose>
<when test="userStatus != null and userStatus!=''">
and u.user_status = #{userStatus,jdbcType=VARCHAR}
</when>
<otherwise>
and u.user_status IN ('sys_user_status_normal','sys_user_status_nonuse')
</otherwise>
</choose>
GROUP BY u.id
ORDER BY u.create_time DESC
</select>
<if test="listType == 0">
<choose>
<when test="userStatus != null and userStatus!=''">
and u.user_status = #{userStatus,jdbcType=VARCHAR}
</when>
<otherwise>
and u.user_status IN ('sys_user_status_normal','sys_user_status_nonuse')
</otherwise>
</choose>
<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 ssm.service_id = #{userId,jdbcType=TINYINT}
<if test="serviceType != null and serviceType!=''">
and sm.service_type like "%"#{serviceType,jdbcType=VARCHAR}"%"
</if>
<if test="listType == 1">
and u.user_status IN ('sys_user_status_normal')
<choose>
<when test="userStatus != null and userStatus!=''">
and sm.mechanic_status = #{userStatus,jdbcType=VARCHAR}
</when>
<otherwise>
and sm.mechanic_status IN
('sys_user_status_uncheck','sys_user_status_nopass_check','sys_user_status_pass_check')
</otherwise>
</choose>
<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>
<when test="userStatus != null and userStatus!=''">
and sm.mechanic_status = #{userStatus,jdbcType=VARCHAR}
</when>
<otherwise>
and sm.mechanic_status IN
('sys_user_status_uncheck','sys_user_status_nopass_check','sys_user_status_pass_check')
</otherwise>
</choose>
GROUP BY u.id
ORDER BY u.create_time DESC
</select>
......@@ -997,34 +1033,36 @@
WHERE su.id = #{merchantId,jdbcType=INTEGER}
</select>
<select id="getServiceMechanicList" parameterType="com.glsx.usercenter.pojo.user.SysMechanic" resultType="com.glsx.usercenter.pojo.user.SysMechanic">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'" />
</if>
select
*
from
(
select
u.id, u.username, u.name, u.phone_number,
m.district, m.address,
GROUP_CONCAT(sdd.data_value SEPARATOR '、') serviceItems
FROM sys_service_mechanic sm
LEFT JOIN sys_user u on sm.mechanic_id = u.id
LEFT JOIN sys_mechanic m on sm.mechanic_id = m.user_id
LEFT JOIN sys_user_services us on u.id = us.user_id
LEFT JOIN sys_dict_data sdd on us.service_key = sdd.data_key
<where>
and sm.service_id = #{userId}
and u.user_status = 'sys_user_status_normal'
</where>
GROUP BY u.id
ORDER BY u.create_time DESC, u.id DESC
) d
<where>
<if test="queryContent != null and queryContent != ''">
and (d.name like #{queryContent} or d.phone_number like #{queryContent} or d.serviceItems like #{queryContent})
</if>
</where>
</select>
<select id="getServiceMechanicList" parameterType="com.glsx.usercenter.pojo.user.SysMechanic"
resultType="com.glsx.usercenter.pojo.user.SysMechanic">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select
*
from
(
select
u.id, u.username, u.name, u.phone_number,
m.district, m.address,
GROUP_CONCAT(sdd.data_value SEPARATOR '、') serviceItems
FROM sys_service_mechanic sm
LEFT JOIN sys_user u on sm.mechanic_id = u.id
LEFT JOIN sys_mechanic m on sm.mechanic_id = m.user_id
LEFT JOIN sys_user_services us on u.id = us.user_id
LEFT JOIN sys_dict_data sdd on us.service_key = sdd.data_key
<where>
and sm.service_id = #{userId}
and u.user_status = 'sys_user_status_normal'
</where>
GROUP BY u.id
ORDER BY u.create_time DESC, u.id DESC
) d
<where>
<if test="queryContent != null and queryContent != ''">
and (d.name like #{queryContent} or d.phone_number like #{queryContent} or d.serviceItems like
#{queryContent})
</if>
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!