Compare commits
2 Commits
0a2e13c428
...
main-zhb
| Author | SHA1 | Date | |
|---|---|---|---|
| fdec029158 | |||
| 153dc8751e |
@@ -66,6 +66,7 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
<version>1.18.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi excel -->
|
||||
|
||||
@@ -84,7 +84,8 @@ public class PmsProductServiceImpl implements PmsProductService {
|
||||
log.info("b"+String.valueOf(productParam.getProductAttributeCategoryId()));
|
||||
log.info("c"+String.valueOf(product.getProductCategoryId()));
|
||||
log.info("d"+String.valueOf(product.getProductAttributeCategoryId()));
|
||||
productMapper.insertSelective(product);
|
||||
product.setOriginalPrice(productParam.getPrice());
|
||||
productMapper.insertAll(product);
|
||||
//根据促销类型设置价格:、阶梯价格、满减价格
|
||||
Long productId = product.getId();
|
||||
//会员价格
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface PmsProductMapper {
|
||||
|
||||
PmsProduct getProductByOrderSn(String orderSn);
|
||||
|
||||
|
||||
int insertAll(PmsProduct product);
|
||||
|
||||
|
||||
}
|
||||
@@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.buy507.mall.model.OmsOrder">
|
||||
<insert id="insert" useGeneratedKeys="true" parameterType="com.buy507.mall.model.OmsOrder">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
|
||||
@@ -940,4 +940,58 @@
|
||||
LIMIT 1
|
||||
)
|
||||
</select>
|
||||
|
||||
<insert id="insertAll" useGeneratedKeys="true" parameterType="com.buy507.mall.model.PmsProduct">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
INSERT INTO pms_product
|
||||
SET
|
||||
brand_id = #{brandId},
|
||||
product_category_id = #{productCategoryId},
|
||||
feight_template_id = #{feightTemplateId},
|
||||
product_attribute_category_id = #{productAttributeCategoryId},
|
||||
name = #{name},
|
||||
pic = #{pic},
|
||||
product_sn = #{productSn},
|
||||
delete_status = #{deleteStatus},
|
||||
publish_status = #{publishStatus},
|
||||
new_status = #{newStatus},
|
||||
vip_status = #{vipStatus},
|
||||
points_area_status = #{pointsAreaStatus},
|
||||
points_exchange_status = #{pointsExchangeStatus},
|
||||
recommand_status = #{recommandStatus},
|
||||
verify_status = #{verifyStatus},
|
||||
sort = #{sort},
|
||||
sale = #{sale},
|
||||
price = #{price},
|
||||
promotion_price = #{promotionPrice},
|
||||
gift_growth = #{giftGrowth},
|
||||
gift_point = #{giftPoint},
|
||||
use_point_limit = #{usePointLimit},
|
||||
sub_title = #{subTitle},
|
||||
original_price = #{originalPrice},
|
||||
stock = #{stock},
|
||||
low_stock = #{lowStock},
|
||||
unit = #{unit},
|
||||
weight = #{weight},
|
||||
preview_status = #{previewStatus},
|
||||
service_ids = #{serviceIds},
|
||||
keywords = #{keywords},
|
||||
note = #{note},
|
||||
album_pics = #{albumPics},
|
||||
detail_title = #{detailTitle},
|
||||
promotion_start_time = #{promotionStartTime},
|
||||
promotion_end_time = #{promotionEndTime},
|
||||
promotion_per_limit = #{promotionPerLimit},
|
||||
promotion_type = #{promotionType},
|
||||
brand_name = #{brandName},
|
||||
product_category_name = #{productCategoryName},
|
||||
description = #{description},
|
||||
detail_desc = #{detailDesc},
|
||||
detail_html = #{detailHtml},
|
||||
detail_mobile_html = #{detailMobileHtml},
|
||||
intergration_price = #{intergrationPrice};
|
||||
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -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<UmsDevelopmentFund> getDevelopmentFund() {
|
||||
UmsDevelopmentFund result = memberService.getDevelopmentFund();
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员昵称")
|
||||
@RequestMapping(value = "/updateMemberNickname", method = RequestMethod.POST)
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
package com.buy507.mall.portal.controller;
|
||||
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.mapper.OmsOrderMapper;
|
||||
import com.buy507.mall.mapper.PmsProductMapper;
|
||||
import com.buy507.mall.mapper.UmsMemberMapper;
|
||||
import com.buy507.mall.model.OmsOrder;
|
||||
import com.buy507.mall.model.UmsMember;
|
||||
import com.buy507.mall.portal.service.OmsPortalOrderService;
|
||||
import com.buy507.mall.portal.service.UmsMemberService;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ClassName:VipCenterController
|
||||
* Description:
|
||||
*
|
||||
* @Author axin
|
||||
* @Create 2025/2/19 11:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@Api(tags = "VipCenterController", description = "会员中心")
|
||||
@RequestMapping("/vipCenter")
|
||||
public class VipCenterController {
|
||||
@Autowired
|
||||
private UmsMemberMapper memberMapper;
|
||||
|
||||
@Autowired
|
||||
private UmsMemberService memberService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private OmsOrderMapper orderMapper;
|
||||
|
||||
//店长升级金额
|
||||
@Value("${storeManagerAmount}")
|
||||
private BigDecimal storeManagerAmount;
|
||||
|
||||
//代理升级金额
|
||||
@Value("${agentAmount}")
|
||||
private BigDecimal agentAmount;
|
||||
|
||||
//市代理升级金额
|
||||
@Value("${cityAgentAmount}")
|
||||
private BigDecimal cityAgentAmount;
|
||||
|
||||
@ApiOperation("查询当前登录人信息")
|
||||
@RequestMapping("/getCurrentUserInfo")
|
||||
public CommonResult getCurrentUserInfo(){
|
||||
//获取当前登录人的信息
|
||||
UmsMember member = memberMapper.selectByPrimaryKey(memberService.getCurrentMember().getId());
|
||||
|
||||
// 获取当前用户的会员等级ID
|
||||
Long memberLevelId = member.getMemberLevelId();
|
||||
|
||||
String memberLevelName = "普通用户";
|
||||
if (memberLevelId == 1) {
|
||||
memberLevelName = "普通用户";
|
||||
} else if (memberLevelId == 2) {
|
||||
memberLevelName = "VIP会员";
|
||||
} else if (memberLevelId == 3) {
|
||||
memberLevelName = "店长";
|
||||
} else if (memberLevelId == 4) {
|
||||
memberLevelName = "代理";
|
||||
} else if (memberLevelId == 5) {
|
||||
memberLevelName = "市代理";
|
||||
}
|
||||
|
||||
// 返回当前用户的会员信息
|
||||
return CommonResult.success("当前登录用户: " + member.getUsername() + ", 会员等级: " + memberLevelName);
|
||||
}
|
||||
|
||||
@ApiOperation("创建会员中心订单")
|
||||
@RequestMapping( value = "/createVipOrder", method = RequestMethod.POST)
|
||||
public CommonResult createVipOrder(){
|
||||
//获取当前登录人的信息
|
||||
UmsMember member = memberMapper.selectByPrimaryKey(memberService.getCurrentMember().getId());
|
||||
|
||||
// 获取当前用户的会员等级ID
|
||||
Long memberLevelId = member.getMemberLevelId();
|
||||
|
||||
//创建返回值
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
//生成订单
|
||||
OmsOrder order = new OmsOrder();
|
||||
// 根据会员等级ID动态设置订单金额
|
||||
// 店长
|
||||
if (memberLevelId == 3) {
|
||||
order.setTotalAmount(storeManagerAmount);
|
||||
order.setPayAmount(storeManagerAmount);
|
||||
// 代理
|
||||
} else if (memberLevelId == 4) {
|
||||
order.setTotalAmount(agentAmount);
|
||||
order.setPayAmount(agentAmount);
|
||||
// 市代理
|
||||
} else if (memberLevelId == 5) {
|
||||
order.setTotalAmount(cityAgentAmount);
|
||||
order.setPayAmount(cityAgentAmount);
|
||||
}
|
||||
order.setMemberId(member.getId());
|
||||
order.setCreateTime(new Date());
|
||||
order.setModifyTime(new Date());
|
||||
|
||||
// 支付方式,0为未支付
|
||||
order.setPayType(0);
|
||||
// 订单状态,0为待付款
|
||||
order.setStatus(0);
|
||||
// 虚拟订单
|
||||
order.setOrderType(3);
|
||||
// 升级订单,无需实际收货人信息
|
||||
order.setReceiverName("会员升级");
|
||||
|
||||
// 保存订单
|
||||
orderMapper.insert(order);
|
||||
|
||||
// 更新返回结果
|
||||
result.put("orderId", order.getId());
|
||||
|
||||
return CommonResult.success(result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.buy507.mall.portal.controller;
|
||||
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.model.OmsOrder;
|
||||
import com.buy507.mall.portal.domain.OrderParam;
|
||||
import com.buy507.mall.portal.service.VipCenterService;
|
||||
import com.buy507.mall.portal.vo.OmsOrderDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/vip")
|
||||
public class VipController {
|
||||
|
||||
@Autowired
|
||||
private VipCenterService vipCenterService;
|
||||
|
||||
@ApiOperation("查询升级权限金额")
|
||||
@RequestMapping(value = "/getUpgradeAmount", method = RequestMethod.GET)
|
||||
public CommonResult<BigDecimal> getUpgradeAmount(@RequestParam Long memberLevelId){
|
||||
BigDecimal amount = vipCenterService.getUpgradeAmount(memberLevelId);
|
||||
return CommonResult.success(amount);
|
||||
}
|
||||
|
||||
@ApiOperation("创建购买权益订单")
|
||||
@RequestMapping(value = "/createUpgradeOrder", method = RequestMethod.POST)
|
||||
public CommonResult createUpgradeOrder(@RequestBody OmsOrderDTO param){
|
||||
try {
|
||||
return vipCenterService.createUpgradeOrder(param);
|
||||
} catch (Exception e) {
|
||||
return CommonResult.failed("createOrder fail");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.buy507.mall.portal.service;
|
||||
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.model.OmsOrder;
|
||||
import com.buy507.mall.portal.domain.OrderParam;
|
||||
import com.buy507.mall.portal.vo.OmsOrderDTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public interface VipCenterService {
|
||||
|
||||
/**
|
||||
* 查询升级权限金额
|
||||
* @param memberLevelId
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getUpgradeAmount(Long memberLevelId);
|
||||
|
||||
/**
|
||||
* 创建购买权益订单
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
CommonResult createUpgradeOrder(OmsOrderDTO param);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
result.setNickname(member.getNickname() == null ? "" : member.getNickname());
|
||||
result.setHeadPicture(member.getIcon() == null ? "" :member.getIcon());
|
||||
result.setGender(member.getGender());
|
||||
result.setMemberLevel(member.getMemberLevel().getValue());
|
||||
result.setMemberLevel(member.getMemberLevel().getValue()-1);
|
||||
result.setMemberId(loginMember.getId());
|
||||
result.setRealName(member.getRealName());
|
||||
result.setDetailAddress(member.getDetailAddress());
|
||||
@@ -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<>();
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.buy507.mall.portal.service.impl;
|
||||
|
||||
import cn.hutool.db.sql.Order;
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.mapper.OmsOrderMapper;
|
||||
import com.buy507.mall.model.MemberLevel;
|
||||
import com.buy507.mall.model.OmsOrder;
|
||||
import com.buy507.mall.portal.domain.OrderParam;
|
||||
import com.buy507.mall.portal.domain.OrderResult;
|
||||
import com.buy507.mall.portal.service.RedisService;
|
||||
import com.buy507.mall.portal.service.VipCenterService;
|
||||
import com.buy507.mall.portal.vo.OmsOrderDTO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class VipCenterServiceImpl implements VipCenterService {
|
||||
|
||||
//店长升级金额
|
||||
@Value("${storeManagerAmount}")
|
||||
private BigDecimal storeManagerAmount;
|
||||
|
||||
//代理升级金额
|
||||
@Value("${agentAmount}")
|
||||
private BigDecimal agentAmount;
|
||||
|
||||
//市代理升级金额
|
||||
@Value("${cityAgentAmount}")
|
||||
private BigDecimal cityAgentAmount;
|
||||
|
||||
@Value("${redis.key.prefix.orderId}")
|
||||
private String REDIS_KEY_PREFIX_ORDER_ID;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private OmsOrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public BigDecimal getUpgradeAmount(Long memberLevelId) {
|
||||
BigDecimal amount = null;
|
||||
if (MemberLevel.Partner.getValue() == memberLevelId){
|
||||
amount = storeManagerAmount;
|
||||
}
|
||||
if (MemberLevel.Diamond.getValue() == memberLevelId){
|
||||
amount = agentAmount;
|
||||
}
|
||||
if (MemberLevel.OneDiamond.getValue() == memberLevelId){
|
||||
amount = cityAgentAmount;
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建购买权益订单
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult createUpgradeOrder(OmsOrderDTO param) {
|
||||
if (param == null){
|
||||
return CommonResult.validateFailed("订单数据为空");
|
||||
}else {
|
||||
//创建权益订单
|
||||
OmsOrder order = new OmsOrder();
|
||||
BeanUtils.copyProperties(param, order);
|
||||
order.setOrderSn(generateUpgradeOrderSn(param)); //生成orderSn
|
||||
order.setCreateTime(new Date()); //创建订单时间
|
||||
order.setStatus(0); //订单状态--未支付
|
||||
order.setOrderType(3); //订单类型--虚拟订单
|
||||
orderMapper.insert(order);
|
||||
|
||||
//返回订单id
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("orderId", order.getId());
|
||||
return CommonResult.success(result, "下单成功");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成18位订单编号:8位日期+2位订单类型+2位支付方式+6位以上自增id
|
||||
*/
|
||||
private String generateUpgradeOrderSn(OmsOrderDTO param) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
String key = REDIS_KEY_PREFIX_ORDER_ID + date;
|
||||
Long increment = redisService.increment(key, 1);
|
||||
sb.append(date);
|
||||
sb.append(String.format("%02d", param.getOrderType()));
|
||||
sb.append(String.format("%02d", param.getPayType()));
|
||||
String incrementStr = increment.toString();
|
||||
if (incrementStr.length() <= 6) {
|
||||
sb.append(String.format("%06d", increment));
|
||||
} else {
|
||||
sb.append(incrementStr);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.buy507.mall.portal.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OmsOrderDTO {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long memberId;
|
||||
|
||||
@ApiModelProperty(value = "用户帐号")
|
||||
private String memberUsername;
|
||||
|
||||
@ApiModelProperty(value = "应付金额(实际支付金额)")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@ApiModelProperty(value = "支付方式:0->未支付;1->支付宝;2->微信;3->线下支付;4->积分支付;5—>余额支付")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "订单类型:0->正常订单;1->秒杀订单;3->虚拟订单")
|
||||
private Integer orderType;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ mybatis:
|
||||
mapper-locations:
|
||||
- classpath:dao/*.xml
|
||||
- classpath*:com/**/mapper/*.xml
|
||||
configuration:
|
||||
#开启驼峰命名
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
jwt:
|
||||
tokenHeader: Authorization #JWT存储的请求头
|
||||
|
||||
@@ -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