|
|
@ -4,6 +4,7 @@ import com.acupuncture.common.annotation.DataSource; |
|
|
|
import com.acupuncture.common.annotation.Log; |
|
|
|
import com.acupuncture.common.constant.Constants; |
|
|
|
import com.acupuncture.common.core.domain.AjaxResult; |
|
|
|
import com.acupuncture.common.core.domain.BaseDto; |
|
|
|
import com.acupuncture.common.core.domain.JsonResponse; |
|
|
|
import com.acupuncture.common.core.domain.entity.SysUser; |
|
|
|
import com.acupuncture.common.core.domain.model.LoginBody; |
|
|
@ -14,14 +15,22 @@ import com.acupuncture.common.utils.SecurityUtils; |
|
|
|
import com.acupuncture.framework.web.service.SysPermissionService; |
|
|
|
import com.acupuncture.framework.web.service.TokenService; |
|
|
|
import com.acupuncture.framework.web.service.WebDmsLoginService; |
|
|
|
import com.acupuncture.system.domain.dto.FmsFollowupDto; |
|
|
|
import com.acupuncture.system.domain.po.DmsTenant; |
|
|
|
import com.acupuncture.system.domain.vo.DmsLoginUserVo; |
|
|
|
import com.acupuncture.system.domain.vo.FmsFollowupVo; |
|
|
|
import com.acupuncture.system.service.DmsLoginService; |
|
|
|
import com.acupuncture.system.service.FmsFollowupQueueService; |
|
|
|
import com.acupuncture.system.service.FmsFollowupService; |
|
|
|
import com.acupuncture.system.service.ISysUserService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
@ -48,6 +57,8 @@ public class DmsLoginController { |
|
|
|
private DmsLoginService dmsLoginService; |
|
|
|
@Resource |
|
|
|
private ISysUserService sysUserService; |
|
|
|
@Resource |
|
|
|
private FmsFollowupQueueService fmsFollowupQueueService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 登录方法 |
|
|
@ -66,25 +77,6 @@ public class DmsLoginController { |
|
|
|
return ajax; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取用户信息 |
|
|
|
* |
|
|
|
* @return 用户信息 |
|
|
|
*/ |
|
|
|
@GetMapping("getInfo") |
|
|
|
public AjaxResult getInfo() { |
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
//获取用户从库信息
|
|
|
|
SysUser user = sysUserService.selectUserByTenantId(loginUser.getTenantId(), loginUser.getUsername()); |
|
|
|
//刷新token
|
|
|
|
tokenService.refreshToken(loginUser); |
|
|
|
AjaxResult ajax = AjaxResult.success(); |
|
|
|
ajax.put("user", user); |
|
|
|
ajax.put("tenantId", loginUser.getTenantId()); |
|
|
|
ajax.put("scoreId", loginUser.getScoreId()); |
|
|
|
return ajax; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 重置密码 |
|
|
|
*/ |
|
|
@ -118,16 +110,48 @@ public class DmsLoginController { |
|
|
|
return AjaxResult.error("修改密码异常,请联系管理员"); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查询公共队列") |
|
|
|
@PostMapping("/commonQueue") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<PageInfo<FmsFollowupVo.FollowupQueueVO>> queryCommonQueue(@RequestBody @Validated BaseDto<FmsFollowupDto.QueueQuery> dto) { |
|
|
|
if (dto.getPageNum() > 0) { |
|
|
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|
|
|
} |
|
|
|
return JsonResponse.ok(new PageInfo<>(fmsFollowupQueueService.queryCommonQueue(dto.getParam().getName()))); |
|
|
|
} |
|
|
|
|
|
|
|
// @PutMapping("/resetPwd")
|
|
|
|
// public JsonResponse<Integer> resetPwd(@RequestBody DmsLoginUserVo.DmsUserVo user) {
|
|
|
|
//// webDmsLoginService.checkUserAllowed(user);
|
|
|
|
//// webDmsLoginService.checkUserDataScope(user.getUserId());
|
|
|
|
// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
|
// return JsonResponse.ok(dmsLoginService.resetPwd(user));
|
|
|
|
// }
|
|
|
|
/** |
|
|
|
* 获取用户信息,暂时先从主库获取 |
|
|
|
* @return 用户信息 |
|
|
|
*/ |
|
|
|
@ApiOperation("用户信息") |
|
|
|
@GetMapping("/getInfo") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public AjaxResult getInfo() { |
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
//获取用户从库信息
|
|
|
|
DmsLoginUserVo.DmsUserVo tenantUser = dmsLoginService.selectTenantUserById(loginUser.getUserId()); |
|
|
|
SysUser user = new SysUser(); |
|
|
|
user.setUserId(tenantUser.getId()); |
|
|
|
user.setUserName(tenantUser.getUserName()); |
|
|
|
user.setNickName(tenantUser.getNickName()); |
|
|
|
user.setTenantId(tenantUser.getTenantId()); |
|
|
|
user.setTenantName(tenantUser.getTenantName()); |
|
|
|
user.setTenantPhone(tenantUser.getTenantPhone()); |
|
|
|
//刷新token
|
|
|
|
tokenService.refreshToken(loginUser); |
|
|
|
AjaxResult ajax = AjaxResult.success(); |
|
|
|
ajax.put("user", user); |
|
|
|
return ajax; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 筛查接口,此接口已添加白名单,所以不需要@annomous |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/queryTenantById") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<DmsTenant> queryTenantById(@RequestBody DmsLoginUserVo.Query dto){ |
|
|
|
return JsonResponse.ok(dmsLoginService.queryById(dto.getId())); |
|
|
|
} |
|
|
|