人员定位

pull/14/head
dearlin 2024-01-08 09:16:25 +08:00
parent 6fef2c1407
commit 3fe3d5e010
7 changed files with 124 additions and 8 deletions

View File

@ -333,8 +333,9 @@ public class MapController extends BaseController {
@RequestMapping(value = "/getAlarmData")
@ResponseBody
public Object getAlarmData() {
return HttpRequestUtil.getPeopleApi("/statistics/alarmStatistics/todayAlarm","");
return HttpRequestUtil.getPeopleApi("/statistics/alarmStatistics/todayAlarm", "");
}
/**
* @Description:
* @Author: dearLin
@ -345,9 +346,34 @@ public class MapController extends BaseController {
@RequestMapping(value = "/getCzksBasicLocationInfoData")
@ResponseBody
public Object getCzksBasicLocationInfoData() {
return HttpRequestUtil.getPeopleApi("/statistics/personStatistics/todayPerson","");
return HttpRequestUtil.getPeopleApi("/statistics/personStatistics/todayPerson", "");
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/6/006 17:33
* @Param: [] []
* @Return: java.lang.Object
*/
@RequestMapping(value = "/czks/person/allPerson/listPage")
@ResponseBody
public Object getCzksOnlinePersion() throws Exception {
PageData pageData = this.getPageData();
JSONObject request = new JSONObject();
request.put("pageNum", 1);
request.put("pageSize", 10);
request.put("online", "true");
// 人员定位在线
ReturnMap online = HttpRequestUtil.getPeopleApi("/person/allPerson/listPage", request.toString());
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
// 系统人员数
int userCount = usersService.getUserCount(pageData);
// 系统部门数
int departCount = departmentService.getDepartmentCount(pageData);
online.put("userCount",userCount);
online.put("departCount",departCount);
return online;
}
/**
* @Description:
* @Author: dearLin
@ -363,11 +389,11 @@ public class MapController extends BaseController {
request.put("pageNum", pageData.getString("pageNum"));
request.put("pageSize", pageData.getString("pageSize"));
// 普通员工
if ("0".equals(pageData.getString("type"))) {
return HttpRequestUtil.getPeopleApi("/person/staff/listPage",request.toString());
if ("1".equals(pageData.getString("type"))) {
return HttpRequestUtil.getPeopleApi("/person/staff/listPage", request.toString());
} else {
// 相关方 员工
return HttpRequestUtil.getPeopleApi("/person/allPerson/listPage",request.toString());
return HttpRequestUtil.getPeopleApi("/person/allPerson/listPage", request.toString());
}
}
/**

View File

@ -181,5 +181,7 @@ public interface DepartmentMapper{
List<Department> listSubCorpDepartmentByParentId(String parentId);
PageData findByCorpDepartmentId(PageData condition);
int getDepartmentCount(PageData pageData);
}

View File

@ -231,5 +231,7 @@ public interface DepartmentService{
List<Department> listAllCorpDepartment(String number) throws Exception;
PageData getCorpDepartment(PageData condition) throws Exception;
int getDepartmentCount(PageData pageData);
}

View File

@ -441,6 +441,11 @@ public class DepartmentServiceImpl implements DepartmentService{
return departmentMapper.findByCorpDepartmentId(condition);
}
@Override
public int getDepartmentCount(PageData pageData) {
return departmentMapper.getDepartmentCount(pageData);
}
/**
* ID
* @param parentId

View File

@ -155,7 +155,85 @@ public class Smb {
* IMGFILES_IDFOREIGN_KEYTYPE
* Smb.sshSftp
* */
public static void sshSftp(MultipartFile file, String fileName, String path, String IMGFILES_ID, String FOREIGN_KEY, String TYPE) throws Exception {
public static void sshSftp(MultipartFile file, String fileName, String path,
String IMGFILES_ID, String FOREIGN_KEY, String TYPE) throws Exception {
Session session = null;
Channel channel = null;
JSch jsch = new JSch();
if (port <= 0) {
// 连接服务器,采用默认端口
session = jsch.getSession(user, host);
} else {
// 采用指定的端口连接服务器
session = jsch.getSession(user, host, port);
}
// 如果服务器连接不上,则抛出异常
if (session == null) {
throw new Exception("session is null");
}
// 设置登陆主机的密码
session.setPassword(password);
// 设置第一次登陆的时候提示,可选值:(ask | yes | no)
session.setConfig("StrictHostKeyChecking", "no");
// 设置登陆超时时间
session.connect(30000);
OutputStream outstream = null;
try {
// 创建sftp通信通道
channel = (Channel) session.openChannel("sftp");
channel.connect(1000);
ChannelSftp sftp = (ChannelSftp) channel;
// 进入服务器指定的文件夹
// File dir = new File(basePath+"/"+path);
// dir.setWritable(true, false);
// if(!dir.exists()){
// dir.mkdirs();
// }
createDir(basePath + path, sftp);
sftp.cd(basePath + path);
// 列出服务器指定的文件列表
// Vector v = sftp.ls("*");
// for(int i=0;i<v.size();i++){
// System.out.println(v.get(i));
// }
// 以下代码实现从本地上传一个文件到服务器,如果要实现下载,对换以下流就可以了
DockSendMessageService sendMessageService = SpringUtil.getBean(DockSendMessageService.class);
sftp.put(file.getInputStream(), fileName);
PageData pageData = new PageData();
pageData.put("IMGFILES_ID", IMGFILES_ID);
pageData.put("FOREIGN_KEY", FOREIGN_KEY);
pageData.put("TYPE", TYPE);
pageData.put("BASEIMGPATH", baseimgpath);
pageData.put("FILEPATH", path);
pageData.put("FILENAME", fileName);
TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setMessage("图片消息");
tenCorpDto.setData(pageData);
tenCorpDto.setId(UuidUtil.get32UUID());
tenCorpDto.setTopic("dockingPicture");
tenCorpDto.setProducer_name("qa-prevention-czks");
sendMessageService.sendMessagePicture(tenCorpDto);
} catch (Exception e) {
e.printStackTrace();
} finally {
// 关流操作
if (outstream != null) {
outstream.flush();
outstream.close();
}
if (session != null) {
session.disconnect();
}
if (channel != null) {
channel.disconnect();
}
}
}
public static void sshSftp(MultipartFile file, String fileName, String path,String FILE_NAME,
String IMGFILES_ID, String FOREIGN_KEY, String TYPE) throws Exception {
Session session = null;
Channel channel = null;
JSch jsch = new JSch();

View File

@ -592,4 +592,7 @@
where DEPARTMENT_ID = #{DEPARTMENT_ID}
order by DEP_ORDER asc, NAME
</select>
<select id="getDepartmentCount" resultType="java.lang.Integer">
SELECT COUNT(1) cont FROM `oa_department` WHERE CORPINFO_ID = #{CORPINFO_ID}
</select>
</mapper>

View File

@ -1050,7 +1050,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
sys_user
WHERE
CORPINFO_ID = #{CORPINFO_ID}
CORPINFO_ID = #{CORPINFO_ID} and ISDELETE = '0'
</select>
<!-- 查询公司检查过清单的员工总数 -->