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
4e3fc840
Commit
4e3fc840
authored
Jun 21, 2024
by
Fuzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正
parent
9037e6dc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
96 deletions
+54
-96
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesAccountServiceImpl.java
...yi/system/service/impl/ActSuppliesAccountServiceImpl.java
+40
-80
ruoyi-wages/src/main/java/com/ruoyi/system/controller/WagesConversionController.java
...om/ruoyi/system/controller/WagesConversionController.java
+2
-6
ruoyi-wages/src/main/java/com/ruoyi/system/service/WagesConversionService.java
...java/com/ruoyi/system/service/WagesConversionService.java
+6
-5
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesConversionServiceImpl.java
...ruoyi/system/service/impl/WagesConversionServiceImpl.java
+6
-5
No files found.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesAccountServiceImpl.java
View file @
4e3fc840
...
...
@@ -88,94 +88,54 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
* @return
*/
private
static
List
<
ActDispensing
>
getActDispensing
(
List
<
ActDispensing
>
actDispensings
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"accsubjectchart"
,
"1896891590924304390"
);
jsonObject
.
put
(
"pk_org"
,
"1685820920723669151"
);
for
(
ActDispensing
actDispensing
:
actDispensings
)
{
String
[]
names
=
actDispensing
.
getName
().
split
(
"_"
);
int
len
=
names
.
length
;
jsonObject
.
put
(
"names"
,
names
[
len
-
1
]);
ReturnResult
returnResult
=
VoucherUtils
.
callVoucherQuery
(
jsonObject
,
"/yonbip/fi/fipub/accsubject/querysubjectapi"
);
ArrayList
data
=
returnResult
.
getData
();
JSONObject
object
=
(
JSONObject
)
data
.
get
(
0
);
JSONObject
accsubjectchart
=
object
.
getJSONObject
(
"accsubjectchart"
);
JSONObject
accSubjects
=
(
JSONObject
)
accsubjectchart
.
get
(
"accSubjects"
);
accSubjects
.
forEach
((
a
,
b
)
->
{
JSONObject
jsonObject1
=
(
JSONObject
)
b
;
if
(
actDispensing
.
getName
().
equals
(
jsonObject1
.
getString
(
"displayname"
)))
{
actDispensing
.
setAccountingCode
(
jsonObject1
.
getString
(
"code"
));
JSONArray
bodies
=
jsonObject1
.
getJSONArray
(
"bodies"
);
if
(
actDispensing
.
getAccountingNameA
()
!=
null
&&
actDispensing
.
getAccountingNameA
().
split
(
"-"
).
length
==
2
)
{
String
[]
split
=
actDispensing
.
getAccountingNameA
().
split
(
"-"
);
boolean
dimensionext_name
=
IntStream
.
range
(
0
,
bodies
.
size
())
.
mapToObj
(
bodies:
:
getJSONObject
)
.
map
(
v
->
v
.
getString
(
"dimensionext_name"
))
.
anyMatch
(
v
->
split
[
0
].
equals
(
v
));
if
(
dimensionext_name
)
{
JSONObject
object1
=
new
JSONObject
();
object1
.
put
(
"pageIndex"
,
"1"
);
object1
.
put
(
"pageSize"
,
"1000"
);
object1
.
put
(
"name"
,
split
[
1
]);
ReturnResult
returnResult1
=
VoucherUtils
.
callVoucherQuery
(
jsonObject
,
"/yonbip/digitalModel/customerdoc/list"
);
JSONObject
o
=
(
JSONObject
)
returnResult1
.
getData
().
get
(
0
);
JSONArray
recordList
=
o
.
getJSONArray
(
"recordList"
);
Optional
<
String
>
first
=
IntStream
.
range
(
0
,
recordList
.
size
())
.
mapToObj
(
recordList:
:
getJSONObject
)
.
filter
(
v
->
v
.
getString
(
"custdocdefid_name"
).
equals
(
split
[
0
]))
.
map
(
v
->
v
.
getString
(
"code"
))
.
findFirst
();
first
.
ifPresent
(
actDispensing:
:
setAccountingIdA
);
}
}
if
(
actDispensing
.
getAccountingNameB
()
!=
null
&&
actDispensing
.
getAccountingNameB
().
split
(
"-"
).
length
==
2
)
{
String
[]
split
=
actDispensing
.
getAccountingNameB
().
split
(
"-"
);
boolean
dimensionext_name
=
IntStream
.
range
(
0
,
bodies
.
size
())
.
mapToObj
(
bodies:
:
getJSONObject
)
.
map
(
v
->
v
.
getString
(
"dimensionext_name"
))
.
anyMatch
(
v
->
split
[
0
].
equals
(
v
));
if
(
dimensionext_name
)
{
JSONObject
object1
=
new
JSONObject
();
object1
.
put
(
"pageIndex"
,
"1"
);
object1
.
put
(
"pageSize"
,
"1000"
);
object1
.
put
(
"name"
,
split
[
1
]);
ReturnResult
returnResult1
=
VoucherUtils
.
callVoucherQuery
(
jsonObject
,
"/yonbip/digitalModel/customerdoc/list"
);
JSONObject
o
=
(
JSONObject
)
returnResult1
.
getData
().
get
(
0
);
JSONArray
recordList
=
o
.
getJSONArray
(
"recordList"
);
Optional
<
String
>
first
=
IntStream
.
range
(
0
,
recordList
.
size
())
.
mapToObj
(
recordList:
:
getJSONObject
)
.
filter
(
v
->
v
.
getString
(
"custdocdefid_name"
).
equals
(
split
[
0
]))
.
map
(
v
->
v
.
getString
(
"code"
))
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"accsubjectchart"
,
"1896891590924304390"
);
object
.
put
(
"pk_org"
,
"1685820920723669151"
);
object
.
put
(
"codes"
,
actDispensing
.
getR
());
ReturnResult
returnResult
=
VoucherUtils
.
callVoucherQuery
(
object
,
"/yonbip/fi/fipub/accsubject/querysubjectapi"
);
JSONObject
o
=
(
JSONObject
)
returnResult
.
getData
().
get
(
0
);
JSONObject
data
=
o
.
getJSONObject
(
"accsubjectchart"
);
JSONObject
accSubjects
=
data
.
getJSONObject
(
"accSubjects"
);
for
(
Map
.
Entry
<
String
,
Object
>
stringObjectEntry
:
accSubjects
.
entrySet
())
{
JSONArray
jsonObject
=
(
JSONArray
)
stringObjectEntry
.
getValue
();
Optional
<
JSONObject
>
code
=
IntStream
.
range
(
0
,
jsonObject
.
size
())
.
mapToObj
(
jsonObject:
:
getJSONObject
)
.
filter
(
v
->
actDispensing
.
getR
().
equals
(
v
.
getString
(
"code"
)))
.
findFirst
();
first
.
ifPresent
(
actDispensing:
:
setAccountingIdB
);
}
}
if
(
actDispensing
.
getAccountingNameC
()
!=
null
&&
actDispensing
.
getAccountingNameC
().
split
(
"-"
).
length
==
2
)
{
String
[]
split
=
actDispensing
.
getAccountingNameC
().
split
(
"-"
);
boolean
dimensionext_name
=
IntStream
.
range
(
0
,
bodies
.
size
())
.
mapToObj
(
bodies:
:
getJSONObject
)
.
map
(
v
->
v
.
getString
(
"dimensionext_name"
))
.
anyMatch
(
v
->
split
[
0
].
equals
(
v
));
if
(
dimensionext_name
)
{
JSONObject
object1
=
new
JSONObject
();
object1
.
put
(
"pageIndex"
,
"1"
);
object1
.
put
(
"pageSize"
,
"1000"
);
object1
.
put
(
"name"
,
split
[
1
]);
ReturnResult
returnResult1
=
VoucherUtils
.
callVoucherQuery
(
jsonObject
,
"/yonbip/digitalModel/customerdoc/list"
);
JSONObject
o
=
(
JSONObject
)
returnResult1
.
getData
().
get
(
0
);
JSONArray
recordList
=
o
.
getJSONArray
(
"recordList"
);
Optional
<
String
>
first
=
IntStream
.
range
(
0
,
recordList
.
size
())
if
(
code
.
isPresent
())
{
JSONArray
bodies
=
code
.
get
().
getJSONArray
(
"bodies"
);
for
(
int
i
=
0
;
i
<
bodies
.
size
();
i
++)
{
JSONObject
json
=
(
JSONObject
)
bodies
.
get
(
i
);
String
name
=
json
.
getString
(
"dimensionext_name"
);
if
(
"物料基本分类"
.
equals
(
name
))
{
actDispensing
.
setAccountingIdA
(
"物料基本分类,FM060305"
);
}
if
(
"财务核算部门"
.
equals
(
name
))
{
ReturnResult
cw0027
=
getReturnResult
(
"CW0027_yql"
,
"/yonbip/digitalModel/customerdoc/list"
);
JSONObject
obj
=
(
JSONObject
)
cw0027
.
getData
().
get
(
0
);
JSONArray
recordList
=
obj
.
getJSONArray
(
"recordList"
);
Optional
<
JSONObject
>
first
=
IntStream
.
range
(
0
,
recordList
.
size
())
.
mapToObj
(
recordList:
:
getJSONObject
)
.
filter
(
v
->
v
.
getString
(
"custdocdefid_name"
).
equals
(
split
[
0
]))
.
map
(
v
->
v
.
getString
(
"code"
))
.
filter
(
v
->
actDispensing
.
getMaterial
().
equals
(
v
.
getJSONObject
(
"name"
).
getString
(
"zh_CN"
)))
.
findFirst
();
first
.
ifPresent
(
actDispensing:
:
setAccountingIdC
);
if
(
first
.
isPresent
()){
actDispensing
.
setAccountingIdB
(
"财务核算部门,"
+
first
.
get
().
getString
(
"code"
));
}
}
return
;
}
});
}
return
null
;
}
}
return
actDispensings
;
}
private
static
ReturnResult
getReturnResult
(
String
value
,
String
url
)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"pageIndex"
,
"1"
);
object
.
put
(
"pageSize"
,
"1000"
);
object
.
put
(
"custdocdefcode"
,
value
);
return
VoucherUtils
.
callVoucherQuery
(
object
,
url
);
}
/**
...
...
ruoyi-wages/src/main/java/com/ruoyi/system/controller/WagesConversionController.java
View file @
4e3fc840
...
...
@@ -57,11 +57,7 @@ public class WagesConversionController extends BaseController {
}
@GetMapping
(
"/recentFormulas/{id}"
)
public
AjaxResult
recentFormulas
(
@PathVariable
(
"id"
)
String
mineId
){
Object
o
=
wagesConversionService
.
recentFormulas
(
mineId
);
if
(
o
!=
null
){
return
new
AjaxResult
(
200
,
"成功"
,
o
);
}
return
new
AjaxResult
(
500
,
(
String
)
o
,
null
);
public
AjaxResult
recentFormulas
(
@PathVariable
(
"id"
)
String
mineId
)
{
return
wagesConversionService
.
recentFormulas
(
mineId
);
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/WagesConversionService.java
View file @
4e3fc840
package
com.ruoyi.system.service
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.model.wages.dao.WagesConversionData
;
import
com.ruoyi.system.model.wages.dto.WagesParamsDto
;
import
com.ruoyi.system.model.wages.vo.WagesConversionDataVO
;
...
...
@@ -19,5 +20,5 @@ public interface WagesConversionService {
WagesConversionData
selectWagesConversionDataById
(
int
id
);
Objec
t
recentFormulas
(
String
mineId
);
AjaxResul
t
recentFormulas
(
String
mineId
);
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesConversionServiceImpl.java
View file @
4e3fc840
package
com.ruoyi.system.service.impl
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.mapper.WagesConversionMapper
;
import
com.ruoyi.system.model.wages.dao.WagesConversionData
;
import
com.ruoyi.system.model.wages.dto.WagesParamsDto
;
...
...
@@ -51,23 +52,23 @@ public class WagesConversionServiceImpl implements WagesConversionService {
}
@Override
public
Objec
t
recentFormulas
(
String
mineId
)
{
public
AjaxResul
t
recentFormulas
(
String
mineId
)
{
List
<
WagesConversionDataVO
>
list
=
wagesConversionMapper
.
selectWagesValueAndDate
(
mineId
);
list
.
removeAll
(
Collections
.
singleton
(
null
));
boolean
b1
=
list
.
parallelStream
().
anyMatch
(
v
->
v
.
getYearMonth
()
==
null
||
v
.
getYearMonth
().
indexOf
(
"-"
)
<=
0
);
if
(
b1
)
return
"数据库中数据存在日期错误"
;
if
(
b1
)
return
new
AjaxResult
(
500
,
"数据库中数据存在日期错误"
,
null
)
;
Optional
<
Integer
>
max
=
list
.
parallelStream
().
map
(
v
->
Integer
.
parseInt
(
v
.
getYearMonth
().
split
(
"-"
)[
0
])).
max
((
a
,
b
)
->
a
-
b
);
List
<
WagesConversionDataVO
>
collect
;
if
(
max
.
isPresent
())
{
collect
=
list
.
parallelStream
().
filter
(
v
->
v
.
getYearMonth
().
split
(
"-"
)[
0
].
equals
(
max
.
get
()
+
""
)).
collect
(
Collectors
.
toList
());
}
else
{
return
"数据库中没有数据"
;
return
new
AjaxResult
(
500
,
"数据库中没有数据"
,
null
)
;
}
if
(
collect
.
size
()
!=
0
)
{
collect
=
collect
.
parallelStream
().
sorted
((
a
,
b
)
->
Integer
.
parseInt
(
b
.
getYearMonth
().
split
(
"-"
)[
1
])
-
Integer
.
parseInt
(
a
.
getYearMonth
().
split
(
"-"
)[
1
])).
collect
(
Collectors
.
toList
());
return
collect
.
get
(
0
).
getValue
(
);
return
new
AjaxResult
(
200
,
"成功"
,
collect
.
get
(
0
).
getValue
()
);
}
return
"数据库中数据错误"
;
return
new
AjaxResult
(
500
,
"数据库中数据错误"
,
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