Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
鲁鑫
topsun-bpm
Commits
68a5d03d
Commit
68a5d03d
authored
Jan 08, 2024
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
固定资产主数据接口完成
parent
4c42be93
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
SapFixedAssetsApplicationImpl.java
...ssets/application/impl/SapFixedAssetsApplicationImpl.java
+18
-6
No files found.
topsun/src/main/java/com/huigou/topsun/sap/fixedAssets/application/impl/SapFixedAssetsApplicationImpl.java
View file @
68a5d03d
...
@@ -2,9 +2,11 @@ package com.huigou.topsun.sap.fixedAssets.application.impl;
...
@@ -2,9 +2,11 @@ package com.huigou.topsun.sap.fixedAssets.application.impl;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.Operator
;
import
com.huigou.context.Operator
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.common.HttpClient
;
import
com.huigou.topsun.sap.fixedAssets.application.SapFixedAssetsApplication
;
import
com.huigou.topsun.sap.fixedAssets.application.SapFixedAssetsApplication
;
import
com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssets
;
import
com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssets
;
import
com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssetsQueryRequest
;
import
com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssetsQueryRequest
;
...
@@ -21,11 +23,9 @@ import org.springframework.beans.BeanUtils;
...
@@ -21,11 +23,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.net.SocketTimeoutException
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.locks.ReentrantReadWriteLock
;
/**
/**
* @Auther: xin.lu
* @Auther: xin.lu
...
@@ -38,6 +38,9 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
...
@@ -38,6 +38,9 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
@Autowired
@Autowired
private
SapFixedAssetsRepository
sapFixedAssetsRepository
;
private
SapFixedAssetsRepository
sapFixedAssetsRepository
;
@Autowired
private
HttpClient
httpClient
;
@Override
@Override
public
Map
<
String
,
Object
>
getFixedAssetsList
(
SapFixedAssetsQueryRequest
sapFixedAssetsQueryRequest
)
{
public
Map
<
String
,
Object
>
getFixedAssetsList
(
SapFixedAssetsQueryRequest
sapFixedAssetsQueryRequest
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"sapFixedAssets"
);
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"sapFixedAssets"
);
...
@@ -68,7 +71,7 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
...
@@ -68,7 +71,7 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
}
else
{
}
else
{
// 新增
// 新增
// 封装填报时间
// 封装填报时间
BeanUtils
.
copyProperties
(
operator
,
sapFixedAssets
);
BeanUtils
.
copyProperties
(
operator
,
sapFixedAssets
);
// sapFixedAssets.setStatusId(BizBillStatus.APPLYING.getId());
// sapFixedAssets.setStatusId(BizBillStatus.APPLYING.getId());
sapFixedAssets
.
setZflg
(
1
);
sapFixedAssets
.
setZflg
(
1
);
sapFixedAssets
=
sapFixedAssetsRepository
.
saveAndFlush
(
sapFixedAssets
);
sapFixedAssets
=
sapFixedAssetsRepository
.
saveAndFlush
(
sapFixedAssets
);
...
@@ -83,10 +86,19 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
...
@@ -83,10 +86,19 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
BizBillStatus
status
=
approvePassed
()
?
BizBillStatus
.
COMPLETED
:
BizBillStatus
.
ABORTED
;
BizBillStatus
status
=
approvePassed
()
?
BizBillStatus
.
COMPLETED
:
BizBillStatus
.
ABORTED
;
SapFixedAssets
fixedAssets
=
sapFixedAssetsRepository
.
findOne
(
bizId
);
SapFixedAssets
fixedAssets
=
sapFixedAssetsRepository
.
findOne
(
bizId
);
fixedAssets
.
setStatusId
(
status
.
getId
());
fixedAssets
.
setStatusId
(
status
.
getId
());
sapFixedAssetsRepository
.
save
(
fixedAssets
);
// 封装返回数据
// 封装返回数据
String
returnJSON
=
getReturnVo
(
fixedAssets
);
String
returnJSON
=
getReturnVo
(
fixedAssets
);
String
url
=
SystemCache
.
getParameter
(
"sap.service.fixedAssets.url"
,
String
.
class
);
SapFixedAssets
message
;
try
{
String
execute
=
httpClient
.
execute
(
returnJSON
,
url
);
message
=
new
ObjectMapper
().
readValue
(
execute
,
SapFixedAssets
.
class
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
BeanUtils
.
copyProperties
(
message
,
fixedAssets
);
sapFixedAssetsRepository
.
save
(
fixedAssets
);
}
}
/**
/**
...
@@ -139,7 +151,7 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
...
@@ -139,7 +151,7 @@ public class SapFixedAssetsApplicationImpl extends FlowBroker implements SapFixe
if
(
sapFixedAssets
.
isNew
())
{
if
(
sapFixedAssets
.
isNew
())
{
sapFixedAssets
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
sapFixedAssets
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
sapFixedAssets
.
setZflg
(
1
);
sapFixedAssets
.
setZflg
(
1
);
BeanUtils
.
copyProperties
(
operator
,
sapFixedAssets
);
BeanUtils
.
copyProperties
(
operator
,
sapFixedAssets
);
sapFixedAssets
.
setZbpmn
(
sapFixedAssets
.
getBillCode
());
sapFixedAssets
.
setZbpmn
(
sapFixedAssets
.
getBillCode
());
}
else
{
}
else
{
sapFixedAssets
.
setZflg
(
2
);
sapFixedAssets
.
setZflg
(
2
);
...
...
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