完成充值记录接口
This commit is contained in:
parent
3b49f43789
commit
816fd81cc6
@ -175,5 +175,18 @@ public class XhpcCardController extends BaseController {
|
|||||||
return xhpcCardService.operateDevicesLog(operateDevicesLogRequest);
|
return xhpcCardService.operateDevicesLog(operateDevicesLogRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query recharging records of user
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 11:13
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
@GetMapping("/user/recharging")
|
||||||
|
public R<QueryRechargingRecordResponse> queryRechargingRecord(QueryRechargingRecordRequest queryRechargingRecordRequest) {
|
||||||
|
|
||||||
|
return xhpcCardService.queryRechargingRecord(queryRechargingRecordRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.xhpc.card.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity class of query recharge record
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 15:45
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class QueryRechargingRecordRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
@JsonProperty("userAccount")
|
||||||
|
@NotNull(message = "userAccount的参数名不正确或者userAccount的值为空,请检查传入参数")
|
||||||
|
@NotBlank(message = "userAccount的参数不能为''字符串,请检查传入参数")
|
||||||
|
private String userAccount;
|
||||||
|
/**
|
||||||
|
* 用户类型
|
||||||
|
* (0 C端用户 1 流量方用户 2社区用户 3B端用户)
|
||||||
|
*/
|
||||||
|
@JsonProperty("userType")
|
||||||
|
@NotNull(message = "userType的参数名不正确或者userType的值为空,请检查传入参数")
|
||||||
|
private Integer userType;
|
||||||
|
/**
|
||||||
|
* 卡类型(0离线,1联网)
|
||||||
|
*/
|
||||||
|
@JsonProperty("cardType")
|
||||||
|
@NotNull(message = "cardType的参数名不正确或者cardType的值为空,请检查传入参数")
|
||||||
|
private Integer cardType;
|
||||||
|
/**
|
||||||
|
* 卡号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "cardSerialNumber的参数名不正确或者cardSerialNumber的值为空,请检查传入参数")
|
||||||
|
@NotBlank(message = "cardSerialNumber的参数不能为''字符串,请检查传入参数")
|
||||||
|
@JsonProperty("cardSerialNumber")
|
||||||
|
private String cardSerialNumber;
|
||||||
|
/**
|
||||||
|
* Page number of current page
|
||||||
|
*/
|
||||||
|
private Long currentPage;
|
||||||
|
/**
|
||||||
|
* Every page shows items of data
|
||||||
|
*/
|
||||||
|
private Long items;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.xhpc.card.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper response class of interface of query recharging record
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 16:08
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class QueryRechargingRecordResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总条数
|
||||||
|
*/
|
||||||
|
@JsonProperty("totalItems")
|
||||||
|
private Long totalItems;
|
||||||
|
/**
|
||||||
|
* 数据
|
||||||
|
*/
|
||||||
|
@JsonProperty("data")
|
||||||
|
private List<DataDTO> data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一条数据
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class DataDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账户
|
||||||
|
*/
|
||||||
|
@JsonProperty("userAccount")
|
||||||
|
private String userAccount;
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
@JsonProperty("orderNumber")
|
||||||
|
private String orderNumber;
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
@JsonProperty("rechargeMoney")
|
||||||
|
private Long rechargeMoney;
|
||||||
|
/**
|
||||||
|
* 充值方式(1 微信 2 支付宝 3 平台)
|
||||||
|
*/
|
||||||
|
@JsonProperty("rechargeMethod")
|
||||||
|
private String rechargeMethod;
|
||||||
|
/**
|
||||||
|
* 订单状态(0待支付 1充值成功,2充值失败)
|
||||||
|
*/
|
||||||
|
@JsonProperty("orderStatus")
|
||||||
|
private Integer orderStatus;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("createTime")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package com.xhpc.card.mapper;
|
|||||||
import com.xhpc.card.domain.OperateCardsLogRequest;
|
import com.xhpc.card.domain.OperateCardsLogRequest;
|
||||||
import com.xhpc.card.domain.OperateDevicesLogRequest;
|
import com.xhpc.card.domain.OperateDevicesLogRequest;
|
||||||
import com.xhpc.card.pojo.TIccardLog;
|
import com.xhpc.card.pojo.TIccardLog;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -56,4 +57,22 @@ public interface TIccardLogMapper {
|
|||||||
*/
|
*/
|
||||||
Long selectCountOfDeviceLogListByCondition(OperateDevicesLogRequest operateDevicesLogRequest);
|
Long selectCountOfDeviceLogListByCondition(OperateDevicesLogRequest operateDevicesLogRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query log about recharge records by uniqueId of card
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/15 9:43
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
List<TIccardLog> selectRechargeLogByUniqueId(@Param("uniqueId") String uniqueId, @Param("currentPage") Long currentPage, @Param("items") Long items);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query log count about recharge records by uniqueId of card
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/15 9:43
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
Long selectCountRechargeLogByUniqueId(@Param("uniqueId") String uniqueId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -37,4 +37,13 @@ public interface XhpcAppUserMapper {
|
|||||||
*/
|
*/
|
||||||
List<XhpcAppUser> selectByCondition(SearchCardUserQueryCondition queryCondition);
|
List<XhpcAppUser> selectByCondition(SearchCardUserQueryCondition queryCondition);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号查找C端用户充值记录
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 17:14
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
XhpcAppUser selectByPhone(String userAccount);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -63,4 +63,13 @@ public interface XhpcCommunityPersonnelMapper {
|
|||||||
*/
|
*/
|
||||||
Long selectCountByOperatorId(@Param("operatorId") Long operatorId);
|
Long selectCountByOperatorId(@Param("operatorId") Long operatorId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query record by userAccount
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/15 17:10
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
XhpcCommunityPersonnel selectByAccount(String userAccount);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -65,4 +65,12 @@ public interface XhpcCustomersPersonnelMapper {
|
|||||||
*/
|
*/
|
||||||
Long selectCountByOperatorId(Long operatorId);
|
Long selectCountByOperatorId(Long operatorId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query record by user account
|
||||||
|
*
|
||||||
|
* @param userAccount
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
XhpcCustomersPersonnel selectByAccount(String userAccount);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.xhpc.card.mapper;
|
||||||
|
|
||||||
|
import com.xhpc.card.pojo.XhpcRechargeOrder;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface XhpcRechargeOrderMapper {
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Long rechargeOrderId);
|
||||||
|
|
||||||
|
int insert(XhpcRechargeOrder record);
|
||||||
|
|
||||||
|
int insertSelective(XhpcRechargeOrder record);
|
||||||
|
|
||||||
|
XhpcRechargeOrder selectByPrimaryKey(Long rechargeOrderId);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(XhpcRechargeOrder record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(XhpcRechargeOrder record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过用户id查找用户所有的充值记录
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 17:53
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
List<XhpcRechargeOrder> selectByUserId(@Param("appUserId") Long appUserId, @Param("currentPage") Long currentPage, @Param("items") Long items);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query count of recharge records of user by user id
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/15 16:14
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
Long selectCountByUserId(@Param("appUserId") Long appUserId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
package com.xhpc.card.pojo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xhpc_recharge_order
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class XhpcRechargeOrder implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单id
|
||||||
|
*/
|
||||||
|
private Long rechargeOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单编号
|
||||||
|
*/
|
||||||
|
private String rechargeOrderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付订单号
|
||||||
|
*/
|
||||||
|
private String prepayId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝订单编号
|
||||||
|
*/
|
||||||
|
private String alipayNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值渠道(1微信 2支付宝 3平台)
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0待支付 1充值成功,2充值失败)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单来源(0 C端用户 1 流量方用户 2社区用户 3B端用户)
|
||||||
|
*/
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@ -139,4 +139,14 @@ public interface IXhpcCardService {
|
|||||||
*/
|
*/
|
||||||
R<OperateDevicesLogResponse> operateDevicesLog(OperateDevicesLogRequest operateDevicesLogRequest);
|
R<OperateDevicesLogResponse> operateDevicesLog(OperateDevicesLogRequest operateDevicesLogRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query recharge record of card
|
||||||
|
* ps:query card equals query account
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/14 15:55
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
R<QueryRechargingRecordResponse> queryRechargingRecord(QueryRechargingRecordRequest queryRechargingRecordRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
|||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
@Resource
|
@Resource
|
||||||
private TIccardLogMapper tIccardLogMapper;
|
private TIccardLogMapper tIccardLogMapper;
|
||||||
|
@Resource
|
||||||
|
private XhpcRechargeOrderMapper xhpcRechargeOrderMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R cardStartup(String cardno, String serialNumber, String rateModelId) {
|
public R cardStartup(String cardno, String serialNumber, String rateModelId) {
|
||||||
@ -515,6 +517,113 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
|||||||
return R.ok(operateDevicesLogResponse);
|
return R.ok(operateDevicesLogResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<QueryRechargingRecordResponse> queryRechargingRecord(QueryRechargingRecordRequest queryRechargingRecordRequest) {
|
||||||
|
//计算分页索引
|
||||||
|
long startIndex = MyPagingUtil.calculateStartIndex(queryRechargingRecordRequest.getCurrentPage(), queryRechargingRecordRequest.getItems());
|
||||||
|
queryRechargingRecordRequest.setCurrentPage(startIndex);
|
||||||
|
QueryRechargingRecordResponse queryRechargingRecordResponse = new QueryRechargingRecordResponse();
|
||||||
|
queryRechargingRecordResponse.setData(new ArrayList<>());
|
||||||
|
queryRechargingRecordResponse.setTotalItems(0L);
|
||||||
|
Integer cardType = queryRechargingRecordRequest.getCardType();
|
||||||
|
//如果卡是离线卡
|
||||||
|
if (cardType == 0) {
|
||||||
|
List<TIccardLog> tIccardLogList = tIccardLogMapper.selectRechargeLogByUniqueId(queryRechargingRecordRequest.getCardSerialNumber(), queryRechargingRecordRequest.getCurrentPage(), queryRechargingRecordRequest.getItems());
|
||||||
|
if (tIccardLogList.isEmpty()) {
|
||||||
|
R.ok(queryRechargingRecordResponse);
|
||||||
|
}
|
||||||
|
Long recordsCount = tIccardLogMapper.selectCountRechargeLogByUniqueId(queryRechargingRecordRequest.getCardSerialNumber());
|
||||||
|
queryRechargingRecordResponse.setTotalItems(recordsCount);
|
||||||
|
for (TIccardLog tIccardLog : tIccardLogList) {
|
||||||
|
String log = tIccardLog.getLog();
|
||||||
|
CardLogInfo cardLogInfo = JSONUtil.toBean(log, CardLogInfo.class);
|
||||||
|
CardLogInfo.CardInfoDTO cardInfo = cardLogInfo.getCardInfo();
|
||||||
|
//Get userAccount by userIndex
|
||||||
|
Integer userIndex = cardInfo.getUserIndex();
|
||||||
|
TIccardUsers tIccardUsers = tIccardUsersMapper.selectByPrimaryKey(userIndex);
|
||||||
|
String accountStr = tIccardUsers.getPhone();
|
||||||
|
QueryRechargingRecordResponse.DataDTO dataDTO = new QueryRechargingRecordResponse.DataDTO();
|
||||||
|
dataDTO.setUserAccount(accountStr);
|
||||||
|
//Get orderNumber(not found in the MySQL database)
|
||||||
|
dataDTO.setOrderNumber(null);
|
||||||
|
//Get rechargeMoney
|
||||||
|
dataDTO.setRechargeMoney(Long.valueOf(cardInfo.getPrepay()));
|
||||||
|
//Get rechargeMethod (not found in the MySQL database)
|
||||||
|
dataDTO.setRechargeMethod(null);
|
||||||
|
dataDTO.setOrderStatus(null);
|
||||||
|
dataDTO.setCreateTime(MyDateUtil.parseDateToStr(tIccardLog.getCreatetime()));
|
||||||
|
queryRechargingRecordResponse.getData().add(dataDTO);
|
||||||
|
}
|
||||||
|
return R.ok(queryRechargingRecordResponse);
|
||||||
|
} else {
|
||||||
|
//如果是联网卡
|
||||||
|
//Get user id
|
||||||
|
switch (queryRechargingRecordRequest.getUserType()) {
|
||||||
|
case 0:
|
||||||
|
XhpcAppUser xhpcAppUser = xhpcAppUserMapper.selectByPhone(queryRechargingRecordRequest.getUserAccount());
|
||||||
|
List<XhpcRechargeOrder> xhpcRechargeOrderList = xhpcRechargeOrderMapper.selectByUserId(xhpcAppUser.getAppUserId(), queryRechargingRecordRequest.getCurrentPage(), queryRechargingRecordRequest.getItems());
|
||||||
|
if (xhpcRechargeOrderList.isEmpty()) {
|
||||||
|
return R.ok(queryRechargingRecordResponse);
|
||||||
|
}
|
||||||
|
Long recordsCount = xhpcRechargeOrderMapper.selectCountByUserId(xhpcAppUser.getAppUserId());
|
||||||
|
queryRechargingRecordResponse.setTotalItems(recordsCount);
|
||||||
|
for (XhpcRechargeOrder xhpcRechargeOrder : xhpcRechargeOrderList) {
|
||||||
|
QueryRechargingRecordResponse.DataDTO dataDTO = new QueryRechargingRecordResponse.DataDTO();
|
||||||
|
dataDTO.setUserAccount(xhpcAppUser.getPhone());
|
||||||
|
queryRechargeRecordToEncapsulateDTO(queryRechargingRecordResponse, xhpcRechargeOrder, dataDTO);
|
||||||
|
}
|
||||||
|
return R.ok(queryRechargingRecordResponse);
|
||||||
|
case 2:
|
||||||
|
XhpcCommunityPersonnel xhpcCommunityPersonnel = xhpcCommunityPersonnelMapper.selectByAccount(queryRechargingRecordRequest.getUserAccount());
|
||||||
|
List<XhpcRechargeOrder> xhpcRechargeOrderList1 = xhpcRechargeOrderMapper.selectByUserId(xhpcCommunityPersonnel.getCommunityPersonnelId(), queryRechargingRecordRequest.getCurrentPage(), queryRechargingRecordRequest.getItems());
|
||||||
|
if (xhpcRechargeOrderList1.isEmpty()) {
|
||||||
|
R.ok(queryRechargingRecordResponse);
|
||||||
|
}
|
||||||
|
Long recordsCount1 = xhpcRechargeOrderMapper.selectCountByUserId(xhpcCommunityPersonnel.getCommunityId());
|
||||||
|
queryRechargingRecordResponse.setTotalItems(recordsCount1);
|
||||||
|
for (XhpcRechargeOrder xhpcRechargeOrder : xhpcRechargeOrderList1) {
|
||||||
|
QueryRechargingRecordResponse.DataDTO dataDTO = new QueryRechargingRecordResponse.DataDTO();
|
||||||
|
dataDTO.setUserAccount(xhpcCommunityPersonnel.getAccount());
|
||||||
|
queryRechargeRecordToEncapsulateDTO(queryRechargingRecordResponse, xhpcRechargeOrder, dataDTO);
|
||||||
|
}
|
||||||
|
return R.ok(queryRechargingRecordResponse);
|
||||||
|
case 3:
|
||||||
|
XhpcCustomersPersonnel xhpcCustomersPersonnel = xhpcCustomersPersonnelMapper.selectByAccount(queryRechargingRecordRequest.getUserAccount());
|
||||||
|
List<XhpcRechargeOrder> xhpcRechargeOrderList2 = xhpcRechargeOrderMapper.selectByUserId(xhpcCustomersPersonnel.getCustomersId(), queryRechargingRecordRequest.getCurrentPage(), queryRechargingRecordRequest.getItems());
|
||||||
|
if (xhpcRechargeOrderList2.isEmpty()) {
|
||||||
|
R.ok(queryRechargingRecordResponse);
|
||||||
|
}
|
||||||
|
Long recordsCount2 = xhpcRechargeOrderMapper.selectCountByUserId(xhpcCustomersPersonnel.getCustomersId());
|
||||||
|
queryRechargingRecordResponse.setTotalItems(recordsCount2);
|
||||||
|
for (XhpcRechargeOrder xhpcRechargeOrder : xhpcRechargeOrderList2) {
|
||||||
|
QueryRechargingRecordResponse.DataDTO dataDTO = new QueryRechargingRecordResponse.DataDTO();
|
||||||
|
dataDTO.setUserAccount(xhpcCustomersPersonnel.getAccount());
|
||||||
|
queryRechargeRecordToEncapsulateDTO(queryRechargingRecordResponse, xhpcRechargeOrder, dataDTO);
|
||||||
|
}
|
||||||
|
return R.ok(queryRechargingRecordResponse);
|
||||||
|
default:
|
||||||
|
return R.fail("没有此类型的用户");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于QueryRechargeRecord方法封装DTO数据
|
||||||
|
*
|
||||||
|
* @author WH
|
||||||
|
* @date 2022/2/15 18:15
|
||||||
|
* @since version-1.0
|
||||||
|
*/
|
||||||
|
private void queryRechargeRecordToEncapsulateDTO(QueryRechargingRecordResponse queryRechargingRecordResponse, XhpcRechargeOrder xhpcRechargeOrder, QueryRechargingRecordResponse.DataDTO dataDTO) {
|
||||||
|
|
||||||
|
dataDTO.setOrderNumber(xhpcRechargeOrder.getRechargeOrderNumber());
|
||||||
|
dataDTO.setRechargeMethod(String.valueOf(xhpcRechargeOrder.getType()));
|
||||||
|
dataDTO.setRechargeMoney(xhpcRechargeOrder.getAmount().longValue());
|
||||||
|
dataDTO.setOrderStatus(xhpcRechargeOrder.getStatus());
|
||||||
|
dataDTO.setCreateTime(MyDateUtil.parseDateToStr(xhpcRechargeOrder.getCreateTime()));
|
||||||
|
queryRechargingRecordResponse.getData().add(dataDTO);
|
||||||
|
}
|
||||||
|
|
||||||
private void fillUserInfo(CardUserInfo cardUserInfo, Map<String, Object> userData) {
|
private void fillUserInfo(CardUserInfo cardUserInfo, Map<String, Object> userData) {
|
||||||
|
|
||||||
cardUserInfo.setCardSerialNumber((String) userData.get("cardID"));
|
cardUserInfo.setCardSerialNumber((String) userData.get("cardID"));
|
||||||
|
|||||||
@ -91,6 +91,23 @@
|
|||||||
AND createTime <= #{logEndTime}
|
AND createTime <= #{logEndTime}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectRechargeLogByUniqueId" resultMap="BaseResultMap"
|
||||||
|
parameterType="com.xhpc.card.domain.QueryRechargingRecordRequest">
|
||||||
|
SELECT
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
FROM
|
||||||
|
t_iccard_log
|
||||||
|
WHERE
|
||||||
|
operate = 2
|
||||||
|
and uniqueID = #{uniqueId}
|
||||||
|
limit #{currentPage},#{items}
|
||||||
|
</select>
|
||||||
|
<select id="selectCountRechargeLogByUniqueId" resultType="java.lang.Long">
|
||||||
|
SELECT count(id)
|
||||||
|
FROM t_iccard_log
|
||||||
|
WHERE operate = 2
|
||||||
|
and uniqueID = #{uniqueId}
|
||||||
|
</select>
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
delete
|
delete
|
||||||
from t_iccard_log
|
from t_iccard_log
|
||||||
|
|||||||
@ -57,6 +57,14 @@
|
|||||||
</where>
|
</where>
|
||||||
limit #{currentPage},#{items}
|
limit #{currentPage},#{items}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByPhone" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from xhpc_app_user
|
||||||
|
<where>
|
||||||
|
phone = #{userAccount}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
delete
|
delete
|
||||||
from xhpc_app_user
|
from xhpc_app_user
|
||||||
|
|||||||
@ -82,6 +82,13 @@
|
|||||||
where create_type = 2
|
where create_type = 2
|
||||||
and create_id = #{operatorId}
|
and create_id = #{operatorId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByAccount" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from xhpc_community_personnel
|
||||||
|
where
|
||||||
|
account = #{userAccount}
|
||||||
|
</select>
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
delete
|
delete
|
||||||
from xhpc_community_personnel
|
from xhpc_community_personnel
|
||||||
|
|||||||
@ -82,6 +82,13 @@
|
|||||||
where create_type = 2
|
where create_type = 2
|
||||||
and create_id = #{operatorId}
|
and create_id = #{operatorId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByAccount" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from xhpc_customers_personnel
|
||||||
|
where
|
||||||
|
account = #{userAccount}
|
||||||
|
</select>
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
delete
|
delete
|
||||||
from xhpc_customers_personnel
|
from xhpc_customers_personnel
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user