Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zyn
/
cjs-site
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
bruce
2019-05-21 16:21:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
089d6419b95c40b44da9ff41dd835726f92edfbf
089d6419
1 parent
5c598b0e
仓管费
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
23 deletions
src/main/java/com/cjs/site/action/user/fund/PickPayAction.java
src/main/java/com/cjs/site/action/user/pick/PickAction.java
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
src/main/java/com/cjs/site/model/user/pick/OutpropApplyPayInfo.java
src/main/java/com/cjs/site/util/lang/JsonUtil.java
src/main/resources/mybatis/user/pick/out-prop-apply-pay-mapper.xml
src/main/webapp/view/user/pick/payInfo.jsp
src/main/java/com/cjs/site/action/user/fund/PickPayAction.java
View file @
089d641
package
com
.
cjs
.
site
.
action
.
user
.
fund
;
import
com.cjs.site.biz.user.pick.PickPayBiz
;
import
com.cjs.site.util.lang.JsonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -30,7 +31,8 @@ public class PickPayAction {
//支付通知
@RequestMapping
(
value
=
"notify"
,
method
=
RequestMethod
.
POST
)
public
String
notify
(
Map
<
String
,
String
>
params
)
{
public
String
notify
(
Map
<
String
,
String
>
params
)
{
System
.
out
.
println
(
"map----params参数"
+
JsonUtil
.
toJson
(
params
));
pickPayBiz
.
isValidNotify
(
params
);
return
"/jsp/payResult.jsp"
;
}
...
...
src/main/java/com/cjs/site/action/user/pick/PickAction.java
View file @
089d641
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
javax.servlet.http.HttpSession
;
import
com.cjs.site.model.user.account.UserInfo
;
import
com.cjs.site.util.lang.DateUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -98,7 +99,7 @@ public class PickAction {
/**
* 自提
*/
@RequestMapping
(
"self"
)
//todo 自提方式重定向页面应跳转到待支付页面
@RequestMapping
(
"self"
)
public
String
selfPick
(
OutpropApplyPickInfo
pickInfo
,
Model
model
,
RedirectAttributes
attributes
,
HttpSession
session
)
{
ResultInfo
resultInfo
=
pickBiz
.
selfPickNew
(
pickInfo
);
...
...
@@ -129,7 +130,7 @@ public class PickAction {
/**
* 顺丰到付
*/
@RequestMapping
(
"express"
)
//todo 顺丰到付提货进入支付-提货详情页
@RequestMapping
(
"express"
)
public
String
expressPick
(
OutpropApplyPickInfo
pickInfo
,
Integer
addressId
,
Model
model
,
RedirectAttributes
attributes
,
HttpSession
session
)
{
ResultInfo
resultInfo
=
pickBiz
.
expressPick
(
pickInfo
,
addressId
);
...
...
@@ -146,7 +147,7 @@ public class PickAction {
/**
* 转赵涌在线拍卖
*/
@RequestMapping
(
"zhaoonline"
)
//
todo `转赵涌在线拍卖跳转
@RequestMapping
(
"zhaoonline"
)
//
public
String
zhaoonlinePick
(
OutpropApplyPickInfo
pickInfo
,
Model
model
,
RedirectAttributes
attributes
,
HttpSession
session
)
{
session
.
setAttribute
(
"pickInfo"
,
pickInfo
);
...
...
@@ -184,7 +185,7 @@ public class PickAction {
}
@RequestMapping
(
"payInfo"
)
@SuppressWarnings
(
"unchecked"
)
//todo 计算托管费用
@SuppressWarnings
(
"unchecked"
)
public
String
payInfo
(
HttpSession
session
,
Model
model
,
String
pickType
,
OutpropApplyPickInfo
pickInfo
,
Integer
addressId
)
{
List
<
OutpropApplyInfo
>
applyList
=
(
List
<
OutpropApplyInfo
>)
session
.
getAttribute
(
"applyList"
);
...
...
@@ -197,11 +198,27 @@ public class PickAction {
}
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.01"
).
multiply
(
new
BigDecimal
(
trusteeshipCycle
)).
multiply
(
new
BigDecimal
(
pickTotal
));
if
(
addressId
!=
null
){
if
(
"1"
.
equals
(
pickType
)){
//上门自提
pickInfo
=
(
OutpropApplyPickInfo
)
session
.
getAttribute
(
"pickInfo"
);
if
(
pickInfo
.
getPickType
().
equals
(
"01"
)){
UserInfo
userInfo
=
(
UserInfo
)
session
.
getAttribute
(
"USER_INFO"
);
model
.
addAttribute
(
"pickName"
,
userInfo
.
getClient_id
());
pickInfo
.
setPickType
(
"0"
);
}
else
{
pickInfo
.
setPickType
(
"1"
);
model
.
addAttribute
(
"pickName"
,
pickInfo
.
getDelegateName
());
}
}
else
if
(
"2"
.
equals
(
pickType
)){
//顺丰到付
pickInfo
.
setPickType
(
pickType
);
pickInfo
.
setCreateDate
(
String
.
valueOf
(
addressId
));
model
.
addAttribute
(
"pickName"
,
addressDao
.
queryById
(
addressId
).
getUserName
());
}
else
if
(
"3"
.
equals
(
pickType
)){
//转赵涌在线
pickInfo
=
(
OutpropApplyPickInfo
)
session
.
getAttribute
(
"pickInfo"
);
pickInfo
.
setPickType
(
pickType
);
model
.
addAttribute
(
"pickName"
,
pickInfo
.
getZhaoonlineId
());
}
session
.
setAttribute
(
"pickInfo"
,
pickInfo
);
model
.
addAttribute
(
"pickDate"
,
pickInfo
.
getPickDate
());
model
.
addAttribute
(
"pickType"
,
pickType
);
model
.
addAttribute
(
"applyList"
,
applyList
);
model
.
addAttribute
(
"warehousingCharges"
,
totalAmount
);
model
.
addAttribute
(
"totalAmount"
,
totalAmount
.
add
(
new
BigDecimal
(
"6"
)));
...
...
src/main/java/com/cjs/site/biz/user/pick/PickPayBiz.java
View file @
089d641
...
...
@@ -44,10 +44,6 @@ public class PickPayBiz {
private
DataSourceTransactionManager
transactionManager
;
public
Map
<
String
,
Object
>
createOrder
(
HttpSession
session
)
{
String
pickType
=
(
String
)
session
.
getAttribute
(
"pickType"
);
OutpropApplyPickInfo
pickInfo
=
(
OutpropApplyPickInfo
)
session
.
getAttribute
(
"pickInfo"
);
System
.
out
.
println
(
"---------------------------"
+
pickType
);
System
.
out
.
println
(
"---------------------------"
+
JsonUtil
.
toJson
(
pickInfo
));
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
result
.
put
(
"code"
,
true
);
...
...
@@ -69,14 +65,17 @@ public class PickPayBiz {
createQrCode
.
setTotalAmount
(
String
.
valueOf
(
totalAmount
.
multiply
(
BigDecimal
.
valueOf
(
100
)).
intValue
()));
createQrCode
.
setRequestTimestamp
(
DateUtil
.
getNow
());
createQrCode
.
setBillDate
(
DateUtil
.
getNow
(
DateEnum
.
DATE
));
createQrCode
.
setSrcReserve
(
pickNo
);
//此处拼接提货信息
OutpropApplyPickInfo
pickInfo
=
(
OutpropApplyPickInfo
)
session
.
getAttribute
(
"pickInfo"
);
pickInfo
.
setPickNo
(
pickNo
);
createQrCode
.
setSrcReserve
(
JsonUtil
.
toJsonRemoveNull
(
pickInfo
));
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
String
>
mapTypes
=
JsonUtil
.
fromJson
(
JsonUtil
.
toJson
(
createQrCode
),
Map
.
class
);
String
json
=
UnionPayUtil
.
sendPost
(
UnionConstants
.
CREATE_ORDER
,
mapTypes
);
UnionResponse
response
=
JsonUtil
.
fromJson
(
json
,
UnionResponse
.
class
);
if
(
response
!=
null
&&
response
.
getErrCode
().
equals
(
UnionConstants
.
SUCCESS_CODE
))
{
result
.
put
(
"qrCode"
,
UnionPayUtil
.
createQrCode
(
createQrCode
.
getQrCodeId
()));
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
pickNo
);
insertPickPay
(
userId
,
createQrCode
.
getBillNo
(),
pickNo
,
createQrCode
.
getSrcReserve
()
);
}
else
{
result
.
put
(
"code"
,
false
);
result
.
put
(
"msg"
,
response
.
getErrMsg
());
...
...
@@ -101,8 +100,14 @@ public class PickPayBiz {
update
.
setStatus
(
"2"
);
outpropApplyPayDao
.
update
(
update
);
//todo 更新库存,生成提货单<包含提货类型,提货人,提货日期,保价费>
OutpropApplyPickInfo
pickInfo
=
JsonUtil
.
fromJson
(
result
.
get
(
"srcReserve"
),
OutpropApplyPickInfo
.
class
);
if
(
"0"
.
equals
(
pickInfo
.
getPickType
())
||
"1"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
selfPick
(
pickInfo
);
}
else
if
(
"2"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
expressPick
(
pickInfo
,
Integer
.
parseInt
(
pickInfo
.
getCreateDate
()));
}
else
if
(
"3"
.
equals
(
pickInfo
.
getPickType
()))
{
pickBiz
.
zhaoonlinePick
(
pickInfo
);
}
}
transactionManager
.
commit
(
status
);
return
true
;
...
...
@@ -113,13 +118,14 @@ public class PickPayBiz {
return
false
;
}
private
void
insertPickPay
(
String
clientId
,
String
tradeNo
,
String
applyNo
)
{
private
void
insertPickPay
(
String
clientId
,
String
tradeNo
,
String
applyNo
,
String
extInfo
)
{
OutpropApplyPayInfo
insert
=
new
OutpropApplyPayInfo
();
insert
.
setCreatedAt
(
DateUtil
.
getNow
());
insert
.
setClientId
(
clientId
);
insert
.
setStatus
(
"1"
);
insert
.
setTradeNo
(
tradeNo
);
insert
.
setApplyNo
(
applyNo
);
insert
.
setExtInfo
(
extInfo
);
outpropApplyPayDao
.
insert
(
insert
);
}
...
...
src/main/java/com/cjs/site/model/user/pick/OutpropApplyPayInfo.java
View file @
089d641
...
...
@@ -16,6 +16,7 @@ public class OutpropApplyPayInfo extends BaseInfo {
private
String
payAt
;
private
String
createdAt
;
private
String
updatedAt
;
private
String
extInfo
;
public
String
getTradeNo
()
{
return
tradeNo
;
...
...
@@ -72,4 +73,12 @@ public class OutpropApplyPayInfo extends BaseInfo {
public
void
setUpdatedAt
(
String
updatedAt
)
{
this
.
updatedAt
=
updatedAt
;
}
public
String
getExtInfo
()
{
return
extInfo
;
}
public
void
setExtInfo
(
String
extInfo
)
{
this
.
extInfo
=
extInfo
;
}
}
...
...
src/main/java/com/cjs/site/util/lang/JsonUtil.java
View file @
089d641
...
...
@@ -8,6 +8,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -62,6 +63,16 @@ public class JsonUtil {
}
}
public
static
String
toJsonRemoveNull
(
Object
obj
){
try
{
mapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
return
mapper
.
writeValueAsString
(
obj
);
}
catch
(
JsonProcessingException
e
)
{
logger
.
error
(
"write to json string error:"
+
obj
,
e
);
return
null
;
}
}
/**
* 将单个键值对转换成JSON字符串,用于返回只有一个键值对json时的便捷方法
* @param obj 目标对象
...
...
src/main/resources/mybatis/user/pick/out-prop-apply-pay-mapper.xml
View file @
089d641
...
...
@@ -10,16 +10,17 @@
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"payAt"
column=
"PAY_AT"
/>
<result
property=
"status"
column=
"STATUS"
/>
<result
property=
"extInfo"
column=
"EXT_INFO"
/>
</resultMap>
<sql
id=
"base_field"
>
TRADE_NO,CREATED_AT,UPDATED_AT,APPLY_NO,PAY_AT,STATUS
TRADE_NO,CREATED_AT,UPDATED_AT,APPLY_NO,PAY_AT,STATUS
,EXT_INFO
</sql>
<insert
id=
"insert"
parameterType=
"OutpropApplyPayInfo"
>
INSERT INTO HS_ASSET.OUTPROPAPPLY_PAY (TRADE_NO,CREATED_AT,UPDATED_AT,APPLY_NO,PAY_AT,STATUS)
INSERT INTO HS_ASSET.OUTPROPAPPLY_PAY (TRADE_NO,CREATED_AT,UPDATED_AT,APPLY_NO,PAY_AT,STATUS
,EXT_INFO
)
VALUES (#{tradeNo, jdbcType=VARCHAR}, #{createdAt, jdbcType=VARCHAR}, #{updatedAt, jdbcType=VARCHAR},
#{applyNo, jdbcType=VARCHAR}, #{payAt, jdbcType=VARCHAR}, #{status, jdbcType=VARCHAR})
#{applyNo, jdbcType=VARCHAR}, #{payAt, jdbcType=VARCHAR}, #{status, jdbcType=VARCHAR}
, #{extInfo, jdbcType=VARCHAR}
)
</insert>
<select
id=
"selectByTradeNo"
parameterType=
"java.lang.String"
resultMap=
"BaseMap"
>
...
...
src/main/webapp/view/user/pick/payInfo.jsp
View file @
089d641
...
...
@@ -100,9 +100,10 @@
提货方式:
</div>
<div
style=
"display: inline-block;vertical-align: top;width: 500px;"
>
<c:if
test=
"${pickType == '1'}"
>
上门自提
</c:if>
<c:if
test=
"${pickType == '2' }"
>
顺丰到付
</c:if>
<c:if
test=
"${pickType == '3' }"
>
转赵涌在线
</c:if>
<c:if
test=
"${pickInfo.pickType == 0}"
>
上门自提
</c:if>
<c:if
test=
"${pickInfo.pickType == 1}"
>
委托自提
</c:if>
<c:if
test=
"${pickInfo.pickType == 2}"
>
顺丰到付
</c:if>
<c:if
test=
"${pickInfo.pickType == 3}"
>
转赵涌在线
</c:if>
</div>
</div>
<div
style=
"width: 100%;height: 30px;line-height: 30px;width: 620px;"
>
...
...
@@ -113,7 +114,7 @@
${pickName }
</div>
</div>
<c:if
test=
"${pickType ==
'1'
}"
>
<c:if
test=
"${pickType ==
1 or pickType == 2
}"
>
<div
style=
"width: 100%;height: 30px;line-height: 30px;width: 620px;"
>
<div
style=
"display: inline-block;vertical-align: top;width: 100px;"
>
提货日期:
...
...
Please
register
or
login
to post a comment