调整支付名称
This commit is contained in:
parent
a20982eabc
commit
fd500bbd0d
|
|
@ -71,7 +71,7 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
|
|||
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
|
||||
vo.setPayTime(TimeUtils.timestampToDate(vo.getPayTime()));
|
||||
vo.setAvatar(UrlUtils.toAbsoluteUrl(vo.getAvatar()));
|
||||
vo.setPayWay(PaymentEnum.getMsgByCode(Integer.parseInt(vo.getPayWay())));
|
||||
vo.setPayWay(PaymentEnum.getPayWayMsg(Integer.parseInt(vo.getPayWay())));
|
||||
}
|
||||
|
||||
return PageResult.iPageHandle(iPage);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.mdd.admin.validate.setting.SettingPayMethodValidate;
|
|||
import com.mdd.admin.vo.setting.SettingPaymentMethodVo;
|
||||
import com.mdd.common.entity.setting.DevPayConfig;
|
||||
import com.mdd.common.entity.setting.DevPayWay;
|
||||
import com.mdd.common.enums.PaymentEnum;
|
||||
import com.mdd.common.mapper.setting.DevPayConfigMapper;
|
||||
import com.mdd.common.mapper.setting.DevPayWayMapper;
|
||||
import com.mdd.common.util.MapUtils;
|
||||
|
|
@ -51,7 +52,8 @@ public class SettingPaymentServiceImpl implements ISettingPaymentService {
|
|||
|
||||
SettingPaymentMethodVo vo = new SettingPaymentMethodVo();
|
||||
BeanUtils.copyProperties(devPayWay, vo);
|
||||
vo.setName(devPayConfig.getName());
|
||||
vo.setName(PaymentEnum.getPayWayMsg(devPayConfig.getWay()));
|
||||
vo.setShowName(devPayConfig.getName());
|
||||
vo.setIcon(UrlUtils.toAbsoluteUrl(devPayConfig.getIcon()));
|
||||
|
||||
switch (devPayWay.getScene()) {
|
||||
|
|
@ -86,6 +88,8 @@ public class SettingPaymentServiceImpl implements ISettingPaymentService {
|
|||
.orderByDesc(Arrays.asList("sort", "id")));
|
||||
|
||||
for (DevPayConfig dev : devPayConfigs) {
|
||||
dev.setShowName(dev.getName());
|
||||
dev.setName(PaymentEnum.getPayWayMsg(dev.getWay()));
|
||||
dev.setParams(MapUtils.jsonToMap(dev.getParams().toString()));
|
||||
dev.setIcon(UrlUtils.toAbsoluteUrl(dev.getIcon()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ public class SettingPaymentMethodVo {
|
|||
|
||||
private String name;
|
||||
|
||||
private String showName;
|
||||
|
||||
private String icon;
|
||||
|
||||
private Integer isDefault;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.mdd.common.entity.setting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -21,6 +22,10 @@ public class DevPayConfig implements Serializable {
|
|||
@ApiModelProperty("模版名称")
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("显示名称")
|
||||
private String showName;
|
||||
|
||||
@ApiModelProperty("渠道图标")
|
||||
private String icon;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,13 +49,16 @@ public enum PaymentEnum {
|
|||
* @param code 类型
|
||||
* @return String
|
||||
*/
|
||||
public static String getMsgByCode(Integer code){
|
||||
for(PaymentEnum enumItem: PaymentEnum.values()) {
|
||||
if (enumItem.getCode() == code) {
|
||||
return enumItem.getMsg();
|
||||
}
|
||||
public static String getPayWayMsg(Integer code){
|
||||
switch (code) {
|
||||
case 1:
|
||||
return "余额支付";
|
||||
case 2:
|
||||
return "微信支付";
|
||||
case 3:
|
||||
return "支付宝支付";
|
||||
}
|
||||
return null;
|
||||
return "未知";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue