员工入职审批或邀请员工同意后,自动创建登录账号及密码同步,调整mq调用时使用api,修改摄像头能成功预览后更新在线状态
This commit is contained in:
parent
b4b5c838cd
commit
fdeb25c646
|
|
@ -26,4 +26,5 @@ public interface AppCameraInfoMapper extends BaseMapper<AppCameraInfo> {
|
||||||
AppCameraInfo getCapabilityByDeviceId(AppCameraInfo cameraInfo);
|
AppCameraInfo getCapabilityByDeviceId(AppCameraInfo cameraInfo);
|
||||||
void insertCapability(AppCameraInfo cameraInfo);
|
void insertCapability(AppCameraInfo cameraInfo);
|
||||||
void updateCapabilityById(AppCameraInfo cameraInfo);
|
void updateCapabilityById(AppCameraInfo cameraInfo);
|
||||||
|
void updateDeviceStatusByDevId(AppCameraInfo cameraInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -246,4 +246,10 @@
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateDeviceStatusByDevId">
|
||||||
|
UPDATE nu_iot_tplink_camera
|
||||||
|
SET device_status = #{deviceStatus}
|
||||||
|
where device_index = #{deviceIndex}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -764,8 +764,8 @@ public class AppCameraInfoServiceImpl extends ServiceImpl<AppCameraInfoMapper, A
|
||||||
getPreviewSb.append("}");
|
getPreviewSb.append("}");
|
||||||
String getPreviewSbRes = tumsApi.getPreviewUrl(getPreviewSb.toString());
|
String getPreviewSbRes = tumsApi.getPreviewUrl(getPreviewSb.toString());
|
||||||
JSONObject jsonObject = new JSONObject(getPreviewSbRes);
|
JSONObject jsonObject = new JSONObject(getPreviewSbRes);
|
||||||
int errorCode = jsonObject.getInt("error_code");
|
String errorCode = jsonObject.getStr("error_code");
|
||||||
if(errorCode == 0){
|
if(errorCode.equals("0")){
|
||||||
JSONObject getPreviewResult = (JSONObject)jsonObject.get("result");
|
JSONObject getPreviewResult = (JSONObject)jsonObject.get("result");
|
||||||
String url = getPreviewResult.getStr("url");
|
String url = getPreviewResult.getStr("url");
|
||||||
String backupUrl = getPreviewResult.getStr("backupUrl");
|
String backupUrl = getPreviewResult.getStr("backupUrl");
|
||||||
|
|
@ -775,17 +775,46 @@ public class AppCameraInfoServiceImpl extends ServiceImpl<AppCameraInfoMapper, A
|
||||||
map.put("backupUrl",backupUrl);
|
map.put("backupUrl",backupUrl);
|
||||||
map.put("wsUrl",wsUrl);
|
map.put("wsUrl",wsUrl);
|
||||||
map.put("wssUrl",wssUrl);
|
map.put("wssUrl",wssUrl);
|
||||||
}else if(errorCode == -80703){
|
}else if(errorCode.equals("-80703")){
|
||||||
try {
|
try {
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
map = getPreviewUrl(id,streamType,sessionId);
|
map = getPreviewUrl(id,streamType,sessionId);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
String errorMsg = "";
|
||||||
|
try{
|
||||||
|
AppErrorCode errVo = errorCodeService.getByCode(errorCode);
|
||||||
|
errorMsg = errVo.getErrorMsg();
|
||||||
|
}catch (Exception e){
|
||||||
|
errorMsg = errorCode;
|
||||||
|
}
|
||||||
|
log.info("getPreviewUrl:{}",errorMsg);
|
||||||
}
|
}
|
||||||
|
updateDeviceStatus(id,errorCode);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新设备在线状态
|
||||||
|
* @param deviceIndex
|
||||||
|
* @param errCode
|
||||||
|
*/
|
||||||
|
private void updateDeviceStatus(String deviceIndex,String errCode){
|
||||||
|
AppCameraInfo cameraInfo = new AppCameraInfo();
|
||||||
|
cameraInfo.setDeviceIndex(deviceIndex);
|
||||||
|
if(errCode.equals("0")){
|
||||||
|
//在线
|
||||||
|
cameraInfo.setDeviceStatus("1");
|
||||||
|
baseMapper.updateDeviceStatusByDevId(cameraInfo);
|
||||||
|
}else if(errCode.equals("-80327")){
|
||||||
|
//离线
|
||||||
|
cameraInfo.setDeviceStatus("0");
|
||||||
|
baseMapper.updateDeviceStatusByDevId(cameraInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取镜头遮挡参数
|
* 获取镜头遮挡参数
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,219 @@
|
||||||
|
package com.nu.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @Author scott
|
||||||
|
* @since 2018-12-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SysUserEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账号
|
||||||
|
*/
|
||||||
|
@Excel(name = "登录账号", width = 15)
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 真实姓名
|
||||||
|
*/
|
||||||
|
@Excel(name = "真实姓名", width = 15)
|
||||||
|
private String realname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* md5密码盐
|
||||||
|
*/
|
||||||
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
|
private String salt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
@Excel(name = "头像", width = 15,type = 2)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生日
|
||||||
|
*/
|
||||||
|
@Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date birthday;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(1:男 2:女)
|
||||||
|
*/
|
||||||
|
@Excel(name = "性别", width = 15,dicCode="sex")
|
||||||
|
@Dict(dicCode = "sex")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子邮件
|
||||||
|
*/
|
||||||
|
@Excel(name = "电子邮件", width = 15)
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
@Excel(name = "电话", width = 15)
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录选择部门编码
|
||||||
|
*/
|
||||||
|
private String orgCode;
|
||||||
|
/**
|
||||||
|
* 登录选择租户ID
|
||||||
|
*/
|
||||||
|
private Integer loginTenantId;
|
||||||
|
|
||||||
|
/**部门名称*/
|
||||||
|
private transient String orgCodeTxt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:正常 2:冻结 )
|
||||||
|
*/
|
||||||
|
@Excel(name = "状态", width = 15,dicCode="user_status")
|
||||||
|
@Dict(dicCode = "user_status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态(0,正常,1已删除)
|
||||||
|
*/
|
||||||
|
@Excel(name = "删除状态", width = 15,dicCode="del_flag")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号,唯一键
|
||||||
|
*/
|
||||||
|
@Excel(name = "工号", width = 15)
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职务,关联职务表
|
||||||
|
*/
|
||||||
|
@Excel(name = "职务", width = 15)
|
||||||
|
@Dict(dictTable ="sys_position",dicText = "name",dicCode = "id")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String post;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 座机号
|
||||||
|
*/
|
||||||
|
@Excel(name = "座机号", width = 15)
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
* 同步工作流引擎1同步0不同步
|
||||||
|
*/
|
||||||
|
private Integer activitiSync;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工id
|
||||||
|
*/
|
||||||
|
private String employessId;
|
||||||
|
|
||||||
|
@Dict(dicCode = "login_type")
|
||||||
|
private String loginType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份(0 普通成员 1 上级)
|
||||||
|
*/
|
||||||
|
@Excel(name="(1普通成员 2上级)",width = 15)
|
||||||
|
private Integer userIdentity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责部门
|
||||||
|
*/
|
||||||
|
@Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||||
|
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||||
|
private String departIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多租户ids临时用,不持久化数据库(数据库字段不存在)
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String relTenantIds;
|
||||||
|
|
||||||
|
/**设备id uniapp推送用*/
|
||||||
|
private String clientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录首页地址
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String homePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职位名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String postText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程状态
|
||||||
|
*/
|
||||||
|
private String bpmStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已经绑定第三方
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private boolean izBindThird;
|
||||||
|
}
|
||||||
|
|
@ -23,8 +23,8 @@ import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.jeecg.common.util.PasswordUtil;
|
import org.jeecg.common.util.PasswordUtil;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import com.nu.entity.SysUserEntity;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
import org.jeecg.common.system.api.ISysUserAPI;
|
||||||
import org.springframework.amqp.core.ExchangeTypes;
|
import org.springframework.amqp.core.ExchangeTypes;
|
||||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||||
|
|
@ -60,7 +60,7 @@ public class EmployeesMQListener {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBizEmployeesMediaService employeesMediaService;
|
private IBizEmployeesMediaService employeesMediaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService sysUserService;
|
private ISysUserAPI sysUserAPI;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysBaseAPI sysBaseAPI;
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
|
|
@ -1395,12 +1395,9 @@ public class EmployeesMQListener {
|
||||||
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||||
qw.eq("id", employeeId);
|
qw.eq("id", employeeId);
|
||||||
BizEmployeesInfo employeesInfo = employeesInfoService.getOne(qw);
|
BizEmployeesInfo employeesInfo = employeesInfoService.getOne(qw);
|
||||||
|
SysUserEntity user = sysUserAPI.getOne(employeeId);
|
||||||
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("employess_id", employeeId);
|
|
||||||
SysUser user = sysUserService.getOne(queryWrapper);
|
|
||||||
if(user==null) {
|
if(user==null) {
|
||||||
user = new SysUser();
|
user = new SysUserEntity();
|
||||||
user.setUsername(employeesInfo.getTel());
|
user.setUsername(employeesInfo.getTel());
|
||||||
user.setRealname(employeesInfo.getName());
|
user.setRealname(employeesInfo.getName());
|
||||||
String salt = oConvertUtils.randomGen(8);
|
String salt = oConvertUtils.randomGen(8);
|
||||||
|
|
@ -1425,7 +1422,7 @@ public class EmployeesMQListener {
|
||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setCreateTime(new Date());//设置创建时间
|
user.setCreateTime(new Date());//设置创建时间
|
||||||
user.setEmployessId(employeeId);
|
user.setEmployessId(employeeId);
|
||||||
sysUserService.save(user);
|
sysUserAPI.save(user);
|
||||||
}else{
|
}else{
|
||||||
user.setUsername(employeesInfo.getTel());
|
user.setUsername(employeesInfo.getTel());
|
||||||
user.setRealname(employeesInfo.getName());
|
user.setRealname(employeesInfo.getName());
|
||||||
|
|
@ -1450,15 +1447,13 @@ public class EmployeesMQListener {
|
||||||
user.setStatus(1);
|
user.setStatus(1);
|
||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setUpdateTime(new Date());//设置创建时间
|
user.setUpdateTime(new Date());//设置创建时间
|
||||||
sysUserService.updateById(user);
|
sysUserAPI.updateById(user);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//不需要初始化,从其他业务结构复制过来
|
//不需要初始化,从其他业务结构复制过来
|
||||||
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
SysUserEntity user = sysUserAPI.getOne(employeeId);
|
||||||
queryWrapper.eq("employess_id", employeeId);
|
|
||||||
SysUser user = sysUserService.getOne(queryWrapper);
|
|
||||||
if(user==null) {
|
if(user==null) {
|
||||||
user = new SysUser();
|
user = new SysUserEntity();
|
||||||
user.setUsername(dto.getUsername());
|
user.setUsername(dto.getUsername());
|
||||||
user.setRealname(dto.getRealname());
|
user.setRealname(dto.getRealname());
|
||||||
user.setPassword(dto.getPassword());
|
user.setPassword(dto.getPassword());
|
||||||
|
|
@ -1472,7 +1467,7 @@ public class EmployeesMQListener {
|
||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setCreateTime(new Date());//设置创建时间
|
user.setCreateTime(new Date());//设置创建时间
|
||||||
user.setEmployessId(employeeId);
|
user.setEmployessId(employeeId);
|
||||||
sysUserService.save(user);
|
sysUserAPI.save(user);
|
||||||
}else{
|
}else{
|
||||||
user.setUsername(dto.getUsername());
|
user.setUsername(dto.getUsername());
|
||||||
user.setRealname(dto.getRealname());
|
user.setRealname(dto.getRealname());
|
||||||
|
|
@ -1486,15 +1481,13 @@ public class EmployeesMQListener {
|
||||||
user.setStatus(1);
|
user.setStatus(1);
|
||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setUpdateTime(new Date());//设置创建时间
|
user.setUpdateTime(new Date());//设置创建时间
|
||||||
sysUserService.updateById(user);
|
sysUserAPI.updateById(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(izInitPassword.equals("1")){
|
if(izInitPassword.equals("1")){
|
||||||
//需要更新其他业务平台密码
|
//需要更新其他业务平台密码
|
||||||
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
SysUserEntity user = sysUserAPI.getOne(employeeId);
|
||||||
queryWrapper.eq("employess_id", employeeId);
|
|
||||||
SysUser user = sysUserService.getOne(queryWrapper);
|
|
||||||
if(user!=null){
|
if(user!=null){
|
||||||
SysUserMQDto sysUserMQDto = new SysUserMQDto();
|
SysUserMQDto sysUserMQDto = new SysUserMQDto();
|
||||||
BeanUtils.copyProperties(user, sysUserMQDto);
|
BeanUtils.copyProperties(user, sysUserMQDto);
|
||||||
|
|
@ -1525,14 +1518,11 @@ public class EmployeesMQListener {
|
||||||
errorHandler = "employeesMQErrorHandler"
|
errorHandler = "employeesMQErrorHandler"
|
||||||
)
|
)
|
||||||
public void handleSyncSysUserPwd(SysUserMQDto dto) {
|
public void handleSyncSysUserPwd(SysUserMQDto dto) {
|
||||||
String employeeId = dto.getEmployeeId();
|
SysUserEntity user = sysUserAPI.getOne(dto.getEmployeeId());
|
||||||
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("employess_id", employeeId);
|
|
||||||
SysUser user = sysUserService.getOne(queryWrapper);
|
|
||||||
if(user!=null) {
|
if(user!=null) {
|
||||||
user.setPassword(dto.getPassword());
|
user.setPassword(dto.getPassword());
|
||||||
user.setSalt(dto.getSalt());
|
user.setSalt(dto.getSalt());
|
||||||
sysUserService.updateById(user);
|
sysUserAPI.updateById(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1550,10 +1540,10 @@ public class EmployeesMQListener {
|
||||||
errorHandler = "employeesMQErrorHandler"
|
errorHandler = "employeesMQErrorHandler"
|
||||||
)
|
)
|
||||||
public void handleSysUserInfo(SysUserMQDto dto) {
|
public void handleSysUserInfo(SysUserMQDto dto) {
|
||||||
String employeeId = dto.getEmployeeId();
|
// String employeeId = dto.getEmployeeId();
|
||||||
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<SysUserEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("employess_id", employeeId);
|
// queryWrapper.eq("employess_id", employeeId);
|
||||||
SysUser user = sysUserService.getOne(queryWrapper);
|
SysUserEntity user = sysUserAPI.getOne(dto.getEmployeeId());
|
||||||
if(user!=null) {
|
if(user!=null) {
|
||||||
SysUserMQDto sysUserMQDto = new SysUserMQDto();
|
SysUserMQDto sysUserMQDto = new SysUserMQDto();
|
||||||
BeanUtils.copyProperties(user, sysUserMQDto);
|
BeanUtils.copyProperties(user, sysUserMQDto);
|
||||||
|
|
|
||||||
|
|
@ -1152,9 +1152,9 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
errorMsg = errorCode;
|
errorMsg = errorCode;
|
||||||
}
|
}
|
||||||
updateDeviceStatus(id,errorCode);
|
|
||||||
log.info("getPreviewUrl:{}",errorMsg);
|
log.info("getPreviewUrl:{}",errorMsg);
|
||||||
}
|
}
|
||||||
|
updateDeviceStatus(id,errorCode);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>nu-system-local-api</artifactId>
|
<artifactId>nu-system-local-api</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nursingunit.boot</groupId>
|
||||||
|
<artifactId>nursing-unit-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.jeecg.common.system.api;
|
||||||
|
|
||||||
|
import com.nu.entity.SysUserEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @Author caolei
|
||||||
|
* @since 2025-10-09
|
||||||
|
*/
|
||||||
|
public interface ISysUserAPI{
|
||||||
|
SysUserEntity getOne(String employeeId);
|
||||||
|
void save(SysUserEntity sysUserEntity);
|
||||||
|
void updateById(SysUserEntity sysUserEntity);
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyuncs.exceptions.ClientException;
|
import com.aliyuncs.exceptions.ClientException;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.nu.dto.EmployeesApplyMQDto;
|
||||||
|
import com.nu.dto.SysUserMQDto;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -15,6 +18,7 @@ import org.jeecg.common.constant.CacheConstant;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
import org.jeecg.common.constant.enums.DySmsEnum;
|
import org.jeecg.common.constant.enums.DySmsEnum;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.*;
|
import org.jeecg.common.util.*;
|
||||||
|
|
@ -66,6 +70,10 @@ public class LoginController {
|
||||||
private BaseCommonService baseCommonService;
|
private BaseCommonService baseCommonService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JeecgBaseConfig jeecgBaseConfig;
|
private JeecgBaseConfig jeecgBaseConfig;
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
|
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
|
||||||
|
|
||||||
|
|
@ -128,6 +136,15 @@ public class LoginController {
|
||||||
LoginUser loginUser = new LoginUser();
|
LoginUser loginUser = new LoginUser();
|
||||||
BeanUtils.copyProperties(sysUser, loginUser);
|
BeanUtils.copyProperties(sysUser, loginUser);
|
||||||
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null,loginUser);
|
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null,loginUser);
|
||||||
|
|
||||||
|
// step.7 修改管理系统中账号的最后登录机构信息
|
||||||
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
|
String orgCode = deptInfo.getString("code");
|
||||||
|
SysUserMQDto dto = new SysUserMQDto();
|
||||||
|
dto.setEmployeeId(sysUser.getEmployessId());
|
||||||
|
dto.setOrgCode(orgCode);
|
||||||
|
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employeesorg.lastlogin", dto);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -577,7 +594,7 @@ public class LoginController {
|
||||||
//返回前端
|
//返回前端
|
||||||
String base64 = RandImageUtil.generate(code);
|
String base64 = RandImageUtil.generate(code);
|
||||||
res.setSuccess(true);
|
res.setSuccess(true);
|
||||||
res.setResult(base64);
|
// res.setResult(base64);//暂无需提供
|
||||||
res.setMessage(code);
|
res.setMessage(code);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.nu.entity.SysUserEntity;
|
||||||
|
import freemarker.core.TemplateClassResolver;
|
||||||
|
import freemarker.template.Configuration;
|
||||||
|
import freemarker.template.Template;
|
||||||
|
import freemarker.template.TemplateException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.jeecg.common.api.dto.DataLogDTO;
|
||||||
|
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||||
|
import org.jeecg.common.api.dto.message.*;
|
||||||
|
import org.jeecg.common.aspect.UrlMatchEnum;
|
||||||
|
import org.jeecg.common.constant.*;
|
||||||
|
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||||
|
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||||
|
import org.jeecg.common.constant.enums.SysAnnmentTypeEnum;
|
||||||
|
import org.jeecg.common.desensitization.util.SensitiveInfoUtil;
|
||||||
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.api.ISysUserAPI;
|
||||||
|
import org.jeecg.common.system.query.QueryCondition;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.system.vo.*;
|
||||||
|
import org.jeecg.common.util.HTMLUtils;
|
||||||
|
import org.jeecg.common.util.YouBianCodeUtil;
|
||||||
|
import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
|
||||||
|
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||||
|
import org.jeecg.modules.message.entity.SysMessageTemplate;
|
||||||
|
import org.jeecg.modules.message.handle.impl.DdSendMsgHandle;
|
||||||
|
import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
|
||||||
|
import org.jeecg.modules.message.handle.impl.QywxSendMsgHandle;
|
||||||
|
import org.jeecg.modules.message.handle.impl.SystemSendMsgHandle;
|
||||||
|
import org.jeecg.modules.message.service.ISysMessageTemplateService;
|
||||||
|
import org.jeecg.modules.message.websocket.WebSocket;
|
||||||
|
import org.jeecg.modules.system.entity.*;
|
||||||
|
import org.jeecg.modules.system.mapper.*;
|
||||||
|
import org.jeecg.modules.system.service.*;
|
||||||
|
import org.jeecg.modules.system.util.SecurityUtil;
|
||||||
|
import org.jeecg.modules.system.vo.lowapp.SysDictVo;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
|
||||||
|
import org.springframework.util.AntPathMatcher;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.PathMatcher;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DatabaseMetaData;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 底层共通业务API,提供其他独立模块调用
|
||||||
|
* @Author: scott
|
||||||
|
* @Date:2019-4-20
|
||||||
|
* @Version:V1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SysUserApiImpl implements ISysUserAPI {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService service;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysUserEntity getOne(String employeeId) {
|
||||||
|
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("employess_id", employeeId);
|
||||||
|
SysUser user = service.getOne(queryWrapper);
|
||||||
|
SysUserEntity sysUserEntity = new SysUserEntity();
|
||||||
|
BeanUtils.copyProperties(user, sysUserEntity);
|
||||||
|
return sysUserEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(SysUserEntity sysUserEntity) {
|
||||||
|
SysUser user = new SysUser();
|
||||||
|
BeanUtils.copyProperties(sysUserEntity, user);
|
||||||
|
service.save(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateById(SysUserEntity sysUserEntity) {
|
||||||
|
SysUser user = new SysUser();
|
||||||
|
BeanUtils.copyProperties(sysUserEntity, user);
|
||||||
|
service.updateById(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue