mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-10 18:30:02 +08:00
update 汇付会员
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.service;
|
package com.jsowell.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.TypeReference;
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -274,9 +275,10 @@ public class OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 封装对象
|
// 封装对象
|
||||||
|
String amount = AdapayUtil.formatAmount(dto.getPayAmount()); // 用户支付金额
|
||||||
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
|
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
|
||||||
createAdaPaymentParam.setOrder_no(orderInfo.getOrderCode());
|
createAdaPaymentParam.setOrder_no(orderInfo.getOrderCode());
|
||||||
createAdaPaymentParam.setPay_amt(AdapayUtil.formatAmount(dto.getPayAmount()));
|
createAdaPaymentParam.setPay_amt(amount);
|
||||||
createAdaPaymentParam.setApp_id(ADAPAY_APP_ID); // todo 后面移动到配置文件中
|
createAdaPaymentParam.setApp_id(ADAPAY_APP_ID); // todo 后面移动到配置文件中
|
||||||
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
|
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
|
||||||
createAdaPaymentParam.setGoods_title("充电费用");
|
createAdaPaymentParam.setGoods_title("充电费用");
|
||||||
@@ -288,12 +290,26 @@ public class OrderService {
|
|||||||
//异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
//异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||||
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
||||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId)));
|
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId)));
|
||||||
|
|
||||||
|
// 分账对象信息
|
||||||
|
String adapayMemberId = pileStationInfoService.selectAdapayMemberId(orderInfo.getStationId());
|
||||||
|
if (StringUtils.isNotBlank(adapayMemberId)) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("member_id", adapayMemberId);
|
||||||
|
jsonObject.put("amount", amount);
|
||||||
|
jsonObject.put("fee_flag", Constants.Y);
|
||||||
|
|
||||||
|
// 分账对象信息列表,最多仅支持7个分账方,json 数组形式
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(jsonObject);
|
||||||
|
createAdaPaymentParam.setDiv_members(jsonArray.toString());
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
log.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
|
log.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
|
||||||
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam));
|
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam));
|
||||||
if (response != null && !response.isEmpty()) {
|
if (response != null && !response.isEmpty()) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(response.get("expend").toString());
|
JSONObject expend = JSONObject.parseObject(response.get("expend").toString());
|
||||||
JSONObject pay_info = jsonObject.getJSONObject("pay_info");
|
JSONObject pay_info = expend.getJSONObject("pay_info");
|
||||||
Map<String, Object> resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference<Map<String, Object>>() {
|
Map<String, Object> resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference<Map<String, Object>>() {
|
||||||
});
|
});
|
||||||
if (resultMap != null) {
|
if (resultMap != null) {
|
||||||
|
|||||||
@@ -56,4 +56,12 @@ public class AdapayMemberController extends BaseController {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询汇付结算账户
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectSettleAccount")
|
||||||
|
public AjaxResult selectSettleAccount(@RequestBody AdapayMemberInfoDTO dto) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,4 +217,10 @@ public class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||||
"org.springframework", "org.apache", "com.jsowell.common.util.file"};
|
"org.springframework", "org.apache", "com.jsowell.common.util.file"};
|
||||||
|
|
||||||
|
// Y-是
|
||||||
|
public static final String Y = "Y";
|
||||||
|
|
||||||
|
// N-否
|
||||||
|
public static final String N = "N";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,4 +94,6 @@ public interface IPileStationInfoService {
|
|||||||
List<PileStationInfo> getStationInfoForLianLian();
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
|
|
||||||
List<String> queryByStationDeptIds(List<String> stationIds);
|
List<String> queryByStationDeptIds(List<String> stationIds);
|
||||||
|
|
||||||
|
String selectAdapayMemberId(String stationId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
if (StringUtils.isNotBlank(pileStationInfo.getQrcodePrefix())) {
|
if (StringUtils.isNotBlank(pileStationInfo.getQrcodePrefix())) {
|
||||||
vo.setQrcodePrefix(pileStationInfo.getQrcodePrefix());
|
vo.setQrcodePrefix(pileStationInfo.getQrcodePrefix());
|
||||||
}
|
}
|
||||||
vo.setMerchantId(pileStationInfo.getMerchantId().toString());
|
// vo.setMerchantId(pileStationInfo.getMerchantId().toString());
|
||||||
// vo.setMerchantName(pileStationInfo.getmer());
|
// vo.setMerchantName(pileStationInfo.getmer());
|
||||||
vo.setMerchantAdminName(pileStationInfo.getStationAdminName());
|
vo.setMerchantAdminName(pileStationInfo.getStationAdminName());
|
||||||
vo.setStationStatus(Integer.parseInt(pileStationInfo.getStationStatus()));
|
vo.setStationStatus(Integer.parseInt(pileStationInfo.getStationStatus()));
|
||||||
@@ -326,18 +326,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
// 小程序站点列表页只展示对外开放的站点
|
// 小程序站点列表页只展示对外开放的站点
|
||||||
dto.setPublicFlag(Constants.ONE);
|
dto.setPublicFlag(Constants.ONE);
|
||||||
// 根据前台参数分页
|
// 根据前台参数分页
|
||||||
// PageHelper.startPage(pageNum, pageSize);
|
|
||||||
List<PileStationVO> list = pileStationInfoMapper.queryStationInfos(dto);
|
List<PileStationVO> list = pileStationInfoMapper.queryStationInfos(dto);
|
||||||
// PageInfo<PileStationVO> pageInfo = new PageInfo<>(list);
|
|
||||||
// if (CollectionUtils.isEmpty(pageInfo.getList())) {
|
|
||||||
// return PageResponse.builder()
|
|
||||||
// .pageNum(pageInfo.getPageNum())
|
|
||||||
// .pageSize(pageInfo.getPageSize())
|
|
||||||
// .list(Lists.newArrayList())
|
|
||||||
// .pages(pageInfo.getPages())
|
|
||||||
// .total(pageInfo.getTotal())
|
|
||||||
// .build();
|
|
||||||
// }
|
|
||||||
|
|
||||||
List<StationInfoVO> stationVOList = Lists.newArrayList();
|
List<StationInfoVO> stationVOList = Lists.newArrayList();
|
||||||
StationInfoVO stationVO = null;
|
StationInfoVO stationVO = null;
|
||||||
@@ -430,5 +419,15 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据站点id查询运营商配置的汇付会员id
|
||||||
|
* @param stationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String selectAdapayMemberId(String stationId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ export default {
|
|||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
},
|
},
|
||||||
// 查询汇付会员
|
// 查询汇付会员
|
||||||
getList() {
|
selectAdapayMember() {
|
||||||
console.log("this.merchantId", this.merchantId);
|
console.log("this.merchantId", this.merchantId);
|
||||||
let param = {
|
let param = {
|
||||||
merchantId: this.merchantId,
|
merchantId: this.merchantId,
|
||||||
@@ -323,9 +323,14 @@ export default {
|
|||||||
this.adapayMember = response.data;
|
this.adapayMember = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 查询汇付结算账户
|
||||||
|
selectSettleAccount() {
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.selectAdapayMember();
|
||||||
|
this.selectSettleAccount();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user