| | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.Snowflake; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | ISysUserService IUserService; |
| | | |
| | | |
| | | @Autowired |
| | | IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | /** |
| | | * 查询列表 |
| | |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPhonenumber())) |
| | | { |
| | | return error("手机号不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getUserName())) |
| | | { |
| | | return error("昵称不能为空"); |
| | | } |
| | | |
| | | SysUser user = IUserService.getUserByAccount(config.getLoginName()); |
| | | if (user != null) { |
| | | //提示用户名或密码错误 |
| | | return error("该账户已存在!"); |
| | | if(StringUtils.isEmpty(config.getDepartmentId())) |
| | | { |
| | | return error("部门不能为空"); |
| | | } |
| | | |
| | | ResultData data = IUserService.loginByPhonenumber(config.getPhonenumber()); |
| | | if (data != null) |
| | | { |
| | | SysUser user= (SysUser) data.getData(); |
| | | user.setUserType("2"); |
| | | //提示用户名或密码错误 |
| | | return toAjax(IUserService.updateConfig(user)); |
| | | } |
| | | config.setUserType("2"); |
| | | |
| | | config.setCreateTime(LocalDateTime.now()); |
| | |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPhonenumber())) |
| | | { |
| | | return error("手机号不能为空"); |
| | | } |
| | | |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除聊天记录 |
| | | * 删除导办用户接口 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | int a=iGuideRepairOrderService.countUser(userId,"2"); |
| | | if(a>0) |
| | | { |
| | | return error("该人员有工单未处理完不能删除"); |
| | | } |
| | | |
| | | return toAjax(IUserService.deleteConfigById(userId)); |
| | | } |
| | | |
| | | /** |
| | | * 修改空闲状态 |
| | | * 修改导办用户空闲状态接口 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | |
| | | @GetMapping("/selectListByDepartmentId") |
| | | @Authorization |
| | | public ResultData selectListByDepartmentId(@RequestParam("departmentId") String departmentId, |
| | | @RequestParam("classifyId") String classifyId){ |
| | | @RequestParam(value = "classifyId",required = false) String classifyId){ |
| | | return ResultData.success(IUserService.selectListByDepartmentId(departmentId,classifyId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询导办用户列表(不分页) |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(" 查询导办用户列表(不分页)") |
| | | @GetMapping("/queryList") |
| | | @Authorization |
| | | public ResultData queryList(){ |
| | | return ResultData.success(IUserService.queryList(2)); |
| | | } |
| | | |
| | | } |