Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
dad1f09b
由
张雷
编写于
2023-03-30 18:55:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
人员定位系统对接开发
1 个父辈
7dfb2818
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
129 行增加
和
25 行删除
fm-product/src/main/java/com/skua/modules/location/controller/UserLocationController.java
fm-product/src/main/java/com/skua/modules/location/entity/UserBaseInfo.java
fm-product/src/main/java/com/skua/modules/location/entity/UserBaseInfoYwResult.java
fm-product/src/main/java/com/skua/modules/location/entity/UserLocation.java
fm-product/src/main/java/com/skua/modules/location/service/ILocationService.java
fm-product/src/main/java/com/skua/modules/location/service/impl/BkyhLocationServiceImpl.java
fm-product/src/main/java/com/skua/modules/location/service/impl/YwLocationServiceImpl.java
fm-product/src/main/java/com/skua/modules/location/controller/UserLocationController.java
查看文件 @
dad1f09
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.location.controller;
import
com.skua.core.api.vo.Result
;
import
com.skua.core.aspect.annotation.AutoLog
;
import
com.skua.modules.location.UserLocationFactory
;
import
com.skua.modules.location.entity.UserBaseInfo
;
import
com.skua.modules.location.entity.UserLocation
;
import
com.skua.modules.location.service.ILocationService
;
import
io.swagger.annotations.Api
;
...
...
@@ -22,6 +23,19 @@ import java.util.List;
public
class
UserLocationController
{
//*****************************************义乌人员定位**********************************************//
@AutoLog
(
value
=
"义乌人员定位-获取所有人员列表"
)
@ApiOperation
(
value
=
"义乌人员定位-获取所有人员列表"
,
notes
=
"义乌人员定位-获取所有人员列表"
)
@GetMapping
(
value
=
"/getAllUser"
)
public
Result
<
List
<
UserBaseInfo
>>
getAllUser
()
{
Result
<
List
<
UserBaseInfo
>>
result
=
new
Result
<
List
<
UserBaseInfo
>>();
List
<
UserBaseInfo
>
list
=
new
ArrayList
<>();
ILocationService
locationService
=
UserLocationFactory
.
getLocationService
(
"YW"
);
list
=
locationService
.
getAllUser
();
result
.
setResult
(
list
);
result
.
setSuccess
(
true
);
return
result
;
}
@AutoLog
(
value
=
"义乌人员定位-获取所有人员实时定位数据"
)
@ApiOperation
(
value
=
"义乌人员定位-获取所有人员实时定位数据"
,
notes
=
"义乌人员定位-获取所有人员实时定位数据"
)
@GetMapping
(
value
=
"/getAllUserGPS"
)
...
...
fm-product/src/main/java/com/skua/modules/location/entity/UserBaseInfo.java
0 → 100644
查看文件 @
dad1f09
package
com
.
skua
.
modules
.
location
.
entity
;
import
lombok.Data
;
/**
* 人员定位数据
*/
@Data
public
class
UserBaseInfo
{
/**设备编码*/
private
String
deviceCode
;
/**用户类型*/
private
String
userType
;
/**人员名称*/
private
String
userName
;
/**人员工号*/
private
String
userNo
;
/**人员头像*/
private
String
userIcon
;
}
fm-product/src/main/java/com/skua/modules/location/entity/UserBaseInfoYwResult.java
0 → 100644
查看文件 @
dad1f09
package
com
.
skua
.
modules
.
location
.
entity
;
import
lombok.Data
;
/**
* 人员详细信息
*/
@Data
public
class
UserBaseInfoYwResult
{
private
String
branchtypeid
;
private
String
worktypename
;
private
String
elasttime
;
private
String
worktype
;
private
Integer
id
;
private
String
empno
;
private
String
empname
;
private
String
locatorNum
;
private
String
iccard
;
private
String
deviceno
;
private
String
empsex
;
private
String
idcard
;
private
String
tel
;
private
String
addr
;
private
Integer
h_id
;
private
Integer
isvalid
;
private
String
departmentId
;
private
String
departmentName
;
private
String
lasttime
;
}
fm-product/src/main/java/com/skua/modules/location/entity/UserLocation.java
查看文件 @
dad1f09
...
...
@@ -10,8 +10,12 @@ public class UserLocation {
/**设备编码*/
private
String
deviceCode
;
/**设备类型*/
private
String
deviceType
;
/**人员名称*/
private
String
userName
;
/**人员头像*/
private
String
userIcon
;
/**X坐标*/
private
Double
x
;
/**Y坐标*/
...
...
fm-product/src/main/java/com/skua/modules/location/service/ILocationService.java
查看文件 @
dad1f09
package
com
.
skua
.
modules
.
location
.
service
;
import
com.skua.modules.location.entity.UserBaseInfo
;
import
com.skua.modules.location.entity.UserLocation
;
import
java.util.List
;
...
...
@@ -9,4 +10,6 @@ public interface ILocationService {
List
<
UserLocation
>
getAllUserGPS
();
List
<
UserLocation
>
getUserHistory
(
String
deviceCode
,
String
startTime
,
String
endTime
);
List
<
UserBaseInfo
>
getAllUser
();
}
...
...
fm-product/src/main/java/com/skua/modules/location/service/impl/BkyhLocationServiceImpl.java
查看文件 @
dad1f09
package
com
.
skua
.
modules
.
location
.
service
.
impl
;
import
com.skua.modules.location.entity.UserBaseInfo
;
import
com.skua.modules.location.entity.UserLocation
;
import
com.skua.modules.location.service.ILocationService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -61,5 +62,9 @@ public class BkyhLocationServiceImpl implements ILocationService {
return
list
;
}
@Override
public
List
<
UserBaseInfo
>
getAllUser
()
{
return
null
;
}
}
...
...
fm-product/src/main/java/com/skua/modules/location/service/impl/YwLocationServiceImpl.java
查看文件 @
dad1f09
package
com
.
skua
.
modules
.
location
.
service
.
impl
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.skua.modules.location.entity.UserLocation
;
import
com.skua.modules.location.entity.UserLocationYwResult
;
import
com.skua.modules.location.entity.UserLocationHistoryYwResult
;
import
com.skua.modules.location.entity.*
;
import
com.skua.modules.location.service.ILocationService
;
import
com.skua.modules.location.util.ChangeLocationUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -62,29 +61,29 @@ public class YwLocationServiceImpl implements ILocationService {
String
get
=
"{\n"
+
"\"data\":\n"
+
"[{\n"
+
"\"empName\":\"
张小凡
\",\n"
+
"\"empName\":\"
贾伟峰
\",\n"
+
"\"area\":\"2\",\n"
+
"\"deviceNo\":\"
f1843311
\",\n"
+
"\"crossY\":\"
1100
\",\n"
+
"\"crossX\":\"
2670
\",\n"
+
"\"deviceNo\":\"
16a7ebee
\",\n"
+
"\"crossY\":\"
-8438
\",\n"
+
"\"crossX\":\"
7186
\",\n"
+
"\"longitude\":104.04438600000114,\n"
+
"\"latitude\":30.630693000000115,\n"
+
"\"dateTime\":\"20
19
-05-05 11:35:52\",\n"
+
"\"layer\":\"1\",\n"
+
"\"empNo\":\"1
2123
\",\n"
+
"\"dateTime\":\"20
22
-05-05 11:35:52\",\n"
+
"\"layer\":\"
-
1\",\n"
+
"\"empNo\":\"1
08036
\",\n"
+
"\"specifictype\":\"0\"\n"
+
"},\n"
+
"{\n"
+
"\"empName\":\"
张大凡
\",\n"
+
"\"empName\":\"
何成翔
\",\n"
+
"\"area\":\"2\",\n"
+
"\"deviceNo\":\"
f1843310
\",\n"
+
"\"crossY\":\"
1111
\",\n"
+
"\"crossX\":\"
2666
\",\n"
+
"\"longitude\":124.0
443860
0000114,\n"
+
"\"latitude\":31.630
69300
0000115,\n"
+
"\"dateTime\":\"20
19
-05-05 11:35:52\",\n"
+
"\"layer\":\"1\",\n"
+
"\"empNo\":\"1
2121
\",\n"
+
"\"deviceNo\":\"
169c0cba
\",\n"
+
"\"crossY\":\"
-8312
\",\n"
+
"\"crossX\":\"
32438
\",\n"
+
"\"longitude\":124.0
123
0000114,\n"
+
"\"latitude\":31.630
123
0000115,\n"
+
"\"dateTime\":\"20
22
-05-05 11:35:52\",\n"
+
"\"layer\":\"
-
1\",\n"
+
"\"empNo\":\"1
47258
\",\n"
+
"\"specifictype\":\"0\"\n"
+
"}],\n"
+
"\"status\":0,\n"
+
...
...
@@ -95,13 +94,16 @@ public class YwLocationServiceImpl implements ILocationService {
getLocationBasicInfo
();
//坐标转换基础信息
for
(
UserLocationYwResult
userLocationYwResult
:
getList
)
{
UserLocation
userLocation
=
new
UserLocation
();
userLocation
.
setDeviceType
(
"员工"
);
userLocation
.
setFloor
(
userLocationYwResult
.
getLayer
());
userLocation
.
setDeviceCode
(
userLocationYwResult
.
getDeviceNo
());
userLocation
.
setUserName
(
userLocationYwResult
.
getEmpName
());
Map
<
String
,
Object
>
map
=
ChangeLocationUtils
.
changeUserLocation
(
userLocationYwResult
.
getLayer
(),
String
.
valueOf
(
userLocationYwResult
.
getCrossX
()),
String
.
valueOf
(
userLocationYwResult
.
getCrossY
()),
locationBasicInfo
);
userLocation
.
setX
(
Double
.
valueOf
(
map
.
get
(
"x"
).
toString
()));
userLocation
.
setY
(
Double
.
valueOf
(
map
.
get
(
"y"
).
toString
()));
// Map<String,Object> map = ChangeLocationUtils.changeUserLocation(userLocationYwResult.getLayer(), String.valueOf(userLocationYwResult.getCrossX()),
// String.valueOf(userLocationYwResult.getCrossY()), locationBasicInfo);
// userLocation.setX(Double.valueOf(map.get("x").toString()));
// userLocation.setY(Double.valueOf(map.get("y").toString()));
userLocation
.
setX
(
userLocationYwResult
.
getCrossX
());
userLocation
.
setY
(
userLocationYwResult
.
getCrossY
());
userLocation
.
setDateTime
(
userLocationYwResult
.
getDateTime
());
list
.
add
(
userLocation
);
}
...
...
@@ -114,7 +116,7 @@ public class YwLocationServiceImpl implements ILocationService {
String
get
=
"{\n"
+
"\"data\":[\n"
+
"{\n"
+
"\"name\":\"
何小龙
\",\n"
+
"\"name\":\"
贾伟峰
\",\n"
+
"\"time\":\"2020-04-20 00:02:35\",\n"
+
"\"x\":\"3539.05\",\n"
+
"\"y\":\"2711.93\",\n"
+
...
...
@@ -122,7 +124,7 @@ public class YwLocationServiceImpl implements ILocationService {
"\"lon\":121.05223514735032\n"
+
"},\n"
+
"{\n"
+
"\"name\":\"
何小龙
\",\n"
+
"\"name\":\"
贾伟峰
\",\n"
+
"\"time\":\"2020-04-20 00:02:45\",\n"
+
"\"x\":\"3536.05\",\n"
+
"\"y\":\"2611.93\",\n"
+
...
...
@@ -148,4 +150,27 @@ public class YwLocationServiceImpl implements ILocationService {
}
return
list
;
}
@Override
public
List
<
UserBaseInfo
>
getAllUser
()
{
List
<
UserBaseInfo
>
list
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"username"
,
"ywsjh"
);
map
.
put
(
"password"
,
"ywsjh@2023"
);
map
.
put
(
"page"
,
1
);
map
.
put
(
"rows"
,
800
);
map
.
put
(
"emp"
,
""
);
String
post
=
HttpUtil
.
get
(
"http://xylie.tpddns.cn:8084/YWSJH/open/information/getEmp.do"
,
map
);
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
parseObject
(
post
).
get
(
"data"
).
toString
());
List
<
UserBaseInfoYwResult
>
userList
=
JSONObject
.
parseArray
(
json
.
get
(
"rows"
).
toString
(),
UserBaseInfoYwResult
.
class
);
for
(
UserBaseInfoYwResult
userBaseInfoYwResult
:
userList
)
{
UserBaseInfo
userBaseInfo
=
new
UserBaseInfo
();
userBaseInfo
.
setDeviceCode
(
userBaseInfoYwResult
.
getDeviceno
());
userBaseInfo
.
setUserName
(
userBaseInfoYwResult
.
getEmpname
());
userBaseInfo
.
setUserNo
(
userBaseInfoYwResult
.
getEmpno
());
userBaseInfo
.
setUserType
(
"员工"
);
list
.
add
(
userBaseInfo
);
}
return
list
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论