Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
complex-platform
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
赵啸非
complex-platform
Commits
856b1824
Commit
856b1824
authored
Dec 04, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加事项材料与情形查询
parent
fd592217
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
10 deletions
+141
-10
complex-window-manager/src/main/java/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
...a/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
+2
-2
complex-window-manager/src/main/java/com/mortals/xhx/busiz/req/accept/ComplexMaterialsItem.java
...om/mortals/xhx/busiz/req/accept/ComplexMaterialsItem.java
+2
-0
complex-window-manager/src/main/java/com/mortals/xhx/busiz/web/ComplexApiController.java
.../java/com/mortals/xhx/busiz/web/ComplexApiController.java
+14
-1
complex-window-manager/src/main/java/com/mortals/xhx/thread/ImplementAcceptSendTask.java
.../java/com/mortals/xhx/thread/ImplementAcceptSendTask.java
+112
-0
complex-window-manager/src/main/java/com/mortals/xhx/thread/SendThread.java
...ager/src/main/java/com/mortals/xhx/thread/SendThread.java
+11
-7
No files found.
complex-window-manager/src/main/java/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
View file @
856b1824
...
@@ -30,8 +30,8 @@ import java.util.Map;
...
@@ -30,8 +30,8 @@ import java.util.Map;
* @author: zxfei
* @author: zxfei
* @date: 2022/4/20 9:24
* @date: 2022/4/20 9:24
*/
*/
@Aspect
//
@Aspect
@Component
//
@Component
@Slf4j
@Slf4j
@Order
(
1
)
@Order
(
1
)
@Profile
({
"default"
,
"develop"
,
"test"
})
@Profile
({
"default"
,
"develop"
,
"test"
})
...
...
complex-window-manager/src/main/java/com/mortals/xhx/busiz/req/accept/ComplexMaterialsItem.java
View file @
856b1824
package
com.mortals.xhx.busiz.req.accept
;
package
com.mortals.xhx.busiz.req.accept
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
...
@@ -11,5 +12,6 @@ public class ComplexMaterialsItem {
...
@@ -11,5 +12,6 @@ public class ComplexMaterialsItem {
/**
/**
* 材料内容,base64编码附件
* 材料内容,base64编码附件
*/
*/
@JSONField
(
serialize
=
false
)
private
String
materialContent
;
private
String
materialContent
;
}
}
\ No newline at end of file
complex-window-manager/src/main/java/com/mortals/xhx/busiz/web/ComplexApiController.java
View file @
856b1824
package
com.mortals.xhx.busiz.web
;
package
com.mortals.xhx.busiz.web
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
...
@@ -25,12 +26,14 @@ import com.mortals.xhx.protocol.complex.ComplexApiRest;
...
@@ -25,12 +26,14 @@ import com.mortals.xhx.protocol.complex.ComplexApiRest;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.DictInfo
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.DictInfo
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.math3.Field
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
HTTP_TIMEOUT
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
HTTP_TIMEOUT
;
...
@@ -293,7 +296,7 @@ public class ComplexApiController {
...
@@ -293,7 +296,7 @@ public class ComplexApiController {
try
{
try
{
req
.
setNonce
(
RandomUtil
.
randomNumbers
(
6
));
req
.
setNonce
(
RandomUtil
.
randomNumbers
(
6
));
cacheService
.
lpush
(
KEY_COMPLEX_REQ
,
JSONObject
.
toJSONString
(
req
));
cacheService
.
lpush
(
KEY_COMPLEX_REQ
,
JSONObject
.
toJSONString
(
req
));
String
rest
=
cacheService
.
blpop
(
KEY_EVENT_IMPLEMENTATION_RESP
+
req
.
getNonce
(),
HTTP_TIMEOUT
,
String
.
class
);
String
rest
=
cacheService
.
blpop
(
KEY_EVENT_IMPLEMENTATION_RESP
+
req
.
getNonce
(),
60
,
String
.
class
);
if
(
ObjectUtil
.
isEmpty
(
rest
))
{
if
(
ObjectUtil
.
isEmpty
(
rest
))
{
throw
new
AppException
(
"请求访问超时"
);
throw
new
AppException
(
"请求访问超时"
);
}
}
...
@@ -308,4 +311,14 @@ public class ComplexApiController {
...
@@ -308,4 +311,14 @@ public class ComplexApiController {
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
"E:\\pic\\1.png"
);
String
encode
=
Base64
.
encode
(
file
);
System
.
out
.
println
(
encode
);
}
}
}
complex-window-manager/src/main/java/com/mortals/xhx/thread/ImplementAcceptSendTask.java
0 → 100644
View file @
856b1824
package
com.mortals.xhx.thread
;
import
cn.hutool.core.codec.Base64
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.xhx.busiz.req.accept.ComplexAcceptReq
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.protocol.complex.matter.model.req.*
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.AcceptRspInfo
;
import
com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService
;
import
com.mortals.xhx.utils.SpringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
REDIS_RESP_TIMEOUT
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_EVENT_IMPLEMENTATION_RESP
;
/**
* 自助接件服务
*
* @author: zxfei
* @date: 2023/12/3 14:04
*/
@Slf4j
public
class
ImplementAcceptSendTask
implements
Runnable
{
private
ComplexAcceptReq
complexAcceptReq
;
private
String
deviceLogo
;
private
IComplexMatterService
complexMatterService
;
private
ICacheService
cacheService
;
public
ImplementAcceptSendTask
(
String
deviceLogo
,
ComplexAcceptReq
complexAcceptReq
)
{
this
.
complexAcceptReq
=
complexAcceptReq
;
this
.
deviceLogo
=
deviceLogo
;
complexMatterService
=
SpringUtils
.
getBean
(
IComplexMatterService
.
class
);
cacheService
=
SpringUtils
.
getBean
(
ICacheService
.
class
);
}
@Override
public
void
run
()
{
try
{
log
.
info
(
"自助接件服务"
);
//遍历 上传附件
List
<
MaterialsItem
>
materialsItemList
=
complexAcceptReq
.
getMaterials
().
stream
().
map
(
item
->
{
MaterialsItem
materialsItem
=
new
MaterialsItem
();
//base64
String
materialContent
=
item
.
getMaterialContent
();
if
(!
ObjectUtils
.
isEmpty
(
materialContent
))
{
byte
[]
bytes
=
Base64
.
decode
(
materialContent
);
Rest
<
String
>
uploadFileRest
=
complexMatterService
.
uploadFile
(
deviceLogo
,
bytes
,
item
.
getUploadFileName
());
if
(
uploadFileRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
item
.
setMaterialPath
(
uploadFileRest
.
getData
());
item
.
setMaterialContent
(
""
);
}
}
BeanUtils
.
copyProperties
(
item
,
materialsItem
,
BeanUtil
.
getNullPropertyNames
(
item
));
return
materialsItem
;
}).
collect
(
Collectors
.
toList
());
AcceptReq
acceptReq
=
new
AcceptReq
();
BeanUtils
.
copyProperties
(
complexAcceptReq
,
acceptReq
,
BeanUtil
.
getNullPropertyNames
(
complexAcceptReq
));
acceptReq
.
setMaterials
(
materialsItemList
);
if
(!
ObjectUtils
.
isEmpty
(
complexAcceptReq
.
getHandlings
()))
{
List
<
HandlingsItem
>
handlingsItemList
=
complexAcceptReq
.
getHandlings
().
stream
().
map
(
item
->
{
HandlingsItem
handlingsItem
=
new
HandlingsItem
();
BeanUtils
.
copyProperties
(
item
,
handlingsItem
);
return
handlingsItem
;
}).
collect
(
Collectors
.
toList
());
acceptReq
.
setHandlings
(
handlingsItemList
);
}
if
(!
ObjectUtils
.
isEmpty
(
complexAcceptReq
.
getApplicantLegal
()))
{
ApplicantLeagal
applicantLeagal
=
new
ApplicantLeagal
();
BeanUtils
.
copyProperties
(
complexAcceptReq
.
getApplicantLegal
(),
applicantLeagal
);
acceptReq
.
setApplicantLegal
(
applicantLeagal
);
}
if
(!
ObjectUtils
.
isEmpty
(
complexAcceptReq
.
getApplicantPersonal
()))
{
ApplicantPersonal
applicantPersonal
=
new
ApplicantPersonal
();
BeanUtils
.
copyProperties
(
complexAcceptReq
.
getApplicantPersonal
(),
applicantPersonal
);
acceptReq
.
setApplicantPersonal
(
applicantPersonal
);
}
Rest
<
List
<
AcceptRspInfo
>>
rest
=
complexMatterService
.
accept
(
deviceLogo
,
acceptReq
);
cacheService
.
lpushForTime
(
KEY_EVENT_IMPLEMENTATION_RESP
+
complexAcceptReq
.
getNonce
(),
REDIS_RESP_TIMEOUT
,
JSONObject
.
toJSONString
(
rest
));
/*
Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEvent(deviceLogo, implementationReq.getEventId());
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
*/
}
catch
(
Exception
e
)
{
log
.
error
(
"发送异常:"
+
e
);
}
}
}
\ No newline at end of file
complex-window-manager/src/main/java/com/mortals/xhx/thread/SendThread.java
View file @
856b1824
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.xhx.busiz.req.accept.ComplexAcceptReq
;
import
com.mortals.xhx.common.utils.AbstractThread
;
import
com.mortals.xhx.common.utils.AbstractThread
;
import
com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq
;
import
com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo
;
import
com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo
;
...
@@ -55,30 +56,34 @@ public class SendThread extends AbstractThread {
...
@@ -55,30 +56,34 @@ public class SendThread extends AbstractThread {
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementListSendTask
implementListSendTask
=
new
ImplementListSendTask
(
deviceCode
,
implementationReq
);
ImplementListSendTask
implementListSendTask
=
new
ImplementListSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementListSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementListSendTask
);
}
else
if
(
"event-implementation/get-by-id"
.
equals
(
urlPath
))
{
}
else
if
(
"event-implementation/get-by-id"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementDetailSendTask
implementSendTask
=
new
ImplementDetailSendTask
(
deviceCode
,
implementationReq
);
ImplementDetailSendTask
implementSendTask
=
new
ImplementDetailSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"bus-situation-material/getSituationMaterialTreeByEventIds"
.
equals
(
urlPath
))
{
}
else
if
(
"bus-situation-material/getSituationMaterialTreeByEventIds"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementSituationSendTask
implementSendTask
=
new
ImplementSituationSendTask
(
deviceCode
,
implementationReq
);
ImplementSituationSendTask
implementSendTask
=
new
ImplementSituationSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"consulting-service/getMaterialByEventAndSituation"
.
equals
(
urlPath
))
{
}
else
if
(
"consulting-service/getMaterialByEventAndSituation"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
EventAndSituationSendTask
implementSendTask
=
new
EventAndSituationSendTask
(
deviceCode
,
implementationReq
);
EventAndSituationSendTask
implementSendTask
=
new
EventAndSituationSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"material/findList"
.
equals
(
urlPath
))
{
}
else
if
(
"material/findList"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementMaterialSendTask
implementSendTask
=
new
ImplementMaterialSendTask
(
deviceCode
,
implementationReq
);
ImplementMaterialSendTask
implementSendTask
=
new
ImplementMaterialSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"event-implementation/getDynamicFormByEventIds"
.
equals
(
urlPath
))
{
}
else
if
(
"event-implementation/getDynamicFormByEventIds"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementDynamicFormSendTask
implementSendTask
=
new
ImplementDynamicFormSendTask
(
deviceCode
,
implementationReq
);
ImplementDynamicFormSendTask
implementSendTask
=
new
ImplementDynamicFormSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"common/queryDict"
.
equals
(
urlPath
))
{
}
else
if
(
"common/queryDict"
.
equals
(
urlPath
))
{
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
ImplementationReq
implementationReq
=
JSONObject
.
parseObject
(
reqStr
,
ImplementationReq
.
class
);
DictSendTask
implementSendTask
=
new
DictSendTask
(
deviceCode
,
implementationReq
);
DictSendTask
implementSendTask
=
new
DictSendTask
(
deviceCode
,
implementationReq
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
ThreadPool
.
getInstance
().
execute
(
implementSendTask
);
}
else
if
(
"self-device-info/acceptHandling"
.
equals
(
urlPath
))
{
ComplexAcceptReq
complexAcceptReq
=
JSONObject
.
parseObject
(
reqStr
,
ComplexAcceptReq
.
class
);
ImplementAcceptSendTask
acceptSendTask
=
new
ImplementAcceptSendTask
(
deviceCode
,
complexAcceptReq
);
ThreadPool
.
getInstance
().
execute
(
acceptSendTask
);
}
}
...
@@ -93,5 +98,4 @@ public class SendThread extends AbstractThread {
...
@@ -93,5 +98,4 @@ public class SendThread extends AbstractThread {
}
}
}
}
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