Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-Integration
Commits
1d648156
提交
1d648156
authored
8月 27, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改日志结构
上级
3defe161
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
430 行增加
和
55 行删除
+430
-55
PurchaseorderTimed.java
.../jeecg/modules/iost/API/TimedTask/PurchaseorderTimed.java
+7
-5
GridErrorReturnProcessController.java
...iost/API/controller/GridErrorReturnProcessController.java
+88
-0
PurchaseorderController.java
.../modules/iost/API/controller/PurchaseorderController.java
+1
-9
KingdeeJournalReturnProcessController.java
...kingdeejournal/KingdeeJournalReturnProcessController.java
+91
-0
GridError.java
...ain/java/org/jeecg/modules/iost/API/entity/GridError.java
+1
-1
GridErrorReturnProcess.java
...jeecg/modules/iost/API/entity/GridErrorReturnProcess.java
+1
-1
KingdeeJournalReturnProcess.java
...PI/entity/kingdeejournal/KingdeeJournalReturnProcess.java
+53
-0
GridErrorReturnProcessMapper.java
...modules/iost/API/mapper/GridErrorReturnProcessMapper.java
+9
-0
KingdeeJournalReturnProcessMapper.java
...es/iost/API/mapper/KingdeeJournalReturnProcessMapper.java
+7
-0
GridErrorReturnProcessMapper.xml
...ules/iost/API/mapper/xml/GridErrorReturnProcessMapper.xml
+6
-0
KingdeeJournalReturnProcessMapper.xml
...iost/API/mapper/xml/KingdeeJournalReturnProcessMapper.xml
+6
-0
GridErrorReturnProcessService.java
...dules/iost/API/service/GridErrorReturnProcessService.java
+12
-0
IPurchaseorderService.java
...jeecg/modules/iost/API/service/IPurchaseorderService.java
+3
-1
KingdeeJournalReturnProcessService.java
.../iost/API/service/KingdeeJournalReturnProcessService.java
+6
-0
GridErrorReturnProcessServiceImpl.java
...t/API/service/impl/GridErrorReturnProcessServiceImpl.java
+58
-0
KingdeeJournalReturnProcessServiceImpl.java
.../service/impl/KingdeeJournalReturnProcessServiceImpl.java
+12
-0
PurchaseorderServiceImpl.java
...dules/iost/API/service/impl/PurchaseorderServiceImpl.java
+69
-38
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/PurchaseorderTimed.java
浏览文件 @
1d648156
...
...
@@ -22,19 +22,21 @@ public class PurchaseorderTimed implements Job {
@Autowired
IPurchaseorderService
iPurchaseorderService
;
/**测试定时*/
/**
* 测试定时
*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
@Scheduled
(
fixedDelay
=
1000
*
60
)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
JSONObject
synchronization
=
iPurchaseorderService
.
synchronizationList
(
null
);
iPurchaseorderService
.
synchronizationList
(
null
);
System
.
out
.
println
(
"执行了"
);
System
.
out
.
println
(
"执行了"
);
}
@Override
public
void
execute
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
try
{
JSONObject
synchronization
=
iPurchaseorderService
.
synchronizationList
(
null
);
iPurchaseorderService
.
synchronizationList
(
null
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/GridErrorReturnProcessController.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONObject
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.modules.iost.API.entity.GridError
;
import
org.jeecg.modules.iost.API.entity.GridErrorReturnProcess
;
import
org.jeecg.modules.iost.API.service.GridErrorReturnProcessService
;
import
org.jeecg.modules.iost.API.service.GridErrorService
;
import
org.jeecg.modules.iost.API.service.IPurchaseorderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.util.Map
;
@Api
(
tags
=
"请求国网日志-正序"
)
@RestController
@RequestMapping
(
"/API/gereturnprocess"
)
@Slf4j
public
class
GridErrorReturnProcessController
{
@Autowired
private
GridErrorReturnProcessService
gridErrorService
;
@Autowired
private
IPurchaseorderService
purchaseorderService
;
/**
* 分页列表查询
*
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog
(
value
=
"国网日志接口-正序-分页列表查询"
)
@ApiOperation
(
value
=
"国网日志接口-正序-分页列表查询"
,
notes
=
"国网日志接口-正序-分页列表查询"
)
@GetMapping
(
value
=
"list"
)
public
Result
<?>
queryPageList
(
GridErrorReturnProcess
gridError
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
QueryWrapper
<
GridErrorReturnProcess
>
queryWrapper
=
QueryGenerator
.
initQueryWrapper
(
gridError
,
req
.
getParameterMap
());
Page
<
GridErrorReturnProcess
>
page
=
new
Page
<
GridErrorReturnProcess
>(
pageNo
,
pageSize
);
IPage
<
GridErrorReturnProcess
>
pageList
=
gridErrorService
.
page
(
page
,
queryWrapper
);
return
Result
.
OK
(
pageList
);
}
@PostMapping
(
value
=
"manual"
)
public
Result
<?>
synchronization
(
@RequestBody
GridErrorReturnProcess
data
)
throws
ParseException
,
IOException
{
Boolean
success
=
false
;
String
id
=
data
.
getId
();
Result
ok
=
new
Result
();
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
data
.
getRequestjson
());
Map
map
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
String
.
valueOf
(
jsonObject
),
Map
.
class
);
if
(
data
.
getBusinessNo
()
!=
null
)
{
switch
(
data
.
getBusinessNo
())
{
case
1
:
success
=
purchaseorderService
.
synchronizationList
(
map
);
ok
=
Result
.
OK
(
success
);
break
;
}
}
editSuccess
(
success
,
id
);
return
ok
;
}
public
Boolean
editSuccess
(
Boolean
success
,
String
id
)
{
boolean
isSuccess
=
false
;
if
(
success
)
{
isSuccess
=
gridErrorService
.
updateById
(
new
GridErrorReturnProcess
().
setId
(
id
).
setSuccessagain
(
1
).
setSynchronization
(
1
));
}
else
{
isSuccess
=
gridErrorService
.
updateById
(
new
GridErrorReturnProcess
().
setId
(
id
).
setSuccessagain
(
0
));
}
return
isSuccess
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/PurchaseorderController.java
浏览文件 @
1d648156
...
...
@@ -62,15 +62,7 @@ public class PurchaseorderController {
@ApiOperation
(
value
=
"同步生成销售订单接口-添加"
,
notes
=
"同步生成销售订单接口-添加"
)
@GetMapping
(
value
=
"/synchronizationList"
)
public
Result
<?>
synchronizationList
()
throws
IOException
,
ParseException
{
JSONObject
jsonObject
=
iPurchaseorderService
.
synchronizationList
(
null
);
return
Result
.
OK
();
}
@AutoLog
(
value
=
"测试生成销售订单接口-添加"
)
@ApiOperation
(
value
=
"测试生成销售订单接口-添加"
,
notes
=
"测试生成销售订单接口-添加"
)
@GetMapping
(
value
=
"/selectList"
)
public
Result
<?>
ob
()
throws
IOException
,
ParseException
{
JSONObject
jsonObject
=
iPurchaseorderService
.
synchronizationList
(
null
);
iPurchaseorderService
.
synchronizationList
(
null
);
return
Result
.
OK
();
}
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/kingdeejournal/KingdeeJournalReturnProcessController.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
controller
.
kingdeejournal
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONObject
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalReturnProcess
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalReturnProcess
;
import
org.jeecg.modules.iost.API.service.IPurchaseorderService
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalReturnProcessService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.Map
;
@Api
(
tags
=
"金蝶日志-正序 "
)
@RestController
@RequestMapping
(
"/API/kingdeejournalrp"
)
@Slf4j
public
class
KingdeeJournalReturnProcessController
{
@Autowired
private
KingdeeJournalReturnProcessService
kingdeeJournalReturnProcessService
;
@Autowired
private
IPurchaseorderService
purchaseorderService
;
/**
* 分页列表查询
*
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog
(
value
=
"金蝶日志-正序-分页列表查询"
)
@ApiOperation
(
value
=
"金蝶日志-正序-分页列表查询"
,
notes
=
"金蝶日志-正序-分页列表查询"
)
@GetMapping
(
value
=
"list"
)
public
Result
<?>
queryPageList
(
KingdeeJournalReturnProcess
kingdeeJournal
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
QueryWrapper
<
KingdeeJournalReturnProcess
>
queryWrapper
=
QueryGenerator
.
initQueryWrapper
(
kingdeeJournal
,
req
.
getParameterMap
());
Page
<
KingdeeJournalReturnProcess
>
page
=
new
Page
<
KingdeeJournalReturnProcess
>(
pageNo
,
pageSize
);
IPage
<
KingdeeJournalReturnProcess
>
pageList
=
kingdeeJournalReturnProcessService
.
page
(
page
,
queryWrapper
);
return
Result
.
OK
(
pageList
);
}
/**
*
*/
@PostMapping
(
value
=
"manual"
)
public
Result
<?>
synchronization
(
@RequestBody
KingdeeJournalReturnProcess
data
)
throws
ParseException
{
Boolean
success
=
false
;
Result
ok
=
new
Result
();
String
ReturnProcessId
=
data
.
getReturnProcessId
();
Integer
businessNo
=
null
;
String
id
=
data
.
getId
();
businessNo
=
data
.
getBusinessNo
();
Map
<
String
,
Object
>
jsonObject1
=
JSONObject
.
fromObject
(
data
.
getReturnProcessJson
());
if
(
businessNo
!=
null
)
{
switch
(
businessNo
)
{
case
1
:
success
=
purchaseorderService
.
manual
(
jsonObject1
,
ReturnProcessId
);
ok
=
Result
.
OK
(
success
);
break
;
}
}
editSuccess
(
success
,
id
);
return
ok
;
}
public
Boolean
editSuccess
(
Boolean
success
,
String
id
)
{
boolean
isSuccess
=
false
;
if
(
success
)
{
isSuccess
=
kingdeeJournalReturnProcessService
.
updateById
(
new
KingdeeJournalReturnProcess
().
setId
(
id
).
setSuccessagain
(
1
).
setSynchronization
(
1
));
}
else
{
isSuccess
=
kingdeeJournalReturnProcessService
.
updateById
(
new
KingdeeJournalReturnProcess
().
setId
(
id
).
setSuccessagain
(
0
));
}
return
isSuccess
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/entity/GridError.java
浏览文件 @
1d648156
...
...
@@ -15,7 +15,7 @@ import java.io.Serializable;
import
java.util.Date
;
/**
* @Description: 国网
实物ID信息API
* @Description: 国网
日志
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/entity/GridErrorReturnProcess.java
浏览文件 @
1d648156
...
...
@@ -15,7 +15,7 @@ import java.io.Serializable;
import
java.util.Date
;
/**
* @Description: 国网
实物ID信息API
* @Description: 国网
日志请求
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/entity/kingdeejournal/KingdeeJournalReturnProcess.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
entity
.
kingdeejournal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
@Data
@TableName
(
"KingdeeJournalReturnProcess"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"KingdeeJournalReturnProcess对象"
,
description
=
"金蝶日志-正序-请求信息"
)
public
class
KingdeeJournalReturnProcess
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
// 传入的业务
private
String
name
;
//传入金蝶信息
private
String
request
;
//金蝶响应信息
private
String
response
;
/**
* 创建日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
java
.
util
.
Date
createtime
;
/**
* 数据同步:失败:0,成功:1
*/
private
Integer
synchronization
;
/**
* 是否已成功:失败:0,成功:1
*/
private
Integer
successagain
;
/**业务编号**/
private
Integer
businessNo
;
/**来源**/
private
String
returnProcessId
;
/**传入金蝶信息来源**/
private
String
returnProcessJson
;
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/mapper/GridErrorReturnProcessMapper.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.jeecg.modules.iost.API.entity.GridErrorReturnProcess
;
public
interface
GridErrorReturnProcessMapper
extends
BaseMapper
<
GridErrorReturnProcess
>
{
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/mapper/KingdeeJournalReturnProcessMapper.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalReturnProcess
;
public
interface
KingdeeJournalReturnProcessMapper
extends
BaseMapper
<
KingdeeJournalReturnProcess
>
{
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/mapper/xml/GridErrorReturnProcessMapper.xml
0 → 100644
浏览文件 @
1d648156
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.jeecg.modules.iost.API.mapper.GridErrorReturnProcessMapper"
>
</mapper>
\ No newline at end of file
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/mapper/xml/KingdeeJournalReturnProcessMapper.xml
0 → 100644
浏览文件 @
1d648156
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.jeecg.modules.iost.API.mapper.KingdeeJournalReturnProcessMapper"
>
</mapper>
\ No newline at end of file
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/GridErrorReturnProcessService.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
net.sf.json.JSONObject
;
import
org.jeecg.modules.iost.API.entity.GridErrorReturnProcess
;
import
java.text.ParseException
;
import
java.util.Map
;
public
interface
GridErrorReturnProcessService
extends
IService
<
GridErrorReturnProcess
>
{
Map
<
Boolean
,
String
>
setGridError
(
JSONObject
jsonObject
,
String
requestJson
,
Integer
BusinessNo
)
throws
ParseException
;
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/IPurchaseorderService.java
浏览文件 @
1d648156
...
...
@@ -20,7 +20,9 @@ public interface IPurchaseorderService extends IService<Purchaseorder> {
public
JSONObject
select
(
Map
<
String
,
String
>
map
);
public
JSONObject
synchronizationList
(
Map
object
)
throws
IOException
,
ParseException
;
public
Boolean
synchronizationList
(
Map
object
)
throws
IOException
,
ParseException
;
public
Purchaseorder
synchronization
(
Object
object
);
public
Boolean
manual
(
Map
<
String
,
Object
>
map
,
String
ReturnProcessId
)
throws
ParseException
;
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/KingdeeJournalReturnProcessService.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalReturnProcess
;
public
interface
KingdeeJournalReturnProcessService
extends
IService
<
KingdeeJournalReturnProcess
>
{
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/GridErrorReturnProcessServiceImpl.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
net.sf.json.JSONObject
;
import
org.jeecg.modules.iost.API.dto.EIP
;
import
org.jeecg.modules.iost.API.entity.GridErrorReturnProcess
;
import
org.jeecg.modules.iost.API.mapper.GridErrorReturnProcessMapper
;
import
org.jeecg.modules.iost.API.service.GridErrorReturnProcessService
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
public
class
GridErrorReturnProcessServiceImpl
extends
ServiceImpl
<
GridErrorReturnProcessMapper
,
GridErrorReturnProcess
>
implements
GridErrorReturnProcessService
{
public
Map
<
Boolean
,
String
>
setGridError
(
JSONObject
jsonObject
,
String
requestJson
,
Integer
BusinessNo
)
throws
ParseException
{
Boolean
complent
=
true
;
Map
<
Boolean
,
String
>
save
=
new
HashMap
<>();
GridErrorReturnProcess
gridError
=
addGridError
(
jsonObject
,
requestJson
,
BusinessNo
);
complent
=
this
.
save
(
gridError
);
save
.
put
(
complent
,
gridError
.
getId
());
return
save
;
}
public
GridErrorReturnProcess
addGridError
(
JSONObject
jsonObject
,
String
requestJson
,
Integer
BusinessNo
)
throws
ParseException
{
//转换为请求国网日志
GridErrorReturnProcess
gridError
=
new
GridErrorReturnProcess
();
if
(
jsonObject
.
get
(
"successful"
)
!=
null
)
{
//请求国网的返回信息
JSONObject
resultValue
=
JSONObject
.
fromObject
(
jsonObject
.
get
(
"resultValue"
));
Object
data
=
resultValue
.
get
(
"data"
);
//获取返回数据的 data对象
gridError
.
setMessage
(
resultValue
.
get
(
"message"
).
toString
());
gridError
.
setRequestjson
(
requestJson
);
gridError
.
setResponsejson
(
data
.
toString
());
gridError
.
setStatus
(
Integer
.
parseInt
(
resultValue
.
get
(
"status"
).
toString
()));
gridError
.
setCreatetime
(
new
Date
());
gridError
.
setSynchronization
(
data
==
null
?
0
:
1
);
gridError
.
setBusinessNo
(
BusinessNo
);
gridError
.
setBusinessName
(
EIP
.
entity
.
get
(
BusinessNo
));
}
else
{
//请求国网的返回信息-错误
gridError
.
setMessage
(
jsonObject
.
get
(
"message"
).
toString
());
gridError
.
setRequestjson
(
requestJson
);
gridError
.
setResponsejson
(
jsonObject
.
get
(
"result"
).
toString
());
gridError
.
setStatus
((
int
)
jsonObject
.
get
(
"code"
));
gridError
.
setCreatetime
(
new
Date
());
gridError
.
setSynchronization
(
0
);
gridError
.
setBusinessNo
(
BusinessNo
);
gridError
.
setBusinessName
(
EIP
.
entity
.
get
(
BusinessNo
));
}
return
gridError
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/KingdeeJournalReturnProcessServiceImpl.java
0 → 100644
浏览文件 @
1d648156
package
org
.
jeecg
.
modules
.
iost
.
API
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalReturnProcess
;
import
org.jeecg.modules.iost.API.mapper.KingdeeJournalReturnProcessMapper
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalReturnProcessService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
KingdeeJournalReturnProcessServiceImpl
extends
ServiceImpl
<
KingdeeJournalReturnProcessMapper
,
KingdeeJournalReturnProcess
>
implements
KingdeeJournalReturnProcessService
{
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/PurchaseorderServiceImpl.java
浏览文件 @
1d648156
...
...
@@ -6,14 +6,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
net.sf.json.JSONObject
;
import
org.jeecg.modules.iost.API.ExternalInterface.PurchaseorderApi
;
import
org.jeecg.modules.iost.API.Util.JsonUtil
;
import
org.jeecg.modules.iost.API.
entity.Purchaseordererror
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournal
;
import
org.jeecg.modules.iost.API.
dto.EIP
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournal
ReturnProcess
;
import
org.jeecg.modules.iost.API.mapper.PurchaseorderMapper
;
import
org.jeecg.modules.iost.API.entity.Purchaseorder
;
import
org.jeecg.modules.iost.API.service.
IPurchaseorderService
;
import
org.jeecg.modules.iost.API.service.
*
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalService
;
import
org.jeecg.modules.iost.API.service.PurchaseordererrorService
;
import
org.jeecg.modules.iost.API.webapi.SalesOrderWebapi
;
import
org.jeecg.modules.iost.API.webapi.Util.FieldConversion
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -43,10 +41,9 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
private
SalesOrderWebapi
salesOrderWebapi
;
@Autowired
private
PurchaseordererrorService
purchaseordererrorService
;
private
KingdeeJournalReturnProcessService
kingdeeJournalService
;
@Autowired
private
KingdeeJournalService
kingdeeJournal
Service
;
private
GridErrorReturnProcessService
gridError
Service
;
@Override
public
String
add
(
Map
<
String
,
String
>
map
)
{
...
...
@@ -68,42 +65,43 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
}
//从国网同步采购订单数据至金蝶销售订单
public
JSONObject
synchronizationList
(
Map
object
)
throws
IOException
,
ParseException
{
public
Boolean
synchronizationList
(
Map
object
)
throws
IOException
,
ParseException
{
Boolean
success
=
true
;
/**
* 获取记录的最大时间访问国网
* 根据时间获取最新采购订单记录
* 返回值转json
*/
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
purchaseorderApi
.
selectList
(
new
HashMap
()
{{
put
(
"modifyStartTime"
,
getTime
());
//put("modifyStartTime", "2021-08-18 19:11:13");
}}));
Purchaseordererror
purchaseordererror
=
new
Purchaseordererror
();
Map
map
=
null
;
if
(
object
==
null
)
{
map
=
new
HashMap
()
{{
put
(
"modifyStartTime"
,
getTime
());
}};
}
else
{
map
=
object
;
}
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
purchaseorderApi
.
selectList
(
map
));
if
(
jsonObject
.
get
(
"success"
)
==
null
)
{
//请求国网的返回信息
JSONObject
resultValue
=
JSONObject
.
fromObject
(
jsonObject
.
get
(
"resultValue"
));
Object
data
=
resultValue
.
get
(
"data"
);
//获取返回数据的 data对象
List
<
Map
<
String
,
Object
>>
list
=
com
.
alibaba
.
fastjson
.
JSONObject
.
parseObject
(
data
.
toString
(),
List
.
class
);
//格式转换
//记录请求国网的返回信息
Map
<
Boolean
,
String
>
booleanStringMap
=
gridErrorService
.
setGridError
(
jsonObject
,
JsonUtil
.
Mapjson
(
map
),
BusinessNo
);
String
ReturnProcessId
=
null
;
if
(
booleanStringMap
.
containsKey
(
true
))
{
ReturnProcessId
=
booleanStringMap
.
get
(
true
);
}
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
Boolean
aBoolean
=
this
.
addSalesOrderWebapi
(
list
);
success
=
this
.
addSalesOrderWebapi
(
list
,
ReturnProcessId
);
}
purchaseordererror
.
setMessage
(
resultValue
.
get
(
"message"
).
toString
());
purchaseordererror
.
setJson
(
JsonUtil
.
Listjson
(
list
));
purchaseordererror
.
setStatus
(
Integer
.
parseInt
(
resultValue
.
get
(
"status"
).
toString
()));
purchaseordererror
.
setCreatetime
(
new
Date
());
purchaseordererror
.
setSynchronization
(
data
==
null
?
0
:
1
);
}
else
{
//请求国网的返回信息-错误
purchaseordererror
.
setMessage
(
jsonObject
.
get
(
"message"
).
toString
());
purchaseordererror
.
setJson
(
jsonObject
.
get
(
"result"
).
toString
());
purchaseordererror
.
setStatus
((
int
)
jsonObject
.
get
(
"code"
));
purchaseordererror
.
setCreatetime
(
new
Date
());
purchaseordererror
.
setSynchronization
(
0
);
gridErrorService
.
setGridError
(
jsonObject
,
JsonUtil
.
Mapjson
(
map
),
BusinessNo
);
}
//记录请求国网的返回信息
purchaseordererrorService
.
save
(
purchaseordererror
);
return
null
;
return
success
;
}
@Override
...
...
@@ -154,10 +152,11 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
* @return
* @throws ParseException
*/
public
Boolean
addSalesOrderWebapi
(
List
<
Map
<
String
,
Object
>>
list
)
throws
ParseException
{
public
Boolean
addSalesOrderWebapi
(
List
<
Map
<
String
,
Object
>>
list
,
String
ReturnProcessId
)
throws
ParseException
{
List
<
Purchaseorder
>
purchaseordersAdd
=
new
ArrayList
<>();
Boolean
fn
=
false
;
for
(
Map
<
String
,
Object
>
map
:
list
)
{
System
.
out
.
println
(
"mapc"
+
map
);
if
(
map
.
get
(
"prjname"
)
==
null
||
map
.
get
(
"materialcode"
)
==
null
||
map
.
get
(
"amount"
)
==
null
||
Integer
.
parseInt
(
map
.
get
(
"amount"
).
toString
())
<=
0
)
{
...
...
@@ -169,8 +168,8 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
JSONObject
Result
=
JSONObject
.
fromObject
(
rswebapi
);
//
JSONObject
ResponseStatus
=
JSONObject
.
fromObject
(
JSONObject
.
fromObject
(
Result
.
get
(
"Result"
)).
get
(
"ResponseStatus"
));
//记录金蝶日志
System
.
out
.
println
(
);
setKingdeeJournal
(
JsonUtil
.
Objectjson
(
SAL_SaleOrder
),
name
,
rswebapi
,
ResponseStatus
);
setKingdeeJournalReturnProcess
(
JsonUtil
.
Objectjson
(
SAL_SaleOrder
),
ReturnProcessId
,
rswebapi
,
JsonUtil
.
Objectjson
(
map
)
);
List
<
Map
<
String
,
String
>>
SuccessEntitys
=
(
List
<
Map
<
String
,
String
>>)
ResponseStatus
.
get
(
"SuccessEntitys"
);
//金蝶云返回值SuccessEntitys
Map
<
String
,
String
>
stringStringMap
=
SuccessEntitys
.
get
(
0
);
if
(
stringStringMap
.
get
(
"Id"
)
!=
null
&&
stringStringMap
.
get
(
"Number"
)
!=
null
)
{
...
...
@@ -182,18 +181,50 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
}
}
boolean
save
=
this
.
saveBatch
(
purchaseordersAdd
);
//记录明细
return
false
;
return
save
;
}
public
Boolean
manual
(
Map
<
String
,
Object
>
map
,
String
ReturnProcessId
)
throws
ParseException
{
Boolean
fn
=
false
;
if
(
map
.
get
(
"prjname"
)
==
null
||
map
.
get
(
"materialcode"
)
==
null
||
map
.
get
(
"amount"
)
==
null
||
Integer
.
parseInt
(
map
.
get
(
"amount"
).
toString
())
<=
0
)
{
}
else
{
JSONObject
model
=
JSONObject
.
fromObject
(
map
);
//转换数据格式
Map
<
String
,
Object
>
SAL_SaleOrder
=
FieldConversion
.
nameAPI
(
model
);
//拼接需要的数据 字段转换
String
rswebapi
=
salesOrderWebapi
.
add
(
SAL_SaleOrder
);
//同步到金蝶
System
.
out
.
println
(
rswebapi
);
JSONObject
Result
=
JSONObject
.
fromObject
(
rswebapi
);
//
JSONObject
ResponseStatus
=
JSONObject
.
fromObject
(
JSONObject
.
fromObject
(
Result
.
get
(
"Result"
)).
get
(
"ResponseStatus"
));
//记录金蝶日志
setKingdeeJournalReturnProcess
(
JsonUtil
.
Objectjson
(
SAL_SaleOrder
),
ReturnProcessId
,
rswebapi
,
JsonUtil
.
Objectjson
(
map
));
List
<
Map
<
String
,
String
>>
SuccessEntitys
=
(
List
<
Map
<
String
,
String
>>)
ResponseStatus
.
get
(
"SuccessEntitys"
);
//金蝶云返回值SuccessEntitys
Map
<
String
,
String
>
stringStringMap
=
SuccessEntitys
.
get
(
0
);
if
(
stringStringMap
.
get
(
"Id"
)
!=
null
&&
stringStringMap
.
get
(
"Number"
)
!=
null
)
{
fn
=
true
;
map
.
put
(
"FId"
,
stringStringMap
.
get
(
"Id"
));
map
.
put
(
"FNumber"
,
stringStringMap
.
get
(
"Number"
));
//获取返回数据记录到记录明细
boolean
save
=
save
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
Purchaseorder
.
class
));
}
}
return
fn
;
}
//金蝶日志
public
Boolean
setKingdeeJournal
(
String
setRequest
,
String
setName
,
String
setResponse
,
JSONObject
ResponseStatus
)
throws
ParseException
{
public
Boolean
setKingdeeJournal
ReturnProcess
(
String
setRequest
,
String
ReturnProcessId
,
String
setResponse
,
String
ReturnProcessJson
)
throws
ParseException
{
boolean
ny
=
false
;
KingdeeJournal
kingdeeJournal
=
new
KingdeeJournal
();
KingdeeJournalReturnProcess
kingdeeJournal
=
new
KingdeeJournalReturnProcess
();
kingdeeJournal
.
setRequest
(
setRequest
);
kingdeeJournal
.
setName
(
setName
);
kingdeeJournal
.
setName
(
EIP
.
entity
.
get
(
BusinessNo
)
);
kingdeeJournal
.
setResponse
(
setResponse
);
kingdeeJournal
.
setCreatetime
(
new
Date
());
kingdeeJournal
.
setBusinessNo
(
BusinessNo
);
kingdeeJournal
.
setReturnProcessId
(
ReturnProcessId
);
kingdeeJournal
.
setReturnProcessJson
(
ReturnProcessJson
);
JSONObject
Result
=
JSONObject
.
fromObject
(
setResponse
);
//
JSONObject
ResponseStatus
=
JSONObject
.
fromObject
(
JSONObject
.
fromObject
(
Result
.
get
(
"Result"
)).
get
(
"ResponseStatus"
));
if
(
setResponse
==
null
||
!(
Boolean
)
ResponseStatus
.
get
(
"IsSuccess"
)
||
null
==
(
Boolean
)
ResponseStatus
.
get
(
"IsSuccess"
))
{
//判断请求是否错误
kingdeeJournal
.
setSynchronization
(
0
);
ny
=
false
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论