Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
data-center
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
廖鑫
data-center
Commits
ee0df0de
Commit
ee0df0de
authored
Nov 30, 2021
by
shenxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码合并
parent
f5a9fad4
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1838 additions
and
944 deletions
+1838
-944
dataCenter-manager/src/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
...c/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
+3
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/task/RybApplyAndAcceptInformationTaskImpl.java
...nformation/task/RybApplyAndAcceptInformationTaskImpl.java
+179
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/task/RybSubmitLinkDataInformationTaskImpl.java
...nformation/task/RybSubmitLinkDataInformationTaskImpl.java
+110
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/listener/InformationDataConversionListener.java
...upplement/listener/InformationDataConversionListener.java
+1
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/model/SupplementEntity.java
...ortals/xhx/modules/supplement/model/SupplementEntity.java
+22
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/model/SupplementQuery.java
...mortals/xhx/modules/supplement/model/SupplementQuery.java
+693
-210
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/task/SupplementTaskImpl.java
...rtals/xhx/modules/supplement/task/SupplementTaskImpl.java
+84
-7
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/web/SupplementController.java
...tals/xhx/modules/supplement/web/SupplementController.java
+3
-3
dataCenter-manager/src/main/resources/bootstrap.yml
dataCenter-manager/src/main/resources/bootstrap.yml
+6
-1
dataCenter-manager/src/main/resources/sqlmap/module/supplement/supplement.xml
...rc/main/resources/sqlmap/module/supplement/supplement.xml
+736
-722
pom.xml
pom.xml
+1
-1
No files found.
dataCenter-manager/src/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
View file @
ee0df0de
...
@@ -8,6 +8,9 @@ package com.mortals.xhx.common.code;
...
@@ -8,6 +8,9 @@ package com.mortals.xhx.common.code;
*/
*/
public
enum
NodeTypeEnum
{
public
enum
NodeTypeEnum
{
蓉易办受理
(
"BusiType_21"
,
"21"
,
"蓉易办受理"
),
蓉易办环节
(
"BusiType_22"
,
"22"
,
"蓉易办环节"
),
已提交
(
"BusiType_23"
,
"23"
,
"已提交"
),
受理
(
"BusiType_1"
,
"11"
,
"受理"
),
受理
(
"BusiType_1"
,
"11"
,
"受理"
),
审查
(
"BusiType_13"
,
"21"
,
"审查"
),
审查
(
"BusiType_13"
,
"21"
,
"审查"
),
决定
(
"BusiType_8"
,
"91"
,
"决定"
),
决定
(
"BusiType_8"
,
"91"
,
"决定"
),
...
...
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/task/RybApplyAndAcceptInformationTaskImpl.java
0 → 100644
View file @
ee0df0de
package
com.mortals.xhx.modules.information.task
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.excel.util.CollectionUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.common.code.NodeTypeEnum
;
import
com.mortals.xhx.common.utils.DateByAffairUtils
;
import
com.mortals.xhx.modules.implementlist.dao.RybMatterDao
;
import
com.mortals.xhx.modules.implementlist.dao.RybWorkDao
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
import
com.mortals.xhx.modules.implementlist.model.RybWorkEntry
;
import
com.mortals.xhx.modules.information.model.InformationEntity
;
import
com.mortals.xhx.modules.information.service.InformationService
;
import
com.mortals.xhx.modules.service.QueryInformationServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
/**
* @author shenxin
* @Date: 2021/11/17-16:28
* @Description:办件数据推送蓉易办(申请并受理)
*/
@Slf4j
@Component
(
"rybApplyAndAcceptInformationTaskImpl"
)
public
class
RybApplyAndAcceptInformationTaskImpl
implements
ITaskExcuteService
{
@Value
(
"${upload.AppKey}"
)
String
AppKey
;
@Autowired
private
InformationService
informationService
;
@Autowired
private
QueryInformationServiceImpl
queryInformationService
;
@Resource
private
RybWorkDao
rybWorkDao
;
@Resource
private
RybMatterDao
rybMatterDao
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
//1.查询上月的表是否存在未推送的数据
List
<
InformationEntity
>
informationEntities
=
queryInformationService
.
queryDataThatHasNotBeenPushed
(
NodeTypeEnum
.
蓉易办受理
.
getCode
(),
"1"
,
"0"
,
task
.
getExcuteParam
());
//组装申请并受理数据推送一体化平台
this
.
applyAndAccept
(
informationEntities
);
}
private
void
applyAndAccept
(
List
<
InformationEntity
>
informationEntities
)
{
log
.
info
(
"开始推送申请并受理理数据"
);
if
(
CollectionUtils
.
isEmpty
(
informationEntities
)){
log
.
info
(
"没有需要推送申请并受理理数据"
);
return
;
}
List
<
InformationEntity
>
entities
=
informationEntities
.
parallelStream
().
map
(
e
->
{
//组装参数
HashMap
<
String
,
Object
>
stringObjectHashMap
=
assemblyParameters
(
e
);
if
(
stringObjectHashMap
==
null
){
log
.
info
(
"推送失败,没有该办件所对应的事项部门编码!"
);
e
.
setFailReason
(
"推送失败,没有该办件所对应的事项部门编码!"
);
e
.
setIsReport
(
"1"
);
e
.
setIsSuccess
(
"0"
);
return
e
;
}
Map
<
String
,
String
>
map
=
(
Map
<
String
,
String
>)
stringObjectHashMap
.
get
(
"params"
);
e
.
setAcceptName
(
map
.
get
(
"receiveusername"
));
e
.
setAcceptId
(
map
.
get
(
"receiveuseridcard"
));
e
.
setAcceptPhone
(
map
.
get
(
"receiveuserphone"
));
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"jsonData"
,
JSONObject
.
toJSONString
(
stringObjectHashMap
));
HttpRequest
key
=
HttpUtil
.
createPost
(
"https://10.1.235.51:4433/gateway/api/1/wllz/bjsqtjbsl/zs"
)
//蓉易办
// HttpRequest key = HttpUtil.createPost("http://192.168.0.222:17011/m/supplement/test")//本地测试
.
header
(
"AppKey"
,
AppKey
)
.
header
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
).
form
(
params
);
HttpResponse
appKey
=
key
.
execute
().
charset
(
"utf-8"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
appKey
.
body
());
log
.
info
(
"响应:"
+
jsonObject
);
JSONObject
data
=
JSONObject
.
parseObject
(
jsonObject
.
getString
(
"data"
));
if
(
"200"
.
equals
(
jsonObject
.
getString
(
"code"
))
&&
"1"
.
equals
(
data
.
getJSONObject
(
"custom"
).
getString
(
"code"
)))
{
log
.
info
(
"推送成功"
);
e
.
setIsReport
(
"1"
);
e
.
setIsSuccess
(
"1"
);
e
.
setBizStatus
(
NodeTypeEnum
.
蓉易办环节
.
getDesc
());
e
.
setNodeType
(
NodeTypeEnum
.
蓉易办环节
.
getCode
());
//默认区间3~20分钟
e
.
setCreateTime
(
DateByAffairUtils
.
getTimeByAddRandomDouble
(
DateTime
.
now
(),
null
,
null
));
e
.
setOfficeCode
(
data
.
getJSONObject
(
"custom"
).
getJSONObject
(
"content"
).
getString
(
"flowsn"
));
}
else
{
log
.
info
(
"推送失败:"
+
jsonObject
);
e
.
setFailReason
(
jsonObject
.
toString
());
e
.
setIsReport
(
"1"
);
e
.
setIsSuccess
(
"0"
);
}
e
.
setProcessStatusName
(
NodeTypeEnum
.
蓉易办受理
.
getValue
());
return
e
;
}).
collect
(
Collectors
.
toList
());
log
.
info
(
"申请受理推送完成"
);
informationService
.
update
(
entities
,
null
);
}
private
HashMap
<
String
,
Object
>
assemblyParameters
(
InformationEntity
e
)
{
HashMap
<
String
,
Object
>
dataMap
=
new
HashMap
<>(
16
);
dataMap
.
put
(
"token"
,
"Epoint_WebSerivce_**##0601"
);
HashMap
<
String
,
Object
>
baseInfoMap
=
new
HashMap
<>(
16
);
baseInfoMap
.
put
(
"projectname"
,
e
.
getEventName
());
baseInfoMap
.
put
(
"applyway"
,
"20"
);
if
(
e
.
getApplicantAttributes
()
==
2
)
{
baseInfoMap
.
put
(
"applyertype"
,
"20"
);
}
else
{
baseInfoMap
.
put
(
"applyertype"
,
"10"
);
baseInfoMap
.
put
(
"legal"
,
e
.
getLegalPerson
());
baseInfoMap
.
put
(
"legalpersoncardtype"
,
""
);
baseInfoMap
.
put
(
"legalpersonidcard"
,
""
);
}
baseInfoMap
.
put
(
"applyername"
,
e
.
getApplicantName
());
baseInfoMap
.
put
(
"applyersex"
,
e
.
getApplicantSex
());
baseInfoMap
.
put
(
"certtype"
,
"22"
);
baseInfoMap
.
put
(
"certnum"
,
e
.
getApplicantCardNumbe
());
baseInfoMap
.
put
(
"address"
,
"地址暂无"
);
baseInfoMap
.
put
(
"contactmobile"
,
e
.
getContactPhone
());
baseInfoMap
.
put
(
"contactperson"
,
e
.
getContactName
());
List
<
RybWorkEntry
>
workEntries
=
rybWorkDao
.
find
(
e
.
getDeptCode
());
if
(
CollectionUtils
.
isEmpty
(
workEntries
)){
return
null
;
}
baseInfoMap
.
putAll
(
randomlyExtractPersonnelInformation
(
workEntries
));
baseInfoMap
.
put
(
"receivedate"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
e
.
getCreateTime
()));
RybMatterListEntry
entry
=
rybMatterDao
.
find
(
e
.
getEventCode
()).
get
(
0
);
if
(
null
!=
entry
)
{
baseInfoMap
.
put
(
"tasktype"
,
entry
.
getMatterType
());
baseInfoMap
.
put
(
"task_id"
,
entry
.
getTaskId
());
}
else
{
baseInfoMap
.
put
(
"tasktype"
,
"1A"
);
baseInfoMap
.
put
(
"task_id"
,
"123"
);
}
baseInfoMap
.
put
(
"eventcode"
,
entry
.
getMatterCode
());
baseInfoMap
.
put
(
"areacode"
,
e
.
getAreaCode
());
baseInfoMap
.
put
(
"source"
,
"MTEwNDEyOTc0MDAw"
);
baseInfoMap
.
put
(
"contactcertnum"
,
e
.
getContactIdCard
());
baseInfoMap
.
put
(
"contactidcard"
,
e
.
getContactIdCard
());
dataMap
.
put
(
"params"
,
baseInfoMap
);
return
dataMap
;
}
private
HashMap
<
String
,
String
>
randomlyExtractPersonnelInformation
(
List
<
RybWorkEntry
>
workEntries
)
{
HashMap
<
String
,
String
>
dataMap
=
new
HashMap
<>(
16
);
Random
random
=
new
Random
();
int
i
=
random
.
nextInt
(
workEntries
.
size
());
dataMap
.
put
(
"receiveusername"
,
workEntries
.
get
(
i
).
getReceiveUserName
());
dataMap
.
put
(
"receiveuseridcard"
,
workEntries
.
get
(
i
).
getReceiveUserIdcard
());
dataMap
.
put
(
"receiveuserphone"
,
workEntries
.
get
(
i
).
getReceiveUserPhone
());
return
dataMap
;
}
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/task/RybSubmitLinkDataInformationTaskImpl.java
0 → 100644
View file @
ee0df0de
package
com.mortals.xhx.modules.information.task
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.excel.util.CollectionUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.common.code.NodeTypeEnum
;
import
com.mortals.xhx.modules.information.model.InformationEntity
;
import
com.mortals.xhx.modules.information.service.InformationService
;
import
com.mortals.xhx.modules.service.QueryInformationServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author shenxin
* @Date: 2021/11/17-16:28
* @Description:办件数据推送蓉易办(办件环节)
*/
@Slf4j
@Component
(
"rybSubmitLinkDataInformationTaskImpl"
)
public
class
RybSubmitLinkDataInformationTaskImpl
implements
ITaskExcuteService
{
@Value
(
"${upload.AppKey}"
)
String
AppKey
;
@Autowired
private
InformationService
informationService
;
@Autowired
private
QueryInformationServiceImpl
queryInformationService
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
//1.查询上月的表是否存在未推送的数据
List
<
InformationEntity
>
informationEntities
=
queryInformationService
.
queryDataThatHasNotBeenPushed
(
NodeTypeEnum
.
蓉易办环节
.
getCode
(),
"1"
,
"1"
,
task
.
getExcuteParam
());
//办件环节数据推送蓉易办
this
.
submitLinkData
(
informationEntities
);
}
private
void
submitLinkData
(
List
<
InformationEntity
>
informationEntities
)
{
log
.
info
(
"开始推送申请并受理理数据"
);
if
(
CollectionUtils
.
isEmpty
(
informationEntities
)){
log
.
info
(
"没有需要推送办件环节数据"
);
return
;
}
List
<
InformationEntity
>
collect
=
informationEntities
.
parallelStream
().
map
(
e
->
{
//组装参数
HashMap
<
String
,
Object
>
stringObjectHashMap
=
assemblyParametersLink
(
e
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"jsonData"
,
JSONObject
.
toJSONString
(
stringObjectHashMap
));
String
appKey
=
HttpUtil
.
createPost
(
"https://10.1.235.51:4433/gateway/api/1/wllz/bjhjgcsjts/zs"
).
form
(
params
)
//蓉易办
// .createPost("http://192.168.0.222:17011/m/supplement/test").form(params)//测试
.
header
(
"AppKey"
,
AppKey
)
.
header
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
)
.
execute
()
.
charset
(
"utf-8"
)
.
body
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
appKey
);
e
.
setBizStatus
(
NodeTypeEnum
.
已提交
.
getDesc
());
e
.
setNodeType
(
NodeTypeEnum
.
已提交
.
getCode
());
if
(
"200"
.
equals
(
jsonObject
.
getString
(
"code"
)))
{
log
.
info
(
"提交成功:"
+
jsonObject
);
}
else
{
log
.
info
(
"提交失败:"
+
jsonObject
);
}
e
.
setProcessStatusName
(
NodeTypeEnum
.
蓉易办环节
.
getValue
());
return
e
;
}).
collect
(
Collectors
.
toList
());
log
.
info
(
"办件环节推送完成"
);
informationService
.
update
(
collect
,
null
);
}
private
HashMap
<
String
,
Object
>
assemblyParametersLink
(
InformationEntity
e
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
HashMap
<
String
,
Object
>
dataMap
=
new
HashMap
<>(
16
);
dataMap
.
put
(
"token"
,
"Epoint_WebSerivce_**##0601"
);
HashMap
<
String
,
Object
>
baseInfoMap
=
new
HashMap
<>(
16
);
baseInfoMap
.
put
(
"flowsn"
,
e
.
getOfficeCode
());
baseInfoMap
.
put
(
"operatetype"
,
"80"
);
baseInfoMap
.
put
(
"startdate"
,
format
.
format
(
e
.
getGenTime
()));
baseInfoMap
.
put
(
"enddate"
,
format
.
format
(
e
.
getCompleteTime
()));
baseInfoMap
.
put
(
"operateusername"
,
e
.
getAcceptName
());
baseInfoMap
.
put
(
"operateuserphone"
,
e
.
getAcceptPhone
());
baseInfoMap
.
put
(
"operateuseridcard"
,
e
.
getAcceptId
());
baseInfoMap
.
put
(
"areacode"
,
e
.
getAreaCode
());
baseInfoMap
.
put
(
"handleTime"
,
format
.
format
(
e
.
getCreateTime
()));
baseInfoMap
.
put
(
"nodeStatus"
,
"1"
);
dataMap
.
put
(
"params"
,
baseInfoMap
);
return
dataMap
;
}
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/listener/InformationDataConversionListener.java
View file @
ee0df0de
...
@@ -86,6 +86,7 @@ public class InformationDataConversionListener extends AnalysisEventListener<Sup
...
@@ -86,6 +86,7 @@ public class InformationDataConversionListener extends AnalysisEventListener<Sup
supplementEntity
.
setIsSuccess
(
"0"
);
supplementEntity
.
setIsSuccess
(
"0"
);
supplementEntity
.
setCreateDate
(
DateTime
.
now
());
supplementEntity
.
setCreateDate
(
DateTime
.
now
());
supplementEntity
.
setUpdateDate
(
supplementEntity
.
getCreateDate
());
supplementEntity
.
setUpdateDate
(
supplementEntity
.
getCreateDate
());
supplementEntity
.
setPushType
(
TYPE
);
entityList
.
add
(
supplementEntity
);
entityList
.
add
(
supplementEntity
);
eventCodeList
.
add
(
supplementEntity
.
getImplCode
());
eventCodeList
.
add
(
supplementEntity
.
getImplCode
());
if
(
PushTypeEnum
.
SYTH
.
getStyle
().
equals
(
TYPE
)){
if
(
PushTypeEnum
.
SYTH
.
getStyle
().
equals
(
TYPE
)){
...
...
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/model/SupplementEntity.java
View file @
ee0df0de
...
@@ -145,6 +145,12 @@ public class SupplementEntity extends BaseEntityLong{
...
@@ -145,6 +145,12 @@ public class SupplementEntity extends BaseEntityLong{
@ExcelIgnore
@ExcelIgnore
private
String
failReason
;
private
String
failReason
;
/**
* 推送类型
*/
@ExcelIgnore
private
String
pushType
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -454,6 +460,20 @@ public class SupplementEntity extends BaseEntityLong{
...
@@ -454,6 +460,20 @@ public class SupplementEntity extends BaseEntityLong{
public
void
setFailReason
(
String
failReason
)
{
public
void
setFailReason
(
String
failReason
)
{
this
.
failReason
=
failReason
;
this
.
failReason
=
failReason
;
}
}
/**
* 获取 推送类型
* @return String
*/
public
String
getPushType
(){
return
pushType
;
}
/**
* 设置 推送类型
* @param pushType
*/
public
void
setPushType
(
String
pushType
){
this
.
pushType
=
pushType
;
}
/**
/**
* 获取 创建时间
* 获取 创建时间
* @return createDate
* @return createDate
...
@@ -525,6 +545,7 @@ public class SupplementEntity extends BaseEntityLong{
...
@@ -525,6 +545,7 @@ public class SupplementEntity extends BaseEntityLong{
.
append
(
",isExecute:"
).
append
(
getIsExecute
())
.
append
(
",isExecute:"
).
append
(
getIsExecute
())
.
append
(
",isSuccess:"
).
append
(
getIsSuccess
())
.
append
(
",isSuccess:"
).
append
(
getIsSuccess
())
.
append
(
",failReason:"
).
append
(
getFailReason
())
.
append
(
",failReason:"
).
append
(
getFailReason
())
.
append
(
",pushType:"
).
append
(
getPushType
())
.
append
(
",createDate:"
).
append
(
getCreateDate
())
.
append
(
",createDate:"
).
append
(
getCreateDate
())
.
append
(
",updateDate:"
).
append
(
getUpdateDate
())
.
append
(
",updateDate:"
).
append
(
getUpdateDate
())
;
;
...
@@ -553,6 +574,7 @@ public class SupplementEntity extends BaseEntityLong{
...
@@ -553,6 +574,7 @@ public class SupplementEntity extends BaseEntityLong{
this
.
isExecute
=
null
;
this
.
isExecute
=
null
;
this
.
isSuccess
=
null
;
this
.
isSuccess
=
null
;
this
.
failReason
=
null
;
this
.
failReason
=
null
;
this
.
pushType
=
null
;
this
.
createDate
=
null
;
this
.
createDate
=
null
;
this
.
updateDate
=
null
;
this
.
updateDate
=
null
;
}
}
...
...
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/model/SupplementQuery.java
View file @
ee0df0de
This diff is collapsed.
Click to expand it.
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/task/SupplementTaskImpl.java
View file @
ee0df0de
package
com.mortals.xhx.modules.supplement.task
;
package
com.mortals.xhx.modules.supplement.task
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
com.alibaba.excel.util.CollectionUtils
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITask
;
...
@@ -8,11 +9,14 @@ import com.mortals.framework.service.ITaskExcuteService;
...
@@ -8,11 +9,14 @@ import com.mortals.framework.service.ITaskExcuteService;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.xhx.common.code.ApplicantTypeEnums
;
import
com.mortals.xhx.common.code.ApplicantTypeEnums
;
import
com.mortals.xhx.common.code.NodeTypeEnum
;
import
com.mortals.xhx.common.code.NodeTypeEnum
;
import
com.mortals.xhx.common.code.PushTypeEnum
;
import
com.mortals.xhx.common.utils.DateByAffairUtils
;
import
com.mortals.xhx.common.utils.DateByAffairUtils
;
import
com.mortals.xhx.common.utils.FilterSuppDataUtils
;
import
com.mortals.xhx.common.utils.FilterSuppDataUtils
;
import
com.mortals.xhx.common.utils.SnowFlakeUtil
;
import
com.mortals.xhx.common.utils.SnowFlakeUtil
;
import
com.mortals.xhx.modules.implementlist.model.ImplementlistEntity
;
import
com.mortals.xhx.modules.implementlist.model.ImplementlistEntity
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
import
com.mortals.xhx.modules.implementlist.service.ImplementlistService
;
import
com.mortals.xhx.modules.implementlist.service.ImplementlistService
;
import
com.mortals.xhx.modules.implementlist.service.RybMatterListService
;
import
com.mortals.xhx.modules.information.dao.InformationDao
;
import
com.mortals.xhx.modules.information.dao.InformationDao
;
import
com.mortals.xhx.modules.information.model.InformationEntity
;
import
com.mortals.xhx.modules.information.model.InformationEntity
;
import
com.mortals.xhx.modules.supplement.model.SupplementEntity
;
import
com.mortals.xhx.modules.supplement.model.SupplementEntity
;
...
@@ -20,8 +24,10 @@ import com.mortals.xhx.modules.supplement.model.SupplementQuery;
...
@@ -20,8 +24,10 @@ import com.mortals.xhx.modules.supplement.model.SupplementQuery;
import
com.mortals.xhx.modules.supplement.service.SupplementService
;
import
com.mortals.xhx.modules.supplement.service.SupplementService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -37,21 +43,31 @@ import java.util.stream.Collectors;
...
@@ -37,21 +43,31 @@ import java.util.stream.Collectors;
@Component
(
"supplementTaskImpl"
)
@Component
(
"supplementTaskImpl"
)
public
class
SupplementTaskImpl
implements
ITaskExcuteService
{
public
class
SupplementTaskImpl
implements
ITaskExcuteService
{
@Value
(
"${upload.area}"
)
String
area
;
@Autowired
@Autowired
private
SupplementService
supplementService
;
private
SupplementService
supplementService
;
@Autowired
@Autowired
private
ImplementlistService
implementlistService
;
private
ImplementlistService
implementlistService
;
@Resource
private
RybMatterListService
rybMatterListService
;
@Autowired
@Autowired
private
InformationDao
informationDao
;
private
InformationDao
informationDao
;
@Override
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
//1.查询上月的表是否存在未清洗的数据
//1.查询上月的表是否存在未清洗的数据
//蓉易办
List
<
SupplementEntity
>
supplementEntities
=
queryDataThatHasNotBeenPushed
(
task
.
getExcuteParam
()
);
List
<
SupplementEntity
>
ryb
=
queryDataThatHasNotBeenPushed
(
task
.
getExcuteParam
(),
1
);
//开始进行数据清洗
//开始进行数据清洗
this
.
dataCleaning
(
supplementEntities
);
this
.
ryb
(
ryb
);
//1.查询上月的表是否存在未清洗的数据 //省一体化
List
<
SupplementEntity
>
syth
=
queryDataThatHasNotBeenPushed
(
task
.
getExcuteParam
(),
2
);
//开始进行数据清洗
this
.
dataCleaning
(
syth
);
}
}
...
@@ -60,6 +76,62 @@ public class SupplementTaskImpl implements ITaskExcuteService {
...
@@ -60,6 +76,62 @@ public class SupplementTaskImpl implements ITaskExcuteService {
}
}
private
void
ryb
(
List
<
SupplementEntity
>
supplementEntities
)
{
log
.
info
(
"开始清洗"
);
if
(
CollectionUtils
.
isEmpty
(
supplementEntities
)){
log
.
info
(
"没有需要清洗数据"
);
return
;
}
List
<
InformationEntity
>
informationQueries
=
new
ArrayList
<>();
if
(!
supplementEntities
.
isEmpty
())
{
List
<
SupplementEntity
>
collect
=
supplementEntities
.
parallelStream
().
map
(
e
->
{
//TODO:查询实施清单信息,通过事项编码查询有问题(但因数据库存储的事项数据是条件过滤后的,故暂时不改动查询),后期改动
RybMatterListEntry
thImplement
=
rybMatterListService
.
getThImplement
(
e
.
getImplCode
());
try
{
InformationEntity
informationQuery
=
new
InformationEntity
();
//组装第一次业务数据(清洗后的)
informationQuery
=
assemblyOfficeData
(
informationQuery
,
e
);
if
(
null
!=
thImplement
)
{
informationQuery
.
setDeptCode
(
thImplement
.
getDeptCode
());
informationQuery
.
setEventCode
(
thImplement
.
getMatterCode
());
informationQuery
.
setEventName
(
thImplement
.
getMatterName
());
informationQuery
.
setAreaCode
(
area
);
//是否转化成功:0默认 1成功
informationQuery
.
setIsSuccess
(
"1"
);
//是否推送(0 否 1是)
informationQuery
.
setIsReport
(
"0"
);
//设置 失败次数 默认为0
informationQuery
.
setFailTimes
(
0
);
// 是否执行转化(0.未执行 1.已执行)
e
.
setIsExecute
(
"1"
);
//是否转化成功(0默认 1成功)
e
.
setIsSuccess
(
"1"
);
}
else
{
e
.
setFailReason
(
" Err:实施清单不存在"
);
informationQuery
.
setFailReason
(
" Err:实施清单不存在"
);
informationQuery
.
setIsSuccess
(
"0"
);
// 是否执行转化(0.未执行 1.已执行)
e
.
setIsExecute
(
"1"
);
//是否转化成功(0默认 1成功)
e
.
setIsSuccess
(
"0"
);
}
e
.
setUpdateDate
(
DateTime
.
now
());
informationQueries
.
add
(
informationQuery
);
return
e
;
}
catch
(
Exception
ex
)
{
e
.
setIsExecute
(
"1"
);
e
.
setFailReason
(
"转换失败"
);
log
.
error
(
"转换失败:SupplementID:"
+
e
.
getId
());
log
.
error
(
"转换失败:失败原因"
+
ex
.
getMessage
());
return
e
;
}
}).
collect
(
Collectors
.
toList
());
supplementService
.
update
(
collect
,
null
);
informationDao
.
insertBatch
(
informationQueries
);
log
.
info
(
"清洗完成,本次清洗数量:"
+
informationQueries
.
size
());
}
}
private
void
dataCleaning
(
List
<
SupplementEntity
>
supplementEntities
)
{
private
void
dataCleaning
(
List
<
SupplementEntity
>
supplementEntities
)
{
if
(!
supplementEntities
.
isEmpty
())
{
if
(!
supplementEntities
.
isEmpty
())
{
List
<
InformationEntity
>
informationQueries
=
new
ArrayList
<>();
List
<
InformationEntity
>
informationQueries
=
new
ArrayList
<>();
...
@@ -165,9 +237,13 @@ public class SupplementTaskImpl implements ITaskExcuteService {
...
@@ -165,9 +237,13 @@ public class SupplementTaskImpl implements ITaskExcuteService {
informationQuery
.
setSystemCode
(
supplementEntity
.
getSysCode
());
informationQuery
.
setSystemCode
(
supplementEntity
.
getSysCode
());
//测试暂时写死
if
(
PushTypeEnum
.
SYTH
.
getStyle
().
equals
(
supplementEntity
.
getPushType
())){
informationQuery
.
setNodeType
(
NodeTypeEnum
.
受理
.
getCode
());
informationQuery
.
setNodeType
(
NodeTypeEnum
.
受理
.
getCode
());
informationQuery
.
setBizStatus
(
NodeTypeEnum
.
受理
.
getDesc
());
informationQuery
.
setBizStatus
(
NodeTypeEnum
.
受理
.
getDesc
());
}
else
if
(
PushTypeEnum
.
RYB
.
getStyle
().
equals
(
supplementEntity
.
getPushType
())){
informationQuery
.
setNodeType
(
NodeTypeEnum
.
蓉易办受理
.
getCode
());
informationQuery
.
setBizStatus
(
NodeTypeEnum
.
蓉易办受理
.
getDesc
());
}
informationQuery
.
setProcessStatusName
(
"申请并受理"
);
informationQuery
.
setProcessStatusName
(
"申请并受理"
);
informationQuery
.
setDoThingProperty
(
"0"
);
informationQuery
.
setDoThingProperty
(
"0"
);
informationQuery
.
setApplyNum
(
"1"
);
informationQuery
.
setApplyNum
(
"1"
);
...
@@ -178,11 +254,12 @@ public class SupplementTaskImpl implements ITaskExcuteService {
...
@@ -178,11 +254,12 @@ public class SupplementTaskImpl implements ITaskExcuteService {
return
informationQuery
;
return
informationQuery
;
}
}
private
List
<
SupplementEntity
>
queryDataThatHasNotBeenPushed
(
String
excuteParam
)
{
private
List
<
SupplementEntity
>
queryDataThatHasNotBeenPushed
(
String
excuteParam
,
int
type
)
{
List
<
SupplementEntity
>
supplementEntities
;
List
<
SupplementEntity
>
supplementEntities
;
SupplementQuery
supplementQuery
=
new
SupplementQuery
();
SupplementQuery
supplementQuery
=
new
SupplementQuery
();
supplementQuery
.
setIsExecute
(
"0"
);
supplementQuery
.
setIsExecute
(
"0"
);
supplementQuery
.
setIsSuccess
(
"0"
);
supplementQuery
.
setIsSuccess
(
"0"
);
supplementQuery
.
setPushType
(
PushTypeEnum
.
getByValue
(
type
).
getStyle
());
PageInfo
pageInfo
=
new
PageInfo
();
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setPrePageResult
(
Integer
.
parseInt
(
excuteParam
));
pageInfo
.
setPrePageResult
(
Integer
.
parseInt
(
excuteParam
));
//TODO: 条数限制
//TODO: 条数限制
...
...
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/web/SupplementController.java
View file @
ee0df0de
...
@@ -44,17 +44,17 @@ public class SupplementController extends BaseCRUDJsonMappingController<Suppleme
...
@@ -44,17 +44,17 @@ public class SupplementController extends BaseCRUDJsonMappingController<Suppleme
* 导入办件信息,一阶段通过excel表格导入,放入磁盘中,在通过文件地址去获取文件内容进行数据清洗
* 导入办件信息,一阶段通过excel表格导入,放入磁盘中,在通过文件地址去获取文件内容进行数据清洗
*/
*/
@PostMapping
(
value
=
"importOfficeInformation"
)
@PostMapping
(
value
=
"importOfficeInformation"
)
public
ApiRespPdu
importOfficeInformation
(
@RequestPart
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"sysCode"
)
String
sysCode
,
@RequestParam
(
"type"
)
String
type
){
public
ApiRespPdu
importOfficeInformation
(
@RequestPart
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"sysCode"
)
String
sysCode
,
@RequestParam
(
"type"
)
int
type
){
ApiRespPdu
respPdu
=
new
ApiRespPdu
();
ApiRespPdu
respPdu
=
new
ApiRespPdu
();
String
filePath
=
uploadService
.
saveFileUpload
(
file
,
null
,
null
);
String
filePath
=
uploadService
.
saveFileUpload
(
file
,
null
,
null
);
Map
<
String
,
String
>
objectObjectHashMap
=
new
HashMap
<>();
Map
<
String
,
String
>
objectObjectHashMap
=
new
HashMap
<>();
if
(
PushTypeEnum
.
SYTH
.
get
Style
().
equals
(
type
)
&&
StringUtils
.
isEmpty
(
sysCode
)){
if
(
PushTypeEnum
.
SYTH
.
get
Value
()
==
type
&&
StringUtils
.
isEmpty
(
sysCode
)){
respPdu
.
setCode
(-
1
);
respPdu
.
setCode
(-
1
);
respPdu
.
setMsg
(
"缺少系统编码"
);
respPdu
.
setMsg
(
"缺少系统编码"
);
return
respPdu
;
return
respPdu
;
}
}
objectObjectHashMap
.
put
(
"sysCode"
,
sysCode
);
objectObjectHashMap
.
put
(
"sysCode"
,
sysCode
);
objectObjectHashMap
.
put
(
"type"
,
type
);
objectObjectHashMap
.
put
(
"type"
,
PushTypeEnum
.
getByValue
(
type
).
getStyle
()
);
objectObjectHashMap
.
put
(
"status"
,
ExcelUploadEnum
.
未处理的文件路径
.
getCode
());
objectObjectHashMap
.
put
(
"status"
,
ExcelUploadEnum
.
未处理的文件路径
.
getCode
());
iCacheService
.
hset
(
ExcelUploadEnum
.
UPLOAD_PATH
.
getCode
(),
filePath
,
objectObjectHashMap
);
iCacheService
.
hset
(
ExcelUploadEnum
.
UPLOAD_PATH
.
getCode
(),
filePath
,
objectObjectHashMap
);
respPdu
.
setCode
(
200
);
respPdu
.
setCode
(
200
);
...
...
dataCenter-manager/src/main/resources/bootstrap.yml
View file @
ee0df0de
...
@@ -57,4 +57,9 @@ cookie:
...
@@ -57,4 +57,9 @@ cookie:
domain
:
base.testnew.com
domain
:
base.testnew.com
port
:
111
port
:
111
upload
:
upload
:
path
:
@
profiles.filepath@
path
:
/data-center-send/pic
#新津
# path: D:/pic #金堂
area
:
510132
#新津
# area: 510121 #金堂
AppKey
:
834815625598599168
#新津
# AppKey: 743109085582327808 #金堂
\ No newline at end of file
dataCenter-manager/src/main/resources/sqlmap/module/supplement/supplement.xml
View file @
ee0df0de
This diff is collapsed.
Click to expand it.
pom.xml
View file @
ee0df0de
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<properties>
<properties>
<profiles.active>
test
</profiles.active>
<profiles.active>
test
</profiles.active>
<profiles.datasource.uri>
<profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.25
2:3306/datacenter-platform
?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]>
</profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.25
1:3306/xhx-base
?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]>
</profiles.datasource.uri>
<profiles.datasource.username>
root
</profiles.datasource.username>
<profiles.datasource.username>
root
</profiles.datasource.username>
<profiles.datasource.password>
nacos@2020
</profiles.datasource.password>
<profiles.datasource.password>
nacos@2020
</profiles.datasource.password>
<profiles.redis.uri>
192.168.0.252
</profiles.redis.uri>
<profiles.redis.uri>
192.168.0.252
</profiles.redis.uri>
...
...
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