Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
robot-server
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
inroi
robot-server
Commits
adc58e90
提交
adc58e90
authored
2月 08, 2023
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增导出,解决数据错误
上级
2f5482bc
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
88 行增加
和
19 行删除
+88
-19
KingDeeApi.java
robot-system/src/main/java/com/system/api/KingDeeApi.java
+38
-3
KingDeeGetController.java
...main/java/com/system/controller/KingDeeGetController.java
+6
-9
KingDeeCommonGetApi.java
...src/main/java/com/system/kingdee/KingDeeCommonGetApi.java
+13
-0
WebSocketConfig.java
...rc/main/java/com/system/oauth/config/WebSocketConfig.java
+4
-4
KingDeeCommonGetServiceImpl.java
.../com/system/serivce/impl/KingDeeCommonGetServiceImpl.java
+7
-3
KingDeeLimitVo.java
...main/java/com/system/transfer/kingdee/KingDeeLimitVo.java
+20
-0
没有找到文件。
robot-system/src/main/java/com/system/api/KingDeeApi.java
浏览文件 @
adc58e90
...
@@ -8,6 +8,7 @@ import com.system.dao.InitConnectParamMapper;
...
@@ -8,6 +8,7 @@ import com.system.dao.InitConnectParamMapper;
import
com.system.exception.KingDeeConnectException
;
import
com.system.exception.KingDeeConnectException
;
import
com.system.model.DelayedElement
;
import
com.system.model.DelayedElement
;
import
com.system.model.InitConnectParam
;
import
com.system.model.InitConnectParam
;
import
com.system.transfer.kingdee.KingDeeLimitVo
;
import
com.system.utils.HttpUtil
;
import
com.system.utils.HttpUtil
;
import
com.system.utils.JsonUtil
;
import
com.system.utils.JsonUtil
;
import
com.system.utils.ProductLogUtil
;
import
com.system.utils.ProductLogUtil
;
...
@@ -96,6 +97,12 @@ public class KingDeeApi {
...
@@ -96,6 +97,12 @@ public class KingDeeApi {
this
.
thirdPartyUrl
=
thirdPartyUrl
;
this
.
thirdPartyUrl
=
thirdPartyUrl
;
}
}
private
String
stringLimit
(
KingDeeLimitVo
limit
)
{
return
"\"StartRow\": "
+
limit
.
getPageNo
()
+
",\n"
+
" \"Limit\": "
+
limit
.
getPageSize
();
}
private
String
stringKey
(
Map
<
String
,
String
>
map
)
{
private
String
stringKey
(
Map
<
String
,
String
>
map
)
{
StringBuilder
keys
=
new
StringBuilder
();
StringBuilder
keys
=
new
StringBuilder
();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
map
.
entrySet
())
{
...
@@ -121,18 +128,46 @@ public class KingDeeApi {
...
@@ -121,18 +128,46 @@ public class KingDeeApi {
}
}
}
}
if
(
StringUtil
.
isNotBlank
(
where
.
toString
()))
{
if
(
StringUtil
.
isNotBlank
(
where
.
toString
()))
{
return
"
,
\"FilterString\":\""
+
where
.
toString
()
+
"\""
;
return
"\"FilterString\":\""
+
where
.
toString
()
+
"\""
;
}
}
return
""
;
return
""
;
}
}
/**
/**
* 查询单据体分页
*/
public
List
<
List
<
Object
>>
getKingDeeDataLimit
(
Map
<
String
,
String
>
config
,
String
queueId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
,
KingDeeLimitVo
limit
)
{
String
requesqt
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
","
+
stringWhere
(
where
)
+
","
+
stringLimit
(
limit
)+
"}"
;
try
{
if
(
this
.
flag
)
{
String
request
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
","
+
stringWhere
(
where
)
+
","
+
stringLimit
(
limit
)+
"}"
;
System
.
out
.
println
(
"================content=============="
+
request
+
"=================content==================="
);
List
<
List
<
Object
>>
response
=
kingDeeK3CloudApi
.
executeBillQuery
(
request
);
//记录查询金蝶云数据的请求及响应信息
if
(
StringUtil
.
isNotBlank
(
config
.
get
(
Constants
.
NAME
)))
{
productLogUtil
.
productSyncLogCreate
(
Integer
.
valueOf
(
config
.
get
(
"productId"
)),
queueId
,
config
.
get
(
"name"
),
config
.
get
(
"docType"
),
config
.
get
(
"direction"
),
request
,
response
);
}
return
response
;
}
else
{
throw
new
KingDeeConnectException
(
LOGIN_MESSAGE
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
if
(
StringUtil
.
isNotNull
(
config
.
get
(
Constants
.
NAME
)))
{
productLogUtil
.
productSyncErrorLogCreate
(
Integer
.
valueOf
(
config
.
get
(
"productId"
)),
queueId
,
config
.
get
(
"name"
),
config
.
get
(
"docType"
),
config
.
get
(
"direction"
),
""
,
LOGIN_MESSAGE
);
}
throw
new
KingDeeConnectException
(
LOGIN_MESSAGE
);
}
}
/**
* 查询单据体
* 查询单据体
*/
*/
public
List
<
List
<
Object
>>
getKingDeeData
(
Map
<
String
,
String
>
config
,
String
queueId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
)
{
public
List
<
List
<
Object
>>
getKingDeeData
(
Map
<
String
,
String
>
config
,
String
queueId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
)
{
try
{
try
{
if
(
this
.
flag
)
{
if
(
this
.
flag
)
{
String
request
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
stringWhere
(
where
)
+
"}"
;
String
request
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
","
+
stringWhere
(
where
)
+
"}"
;
System
.
out
.
println
(
"================content=============="
+
request
+
"=================content==================="
);
System
.
out
.
println
(
"================content=============="
+
request
+
"=================content==================="
);
List
<
List
<
Object
>>
response
=
kingDeeK3CloudApi
.
executeBillQuery
(
request
);
List
<
List
<
Object
>>
response
=
kingDeeK3CloudApi
.
executeBillQuery
(
request
);
//记录查询金蝶云数据的请求及响应信息
//记录查询金蝶云数据的请求及响应信息
...
@@ -158,7 +193,7 @@ public class KingDeeApi {
...
@@ -158,7 +193,7 @@ public class KingDeeApi {
public
List
<
List
<
Object
>>
synchronization
(
Map
<
String
,
String
>
config
,
String
queueId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
)
{
public
List
<
List
<
Object
>>
synchronization
(
Map
<
String
,
String
>
config
,
String
queueId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
)
{
try
{
try
{
if
(
this
.
flag
)
{
if
(
this
.
flag
)
{
String
request
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
stringWhere
(
where
)
+
"}"
;
String
request
=
"{\"FormId\":\""
+
config
.
get
(
"sFormId"
)
+
"\","
+
stringKey
(
key
)
+
","
+
stringWhere
(
where
)
+
"}"
;
System
.
out
.
println
(
"================content=============="
+
request
+
"=================content==================="
);
System
.
out
.
println
(
"================content=============="
+
request
+
"=================content==================="
);
List
<
List
<
Object
>>
response
=
kingDeeK3CloudApi
.
executeBillQuery
(
request
);
List
<
List
<
Object
>>
response
=
kingDeeK3CloudApi
.
executeBillQuery
(
request
);
//记录查询金蝶云数据的请求及响应信息
//记录查询金蝶云数据的请求及响应信息
...
...
robot-system/src/main/java/com/system/controller/KingDeeGetController.java
浏览文件 @
adc58e90
...
@@ -10,15 +10,11 @@ import io.swagger.annotations.Api;
...
@@ -10,15 +10,11 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.*
;
import
java.util.Map
;
/**
/**
* @author Inori
* @author Inori
...
@@ -38,8 +34,8 @@ public class KingDeeGetController {
...
@@ -38,8 +34,8 @@ public class KingDeeGetController {
return
kingDeeCommonGetService
.
kingDeeDataList
(
inVo
);
return
kingDeeCommonGetService
.
kingDeeDataList
(
inVo
);
}
}
@ApiOperation
(
"金蝶通用
查询
"
)
@ApiOperation
(
"金蝶通用
导出
"
)
@PostMapping
(
"/kingdee/data/export"
)
@PostMapping
(
"/kingdee/data/export
/list
"
)
public
void
kingDeeDataExport
(
@RequestBody
@Validated
KingDeeDataListInVo
inVo
,
HttpServletResponse
response
)
throws
IOException
{
public
void
kingDeeDataExport
(
@RequestBody
@Validated
KingDeeDataListInVo
inVo
,
HttpServletResponse
response
)
throws
IOException
{
try
{
try
{
...
@@ -57,7 +53,8 @@ public class KingDeeGetController {
...
@@ -57,7 +53,8 @@ public class KingDeeGetController {
}
}
}
}
@ApiOperation
(
"金蝶通用查询"
)
@ApiOperation
(
"金蝶通用导出All"
)
@PostMapping
(
"/kingdee/data/export/all"
)
@PostMapping
(
"/kingdee/data/export/all"
)
public
void
kingDeeDataExportAll
(
@RequestBody
@Validated
KingDeeDataListInVo
inVo
,
HttpServletResponse
response
)
throws
IOException
{
public
void
kingDeeDataExportAll
(
@RequestBody
@Validated
KingDeeDataListInVo
inVo
,
HttpServletResponse
response
)
throws
IOException
{
inVo
.
setAll
(
true
);
inVo
.
setAll
(
true
);
...
...
robot-system/src/main/java/com/system/kingdee/KingDeeCommonGetApi.java
浏览文件 @
adc58e90
...
@@ -2,6 +2,7 @@ package com.system.kingdee;
...
@@ -2,6 +2,7 @@ package com.system.kingdee;
import
com.system.api.KingDeeApi
;
import
com.system.api.KingDeeApi
;
import
com.system.constants.KingDeeCommonSyncConstants
;
import
com.system.constants.KingDeeCommonSyncConstants
;
import
com.system.transfer.kingdee.KingDeeLimitVo
;
import
com.system.utils.KingDeeUtil
;
import
com.system.utils.KingDeeUtil
;
import
com.system.utils.StringUtil
;
import
com.system.utils.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -26,12 +27,24 @@ public class KingDeeCommonGetApi {
...
@@ -26,12 +27,24 @@ public class KingDeeCommonGetApi {
return
encapsulationIms
(
result
,
fieldList
,
config
.
get
(
"mesEntryName"
),
Integer
.
valueOf
(
config
.
get
(
"encapsulationFormat"
)));
return
encapsulationIms
(
result
,
fieldList
,
config
.
get
(
"mesEntryName"
),
Integer
.
valueOf
(
config
.
get
(
"encapsulationFormat"
)));
}
}
public
List
<
Map
<
String
,
Object
>>
getKingDeeDataLimit
(
Map
<
String
,
String
>
config
,
String
queueId
,
List
<
Map
<
String
,
String
>>
fieldList
,
Map
<
String
,
String
>
where
,
KingDeeLimitVo
limit
)
{
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationKingDeeField
(
fieldList
);
List
<
List
<
Object
>>
result
=
kingDeeApi
.
getKingDeeDataLimit
(
config
,
queueId
,
key
,
where
,
limit
);
return
encapsulationIms
(
result
,
fieldList
,
config
.
get
(
"mesEntryName"
),
Integer
.
valueOf
(
config
.
get
(
"encapsulationFormat"
)));
}
public
List
<
List
<
Object
>>
getKingDeeList
(
Map
<
String
,
String
>
config
,
String
queueId
,
List
<
Map
<
String
,
String
>>
fieldList
,
Map
<
String
,
String
>
where
)
{
public
List
<
List
<
Object
>>
getKingDeeList
(
Map
<
String
,
String
>
config
,
String
queueId
,
List
<
Map
<
String
,
String
>>
fieldList
,
Map
<
String
,
String
>
where
)
{
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationKingDeeField
(
fieldList
);
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationKingDeeField
(
fieldList
);
List
<
List
<
Object
>>
result
=
kingDeeApi
.
getKingDeeData
(
config
,
queueId
,
key
,
where
);
List
<
List
<
Object
>>
result
=
kingDeeApi
.
getKingDeeData
(
config
,
queueId
,
key
,
where
);
return
result
;
return
result
;
}
}
public
List
<
List
<
Object
>>
getKingDeeListLimit
(
Map
<
String
,
String
>
config
,
String
queueId
,
List
<
Map
<
String
,
String
>>
fieldList
,
Map
<
String
,
String
>
where
,
KingDeeLimitVo
limit
)
{
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationKingDeeField
(
fieldList
);
List
<
List
<
Object
>>
result
=
kingDeeApi
.
getKingDeeDataLimit
(
config
,
queueId
,
key
,
where
,
limit
);
return
result
;
}
/**
/**
* 封装第三方字段
* 封装第三方字段
*/
*/
...
...
robot-system/src/main/java/com/system/oauth/config/WebSocketConfig.java
浏览文件 @
adc58e90
...
@@ -11,12 +11,12 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
...
@@ -11,12 +11,12 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
* @author daiyg
* @author daiyg
* @date 2021/8/24 17:19
* @date 2021/8/24 17:19
*/
*/
@Service
//
@Service
@Configuration
//
@Configuration
@EnableWebSocket
//
@EnableWebSocket
public
class
WebSocketConfig
{
public
class
WebSocketConfig
{
@Bean
//
@Bean
public
ServerEndpointExporter
serverEndpointExporter
(){
public
ServerEndpointExporter
serverEndpointExporter
(){
return
new
ServerEndpointExporter
();
return
new
ServerEndpointExporter
();
}
}
...
...
robot-system/src/main/java/com/system/serivce/impl/KingDeeCommonGetServiceImpl.java
浏览文件 @
adc58e90
...
@@ -7,6 +7,7 @@ import com.system.framework.core.exception.StarBosException;
...
@@ -7,6 +7,7 @@ import com.system.framework.core.exception.StarBosException;
import
com.system.kingdee.KingDeeCommonGetApi
;
import
com.system.kingdee.KingDeeCommonGetApi
;
import
com.system.serivce.IKingDeeCommonGetService
;
import
com.system.serivce.IKingDeeCommonGetService
;
import
com.system.transfer.kingdee.KingDeeDataListInVo
;
import
com.system.transfer.kingdee.KingDeeDataListInVo
;
import
com.system.transfer.kingdee.KingDeeLimitVo
;
import
com.system.transfer.response.RestResponse
;
import
com.system.transfer.response.RestResponse
;
import
com.system.transfer.temp.KingDeeCommonGetListOutVo
;
import
com.system.transfer.temp.KingDeeCommonGetListOutVo
;
import
com.system.utils.JsonUtil
;
import
com.system.utils.JsonUtil
;
...
@@ -44,6 +45,7 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
...
@@ -44,6 +45,7 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
String
queueId
=
inVo
.
getQueueId
();
String
queueId
=
inVo
.
getQueueId
();
Map
<
String
,
String
>
config
=
kingDeeCommonGetConstants
.
get
(
inVo
.
getDocType
());
Map
<
String
,
String
>
config
=
kingDeeCommonGetConstants
.
get
(
inVo
.
getDocType
());
if
(
CollectionUtils
.
isEmpty
(
config
))
{
if
(
CollectionUtils
.
isEmpty
(
config
))
{
return
RestResponse
.
fail
(
"自定义查询失败! docType为: "
+
inVo
.
getDocType
()
+
" 的表单ERP-MES标识不存在"
);
return
RestResponse
.
fail
(
"自定义查询失败! docType为: "
+
inVo
.
getDocType
()
+
" 的表单ERP-MES标识不存在"
);
...
@@ -101,7 +103,9 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
...
@@ -101,7 +103,9 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
}
}
this
.
setWhereDefaultRule
(
inVo
.
getDocType
(),
where
);
this
.
setWhereDefaultRule
(
inVo
.
getDocType
(),
where
);
List
<
List
<
Object
>>
response
=
kingDeeCommonGetApi
.
getKingDeeList
(
config
,
queueId
,
fieldList
,
where
);
List
<
List
<
Object
>>
response
=
kingDeeCommonGetApi
.
getKingDeeList
(
config
,
queueId
,
fieldList
,
where
);
long
costTime
=
System
.
currentTimeMillis
()
-
start
;
long
costTime
=
System
.
currentTimeMillis
()
-
start
;
if
(!
CollectionUtils
.
isEmpty
(
response
))
{
if
(!
CollectionUtils
.
isEmpty
(
response
))
{
String
temp
=
"false"
;
String
temp
=
"false"
;
...
@@ -112,11 +116,11 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
...
@@ -112,11 +116,11 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
}
}
}
}
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationThirdPartyFieldCn
(
fieldList
);
Map
<
String
,
String
>
key
=
KingDeeCommonSyncConstants
.
encapsulationThirdPartyFieldCn
(
fieldList
);
List
<
List
<
String
>>
head
=
key
.
keySet
().
stream
().
map
(
m
->
new
ArrayList
()
{{
List
<
List
<
String
>>
head
=
key
.
keySet
().
stream
().
map
(
m
->
new
ArrayList
<
String
>
()
{{
add
(
m
);
add
(
m
);
}}).
collect
(
Collectors
.
toList
());
}}).
collect
(
Collectors
.
toList
());
List
<
List
<
Object
>>
dataList
=
response
;
List
<
List
<
Object
>>
dataList
=
new
ArrayList
<>();
if
(!
inVo
.
getAll
())
{
if
(!
inVo
.
getAll
())
{
dataList
=
response
.
stream
().
skip
((
inVo
.
getPageNo
()
-
1
)
*
inVo
.
getPageSize
()).
limit
(
inVo
.
getPageSize
()).
collect
(
Collectors
.
toList
());
dataList
=
response
.
stream
().
skip
((
inVo
.
getPageNo
()
-
1
)
*
inVo
.
getPageSize
()).
limit
(
inVo
.
getPageSize
()).
collect
(
Collectors
.
toList
());
}
}
...
@@ -137,7 +141,7 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
...
@@ -137,7 +141,7 @@ public class KingDeeCommonGetServiceImpl implements IKingDeeCommonGetService {
*/
*/
private
void
setWhereDefaultRule
(
String
docType
,
Map
<
String
,
String
>
where
)
{
private
void
setWhereDefaultRule
(
String
docType
,
Map
<
String
,
String
>
where
)
{
if
(
"INVENTORY"
.
equals
(
docType
))
{
if
(
"INVENTORY"
.
equals
(
docType
))
{
where
.
put
(
"FQty"
+
"!"
,
"0"
);
where
.
put
(
"F
Base
Qty"
+
"!"
,
"0"
);
}
}
}
}
}
}
robot-system/src/main/java/com/system/transfer/kingdee/KingDeeLimitVo.java
0 → 100644
浏览文件 @
adc58e90
package
com
.
system
.
transfer
.
kingdee
;
import
lombok.Data
;
/**
*
*/
@Data
public
class
KingDeeLimitVo
{
/**
* 页码
*/
private
Integer
pageNo
;
/**
* 每页数量
*/
private
Integer
pageSize
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论