添加支付宝线下产品设置

This commit is contained in:
leslie52
2016-08-05 16:26:36 +08:00
parent f1d1c152c9
commit ad68da5943
10 changed files with 150 additions and 9 deletions
@@ -53,4 +53,12 @@ public interface RpAccountService{
*/
PageBean listPage(PageParam pageParam, RpAccount rpAccount);
/**
* 根据userNo获取数据
*
* @param userNo
* @return
*/
RpAccount getDataByUserNo(String userNo);
}
@@ -59,4 +59,11 @@ public class RpAccountServiceImpl implements RpAccountService{
paramMap.put("accountNo", rpAccount.getAccountNo());
return rpAccountDao.listPage(pageParam, paramMap);
}
@Override
public RpAccount getDataByUserNo(String userNo){
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("userNo", userNo);
return rpAccountDao.getBy(paramMap);
}
}
@@ -73,7 +73,31 @@ public class RpUserPayInfo extends BaseEntity implements Serializable {
*/
private String rsaPublicKey;
public String getPayWayCode() {
public String getOfflineAppId() {
return offlineAppId;
}
public void setOfflineAppId(String offlineAppId) {
this.offlineAppId = offlineAppId;
}
public String getRsaPrivateKey() {
return rsaPrivateKey;
}
public void setRsaPrivateKey(String rsaPrivateKey) {
this.rsaPrivateKey = rsaPrivateKey;
}
public String getRsaPublicKey() {
return rsaPublicKey;
}
public void setRsaPublicKey(String rsaPublicKey) {
this.rsaPublicKey = rsaPublicKey;
}
public String getPayWayCode() {
return payWayCode;
}
@@ -85,7 +85,8 @@ public interface RpUserPayConfigService{
* 创建用户支付配置
*/
void createUserPayConfig(String userNo, String userName, String productCode, String productName, Integer riskDay, String fundIntoType,
String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key) throws PayBizException;
String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key,
String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException;
/**
* 删除支付产品
@@ -97,7 +98,8 @@ public interface RpUserPayConfigService{
* 修改用户支付配置
*/
void updateUserPayConfig(String userNo, String productCode, String productName, Integer riskDay, String fundIntoType,
String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key) throws PayBizException;
String isAutoSett, String appId, String merchantId, String partnerKey, String ali_partner, String ali_sellerId, String ali_key,
String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException;
/**
* 审核
@@ -136,7 +136,7 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
@Override
public void createUserPayConfig(String userNo, String userName, String productCode, String productName, Integer riskDay,
String fundIntoType, String isAutoSett, String appId, String merchantId, String partnerKey,
String ali_partner, String ali_sellerId, String ali_key) throws PayBizException{
String ali_partner, String ali_sellerId, String ali_key, String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException{
RpUserPayConfig payConfig = rpUserPayConfigDao.getByUserNo(userNo, null);
if(payConfig != null){
@@ -208,6 +208,9 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
rpUserPayInfo.setUserNo(userNo);
rpUserPayInfo.setUserName(userName);
rpUserPayInfo.setStatus(PublicStatusEnum.ACTIVE.name());
rpUserPayInfo.setOfflineAppId(ali_appid);
rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey);
rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey);
rpUserPayInfoService.saveData(rpUserPayInfo);
}else{
rpUserPayInfo.setEditTime(new Date());
@@ -216,6 +219,9 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
rpUserPayInfo.setPartnerKey(ali_key);
rpUserPayInfo.setPayWayCode(PayWayEnum.ALIPAY.name());
rpUserPayInfo.setPayWayName(PayWayEnum.ALIPAY.getDesc());
rpUserPayInfo.setOfflineAppId(ali_appid);
rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey);
rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey);
rpUserPayInfoService.updateData(rpUserPayInfo);
}
}
@@ -248,7 +254,7 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
@Override
public void updateUserPayConfig(String userNo, String productCode, String productName, Integer riskDay, String fundIntoType,
String isAutoSett, String appId, String merchantId, String partnerKey,
String ali_partner, String ali_sellerId, String ali_key) throws PayBizException{
String ali_partner, String ali_sellerId, String ali_key, String ali_appid, String ali_rsaPrivateKey, String ali_rsaPublicKey) throws PayBizException{
RpUserPayConfig rpUserPayConfig = rpUserPayConfigDao.getByUserNo(userNo, null);
if(rpUserPayConfig == null){
throw new PayBizException(PayBizException.USER_PAY_CONFIG_IS_NOT_EXIST,"用户支付配置不存在");
@@ -312,6 +318,9 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
rpUserPayInfo.setUserNo(userNo);
rpUserPayInfo.setUserName(rpUserPayConfig.getUserName());
rpUserPayInfo.setStatus(PublicStatusEnum.ACTIVE.name());
rpUserPayInfo.setOfflineAppId(ali_appid);
rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey);
rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey);
rpUserPayInfoService.saveData(rpUserPayInfo);
}else{
rpUserPayInfo.setEditTime(new Date());
@@ -320,6 +329,9 @@ public class RpUserPayConfigServiceImpl implements RpUserPayConfigService{
rpUserPayInfo.setPartnerKey(ali_key);
rpUserPayInfo.setPayWayCode(PayWayEnum.ALIPAY.name());
rpUserPayInfo.setPayWayName(PayWayEnum.ALIPAY.getDesc());
rpUserPayInfo.setOfflineAppId(ali_appid);
rpUserPayInfo.setRsaPrivateKey(ali_rsaPrivateKey);
rpUserPayInfo.setRsaPublicKey(ali_rsaPublicKey);
rpUserPayInfoService.updateData(rpUserPayInfo);
}
}
@@ -113,9 +113,12 @@ public class UserPayConfigController {
String ali_partner = request.getParameter("ali_partner");
String ali_key = request.getParameter("ali_key");
String ali_sellerId = request.getParameter("ali_sellerId");
String ali_appid = request.getParameter("ali_appid");
String ali_rsaPrivateKey = request.getParameter("ali_rsaPrivateKey");
String ali_rsaPublicKey = request.getParameter("ali_rsaPublicKey");
rpUserPayConfigService.createUserPayConfig(userNo, userName, productCode, productName,
rpUserPayConfig.getRiskDay(), rpUserPayConfig.getFundIntoType(), rpUserPayConfig.getIsAutoSett(), we_appId
, we_merchantId, we_partnerKey, ali_partner, ali_sellerId, ali_key);
, we_merchantId, we_partnerKey, ali_partner, ali_sellerId, ali_key, ali_appid, ali_rsaPrivateKey, ali_rsaPublicKey);
dwz.setStatusCode(DWZ.SUCCESS);
dwz.setMessage(DWZ.SUCCESS_MSG);
model.addAttribute("dwz", dwz);
@@ -160,9 +163,12 @@ public class UserPayConfigController {
String ali_partner = request.getParameter("ali_partner");
String ali_key = request.getParameter("ali_key");
String ali_sellerId = request.getParameter("ali_sellerId");
String ali_appid = request.getParameter("ali_appid");
String ali_rsaPrivateKey = request.getParameter("ali_rsaPrivateKey");
String ali_rsaPublicKey = request.getParameter("ali_rsaPublicKey");
rpUserPayConfigService.updateUserPayConfig(rpUserPayConfig.getUserNo(), productCode, productName,
rpUserPayConfig.getRiskDay(), rpUserPayConfig.getFundIntoType(), rpUserPayConfig.getIsAutoSett(),
we_appId, we_merchantId, we_partnerKey, ali_partner, ali_sellerId, ali_key);
we_appId, we_merchantId, we_partnerKey, ali_partner, ali_sellerId, ali_key, ali_appid, ali_rsaPrivateKey, ali_rsaPublicKey);
dwz.setStatusCode(DWZ.SUCCESS);
dwz.setMessage(DWZ.SUCCESS_MSG);
model.addAttribute("dwz", dwz);
@@ -28,8 +28,11 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.roncoo.pay.account.entity.RpAccount;
import com.roncoo.pay.account.entity.RpSettRecord;
import com.roncoo.pay.account.service.RpAccountService;
import com.roncoo.pay.account.service.RpSettHandleService;
import com.roncoo.pay.account.service.RpSettQueryService;
import com.roncoo.pay.common.core.dwz.DWZ;
@@ -50,6 +53,8 @@ public class SettController {
private RpSettQueryService rpSettQueryService;
@Autowired
private RpSettHandleService rpSettHandleService;
@Autowired
private RpAccountService rpAccountService;
/**
* 函数功能说明 : 查询分页数据
@@ -185,4 +190,18 @@ public class SettController {
model.addAttribute("settRecord", settRecord);
return "sett/view";
}
/**
* 函数功能说明 :根据支付产品获取支付方式
*
* @参数: @return
* @return String
* @throws
*/
@RequestMapping(value = "/getSettAmount", method = RequestMethod.GET)
@ResponseBody
public RpAccount getSettAmount(@RequestParam("userNo") String userNo) {
RpAccount rpAccount = rpAccountService.getDataByUserNo(userNo);
return rpAccount;
}
}
@@ -94,6 +94,18 @@
<td>收款账号:</td>
<td><input type="text" name="ali_sellerId" id="ali_sellerId" maxlength="200" class="required" /></td>
</tr>
<tr>
<td>APPID:</td>
<td><input type="text" name="ali_appid" id="ali_appid" maxlength="200" class="required" /></td>
</tr>
<tr>
<td>支付宝私钥:</td>
<td><input type="text" name="ali_rsaPrivateKey" id="ali_rsaPrivateKey" maxlength="200" class="required" /></td>
</tr>
<tr>
<td>支付宝公钥:</td>
<td><input type="text" name="ali_rsaPublicKey" id="ali_rsaPublicKey" maxlength="200" class="required" /></td>
</tr>
</table>
</fieldset>
@@ -134,6 +146,9 @@
$("#ali_partner").attr("class", "");
$("#ali_sellerId").attr("class", "");
$("#ali_key").attr("class", "");
$("#ali_appid").attr("class", "");
$("#ali_rsaPrivateKey").attr("class", "");
$("#ali_rsaPublicKey").attr("class", "");
if(fundIntoType == 'MERCHANT_RECEIVES'){
if(productCode != ""){
$.ajax({
@@ -157,6 +172,9 @@
$("#ali_partner").attr("class", "required");
$("#ali_sellerId").attr("class", "required");
$("#ali_key").attr("class", "required");
$("#ali_appid").attr("class", "required");
$("#ali_rsaPrivateKey").attr("class", "required");
$("#ali_rsaPublicKey").attr("class", "required");
}
}
}
@@ -93,6 +93,18 @@
<td>收款账号:</td>
<td><input type="text" name="ali_sellerId" id="ali_sellerId" maxlength="200" class="required" value="${aliUserPayInfo.partnerKey }"/></td>
</tr>
<tr>
<td>APPID:</td>
<td><input type="text" name="ali_appid" id="ali_appid" maxlength="200" class="required" value="${aliUserPayInfo.offlineAppId }"/></td>
</tr>
<tr>
<td>支付宝私钥:</td>
<td><input type="text" name="ali_rsaPrivateKey" id="ali_rsaPrivateKey" maxlength="200" class="required" value="${aliUserPayInfo.rsaPrivateKey }"/></td>
</tr>
<tr>
<td>支付宝公钥:</td>
<td><input type="text" name="ali_rsaPublicKey" id="ali_rsaPublicKey" maxlength="200" class="required" value="${aliUserPayInfo.rsaPublicKey }"/></td>
</tr>
</table>
</fieldset>
</div>
@@ -133,6 +145,9 @@ function changeWePay(){
$("#ali_partner").attr("class", "");
$("#ali_sellerId").attr("class", "");
$("#ali_key").attr("class", "");
$("#ali_appid").attr("class", "");
$("#ali_rsaPrivateKey").attr("class", "");
$("#ali_rsaPublicKey").attr("class", "");
if(fundIntoType == 'MERCHANT_RECEIVES'){
if(productCode != ""){
@@ -157,6 +172,9 @@ function changeWePay(){
$("#ali_partner").attr("class", "required");
$("#ali_sellerId").attr("class", "required");
$("#ali_key").attr("class", "required");
$("#ali_appid").attr("class", "required");
$("#ali_rsaPrivateKey").attr("class", "required");
$("#ali_rsaPublicKey").attr("class", "required");
}
}
}
@@ -13,7 +13,7 @@
<dl>
<dt>用户编号:</dt>
<dd>
<input type="text" name="user.userNo" size="25" maxlength="128" class="required readonly" />
<input type="text" name="user.userNo" id="userNo" size="25" maxlength="128" class="required readonly" />
<a class="btnLook" href="${baseURL}/user/info/lookupList" lookupGroup="user">搜索</a>
</dd>
</dl>
@@ -23,6 +23,13 @@
<input type="text" name="user.userName" maxlength="80" class="required readonly" />
</dd>
</dl>
<dl>
<dt>可结算余额:</dt>
<dd>
<input type="text" name="settAmount" id="settAmount" size="10" maxlength="30" class="readonly" />
&nbsp;<a href="javascript:void(0)" onclick="getSettAmount()" style="color: blue;">获取可结算余额</a>
</dd>
</dl>
<dl>
<dt>结算金额:</dt>
<dd>
@@ -51,4 +58,24 @@
</ul>
</div>
</form>
</div>
</div>
<script>
function getSettAmount(){
var userNo = $("#userNo").val();
if(userNo != ''){
$.ajax({
type: "GET",
dataType : "json",
data:{userNo : userNo},
url: "${baseURL }/sett/getSettAmount",
//请求成功完成后要执行的方法
success: function(obj){
$("#settAmount").val(obj.availableSettAmount);
},
error : function() {
alert("系统异常!");
}
});
}
}
</script>