mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
运营商VIP
This commit is contained in:
@@ -15,6 +15,7 @@ import com.jsowell.common.response.RestApiResponse;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||||
|
import com.jsowell.pile.dto.CreateMerchantVipDTO;
|
||||||
import com.jsowell.pile.dto.PlatformTesterDTO;
|
import com.jsowell.pile.dto.PlatformTesterDTO;
|
||||||
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
||||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||||
@@ -77,6 +78,26 @@ public class MemberBasicInfoController extends BaseController {
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运营商VIP
|
||||||
|
*/
|
||||||
|
@PostMapping ("/createMerchantVip")
|
||||||
|
public AjaxResult createMerchantVip(@RequestBody CreateMerchantVipDTO dto) {
|
||||||
|
AjaxResult ajaxResult;
|
||||||
|
try {
|
||||||
|
memberBasicInfoService.createMerchantVip(dto);
|
||||||
|
ajaxResult = AjaxResult.success();
|
||||||
|
} catch (BusinessException e) {
|
||||||
|
logger.error("新增运营商VIP error", e);
|
||||||
|
ajaxResult = AjaxResult.error(e.getMessage() + ", 新增运营商VIP失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("新增运营商VIP error", e);
|
||||||
|
ajaxResult = AjaxResult.error("发生异常, 新增运营商VIP失败");
|
||||||
|
}
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前会员表中存在的运营商列表
|
* 获取当前会员表中存在的运营商列表
|
||||||
* http://localhost:8080/member/info/getMerchantListByAuth
|
* http://localhost:8080/member/info/getMerchantListByAuth
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.jsowell.pile.dto;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运营商vip DTO
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateMerchantVipDTO {
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobileNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属运营商id
|
||||||
|
*/
|
||||||
|
private String targetMerchantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal updatePrincipalBalance;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.service;
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||||
|
import com.jsowell.pile.dto.CreateMerchantVipDTO;
|
||||||
import com.jsowell.pile.dto.PlatformTesterDTO;
|
import com.jsowell.pile.dto.PlatformTesterDTO;
|
||||||
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
||||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||||
@@ -147,4 +148,6 @@ public interface IMemberBasicInfoService {
|
|||||||
List<MemberBalanceVO> getMemberRefundAmount(List<String> memberIds);
|
List<MemberBalanceVO> getMemberRefundAmount(List<String> memberIds);
|
||||||
|
|
||||||
List<MerchantVipVO> queryMerchantVipList(QueryMemberInfoDTO dto);
|
List<MerchantVipVO> queryMerchantVipList(QueryMemberInfoDTO dto);
|
||||||
|
|
||||||
|
void createMerchantVip(CreateMerchantVipDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.jsowell.pile.domain.MemberBasicInfo;
|
|||||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||||
import com.jsowell.pile.domain.MemberWalletInfo;
|
import com.jsowell.pile.domain.MemberWalletInfo;
|
||||||
import com.jsowell.pile.domain.MemberWalletLog;
|
import com.jsowell.pile.domain.MemberWalletLog;
|
||||||
|
import com.jsowell.pile.dto.CreateMerchantVipDTO;
|
||||||
import com.jsowell.pile.dto.PlatformTesterDTO;
|
import com.jsowell.pile.dto.PlatformTesterDTO;
|
||||||
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
||||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||||
@@ -322,17 +323,19 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
BigDecimal totalAccountAmount = BigDecimal.ZERO;
|
BigDecimal totalAccountAmount = BigDecimal.ZERO;
|
||||||
BigDecimal principalBalance = BigDecimal.ZERO;
|
BigDecimal principalBalance = BigDecimal.ZERO;
|
||||||
if (StringUtils.isNotBlank(merchantId)) {
|
|
||||||
MemberWalletInfo memberWalletInfo = memberWalletInfoService.selectByMemberId(memberId, merchantId);
|
MemberWalletInfo memberWalletInfo = memberWalletInfoService.selectByMemberId(memberId, merchantId);
|
||||||
if (memberWalletInfo != null) {
|
if (memberWalletInfo != null) {
|
||||||
totalAccountAmount = memberWalletInfo.getPrincipalBalance();
|
totalAccountAmount = memberWalletInfo.getPrincipalBalance();
|
||||||
principalBalance = memberWalletInfo.getPrincipalBalance();
|
principalBalance = memberWalletInfo.getPrincipalBalance();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
vo.setTotalAccountAmount(totalAccountAmount);
|
vo.setTotalAccountAmount(totalAccountAmount);
|
||||||
vo.setPrincipalBalance(principalBalance);
|
vo.setPrincipalBalance(principalBalance);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询用户余额异常 memberId:{}, merchantId:{}", memberId, merchantId, e);
|
||||||
|
}
|
||||||
|
|
||||||
// 查询用户车牌号
|
// 查询用户车牌号
|
||||||
MemberPlateNumberRelation memberPlateNumberRelation = new MemberPlateNumberRelation();
|
MemberPlateNumberRelation memberPlateNumberRelation = new MemberPlateNumberRelation();
|
||||||
@@ -490,4 +493,24 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createMerchantVip(CreateMerchantVipDTO dto) {
|
||||||
|
// 查询一级运营商
|
||||||
|
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(dto.getTargetMerchantId());
|
||||||
|
if (StringUtils.isBlank(firstLevelMerchantId)) {
|
||||||
|
throw new BusinessException("", "没有查询到以及运营商信息");
|
||||||
|
}
|
||||||
|
// 根据手机号查询会员信息
|
||||||
|
MemberBasicInfo memberBasicInfo = memberBasicInfoMapper.selectInfoByMobileNumberAndMerchantId(dto.getMobileNumber(), firstLevelMerchantId);
|
||||||
|
if (memberBasicInfo == null) {
|
||||||
|
throw new BusinessException("", "根据手机号没有查询到会员信息");
|
||||||
|
}
|
||||||
|
UpdateMemberBalanceDTO updateMemberBalanceDTO = new UpdateMemberBalanceDTO();
|
||||||
|
updateMemberBalanceDTO.setMemberId(memberBasicInfo.getMemberId());
|
||||||
|
updateMemberBalanceDTO.setType(dto.getType());
|
||||||
|
updateMemberBalanceDTO.setUpdatePrincipalBalance(dto.getUpdatePrincipalBalance());
|
||||||
|
updateMemberBalanceDTO.setTargetMerchantId(dto.getTargetMerchantId());
|
||||||
|
updateMemberBalance(updateMemberBalanceDTO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,15 @@ export function delInfo(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开卡
|
||||||
|
export function createMerchantVip(data) {
|
||||||
|
return request({
|
||||||
|
url: '/member/info/createMerchantVip',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 修改会员基础信息
|
// 修改会员基础信息
|
||||||
export function updateMemberBalance(data) {
|
export function updateMemberBalance(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ export default {
|
|||||||
getMerchantList() {
|
getMerchantList() {
|
||||||
getMerchantList().then((response) =>{
|
getMerchantList().then((response) =>{
|
||||||
console.log("response", response)
|
console.log("response", response)
|
||||||
this.merchantList = response.obj
|
this.merchantList = response.obj;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<!--<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['member:info:add']"
|
v-hasPermi="['member:info:add']"
|
||||||
>新增</el-button>
|
>开卡</el-button>
|
||||||
</el-col>-->
|
</el-col>
|
||||||
<!--<el-col :span="1.5">
|
<!--<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@@ -151,25 +151,34 @@
|
|||||||
|
|
||||||
<!-- 添加或修改会员基础信息对话框 -->
|
<!-- 添加或修改会员基础信息对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="createMerchantVip" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="会员Id" prop="memberId">
|
<el-form-item label="选择运营商">
|
||||||
<el-input v-model="form.memberId" :disabled="true" placeholder="请输入手机号"/>
|
<el-select
|
||||||
|
v-model="createMerchantVip.targetMerchantId"
|
||||||
|
clearable placeholder="请选择运营商"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in merchantList"
|
||||||
|
:key="item.merchantName"
|
||||||
|
:label="item.merchantName"
|
||||||
|
:value="item.merchantId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手机号" prop="mobileNumber">
|
<el-form-item label="手机号码">
|
||||||
<el-input v-model="form.mobileNumber" :disabled="true" placeholder="请输入手机号"/>
|
<el-input v-model="createMerchantVip.mobileNumber" placeholder="请输入手机号码"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="昵称" prop="nickName">
|
<el-form-item label="操作类型">
|
||||||
<el-input v-model="form.nickName" placeholder="请输入昵称"/>
|
<el-radio v-model="createMerchantVip.type" label="1" border>充值</el-radio>
|
||||||
|
<el-radio v-model="createMerchantVip.type" label="2" border>扣款</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="头像url" prop="avatarUrl">
|
<el-form-item label="金额" prop="balance">
|
||||||
<el-input v-model="form.avatarUrl" placeholder="请输入头像url"/>
|
<el-input-number v-model="createMerchantVip.updatePrincipalBalance" placeholder="请输入金额" :min="0" :controls="false"
|
||||||
</el-form-item>
|
:precision="2"></el-input-number>
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitCreateMerchantVip">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -217,7 +226,7 @@ import {
|
|||||||
addInfo,
|
addInfo,
|
||||||
updateInfo,
|
updateInfo,
|
||||||
updateMemberBalance,
|
updateMemberBalance,
|
||||||
getMerchantList, queryMerchantVipList,
|
getMerchantList, queryMerchantVipList, createMerchantVip,
|
||||||
} from "@/api/member/info";
|
} from "@/api/member/info";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -268,7 +277,9 @@ export default {
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {}
|
rules: {},
|
||||||
|
// 开卡参数
|
||||||
|
createMerchantVip: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -280,7 +291,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
// this.getMerchantList();
|
this.getMerchantList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询会员基础信息列表 */
|
/** 查询会员基础信息列表 */
|
||||||
@@ -304,7 +315,7 @@ export default {
|
|||||||
getMerchantList() {
|
getMerchantList() {
|
||||||
getMerchantList().then((response) =>{
|
getMerchantList().then((response) =>{
|
||||||
console.log("response", response)
|
console.log("response", response)
|
||||||
this.merchantList = response.obj
|
this.merchantList = response.obj;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
@@ -350,7 +361,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加会员基础信息";
|
this.title = "添加运营商VIP";
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -407,6 +418,16 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/* 开卡确定按钮 */
|
||||||
|
submitCreateMerchantVip() {
|
||||||
|
console.log("submitCreateMerchantVip", this.createMerchantVip);
|
||||||
|
createMerchantVip(this.createMerchantVip).then(response => {
|
||||||
|
console.log("开卡确定按钮 response:", response);
|
||||||
|
this.$modal.msgSuccess("开卡成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
|
|||||||
Reference in New Issue
Block a user