wangbeiyong@zhaoonline.com

提货时候,余额足够就扣否则不扣

......@@ -56,7 +56,7 @@ public class ZhaoonlineBiz {
throw new ServiceException("赵涌在线账号应为7位数字用户ID或11位手机号码");
}
String uri = "http://zhaom3.services.zhao-cloud.com";
String uri = "https://appservices.zhaoonline.com";
uri += "/api/user/" + userId + "/exist";
Map<String, Object> response = restClient.getForObject(uri, Map.class);
log.info("检查赵涌在线账号是否存在[" + userId + "]:" + response);
......
......@@ -44,7 +44,7 @@ import com.cjs.site.util.web.ActionUtil;
/**
* 提货
*
*
* @author tongyufu
*
*/
......@@ -314,24 +314,35 @@ public class PickBiz {
return resultInfo;
}
String userId = ActionUtil.getUser().getUserId();
Map<String, Object> balance = fundBiz.balance(userId);
Double enableBalance = 0.00;
if(balance.get("enable_balance") != null){
enableBalance = Double.valueOf(balance.get("enable_balance").toString());
}
//普通物流提货,收取6元物流包装费
if ("0".equals(pack) && "2".equals(pickInfo.getPickType())) {
if (pickInfo.isMerge()) {
pickDao.mergeOrder(pickInfo);
} else {
//收取6元物流包装费
T2Result result = fundBiz.subtractSysFund(pickInfo.getPickNo(),
ConstInfo.Fund.USER_PICK, user.getClient_id(), -6.0,
ConstInfo.Fund.USER_PICK_REMARK);
log.info("收取提货包装费[" + pickInfo.getPickNo() + "]:" + result);
if(enableBalance >= 6){
//收取6元物流包装费
T2Result result = fundBiz.subtractSysFund(pickInfo.getPickNo(),
ConstInfo.Fund.USER_PICK, user.getClient_id(), -6.0,
ConstInfo.Fund.USER_PICK_REMARK);
log.info("收取提货包装费[" + pickInfo.getPickNo() + "]:" + result);
}
}
}
//封装提货,收取费用
if ("1".equals(pack)) {
T2Result result = fundBiz.subtractSysFund(pickInfo.getPickNo(),
ConstInfo.Fund.USER_PICK, user.getClient_id(), -pickInfo.getAmountFee(),
ConstInfo.Fund.USER_PICK_REMARK);
log.info("收取提货包装费[" + pickInfo.getPickNo() + "]:" + result);
if(enableBalance >= pickInfo.getAmountFee()){
T2Result result = fundBiz.subtractSysFund(pickInfo.getPickNo(),
ConstInfo.Fund.USER_PICK, user.getClient_id(), -pickInfo.getAmountFee(),
ConstInfo.Fund.USER_PICK_REMARK);
log.info("收取提货包装费[" + pickInfo.getPickNo() + "]:" + result);
}
}
return resultInfo;
}
......@@ -382,8 +393,10 @@ public class PickBiz {
double totalFee = 0;
String userId = ActionUtil.getUser().getUserId();
Map<String, Object> balance = fundBiz.balance(userId);
Double enableBalance = Double.valueOf(balance.get("enable_balance").toString());
Double enableBalance = 0.00;
if(balance.get("enable_balance") != null){
enableBalance = Double.valueOf(balance.get("enable_balance").toString());
}
//封装提货
if ("1".equals(pack)) {
Integer packageId = Integer.valueOf(session.getAttribute("packageId").toString());
......@@ -406,9 +419,9 @@ public class PickBiz {
totalFee += 6;
}
pickInfo.setAmountFee(totalFee);
if (enableBalance < totalFee) {
/* if (enableBalance < totalFee) {
return new ResultInfo(0, "账户可用余额少于" + totalFee + "元,无法支付提货费用");
}
}*/
return new ResultInfo(1, "");
}
......