Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
oms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
oms
Commits
2cf06f74
Commit
2cf06f74
authored
Dec 13, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
f9d9fa5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
44 deletions
+47
-44
OrderServiceImpl.java
...ain/java/com/egolm/oms/service/impl/OrderServiceImpl.java
+47
-44
No files found.
src/main/java/com/egolm/oms/service/impl/OrderServiceImpl.java
View file @
2cf06f74
...
...
@@ -38,9 +38,9 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Autowired
private
QiyeWxService
wxService
;
@Autowired
QiyeWxService
wxService
;
/**
* 订单检查
...
...
@@ -48,7 +48,7 @@ public class OrderServiceImpl implements OrderService {
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.oms.service.OrderService#orderCheck(java.util.Map)
* @see com.egolm.
shop.api.service.
oms.service.OrderService#orderCheck(java.util.Map)
*/
public
String
orderCheck
(
Map
<
String
,
Object
>
params
)
{
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
...
...
@@ -123,6 +123,7 @@ public class OrderServiceImpl implements OrderService {
if
(
commitMap
!=
null
&&
commitMap
.
size
()
>
0
&&
commitMap
.
get
(
0
)
!=
null
&&
Util
.
objTo
(
commitMap
.
get
(
0
).
get
(
"Status"
),
Integer
.
class
)
==
0
&&
Util
.
objTo
(
commitMap
.
get
(
commitMap
.
size
()-
1
).
get
(
"Status"
),
Integer
.
class
)
==
0
)
{
String
sSalesOrderID
=
(
String
)
commitMap
.
get
(
0
).
get
(
"SalesOrderID"
);
jdbcTemplate
.
update
(
"update tSalesOrder set sFormID = ?, sEmail = ?, sSalesmanNO = ? where sSalesOrderID = ?"
,
formId
,
email
,
salesmanNo
,
sSalesOrderID
);
this
.
sendWxMessage
(
sSalesOrderID
);
return
Rjx
.
jsonOk
().
setData
(
commitMap
).
toJson
();
}
else
{
String
errorMsg
=
""
;
...
...
@@ -265,7 +266,7 @@ public class OrderServiceImpl implements OrderService {
Dialect
dialect
=
jdbcTemplate
.
getDialect
();
Sql
sqlDesc
=
dialect
.
argsInsert
(
"tSalesOrderPay"
,
map
);
String
sql
=
"if not exists (select * from tSalesOrderPay where sTransTraceNO = '"
+
sTransTraceNO
+
"') "
+
sqlDesc
.
getSql
();
int
count
=
jdbcTemplate
.
update
(
sql
,
sqlDesc
.
getArgs
());
jdbcTemplate
.
update
(
sql
,
sqlDesc
.
getArgs
());
jdbcTemplate
.
update
(
"update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?"
,
sSalesOrderID
);
try
{
jdbcTemplate
.
executeMutil
(
"exec Up_Ego_SplitOrderPrd '"
+
sSalesOrderID
+
"'"
);
...
...
@@ -275,44 +276,6 @@ public class OrderServiceImpl implements OrderService {
}
throw
e
;
}
if
(
count
>
0
)
{
TSalesOrder
order
=
jdbcTemplate
.
queryForBean
(
"select * from tSalesOrder where sSalesOrderID = ?"
,
TSalesOrder
.
class
,
sSalesOrderID
);
String
salesmanNo
=
order
.
getsSalesmanNO
();
String
shopNo
=
order
.
getsShopNO
();
BigDecimal
totalAmount
=
order
.
getnTotalSaleAmount
();
BigDecimal
totalSaleQty
=
order
.
getnTotalSaleQty
();
String
payType
=
order
.
getsSalesOrderPayType
();
Map
<
String
,
Object
>
salesman
=
null
;
try
{
salesman
=
jdbcTemplate
.
queryForMap
(
"select * from tSalesman where sSalesmanNO = ?"
,
salesmanNo
);
}
catch
(
EmptyResultDataAccessException
e
)
{
e
.
printStackTrace
();
}
if
(
salesman
!=
null
)
{
Map
<
String
,
Object
>
shop
=
jdbcTemplate
.
queryForMap
(
"select * from tShop where sShopNO = ?"
,
shopNo
);
String
custNo
=
(
String
)
shop
.
get
(
"sCustNO"
);
String
shopMemo
=
(
String
)
shop
.
get
(
"sMemo"
);
Map
<
String
,
Object
>
cust
=
jdbcTemplate
.
queryForMap
(
"select * from tCustomer where sCustNO = ?"
,
custNo
);;
String
custName
=
(
String
)
cust
.
get
(
"sCustName"
);
String
sCompanyAccountID
=
(
String
)
salesman
.
get
(
"sCompanyAccountID"
);
WxMessage
wxMessage
=
new
WxMessage
(
sCompanyAccountID
);
MiniprogramNotice
notice
=
new
MiniprogramNotice
();
wxMessage
.
setMiniprogram_notice
(
notice
);
notice
.
setDescription
(
"当前时间"
);
notice
.
setTitle
(
"认证审核通知"
);
notice
.
setPage
(
"pages/ordermanage/detail/detail?SalesmanNO="
+
salesmanNo
+
"&isShare=1&id="
+
sSalesOrderID
+
"&isActive=0"
);
Map
<
Object
,
Object
>
params
=
new
LinkedHashMap
<
Object
,
Object
>();
params
.
put
(
"订单状态"
,
"待审核"
);
params
.
put
(
"客户"
,
custName
);
params
.
put
(
"订单金额"
,
totalAmount
);
params
.
put
(
"商品数量"
,
totalSaleQty
);
params
.
put
(
"支付方式"
,
payType
);
params
.
put
(
"订单时间"
,
DateUtil
.
format
(
new
Date
()));
params
.
put
(
"备注"
,
StringUtil
.
isBlank
(
shopMemo
)
?
" "
:
shopMemo
);
notice
.
setContent_item
(
params
);
wxService
.
sendMessage
(
wxMessage
);
}
}
}
@Override
...
...
@@ -547,6 +510,7 @@ public class OrderServiceImpl implements OrderService {
list
.
add
(
dtl
);
}
jdbcTemplate
.
batchSave
(
list
);
this
.
sendWxMessage
(
order
.
getsSalesOrderID
());
return
order
.
getsSalesOrderID
();
}
...
...
@@ -704,7 +668,7 @@ public class OrderServiceImpl implements OrderService {
String
sqlUpdate
=
"update tZHCProject set nSalePaperQty = ?, nSaleQty = ?, nSaleAmount = ? where nProjectID = ?"
;
jdbcTemplate
.
executeUpdate
(
sqlUpdate
,
nSalePaperQty
,
nSaleQty
,
nSaleAmount
,
nProjectID
);
}
this
.
sendWxMessage
(
order
.
getsSalesOrderID
());
return
order
.
getsSalesOrderID
();
}
...
...
@@ -824,7 +788,7 @@ public class OrderServiceImpl implements OrderService {
dtl
.
setsSalesOrderID
(
sSalesOrderID
);
dtl
.
setsWarehouseNO
(
sWarehouseNO
);
jdbcTemplate
.
save
(
dtl
);
this
.
sendWxMessage
(
order
.
getsSalesOrderID
());
return
order
.
getsSalesOrderID
();
}
...
...
@@ -890,4 +854,43 @@ public class OrderServiceImpl implements OrderService {
return
jdbcTemplate
.
queryForList
(
"select * from tSalesOrderDeliverSubDtl where nTag&1 = 0 and sAocOrderID = ?"
,
aocOrderID
);
}
private
void
sendWxMessage
(
String
sSalesOrderID
)
{
TSalesOrder
order
=
jdbcTemplate
.
queryForBean
(
"select * from tSalesOrder where sSalesOrderID = ?"
,
TSalesOrder
.
class
,
sSalesOrderID
);
String
salesmanNo
=
order
.
getsSalesmanNO
();
String
shopNo
=
order
.
getsShopNO
();
BigDecimal
totalAmount
=
order
.
getnTotalSaleAmount
();
BigDecimal
totalSaleQty
=
order
.
getnTotalSaleQty
();
String
payType
=
order
.
getsSalesOrderPayType
();
Map
<
String
,
Object
>
salesman
=
null
;
try
{
salesman
=
jdbcTemplate
.
queryForMap
(
"select * from tSalesman where sSalesmanNO = ?"
,
salesmanNo
);
}
catch
(
EmptyResultDataAccessException
e
)
{
e
.
printStackTrace
();
}
if
(
salesman
!=
null
)
{
Map
<
String
,
Object
>
shop
=
jdbcTemplate
.
queryForMap
(
"select * from tShop where sShopNO = ?"
,
shopNo
);
String
custNo
=
(
String
)
shop
.
get
(
"sCustNO"
);
String
shopMemo
=
(
String
)
shop
.
get
(
"sMemo"
);
Map
<
String
,
Object
>
cust
=
jdbcTemplate
.
queryForMap
(
"select * from tCustomer where sCustNO = ?"
,
custNo
);;
String
custName
=
(
String
)
cust
.
get
(
"sCustName"
);
String
sCompanyAccountID
=
(
String
)
salesman
.
get
(
"sCompanyAccountID"
);
WxMessage
wxMessage
=
new
WxMessage
(
sCompanyAccountID
);
MiniprogramNotice
notice
=
new
MiniprogramNotice
();
wxMessage
.
setMiniprogram_notice
(
notice
);
notice
.
setDescription
(
"当前时间"
);
notice
.
setTitle
(
"认证审核通知"
);
notice
.
setPage
(
"pages/ordermanage/detail/detail?SalesmanNO="
+
salesmanNo
+
"&isShare=1&id="
+
sSalesOrderID
+
"&isActive=0"
);
Map
<
Object
,
Object
>
params
=
new
LinkedHashMap
<
Object
,
Object
>();
params
.
put
(
"订单状态"
,
"待审核"
);
params
.
put
(
"客户"
,
custName
);
params
.
put
(
"订单金额"
,
totalAmount
);
params
.
put
(
"商品数量"
,
totalSaleQty
);
params
.
put
(
"支付方式"
,
payType
);
params
.
put
(
"订单时间"
,
DateUtil
.
format
(
new
Date
()));
params
.
put
(
"备注"
,
StringUtil
.
isBlank
(
shopMemo
)
?
" "
:
shopMemo
);
notice
.
setContent_item
(
params
);
wxService
.
sendMessage
(
wxMessage
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment