修改更新发展基金、个人钱包业务逻辑
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
<version>1.18.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi excel -->
|
||||
|
||||
@@ -43,6 +43,13 @@ public interface UmsDevelopmentFundMapper {
|
||||
*/
|
||||
@Update("update ums_development_fund set cash_total = cash_total + #{fundCash}")
|
||||
void updateCash(BigDecimal fundCash);
|
||||
|
||||
/**
|
||||
* 发展基金
|
||||
* @return
|
||||
*/
|
||||
@Select("select id, cash_total, points_total, updated_at from ums_development_fund")
|
||||
UmsDevelopmentFund selectAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,38 @@ public class UmsDevelopmentFund implements Serializable {
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
public Integer getPointsTotal() {
|
||||
return pointsTotal;
|
||||
}
|
||||
|
||||
public void setPointsTotal(Integer pointsTotal) {
|
||||
this.pointsTotal = pointsTotal;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public BigDecimal getCashTotal() {
|
||||
return cashTotal;
|
||||
}
|
||||
|
||||
public void setCashTotal(BigDecimal cashTotal) {
|
||||
this.cashTotal = cashTotal;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UmsDevelopmentFund{" +
|
||||
|
||||
@@ -44,6 +44,17 @@ public class UmsMemberAccountTransaction implements Serializable {
|
||||
@ApiModelProperty(value = "进账积分")
|
||||
private Integer revenuePoints;
|
||||
|
||||
public Integer getFlowType() {
|
||||
return flowType;
|
||||
}
|
||||
|
||||
public void setFlowType(Integer flowType) {
|
||||
this.flowType = flowType;
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "流水类型")
|
||||
private Integer flowType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getId() {
|
||||
@@ -139,6 +150,7 @@ public class UmsMemberAccountTransaction implements Serializable {
|
||||
", createTime=" + createTime +
|
||||
", transferPaymentTime=" + transferPaymentTime +
|
||||
", revenuePoints=" + revenuePoints +
|
||||
", flowType=" + flowType +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.buy507.mall.portal.controller;
|
||||
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.model.UmsDevelopmentFund;
|
||||
import com.buy507.mall.portal.domain.*;
|
||||
import com.buy507.mall.portal.service.UmsMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -90,6 +91,13 @@ public class UmsMemberController {
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("获取发展基金")
|
||||
@RequestMapping(value = "/getDevelopmentFund", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<UmsDevelopmentFund> getDevelopmentFund() {
|
||||
UmsDevelopmentFund result = memberService.getDevelopmentFund();
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员昵称")
|
||||
@RequestMapping(value = "/updateMemberNickname", method = RequestMethod.POST)
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface MyWalletMapper {
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT revenue_amount, remarks, transfer_payment_time FROM ums_member_account_transaction " +
|
||||
"WHERE ums_member_account_transaction.member_id = #{userId} ORDER BY transfer_payment_time DESC")
|
||||
"WHERE member_id = #{userId} And flow_type = 1 ORDER BY transfer_payment_time DESC")
|
||||
List<TransactionCashVo> getCashFlow(Long userId);
|
||||
|
||||
/**
|
||||
@@ -42,6 +42,6 @@ public interface MyWalletMapper {
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT revenue_points, remarks, transfer_payment_time FROM ums_member_account_transaction " +
|
||||
"WHERE ums_member_account_transaction.member_id = #{userId} ORDER BY transfer_payment_time DESC")
|
||||
"WHERE member_id = #{userId} And flow_type = 2 ORDER BY transfer_payment_time DESC")
|
||||
List<TransactionPointsVo> getPointsFlow(Long userId);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.buy507.mall.portal.service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.buy507.mall.model.UmsDevelopmentFund;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -185,4 +186,10 @@ public interface UmsMemberService {
|
||||
* @return
|
||||
*/
|
||||
CommonResult<Map<String, Object>> personalTeam();
|
||||
|
||||
/**
|
||||
* 查询发展基金
|
||||
* @return
|
||||
*/
|
||||
UmsDevelopmentFund getDevelopmentFund();
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setTransactionState(UmsMemberAccountTransaction.TRANSACTION_STATE_YES);
|
||||
accountTransaction.setRevenuePoints(revenuePoints);
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
log.info("new Account Transaction {}" , JSONUtil.toJsonStr(accountTransaction));
|
||||
|
||||
@@ -206,6 +207,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
//即时到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -235,6 +237,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
//即时到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -281,6 +284,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setRemarks("三级代理上级积分分润");
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -308,6 +312,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
//24小时后到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.tomorrow());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -351,6 +356,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
//24小时后到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(2);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -371,6 +377,7 @@ public class MemberPointsSplitProfitService{
|
||||
accountTransaction.setMemberId(higherMember.getId());
|
||||
accountTransaction.setOrderId(order.getId());
|
||||
accountTransaction.setRemarks("四级市代理平级积分分润");
|
||||
accountTransaction.setFlowType(2);
|
||||
accountTransaction.setRevenuePoints(pointsCommission);
|
||||
|
||||
//会员金额到账
|
||||
|
||||
@@ -175,6 +175,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRemarks("会员此订单退出队列到账");
|
||||
accountTransaction.setRevenueAmount(orderQueue.getOrderAmount());
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//出局后订单状态置为2
|
||||
@@ -295,6 +296,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(higherQueue.getOrderAmount());
|
||||
//即时到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//快速出局后将订单状态置为2
|
||||
@@ -402,6 +404,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(revenueAmount);
|
||||
//
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
log.info("new Account Transaction {}" , JSONUtil.toJsonStr(accountTransaction));
|
||||
|
||||
@@ -445,6 +448,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(payAmountPercent);
|
||||
//即时到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -474,6 +478,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(tenPercent);
|
||||
//即时到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -520,6 +525,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRemarks("三级代理上级分润");
|
||||
accountTransaction.setRevenueAmount(payAmountPercent);
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -547,6 +553,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(tenPercent);
|
||||
//24小时后到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.tomorrow());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -591,6 +598,7 @@ public class MemberSplitProfitService{
|
||||
accountTransaction.setRevenueAmount(payAmountPercent);
|
||||
//24小时后到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.date());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
|
||||
//会员金额到账
|
||||
@@ -620,6 +628,7 @@ public class MemberSplitProfitService{
|
||||
|
||||
//24小时后到账
|
||||
accountTransaction.setTransferPaymentTime(DateUtil.tomorrow());
|
||||
accountTransaction.setFlowType(1);
|
||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,10 +622,6 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
result.setInviter(memberMapper.selectByPrimaryKey(teamLevel.getParentId()).getNickname());
|
||||
}
|
||||
|
||||
/*查询发展基金*/
|
||||
BigDecimal totalCash = umsDevelopmentFundMapper.getTotalCash();
|
||||
Integer totalPoints = umsDevelopmentFundMapper.getTotalPoints();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1312,6 +1308,17 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发展基金
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UmsDevelopmentFund getDevelopmentFund() {
|
||||
UmsDevelopmentFund developmentFund = new UmsDevelopmentFund();
|
||||
developmentFund = umsDevelopmentFundMapper.selectAll();
|
||||
return developmentFund;
|
||||
}
|
||||
|
||||
private Map<String, Object> getOrderInfoByDate(DateTime begin, DateTime end, UmsMember currentMember, List<Long> teamIdList) {
|
||||
|
||||
Map<String, Object> infoMap = new HashMap<>();
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.buy507.mall.portal.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@@ -18,5 +21,6 @@ public class TransactionCashVo implements Serializable {
|
||||
private String remarks;
|
||||
|
||||
//时间
|
||||
private Data transferPaymentTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferPaymentTime;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.buy507.mall.portal.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@@ -17,5 +20,6 @@ public class TransactionPointsVo implements Serializable {
|
||||
private String remarks;
|
||||
|
||||
//时间
|
||||
private Data transferPaymentTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferPaymentTime;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getProductVipStatus" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
@@ -89,7 +89,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getProductpointSareaStatus" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<select id="getProductpointsExchangeStatus" resultType="com.buy507.mall.model.PmsProduct">
|
||||
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
@@ -108,7 +108,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getVipStatusList" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
@@ -116,7 +116,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getPointStatusList" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
@@ -124,7 +124,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getPointExchangeProductList" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.*
|
||||
SELECT *
|
||||
FROM
|
||||
pms_product
|
||||
WHERE
|
||||
|
||||
Reference in New Issue
Block a user