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
232078e7
Commit
232078e7
authored
Nov 08, 2021
by
shenxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
蓉易办推送数据
parent
b853a39f
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
383 additions
and
53 deletions
+383
-53
dataCenter-manager/src/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
...c/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
+1
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/dao/RybMatterDao.java
...m/mortals/xhx/modules/implementlist/dao/RybMatterDao.java
+16
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/dao/ibatis/RybMatterDaoImpl.java
...hx/modules/implementlist/dao/ibatis/RybMatterDaoImpl.java
+31
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/model/RybMatterListEntry.java
...s/xhx/modules/implementlist/model/RybMatterListEntry.java
+53
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/service/RybMatterListService.java
...x/modules/implementlist/service/RybMatterListService.java
+10
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/service/impl/RybMatterListServiceImpl.java
.../implementlist/service/impl/RybMatterListServiceImpl.java
+40
-0
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/service/impl/InformationServiceImpl.java
...ules/information/service/impl/InformationServiceImpl.java
+130
-44
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/task/SupplementTaskImpl.java
...rtals/xhx/modules/supplement/task/SupplementTaskImpl.java
+74
-9
dataCenter-manager/src/main/resources/sqlmap/implementlist/rybMatter.xml
...ger/src/main/resources/sqlmap/implementlist/rybMatter.xml
+28
-0
No files found.
dataCenter-manager/src/main/java/com/mortals/xhx/common/code/NodeTypeEnum.java
View file @
232078e7
...
...
@@ -17,6 +17,7 @@ public enum NodeTypeEnum {
受理
(
"BusiType_1"
,
"11"
,
"受理"
),
审查
(
"BusiType_13"
,
"21"
,
"审查"
),
决定
(
"BusiType_8"
,
"41"
,
"决定"
),
已提交
(
"BusiType_12"
,
"61"
,
"已提交"
),
办结
(
"end"
,
"81"
,
"办结"
);
private
String
code
;
...
...
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/dao/RybMatterDao.java
0 → 100644
View file @
232078e7
package
com.mortals.xhx.modules.implementlist.dao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.modules.implementlist.model.ImplementlistEntity
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
RybMatterDao
extends
ICRUDDao
<
ImplementlistEntity
,
Long
>
{
List
<
RybMatterListEntry
>
find
(
String
eventCode
);
void
inserts
(
List
<
RybMatterListEntry
>
informationQueries
);
}
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/dao/ibatis/RybMatterDaoImpl.java
0 → 100644
View file @
232078e7
package
com.mortals.xhx.modules.implementlist.dao.ibatis
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
com.mortals.xhx.modules.implementlist.dao.ImplementlistDao
;
import
com.mortals.xhx.modules.implementlist.dao.RybMatterDao
;
import
com.mortals.xhx.modules.implementlist.model.ImplementlistEntity
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>Title: 实施清单主表</p>
* <p>Description: ImplementlistDaoImpl DAO接口 </p>
* @author
* @version 1.0.0
*/
@Repository
(
"rybMatterDao"
)
public
class
RybMatterDaoImpl
extends
BaseCRUDDaoMybatis
<
ImplementlistEntity
,
Long
>
implements
RybMatterDao
{
@Override
public
List
<
RybMatterListEntry
>
find
(
String
eventCode
)
{
return
getSqlSession
().
selectList
(
getSqlId
(
"findRyb"
),
eventCode
);
}
@Override
public
void
inserts
(
List
<
RybMatterListEntry
>
informationQueries
)
{
getSqlSession
().
insert
(
getSqlId
(
"insertRyb"
),
informationQueries
);
}
}
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/model/RybMatterListEntry.java
0 → 100644
View file @
232078e7
package
com.mortals.xhx.modules.implementlist.model
;
/**
* 蓉易办对接实体类
*/
import
com.mortals.framework.model.BaseEntityLong
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
RybMatterListEntry
extends
BaseEntityLong
{
//部门编码
private
String
deptCode
;
//部门名称
private
String
deptName
;
//事项名称
private
String
matterName
;
//事项编码
private
String
matterCode
;
//taskId
private
String
taskId
;
//事项类型
private
String
matterType
;
/**
* 是否推送(0 否 1是)
*/
private
String
isReport
;
/**
* 是否成功(0 否 1是)
*/
private
String
isSuccess
;
/**
* 失败次数
*/
private
Integer
failTimes
;
/**
* 推送失败原因
*/
private
String
failReason
;
private
Date
createTime
;
}
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/service/RybMatterListService.java
0 → 100644
View file @
232078e7
package
com.mortals.xhx.modules.implementlist.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
public
interface
RybMatterListService
{
RybMatterListEntry
getThImplement
(
String
event_code
);
}
\ No newline at end of file
dataCenter-manager/src/main/java/com/mortals/xhx/modules/implementlist/service/impl/RybMatterListServiceImpl.java
0 → 100644
View file @
232078e7
package
com.mortals.xhx.modules.implementlist.service.impl
;
import
com.github.benmanes.caffeine.cache.Cache
;
import
com.mortals.xhx.modules.implementlist.dao.RybMatterDao
;
import
com.mortals.xhx.modules.implementlist.model.RybMatterListEntry
;
import
com.mortals.xhx.modules.implementlist.service.RybMatterListService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
RybMatterListServiceImpl
implements
RybMatterListService
{
@Resource
private
RybMatterDao
rybMatterDao
;
private
final
Cache
<
String
,
Object
>
caffeineCache
;
@Override
public
RybMatterListEntry
getThImplement
(
String
event_code
)
{
caffeineCache
.
getIfPresent
(
event_code
);
RybMatterListEntry
thImplementList
=
(
RybMatterListEntry
)
caffeineCache
.
asMap
().
get
(
event_code
);
if
(
thImplementList
!=
null
)
{
return
thImplementList
;
}
//根据事项编码查
List
<
RybMatterListEntry
>
rybMatterListEntries
=
rybMatterDao
.
find
(
event_code
);
if
(
rybMatterListEntries
.
size
()
>
0
)
{
for
(
RybMatterListEntry
entity
:
rybMatterListEntries
)
{
thImplementList
=
entity
;
caffeineCache
.
put
(
event_code
,
entity
);
}
}
return
thImplementList
;
}
}
\ No newline at end of file
dataCenter-manager/src/main/java/com/mortals/xhx/modules/information/service/impl/InformationServiceImpl.java
View file @
232078e7
This diff is collapsed.
Click to expand it.
dataCenter-manager/src/main/java/com/mortals/xhx/modules/supplement/task/SupplementTaskImpl.java
View file @
232078e7
...
...
@@ -11,8 +11,11 @@ import com.mortals.xhx.common.code.NodeTypeEnum;
import
com.mortals.xhx.common.utils.DateByAffairUtils
;
import
com.mortals.xhx.common.utils.FilterSuppDataUtils
;
import
com.mortals.xhx.common.utils.SnowFlakeUtil
;
import
com.mortals.xhx.modules.implementlist.dao.RybMatterDao
;
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.RybMatterListService
;
import
com.mortals.xhx.modules.information.dao.InformationDao
;
import
com.mortals.xhx.modules.information.model.InformationEntity
;
import
com.mortals.xhx.modules.supplement.model.SupplementEntity
;
...
...
@@ -22,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -43,9 +47,15 @@ public class SupplementTaskImpl implements ITaskExcuteService {
@Autowired
private
ImplementlistService
implementlistService
;
@Resource
private
RybMatterListService
rybMatterListService
;
@Autowired
private
InformationDao
informationDao
;
@Resource
private
RybMatterDao
rybMatterDao
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
//TODO:因临时对接蓉易办暂时屏蔽,等后期蓉易办对接完成后放开
...
...
@@ -53,7 +63,62 @@ public class SupplementTaskImpl implements ITaskExcuteService {
// List<SupplementEntity> supplementEntities = queryDataThatHasNotBeenPushed(task.getExcuteParam());
// //开始进行数据清洗
// this.dataCleaning(supplementEntities);
this
.
temporaryDocking
();
// this.temporaryDocking();
this
.
ryb
();
}
//TODO:因临时对接蓉易办,后期可删除
private
void
ryb
()
{
SupplementQuery
supplementQuery
=
new
SupplementQuery
();
supplementQuery
.
setIsExecute
(
"0"
);
supplementQuery
.
setIsSuccess
(
"0"
);
List
<
InformationEntity
>
informationQueries
=
new
ArrayList
<>();
List
<
SupplementEntity
>
supplementEntities
=
supplementService
.
find
(
supplementQuery
,
null
);
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
(
"510121"
);
//是否转化成功: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"
);
log
.
error
(
"转换失败:SupplementID:"
+
e
.
getId
());
log
.
error
(
"转换失败:失败原因"
+
ex
.
getMessage
());
return
e
;
}
}).
collect
(
Collectors
.
toList
());
supplementService
.
update
(
collect
,
null
);
informationDao
.
insertBatch
(
informationQueries
);
}
}
//TODO:因临时对接蓉易办,后期可删除
...
...
@@ -63,7 +128,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
supplementQuery
.
setIsSuccess
(
"0"
);
List
<
InformationEntity
>
informationQueries
=
new
ArrayList
<>();
List
<
SupplementEntity
>
supplementEntities
=
supplementService
.
find
(
supplementQuery
,
null
);
if
(!
supplementEntities
.
isEmpty
()){
if
(!
supplementEntities
.
isEmpty
())
{
List
<
SupplementEntity
>
collect
=
supplementEntities
.
parallelStream
().
map
(
e
->
{
//TODO:查询实施清单信息,通过事项编码查询有问题(但因数据库存储的事项数据是条件过滤后的,故暂时不改动查询),后期改动
ImplementlistEntity
thImplement
=
implementlistService
.
getThImplement
(
e
.
getImplCode
());
...
...
@@ -105,7 +170,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
return
e
;
}
}).
collect
(
Collectors
.
toList
());
supplementService
.
update
(
collect
,
null
);
supplementService
.
update
(
collect
,
null
);
informationDao
.
insertBatch
(
informationQueries
);
}
}
...
...
@@ -156,7 +221,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
return
e
;
}
}).
collect
(
Collectors
.
toList
());
supplementService
.
update
(
collect
,
null
);
supplementService
.
update
(
collect
,
null
);
informationDao
.
insertBatch
(
informationQueries
);
}
else
{
log
.
info
(
"没有从临时表中获取到需要清洗的数据"
);
...
...
@@ -238,7 +303,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
//当月第几天
String
theDayOfTheMonth
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
//每月第一天,去查询上月的数据是否存在未处理的数据
if
(
theFirstDayOfTheMonth
.
equals
(
theDayOfTheMonth
)){
if
(
theFirstDayOfTheMonth
.
equals
(
theDayOfTheMonth
))
{
//获取上月第一天的开始时间
supplementQuery
.
setCreateDateStart
(
DateByAffairUtils
.
getLastMonthFirstDate
(
new
Date
(),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
toPattern
()));
...
...
@@ -246,7 +311,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
supplementQuery
.
setCreateDateEnd
(
DateByAffairUtils
.
getLastMonthLastDate
(
new
Date
(),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
toPattern
()));
try
{
supplementEntities
=
supplementService
.
find
(
supplementQuery
,
pageInfo
,
null
).
getList
();
supplementEntities
=
supplementService
.
find
(
supplementQuery
,
pageInfo
,
null
).
getList
();
}
catch
(
Exception
e
)
{
log
.
info
(
"报错属于业务正常,查询当月表数据"
);
supplementEntities
=
queryCurrentMonthTableData
(
supplementQuery
,
pageInfo
);
...
...
@@ -255,9 +320,9 @@ public class SupplementTaskImpl implements ITaskExcuteService {
if
(
supplementEntities
.
size
()
<=
0
)
{
supplementEntities
=
queryCurrentMonthTableData
(
supplementQuery
,
pageInfo
);
}
}
else
{
}
else
{
//上月未存在未处理的数据,则查询当月数据
supplementEntities
=
queryCurrentMonthTableData
(
supplementQuery
,
pageInfo
);
supplementEntities
=
queryCurrentMonthTableData
(
supplementQuery
,
pageInfo
);
}
...
...
@@ -271,7 +336,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
//获取当前时间
supplementQuery
.
setCreateDateEnd
(
DateUtils
.
convertTime2Str
(
new
Date
().
getTime
(),
DateUtils
.
P_yyyy_MM_dd_HH_mm_ss
));
return
supplementService
.
find
(
supplementQuery
,
pageInfo
,
null
).
getList
();
return
supplementService
.
find
(
supplementQuery
,
pageInfo
,
null
).
getList
();
}
}
dataCenter-manager/src/main/resources/sqlmap/implementlist/rybMatter.xml
0 → 100644
View file @
232078e7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.mortals.xhx.modules.implementlist.dao.ibatis.RybMatterDaoImpl"
>
<select
id=
"findRyb"
resultType=
"com.mortals.xhx.modules.implementlist.model.RybMatterListEntry"
>
select
dept_code as deptCode,
dept_name as deptName,
matter_name as matterName,
matter_code as matterCode,
task_id as taskId,
matter_type as matterType,
create_time as createTime,
is_report as isReport,
is_success as isSuccess,
fail_times as failTimes,
fail_reason as failReason
from ryb_matter_list
where matter_code = #{eventCode}
</select>
<select
id=
"insertRyb"
parameterType=
"collection"
>
insert into values
<foreach
collection=
"collection"
item=
"entry"
index=
","
>
(#{entry.deptCode},#{entry.deptName},#{entry.matterName},#{entry.matterCode},#{entry.taskId},#{entry.matterType},#{entry.createTime},#{entry.isReport},#{entry.isSuccess},#{entry.failTimes},#{entry.failReason})
</foreach>
</select>
</mapper>
\ No newline at end of file
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