diff --git a/mall-admin/pom.xml b/mall-admin/pom.xml index b6422fd..f9ec056 100644 --- a/mall-admin/pom.xml +++ b/mall-admin/pom.xml @@ -66,6 +66,7 @@ org.projectlombok lombok true + 1.18.20 diff --git a/mall-dao/src/main/java/com/buy507/mall/mapper/UmsDevelopmentFundMapper.java b/mall-dao/src/main/java/com/buy507/mall/mapper/UmsDevelopmentFundMapper.java index adc6f04..ee33f15 100644 --- a/mall-dao/src/main/java/com/buy507/mall/mapper/UmsDevelopmentFundMapper.java +++ b/mall-dao/src/main/java/com/buy507/mall/mapper/UmsDevelopmentFundMapper.java @@ -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(); } diff --git a/mall-dao/src/main/java/com/buy507/mall/model/UmsDevelopmentFund.java b/mall-dao/src/main/java/com/buy507/mall/model/UmsDevelopmentFund.java index 3186e89..56f721d 100644 --- a/mall-dao/src/main/java/com/buy507/mall/model/UmsDevelopmentFund.java +++ b/mall-dao/src/main/java/com/buy507/mall/model/UmsDevelopmentFund.java @@ -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{" + diff --git a/mall-dao/src/main/java/com/buy507/mall/model/UmsMemberAccountTransaction.java b/mall-dao/src/main/java/com/buy507/mall/model/UmsMemberAccountTransaction.java index 5650077..ce0edf0 100644 --- a/mall-dao/src/main/java/com/buy507/mall/model/UmsMemberAccountTransaction.java +++ b/mall-dao/src/main/java/com/buy507/mall/model/UmsMemberAccountTransaction.java @@ -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 + '}'; } } \ No newline at end of file diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/controller/UmsMemberController.java b/mall-portal/src/main/java/com/buy507/mall/portal/controller/UmsMemberController.java index 3afe48d..23dfb34 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/controller/UmsMemberController.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/controller/UmsMemberController.java @@ -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; @@ -89,7 +90,14 @@ public class UmsMemberController { MemberInfoResult result = memberService.getMemberInfo(); return CommonResult.success(result); } - + + @ApiOperation("获取发展基金") + @RequestMapping(value = "/getDevelopmentFund", method = RequestMethod.GET) + @ResponseBody + public CommonResult getDevelopmentFund() { + UmsDevelopmentFund result = memberService.getDevelopmentFund(); + return CommonResult.success(result); + } @ApiOperation("修改会员昵称") @RequestMapping(value = "/updateMemberNickname", method = RequestMethod.POST) diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/dao/MyWalletMapper.java b/mall-portal/src/main/java/com/buy507/mall/portal/dao/MyWalletMapper.java index a142017..2711dd1 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/dao/MyWalletMapper.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/dao/MyWalletMapper.java @@ -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 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 getPointsFlow(Long userId); } diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/service/UmsMemberService.java b/mall-portal/src/main/java/com/buy507/mall/portal/service/UmsMemberService.java index 5037269..0e1ead1 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/service/UmsMemberService.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/service/UmsMemberService.java @@ -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> personalTeam(); + + /** + * 查询发展基金 + * @return + */ + UmsDevelopmentFund getDevelopmentFund(); } diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberPointsSplitProfitService.java b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberPointsSplitProfitService.java index 1994a66..a258076 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberPointsSplitProfitService.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberPointsSplitProfitService.java @@ -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); //会员金额到账 diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberSplitProfitService.java b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberSplitProfitService.java index f862104..13fab4d 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberSplitProfitService.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/MemberSplitProfitService.java @@ -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); } } diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/UmsMemberServiceImpl.java b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/UmsMemberServiceImpl.java index e90dd0a..ff6936f 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/UmsMemberServiceImpl.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/service/impl/UmsMemberServiceImpl.java @@ -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 getOrderInfoByDate(DateTime begin, DateTime end, UmsMember currentMember, List teamIdList) { Map infoMap = new HashMap<>(); diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionCashVo.java b/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionCashVo.java index ad45480..a9a3ad7 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionCashVo.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionCashVo.java @@ -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; } diff --git a/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionPointsVo.java b/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionPointsVo.java index df7d12a..a5c12fc 100644 --- a/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionPointsVo.java +++ b/mall-portal/src/main/java/com/buy507/mall/portal/vo/TransactionPointsVo.java @@ -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; } diff --git a/mall-portal/src/main/resources/dao/HomeDao.xml b/mall-portal/src/main/resources/dao/HomeDao.xml index ad91a71..942346d 100644 --- a/mall-portal/src/main/resources/dao/HomeDao.xml +++ b/mall-portal/src/main/resources/dao/HomeDao.xml @@ -80,7 +80,7 @@ - SELECT p.* + SELECT * FROM pms_product WHERE @@ -108,7 +108,7 @@