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
ec306ef6
Commit
ec306ef6
authored
Oct 11, 2023
by
lenovo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后端数据清洗完善
parent
0cef16ee
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
130 deletions
+26
-130
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesCleaningRuleController.java
.../system/controller/ActSuppliesCleaningRuleController.java
+0
-40
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesCleaningRuleService.java
...ruoyi/system/service/IActSuppliesCleaningRuleService.java
+0
-21
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesCleaningRuleServiceImpl.java
...stem/service/impl/ActSuppliesCleaningRuleServiceImpl.java
+0
-38
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
...ystem/service/impl/ActSuppliesHistorydataServiceImpl.java
+22
-7
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
+0
-19
ruoyi-ui/src/views/system/supplies/index.vue
ruoyi-ui/src/views/system/supplies/index.vue
+4
-5
No files found.
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesCleaningRuleController.java
View file @
ec306ef6
package
com.ruoyi.system.controller
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.ActSuppliesHistorydata
;
import
com.ruoyi.system.domain.ActSuppliesImportTable
;
import
com.ruoyi.system.domain.ActSuppliesSixMinesSummaryTable
;
import
com.ruoyi.system.service.IActSuppliesCleaningRuleService
;
import
com.ruoyi.system.service.IActSuppliesHistorydataService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.UUID
;
/**
...
...
@@ -28,8 +21,6 @@ import java.util.UUID;
@RequestMapping
(
"/system/cleaningrule"
)
public
class
ActSuppliesCleaningRuleController
extends
BaseController
{
@Autowired
private
IActSuppliesCleaningRuleService
actSuppliesCleaningRuleService
;
@Autowired
private
IActSuppliesHistorydataService
actSuppliesHistorydataService
;
...
...
@@ -47,36 +38,5 @@ public class ActSuppliesCleaningRuleController extends BaseController
return
AjaxResult
.
success
(
s
);
}
/**
* 新增生成表
*/
@PreAuthorize
(
"@ss.hasPermi('system:cleaningrule:addActSuppliesSixMinesSummaryTable')"
)
@Log
(
title
=
" 六矿数据汇总"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/addActSuppliesSixMinesSummaryTable"
)
public
AjaxResult
addActSuppliesSixMinesSummaryTable
(
@RequestBody
ActSuppliesSixMinesSummaryTable
actSuppliesSixMinesSummaryTable
)
{
UUID
uuid
=
UUID
.
randomUUID
();
String
s
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
actSuppliesSixMinesSummaryTable
.
setId
(
s
);
int
i
=
actSuppliesCleaningRuleService
.
addActSuppliesSixMinesSummaryTable
(
actSuppliesSixMinesSummaryTable
);
int
j
=
actSuppliesHistorydataService
.
updateActSuppliesHistorydataStatusById
(
actSuppliesSixMinesSummaryTable
.
gethId
());
return
toAjax
(
i
);
}
/**
* 新增导入表
*/
@PreAuthorize
(
"@ss.hasPermi('system:cleaningrule:addActSuppliesImportTable')"
)
@Log
(
title
=
" 新增导入表"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/addActSuppliesImportTable"
)
public
AjaxResult
addActSuppliesImportTable
(
@RequestBody
ActSuppliesImportTable
actSuppliesImportTable
)
{
UUID
uuid
=
UUID
.
randomUUID
();
String
s
=
StringUtils
.
remove
(
uuid
.
toString
(),
'-'
);
actSuppliesImportTable
.
setId
(
s
);
int
i
=
actSuppliesCleaningRuleService
.
addActSuppliesImportTable
(
actSuppliesImportTable
);
int
j
=
actSuppliesHistorydataService
.
updateActSuppliesHistorydataStatusById
(
actSuppliesImportTable
.
gethId
());
return
toAjax
(
i
);
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesCleaningRuleService.java
deleted
100644 → 0
View file @
0cef16ee
package
com.ruoyi.system.service
;
import
com.ruoyi.system.domain.ActSuppliesHistorydata
;
import
com.ruoyi.system.domain.ActSuppliesImportTable
;
import
com.ruoyi.system.domain.ActSuppliesSixMinesSummaryTable
;
import
java.util.List
;
/**
* 清洗规则Service接口
*
* @author dongjg
* @date 2023-08-01
*/
public
interface
IActSuppliesCleaningRuleService
{
int
addActSuppliesSixMinesSummaryTable
(
ActSuppliesSixMinesSummaryTable
actSuppliesSixMinesSummaryTable
);
int
addActSuppliesImportTable
(
ActSuppliesImportTable
actSuppliesImportTable
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesCleaningRuleServiceImpl.java
deleted
100644 → 0
View file @
0cef16ee
package
com.ruoyi.system.service.impl
;
import
com.ruoyi.system.domain.ActSuppliesImportTable
;
import
com.ruoyi.system.domain.ActSuppliesSixMinesSummaryTable
;
import
com.ruoyi.system.mapper.ActSuppliesCleaningRuleMapper
;
import
com.ruoyi.system.service.IActSuppliesCleaningRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 清洗规则Service业务层处理
*
* @author
* @date 2023-08-30
*/
@Service
public
class
ActSuppliesCleaningRuleServiceImpl
implements
IActSuppliesCleaningRuleService
{
@Autowired
private
ActSuppliesCleaningRuleMapper
actSuppliesCleaningRuleMapper
;
@Override
public
int
addActSuppliesSixMinesSummaryTable
(
ActSuppliesSixMinesSummaryTable
actSuppliesSixMinesSummaryTable
)
{
return
actSuppliesCleaningRuleMapper
.
addActSuppliesSixMinesSummaryTable
(
actSuppliesSixMinesSummaryTable
);
}
@Override
public
int
addActSuppliesImportTable
(
ActSuppliesImportTable
actSuppliesImportTable
)
{
return
actSuppliesCleaningRuleMapper
.
addActSuppliesImportTable
(
actSuppliesImportTable
);
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
View file @
ec306ef6
...
...
@@ -192,15 +192,20 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
return
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydataStatusById
(
gethId
);
}
/**
* 生成表数据清洗
*
* @return 结果
*/
@Override
public
void
addInsertImport
(
List
<
ActOperation1
>
actOperation2s
)
{
//创建新线程
Thread
thread
=
new
Thread
(){
public
void
run
(){
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
//获取生成excel表数据存储到生成表实体类中
for
(
int
x
=
2
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
ActSuppliesSixMinesSummaryTable
actSuppliesSixMinesSummaryTable
=
new
ActSuppliesSixMinesSummaryTable
();
...
...
@@ -232,11 +237,11 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesSixMinesSummaryTable
.
setCreateBy
(
actOperation2s
.
get
(
i
).
getCreateBy
());
actSuppliesSixMinesSummaryTable
.
sethDate
(
actOperation2s
.
get
(
i
).
gethDate
());
actSuppliesSixMinesSummaryTable
.
setMining
(
actOperation2s
.
get
(
i
).
getMining
());
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addActSuppliesSixMinesSummaryTable
(
actSuppliesSixMinesSummaryTable
);
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydataStatusById
(
actOperation2s
.
get
(
i
).
getId
());
}
...
...
@@ -247,10 +252,16 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
};
//结束线程
thread
.
start
();
}
/**
* 导入表数据清洗
*
* @return 结果
*/
@Override
public
void
addInsertImportss
(
List
<
ActOperation1
>
actOperation2s
)
{
...
...
@@ -260,8 +271,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
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"
};
for
(
int
i
=
0
;
i
<
actOperation2s
.
size
();
i
++)
{
//获取导入excel表数据存储到生成表实体类中
for
(
int
x
=
0
;
x
<
actOperation2s
.
get
(
i
).
getActOperation2
().
length
;
x
++)
{
//判断数据是否为空,为空结束循环
if
(
actOperation2s
.
get
(
i
).
getActOperation2
()[
x
]!=
null
){
ActSuppliesImportTable
actSuppliesImportTable
=
new
ActSuppliesImportTable
();
...
...
@@ -271,12 +283,14 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesImportTable
.
sethId
(
actOperation2s
.
get
(
i
).
gethId
());
actSuppliesImportTable
.
sethDate
(
actOperation2s
.
get
(
i
).
gethDate
());
actSuppliesImportTable
.
setMining
(
actOperation2s
.
get
(
i
).
getMining
());
//获取数组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
)
{
...
...
@@ -287,13 +301,14 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
//新增一条生成表数据
actSuppliesCleaningRuleMapper
.
addActSuppliesImportTable
(
actSuppliesImportTable
);
}
else
{
break
;
}
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydataStatusById
(
actOperation2s
.
get
(
i
).
getId
());
}
...
...
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
View file @
ec306ef6
...
...
@@ -9,25 +9,6 @@ export function selectActSuppliesHistorydata() {
})
}
// 新增生成表
export
function
addActSuppliesSixMinesSummaryTable
(
data
)
{
return
request
({
url
:
'
/system/cleaningrule/addActSuppliesSixMinesSummaryTable
'
,
method
:
'
post
'
,
data
:
data
})
}
// 新增导入表
export
function
addActSuppliesImportTable
(
data
)
{
return
request
({
url
:
'
/system/cleaningrule/addActSuppliesImportTable
'
,
method
:
'
post
'
,
data
:
data
})
}
...
...
ruoyi-ui/src/views/system/supplies/index.vue
View file @
ec306ef6
...
...
@@ -80,7 +80,7 @@
<
script
>
import
{
selectActSuppliesHistorydata
,
addActSuppliesSixMinesSummaryTable
,
addActSuppliesImportTable
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
selectActSuppliesHistorydata
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialConvert
,
roleListid
,
materialList
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
addInsert
,
addInsert1
,
addInsert2
}
from
"
@/api/system/historydata
"
/*import luckysheet from 'luckysheet'*/
...
...
@@ -1753,7 +1753,6 @@ export default {
}
});
},
/** 导出设置 */
handleExport
:
debounce
(
function
()
{
...
...
@@ -1770,11 +1769,11 @@ export default {
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
if
(
data
[
i
].
identifyingCode
==
1
){
debugger
let
parse
=
JSON
.
parse
(
data
[
i
].
historyContent
);
let
transToCellData
=
window
.
luckysheet
.
transToData
(
parse
[
0
].
celldata
);
debugger
this
.
imp
.
hId
=
data
[
i
].
id
;
this
.
imp
.
createBy
=
data
[
i
].
createBy
;
this
.
imp
.
hDate
=
data
[
i
].
date
;
...
...
@@ -1814,7 +1813,7 @@ export default {
// let jsonDataa = JSON.parse(data[i].historyContent);
// for (let j = 0; j
<
jsonDataa
.
length
;
j
++
)
{
// let dataa=window.luckysheet.transToData(jsonDataa[j].celldata);
//
debugger
//
// for (let k = 2; k
<
dataa
.
length
;
k
++
)
{
//
// if(dataa[k][1] == null){
...
...
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