Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
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
位宇华
klck
Commits
5a86b79f
Commit
5a86b79f
authored
Mar 29, 2024
by
Fuzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实体类
parent
69eae076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
205 additions
and
222 deletions
+205
-222
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
...ystem/service/impl/ActSuppliesHistorydataServiceImpl.java
+205
-222
No files found.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
View file @
5a86b79f
...
@@ -21,15 +21,14 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -21,15 +21,14 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
*
历史数据Service业务层处理
* 历史数据Service业务层处理
*
*
* @author dongjg
* @author dongjg
* @date 2023-08-01
* @date 2023-08-01
*/
*/
@Service
@Service
@EnableTransactionManagement
@EnableTransactionManagement
public
class
ActSuppliesHistorydataServiceImpl
implements
IActSuppliesHistorydataService
public
class
ActSuppliesHistorydataServiceImpl
implements
IActSuppliesHistorydataService
{
{
@Autowired
@Autowired
private
ActSuppliesHistorydataMapper
actSuppliesHistorydataMapper
;
private
ActSuppliesHistorydataMapper
actSuppliesHistorydataMapper
;
...
@@ -42,12 +41,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -42,12 +41,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
/**
/**
* 查询 历史数据
* 查询 历史数据
*
*
* @param id
历史数据ID
* @param id 历史数据ID
* @return
历史数据
* @return 历史数据
*/
*/
@Override
@Override
public
ActSuppliesHistorydata
selectActSuppliesHistorydataById
(
Long
id
)
public
ActSuppliesHistorydata
selectActSuppliesHistorydataById
(
Long
id
)
{
{
//return actSuppliesHistorydataMapper.selectActSuppliesHistorydataById(id);
//return actSuppliesHistorydataMapper.selectActSuppliesHistorydataById(id);
return
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydataCopyById
(
id
);
return
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydataCopyById
(
id
);
...
@@ -56,12 +54,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -56,12 +54,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
/**
/**
* 查询 历史数据列表
* 查询 历史数据列表
*
*
* @param actSuppliesHistorydata
历史数据
* @param actSuppliesHistorydata 历史数据
* @return
历史数据
* @return 历史数据
*/
*/
@Override
@Override
public
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataList
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataList
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
{
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
actSuppliesHistorydata
.
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
setCreateBy
(
user
.
getUserName
());
//return actSuppliesHistorydataMapper.selectActSuppliesHistorydataList(actSuppliesHistorydata);
//return actSuppliesHistorydataMapper.selectActSuppliesHistorydataList(actSuppliesHistorydata);
...
@@ -72,14 +69,13 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -72,14 +69,13 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
/**
/**
* 新增 历史数据
* 新增 历史数据
*
*
* @param actSuppliesHistorydata
历史数据
* @param actSuppliesHistorydata 历史数据
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
{
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
Long
status
=
actSuppliesHistorydata
.
get
(
i
).
getStatus
();
Long
status
=
actSuppliesHistorydata
.
get
(
i
).
getStatus
();
...
@@ -90,12 +86,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -90,12 +86,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
/**
/**
* 修改 历史数据
* 修改 历史数据
*
*
* @param actSuppliesHistorydata
历史数据
* @param actSuppliesHistorydata 历史数据
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updateActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
int
updateActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
{
{
return
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydata
(
actSuppliesHistorydata
);
return
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydata
(
actSuppliesHistorydata
);
}
}
...
@@ -106,26 +101,25 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -106,26 +101,25 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteActSuppliesHistorydataByIds
(
Long
[]
ids
)
public
int
deleteActSuppliesHistorydataByIds
(
Long
[]
ids
)
{
{
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataByIds
(
ids
);
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataByIds
(
ids
);
}
}
/**
/**
* 删除 历史数据信息
* 删除 历史数据信息
*
*
* @param id
历史数据ID
* @param id 历史数据ID
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteActSuppliesHistorydataById
(
Long
id
)
public
int
deleteActSuppliesHistorydataById
(
Long
id
)
{
{
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataById
(
id
);
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataById
(
id
);
}
}
/**
/**
* 新增 历史数据信息
* 新增 历史数据信息
*
*
* @param actSuppliesHistorydata
历史数据ID
* @param actSuppliesHistorydata 历史数据ID
* @return 结果
* @return 结果
*/
*/
@Override
@Override
...
@@ -136,33 +130,33 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -136,33 +130,33 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
List
<
ActSuppliesHistorydata
>
s
=
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydatauuid
(
actSuppliesHistorydata
.
get
(
0
));
List
<
ActSuppliesHistorydata
>
s
=
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydatauuid
(
actSuppliesHistorydata
.
get
(
0
));
if
(
s
.
size
()
>
0
)
{
if
(
s
.
size
()
>
0
)
{
//如果存在相同时间和所属矿的表
//如果存在相同时间和所属矿的表
if
(
s
.
get
(
0
).
getCleanStatus
()
>
0
)
{
if
(
s
.
get
(
0
).
getCleanStatus
()
>
0
)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
0
)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
0
)
{
//删除导入表数据
//删除导入表数据
actSuppliesCleaningRuleMapper
.
deleteActSuppliesImportTable
(
s
.
get
(
j
).
getId
());
actSuppliesCleaningRuleMapper
.
deleteActSuppliesImportTable
(
s
.
get
(
j
).
getId
());
actSuppliesCleaningRuleMapper
.
deleteActSuppliesImportCleaning
(
s
.
get
(
j
).
getId
());
actSuppliesCleaningRuleMapper
.
deleteActSuppliesImportCleaning
(
s
.
get
(
j
).
getId
());
}
else
if
(
s
.
get
(
j
).
getIdentifyingCode
()==
1
)
{
}
else
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
1
)
{
//删除生成表数据
//删除生成表数据
actSuppliesCleaningRuleMapper
.
deleteActSuppliesSixMinesSummaryTable
(
s
.
get
(
j
).
getId
());
actSuppliesCleaningRuleMapper
.
deleteActSuppliesSixMinesSummaryTable
(
s
.
get
(
j
).
getId
());
}
}
}
}
}
}
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
0
)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
0
)
{
actSuppliesHistorydata
.
get
(
i
).
setImportUuid
(
s
.
get
(
j
).
getImportUuid
());
actSuppliesHistorydata
.
get
(
i
).
setImportUuid
(
s
.
get
(
j
).
getImportUuid
());
}
}
}
}
}
}
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
1
)
{
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
1
)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
s
.
size
();
j
++)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
1
)
{
if
(
s
.
get
(
j
).
getIdentifyingCode
()
==
1
)
{
actSuppliesHistorydata
.
get
(
i
).
setImportUuid
(
s
.
get
(
j
).
getImportUuid
());
actSuppliesHistorydata
.
get
(
i
).
setImportUuid
(
s
.
get
(
j
).
getImportUuid
());
}
}
}
}
...
@@ -174,13 +168,13 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -174,13 +168,13 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesHistorydataMapper
.
updateActSUppliesHistoryContent
(
actSuppliesHistorydata
.
get
(
i
));
actSuppliesHistorydataMapper
.
updateActSUppliesHistoryContent
(
actSuppliesHistorydata
.
get
(
i
));
}
}
}
else
{
}
else
{
//如果没有重复数据直接新增导入表和生成表
//如果没有重复数据直接新增导入表和生成表
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
UUID
uuid
=
UUID
.
randomUUID
();
UUID
uuid
=
UUID
.
randomUUID
();
String
uuids
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
String
uuids
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
actSuppliesHistorydata1
.
setImportUuid
(
uuids
);
actSuppliesHistorydata1
.
setImportUuid
(
uuids
);
...
@@ -190,7 +184,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -190,7 +184,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesHistorydataMapper
.
insertActSuppliesHistorycontent
(
actSuppliesHistorydata1
);
actSuppliesHistorydataMapper
.
insertActSuppliesHistorycontent
(
actSuppliesHistorydata1
);
}
else
{
}
else
{
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
actSuppliesHistorydata1
.
setImportUuid
(
uuids
);
actSuppliesHistorydata1
.
setImportUuid
(
uuids
);
actSuppliesHistorydata1
.
setStatus
(
0L
);
actSuppliesHistorydata1
.
setStatus
(
0L
);
...
@@ -203,7 +197,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -203,7 +197,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
actSuppliesHistorydata
.
get
(
i
).
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
get
(
i
).
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
get
(
i
).
setCreateTime
(
DateUtils
.
getNowDate
());
actSuppliesHistorydata
.
get
(
i
).
setCreateTime
(
DateUtils
.
getNowDate
());
...
@@ -240,11 +234,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -240,11 +234,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
@Transactional
@Transactional
public
void
addInsertImport
(
List
<
ActOperation1
>
actOperation2s
)
{
public
void
addInsertImport
(
List
<
ActOperation1
>
actOperation2s
)
{
//创建新线程
//创建新线程
Thread
thread
=
new
Thread
(){
Thread
thread
=
new
Thread
()
{
public
void
run
(){
public
void
run
()
{
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
//获取生成excel表数据存储到生成表实体类中
//获取生成excel表数据存储到生成表实体类中
for
(
int
x
=
2
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
for
(
int
x
=
2
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
...
@@ -318,7 +312,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -318,7 +312,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//int k=(int)parse.getJSONObject(0).get("HeaderRow");
//int k=(int)parse.getJSONObject(0).get("HeaderRow");
//获取导入excel表数据存储到生成表实体类中
//获取导入excel表数据存储到生成表实体类中
JSONArray
parse1
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getHistoryRole
());
JSONArray
parse1
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getHistoryRole
());
for
(
int
x
=
(
int
)
parse1
.
getJSONObject
(
0
).
get
(
"HeaderRow"
);
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
for
(
int
x
=
(
int
)
parse1
.
getJSONObject
(
0
).
get
(
"HeaderRow"
);
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
//判断数据是否为空,为空结束循环
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
ActSuppliesImportCleaning
actSuppliesImportCleaning
=
new
ActSuppliesImportCleaning
();
ActSuppliesImportCleaning
actSuppliesImportCleaning
=
new
ActSuppliesImportCleaning
();
...
@@ -337,23 +331,23 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -337,23 +331,23 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//long count = Arrays.stream(actOperation2s.get(i).getActOperation2()[x]).filter(Objects::nonNull).count();
//long count = Arrays.stream(actOperation2s.get(i).getActOperation2()[x]).filter(Objects::nonNull).count();
//循环保存到实体类字段中
//循环保存到实体类字段中
JSONArray
parse
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getHistoryRole
());
JSONArray
parse
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getHistoryRole
());
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
()
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
()
!=
null
)
{
//[{"HeaderRow": 1, "CodeColumn": 6, "DateColumn": 5, "NameColumn": 7, "MoneyColumn": 12, "NumberColumn": 11, "DepartmentColumn": 2}]
//[{"HeaderRow": 1, "CodeColumn": 6, "DateColumn": 5, "NameColumn": 7, "MoneyColumn": 12, "NumberColumn": 11, "DepartmentColumn": 2}]
actSuppliesImportCleaning
.
setNameColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NameColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setNameColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NameColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setCodeColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setCodeColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setDepartmentColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DepartmentColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setDepartmentColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DepartmentColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
());
Object
dateColumn
=
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
);
Object
dateColumn
=
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
);
if
(
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
).
hashCode
()>
0
){
if
(
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
).
hashCode
()
>
0
)
{
actSuppliesImportCleaning
.
setDateColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaning
.
setDateColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
)
-
1
)].
getV
());
}
//actSuppliesImportCleaning.setDateColumn(actOperation2s.get(i).getActOperation2()[x][JSON.parseObject(actOperation2s.get(i).getHistoryRole()).getInteger("DateColumn")].getV());
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaning
(
actSuppliesImportCleaning
);
}
}
//actSuppliesImportCleaning.setDateColumn(actOperation2s.get(i).getActOperation2()[x][JSON.parseObject(actOperation2s.get(i).getHistoryRole()).getInteger("DateColumn")].getV());
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaning
(
actSuppliesImportCleaning
);
}
}
}
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -407,9 +401,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -407,9 +401,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
String
[]
attributes
=
new
String
[
200
];
String
[]
attributes
=
new
String
[
200
];
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
attributes
[
i
-
1
]=
'A'
+
String
.
valueOf
(
i
);
attributes
[
i
-
1
]
=
'A'
+
String
.
valueOf
(
i
);
}
}
...
@@ -417,7 +411,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -417,7 +411,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//获取导入excel表数据存储到生成表实体类中
//获取导入excel表数据存储到生成表实体类中
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
//判断数据是否为空,为空结束循环
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
UUID
uuid
=
UUID
.
randomUUID
();
UUID
uuid
=
UUID
.
randomUUID
();
...
@@ -432,7 +426,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -432,7 +426,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//循环保存到实体类字段中
//循环保存到实体类字段中
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
try
{
try
{
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
...
@@ -447,7 +441,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -447,7 +441,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
//新增一条生成表数据
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addActSuppliesImportTable
(
actSuppliesImportTable
);
actSuppliesCleaningRuleMapper
.
addActSuppliesImportTable
(
actSuppliesImportTable
);
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -482,9 +476,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -482,9 +476,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
String
[]
attributes
=
new
String
[
200
];
String
[]
attributes
=
new
String
[
200
];
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
attributes
[
i
-
1
]=
'A'
+
String
.
valueOf
(
i
);
attributes
[
i
-
1
]
=
'A'
+
String
.
valueOf
(
i
);
}
}
...
@@ -492,7 +486,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -492,7 +486,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//获取导入excel表数据存储到生成表实体类中
//获取导入excel表数据存储到生成表实体类中
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
//判断数据是否为空,为空结束循环
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
UUID
uuid
=
UUID
.
randomUUID
();
UUID
uuid
=
UUID
.
randomUUID
();
...
@@ -507,7 +501,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -507,7 +501,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//循环保存到实体类字段中
//循环保存到实体类字段中
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
try
{
try
{
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
...
@@ -521,7 +515,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -521,7 +515,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
//新增一条生成表数据
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addInsertConvert1
(
actSuppliesImportTable
);
actSuppliesCleaningRuleMapper
.
addInsertConvert1
(
actSuppliesImportTable
);
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -550,13 +544,12 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -550,13 +544,12 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
public
void
run
()
{
public
void
run
()
{
//String[] attributes = {"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "A16", "A17", "A18", "A19", "A20", "A21", "A22", "A23", "A24", "A25", "A26", "A27", "A28", "A29", "A30", "A31", "A32", "A33", "A34", "A35", "A36", "A37", "A38", "A39", "A40", "A41", "A42", "A43", "A44", "A45", "A46", "A47", "A48", "A49", "A50", "A51", "A52", "A53", "A54", "A55", "A56", "A57", "A58", "A59", "A60", "A61", "A62", "A63"};
String
[]
attributes
=
new
String
[
200
];
String
[]
attributes
=
new
String
[
200
];
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
attributes
[
i
-
1
]=
'A'
+
String
.
valueOf
(
i
);
attributes
[
i
-
1
]
=
'A'
+
String
.
valueOf
(
i
);
}
}
...
@@ -564,7 +557,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -564,7 +557,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//获取导入excel表数据存储到生成表实体类中
//获取导入excel表数据存储到生成表实体类中
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
//判断数据是否为空,为空结束循环
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
UUID
uuid
=
UUID
.
randomUUID
();
UUID
uuid
=
UUID
.
randomUUID
();
...
@@ -579,7 +572,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -579,7 +572,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
//循环保存到实体类字段中
//循环保存到实体类字段中
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
try
{
try
{
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
...
@@ -593,7 +586,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -593,7 +586,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
//新增一条生成表数据
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addInsertConvert2
(
actSuppliesImportTable
);
actSuppliesCleaningRuleMapper
.
addInsertConvert2
(
actSuppliesImportTable
);
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -614,7 +607,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -614,7 +607,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
public
void
addInsertImportAccpunt
(
List
<
ActOperation1
>
actOperation2s
)
{
public
void
addInsertImportAccpunt
(
List
<
ActOperation1
>
actOperation2s
)
{
}
}
...
@@ -632,185 +624,178 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -632,185 +624,178 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
// });
// });
// Thread thread = new Thread() {
// Thread thread = new Thread() {
//
//
// public void run() {
// public void run() {
//String[] attributes = {"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "A16", "A17", "A18", "A19", "A20", "A21", "A22", "A23", "A24", "A25", "A26", "A27", "A28", "A29", "A30", "A31", "A32", "A33", "A34", "A35", "A36", "A37", "A38", "A39", "A40", "A41", "A42", "A43", "A44", "A45", "A46", "A47", "A48", "A49", "A50", "A51", "A52", "A53", "A54", "A55", "A56", "A57", "A58", "A59", "A60", "A61", "A62", "A63"};
//String[] attributes = {"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "A16", "A17", "A18", "A19", "A20", "A21", "A22", "A23", "A24", "A25", "A26", "A27", "A28", "A29", "A30", "A31", "A32", "A33", "A34", "A35", "A36", "A37", "A38", "A39", "A40", "A41", "A42", "A43", "A44", "A45", "A46", "A47", "A48", "A49", "A50", "A51", "A52", "A53", "A54", "A55", "A56", "A57", "A58", "A59", "A60", "A61", "A62", "A63"};
String
[]
attributes
=
new
String
[
200
];
for
(
int
i
=
1
;
i
<=
200
;
i
++){
attributes
[
i
-
1
]=
'A'
+
String
.
valueOf
(
i
)
;
String
[]
attributes
=
new
String
[
200
]
;
}
for
(
int
i
=
1
;
i
<=
200
;
i
++)
{
//获取物料明细编码与32类编码对应关系
ActSuppliesDetails
actSuppliesDetails
=
new
ActSuppliesDetails
();
List
<
ActSuppliesDetails
>
actSuppliesDetails1
=
actSuppliesDetailsMapper
.
selectActSuppliesDetailsMaterialList
(
actSuppliesDetails
);
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
attributes
[
i
-
1
]
=
'A'
+
String
.
valueOf
(
i
);
Gson
gson
=
new
Gson
();
}
JSONArray
parse
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getConvenRole
());
Map
<
String
,
String
>[]
mapArray
=
gson
.
fromJson
(
actOperation2s
.
get
(
i
).
getHistoryRole
(),
Map
[].
class
);
Map
<
String
,
String
[]>
mapcode
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
map
:
mapArray
)
{
String
key
=
map
.
get
(
"key"
);
//获取物料明细编码与32类编码对应关系
String
value
=
map
.
get
(
"value"
);
ActSuppliesDetails
actSuppliesDetails
=
new
ActSuppliesDetails
();
String
[]
values
=
value
.
split
(
","
);
List
<
ActSuppliesDetails
>
actSuppliesDetails1
=
actSuppliesDetailsMapper
.
selectActSuppliesDetailsMaterialList
(
actSuppliesDetails
);
mapcode
.
put
(
key
,
values
);
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
Gson
gson
=
new
Gson
();
JSONArray
parse
=
(
JSONArray
)
JSONArray
.
parse
(
actOperation2s
.
get
(
i
).
getConvenRole
());
Map
<
String
,
String
>[]
mapArray
=
gson
.
fromJson
(
actOperation2s
.
get
(
i
).
getHistoryRole
(),
Map
[].
class
);
Map
<
String
,
String
[]>
mapcode
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
map
:
mapArray
)
{
String
key
=
map
.
get
(
"key"
);
String
value
=
map
.
get
(
"value"
);
String
[]
values
=
value
.
split
(
","
);
mapcode
.
put
(
key
,
values
);
}
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
for
(
ActSuppliesDetails
entity
:
actSuppliesDetails1
)
{
resultMap
.
put
(
entity
.
getCode
(),
entity
.
getCodes
());
}
List
<
ActSuppliesImportCleaningAcc
>
actSuppliesImportCleaningAccs
=
new
ArrayList
<>();
//获取导入excel表数据存储到生成表实体类中
for
(
int
x
=
((
int
)
parse
.
getJSONObject
(
0
).
get
(
"HeaderRow"
)
-
1
);
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
String
[]
s1
=
mapcode
.
get
(
String
.
valueOf
(
x
));
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]
!=
null
)
{
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
ActSuppliesImportCleaningAcc
actSuppliesImportCleaningAcc
=
new
ActSuppliesImportCleaningAcc
();
UUID
uuid
=
UUID
.
randomUUID
();
String
s
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
if
(
s1
!=
null
)
{
actSuppliesImportTable
.
setKmCode
(
s1
[
0
]);
}
}
actSuppliesImportTable
.
setId
(
s
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
actSuppliesImportTable
.
sethId
(
actOperation2s
.
get
(
i
).
gethId
());
for
(
ActSuppliesDetails
entity
:
actSuppliesDetails1
)
{
actSuppliesImportTable
.
sethDate
(
actOperation2s
.
get
(
i
).
gethDate
());
resultMap
.
put
(
entity
.
getCode
(),
entity
.
getCodes
());
actSuppliesImportTable
.
setMining
(
actOperation2s
.
get
(
i
).
getMining
());
actSuppliesImportTable
.
setExportUuid
(
actOperation2s
.
get
(
i
).
getExportUuid
());
if
(
s1
!=
null
)
{
actSuppliesImportCleaningAcc
.
setKmCode
(
s1
[
0
]);
actSuppliesImportCleaningAcc
.
setsOfExpenses
(
s1
[
1
]);
}
}
List
<
ActSuppliesImportCleaningAcc
>
actSuppliesImportCleaningAccs
=
new
ArrayList
<>();
actSuppliesImportCleaningAcc
.
setId
(
s
);
//获取导入excel表数据存储到生成表实体类中
actSuppliesImportCleaningAcc
.
sethId
(
actOperation2s
.
get
(
i
).
gethId
());
for
(
int
x
=
((
int
)
parse
.
getJSONObject
(
0
).
get
(
"HeaderRow"
)
-
1
);
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
actSuppliesImportCleaningAcc
.
setHdate
(
actOperation2s
.
get
(
i
).
gethDate
());
//判断数据是否为空,为空结束循环
actSuppliesImportCleaningAcc
.
setSskId
(
actOperation2s
.
get
(
i
).
getMining
());
actSuppliesImportCleaningAcc
.
setYyUuid
(
actOperation2s
.
get
(
i
).
getExportUuid
());
String
[]
s1
=
mapcode
.
get
(
String
.
valueOf
(
x
));
//获取数组x行的真实非空长度
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]!=
null
){
List
<
Object
>
actOperation2s1
=
Arrays
.
asList
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]);
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
long
count
=
Arrays
.
stream
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]).
filter
(
Objects:
:
nonNull
).
count
();
ActSuppliesImportCleaningAcc
actSuppliesImportCleaningAcc
=
new
ActSuppliesImportCleaningAcc
();
//循环保存到实体类字段中
UUID
uuid
=
UUID
.
randomUUID
();
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
String
s
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]
!=
null
)
{
if
(
s1
!=
null
){
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
actSuppliesImportTable
.
setKmCode
(
s1
[
0
]);
try
{
}
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
actSuppliesImportTable
.
setId
(
s
);
}
catch
(
Exception
e
)
{
actSuppliesImportTable
.
sethId
(
actOperation2s
.
get
(
i
).
gethId
());
e
.
printStackTrace
();
actSuppliesImportTable
.
sethDate
(
actOperation2s
.
get
(
i
).
gethDate
());
actSuppliesImportTable
.
setMining
(
actOperation2s
.
get
(
i
).
getMining
());
actSuppliesImportTable
.
setExportUuid
(
actOperation2s
.
get
(
i
).
getExportUuid
());
if
(
s1
!=
null
)
{
actSuppliesImportCleaningAcc
.
setKmCode
(
s1
[
0
]);
actSuppliesImportCleaningAcc
.
setsOfExpenses
(
s1
[
1
]);
}
actSuppliesImportCleaningAcc
.
setId
(
s
);
actSuppliesImportCleaningAcc
.
sethId
(
actOperation2s
.
get
(
i
).
gethId
());
actSuppliesImportCleaningAcc
.
setHdate
(
actOperation2s
.
get
(
i
).
gethDate
());
actSuppliesImportCleaningAcc
.
setSskId
(
actOperation2s
.
get
(
i
).
getMining
());
actSuppliesImportCleaningAcc
.
setYyUuid
(
actOperation2s
.
get
(
i
).
getExportUuid
());
//获取数组x行的真实非空长度
List
<
Object
>
actOperation2s1
=
Arrays
.
asList
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]);
long
count
=
Arrays
.
stream
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]).
filter
(
Objects:
:
nonNull
).
count
();
//循环保存到实体类字段中
for
(
int
y
=
0
;
y
<
count
;
y
++)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
]!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
()
!=
null
)
{
try
{
actSuppliesImportTable
.
getClass
().
getMethod
(
"set"
+
attributes
[
y
],
String
.
class
).
invoke
(
actSuppliesImportTable
,
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
y
].
getV
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
}
//新增一条生成表数据(全部)
}
//actSuppliesCleaningRuleMapper.addInsertConvertAcc(actSuppliesImportTable);
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
!=
null
)
{
//新增一条生成表数据(全部)
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
()
!=
null
)
{
//actSuppliesCleaningRuleMapper.addInsertConvertAcc(actSuppliesImportTable);
//[{"HeaderRow": 1, "CodeColumn": 6, "DateColumn": 5, "NameColumn": 7, "MoneyColumn": 12, "NumberColumn": 11, "DepartmentColumn": 2}]
actSuppliesImportCleaningAcc
.
setNameColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NameColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaningAcc
.
setCodeColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaningAcc
.
setDepartmentColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DepartmentColumn"
)
-
1
)].
getV
());
if
(
actOperation2s
.
get
(
i
).
getMining
().
equals
(
"011702"
)){
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
!=
null
)
{
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
()
!=
null
)
{
//[{"HeaderRow": 1, "CodeColumn": 6, "DateColumn": 5, "NameColumn": 7, "MoneyColumn": 12, "NumberColumn": 11, "DepartmentColumn": 2}]
actSuppliesImportCleaningAcc
.
setNameColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NameColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaningAcc
.
setCodeColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaningAcc
.
setDepartmentColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DepartmentColumn"
)
-
1
)].
getV
());
int
moneycolumn
=
(
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
;
if
(
actOperation2s
.
get
(
i
).
getMining
().
equals
(
"011702"
))
{
int
numbercolumn
=
(
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
;
while
(
true
)
{
int
moneycolumn
=
(
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
;
int
numbercolumn
=
(
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
;
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
]
!=
null
&&
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
()
!=
null
)
{
while
(
true
)
{
actSuppliesImportCleaningAcc
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
numbercolumn
].
getV
());
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
]
!=
null
&&
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
()
!=
null
)
{
actSuppliesImportCleaningAcc
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
());
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
actSuppliesImportCleaningAcc
.
setMoneyColumns
(
df
.
format
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
())
*
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
numbercolumn
].
getV
())));
break
;
}
else
{
moneycolumn
=
moneycolumn
+
5
;
numbercolumn
=
numbercolumn
+
5
;
if
(
moneycolumn
>
count
){
break
;
}
}
actSuppliesImportCleaningAcc
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
numbercolumn
].
getV
());
actSuppliesImportCleaningAcc
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
());
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
actSuppliesImportCleaningAcc
.
setMoneyColumns
(
df
.
format
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
moneycolumn
].
getV
())
*
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][
numbercolumn
].
getV
())));
break
;
}
else
{
moneycolumn
=
moneycolumn
+
5
;
numbercolumn
=
numbercolumn
+
5
;
if
(
moneycolumn
>
count
)
{
break
;
}
}
}
}
else
{
}
actSuppliesImportCleaningAcc
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
());
}
else
{
actSuppliesImportCleaningAcc
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
());
BigDecimal
moneyColumn1
=
new
BigDecimal
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
()));
BigDecimal
moneyColumn2
=
new
BigDecimal
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
()));
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
actSuppliesImportCleaningAcc
.
setMoneyColumns
(
df
.
format
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
())*
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
())));
}
actSuppliesImportCleaningAcc
.
setNumberColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
());
actSuppliesImportCleaningAcc
.
setMoneyColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
());
BigDecimal
moneyColumn1
=
new
BigDecimal
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
()));
BigDecimal
moneyColumn2
=
new
BigDecimal
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
()));
DecimalFormat
df
=
new
DecimalFormat
(
"#.00"
);
actSuppliesImportCleaningAcc
.
setMoneyColumns
(
df
.
format
(
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"MoneyColumn"
)
-
1
)].
getV
())
*
Double
.
parseDouble
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"NumberColumn"
)
-
1
)].
getV
())));
Object
dateColumn
=
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
);
}
if
(
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
).
hashCode
()>
0
){
actSuppliesImportCleaningAcc
.
setDateColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
)
-
1
)].
getV
());
}
String
codeColumn
=
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
();
Object
dateColumn
=
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
);
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
6
))){
if
(
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
).
hashCode
()
>
0
)
{
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
6
)));
actSuppliesImportCleaningAcc
.
setDateColumn
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"DateColumn"
)
-
1
)].
getV
());
}
else
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
4
))){
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
4
)));
}
else
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
2
))){
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
2
)));
}
else
{
actSuppliesImportCleaningAcc
.
setCategories
(
"10"
);
}
//actSuppliesImportCleaning.setDateColumn(actOperation2s.get(i).getActOperation2()[x][JSON.parseObject(actOperation2s.get(i).getHistoryRole()).getInteger("DateColumn")].getV());
//新增一条生成表数据(筛选)
// actSuppliesCleaningRuleMapper.addActSuppliesImportCleaningAcc(actSuppliesImportCleaningAcc);
actSuppliesImportCleaningAccs
.
add
(
actSuppliesImportCleaningAcc
);
}
}
}
}
else
{
break
;
}
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
==
null
){
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
break
;
}
else
{
String
codeColumn
=
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
();
String
codeColumn
=
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
();
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
6
)))
{
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
6
)));
}
else
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
4
)))
{
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
4
)));
}
else
if
(
resultMap
.
containsKey
(
codeColumn
.
substring
(
0
,
2
)))
{
actSuppliesImportCleaningAcc
.
setCategories
(
resultMap
.
get
(
codeColumn
.
substring
(
0
,
2
)));
}
else
{
actSuppliesImportCleaningAcc
.
setCategories
(
"10"
);
}
//actSuppliesImportCleaning.setDateColumn(actOperation2s.get(i).getActOperation2()[x][JSON.parseObject(actOperation2s.get(i).getHistoryRole()).getInteger("DateColumn")].getV());
//新增一条生成表数据(筛选)
// actSuppliesCleaningRuleMapper.addActSuppliesImportCleaningAcc(actSuppliesImportCleaningAcc);
actSuppliesImportCleaningAccs
.
add
(
actSuppliesImportCleaningAcc
);
}
}
if
(
x
%
500
==
0
){
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
}
else
if
(
x
==
actOperation2s
.
get
(
i
).
getActOperation2
().
length
-
1
){
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
}
}
}
//修改历史表中的数据状态(是否清洗)
}
else
{
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydataStatusByIdAcc
(
actOperation2s
.
get
(
i
).
gethId
());
break
;
}
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)]
==
null
)
{
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
break
;
}
else
{
String
codeColumn
=
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
][((
int
)
parse
.
getJSONObject
(
0
).
get
(
"CodeColumn"
)
-
1
)].
getV
();
}
if
(
x
%
500
==
0
)
{
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
}
else
if
(
x
==
actOperation2s
.
get
(
i
).
getActOperation2
().
length
-
1
)
{
actSuppliesCleaningRuleMapper
.
addActSuppliesImportCleaningAcc
(
actSuppliesImportCleaningAccs
);
actSuppliesImportCleaningAccs
.
clear
();
}
}
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydataStatusByIdAcc
(
actOperation2s
.
get
(
i
).
gethId
());
}
// }
// }
//
//
// };
// };
...
@@ -818,7 +803,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -818,7 +803,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
// thread.start();
// thread.start();
}
}
@Override
@Override
...
@@ -833,7 +817,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -833,7 +817,6 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
String
uuids
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
String
uuids
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
if
(
actSuppliesHistorydata
.
get
(
i
).
getIdentifyingCode
()
==
0
)
{
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
actSuppliesHistorydata1
=
actSuppliesHistorydata
.
get
(
i
);
...
...
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