Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
huazheng-project-flink
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
huazheng
huazheng-project-flink
Commits
1566ad14
提交
1566ad14
authored
1月 11, 2021
作者:
think
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加表vbup
上级
246e0693
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
339 行增加
和
1 行删除
+339
-1
HZDataStream.java
src/main/java/com/huazheng/project/HZDataStream.java
+15
-0
GPMapper.java
.../java/com/huazheng/project/greenplum/mapper/GPMapper.java
+10
-0
CheckDeleteServiceImpl.java
...roject/greenplum/service/impl/CheckDeleteServiceImpl.java
+32
-0
CheckUpdateServiceImpl.java
...roject/greenplum/service/impl/CheckUpdateServiceImpl.java
+31
-0
GPServiceImpl.java
...uazheng/project/greenplum/service/impl/GPServiceImpl.java
+30
-0
JobServiceImpl.java
...azheng/project/greenplum/service/impl/JobServiceImpl.java
+27
-0
VbupSource.java
...om/huazheng/project/greenplum/source/hana/VbupSource.java
+71
-0
SapMapper.java
...main/java/com/huazheng/project/hana/mapper/SapMapper.java
+4
-0
Vbup.java
src/main/java/com/huazheng/project/hana/model/Vbup.java
+40
-0
华正项目-数据库表设计20210111.xlsx
src/main/resources/devtools/doc/华正项目-数据库表设计20210111.xlsx
+0
-0
t_vbup.sql
src/main/resources/devtools/table/hana/t_vbup.sql
+15
-0
GPMapper_greenplum.xml
src/main/resources/mapper/greenplum/GPMapper_greenplum.xml
+19
-0
SapMapper_hana.xml
src/main/resources/mapper/hana/SapMapper_hana.xml
+24
-0
spring-init.xml
src/main/resources/spring-init.xml
+21
-1
没有找到文件。
src/main/java/com/huazheng/project/HZDataStream.java
浏览文件 @
1566ad14
...
...
@@ -52,6 +52,7 @@ import com.huazheng.project.greenplum.source.hana.VbpaSource;
import
com.huazheng.project.greenplum.source.hana.VbrkSource
;
import
com.huazheng.project.greenplum.source.hana.VbrpSource
;
import
com.huazheng.project.greenplum.source.hana.VbukSource
;
import
com.huazheng.project.greenplum.source.hana.VbupSource
;
import
com.huazheng.project.greenplum.source.hana.ZmdpcSource
;
import
com.huazheng.project.greenplum.source.hana.ZpoeditSource
;
import
com.huazheng.project.greenplum.source.hana.Zsd06Source
;
...
...
@@ -109,6 +110,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -203,6 +205,7 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
private
static
S066Source
s066Source
;
private
static
S067Source
s067Source
;
private
static
VbukSource
vbukSource
;
private
static
VbupSource
vbupSource
;
private
static
LikpSource
likpSource
;
private
static
KonvSource
konvSource
;
private
static
LipsSource
lipsSource
;
...
...
@@ -275,6 +278,7 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
s066Source
=
(
S066Source
)
context
.
getBean
(
"s066Source"
);
s067Source
=
(
S067Source
)
context
.
getBean
(
"s067Source"
);
vbukSource
=
(
VbukSource
)
context
.
getBean
(
"vbukSource"
);
vbupSource
=
(
VbupSource
)
context
.
getBean
(
"vbupSource"
);
likpSource
=
(
LikpSource
)
context
.
getBean
(
"likpSource"
);
konvSource
=
(
KonvSource
)
context
.
getBean
(
"konvSource"
);
lipsSource
=
(
LipsSource
)
context
.
getBean
(
"lipsSource"
);
...
...
@@ -915,6 +919,17 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
}
}).
setParallelism
(
1
).
name
(
"拉取Vbuk数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出Vbuk数据"
);
// ================= VbupRedis 队列 =================
// 销售凭证 : 项目状态
DataStream
<
String
>
vbupRedis
=
env
.
addSource
(
vbupSource
).
setParallelism
(
1
).
name
(
"输入Vbup队列"
);
vbupRedis
.
flatMap
(
new
FlatMapFunction
<
String
,
Vbup
>()
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
flatMap
(
String
value
,
Collector
<
Vbup
>
out
)
throws
Exception
{
gpserviceImpl
.
processVbup
(
value
,
out
);
}
}).
setParallelism
(
1
).
name
(
"拉取Vbup数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出Vbup数据"
);
// =========================================== mysql ===========================================
// Handover
DataStream
<
String
>
handoverRedis
=
env
.
addSource
(
handoverSource
).
setParallelism
(
1
).
name
(
"输入Handover队列"
);
...
...
src/main/java/com/huazheng/project/greenplum/mapper/GPMapper.java
浏览文件 @
1566ad14
...
...
@@ -46,6 +46,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -377,6 +378,15 @@ public interface GPMapper {
public
List
<
Vbuk
>
selectVbukCheck
(
Vbuk
build
);
@Cacheable
(
key
=
"#root.method.name+':'+#p0.vbeln+','+#p0.posnr+','+#p0.mandt"
,
unless
=
"#result == null"
)
public
Vbup
selectVbup
(
Vbup
vbup
);
// 查询替代删除
public
void
insertVbup
(
Vbup
element
);
@CacheEvict
(
key
=
"'selectVbup'+':'+#p0.vbeln+','+#p0.posnr+','+#p0.mandt"
)
public
void
updateVbup
(
Vbup
vbup
);
@CacheEvict
(
key
=
"'selectVbup'+':'+#p0.vbeln+','+#p0.posnr+','+#p0.mandt"
)
public
void
deleteVbup
(
Vbup
vbup
);
public
List
<
Vbup
>
selectVbupCheck
(
Vbup
build
);
@Cacheable
(
key
=
"#root.method.name+':'+#p0.vbeln+','+#p0.posnr+','+#p0.mandt"
,
unless
=
"#result == null"
)
public
Zmdpc
selectZmdpc
(
Zmdpc
zmdpc
);
// 查询替代删除
public
void
insertZmdpc
(
Zmdpc
element
);
@CacheEvict
(
key
=
"'selectZmdpc'+':'+#p0.vbeln+','+#p0.posnr+','+#p0.mandt"
)
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/CheckDeleteServiceImpl.java
浏览文件 @
1566ad14
...
...
@@ -32,6 +32,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -541,6 +542,37 @@ public class CheckDeleteServiceImpl {
redis1Template
.
opsForValue
().
set
(
"huazheng:checkDeleteError:Vbuk:rowNum"
,
SomeUtils
.
getErrorInfoFromException
(
e
));
}
}
public
void
selectVbupCheckByDelete
()
{
try
{
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
opsForValue
.
setIfAbsent
(
"huazheng:checkDelete:Vbup:rowNum"
,
"0"
);
String
rowNum
=
opsForValue
.
get
(
"huazheng:checkDelete:Vbup:rowNum"
);
Vbup
build
=
Vbup
.
builder
().
rowNum
(
rowNum
).
build
();
List
<
Vbup
>
list
=
gpMapper
.
selectVbupCheck
(
build
);
// 从数仓中查询一组数据
if
(
list
.
size
()
==
0
)
{
redis1Template
.
opsForValue
().
set
(
"huazheng:checkDelete:Vbup:rowNum"
,
"0"
);
// 计数器复位
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
list
.
forEach
(
target
->
{
// 遍历要检查的数据
Vbup
source
=
sapMapper
.
selectVbupById
(
target
);
// 根据主键查询源库中的数据
String
operator
=
"none"
;
if
(
source
==
null
)
{
// 如果源库中没有数据
gpMapper
.
deleteVbup
(
target
);
// 删除数仓中的数据
operator
=
"delete"
;
}
redis1Template
.
opsForValue
().
set
(
"huazheng:checkDelete:Vbup:rowNum"
,
target
.
getRowNum
());
if
(!
operator
.
equals
(
"none"
))
{
log
.
info
(
String
.
format
(
"selectVbupcheckDelete --> rowNum:%s, operator:%s"
,
target
.
getRowNum
(),
operator
));
}
});
}
catch
(
Exception
e
)
{
redis1Template
.
opsForValue
().
set
(
"huazheng:checkDeleteError:Vbup:rowNum"
,
SomeUtils
.
getErrorInfoFromException
(
e
));
}
}
public
void
selectZpoeditCheckByDelete
()
{
try
{
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/CheckUpdateServiceImpl.java
浏览文件 @
1566ad14
...
...
@@ -40,6 +40,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -763,6 +764,30 @@ public class CheckUpdateServiceImpl {
}
}
}
// 所属selectLipsCheckUpdate的级联
private
void
cascadeVbupCheckByUpdate
(
Vbup
source
,
Vbup
target
)
{
if
(
target
!=
null
)
{
// 目标库有数据
String
shash
=
SecureUtil
.
md5
(
JSONUtil
.
toJsonStr
(
source
));
// 源库中数据的hash结果
String
thash
=
target
.
getHashResult
();
// 数仓中数据的hash结果
if
(!
shash
.
equals
(
thash
))
{
// 如果hash结果不一致
source
.
setHashResult
(
shash
);
// ===============================
// ===============================
while
(
true
)
{
try
{
gpMapper
.
updateVbup
(
source
);
// 更新数据到数仓中
break
;
}
catch
(
RuntimeException
e
)
{
log
.
error
(
e
.
getMessage
());
ThreadUtil
.
safeSleep
(
500
);
}
}
ThreadUtil
.
safeSleep
(
500
);
}
}
}
// 所属selectMaraCheckUpdate的级联
private
void
cascadeMaktCheckByUpdate
(
Makt
source
,
Makt
target
)
{
if
(
target
!=
null
)
{
// 目标库有数据
...
...
@@ -1713,6 +1738,12 @@ public class CheckUpdateServiceImpl {
Vbuk
tVbuk
=
gpMapper
.
selectVbuk
(
sVbuk
);
// 查询目标库中afko表
cascadeVbukCheckByUpdate
(
sVbuk
,
tVbuk
);
// 级联更新afko表
}
// 级联更新业务
List
<
Vbup
>
sVbupList
=
sapMapper
.
cascadeVbupByLips
(
source
);
// 级联查询源库vbup表
for
(
Vbup
sVbup
:
sVbupList
)
{
Vbup
tVbup
=
gpMapper
.
selectVbup
(
sVbup
);
// 查询目标库中vbup表
cascadeVbupCheckByUpdate
(
sVbup
,
tVbup
);
// 级联更新vbup表
}
ThreadUtil
.
safeSleep
(
500
);
}
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/GPServiceImpl.java
浏览文件 @
1566ad14
...
...
@@ -49,6 +49,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -1121,6 +1122,35 @@ public class GPServiceImpl {
}
}
public
void
processVbup
(
String
value
,
Collector
<
Vbup
>
out
)
{
try
{
Vbup
data
=
JSONUtil
.
toBean
(
value
,
Vbup
.
class
);
Vbup
exist
=
gpMapper
.
selectVbup
(
data
);
if
(
exist
!=
null
)
{
data
.
setExist
(
true
);
// 已经在库
}
out
.
collect
(
data
);
}
catch
(
Exception
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Vbup:error"
,
"processVbup"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
}
public
void
sinkVbup
(
Vbup
element
)
{
try
{
if
(
element
.
isExist
()
==
false
)
{
log
.
debug
(
"GPServiceImpl.sinkVbup()"
);
gpMapper
.
insertVbup
(
element
);
}
}
catch
(
RuntimeException
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Vbup:error"
,
"sinkVbup"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Vbup:error"
,
"sinkVbup"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
}
public
void
processHandover
(
String
value
,
Collector
<
Handover
>
out
)
{
try
{
Handover
data
=
JSONUtil
.
toBean
(
value
,
Handover
.
class
);
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/JobServiceImpl.java
浏览文件 @
1566ad14
...
...
@@ -52,6 +52,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -1005,6 +1006,32 @@ public class JobServiceImpl {
}
}
}
public
void
selectVbupNew
()
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap4send.lua"
)));
List
<
String
>
keys
=
Arrays
.
asList
(
"huazheng:Vbup:sendcount"
,
"huazheng:Vbup:rowids"
,
"huazheng:list:Vbup"
);
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
opsForValue
.
setIfAbsent
(
"huazheng:Vbup:sendcount"
,
"0"
);
// 不存在则创建,存在则么有操作
opsForValue
.
setIfAbsent
(
"huazheng:Vbup:receivecount"
,
"0"
);
// 不存在则创建,存在则么有操作
opsForValue
.
setIfAbsent
(
"huazheng:Vbup:rowids"
,
"0"
);
// 不存在则创建,存在则么有操作
Long
sendcount
=
Long
.
valueOf
(
opsForValue
.
get
(
"huazheng:Vbup:sendcount"
));
Long
receivecount
=
Long
.
valueOf
(
opsForValue
.
get
(
"huazheng:Vbup:receivecount"
));
if
(
sendcount
-
receivecount
<=
20
)
{
// 如果发送数和消费数的差小于5则往队列中写数据
String
rowids
=
opsForValue
.
get
(
"huazheng:Vbup:rowids"
);
// 标记id
Vbup
vbup
=
Vbup
.
builder
().
rowids
(
Long
.
valueOf
(
rowids
)).
build
();
List
<
Vbup
>
list
=
sapMapper
.
selectVbupNew
(
vbup
);
if
(!
list
.
isEmpty
())
{
list
.
forEach
(
item
->
{
JSONObject
json
=
JSONUtil
.
parseObj
(
item
,
false
);
String
execute
=
redis1Template
.
execute
(
script
,
keys
,
item
.
getRowids
().
toString
(),
json
.
toString
());
log
.
info
(
"标记时间回写 --> "
+
execute
);
});
}
}
}
public
void
selectVbapNew
()
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
...
...
src/main/java/com/huazheng/project/greenplum/source/hana/VbupSource.java
0 → 100644
浏览文件 @
1566ad14
package
com
.
huazheng
.
project
.
greenplum
.
source
.
hana
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.flink.streaming.api.functions.source.SourceFunction
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.data.redis.core.script.DefaultRedisScript
;
import
org.springframework.scripting.support.ResourceScriptSource
;
import
org.springframework.stereotype.Service
;
import
com.huazheng.project.HZDataStream
;
import
cn.hutool.core.thread.ThreadUtil
;
import
lombok.extern.log4j.Log4j2
;
@Log4j2
@Service
public
class
VbupSource
implements
SourceFunction
<
String
>
{
private
static
final
long
serialVersionUID
=
1L
;
public
String
getErrorInfoFromException
(
Exception
e
)
{
try
{
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
e
.
printStackTrace
(
pw
);
return
"\r\n"
+
sw
.
toString
()
+
"\r\n"
;
}
catch
(
Exception
e2
)
{
return
"bad getErrorInfoFromException"
;
}
}
@Override
public
void
run
(
SourceContext
<
String
>
ctx
)
throws
Exception
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap.lua"
)));
List
<
String
>
keys
=
Arrays
.
asList
(
"huazheng:Vbup:sendcount"
,
"huazheng:Vbup:id"
,
"huazheng:list:Vbup"
,
"huazheng:Vbup:receivecount"
);
while
(
true
)
{
try
{
String
value
=
HZDataStream
.
redis1Template
.
execute
(
script
,
keys
,
""
);
String
[]
values
=
value
.
toString
().
split
(
"=========="
);
String
checkString
=
values
[
0
];
String
[]
split
=
checkString
.
split
(
", "
);
boolean
check
=
split
[
0
].
split
(
":"
)[
1
].
equals
(
split
[
1
].
split
(
":"
)[
1
]);
if
(
values
.
length
>
1
)
{
// 有数据字符串
// log.info(msg + " " + value.toString() + " " + check);
log
.
info
(
checkString
+
" "
+
check
);
ctx
.
collect
(
values
[
1
]);
}
else
{
// 没有数据字符串
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
}
catch
(
Exception
e
)
{
HZDataStream
.
redis1Template
.
opsForHash
().
put
(
"huazheng:Vbup:error"
,
"receivecount_elseerror"
,
getErrorInfoFromException
(
e
));
}
}
}
@Override
public
void
cancel
()
{
}
}
src/main/java/com/huazheng/project/hana/mapper/SapMapper.java
浏览文件 @
1566ad14
...
...
@@ -39,6 +39,7 @@ import com.huazheng.project.hana.model.Vbpa;
import
com.huazheng.project.hana.model.Vbrk
;
import
com.huazheng.project.hana.model.Vbrp
;
import
com.huazheng.project.hana.model.Vbuk
;
import
com.huazheng.project.hana.model.Vbup
;
import
com.huazheng.project.hana.model.Zmdpc
;
import
com.huazheng.project.hana.model.Zpoedit
;
import
com.huazheng.project.hana.model.Zsd06
;
...
...
@@ -58,6 +59,7 @@ public interface SapMapper {
public
List
<
S066
>
selectS066New
(
S066
s066
);
public
List
<
S067
>
selectS067New
(
S067
s067
);
public
List
<
Vbuk
>
selectVbukNew
(
Vbuk
vbuk
);
public
List
<
Vbup
>
selectVbupNew
(
Vbup
vbup
);
public
List
<
Likp
>
selectLikpNew
(
Likp
likp
);
public
List
<
Konv
>
selectKonvNew
(
Konv
konv
);
public
List
<
Lips
>
selectLipsNew
(
Lips
lips
);
...
...
@@ -112,6 +114,7 @@ public interface SapMapper {
public
List
<
Konv
>
cascadeKonvByVbak
(
Vbak
vbak
);
public
List
<
Makt
>
cascadeMaktByMara
(
Mara
mara
);
public
List
<
Vbuk
>
cascadeVbukByLips
(
Lips
lips
);
public
List
<
Vbup
>
cascadeVbupByLips
(
Lips
lips
);
public
List
<
Zpoedit
>
cascadeZpoeditByAufk
(
Aufk
aufk
);
public
List
<
Bsad
>
cascadeBsadByBkpf
(
Bkpf
bkpf
);
public
List
<
Bsid
>
cascadeBsidByBkpf
(
Bkpf
bkpf
);
...
...
@@ -149,6 +152,7 @@ public interface SapMapper {
public
Vbrk
selectVbrkById
(
Vbrk
target
);
public
Vbrp
selectVbrpById
(
Vbrp
target
);
public
Vbuk
selectVbukById
(
Vbuk
target
);
public
Vbup
selectVbupById
(
Vbup
target
);
public
Zmdpc
selectZmdpcById
(
Zmdpc
target
);
public
Zsd06
selectZsd06ById
(
Zsd06
target
);
public
Zsdfhzl
selectZsdfhzlById
(
Zsdfhzl
target
);
...
...
src/main/java/com/huazheng/project/hana/model/Vbup.java
0 → 100644
浏览文件 @
1566ad14
package
com
.
huazheng
.
project
.
hana
.
model
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
/**
* 销售凭证 : 项目状态
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors
(
chain
=
true
)
@Builder
public
class
Vbup
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
mandt
;
// 集团
private
String
vbeln
;
// 销售和分销凭证号
private
String
posnr
;
// 销售和分销凭证的项目号
private
String
besta
;
// 凭证项目的确认状态
private
String
lfsta
;
// 交货状态
private
String
lfgsa
;
// 项目的总交货状态
private
String
wbsta
;
// 货物移动状态
private
Long
rowids
;
// sap那边的rowid
private
boolean
exist
;
// 用于标记,不是字段
private
String
hashResult
;
// 数据hash标记
private
String
rowNum
;
// 用于标记,不是字段
}
src/main/resources/devtools/doc/华正项目-数据库表设计202101
08
.xlsx
→
src/main/resources/devtools/doc/华正项目-数据库表设计202101
11
.xlsx
浏览文件 @
1566ad14
No preview for this file type
src/main/resources/devtools/table/hana/t_vbup.sql
0 → 100644
浏览文件 @
1566ad14
drop
table
vbup
;
CREATE
TABLE
vbup
(
mandt
text
,
vbeln
text
,
posnr
text
,
besta
text
,
lfsta
text
,
lfgsa
text
,
wbsta
text
,
PRIMARY
KEY
(
mandt
,
vbeln
,
posnr
)
)
Distributed
by
(
mandt
,
vbeln
,
posnr
);
alter
table
vbuk
add
column
hashResult
text
;
alter
table
vbuk
add
column
rowNum
serial
;
src/main/resources/mapper/greenplum/GPMapper_greenplum.xml
浏览文件 @
1566ad14
...
...
@@ -1267,6 +1267,25 @@
select * from Vbuk where rownum
>
#{rowNum} order by rownum limit 20
</select>
<select
id=
"selectVbup"
parameterType=
"com.huazheng.project.hana.model.Vbup"
resultType=
"com.huazheng.project.hana.model.Vbup"
>
select * from Vbup where vbeln = #{vbeln} and posnr = #{posnr} and mandt = #{mandt}
</select>
<insert
id=
"insertVbup"
parameterType=
"com.huazheng.project.hana.model.Vbup"
>
insert into Vbup (mandt, vbeln, posnr, besta, lfsta, lfgsa, wbsta, hashResult)
values(#{mandt}, #{vbeln}, #{posnr}, #{besta}, #{lfsta}, #{lfgsa}, #{wbsta}, #{hashResult})
</insert>
<delete
id=
"deleteVbup"
parameterType=
"com.huazheng.project.hana.model.Vbup"
>
delete from Vbup where vbeln = #{vbeln} and posnr = #{posnr} and mandt = #{mandt}
</delete>
<update
id=
"updateVbup"
parameterType=
"com.huazheng.project.hana.model.Vbup"
>
update Vbup set
mandt = #{mandt}, vbeln = #{vbeln}, posnr = #{posnr}, besta = #{besta}, lfsta = #{lfsta}, lfgsa = #{lfgsa}, wbsta = #{wbsta}, hashResult = #{hashResult}
where vbeln = #{vbeln} and posnr = #{posnr} and mandt = #{mandt}
</update>
<select
id=
"selectVbupCheck"
parameterType=
"com.huazheng.project.hana.model.Vbup"
resultType=
"com.huazheng.project.hana.model.Vbup"
>
select * from Vbup where rownum
>
#{rowNum} order by rownum limit 20
</select>
<select
id=
"selectZmdpc"
parameterType=
"com.huazheng.project.hana.model.Zmdpc"
resultType=
"com.huazheng.project.hana.model.Zmdpc"
>
select * from Zmdpc
where vbeln = #{vbeln} and posnr = #{posnr} and mandt = #{mandt}
...
...
src/main/resources/mapper/hana/SapMapper_hana.xml
浏览文件 @
1566ad14
...
...
@@ -105,6 +105,15 @@
where "$rowid$"
>
#{rowids} ${hana_mandt}
order by "$rowid$"
</select>
<select
id=
"selectVbupNew"
parameterType=
"Vbup"
resultType=
"Vbup"
>
select top 20 "$rowid$" as rowids,
mandt, vbeln, posnr, besta, lfsta, lfgsa, wbsta
from ${hana_user}.vbup
where "$rowid$"
>
#{rowids} ${hana_mandt}
order by "$rowid$"
</select>
<select
id=
"selectLikpNew"
parameterType=
"Likp"
resultType=
"Likp"
>
select top 20 "$rowid$" as rowids,
vbeln, mandt, erdat, wadat_ist, ctlpc, kunnr, aedat,lfuhr
...
...
@@ -481,6 +490,14 @@
from ${hana_user}.vbuk
where vbeln = #{vbeln} ${hana_mandt}
</select>
<select
id=
"cascadeVbupByLips"
parameterType=
"Lips"
resultType=
"Vbup"
>
select
mandt, vbeln, posnr, besta, lfsta, lfgsa, wbsta
from ${hana_user}.vbup
where vbeln=#{vbeln} and posnr=#{posnr} ${hana_mandt}
</select>
<select
id=
"cascadeZpoeditByAufk"
parameterType=
"Aufk"
resultType=
"Zpoedit"
>
select
mandt, pwerk, aufnr, reason
...
...
@@ -699,6 +716,13 @@
from ${hana_user}.vbuk
where vbeln = #{vbeln} and mandt = '800'
</select>
<select
id=
"selectVbupById"
parameterType=
"Vbup"
resultType=
"Vbup"
>
select mandt, vbeln, posnr, besta, lfsta, lfgsa, wbsta
from ${hana_user}.vbup
where vbeln = #{vbeln} and posnr = #{posnr} and mandt = '800'
</select>
<select
id=
"selectZmdpcById"
parameterType=
"Zmdpc"
resultType=
"Zmdpc"
>
select vbeln,posnr,f_plant,plant,x_plant,mandt
from ${hana_user}.Zmdpc
...
...
src/main/resources/spring-init.xml
浏览文件 @
1566ad14
...
...
@@ -595,6 +595,15 @@
<property
name=
"jobDetail"
>
<bean
parent=
"methodJobDetail"
>
<property
name=
"targetObject"
ref=
"jobServiceImpl"
/>
<property
name=
"targetMethod"
value=
"selectVbupNew"
/>
</bean>
</property>
<property
name=
"cronExpression"
value=
"* * * * * ?"
/>
</bean>
<bean
class=
"org.springframework.scheduling.quartz.CronTriggerFactoryBean"
>
<property
name=
"jobDetail"
>
<bean
parent=
"methodJobDetail"
>
<property
name=
"targetObject"
ref=
"jobServiceImpl"
/>
<property
name=
"targetMethod"
value=
"selectVbpaNew"
/>
</bean>
</property>
...
...
@@ -1217,6 +1226,17 @@
</property>
<property name="cronExpression" value="* * * * * ?" />
</bean> -->
<bean
class=
"org.springframework.scheduling.quartz.CronTriggerFactoryBean"
>
<property
name=
"jobDetail"
>
<bean
parent=
"methodJobDetail"
>
<property
name=
"targetObject"
ref=
"checkDeleteServiceImpl"
/>
<property
name=
"targetMethod"
value=
"selectVbupCheckByDelete"
/>
</bean>
</property>
<property
name=
"cronExpression"
value=
"* * * * * ?"
/>
</bean>
<!-- <bean class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<bean parent="methodJobDetail">
...
...
@@ -1431,7 +1451,7 @@
<property
name=
"cronExpression"
value=
"* * * * * ?"
/>
</bean>
<!-- 以上7
3
个任务 -->
<!-- 以上7
5
个任务 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论