Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
datasync-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
位宇华
datasync-service
Commits
812fc881
Commit
812fc881
authored
Jan 15, 2025
by
gaopengxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客商名称与科目名称完善
parent
d4190cc9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
14 deletions
+66
-14
src/main/java/com/tianyi/sync/mapper/master/QueryMasterMapper.java
...java/com/tianyi/sync/mapper/master/QueryMasterMapper.java
+3
-0
src/main/java/com/tianyi/sync/model/AccountNameModel.java
src/main/java/com/tianyi/sync/model/AccountNameModel.java
+25
-0
src/main/java/com/tianyi/sync/service/impl/GroupSyncServiceimpl.java
...va/com/tianyi/sync/service/impl/GroupSyncServiceimpl.java
+25
-10
src/main/resources/mapper/FallGroupSlaveMapper.xml
src/main/resources/mapper/FallGroupSlaveMapper.xml
+2
-2
src/main/resources/mapper/ResidualValueMapper.xml
src/main/resources/mapper/ResidualValueMapper.xml
+11
-2
No files found.
src/main/java/com/tianyi/sync/mapper/master/QueryMasterMapper.java
View file @
812fc881
...
@@ -2,6 +2,7 @@ package com.tianyi.sync.mapper.master;
...
@@ -2,6 +2,7 @@ package com.tianyi.sync.mapper.master;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.tianyi.sync.model.AccountNameModel
;
import
com.tianyi.sync.model.DataSyncModel
;
import
com.tianyi.sync.model.DataSyncModel
;
import
com.tianyi.sync.model.ParmDataModel
;
import
com.tianyi.sync.model.ParmDataModel
;
import
com.tianyi.sync.model.GroupDataSyncModel
;
import
com.tianyi.sync.model.GroupDataSyncModel
;
...
@@ -17,4 +18,6 @@ public interface QueryMasterMapper {
...
@@ -17,4 +18,6 @@ public interface QueryMasterMapper {
List
<
GroupDataSyncModel
>
queryGroupSingle
(
String
period
,
List
<
String
>
singlePlug
);
List
<
GroupDataSyncModel
>
queryGroupSingle
(
String
period
,
List
<
String
>
singlePlug
);
List
<
AccountNameModel
>
queryAccountName
();
}
}
src/main/java/com/tianyi/sync/model/AccountNameModel.java
0 → 100644
View file @
812fc881
package
com.tianyi.sync.model
;
import
java.io.Serializable
;
public
class
AccountNameModel
implements
Serializable
{
private
String
code
;
private
String
displayname
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
displayname
;
}
public
void
setName
(
String
name
)
{
this
.
displayname
=
name
;
}
}
src/main/java/com/tianyi/sync/service/impl/GroupSyncServiceimpl.java
View file @
812fc881
...
@@ -48,6 +48,9 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -48,6 +48,9 @@ public class GroupSyncServiceimpl implements GroupSyncService {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
//String lastMonth = DateUtils.getYearAndMonthLast();
//String lastMonth = DateUtils.getYearAndMonthLast();
String
lastMonth
=
"2024-09"
;
String
lastMonth
=
"2024-09"
;
String
[]
timeParts
=
lastMonth
.
split
(
"-"
);
String
year
=
timeParts
[
0
];
// 年份部分
String
month
=
String
.
valueOf
(
Integer
.
parseInt
(
timeParts
[
1
]));
// 月份部分
ParmDataModel
parmDataModel
=
new
ParmDataModel
();
ParmDataModel
parmDataModel
=
new
ParmDataModel
();
parmDataModel
.
setPeriod
(
lastMonth
);
parmDataModel
.
setPeriod
(
lastMonth
);
String
period
=
parmDataModel
.
getPeriod
();
String
period
=
parmDataModel
.
getPeriod
();
...
@@ -88,6 +91,8 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -88,6 +91,8 @@ public class GroupSyncServiceimpl implements GroupSyncService {
}
}
}
}
// 单边抵消c3特殊处理
// 单边抵消c3特殊处理
Map
<
String
,
String
>
C3_02_value
=
new
HashMap
<>();
Map
<
String
,
String
>
C3_02_value
=
new
HashMap
<>();
C3_02_value
.
put
(
"Inc99"
,
"Dec99"
);
C3_02_value
.
put
(
"Inc99"
,
"Dec99"
);
...
@@ -231,17 +236,17 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -231,17 +236,17 @@ public class GroupSyncServiceimpl implements GroupSyncService {
dataSyncList
.
addAll
(
list02
);
dataSyncList
.
addAll
(
list02
);
if
(
isReverse
)
{
if
(
isReverse
)
{
// 反向处理:money = money01 - money02
// 反向处理:money = money01 - money02
addSyncModel
(
dataSyncList
,
plugAccount
,
c1
,
destC2
,
entityCode
,
icpCode
,
money01
-
money02
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
c1
,
destC2
,
entityCode
,
icpCode
,
money01
-
money02
);
// 如果 money01 == 0,添加第二个模型
// 如果 money01 == 0,添加第二个模型
if
(
money01
==
0
)
{
if
(
money01
==
0
)
{
addSyncModel
(
dataSyncList
,
plugAccount
,
c1
,
destC2
,
icpCode
,
entityCode
,
money01
-
money02
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
c1
,
destC2
,
icpCode
,
entityCode
,
money01
-
money02
);
}
}
}
else
{
}
else
{
// 正向处理:money = money02 - money01
// 正向处理:money = money02 - money01
addSyncModel
(
dataSyncList
,
plugAccount
,
c1
,
destC2
,
entityCode
,
icpCode
,
money02
-
money01
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
c1
,
destC2
,
entityCode
,
icpCode
,
money02
-
money01
);
// 如果 money01 == 0,添加第二个模型
// 如果 money01 == 0,添加第二个模型
if
(
money01
==
0
)
{
if
(
money01
==
0
)
{
addSyncModel
(
dataSyncList
,
plugAccount
,
c1
,
destC2
,
icpCode
,
entityCode
,
money02
-
money01
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
c1
,
destC2
,
icpCode
,
entityCode
,
money02
-
money01
);
}
}
}
}
}
}
...
@@ -253,17 +258,17 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -253,17 +258,17 @@ public class GroupSyncServiceimpl implements GroupSyncService {
dataSyncList
.
addAll
(
filteredList02
);
dataSyncList
.
addAll
(
filteredList02
);
if
(
isReverse
)
{
if
(
isReverse
)
{
// 反向处理:money = money01 - money02
// 反向处理:money = money01 - money02
addSyncModel
(
dataSyncList
,
plugAccount
,
destC1
,
destC2
,
entityCode
,
icpCode
,
money01
-
money02
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
destC1
,
destC2
,
entityCode
,
icpCode
,
money01
-
money02
);
// 如果 money01 == 0,添加第二个模型
// 如果 money01 == 0,添加第二个模型
if
(
money01
==
0
)
{
if
(
money01
==
0
)
{
addSyncModel
(
dataSyncList
,
plugAccount
,
destC1
,
destC2
,
icpCode
,
entityCode
,
money01
-
money02
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
destC1
,
destC2
,
icpCode
,
entityCode
,
money01
-
money02
);
}
}
}
else
{
}
else
{
// 正向处理:money = money02 - money01
// 正向处理:money = money02 - money01
addSyncModel
(
dataSyncList
,
plugAccount
,
destC1
,
destC2
,
entityCode
,
icpCode
,
money02
-
money01
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
destC1
,
destC2
,
entityCode
,
icpCode
,
money02
-
money01
);
// 如果 money01 == 0,添加第二个模型
// 如果 money01 == 0,添加第二个模型
if
(
money01
==
0
)
{
if
(
money01
==
0
)
{
addSyncModel
(
dataSyncList
,
plugAccount
,
destC1
,
destC2
,
icpCode
,
entityCode
,
money02
-
money01
);
addSyncModel
(
dataSyncList
,
plugAccount
,
year
,
month
,
destC1
,
destC2
,
icpCode
,
entityCode
,
money02
-
money01
);
}
}
}
}
}
}
...
@@ -340,6 +345,14 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -340,6 +345,14 @@ public class GroupSyncServiceimpl implements GroupSyncService {
// 单边抵消方法处理同步数据
// 单边抵消方法处理同步数据
private
List
<
GroupDataSyncModel
>
processSyncModel
(
GroupDataSyncModel
model
,
List
<
String
>
singlePlug01
,
List
<
String
>
singlePlug02
,
private
List
<
GroupDataSyncModel
>
processSyncModel
(
GroupDataSyncModel
model
,
List
<
String
>
singlePlug01
,
List
<
String
>
singlePlug02
,
String
c3Value
,
String
entity
,
String
entityName
)
{
String
c3Value
,
String
entity
,
String
entityName
)
{
//获取科目名称
List
<
AccountNameModel
>
accountNameList
=
queryMasterMapper
.
queryAccountName
();
Map
<
String
,
String
>
accountNameMap
=
new
HashMap
<>();
for
(
AccountNameModel
accountNameModel
:
accountNameList
)
{
accountNameMap
.
put
(
accountNameModel
.
getCode
(),
accountNameModel
.
getName
());
}
accountNameMap
.
put
(
"NB2221028"
,
"各单位上交增值税"
);
accountNameMap
.
put
(
"NB41040102"
,
"调整年初未分配利润"
);
List
<
GroupDataSyncModel
>
dataSyncList
=
new
ArrayList
<>();
List
<
GroupDataSyncModel
>
dataSyncList
=
new
ArrayList
<>();
// 获取对应的 account02
// 获取对应的 account02
int
index
=
singlePlug01
.
indexOf
(
model
.
getAccount
());
int
index
=
singlePlug01
.
indexOf
(
model
.
getAccount
());
...
@@ -348,7 +361,7 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -348,7 +361,7 @@ public class GroupSyncServiceimpl implements GroupSyncService {
GroupDataSyncModel
syncModel
=
new
GroupDataSyncModel
();
GroupDataSyncModel
syncModel
=
new
GroupDataSyncModel
();
BeanUtils
.
copyProperties
(
model
,
syncModel
);
BeanUtils
.
copyProperties
(
model
,
syncModel
);
syncModel
.
setAccount
(
account02Value
);
syncModel
.
setAccount
(
account02Value
);
syncModel
.
setAccountname
(
null
);
syncModel
.
setAccountname
(
accountNameMap
.
get
(
account02Value
)
);
// 如果 c3 有值,进行设置
// 如果 c3 有值,进行设置
if
(
c3Value
!=
null
)
{
if
(
c3Value
!=
null
)
{
syncModel
.
setC3
(
c3Value
);
syncModel
.
setC3
(
c3Value
);
...
@@ -453,10 +466,12 @@ public class GroupSyncServiceimpl implements GroupSyncService {
...
@@ -453,10 +466,12 @@ public class GroupSyncServiceimpl implements GroupSyncService {
}
}
}
}
private
void
addSyncModel
(
List
<
GroupDataSyncModel
>
dataSyncList
,
String
plugAccount
,
private
void
addSyncModel
(
List
<
GroupDataSyncModel
>
dataSyncList
,
String
plugAccount
,
String
year
,
String
month
,
String
destC1
,
String
destC2
,
String
entityCode
,
String
destC1
,
String
destC2
,
String
entityCode
,
String
icpCode
,
double
money
)
{
String
icpCode
,
double
money
)
{
GroupDataSyncModel
syncModel
=
new
GroupDataSyncModel
();
GroupDataSyncModel
syncModel
=
new
GroupDataSyncModel
();
syncModel
.
setYear
(
year
);
syncModel
.
setMonth
(
month
);
syncModel
.
setAccount
(
plugAccount
);
syncModel
.
setAccount
(
plugAccount
);
syncModel
.
setICP
(
"[ICP_None]"
);
syncModel
.
setICP
(
"[ICP_None]"
);
syncModel
.
setC1
(
destC1
);
syncModel
.
setC1
(
destC1
);
...
...
src/main/resources/mapper/FallGroupSlaveMapper.xml
View file @
812fc881
...
@@ -12,10 +12,10 @@
...
@@ -12,10 +12,10 @@
<insert
id=
"addAll"
>
<insert
id=
"addAll"
>
INSERT INTO elim
INSERT INTO elim
( `year`, `month`, entitycode, entityname, accountcode, icpcode,icpname, orivalue,c1,c2,c3,c4,ytenant_id)
( `year`, `month`, entitycode, entityname, accountcode,
accountname,
icpcode,icpname, orivalue,c1,c2,c3,c4,ytenant_id)
VALUES
VALUES
<foreach
collection=
"groupFallDataModelList"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"groupFallDataModelList"
item=
"item"
index=
"index"
separator=
","
>
(#{item.year},#{item.month},#{item.entitycode},#{item.entityname},#{item.accountcode},#{item.icpcode},#{item.icpname},#{item.orivalue},
(#{item.year},#{item.month},#{item.entitycode},#{item.entityname},#{item.accountcode},#{item.
accountname},#{item.
icpcode},#{item.icpname},#{item.orivalue},
#{item.c1},#{item.c2},#{item.c3},#{item.c4},#{item.ytenantId})
#{item.c1},#{item.c2},#{item.c3},#{item.c4},#{item.ytenantId})
</foreach>
</foreach>
</insert>
</insert>
...
...
src/main/resources/mapper/ResidualValueMapper.xml
View file @
812fc881
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
accbook.name as entityname,
accbook.name as entityname,
account_t,
account_t,
case when account_t like 'CF%' then cash.name
case when account_t like 'CF%' then cash.name
else accsubject.name
else accsubject.
display
name
end accountname,
end accountname,
icp_t,
icp_t,
accbook2.name as icpname,
accbook2.name as icpname,
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
accbook.name as entityname,
accbook.name as entityname,
account_t,
account_t,
case when account_t like 'CF%' then cash.name
case when account_t like 'CF%' then cash.name
else accsubject.name
else accsubject.
display
name
end accountname,
end accountname,
icp_t,
icp_t,
accbook2.name as icpname,
accbook2.name as icpname,
...
@@ -208,4 +208,13 @@
...
@@ -208,4 +208,13 @@
</foreach>
</foreach>
</select>
</select>
<select
id=
"queryAccountName"
resultType=
"com.tianyi.sync.model.AccountNameModel"
>
select
code,displayname
from
fiepub.epub_accsubject
where
accsubjectchart = '1749640561330487304'
</select>
</mapper>
</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