Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
self-service
Commits
354631d5
Commit
354631d5
authored
Jan 12, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用信息改为从基础平台获取
parent
a4c0c563
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
613 additions
and
3 deletions
+613
-3
common-lib/src/main/java/com/mortals/xhx/common/pdu/app/AppPdu.java
.../src/main/java/com/mortals/xhx/common/pdu/app/AppPdu.java
+462
-0
common-lib/src/main/java/com/mortals/xhx/feign/app/IAppFeign.java
...ib/src/main/java/com/mortals/xhx/feign/app/IAppFeign.java
+63
-0
sst-manager/src/main/java/com/mortals/xhx/module/apps/model/vo/AppsInfoVo.java
...java/com/mortals/xhx/module/apps/model/vo/AppsInfoVo.java
+4
-1
sst-manager/src/main/java/com/mortals/xhx/module/apps/service/impl/AppsInfoServiceImpl.java
...als/xhx/module/apps/service/impl/AppsInfoServiceImpl.java
+81
-1
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
...rtals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
+3
-1
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/app/AppPdu.java
0 → 100644
View file @
354631d5
package
com.mortals.xhx.common.pdu.app
;
import
com.mortals.framework.model.BaseEntityLong
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 基础平台自助终端应用
*/
public
class
AppPdu
extends
BaseEntityLong
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 站点Id
*/
private
Long
siteId
;
/**
* 站点名称
*/
private
String
siteName
;
/**
* 应用编码
*/
private
String
appCode
;
/**
* 应用名称
*/
private
String
appName
;
/**
* 应用图标
*/
private
String
appIconPath
;
/**
* 应用主题名称
*/
private
String
appThemeName
;
/**
* 类型(1.终端应用,2.移动端应用)
*/
private
Integer
type
;
/**
* 链接地址
*/
private
String
url
;
/**
* 服务接口地址
*/
private
String
serviceApi
;
/**
* 下发设备次数
*/
private
Integer
downDevCount
;
/**
* 是否上架(0.下架,1.上架)
*/
private
Integer
shelves
;
/**
* 类型(1.应用程序,2.url)
*/
private
Integer
appType
;
/**
* 文件名称
*/
private
String
fileName
;
/**
* 文件相对路径地址
*/
private
String
filePath
;
/**
* 文件部署路径地址
*/
private
String
distributeFilePath
;
/**
* 当前版本
*/
private
Integer
version
;
/**
* 简介
*/
private
String
summary
;
/**
* 更新说明
*/
private
String
notes
;
/**
* 是否部署(0.否,1.是)
*/
private
Integer
distribute
;
/**
* 是否数据更新(0.否,1.是)
*/
private
Integer
dataUpdate
;
public
AppPdu
(){}
/**
* 获取 站点Id
* @return Long
*/
public
Long
getSiteId
(){
return
siteId
;
}
/**
* 设置 站点Id
* @param siteId
*/
public
void
setSiteId
(
Long
siteId
){
this
.
siteId
=
siteId
;
}
/**
* 获取 站点名称
* @return String
*/
public
String
getSiteName
(){
return
siteName
;
}
/**
* 设置 站点名称
* @param siteName
*/
public
void
setSiteName
(
String
siteName
){
this
.
siteName
=
siteName
;
}
/**
* 获取 应用编码
* @return String
*/
public
String
getAppCode
(){
return
appCode
;
}
/**
* 设置 应用编码
* @param appCode
*/
public
void
setAppCode
(
String
appCode
){
this
.
appCode
=
appCode
;
}
/**
* 获取 应用名称
* @return String
*/
public
String
getAppName
(){
return
appName
;
}
/**
* 设置 应用名称
* @param appName
*/
public
void
setAppName
(
String
appName
){
this
.
appName
=
appName
;
}
/**
* 获取 应用图标
* @return String
*/
public
String
getAppIconPath
(){
return
appIconPath
;
}
/**
* 设置 应用图标
* @param appIconPath
*/
public
void
setAppIconPath
(
String
appIconPath
){
this
.
appIconPath
=
appIconPath
;
}
/**
* 获取 应用主题名称
* @return String
*/
public
String
getAppThemeName
(){
return
appThemeName
;
}
/**
* 设置 应用主题名称
* @param appThemeName
*/
public
void
setAppThemeName
(
String
appThemeName
){
this
.
appThemeName
=
appThemeName
;
}
/**
* 获取 类型(1.终端应用,2.移动端应用)
* @return Integer
*/
public
Integer
getType
(){
return
type
;
}
/**
* 设置 类型(1.终端应用,2.移动端应用)
* @param type
*/
public
void
setType
(
Integer
type
){
this
.
type
=
type
;
}
/**
* 获取 链接地址
* @return String
*/
public
String
getUrl
(){
return
url
;
}
/**
* 设置 链接地址
* @param url
*/
public
void
setUrl
(
String
url
){
this
.
url
=
url
;
}
/**
* 获取 服务接口地址
* @return String
*/
public
String
getServiceApi
(){
return
serviceApi
;
}
/**
* 设置 服务接口地址
* @param serviceApi
*/
public
void
setServiceApi
(
String
serviceApi
){
this
.
serviceApi
=
serviceApi
;
}
/**
* 获取 下发设备次数
* @return Integer
*/
public
Integer
getDownDevCount
(){
return
downDevCount
;
}
/**
* 设置 下发设备次数
* @param downDevCount
*/
public
void
setDownDevCount
(
Integer
downDevCount
){
this
.
downDevCount
=
downDevCount
;
}
/**
* 获取 是否上架(0.下架,1.上架)
* @return Integer
*/
public
Integer
getShelves
(){
return
shelves
;
}
/**
* 设置 是否上架(0.下架,1.上架)
* @param shelves
*/
public
void
setShelves
(
Integer
shelves
){
this
.
shelves
=
shelves
;
}
/**
* 获取 类型(1.应用程序,2.url)
* @return Integer
*/
public
Integer
getAppType
(){
return
appType
;
}
/**
* 设置 类型(1.应用程序,2.url)
* @param appType
*/
public
void
setAppType
(
Integer
appType
){
this
.
appType
=
appType
;
}
/**
* 获取 文件名称
* @return String
*/
public
String
getFileName
(){
return
fileName
;
}
/**
* 设置 文件名称
* @param fileName
*/
public
void
setFileName
(
String
fileName
){
this
.
fileName
=
fileName
;
}
/**
* 获取 文件相对路径地址
* @return String
*/
public
String
getFilePath
(){
return
filePath
;
}
/**
* 设置 文件相对路径地址
* @param filePath
*/
public
void
setFilePath
(
String
filePath
){
this
.
filePath
=
filePath
;
}
/**
* 获取 文件部署路径地址
* @return String
*/
public
String
getDistributeFilePath
(){
return
distributeFilePath
;
}
/**
* 设置 文件部署路径地址
* @param distributeFilePath
*/
public
void
setDistributeFilePath
(
String
distributeFilePath
){
this
.
distributeFilePath
=
distributeFilePath
;
}
/**
* 获取 当前版本
* @return Integer
*/
public
Integer
getVersion
(){
return
version
;
}
/**
* 设置 当前版本
* @param version
*/
public
void
setVersion
(
Integer
version
){
this
.
version
=
version
;
}
/**
* 获取 简介
* @return String
*/
public
String
getSummary
(){
return
summary
;
}
/**
* 设置 简介
* @param summary
*/
public
void
setSummary
(
String
summary
){
this
.
summary
=
summary
;
}
/**
* 获取 更新说明
* @return String
*/
public
String
getNotes
(){
return
notes
;
}
/**
* 设置 更新说明
* @param notes
*/
public
void
setNotes
(
String
notes
){
this
.
notes
=
notes
;
}
/**
* 获取 是否部署(0.否,1.是)
* @return Integer
*/
public
Integer
getDistribute
(){
return
distribute
;
}
/**
* 设置 是否部署(0.否,1.是)
* @param distribute
*/
public
void
setDistribute
(
Integer
distribute
){
this
.
distribute
=
distribute
;
}
/**
* 获取 是否数据更新(0.否,1.是)
* @return Integer
*/
public
Integer
getDataUpdate
(){
return
dataUpdate
;
}
/**
* 设置 是否数据更新(0.否,1.是)
* @param dataUpdate
*/
public
void
setDataUpdate
(
Integer
dataUpdate
){
this
.
dataUpdate
=
dataUpdate
;
}
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
AppPdu
)
{
AppPdu
tmp
=
(
AppPdu
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
return
false
;
}
public
String
toString
(){
StringBuilder
sb
=
new
StringBuilder
(
""
);
sb
.
append
(
",siteId:"
).
append
(
getSiteId
());
sb
.
append
(
",siteName:"
).
append
(
getSiteName
());
sb
.
append
(
",appCode:"
).
append
(
getAppCode
());
sb
.
append
(
",appName:"
).
append
(
getAppName
());
sb
.
append
(
",appIconPath:"
).
append
(
getAppIconPath
());
sb
.
append
(
",appThemeName:"
).
append
(
getAppThemeName
());
sb
.
append
(
",type:"
).
append
(
getType
());
sb
.
append
(
",url:"
).
append
(
getUrl
());
sb
.
append
(
",serviceApi:"
).
append
(
getServiceApi
());
sb
.
append
(
",downDevCount:"
).
append
(
getDownDevCount
());
sb
.
append
(
",shelves:"
).
append
(
getShelves
());
sb
.
append
(
",appType:"
).
append
(
getAppType
());
sb
.
append
(
",fileName:"
).
append
(
getFileName
());
sb
.
append
(
",filePath:"
).
append
(
getFilePath
());
sb
.
append
(
",distributeFilePath:"
).
append
(
getDistributeFilePath
());
sb
.
append
(
",version:"
).
append
(
getVersion
());
sb
.
append
(
",summary:"
).
append
(
getSummary
());
sb
.
append
(
",notes:"
).
append
(
getNotes
());
sb
.
append
(
",distribute:"
).
append
(
getDistribute
());
sb
.
append
(
",dataUpdate:"
).
append
(
getDataUpdate
());
return
sb
.
toString
();
}
public
void
initAttrValue
(){
this
.
siteId
=
null
;
this
.
siteName
=
null
;
this
.
appCode
=
""
;
this
.
appName
=
""
;
this
.
appIconPath
=
""
;
this
.
appThemeName
=
""
;
this
.
type
=
1
;
this
.
url
=
null
;
this
.
serviceApi
=
""
;
this
.
downDevCount
=
0
;
this
.
shelves
=
0
;
this
.
appType
=
1
;
this
.
fileName
=
""
;
this
.
filePath
=
""
;
this
.
distributeFilePath
=
""
;
this
.
version
=
0
;
this
.
summary
=
""
;
this
.
notes
=
null
;
this
.
distribute
=
0
;
this
.
dataUpdate
=
0
;
}
}
common-lib/src/main/java/com/mortals/xhx/feign/app/IAppFeign.java
0 → 100644
View file @
354631d5
package
com.mortals.xhx.feign.app
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.app.AppPdu
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.feign.IFeign
;
import
com.mortals.xhx.feign.device.IDeviceFeign
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
/**
* 自助终端应用
*/
@FeignClient
(
name
=
"base-manager"
,
path
=
"/base"
,
fallbackFactory
=
AppFeignFallbackFactory
.
class
)
public
interface
IAppFeign
extends
IFeign
{
/**
* 查看自助终端应用列表
*
* @param appPdu
* @return
*/
@PostMapping
(
value
=
"/app/list"
)
Rest
<
RespData
<
List
<
AppPdu
>>>
list
(
@RequestBody
AppPdu
appPdu
);
/**
* 查看自助终端应用
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/app/info"
)
Rest
<
AppPdu
>
info
(
@RequestParam
(
value
=
"id"
)
Long
id
);
}
@Slf4j
@Component
class
AppFeignFallbackFactory
implements
FallbackFactory
<
IAppFeign
>
{
@Override
public
IAppFeign
create
(
Throwable
throwable
)
{
return
new
IAppFeign
(){
@Override
public
Rest
<
RespData
<
List
<
AppPdu
>>>
list
(
AppPdu
appPdu
)
{
return
Rest
.
fail
(
"暂时无法获取自助终端应用列表,请稍后再试!"
);
}
@Override
public
Rest
<
AppPdu
>
info
(
Long
id
)
{
return
Rest
.
fail
(
"暂时无法获取自助终端应用,请稍后再试!"
);
}
};
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/apps/model/vo/AppsInfoVo.java
View file @
354631d5
package
com.mortals.xhx.module.apps.model.vo
;
package
com.mortals.xhx.module.apps.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.apps.model.AppsInfoEntity
;
import
com.mortals.xhx.module.apps.model.AppsInfoEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -9,6 +11,7 @@ import java.util.List;
...
@@ -9,6 +11,7 @@ import java.util.List;
* @author zxfei
* @author zxfei
* @date 2022-12-26
* @date 2022-12-26
*/
*/
@Data
public
class
AppsInfoVo
extends
BaseEntityLong
{
public
class
AppsInfoVo
extends
BaseEntityLong
{
private
Long
siteId
;
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/apps/service/impl/AppsInfoServiceImpl.java
View file @
354631d5
package
com.mortals.xhx.module.apps.service.impl
;
package
com.mortals.xhx.module.apps.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.app.AppPdu
;
import
com.mortals.xhx.feign.app.IAppFeign
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -6,6 +12,12 @@ import com.mortals.framework.model.Context;
...
@@ -6,6 +12,12 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.apps.dao.AppsInfoDao
;
import
com.mortals.xhx.module.apps.dao.AppsInfoDao
;
import
com.mortals.xhx.module.apps.model.AppsInfoEntity
;
import
com.mortals.xhx.module.apps.model.AppsInfoEntity
;
import
com.mortals.xhx.module.apps.service.AppsInfoService
;
import
com.mortals.xhx.module.apps.service.AppsInfoService
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
/**
/**
* AppsInfoService
* AppsInfoService
* 应用信息 service实现
* 应用信息 service实现
...
@@ -16,4 +28,72 @@ import com.mortals.xhx.module.apps.service.AppsInfoService;
...
@@ -16,4 +28,72 @@ import com.mortals.xhx.module.apps.service.AppsInfoService;
@Service
(
"appsInfoService"
)
@Service
(
"appsInfoService"
)
public
class
AppsInfoServiceImpl
extends
AbstractCRUDServiceImpl
<
AppsInfoDao
,
AppsInfoEntity
,
Long
>
implements
AppsInfoService
{
public
class
AppsInfoServiceImpl
extends
AbstractCRUDServiceImpl
<
AppsInfoDao
,
AppsInfoEntity
,
Long
>
implements
AppsInfoService
{
@Autowired
private
IAppFeign
appFeign
;
@Override
public
AppsInfoEntity
save
(
AppsInfoEntity
entity
,
Context
context
)
throws
AppException
{
return
null
;
}
@Override
public
int
save
(
List
<
AppsInfoEntity
>
list
,
Context
context
)
throws
AppException
{
return
0
;
}
@Override
public
AppsInfoEntity
update
(
AppsInfoEntity
entity
,
Context
context
)
throws
AppException
{
return
null
;
}
@Override
public
int
update
(
List
<
AppsInfoEntity
>
list
,
Context
context
)
throws
AppException
{
return
0
;
}
@Override
public
AppsInfoEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
return
null
;
}
@Override
public
List
<
AppsInfoEntity
>
find
(
AppsInfoEntity
entity
)
throws
AppException
{
AppPdu
appPdu
=
new
AppPdu
();
appPdu
.
setSiteId
(
entity
.
getSiteId
());
appPdu
.
setSize
(
999
);
Rest
<
RespData
<
List
<
AppPdu
>>>
rest
=
appFeign
.
list
(
appPdu
);
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
()))
{
List
<
AppsInfoEntity
>
appsInfoEntities
=
new
ArrayList
<>();
for
(
AppPdu
pdu:
rest
.
getData
().
getData
()){
appsInfoEntities
.
add
(
conversion
(
pdu
));
}
return
appsInfoEntities
;
}
else
{
return
Collections
.
emptyList
();
}
}
@Override
public
AppsInfoEntity
get
(
Long
id
)
throws
AppException
{
Rest
<
AppPdu
>
rest
=
appFeign
.
info
(
id
);
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
()))
{
return
conversion
(
rest
.
getData
());
}
else
{
return
null
;
}
}
private
AppsInfoEntity
conversion
(
AppPdu
pdu
){
if
(
pdu
==
null
){
return
null
;
}
AppsInfoEntity
appsInfoEntity
=
new
AppsInfoEntity
();
appsInfoEntity
.
setId
(
pdu
.
getId
());
appsInfoEntity
.
setName
(
pdu
.
getAppName
());
appsInfoEntity
.
setDescribe
(
pdu
.
getSummary
());
appsInfoEntity
.
setIcon
(
pdu
.
getAppIconPath
());
appsInfoEntity
.
setUrl
(
pdu
.
getUrl
());
return
appsInfoEntity
;
}
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
View file @
354631d5
...
@@ -35,7 +35,9 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
...
@@ -35,7 +35,9 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
if
(
siteId
==
null
){
if
(
siteId
==
null
){
throw
new
AppException
(
"站点id不能为空"
);
throw
new
AppException
(
"站点id不能为空"
);
}
}
List
<
AppsInfoEntity
>
allApps
=
appsInfoService
.
find
(
new
AppsInfoEntity
());
AppsInfoEntity
appsInfoQuery
=
new
AppsInfoEntity
();
appsInfoQuery
.
setSiteId
(
siteId
);
List
<
AppsInfoEntity
>
allApps
=
appsInfoService
.
find
(
appsInfoQuery
);
SstAppsEntity
query
=
new
SstAppsEntity
();
SstAppsEntity
query
=
new
SstAppsEntity
();
query
.
setSiteId
(
siteId
);
query
.
setSiteId
(
siteId
);
List
<
SstAppsEntity
>
appsEntities
=
this
.
find
(
query
);
List
<
SstAppsEntity
>
appsEntities
=
this
.
find
(
query
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment