Commit b1ed39ba by zhanghj

V1.0.0--提交服务商技工列表

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18084 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 6b35e569
......@@ -23,6 +23,8 @@ import com.glsx.usercenter.service.IAreaService;
import com.glsx.usercenter.utils.AccountValidatorUtil;
import com.glsx.usercenter.utils.QRCodeUtil;
import com.glsx.usercenter.utils.RedisCacheUtil;
import com.glsx.usercenter.utils.ShiroUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.ExcessiveAttemptsException;
......@@ -49,6 +51,7 @@ import com.glsx.common.utils.UserUtils;
import com.glsx.usercenter.constants.ResultCodeEnum;
import com.glsx.usercenter.pojo.vo.UserQueryVo;
import com.glsx.usercenter.service.SysUserService;
import org.springframework.web.multipart.MultipartFile;
/**
......@@ -671,4 +674,21 @@ public class UserController extends BaseController {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), map);
}
/**
*
* @author zhanghj
* @Title: getServiceMechanicList
* @Description: TODO 获取服务商下面的技工列表
* @param request
* @return
* ResultObject
*
*/
@RequestMapping(value = "/getServiceMechanicList", method = {RequestMethod.GET})
public ResultObject getServiceMechanicList(HttpServletRequest request) {
Integer userId = ShiroUtil.getUserId();
List<SysMechanic> list = sysUserService.getServiceMechanicList(userId);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), list);
}
}
......@@ -5,6 +5,7 @@ import com.glsx.usercenter.dto.ServiceInfo;
import com.glsx.usercenter.pojo.menu.SysOrganization;
import com.glsx.usercenter.pojo.user.*;
import com.glsx.usercenter.pojo.vo.UserQueryVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -65,4 +66,16 @@ public interface SysUserMapper {
ServiceInfo getServiceById(@Param("serviceId")Integer serviceId);
SysMerchant getMerchantById(@Param("merchantId")Integer merchantId);
/**
*
* @author zhanghj
* @Title: getServiceMechanicList
* @Description: TODO 获取服务商下的技工列表
* @param userId
* @return
* List<SysMechanic>
*
*/
List<SysMechanic> getServiceMechanicList(@Param("userId")Integer userId);
}
\ No newline at end of file
......@@ -70,6 +70,11 @@ public class SysMechanic extends SysUser{
private SysArea sysArea;
/**
* 技工服务项目列表
*/
private List<String> serviceItems;
public String getDistrict() {
return district;
}
......@@ -149,4 +154,5 @@ public class SysMechanic extends SysUser{
public void setSysArea(SysArea sysArea) {
this.sysArea = sysArea;
}
}
......@@ -4,9 +4,11 @@ package com.glsx.usercenter.service;
import java.util.List;
import com.glsx.common.utils.Page;
import com.glsx.usercenter.dto.ServiceInfo;
import com.glsx.usercenter.pojo.user.*;
import org.apache.shiro.authc.AuthenticationException;
import com.glsx.usercenter.pojo.menu.SysOrganization;
......@@ -228,4 +230,16 @@ public interface SysUserService {
* @Description: TODO 修改商户详细信息
*/
int updateSysMerchant(SysMerchant sysMerchant);
/**
*
* @author zhanghj
* @Title: getServiceMechanicList
* @Description: TODO 获取服务商下面的技工列表
* @param userId
* @return
* List<SysMechanic>
*
*/
List<SysMechanic> getServiceMechanicList(Integer userId);
}
......@@ -6,6 +6,7 @@ import java.util.List;
import com.github.pagehelper.PageHelper;
import com.glsx.common.utils.Page;
import com.glsx.usercenter.service.IAreaService;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.LockedAccountException;
......@@ -622,4 +623,16 @@ public class SysUserServiceImpl implements SysUserService {
public static void main(String[] args) {
System.out.println(new SysUserServiceImpl().encryptPassword("123456"));
}
@Override
public List<SysMechanic> getServiceMechanicList(Integer userId) {
// TODO Auto-generated method stub
List<SysMechanic> list = sysUserMapper.getServiceMechanicList(userId);
for (SysMechanic sysMechanic : list) {
if (StringUtils.isNotEmpty(sysMechanic.getDistrict())) {
sysMechanic.setSysArea(iAreaService.getAllChargeItems(Integer.valueOf(sysMechanic.getDistrict())));
}
}
return list;
}
}
......@@ -952,4 +952,19 @@
WHERE su.id = #{merchantId,jdbcType=INTEGER}
</select>
<select id="getServiceMechanicList" resultType="com.glsx.usercenter.pojo.user.SysMechanic">
select
u.id, u.username, u.name, u.phone_number,
m.district,
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 sm.service_id = #{userId}
and u.user_status = 'sys_user_status_normal'
GROUP BY u.id
ORDER BY u.create_time DESC, u.id DESC
</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!