Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
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
曲欣亮
shop
Commits
846be522
Commit
846be522
authored
Dec 13, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
76e456c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
OrderService.java
src/main/java/com/egolm/shop/api/service/OrderService.java
+1
-1
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+49
-1
No files found.
src/main/java/com/egolm/shop/api/service/OrderService.java
View file @
846be522
...
...
@@ -35,5 +35,5 @@ public interface OrderService {
public
void
confirmReceipt
(
String
custNo
,
String
subOrderID
);
public
List
<
Map
<
String
,
Object
>>
getDeliverSubDetail
(
String
aocOrderID
);
}
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
846be522
...
...
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -25,6 +26,9 @@ import com.egolm.common.jdbc.dialect.Dialect;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.common.jdbc.dialect.bean.Sql
;
import
com.egolm.shop.api.service.OrderService
;
import
com.egolm.shop.api.service.QiyeWxService
;
import
com.egolm.shop.api.service.QiyeWxService.WxMessage
;
import
com.egolm.shop.api.service.QiyeWxService.WxMessage.MiniprogramNotice
;
import
com.egolm.shop.bean.TSalesOrder
;
import
com.egolm.shop.bean.TSalesOrderDtl
;
import
com.egolm.shop.common.XException
;
...
...
@@ -35,6 +39,9 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Autowired
QiyeWxService
wxService
;
/**
* 订单检查
* <p>Title: orderCheck</p>
...
...
@@ -258,7 +265,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
();
jdbcTemplate
.
update
(
sql
,
sqlDesc
.
getArgs
());
int
count
=
jdbcTemplate
.
update
(
sql
,
sqlDesc
.
getArgs
());
jdbcTemplate
.
update
(
"update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?"
,
sSalesOrderID
);
try
{
jdbcTemplate
.
executeMutil
(
"exec Up_Ego_SplitOrderPrd '"
+
sSalesOrderID
+
"'"
);
...
...
@@ -268,6 +275,9 @@ public class OrderServiceImpl implements OrderService {
}
throw
e
;
}
if
(
count
>
0
)
{
this
.
sendWxOrderCreateMessage
(
sSalesOrderID
);
}
}
@Override
...
...
@@ -845,4 +855,42 @@ public class OrderServiceImpl implements OrderService {
return
jdbcTemplate
.
queryForList
(
"select * from tSalesOrderDeliverSubDtl where nTag&1 = 0 and sAocOrderID = ?"
,
aocOrderID
);
}
private
void
sendWxOrderCreateMessage
(
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/customer/customer_detail/customer_detail?SalesmanNO="
+
salesmanNo
+
"&isShare=1&custNo="
+
custNo
+
"&shopNo="
+
shopNo
+
""
);
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