Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
SoSsDome
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
SoSsDome
Commits
02bf2772
提交
02bf2772
authored
1月 13, 2022
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增单条查询
上级
f2c8b536
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
291 行增加
和
18 行删除
+291
-18
WebApi.java
src/main/java/com/santos/iost/controller/WebApi.java
+5
-5
SoSsCustomerService.java
...ain/java/com/santos/iost/service/SoSsCustomerService.java
+3
-0
SoSsReceiptService.java
...main/java/com/santos/iost/service/SoSsReceiptService.java
+2
-0
SoSsSalesDeliveryService.java
...ava/com/santos/iost/service/SoSsSalesDeliveryService.java
+5
-1
SoSsSalesInvoiceService.java
...java/com/santos/iost/service/SoSsSalesInvoiceService.java
+3
-0
SoSsCustomerServiceImpl.java
...com/santos/iost/service/impl/SoSsCustomerServiceImpl.java
+76
-5
SoSsReceiptServiceImpl.java
.../com/santos/iost/service/impl/SoSsReceiptServiceImpl.java
+66
-1
SoSsSalesDeliveryServiceImpl.java
...antos/iost/service/impl/SoSsSalesDeliveryServiceImpl.java
+66
-1
SoSsSalesInvoiceServiceImpl.java
...santos/iost/service/impl/SoSsSalesInvoiceServiceImpl.java
+65
-5
没有找到文件。
src/main/java/com/santos/iost/controller/WebApi.java
浏览文件 @
02bf2772
...
@@ -76,13 +76,13 @@ public class WebApi {
...
@@ -76,13 +76,13 @@ public class WebApi {
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesOrderService
.
apiName
))
{
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesOrderService
.
apiName
))
{
result
=
salesOrderService
.
getDataById
(
soSsRequestVo
);
//订单
result
=
salesOrderService
.
getDataById
(
soSsRequestVo
);
//订单
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesDeliveryService
.
apiName
))
{
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesDeliveryService
.
apiName
))
{
//发货单
result
=
salesDeliveryService
.
getDataById
(
soSsRequestVo
);
//发货单
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesInvoiceService
.
apiName
))
{
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
salesInvoiceService
.
apiName
))
{
//开票
result
=
salesInvoiceService
.
getDataById
(
soSsRequestVo
);
//开票
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
receiptService
.
apiName
))
{
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
receiptService
.
apiName
))
{
//回款
result
=
receiptService
.
getDataById
(
soSsRequestVo
);
//回款
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
inventory
Service
.
apiName
))
{
}
else
if
(
soSsRequestVo
.
getObjAPIName
().
equals
(
customer
Service
.
apiName
))
{
//库存
result
=
customerService
.
getDataById
(
soSsRequestVo
);
//客户
}
else
{
}
else
{
return
Result
.
fail
(
"操作失败"
,
soSsRequestVo
.
getObjAPIName
()
+
"不存在"
,
"406"
);
return
Result
.
fail
(
"操作失败"
,
soSsRequestVo
.
getObjAPIName
()
+
"不存在"
,
"406"
);
}
}
...
...
src/main/java/com/santos/iost/service/SoSsCustomerService.java
浏览文件 @
02bf2772
...
@@ -3,8 +3,11 @@ package com.santos.iost.service;
...
@@ -3,8 +3,11 @@ package com.santos.iost.service;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.vo.SoSsCreateVo
;
import
com.santos.iost.vo.SoSsCreateVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
public
interface
SoSsCustomerService
{
public
interface
SoSsCustomerService
{
String
apiName
=
"ERPCustomer"
;
String
apiName
=
"ERPCustomer"
;
public
Result
setData
(
SoSsCreateVo
soSsRequestVo
)
throws
Exception
;
public
Result
setData
(
SoSsCreateVo
soSsRequestVo
)
throws
Exception
;
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
);
}
}
src/main/java/com/santos/iost/service/SoSsReceiptService.java
浏览文件 @
02bf2772
...
@@ -2,8 +2,10 @@ package com.santos.iost.service;
...
@@ -2,8 +2,10 @@ package com.santos.iost.service;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
public
interface
SoSsReceiptService
{
public
interface
SoSsReceiptService
{
String
apiName
=
"ReturnFee"
;
String
apiName
=
"ReturnFee"
;
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
);
}
}
src/main/java/com/santos/iost/service/SoSsSalesDeliveryService.java
浏览文件 @
02bf2772
...
@@ -2,8 +2,12 @@ package com.santos.iost.service;
...
@@ -2,8 +2,12 @@ package com.santos.iost.service;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
public
interface
SoSsSalesDeliveryService
{
public
interface
SoSsSalesDeliveryService
{
String
apiName
=
"DeliveryBill"
;
String
apiName
=
"DeliveryBill"
;
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
);
}
}
src/main/java/com/santos/iost/service/SoSsSalesInvoiceService.java
浏览文件 @
02bf2772
...
@@ -2,8 +2,11 @@ package com.santos.iost.service;
...
@@ -2,8 +2,11 @@ package com.santos.iost.service;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.dto.Result
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
public
interface
SoSsSalesInvoiceService
{
public
interface
SoSsSalesInvoiceService
{
String
apiName
=
"Invoice"
;
String
apiName
=
"Invoice"
;
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getData
(
SoSsRequestVo
soSsRequestVo
);
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
);
}
}
src/main/java/com/santos/iost/service/impl/SoSsCustomerServiceImpl.java
浏览文件 @
02bf2772
...
@@ -8,6 +8,7 @@ import com.santos.iost.dto.SoSsResponseDate;
...
@@ -8,6 +8,7 @@ import com.santos.iost.dto.SoSsResponseDate;
import
com.santos.iost.service.SoSsCustomerService
;
import
com.santos.iost.service.SoSsCustomerService
;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.vo.SoSsCreateVo
;
import
com.santos.iost.vo.SoSsCreateVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -19,8 +20,10 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
...
@@ -19,8 +20,10 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
@Autowired
@Autowired
SoSsDao
soSsDao
;
SoSsDao
soSsDao
;
String
Url
;
//拼接用请求地址-(http://127.0.0.1/K3API/Material/GetList?token=${token})
String
Url
;
String
setUrl
;
//拼接用请求地址-(http://127.0.0.1/K3API/Material/GetList?token=${token})
String
setData
;
String
setData
;
String
fields
;
//需要查询出的字段
/**
/**
* 请求字段
* 请求字段
*/
*/
...
@@ -34,12 +37,14 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
...
@@ -34,12 +37,14 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
public
SoSsCustomerServiceImpl
()
{
public
SoSsCustomerServiceImpl
()
{
this
.
Url
=
"/K3API/Customer/Save"
;
//拼接用请求地址-(http://127.0.0.1/K3API/Material/GetList?token=${token})
this
.
Url
=
"/K3API/Customer/GetList"
;
this
.
setUrl
=
"/K3API/Customer/Save"
;
//拼接用请求地址-(http://127.0.0.1/K3API/Material/GetList?token=${token})
this
.
fields
=
"FNumber,FName,FRegionID,Femployee,FContact,FPhone,FAddress"
;
this
.
setData
=
"{\n"
+
this
.
setData
=
"{\n"
+
" \"F_109\": {\n"
+
//
" \"F_109\": {\n" +
" \"FID\": \"003\"\n"
+
//
" \"FID\": \"003\"\n" +
// " \"FName\": \"重要客户\"\n" +
// " \"FName\": \"重要客户\"\n" +
" },\n"
+
//
" },\n" +
" \"FIsCreditMgr\": false,\n"
+
" \"FIsCreditMgr\": false,\n"
+
" \"FlastRPAmount\": 0,\n"
+
" \"FlastRPAmount\": 0,\n"
+
" \"FlastTradeAmount\": 0,\n"
+
" \"FlastTradeAmount\": 0,\n"
+
...
@@ -89,6 +94,29 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
...
@@ -89,6 +94,29 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
return
result
;
return
result
;
}
}
@Override
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
)
{
String
s
=
new
String
();
Map
map
=
new
HashMap
();
Map
Data
=
new
LinkedHashMap
();
Data
.
put
(
"PageSize"
,
1
);
//每页行数
Data
.
put
(
"PageIndex"
,
1
);
//第几页
Data
.
put
(
"Filter"
,
"FNumber = '"
+
soSsRequestVo
.
getDataId
()
+
"'"
);
//过滤条件
Data
.
put
(
"Fields"
,
fields
);
//查询字段
map
.
put
(
"Data"
,
Data
);
try
{
s
=
soSsDao
.
requestK3Api
(
Url
,
JsonUtil
.
Mapjson
(
map
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
,
Feature
.
OrderedField
);
//转换数据类型
Result
result
=
changeResponse2
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
return
result
;
}
/*转换*/
/*转换*/
public
Result
changeResponse
(
SoSsResponseDate
soSsRequestVo
)
{
public
Result
changeResponse
(
SoSsResponseDate
soSsRequestVo
)
{
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
...
@@ -117,4 +145,47 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
...
@@ -117,4 +145,47 @@ public class SoSsCustomerServiceImpl implements SoSsCustomerService {
return
result
;
return
result
;
}
}
/*转换*/
public
Result
changeResponse2
(
SoSsResponseDate
ResponseDate
,
SoSsRequestVo2
RequestVo
)
{
Map
<
Object
,
Object
>
masterField
=
new
LinkedHashMap
<>();
Result
result
=
new
Result
();
try
{
//字段转换-变化soSsRequestVo的data参数格式 为CRM规定格式
Map
data
=
(
Map
)
ResponseDate
.
getData
();
Object
data1
=
data
.
get
(
"Data"
);
System
.
out
.
println
(
data
);
List
list
=
JSON
.
parseObject
(
data1
.
toString
(),
List
.
class
,
Feature
.
OrderedField
);
for
(
Object
o
:
list
)
{
Map
map
=
new
HashMap
<>();
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"ERPNumber"
,
listDateMap
.
get
(
FNumber
));
//
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FName
));
//
masterFieldVal
.
put
(
"detailedAddress"
,
listDateMap
.
get
(
FAddress
));
//
masterFieldVal
.
put
(
"customerLevel"
,
listDateMap
.
get
(
FRegionID
+
"_FID"
));
//
masterFieldVal
.
put
(
"contacts"
,
listDateMap
.
get
(
FContact
));
//
masterFieldVal
.
put
(
"phone"
,
listDateMap
.
get
(
FPhone
));
//
masterFieldVal
.
put
(
"personCharge"
,
listDateMap
.
get
(
Femployee
+
"_FNumber"
));
//
// if (null == RequestVo.getIncludeDetail() || false == RequestVo.getIncludeDetail()) {
// } else if (null != RequestVo.getIncludeDetail() && true == RequestVo.getIncludeDetail()) {
// map = getDetail(listDateMap.get(FBillNo).toString());
// }
masterField
.
put
(
"objAPIName"
,
apiName
);
masterField
.
put
(
"masterFieldVal"
,
masterFieldVal
);
masterField
.
put
(
"detailFieldVals"
,
map
);
}
ResponseDate
.
setData
(
masterField
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//将ERP格式变换为CRM格式
result
.
setMessage
(
ResponseDate
.
getMessage
());
result
.
setCode
(
ResponseDate
.
getStatusCode
());
result
.
setData
(
ResponseDate
.
getData
());
return
result
;
}
}
}
src/main/java/com/santos/iost/service/impl/SoSsReceiptServiceImpl.java
浏览文件 @
02bf2772
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsReceiptService;
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsReceiptService;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -59,6 +60,31 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
...
@@ -59,6 +60,31 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
Result
result
=
changeResponse
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
Result
result
=
changeResponse
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
return
result
;
}
@Override
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
)
{
String
s
=
new
String
();
Map
map
=
new
HashMap
();
Map
Data
=
new
LinkedHashMap
();
Data
.
put
(
"Top"
,
1
);
//返回行数
Data
.
put
(
"PageSize"
,
1
);
//每页行数
Data
.
put
(
"PageIndex"
,
1
);
//第几页
Data
.
put
(
"Filter"
,
"[FNumber] = '"
+
soSsRequestVo
.
getDataId
()
+
"'"
);
//过滤条件
Data
.
put
(
"OrderBy"
,
"[FNumber] asc"
);
//排序规则
Data
.
put
(
"SelectPage"
,
"1"
);
//表体索引,文档默认为2
Data
.
put
(
"Fields"
,
fields
);
//查询字段
map
.
put
(
"Data"
,
Data
);
try
{
s
=
soSsDao
.
requestK3Api
(
Url
,
JsonUtil
.
Mapjson
(
map
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
,
Feature
.
OrderedField
);
//转换数据类型
Result
result
=
changeResponse2
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
return
result
;
return
result
;
}
}
...
@@ -104,6 +130,7 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
...
@@ -104,6 +130,7 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
masterField
=
new
LinkedHashMap
<>();
Map
masterField
=
new
LinkedHashMap
<>();
Map
masterFieldVal
=
new
LinkedHashMap
<>();
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"ERPSystemNumber"
,
listDateMap
.
get
(
FNumber
));
//编号
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FCustomer_DSPName
));
//客户名称
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FCustomer_DSPName
));
//客户名称
masterFieldVal
.
put
(
"MSBsTotalAmount"
,
listDateMap
.
get
(
FAmountFor
));
//本次回款总金额
masterFieldVal
.
put
(
"MSBsTotalAmount"
,
listDateMap
.
get
(
FAmountFor
));
//本次回款总金额
masterFieldVal
.
put
(
"MSBsDate"
,
listDateMap
.
get
(
FDate
));
//回款日期
masterFieldVal
.
put
(
"MSBsDate"
,
listDateMap
.
get
(
FDate
));
//回款日期
...
@@ -142,7 +169,7 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
...
@@ -142,7 +169,7 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
Map
requestData
=
new
HashMap
();
Map
requestData
=
new
HashMap
();
requestData
.
put
(
FBillNo
,
code
);
requestData
.
put
(
FBillNo
,
code
);
paramsMap
.
put
(
"Data"
,
requestData
);
paramsMap
.
put
(
"Data"
,
requestData
);
System
.
out
.
println
(
paramsMap
);
try
{
try
{
String
s
=
soSsDao
.
requestK3ApiDetail
(
includeDetailUrl
,
JsonUtil
.
Mapjson
(
paramsMap
));
String
s
=
soSsDao
.
requestK3ApiDetail
(
includeDetailUrl
,
JsonUtil
.
Mapjson
(
paramsMap
));
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
);
//转换数据类型
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
);
//转换数据类型
...
@@ -212,4 +239,42 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
...
@@ -212,4 +239,42 @@ public class SoSsReceiptServiceImpl implements SoSsReceiptService {
return
result
;
return
result
;
}
}
/*转换*/
public
Result
changeResponse2
(
SoSsResponseDate
ResponseDate
,
SoSsRequestVo2
RequestVo
)
{
Map
<
Object
,
Object
>
masterField
=
new
LinkedHashMap
<>();
Result
result
=
new
Result
();
try
{
//字段转换-变化soSsRequestVo的data参数格式 为CRM规定格式
Map
data
=
(
Map
)
ResponseDate
.
getData
();
Object
data1
=
data
.
get
(
"DATA"
);
List
list
=
JSON
.
parseObject
(
data1
.
toString
(),
List
.
class
,
Feature
.
OrderedField
);
for
(
Object
o
:
list
)
{
Map
map
=
new
HashMap
<>();
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"ERPSystemNumber"
,
listDateMap
.
get
(
FNumber
));
//编号
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FCustomer_DSPName
));
//客户名称
masterFieldVal
.
put
(
"MSBsTotalAmount"
,
listDateMap
.
get
(
FAmountFor
));
//本次回款总金额
masterFieldVal
.
put
(
"MSBsDate"
,
listDateMap
.
get
(
FDate
));
//回款日期
if
(
null
==
RequestVo
.
getIncludeDetail
()
||
false
==
RequestVo
.
getIncludeDetail
())
{
}
else
if
(
null
!=
RequestVo
.
getIncludeDetail
()
&&
true
==
RequestVo
.
getIncludeDetail
())
{
map
=
getDetail
(
listDateMap
.
get
(
FNumber
).
toString
());
}
masterField
.
put
(
"objAPIName"
,
apiName
);
masterField
.
put
(
"masterFieldVal"
,
masterFieldVal
);
masterField
.
put
(
"detailFieldVals"
,
map
);
}
ResponseDate
.
setData
(
masterField
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//将ERP格式变换为CRM格式
result
.
setMessage
(
ResponseDate
.
getMessage
());
result
.
setCode
(
ResponseDate
.
getStatusCode
());
result
.
setData
(
ResponseDate
.
getData
());
return
result
;
}
}
}
src/main/java/com/santos/iost/service/impl/SoSsSalesDeliveryServiceImpl.java
浏览文件 @
02bf2772
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsSalesDeliveryService;
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsSalesDeliveryService;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -71,6 +72,29 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
...
@@ -71,6 +72,29 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
return
result
;
return
result
;
}
}
@Override
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
)
{
String
s
=
new
String
();
Map
map
=
new
HashMap
();
Map
Data
=
new
LinkedHashMap
();
Data
.
put
(
"Top"
,
1
);
//返回行数
Data
.
put
(
"PageSize"
,
1
);
//每页行数
Data
.
put
(
"PageIndex"
,
1
);
//第几页
Data
.
put
(
"Filter"
,
"FBillNo = '"
+
soSsRequestVo
.
getDataId
()
+
"'"
);
//过滤条件
Data
.
put
(
"OrderBy"
,
"[FBillNo] asc"
);
//排序规则
Data
.
put
(
"SelectPage"
,
"1"
);
//表体索引,文档默认为2
Data
.
put
(
"Fields"
,
fields
);
//查询字段
map
.
put
(
"Data"
,
Data
);
try
{
s
=
soSsDao
.
requestK3Api
(
Url
,
JsonUtil
.
Mapjson
(
map
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
,
Feature
.
OrderedField
);
//转换数据类型
Result
result
=
changeResponse2
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
return
result
;
}
/*转换请求参数*/
/*转换请求参数*/
public
Map
changeGeta
(
SoSsRequestVo
soSsRequestVo
)
{
public
Map
changeGeta
(
SoSsRequestVo
soSsRequestVo
)
{
...
@@ -136,7 +160,7 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
...
@@ -136,7 +160,7 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
Map
masterFieldVal
=
new
LinkedHashMap
<>();
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FSupplyID_DSPName
));
//客户名称
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FSupplyID_DSPName
));
//客户名称
masterFieldVal
.
put
(
"customerAddress"
,
listDateMap
.
get
(
FHeadSelfB0162
));
//客户地址
masterFieldVal
.
put
(
"customerAddress"
,
listDateMap
.
get
(
FHeadSelfB0162
));
//客户地址
masterFieldVal
.
put
(
"erpNumber"
,
listDateMap
.
get
(
FBillNo
));
//erp编号
masterFieldVal
.
put
(
"erpNumber"
,
StringUtil
.
randomNumber
()
+
listDateMap
.
get
(
FBillNo
));
//erp编号
masterFieldVal
.
put
(
"orderDate"
,
listDateMap
.
get
(
Fdate
));
//下单日期
masterFieldVal
.
put
(
"orderDate"
,
listDateMap
.
get
(
Fdate
));
//下单日期
masterFieldVal
.
put
(
"logisticsCompany"
,
listDateMap
.
get
(
FHeadSelfB0159
));
//物流公司
masterFieldVal
.
put
(
"logisticsCompany"
,
listDateMap
.
get
(
FHeadSelfB0159
));
//物流公司
masterFieldVal
.
put
(
"logisticsOrderNo"
,
listDateMap
.
get
(
FHeadSelfB0157
));
//物流单号
masterFieldVal
.
put
(
"logisticsOrderNo"
,
listDateMap
.
get
(
FHeadSelfB0157
));
//物流单号
...
@@ -238,4 +262,45 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
...
@@ -238,4 +262,45 @@ public class SoSsSalesDeliveryServiceImpl implements SoSsSalesDeliveryService {
return
result
;
return
result
;
}
}
/*转换*/
public
Result
changeResponse2
(
SoSsResponseDate
ResponseDate
,
SoSsRequestVo2
RequestVo
)
{
Map
<
Object
,
Object
>
masterField
=
new
LinkedHashMap
<>();
Result
result
=
new
Result
();
try
{
//字段转换-变化soSsRequestVo的data参数格式 为CRM规定格式
Map
data
=
(
Map
)
ResponseDate
.
getData
();
Object
data1
=
data
.
get
(
"DATA"
);
List
list
=
JSON
.
parseObject
(
data1
.
toString
(),
List
.
class
,
Feature
.
OrderedField
);
for
(
Object
o
:
list
)
{
Map
map
=
new
HashMap
<>();
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FSupplyID_DSPName
));
//客户名称
masterFieldVal
.
put
(
"customerAddress"
,
listDateMap
.
get
(
FHeadSelfB0162
));
//客户地址
masterFieldVal
.
put
(
"erpNumber"
,
listDateMap
.
get
(
FBillNo
));
//erp编号
masterFieldVal
.
put
(
"orderDate"
,
listDateMap
.
get
(
Fdate
));
//下单日期
masterFieldVal
.
put
(
"logisticsCompany"
,
listDateMap
.
get
(
FHeadSelfB0159
));
//物流公司
masterFieldVal
.
put
(
"logisticsOrderNo"
,
listDateMap
.
get
(
FHeadSelfB0157
));
//物流单号
masterFieldVal
.
put
(
"remarks"
,
listDateMap
.
get
(
FExplanation
));
//备注
if
(
null
==
RequestVo
.
getIncludeDetail
()
||
false
==
RequestVo
.
getIncludeDetail
())
{
}
else
if
(
null
!=
RequestVo
.
getIncludeDetail
()
&&
true
==
RequestVo
.
getIncludeDetail
())
{
map
=
getDetail
(
listDateMap
.
get
(
FBillNo
).
toString
());
}
masterField
.
put
(
"objAPIName"
,
apiName
);
masterField
.
put
(
"masterFieldVal"
,
masterFieldVal
);
masterField
.
put
(
"detailFieldVals"
,
map
);
}
ResponseDate
.
setData
(
masterField
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//将ERP格式变换为CRM格式
result
.
setMessage
(
ResponseDate
.
getMessage
());
result
.
setCode
(
ResponseDate
.
getStatusCode
());
result
.
setData
(
ResponseDate
.
getData
());
return
result
;
}
}
}
src/main/java/com/santos/iost/service/impl/SoSsSalesInvoiceServiceImpl.java
浏览文件 @
02bf2772
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsSalesInvoiceService;
...
@@ -9,6 +9,7 @@ import com.santos.iost.service.SoSsSalesInvoiceService;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.JsonUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.utils.StringUtil
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo
;
import
com.santos.iost.vo.SoSsRequestVo2
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -65,6 +66,30 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
...
@@ -65,6 +66,30 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
return
result
;
return
result
;
}
}
@Override
public
Result
getDataById
(
SoSsRequestVo2
soSsRequestVo
)
{
String
s
=
new
String
();
Map
map
=
new
HashMap
();
Map
Data
=
new
LinkedHashMap
();
Data
.
put
(
"Top"
,
1
);
//返回行数
Data
.
put
(
"PageSize"
,
1
);
//每页行数
Data
.
put
(
"PageIndex"
,
1
);
//第几页
Data
.
put
(
"Filter"
,
"FBillNo = '"
+
soSsRequestVo
.
getDataId
()
+
"'"
);
//过滤条件
Data
.
put
(
"OrderBy"
,
"[FBillNo] asc"
);
//排序规则
Data
.
put
(
"SelectPage"
,
"1"
);
//表体索引,文档默认为2
Data
.
put
(
"Fields"
,
fields
);
//查询字段
map
.
put
(
"Data"
,
Data
);
try
{
s
=
soSsDao
.
requestK3Api
(
Url
,
JsonUtil
.
Mapjson
(
map
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
s
);
SoSsResponseDate
soSsResponseDate
=
JSON
.
parseObject
(
s
,
SoSsResponseDate
.
class
,
Feature
.
OrderedField
);
//转换数据类型
Result
result
=
changeResponse2
(
soSsResponseDate
,
soSsRequestVo
);
//转换返回的数据格式
return
result
;
}
/*转换请求参数*/
/*转换请求参数*/
public
Map
changeGeta
(
SoSsRequestVo
soSsRequestVo
)
{
public
Map
changeGeta
(
SoSsRequestVo
soSsRequestVo
)
{
...
@@ -153,7 +178,7 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
...
@@ -153,7 +178,7 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
// Map Data = JSON.parseObject(soSsResponseDate.getData().toString(), Map.class);//转换数据类型
// Map Data = JSON.parseObject(soSsResponseDate.getData().toString(), Map.class);//转换数据类型
JSONObject
fromObject
=
JSONObject
.
fromObject
(
soSsResponseDate
.
getData
().
toString
());
//转换数据类型
JSONObject
fromObject
=
JSONObject
.
fromObject
(
soSsResponseDate
.
getData
().
toString
());
//转换数据类型
List
list
=
JSON
.
parseObject
(
fromObject
.
get
(
"Page2"
).
toString
(),
List
.
class
,
Feature
.
OrderedField
);
List
list
=
JSON
.
parseObject
(
fromObject
.
get
(
"Page2"
).
toString
(),
List
.
class
,
Feature
.
OrderedField
);
// int i = 1;
List
<
Map
>
mapList
=
new
ArrayList
<>();
List
<
Map
>
mapList
=
new
ArrayList
<>();
for
(
Object
o
:
list
)
{
for
(
Object
o
:
list
)
{
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
);
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
);
...
@@ -165,10 +190,6 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
...
@@ -165,10 +190,6 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
map
.
put
(
"salesUnitPrice"
,
listDateMap
.
get
(
FAuxPriceDiscount
));
//销售单价
map
.
put
(
"salesUnitPrice"
,
listDateMap
.
get
(
FAuxPriceDiscount
));
//销售单价
map
.
put
(
"thisInvoicingSubtotal"
,
listDateMap
.
get
(
FAllAmount
));
//本次开票小计
map
.
put
(
"thisInvoicingSubtotal"
,
listDateMap
.
get
(
FAllAmount
));
//本次开票小计
mapList
.
add
(
map
);
mapList
.
add
(
map
);
// returnDate.put(apiName + i, new ArrayList<Map>() {{
// add(map);
// }});
// i++;
}
}
returnDate
.
put
(
"InvoiceDetail"
,
mapList
);
returnDate
.
put
(
"InvoiceDetail"
,
mapList
);
}
else
{
}
else
{
...
@@ -217,4 +238,43 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
...
@@ -217,4 +238,43 @@ public class SoSsSalesInvoiceServiceImpl implements SoSsSalesInvoiceService {
return
result
;
return
result
;
}
}
/*转换*/
public
Result
changeResponse2
(
SoSsResponseDate
ResponseDate
,
SoSsRequestVo2
RequestVo
)
{
Map
<
Object
,
Object
>
masterField
=
new
LinkedHashMap
<>();
Result
result
=
new
Result
();
try
{
//字段转换-变化soSsRequestVo的data参数格式 为CRM规定格式
Map
data
=
(
Map
)
ResponseDate
.
getData
();
Object
data1
=
data
.
get
(
"DATA"
);
List
list
=
JSON
.
parseObject
(
data1
.
toString
(),
List
.
class
,
Feature
.
OrderedField
);
for
(
Object
o
:
list
)
{
Map
map
=
new
HashMap
<>();
Map
listDateMap
=
JSON
.
parseObject
(
o
.
toString
(),
Map
.
class
,
Feature
.
OrderedField
);
Map
masterFieldVal
=
new
LinkedHashMap
<>();
masterFieldVal
.
put
(
"customerName"
,
listDateMap
.
get
(
FCustID_DSPName
));
//客户名称
masterFieldVal
.
put
(
"billingDate"
,
listDateMap
.
get
(
SJKPRQ80
));
//开票日期
// masterFieldVal.put("billingDate", listDateMap.get(Fdate));//开票日期
masterFieldVal
.
put
(
"invoiceNumber"
,
listDateMap
.
get
(
FBillNo
));
//发票号码
masterFieldVal
.
put
(
"shipmentNo"
,
listDateMap
.
get
(
FHeadSelfI0471
));
//发货单号
if
(
null
==
RequestVo
.
getIncludeDetail
()
||
false
==
RequestVo
.
getIncludeDetail
())
{
}
else
if
(
null
!=
RequestVo
.
getIncludeDetail
()
&&
true
==
RequestVo
.
getIncludeDetail
())
{
map
=
getDetail
(
listDateMap
.
get
(
FBillNo
).
toString
());
}
masterField
.
put
(
"objAPIName"
,
apiName
);
masterField
.
put
(
"masterFieldVal"
,
masterFieldVal
);
masterField
.
put
(
"detailFieldVals"
,
map
);
}
ResponseDate
.
setData
(
masterField
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//将ERP格式变换为CRM格式
result
.
setMessage
(
ResponseDate
.
getMessage
());
result
.
setCode
(
ResponseDate
.
getStatusCode
());
result
.
setData
(
ResponseDate
.
getData
());
return
result
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论