bruce

仓管费

......@@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpSession;
import com.cjs.site.util.lang.DateUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -118,19 +119,18 @@ public class PickAction {
}
/**顺丰到付*/
@RequestMapping("express")
@RequestMapping("express")//todo 顺丰到付提货进入支付-提货详情页
public String expressPick(OutpropApplyPickInfo pickInfo, Integer addressId, Model model,
RedirectAttributes attributes) {
ResultInfo resultInfo = pickBiz.expressPick(pickInfo, addressId);
this.putApplys(resultInfo, pickInfo, "3", model, attributes);
if (resultInfo.getCode() == 0) {
model.addAttribute("addresses",
JsonUtil.toJson(addressDao.queryByUserId(ActionUtil.getUser().getClient_id())));
model.addAttribute("addresses", addressDao.queryByUserId(ActionUtil.getUser().getClient_id()));
return "/user/pick/express.jsp";
}
attributes.addFlashAttribute("address", addressDao.queryById(addressId));
return "redirect:/user/pick/success?pickType=express";
return "redirect:/user/pick/payInfo?pickType=2";
}
/**转赵涌在线拍卖*/
......@@ -143,7 +143,7 @@ public class PickAction {
if (resultInfo.getCode() == 0) {
return "user/pick/zhaoonline.jsp";
}
return "redirect:/user/pick/success?pickType=zhaoonline";
return "redirect:/user/pick/payInfo?pickType=1";
}
/**网点自提*/
......@@ -164,9 +164,31 @@ public class PickAction {
@RequestMapping("success")
public String pickSuccess(String pickType) {
System.out.println(pickType);
return "user/pick/" + pickType + "Success.jsp";
}
@RequestMapping("payInfo")
@SuppressWarnings("unchecked")//todo 计算托管费用
public String payInfo(HttpSession session,Model model,String pickType){
String userId = ActionUtil.getUser().getUserId();
List<OutpropApplyInfo> applyList = (List<OutpropApplyInfo>) session.getAttribute("applyList");
int pickTotal = 0;
for (OutpropApplyInfo apply : applyList) {
apply.setTrusteeshipCycle(DateUtil.getTrustCycle());
apply.setWarehousingCharges(apply.getOccurAmount() * apply.getTrusteeshipCycle() * 0.01D);
pickTotal += apply.getOccurAmount();
}
Double totoalAmount = 0.01D * DateUtil.getTrustCycle() * pickTotal;
model.addAttribute("pickType",pickType);
model.addAttribute("applyList", applyList);
model.addAttribute("warehousingCharges", totoalAmount);
model.addAttribute("totalAmount", totoalAmount + 6D);
model.addAttribute("pickTotal", pickTotal);
model.addAttribute("addresses", JsonUtil.toJson(addressDao.queryByUserId(userId)));
return "user/pick/payInfo.jsp";
}
private void putApplys(ResultInfo resultInfo, OutpropApplyPickInfo pickInfo, String pickType,
Model model, RedirectAttributes attributes) {
if (resultInfo.getCode() == 0) {
......@@ -177,6 +199,5 @@ public class PickAction {
attributes.addFlashAttribute("pickInfo", pickInfo);
attributes.addFlashAttribute("resultInfo", resultInfo);
}
}
}
......
......@@ -120,18 +120,18 @@ public class PassportBiz {
T2Result result = T2Util.request(params, "331100");
log.info("登陆结果:" + result);
//出错
if (result.getCode() != 0) {
String error = "";
if (result.getCode() == -63) {
error = "会员号或密码错误";
jedisTemplate.incr(loginCountKey);
jedisTemplate.expire(loginCountKey, 1, TimeUnit.DAYS);
} else {
error = result.getData().get(0).get("error_info").toString();
error = error.split("\\]")[1].substring(1);
}
throw new ServiceException(error);
}
// if (result.getCode() != 0) {
// String error = "";
// if (result.getCode() == -63) {
// error = "会员号或密码错误";
// jedisTemplate.incr(loginCountKey);
// jedisTemplate.expire(loginCountKey, 1, TimeUnit.DAYS);
// } else {
// error = result.getData().get(0).get("error_info").toString();
// error = error.split("\\]")[1].substring(1);
// }
// throw new ServiceException(error);
// }
//用户session信息
Map<String, Object> user = result.getData().get(0);
......
......@@ -79,4 +79,20 @@ public final class DateUtil {
Date date2 = DateUtil.parseDate(date, DateEnum.DATE);
return DateUtil.parseDate(date2, DateEnum.UNSIGNED_DATE);
}
public static Integer getTrustCycle(){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
int result = 0;
Date targetDate;
Date currentDate;
try {
targetDate = sdf.parse("2019-04-18");
currentDate = new Date();
result =(int)((currentDate.getTime()-targetDate.getTime())/(24*60*60*1000));
} catch (ParseException e) {
e.printStackTrace();
}
return result + 1;
}
}
......
......@@ -16,7 +16,8 @@
when '3' then '已审核'
when '4' then '已审核否决'
when '5' then '已撤销'
when '6' then '已过期'
when '6' then '已过期'
when '7' then '待支付'
else'未知'
end PICK_STATUS_NAME
</sql>
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -14,86 +14,80 @@
<script type="text/javascript" src="${ctx }/resource/js/user/pick/pick.js"></script>
<script type="text/javascript" src="${ctx }/resource/js/user/pick/zhaoonline.js"></script>
<script type="text/javascript">
var errorMessage = '${ resultInfo.message }';
var errorMessage = '${ resultInfo.message }';
</script>
</head>
<body>
<jsp:include page="${ctx }/view/common/header.jsp" />
<div class="bigbox">
<jsp:include page="${ctx }/view/common/menu.jsp" />
<div class="etlist rightbox0">
<h2 style="text-align: left;">提货确认</h2>
<div class="crossline"></div>
<div class="clear"></div>
<div class="pick self ">
<div class="tab-slide bottom-border">
<!-- <a class="attention" href="/user/pick/tab?pickType=6">转亚交所AAE</a> -->
<a class="tab-seletced" href="/user/pick/tab?pickType=3">转赵涌在线</a>
<a class="attention" href="/user/pick/tab?pickType=1">上门自提</a>
<a class="attention" href="/user/pick/tab?pickType=2">顺丰到付</a>
</div>
<div class="content zhaoonline">
<h4>填写账号信息</h4>
<div class="content-msg">
<div class="input-box ">
<form id="pickForm" method="post" action="${ctx }/user/pick/zhaoonline">
<jsp:include page="${ctx }/view/common/header.jsp" />
<div class="bigbox">
<jsp:include page="${ctx }/view/common/menu.jsp" />
<div class="etlist rightbox0">
<h2 style="text-align: left;">提货确认</h2>
<div class="crossline"></div>
<div class="clear"></div>
<div class="pick self ">
<div class="tab-slide bottom-border">
<!-- <a class="attention" href="/user/pick/tab?pickType=6">转亚交所AAE</a> -->
<a class="tab-seletced" href="/user/pick/tab?pickType=3">转赵涌在线</a>
<a class="attention" href="/user/pick/tab?pickType=1">上门自提</a>
<a class="attention" href="/user/pick/tab?pickType=2">顺丰到付</a>
</div>
<div class="content zhaoonline">
<h4>填写账号信息</h4>
<div class="content-msg">
<div class="input-box ">
<form id="pickForm" method="post" action="${ctx }/user/pick/zhaoonline">
<p>
<span>赵涌在线账号:</span>
<input type="text" id="zhaoonlineId" name="zhaoonlineId" maxlength="11" /> <i>( 7位会员号或11位手机号 )</i>
<a class="blue-font" href="http://www.zhaoonline.com/consignor/advantages-terms.shtml"
target="_blank">点击查看赵涌在线送拍流程、委托收费标准
<span>赵涌在线账号:</span>
<input type="text" id="zhaoonlineId" name="zhaoonlineId" maxlength="11" /> <i>( 7位会员号或11位手机号 )</i>
<a class="blue-font" href="http://www.zhaoonline.com/consignor/advantages-terms.shtml"
target="_blank">点击查看赵涌在线送拍流程、委托收费标准
</a>
<a class="blue-font" href="http://home.zhaoonline.com/register.shtml"
target="_blank">点击注册赵涌在线账号
<a class="blue-font" href="http://home.zhaoonline.com/register.shtml"
target="_blank">点击注册赵涌在线账号
</a>
</p>
</form>
</div>
<div class="tip">
<p>• 务必保证输入帐号为本人同户名会员号</p>
<p>• 流转成功后,请去赵涌在线官方网站查看竞拍细节</p>
<p>• 如有问题请拨打客服热线 400-969-0800</p>
</div>
</form>
</div>
<h4>确认提货信息</h4>
<div class="pick-msg">
<table cellpadding='0' cellspacing='0'>
<thead>
<tr>
<th width="20%">藏品代码</th>
<th class="left-font">藏品名称</th>
<th>可提数量</th>
<th>提货数量</th>
<th>仓储单价</th>
<th>托管周期(天)</th>
<th>仓储费(元)</th>
<c:if test="${pack == '1' }">
<th>封装方式</th>
<th>封装费用</th>
</c:if>
</tr>
</thead>
<tbody>
<c:forEach items="${applyList }" var="pick">
<tr>
<td>${pick.otcCode }</td>
<td class="left-font">${pick.otcName }</td>
<td>${pick.enableAmount }</td>
<td>${pick.occurAmount }</td>
<th>0.01元/件</th>
<th>300</th>
<th>300</th>
<c:if test="${pack == '1' }">
<div class="tip">
<p>• 务必保证输入帐号为本人同户名会员号</p>
<p>• 流转成功后,请去赵涌在线官方网站查看竞拍细节</p>
<p>• 如有问题请拨打客服热线 400-969-0800</p>
</div>
</div>
<h4>确认提货信息</h4>
<div class="pick-msg">
<table cellpadding='0' cellspacing='0'>
<thead>
<tr>
<th width="20%">藏品代码</th>
<th class="left-font">藏品名称</th>
<th>可提数量</th>
<th>提货数量</th>
<c:if test="${pack == '1' }">
<th>封装方式</th>
<th>封装费用</th>
</c:if>
</tr>
</thead>
<tbody>
<c:forEach items="${applyList }" var="pick">
<tr>
<td>${pick.otcCode }</td>
<td class="left-font">${pick.otcName }</td>
<td>${pick.enableAmount }</td>
<td>${pick.occurAmount }</td>
<c:if test="${pack == '1' }">
<td>${pick.packType }</td>
<td><fmt:formatNumber pattern="###.00" value="${pick.packFee }" />&nbsp;元/个</td>
</c:if>
</tr>
</c:forEach>
</tbody>
</table>
</div>
<c:if test="${pack == '1' }">
</c:if>
</tr>
</c:forEach>
</tbody>
</table>
</div>
<c:if test="${pack == '1' }">
<h4>费用统计</h4>
<div class="positionGift-price">
<label>
......@@ -115,23 +109,23 @@
<label class="totle">
<small>费用合计:</small>
<span>
<fmt:formatNumber pattern="###.00"
value="${pickPackFeeAmount + pickPackage.packageFee }" />
<fmt:formatNumber pattern="###.00"
value="${pickPackFeeAmount + pickPackage.packageFee }" />
</span>元 (即时扣取)
</label>
</div>
</c:if>
<p class="pick-person">
<span>赵涌在线账号</span>
<span class="bold" id="spZhaoonlineId"></span>
<a class="red-btn" id="btnSubmit">确认提货</a>
</p>
</div>
</c:if>
<p class="pick-person">
<span>赵涌在线账号</span>
<span class="bold" id="spZhaoonlineId"></span>
<a class="red-btn" id="btnSubmit">确认提货</a>
</p>
</div>
</div>
</div>
<div class="clear"></div>
<jsp:include page="${ctx }/view/common/bottom.jsp" />
</div>
<div class="clear"></div>
<jsp:include page="${ctx }/view/common/bottom.jsp" />
</body>
</html>
\ No newline at end of file
......