|
|
|
|
@@ -1,5 +1,6 @@
|
|
|
|
|
package com.jsowell.web.controller.pile;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.jsowell.common.annotation.Log;
|
|
|
|
|
@@ -8,9 +9,11 @@ import com.jsowell.common.core.domain.AjaxResult;
|
|
|
|
|
import com.jsowell.common.core.page.TableDataInfo;
|
|
|
|
|
import com.jsowell.common.enums.BusinessType;
|
|
|
|
|
import com.jsowell.common.enums.uniapp.BalanceChangesEnum;
|
|
|
|
|
import com.jsowell.common.exception.BusinessException;
|
|
|
|
|
import com.jsowell.common.util.StringUtils;
|
|
|
|
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
|
|
|
|
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
|
|
|
|
import com.jsowell.pile.dto.PlatformTesterDTO;
|
|
|
|
|
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
|
|
|
|
import com.jsowell.pile.service.IMemberBasicInfoService;
|
|
|
|
|
import com.jsowell.pile.service.IMemberPlateNumberRelationService;
|
|
|
|
|
@@ -18,6 +21,7 @@ import com.jsowell.pile.service.IMemberTransactionRecordService;
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
|
|
|
|
|
import com.jsowell.pile.vo.web.MemberTransactionVO;
|
|
|
|
|
import com.jsowell.pile.vo.web.PlatformTesterVO;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -33,29 +37,29 @@ import java.util.List;
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/member/info")
|
|
|
|
|
public class MemberBasicInfoController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberBasicInfoService memberBasicInfoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberBasicInfoService memberBasicInfoService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberTransactionRecordService memberTransactionRecordService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberTransactionRecordService memberTransactionRecordService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员基础信息列表
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:list')")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<MemberVO> list = memberBasicInfoService.selectMemberList(memberBasicInfo.getMobileNumber(), memberBasicInfo.getNickName());
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员基础信息列表
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:list')")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<MemberVO> list = memberBasicInfoService.selectMemberList(memberBasicInfo.getMobileNumber(), memberBasicInfo.getNickName());
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出会员基础信息列表
|
|
|
|
|
*/
|
|
|
|
|
/**
|
|
|
|
|
* 导出会员基础信息列表
|
|
|
|
|
*/
|
|
|
|
|
/*@PreAuthorize("@ss.hasPermi('member:info:export')")
|
|
|
|
|
@Log(title = "会员基础信息", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
@@ -65,127 +69,153 @@ public class MemberBasicInfoController extends BaseController {
|
|
|
|
|
util.exportExcel(response, list, "会员基础信息数据");
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取会员基础信息详细信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:query')")
|
|
|
|
|
@GetMapping(value = "/{memberId}")
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("memberId") String memberId) {
|
|
|
|
|
return AjaxResult.success(memberBasicInfoService.queryMemberInfoByMemberId(memberId));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取会员基础信息详细信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:query')")
|
|
|
|
|
@GetMapping(value = "/{memberId}")
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("memberId") String memberId) {
|
|
|
|
|
return AjaxResult.success(memberBasicInfoService.queryMemberInfoByMemberId(memberId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:query')")
|
|
|
|
|
@GetMapping(value = "/getMemberPersonPileInfo/{memberId}")
|
|
|
|
|
public AjaxResult getMemberPersonPileInfo(@PathVariable("memberId") String memberId){
|
|
|
|
|
return AjaxResult.success(memberBasicInfoService.getMemberPersonPileInfo(memberId));
|
|
|
|
|
}
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:query')")
|
|
|
|
|
@GetMapping(value = "/getMemberPersonPileInfo/{memberId}")
|
|
|
|
|
public AjaxResult getMemberPersonPileInfo(@PathVariable("memberId") String memberId) {
|
|
|
|
|
return AjaxResult.success(memberBasicInfoService.getMemberPersonPileInfo(memberId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('member:info:add')")
|
|
|
|
|
// @Log(title = "会员基础信息", businessType = BusinessType.INSERT)
|
|
|
|
|
// @PostMapping
|
|
|
|
|
// public AjaxResult add(@RequestBody MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
// return toAjax(memberBasicInfoService.insertMemberBasicInfo(memberBasicInfo));
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 新增会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('member:info:add')")
|
|
|
|
|
// @Log(title = "会员基础信息", businessType = BusinessType.INSERT)
|
|
|
|
|
// @PostMapping
|
|
|
|
|
// public AjaxResult add(@RequestBody MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
// return toAjax(memberBasicInfoService.insertMemberBasicInfo(memberBasicInfo));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:edit')")
|
|
|
|
|
@Log(title = "会员基础信息", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult edit(@RequestBody MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
return toAjax(memberBasicInfoService.updateMemberBasicInfo(memberBasicInfo));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 修改会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:edit')")
|
|
|
|
|
@Log(title = "会员基础信息", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult edit(@RequestBody MemberBasicInfo memberBasicInfo) {
|
|
|
|
|
return toAjax(memberBasicInfoService.updateMemberBasicInfo(memberBasicInfo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:remove')")
|
|
|
|
|
@Log(title = "会员基础信息", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
public AjaxResult remove(@PathVariable Integer[] ids) {
|
|
|
|
|
return toAjax(memberBasicInfoService.deleteMemberBasicInfoByIds(Lists.newArrayList(ids)));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 删除会员基础信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:remove')")
|
|
|
|
|
@Log(title = "会员基础信息", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
public AjaxResult remove(@PathVariable Integer[] ids) {
|
|
|
|
|
return toAjax(memberBasicInfoService.deleteMemberBasicInfoByIds(Lists.newArrayList(ids)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 充值/扣款余额
|
|
|
|
|
*/
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('member:balance:update')")
|
|
|
|
|
// @Log(title = "会员充值/扣款余额", businessType = BusinessType.UPDATE)
|
|
|
|
|
// @PutMapping("/updateGiftBalance")
|
|
|
|
|
// public AjaxResult updateGiftBalance(@RequestBody UpdateMemberBalanceDTO dto) {
|
|
|
|
|
// logger.info("后管充值/扣款余额 param:{}", dto.toString());
|
|
|
|
|
// // 判断入参
|
|
|
|
|
// return toAjax(memberBasicInfoService.updateMemberBalance(dto));
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 充值/扣款余额
|
|
|
|
|
*/
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('member:balance:update')")
|
|
|
|
|
// @Log(title = "会员充值/扣款余额", businessType = BusinessType.UPDATE)
|
|
|
|
|
// @PutMapping("/updateGiftBalance")
|
|
|
|
|
// public AjaxResult updateGiftBalance(@RequestBody UpdateMemberBalanceDTO dto) {
|
|
|
|
|
// logger.info("后管充值/扣款余额 param:{}", dto.toString());
|
|
|
|
|
// // 判断入参
|
|
|
|
|
// return toAjax(memberBasicInfoService.updateMemberBalance(dto));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员钱包流水
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/queryMemberBalanceChanges")
|
|
|
|
|
public TableDataInfo queryMemberBalanceChanges(@RequestBody UniAppQueryMemberBalanceDTO dto) {
|
|
|
|
|
String type = dto.getType();
|
|
|
|
|
if (!StringUtils.equals("1", type) && !StringUtils.equals("2", type)) {
|
|
|
|
|
type = "";
|
|
|
|
|
}
|
|
|
|
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
|
|
|
|
List<MemberWalletLogVO> list = memberBasicInfoService.getMemberBalanceChanges(dto.getMemberId(), type);
|
|
|
|
|
for (MemberWalletLogVO walletLogVO : list) {
|
|
|
|
|
String subType = walletLogVO.getSubType();
|
|
|
|
|
String subTypeValue = BalanceChangesEnum.getValueByCode(subType);
|
|
|
|
|
if (StringUtils.isNotBlank(subTypeValue)) {
|
|
|
|
|
walletLogVO.setSubType(subTypeValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员钱包流水
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/queryMemberBalanceChanges")
|
|
|
|
|
public TableDataInfo queryMemberBalanceChanges(@RequestBody UniAppQueryMemberBalanceDTO dto) {
|
|
|
|
|
String type = dto.getType();
|
|
|
|
|
if (!StringUtils.equals("1", type) && !StringUtils.equals("2", type)) {
|
|
|
|
|
type = "";
|
|
|
|
|
}
|
|
|
|
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
|
|
|
|
List<MemberWalletLogVO> list = memberBasicInfoService.getMemberBalanceChanges(dto.getMemberId(), type);
|
|
|
|
|
for (MemberWalletLogVO walletLogVO : list) {
|
|
|
|
|
String subType = walletLogVO.getSubType();
|
|
|
|
|
String subTypeValue = BalanceChangesEnum.getValueByCode(subType);
|
|
|
|
|
if (StringUtils.isNotBlank(subTypeValue)) {
|
|
|
|
|
walletLogVO.setSubType(subTypeValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员交易流水
|
|
|
|
|
* IMemberTransactionRecordService
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/selectMemberTransactionRecordList")
|
|
|
|
|
public TableDataInfo selectMemberTransactionRecordList(@RequestBody UniAppQueryMemberBalanceDTO dto) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<MemberTransactionVO> list = memberTransactionRecordService.selectMemberTransactionRecordList(dto.getMemberId());
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询会员交易流水
|
|
|
|
|
* IMemberTransactionRecordService
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/selectMemberTransactionRecordList")
|
|
|
|
|
public TableDataInfo selectMemberTransactionRecordList(@RequestBody UniAppQueryMemberBalanceDTO dto) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<MemberTransactionVO> list = memberTransactionRecordService.selectMemberTransactionRecordList(dto.getMemberId());
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改车牌号信息
|
|
|
|
|
* @param relation
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:edit')")
|
|
|
|
|
@Log(title = "修改车牌号信息", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PostMapping("/updatePlateNumber")
|
|
|
|
|
public AjaxResult updatePlateNumber(@RequestBody MemberPlateNumberRelation relation){
|
|
|
|
|
int i = memberPlateNumberRelationService.updatePlateNumber(relation);
|
|
|
|
|
logger.info("后管修改用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
return toAjax(i);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 修改车牌号信息
|
|
|
|
|
*
|
|
|
|
|
* @param relation
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:edit')")
|
|
|
|
|
@Log(title = "修改车牌号信息", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PostMapping("/updatePlateNumber")
|
|
|
|
|
public AjaxResult updatePlateNumber(@RequestBody MemberPlateNumberRelation relation) {
|
|
|
|
|
int i = memberPlateNumberRelationService.updatePlateNumber(relation);
|
|
|
|
|
logger.info("后管修改用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
return toAjax(i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除会员绑定的车牌号信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:remove')")
|
|
|
|
|
@Log(title = "会员绑定的车牌号信息", businessType = BusinessType.DELETE)
|
|
|
|
|
@PostMapping("/deletePlateNumber")
|
|
|
|
|
public AjaxResult deletePlateNumber(@RequestBody MemberPlateNumberRelation relation){
|
|
|
|
|
int i = memberPlateNumberRelationService.unbindingPlateNumber(relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
logger.info("后管解除绑定用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
return toAjax(i);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 删除会员绑定的车牌号信息
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('member:info:remove')")
|
|
|
|
|
@Log(title = "会员绑定的车牌号信息", businessType = BusinessType.DELETE)
|
|
|
|
|
@PostMapping("/deletePlateNumber")
|
|
|
|
|
public AjaxResult deletePlateNumber(@RequestBody MemberPlateNumberRelation relation) {
|
|
|
|
|
int i = memberPlateNumberRelationService.unbindingPlateNumber(relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
logger.info("后管解除绑定用户:{} 的车牌号:{}", relation.getMemberId(), relation.getLicensePlateNumber());
|
|
|
|
|
return toAjax(i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改平台测试员状态
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public AjaxResult updatePlatformTester() {
|
|
|
|
|
AjaxResult result = new AjaxResult();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 修改平台测试员状态
|
|
|
|
|
* http://localhost:8080/member/info/updatePlatformTester
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/updatePlatformTester")
|
|
|
|
|
public AjaxResult updatePlatformTester(@RequestBody PlatformTesterDTO dto) {
|
|
|
|
|
AjaxResult result;
|
|
|
|
|
try {
|
|
|
|
|
memberBasicInfoService.updatePlatformTester(dto);
|
|
|
|
|
result = AjaxResult.success();
|
|
|
|
|
} catch (BusinessException e) {
|
|
|
|
|
logger.error("修改平台测试员状态error param:{}", JSON.toJSONString(dto), e);
|
|
|
|
|
result = AjaxResult.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询平台测试员状态
|
|
|
|
|
* http://localhost:8080/member/info/selectPlatformTesterStatus
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/selectPlatformTesterStatus")
|
|
|
|
|
public AjaxResult selectPlatformTesterStatus(@RequestBody PlatformTesterDTO dto) {
|
|
|
|
|
AjaxResult result;
|
|
|
|
|
try {
|
|
|
|
|
PlatformTesterVO platformTesterVO = memberBasicInfoService.selectPlatformTesterStatus(dto);
|
|
|
|
|
result = AjaxResult.success(platformTesterVO);
|
|
|
|
|
} catch (BusinessException e) {
|
|
|
|
|
logger.error("查询平台测试员状态error param:{}", JSON.toJSONString(dto), e);
|
|
|
|
|
result = AjaxResult.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|