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
bc32e91e
提交
bc32e91e
authored
8月 24, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
供货单手动同步
上级
a80e492d
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
161 行增加
和
85 行删除
+161
-85
CategoryDao.java
...main/java/org/jeecg/modules/iost/API/Dao/CategoryDao.java
+5
-2
SupplyListController.java
...ecg/modules/iost/API/controller/SupplyListController.java
+3
-2
KingdeeJournalController.java
...I/controller/kingdeejournal/KingdeeJournalController.java
+33
-13
KingdeeJournal.java
...odules/iost/API/entity/kingdeejournal/KingdeeJournal.java
+4
-0
IPhysicalIDerrorService.java
...ecg/modules/iost/API/service/IPhysicalIDerrorService.java
+1
-1
ISalesOrderService.java
...rg/jeecg/modules/iost/API/service/ISalesOrderService.java
+2
-1
ISupplyListIService.java
...g/jeecg/modules/iost/API/service/ISupplyListIService.java
+2
-1
PhysicalIDerrorServiceImpl.java
...les/iost/API/service/impl/PhysicalIDerrorServiceImpl.java
+20
-21
SalesOrderServiceImpl.java
.../modules/iost/API/service/impl/SalesOrderServiceImpl.java
+2
-1
SupplyListIServiceImpl.java
...modules/iost/API/service/impl/SupplyListIServiceImpl.java
+30
-7
ProductInventoryWebapi.java
...jeecg/modules/iost/API/webapi/ProductInventoryWebapi.java
+7
-2
ReserveStockWebapi.java
...org/jeecg/modules/iost/API/webapi/ReserveStockWebapi.java
+39
-28
SupplyListWebapi.java
...a/org/jeecg/modules/iost/API/webapi/SupplyListWebapi.java
+13
-6
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/Dao/CategoryDao.java
浏览文件 @
bc32e91e
...
@@ -118,8 +118,9 @@ public class CategoryDao {
...
@@ -118,8 +118,9 @@ public class CategoryDao {
* @return
* @return
*/
*/
public
List
<
List
<
Object
>>
selectdate
(
String
sFormId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
,
String
date
)
{
public
Map
<
String
,
List
<
List
<
Object
>
>>
selectdate
(
String
sFormId
,
Map
<
String
,
String
>
key
,
Map
<
String
,
String
>
where
,
String
date
)
{
List
<
List
<
Object
>>
list
=
null
;
List
<
List
<
Object
>>
list
=
null
;
Map
<
String
,
List
<
List
<
Object
>>>
stringListHashMap
=
new
HashMap
<
String
,
List
<
List
<
Object
>>>();
try
{
try
{
Boolean
result
=
client
.
login
(
dbId
,
uid
,
pwd
,
lang
);
Boolean
result
=
client
.
login
(
dbId
,
uid
,
pwd
,
lang
);
if
(
result
)
{
if
(
result
)
{
...
@@ -130,11 +131,13 @@ public class CategoryDao {
...
@@ -130,11 +131,13 @@ public class CategoryDao {
content
=
"{\"FormId\":\""
+
sFormId
+
"\","
+
Stringkey
(
key
)
+
"}"
;
content
=
"{\"FormId\":\""
+
sFormId
+
"\","
+
Stringkey
(
key
)
+
"}"
;
}
}
list
=
client
.
executeBillQuery
(
content
);
list
=
client
.
executeBillQuery
(
content
);
stringListHashMap
.
put
(
content
,
list
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
list
;
return
stringListHashMap
;
}
}
public
String
add
(
String
sFormId
,
String
json
)
{
public
String
add
(
String
sFormId
,
String
json
)
{
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/SupplyListController.java
浏览文件 @
bc32e91e
...
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -83,7 +84,7 @@ public class SupplyListController {
...
@@ -83,7 +84,7 @@ public class SupplyListController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/selectwebapi"
)
@GetMapping
(
value
=
"/selectwebapi"
)
public
Result
<?>
selectwebapi
(
@RequestBody
Map
<
String
,
String
>
map
){
public
Result
<?>
selectwebapi
(
@RequestBody
Map
<
String
,
String
>
map
)
throws
ParseException
{
List
<
Map
<
String
,
String
>>
list
=
supplyListWebapi
.
select
(
map
,
null
);
List
<
Map
<
String
,
String
>>
list
=
supplyListWebapi
.
select
(
map
,
null
);
return
Result
.
OK
(
list
);
return
Result
.
OK
(
list
);
}
}
...
@@ -95,7 +96,7 @@ public class SupplyListController {
...
@@ -95,7 +96,7 @@ public class SupplyListController {
@AutoLog
(
value
=
"国网供货单信息API-同步"
)
@AutoLog
(
value
=
"国网供货单信息API-同步"
)
@ApiOperation
(
value
=
"国网供货单信息API-同步"
,
notes
=
"国网供货单信息API-同步"
)
@ApiOperation
(
value
=
"国网供货单信息API-同步"
,
notes
=
"国网供货单信息API-同步"
)
@PostMapping
(
value
=
"/synchronization"
)
@PostMapping
(
value
=
"/synchronization"
)
public
Result
<?>
synchronization
(){
public
Result
<?>
synchronization
()
throws
ParseException
{
return
Result
.
OK
(
supplyListIService
.
synchronization
(
null
));
return
Result
.
OK
(
supplyListIService
.
synchronization
(
null
));
}
}
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/kingdeejournal/KingdeeJournalController.java
浏览文件 @
bc32e91e
package
org
.
jeecg
.
modules
.
iost
.
API
.
controller
.
kingdeejournal
;
package
org
.
jeecg
.
modules
.
iost
.
API
.
controller
.
kingdeejournal
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -13,6 +14,7 @@ import org.jeecg.common.system.query.QueryGenerator;
...
@@ -13,6 +14,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournal
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournal
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalSalesOrder
;
import
org.jeecg.modules.iost.API.entity.kingdeejournal.KingdeeJournalSalesOrder
;
import
org.jeecg.modules.iost.API.service.IPhysicalIDerrorService
;
import
org.jeecg.modules.iost.API.service.IPhysicalIDerrorService
;
import
org.jeecg.modules.iost.API.service.ISupplyListIService
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalService
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -32,7 +34,8 @@ public class KingdeeJournalController {
...
@@ -32,7 +34,8 @@ public class KingdeeJournalController {
private
KingdeeJournalService
kingdeeJournalService
;
private
KingdeeJournalService
kingdeeJournalService
;
@Autowired
@Autowired
private
IPhysicalIDerrorService
physicalIDerrorService
;
private
IPhysicalIDerrorService
physicalIDerrorService
;
@Autowired
private
ISupplyListIService
supplyListIService
;
/**
/**
* 分页列表查询
* 分页列表查询
*
*
...
@@ -59,29 +62,46 @@ public class KingdeeJournalController {
...
@@ -59,29 +62,46 @@ public class KingdeeJournalController {
*
*
*/
*/
@PostMapping
(
value
=
"manual"
)
@PostMapping
(
value
=
"manual"
)
public
Result
<?>
synchronization
(
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@RequestBody
String
king
)
throws
ParseException
{
public
Result
<?>
synchronization
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@RequestBody
String
king
)
throws
ParseException
{
Result
ok
=
new
Result
();
Result
ok
=
new
Result
();
JSONObject
jsonObject
=
null
;
JSONObject
jsonObject
=
null
;
Boolean
success
=
false
;
List
<
List
<
Object
>>
lists
;
List
<
List
<
Object
>>
lists
;
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
switch
(
name
){
switch
(
name
)
{
case
"获取合同和采购订单信息,生成销售订单"
:
case
"获取合同和采购订单信息,生成销售订单"
:
String
synchronization
=
kingdeeJournalService
.
synchronizationAdd
(
name
,
king
);
String
synchronization
1
=
kingdeeJournalService
.
synchronizationAdd
(
name
,
king
);
jsonObject
=
JSONObject
.
fromObject
(
synchronization
);
jsonObject
=
JSONObject
.
fromObject
(
synchronization1
);
ok
=
Result
.
OK
(
jsonObject
);
ok
=
Result
.
OK
(
jsonObject
);
break
;
break
;
case
"推送实物ID信息"
:
case
"推送实物ID信息"
:
lists
=
kingdeeJournalService
.
synchronizationSelect
(
name
,
king
);
lists
=
kingdeeJournalService
.
synchronizationSelect
(
name
,
king
);
physicalIDerrorService
.
synchronization
(
new
HashMap
<
String
,
List
<
List
<
Object
>>>(){{
put
(
king
,
lists
);}});
success
=
physicalIDerrorService
.
synchronization
(
new
HashMap
<
String
,
List
<
List
<
Object
>>>()
{{
ok
=
Result
.
OK
(
lists
);
put
(
king
,
lists
);
}});
ok
=
Result
.
OK
(
success
);
break
;
case
"供货单"
:
lists
=
kingdeeJournalService
.
synchronizationSelect
(
name
,
king
);
success
=
supplyListIService
.
synchronization
(
new
HashMap
<
String
,
List
<
List
<
Object
>>>()
{{
put
(
king
,
lists
);
}});
ok
=
Result
.
OK
(
success
);
break
;
break
;
}
}
}
}
editSuccess
(
success
,
id
);
return
ok
;
return
ok
;
}
}
public
Boolean
editSuccess
(
Boolean
success
,
String
id
)
{
boolean
isSuccess
=
false
;
if
(
success
)
{
isSuccess
=
kingdeeJournalService
.
updateById
(
new
KingdeeJournal
().
setId
(
id
).
setSuccessagain
(
1
));
}
else
{
isSuccess
=
kingdeeJournalService
.
updateById
(
new
KingdeeJournal
().
setId
(
id
).
setSuccessagain
(
0
));
}
return
isSuccess
;
}
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/entity/kingdeejournal/KingdeeJournal.java
浏览文件 @
bc32e91e
...
@@ -37,4 +37,8 @@ public class KingdeeJournal {
...
@@ -37,4 +37,8 @@ public class KingdeeJournal {
/**数据同步:失败:0,成功:1*/
/**数据同步:失败:0,成功:1*/
private
Integer
synchronization
;
private
Integer
synchronization
;
/**是否已成功:失败:0,成功:1*/
private
Integer
successagain
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/IPhysicalIDerrorService.java
浏览文件 @
bc32e91e
...
@@ -21,5 +21,5 @@ public interface IPhysicalIDerrorService extends IService<Physicaliderror> {
...
@@ -21,5 +21,5 @@ public interface IPhysicalIDerrorService extends IService<Physicaliderror> {
public
JSONObject
selectInList
(
Map
<
String
,
String
>
map
)
throws
ParseException
;
public
JSONObject
selectInList
(
Map
<
String
,
String
>
map
)
throws
ParseException
;
public
Object
synchronization
(
Object
object
)
throws
ParseException
;
public
Boolean
synchronization
(
Object
object
)
throws
ParseException
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/ISalesOrderService.java
浏览文件 @
bc32e91e
...
@@ -21,7 +21,7 @@ public interface ISalesOrderService extends IService<Salesordererror> {
...
@@ -21,7 +21,7 @@ public interface ISalesOrderService extends IService<Salesordererror> {
public
JSONObject
select
(
Map
<
String
,
String
>
map
);
public
JSONObject
select
(
Map
<
String
,
String
>
map
);
public
void
synchronization
();
public
Boolean
synchronization
();
public
void
addSalesOrder
(
String
rs
,
Map
<
String
,
String
>
stringStringMap
,
ArrayList
<
Salesordererror
>
salesordererrors
);
public
void
addSalesOrder
(
String
rs
,
Map
<
String
,
String
>
stringStringMap
,
ArrayList
<
Salesordererror
>
salesordererrors
);
}
}
\ No newline at end of file
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/ISupplyListIService.java
浏览文件 @
bc32e91e
...
@@ -5,6 +5,7 @@ import net.sf.json.JSONObject;
...
@@ -5,6 +5,7 @@ import net.sf.json.JSONObject;
import
org.jeecg.modules.iost.API.entity.Materialinventoryerror
;
import
org.jeecg.modules.iost.API.entity.Materialinventoryerror
;
import
org.jeecg.modules.iost.API.entity.Supplylisterror
;
import
org.jeecg.modules.iost.API.entity.Supplylisterror
;
import
java.text.ParseException
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -18,5 +19,5 @@ public interface ISupplyListIService extends IService<Supplylisterror> {
...
@@ -18,5 +19,5 @@ public interface ISupplyListIService extends IService<Supplylisterror> {
public
JSONObject
select
(
Map
<
String
,
String
>
map
);
public
JSONObject
select
(
Map
<
String
,
String
>
map
);
public
Supplylisterror
synchronization
(
Object
object
)
;
public
Boolean
synchronization
(
Object
object
)
throws
ParseException
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/PhysicalIDerrorServiceImpl.java
浏览文件 @
bc32e91e
...
@@ -67,29 +67,28 @@ public class PhysicalIDerrorServiceImpl extends ServiceImpl<PhysicaliderrorMappe
...
@@ -67,29 +67,28 @@ public class PhysicalIDerrorServiceImpl extends ServiceImpl<PhysicaliderrorMappe
@Override
@Override
public
Object
synchronization
(
Object
object
)
throws
ParseException
{
public
Boolean
synchronization
(
Object
object
)
throws
ParseException
{
Map
<
String
,
List
<
List
<
Object
>>>
stringListMap
=
null
;
Boolean
success
=
true
;
if
(
object
==
null
)
{
Map
<
String
,
List
<
List
<
Object
>>>
stringListMap
=
null
;
stringListMap
=
physicalIDWebapi
.
selectInList
(
null
,
new
HashMap
<
String
,
String
>()
{{
if
(
object
==
null
)
{
put
(
"FApproveDate >"
,
getTime
());
stringListMap
=
physicalIDWebapi
.
selectInList
(
null
,
new
HashMap
<
String
,
String
>()
{{
}});
put
(
"FApproveDate >"
,
getTime
());
}
else
{
}});
stringListMap
=
(
Map
<
String
,
List
<
List
<
Object
>>>)
object
;
}
else
{
stringListMap
=
(
Map
<
String
,
List
<
List
<
Object
>>>)
object
;
}
}
System
.
out
.
println
(
"stringListMap"
+
stringListMap
);
//解析金蝶返回数据转换为国网字段,获取的数据错误返回为空
//解析金蝶返回数据转换为国网字段,获取的数据错误返回为空
List
<
Map
<
String
,
String
>>
list
=
kingdeeAs
(
stringListMap
);
//记录金蝶日志
List
<
Map
<
String
,
String
>>
list
=
kingdeeAs
(
stringListMap
);
//记录金蝶日志
if
(
list
==
null
||
list
.
size
()
<
1
)
return
null
;
if
(
list
==
null
||
list
.
size
()
<
1
)
return
false
;
for
(
Map
<
String
,
String
>
stringStringMap
:
list
)
{
for
(
Map
<
String
,
String
>
stringStringMap
:
list
)
{
String
rs
=
physicalIDApi
.
add
(
stringStringMap
);
//数据转存国网
String
rs
=
physicalIDApi
.
add
(
stringStringMap
);
//数据转存国网
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
rs
);
//获取国网返回
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
rs
);
//获取国网返回
this
.
save
(
addPhysicaliderror
(
jsonObject
,
stringStringMap
));
//日志记录国网请求
this
.
save
(
addPhysicaliderror
(
jsonObject
,
stringStringMap
));
//日志记录国网请求
physicalidService
.
save
(
SplicingDetails
(
stringStringMap
));
//记录实物id明细
physicalidService
.
save
(
SplicingDetails
(
stringStringMap
));
//记录实物id明细
}
}
return
null
;
return
success
;
}
}
/**
/**
...
@@ -158,16 +157,16 @@ public class PhysicalIDerrorServiceImpl extends ServiceImpl<PhysicaliderrorMappe
...
@@ -158,16 +157,16 @@ public class PhysicalIDerrorServiceImpl extends ServiceImpl<PhysicaliderrorMappe
public
List
<
Map
<
String
,
String
>>
kingdeeAs
(
Map
<
String
,
List
<
List
<
Object
>>>
stringListMap
)
throws
ParseException
{
public
List
<
Map
<
String
,
String
>>
kingdeeAs
(
Map
<
String
,
List
<
List
<
Object
>>>
stringListMap
)
throws
ParseException
{
List
<
Map
<
String
,
String
>>
selectInList
=
null
;
List
<
Map
<
String
,
String
>>
selectInList
=
null
;
if
(
stringListMap
!=
null
)
if
(
stringListMap
!=
null
)
for
(
String
key
:
stringListMap
.
keySet
())
{
for
(
String
key
:
stringListMap
.
keySet
())
{
List
<
List
<
Object
>>
list
=
stringListMap
.
get
(
key
);
List
<
List
<
Object
>>
list
=
stringListMap
.
get
(
key
);
WebApiLog
webApiLog
=
new
WebApiLog
();
WebApiLog
webApiLog
=
new
WebApiLog
();
Boolean
ny
=
webApiLog
.
setKingdeeJournal
(
key
,
"推送实物ID信息"
,
list
);
Boolean
ny
=
webApiLog
.
setKingdeeJournal
(
key
,
"推送实物ID信息"
,
list
);
if
(
ny
)
{
//记录金蝶日志并判断是否转换国网字段
if
(
ny
)
{
//记录金蝶日志并判断是否转换国网字段
selectInList
=
physicalIDWebapi
.
PhysicalID
(
list
);
//字段转换
selectInList
=
physicalIDWebapi
.
PhysicalID
(
list
);
//字段转换
}
break
;
}
}
break
;
}
return
selectInList
;
return
selectInList
;
}
}
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/SalesOrderServiceImpl.java
浏览文件 @
bc32e91e
...
@@ -77,7 +77,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
...
@@ -77,7 +77,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
/*同步-(从金蝶云同步数据到国网端,并且对两方操作创建同步日志,明细实体保存)*/
/*同步-(从金蝶云同步数据到国网端,并且对两方操作创建同步日志,明细实体保存)*/
@Override
@Override
public
void
synchronization
()
{
public
Boolean
synchronization
()
{
//从金蝶云查询数据(传给国网用)
//从金蝶云查询数据(传给国网用)
List
<
Object
>
select
=
salesOrderWebapi
.
selectObject
(
null
,
null
);
List
<
Object
>
select
=
salesOrderWebapi
.
selectObject
(
null
,
null
);
//拆解select-获取传入金蝶云星空请求的条件数据
//拆解select-获取传入金蝶云星空请求的条件数据
...
@@ -103,6 +103,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
...
@@ -103,6 +103,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
salesorderPojoService
.
saveBatch
(
salesorders
);
salesorderPojoService
.
saveBatch
(
salesorders
);
//国网日志保存操作
//国网日志保存操作
this
.
saveBatch
(
salesordererrors
);
this
.
saveBatch
(
salesordererrors
);
return
false
;
}
}
/*List<Map<String, String>> 转化成 List<List<Object>>*/
/*List<Map<String, String>> 转化成 List<List<Object>>*/
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/SupplyListIServiceImpl.java
浏览文件 @
bc32e91e
...
@@ -14,13 +14,12 @@ import org.jeecg.modules.iost.API.service.ISupplyListIService;
...
@@ -14,13 +14,12 @@ import org.jeecg.modules.iost.API.service.ISupplyListIService;
import
org.jeecg.modules.iost.API.service.KingdeeJournalService
;
import
org.jeecg.modules.iost.API.service.KingdeeJournalService
;
import
org.jeecg.modules.iost.API.service.pojo.SupplylistPojoService
;
import
org.jeecg.modules.iost.API.service.pojo.SupplylistPojoService
;
import
org.jeecg.modules.iost.API.webapi.SupplyListWebapi
;
import
org.jeecg.modules.iost.API.webapi.SupplyListWebapi
;
import
org.jeecg.modules.iost.API.webapi.Util.WebApiLog
;
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.util.ArrayList
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Description: 供货单信息
* @Description: 供货单信息
...
@@ -34,6 +33,7 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
...
@@ -34,6 +33,7 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
SupplyListIApi
supplyListIApi
;
SupplyListIApi
supplyListIApi
;
@Autowired
@Autowired
SupplyListWebapi
supplyListWebapi
;
SupplyListWebapi
supplyListWebapi
;
@Autowired
@Autowired
KingdeeJournalService
kingdeeJournalService
;
KingdeeJournalService
kingdeeJournalService
;
@Autowired
@Autowired
...
@@ -54,12 +54,34 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
...
@@ -54,12 +54,34 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
* @return
* @return
*/
*/
@Override
@Override
public
Supplylisterror
synchronization
(
Object
object
)
{
public
Boolean
synchronization
(
Object
object
)
throws
ParseException
{
Boolean
success
=
true
;
//将返回信息保存在集合
//将返回信息保存在集合
List
<
Supplylisterror
>
lists
=
new
ArrayList
<>();
List
<
Supplylisterror
>
lists
=
new
ArrayList
<>();
List
<
Supplylist
>
pojolist
=
new
ArrayList
<>();
List
<
Supplylist
>
pojolist
=
new
ArrayList
<>();
//查询今天更新的销售出库单基本信息
//查询今天更新的销售出库单基本信息
List
<
Map
<
String
,
String
>>
list
=
supplyListWebapi
.
select
(
null
,
null
);
List
<
Map
<
String
,
String
>>
list
=
null
;
Map
<
String
,
List
<
List
<
Object
>>>
synchronization
=
null
;
if
(
object
==
null
)
{
synchronization
=
supplyListWebapi
.
synchronization
(
null
,
null
);
}
else
{
synchronization
=
(
Map
<
String
,
List
<
List
<
Object
>>>)
object
;
}
List
<
List
<
Object
>>
selectInList
=
null
;
if
(
synchronization
!=
null
)
for
(
String
key
:
synchronization
.
keySet
())
{
selectInList
=
synchronization
.
get
(
key
);
WebApiLog
webApiLog
=
new
WebApiLog
();
Boolean
ny
=
webApiLog
.
setKingdeeJournal
(
key
,
"供货单"
,
selectInList
);
if
(
ny
)
{
//记录金蝶日志并判断是否转换国网字段
list
=
supplyListWebapi
.
SalesOrder
(
selectInList
);
}
break
;
}
if
(
list
==
null
||
list
.
size
()
<
1
)
return
false
;
//遍历集合 将每个单据的物料信息同步到国网
//遍历集合 将每个单据的物料信息同步到国网
for
(
Map
<
String
,
String
>
data:
list
)
{
for
(
Map
<
String
,
String
>
data:
list
)
{
Supplylisterror
supplylisterror
=
new
Supplylisterror
();
Supplylisterror
supplylisterror
=
new
Supplylisterror
();
...
@@ -100,13 +122,14 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
...
@@ -100,13 +122,14 @@ public class SupplyListIServiceImpl extends ServiceImpl<SupplyListIMapper, Suppl
supplylistPojoService
.
saveBatch
(
pojolist
);
supplylistPojoService
.
saveBatch
(
pojolist
);
if
(
this
.
saveBatch
(
lists
)){
if
(
this
.
saveBatch
(
lists
)){
}
}
return
null
;
return
success
;
}
}
/**
/**
* 设置金蝶的请求日志
* 设置金蝶的请求日志
* @param list
* @param list
*/
*/
public
void
KingdeeLog
(
List
<
Map
<
String
,
String
>>
list
){
public
void
KingdeeLog
(
List
<
Map
<
String
,
String
>>
list
){
KingdeeJournal
kingdeeJournal
=
new
KingdeeJournal
();
KingdeeJournal
kingdeeJournal
=
new
KingdeeJournal
();
//设置金蝶云请求日志
//设置金蝶云请求日志
kingdeeJournal
.
setName
(
"供货单"
);
kingdeeJournal
.
setName
(
"供货单"
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/webapi/ProductInventoryWebapi.java
浏览文件 @
bc32e91e
...
@@ -58,10 +58,15 @@ public class ProductInventoryWebapi implements web_api {
...
@@ -58,10 +58,15 @@ public class ProductInventoryWebapi implements web_api {
calendar
.
setTime
(
d1
);
calendar
.
setTime
(
d1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
List
<
List
<
Object
>>
list
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>(){{
Map
<
String
,
List
<
List
<
Object
>
>>
list
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>(){{
put
(
"FUpdateTime"
,
str1
);
put
(
"FUpdateTime"
,
str1
);
}},
date
);
}},
date
);
return
ProductInventory
(
list
);
List
<
List
<
Object
>>
lists
=
null
;
for
(
String
s
:
list
.
keySet
())
{
lists
=
list
.
get
(
s
);
break
;
}
return
ProductInventory
(
lists
);
}
}
/**
/**
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/webapi/ReserveStockWebapi.java
浏览文件 @
bc32e91e
...
@@ -14,22 +14,26 @@ import java.util.*;
...
@@ -14,22 +14,26 @@ import java.util.*;
*/
*/
@Component
@Component
public
class
ReserveStockWebapi
implements
web_api
{
public
class
ReserveStockWebapi
implements
web_api
{
/**操作的单据体名称*/
/**
* 操作的单据体名称
*/
//从生产入库单获取数据
//从生产入库单获取数据
private
String
sFormId
=
"PRD_INSTOCK"
;
private
String
sFormId
=
"PRD_INSTOCK"
;
@Autowired
@Autowired
private
CategoryDao
categoryDao
;
private
CategoryDao
categoryDao
;
private
Map
<
String
,
String
>
key
=
new
LinkedHashMap
<>();
private
Map
<
String
,
String
>
key
=
new
LinkedHashMap
<>();
public
ReserveStockWebapi
(){
public
ReserveStockWebapi
()
{
/*查询字段*/
/*查询字段*/
key
.
put
(
"FMaterialId"
,
"FMaterialId"
);
//物料编码
key
.
put
(
"FMaterialId"
,
"FMaterialId"
);
//物料编码
//FMaterialName
//FMaterialName
key
.
put
(
"FMaterialName"
,
"FMaterialName"
);
//物料名称
key
.
put
(
"FMaterialName"
,
"FMaterialName"
);
//物料名称
key
.
put
(
"FRealQty"
,
"FRealQty"
);
//实收数量
key
.
put
(
"FRealQty"
,
"FRealQty"
);
//实收数量
key
.
put
(
"FCreateDate"
,
"FCreateDate"
);
//创建时间
key
.
put
(
"FCreateDate"
,
"FCreateDate"
);
//创建时间
key
.
put
(
"FBillNo"
,
"FBillNo"
);
//单据编号
key
.
put
(
"FBillNo"
,
"FBillNo"
);
//单据编号
key
.
put
(
"FID"
,
"FID"
);
//主键
key
.
put
(
"FID"
,
"FID"
);
//主键
}
}
@Override
@Override
public
String
add
(
Object
object
)
{
public
String
add
(
Object
object
)
{
return
categoryDao
.
add
(
sFormId
,
JsonUtil
.
Objectjson
(
object
));
return
categoryDao
.
add
(
sFormId
,
JsonUtil
.
Objectjson
(
object
));
...
@@ -39,39 +43,46 @@ public class ReserveStockWebapi implements web_api {
...
@@ -39,39 +43,46 @@ public class ReserveStockWebapi implements web_api {
/**
/**
* 从生产订单获取今天的物料信息
* 从生产订单获取今天的物料信息
*/
*/
public
List
<
Map
<
String
,
String
>>
select
(
Map
<
String
,
String
>
map
,
String
where
)
{
public
List
<
Map
<
String
,
String
>>
select
(
Map
<
String
,
String
>
map
,
String
where
)
{
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
d1
=
new
Date
();
Date
d1
=
new
Date
();
String
str1
=
sdf1
.
format
(
d1
);
String
str1
=
sdf1
.
format
(
d1
);
//根据查询日期拿到明天
//根据查询日期拿到明天
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
d1
);
calendar
.
setTime
(
d1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
List
<
List
<
Object
>>
list
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>(){{
Map
<
String
,
List
<
List
<
Object
>>>
list
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>()
{{
put
(
"FCreateDate"
,
str1
);
put
(
"FCreateDate"
,
str1
);
}},
date
);
}},
date
);
return
ReserveStock
(
list
);
List
<
List
<
Object
>>
lists
=
null
;
for
(
String
s
:
list
.
keySet
())
{
lists
=
list
.
get
(
s
);
break
;
}
return
ReserveStock
(
lists
);
}
}
/**
/**
* 备品备件库存字段转换国网字段
* 备品备件库存字段转换国网字段
*
* @return
* @return
*/
*/
private
List
<
Map
<
String
,
String
>>
ReserveStock
(
List
<
List
<
Object
>>
list
)
{
private
List
<
Map
<
String
,
String
>>
ReserveStock
(
List
<
List
<
Object
>>
list
)
{
List
<
Map
<
String
,
String
>>
salesorderlist
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
salesorderlist
=
new
ArrayList
<>();
for
(
List
<
Object
>
list1
:
list
)
{
for
(
List
<
Object
>
list1
:
list
)
{
Map
<
String
,
String
>
salesordermap
=
new
HashMap
<>();
Map
<
String
,
String
>
salesordermap
=
new
HashMap
<>();
salesordermap
.
put
(
"spareproductcode"
,
list1
.
get
(
0
).
toString
());
salesordermap
.
put
(
"spareproductcode"
,
list1
.
get
(
0
).
toString
());
salesordermap
.
put
(
"productamount"
,
list1
.
get
(
2
).
toString
());
salesordermap
.
put
(
"productamount"
,
list1
.
get
(
2
).
toString
());
salesordermap
.
put
(
"productdec"
,
list1
.
get
(
1
).
toString
());
salesordermap
.
put
(
"productdec"
,
list1
.
get
(
1
).
toString
());
salesordermap
.
put
(
"datasourcecreatetime"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
salesordermap
.
put
(
"datasourcecreatetime"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
salesordermap
.
put
(
"fbillno"
,
list1
.
get
(
4
).
toString
());
salesordermap
.
put
(
"fbillno"
,
list1
.
get
(
4
).
toString
());
salesordermap
.
put
(
"fid"
,
list1
.
get
(
5
).
toString
());
salesordermap
.
put
(
"fid"
,
list1
.
get
(
5
).
toString
());
salesorderlist
.
add
(
salesordermap
);
salesorderlist
.
add
(
salesordermap
);
}
}
return
salesorderlist
;
return
salesorderlist
;
}
}
@Override
@Override
public
String
update
(
Object
object
)
{
public
String
update
(
Object
object
)
{
return
null
;
return
null
;
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/webapi/SupplyListWebapi.java
浏览文件 @
bc32e91e
...
@@ -6,6 +6,7 @@ import org.jeecg.modules.iost.API.webapi.Interface.web_api;
...
@@ -6,6 +6,7 @@ import org.jeecg.modules.iost.API.webapi.Interface.web_api;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -40,7 +41,12 @@ public class SupplyListWebapi implements web_api {
...
@@ -40,7 +41,12 @@ public class SupplyListWebapi implements web_api {
}
}
@Override
@Override
public
List
<
Map
<
String
,
String
>>
select
(
Map
<
String
,
String
>
map
,
String
where
)
{
public
List
<
Map
<
String
,
String
>>
select
(
Map
<
String
,
String
>
map
,
String
where
)
throws
ParseException
{
return
null
;
}
// @Override
public
Map
<
String
,
List
<
List
<
Object
>>>
synchronization
(
Map
<
String
,
String
>
map
,
String
where
)
{
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
d1
=
new
Date
();
Date
d1
=
new
Date
();
String
str1
=
sdf1
.
format
(
d1
);
String
str1
=
sdf1
.
format
(
d1
);
...
@@ -49,16 +55,17 @@ public class SupplyListWebapi implements web_api {
...
@@ -49,16 +55,17 @@ public class SupplyListWebapi implements web_api {
calendar
.
setTime
(
d1
);
calendar
.
setTime
(
d1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
String
date
=
sdf1
.
format
(
calendar
.
getTime
());
List
<
List
<
Object
>>
list
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>(){{
Map
<
String
,
List
<
List
<
Object
>>>
fCreateDate
=
categoryDao
.
selectdate
(
sFormId
,
key
,
new
HashMap
<
String
,
String
>()
{{
put
(
"FCreateDate"
,
str1
);
put
(
"FCreateDate"
,
str1
);
}},
date
);
}},
date
);
return
SalesOrder
(
list
);
// List<List<Object>> list = (List<List<Object>>) fCreateDate;
return
fCreateDate
;
}
}
/**
/**
* 供货单字段转换国网字段
* 供货单字段转换国网字段
* @return
* @return
*/
*/
p
rivate
List
<
Map
<
String
,
String
>>
SalesOrder
(
List
<
List
<
Object
>>
list
){
p
ublic
List
<
Map
<
String
,
String
>>
SalesOrder
(
List
<
List
<
Object
>>
list
){
List
<
Map
<
String
,
String
>>
salesorderlist
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
salesorderlist
=
new
ArrayList
<>();
for
(
List
<
Object
>
list1:
list
)
{
for
(
List
<
Object
>
list1:
list
)
{
Map
<
String
,
String
>
salesordermap
=
new
HashMap
<>();
Map
<
String
,
String
>
salesordermap
=
new
HashMap
<>();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论