Compare commits
23 Commits
88d7814ad4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b0756654e | |||
| a55a89cd11 | |||
| 25e16e41eb | |||
| cd6dd0280f | |||
| f89a84f3ef | |||
| 412c017c96 | |||
| d64f5b4bbb | |||
| 392da5a396 | |||
| 565c82305c | |||
| 6e329f4226 | |||
| fdec029158 | |||
|
|
dab9156c8f | ||
|
|
419f7c9886 | ||
| 153dc8751e | |||
| 0a2e13c428 | |||
| 39553dd80e | |||
| 873360a300 | |||
| d2b590a414 | |||
| 46c7576ba9 | |||
| ac6ad6533a | |||
| 13374f4249 | |||
| 3e6b15eade | |||
| 6939311e6f |
@@ -66,6 +66,7 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
<version>1.18.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi excel -->
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.buy507.mall.mapper.UmsMemberAccountTransactionMapper;
|
||||
import com.buy507.mall.model.*;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||
@@ -24,10 +27,6 @@ import com.buy507.mall.dto.MemberWithdrawApplyResult;
|
||||
import com.buy507.mall.mapper.DmsMemberTradeRecordMapper;
|
||||
import com.buy507.mall.mapper.DmsMemberWithdrawApplyMapper;
|
||||
import com.buy507.mall.mapper.UmsMemberMapper;
|
||||
import com.buy507.mall.model.DmsMemberTradeRecord;
|
||||
import com.buy507.mall.model.DmsMemberWithdrawApply;
|
||||
import com.buy507.mall.model.ItemType;
|
||||
import com.buy507.mall.model.UmsMember;
|
||||
import com.buy507.mall.service.DmsMemberWithdrawApplyService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
||||
@@ -48,6 +47,9 @@ public class DmsMemberWithdrawApplyServiceImpl implements DmsMemberWithdrawApply
|
||||
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@Autowired
|
||||
private UmsMemberAccountTransactionMapper accountTransactionMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -88,6 +90,15 @@ public class DmsMemberWithdrawApplyServiceImpl implements DmsMemberWithdrawApply
|
||||
member = memberMapper.selectByPrimaryKey(member.getId());
|
||||
member.setFreeze(member.getFreeze().subtract(withdrawApply.getValue())); //修改冻结值
|
||||
memberMapper.updateByPrimaryKey(member);
|
||||
|
||||
// 写入会员流水记录表
|
||||
UmsMemberAccountTransaction memberTransaction = new UmsMemberAccountTransaction();
|
||||
memberTransaction.setMemberId(member.getId());
|
||||
memberTransaction.setRevenueAmount(withdrawApply.getValue()); // 提现金额
|
||||
memberTransaction.setRemarks("提现"); // 备注
|
||||
memberTransaction.setCreateTime(DateUtil.date()); // 提现时间
|
||||
accountTransactionMapper.insert(memberTransaction); // 保存流水记录
|
||||
|
||||
redisLock.unlock(String.valueOf(member.getId()), String.valueOf(time));
|
||||
break;
|
||||
}
|
||||
@@ -95,7 +106,7 @@ public class DmsMemberWithdrawApplyServiceImpl implements DmsMemberWithdrawApply
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -84,7 +84,12 @@ 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);
|
||||
productParam.getSkuStockList().forEach(item->{
|
||||
item.setPrice(product.getPrice());
|
||||
});
|
||||
//根据促销类型设置价格:、阶梯价格、满减价格
|
||||
Long productId = product.getId();
|
||||
//会员价格
|
||||
|
||||
@@ -27,4 +27,8 @@ public interface OmsOrderItemMapper {
|
||||
int updateByPrimaryKeySelective(OmsOrderItem record);
|
||||
|
||||
int updateByPrimaryKey(OmsOrderItem record);
|
||||
|
||||
OmsOrderItem selectByOrderId(Long orderId);
|
||||
|
||||
OmsOrderItem getByOrderSn(String orderSn);
|
||||
}
|
||||
@@ -33,4 +33,5 @@ public interface OmsOrderMapper {
|
||||
int updateByPrimaryKey(OmsOrder record);
|
||||
|
||||
|
||||
PmsProduct selectAll(@Param("orderSn") String orderSn);}
|
||||
PmsProduct selectAll(@Param("orderSn") String orderSn);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.buy507.mall.model.PmsProductFullReduction;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
public interface PmsProductMapper {
|
||||
long countByExample(PmsProductExample example);
|
||||
@@ -23,7 +24,9 @@ public interface PmsProductMapper {
|
||||
|
||||
List<PmsProduct> selectByExample(PmsProductExample example);
|
||||
|
||||
// @Select("select * from pms_product where id = #{id}")
|
||||
PmsProduct selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") PmsProduct record, @Param("example") PmsProductExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") PmsProduct record, @Param("example") PmsProductExample example);
|
||||
@@ -40,7 +43,8 @@ public interface PmsProductMapper {
|
||||
|
||||
PmsProduct getProductByOrderSn(String orderSn);
|
||||
|
||||
PmsProduct getPrimaryKey(Long id);
|
||||
|
||||
|
||||
|
||||
int insertAll(PmsProduct product);
|
||||
}
|
||||
@@ -29,4 +29,5 @@ public interface PmsSkuStockMapper {
|
||||
int updateByPrimaryKey(PmsSkuStock record);
|
||||
|
||||
List<PmsSkuStock> getPmsSkuStock(Long id);
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,13 +30,24 @@ public enum MemberLevel {
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static MemberLevel getMemberByInt(int value){
|
||||
for (MemberLevel memberLevel : MemberLevel.values()) {
|
||||
if(value == memberLevel.value){
|
||||
return memberLevel;
|
||||
|
||||
// 获取根据 ordinal 映射的 MemberLevel
|
||||
public static MemberLevel fromOrdinal(int ordinal) {
|
||||
MemberLevel[] levels = MemberLevel.values();
|
||||
if (ordinal >= 0 && ordinal < levels.length) {
|
||||
return levels[ordinal-1];
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid ordinal: " + ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据 value 获取 MemberLevel
|
||||
public static MemberLevel fromValue(int value) {
|
||||
for (MemberLevel level : MemberLevel.values()) {
|
||||
if (level.getValue() == value) {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
throw new IllegalArgumentException("Invalid value: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class OmsOrder implements Serializable {
|
||||
@ApiModelProperty(value = "管理员后台调整订单使用的折扣金额")
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
@ApiModelProperty(value = "支付方式:0->未支付;1->支付宝;2->微信;3->线下支付")
|
||||
@ApiModelProperty(value = "支付方式:0->未支付;1->支付宝;2->微信;3->线下支付;4->积分支付;5—>余额支付")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "订单来源:0->PC订单;1->app订单")
|
||||
|
||||
@@ -62,13 +62,15 @@ public class OmsOrderItem implements Serializable {
|
||||
@ApiModelProperty(value = "该商品经过优惠后的分解金额")
|
||||
private BigDecimal realAmount;
|
||||
|
||||
private Integer giftIntegration;
|
||||
private BigDecimal giftIntegration;
|
||||
|
||||
private Integer giftGrowth;
|
||||
|
||||
@ApiModelProperty(value = "商品销售属性:[{'key':'颜色','value':'颜色'},{'key':'容量','value':'4G'}]")
|
||||
private String productAttr;
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getId() {
|
||||
@@ -239,11 +241,11 @@ public class OmsOrderItem implements Serializable {
|
||||
this.realAmount = realAmount;
|
||||
}
|
||||
|
||||
public Integer getGiftIntegration() {
|
||||
public BigDecimal getGiftIntegration() {
|
||||
return giftIntegration;
|
||||
}
|
||||
|
||||
public void setGiftIntegration(Integer giftIntegration) {
|
||||
public void setGiftIntegration(BigDecimal giftIntegration) {
|
||||
this.giftIntegration = giftIntegration;
|
||||
}
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ public class PmsProduct implements Serializable {
|
||||
|
||||
public void setVipCenter(Integer vipCenter) {this.vipCenter = vipCenter;}
|
||||
|
||||
public Integer getintergrationPrice() {return intergrationPrice;}
|
||||
public Integer getIntergrationPrice() {return intergrationPrice;}
|
||||
|
||||
public void setIntergrationPrice(Integer intergrationPrice) {this.intergrationPrice = intergrationPrice;}
|
||||
|
||||
|
||||
@@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -361,6 +361,11 @@ public class UmsMemberAccountTransactionExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFlowTypeEqualTo(Integer value) {
|
||||
addCriterion("flow_type =", value, "flowType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTransactionStateNotEqualTo(Integer value) {
|
||||
addCriterion("transaction_state <>", value, "transactionState");
|
||||
return (Criteria) this;
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
id, order_id, order_sn, product_id, product_pic, product_name, product_brand, product_sn,
|
||||
product_price, product_quantity, product_sku_id, product_sku_code, product_category_id,
|
||||
sp1, sp2, sp3, promotion_name, promotion_amount, coupon_amount, integration_amount,
|
||||
real_amount, gift_integration, gift_growth, product_attr
|
||||
real_amount, gift_integration, gift_growth, product_attr,intergrationPrice,intergrationExchange
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.buy507.mall.model.OmsOrderItemExample" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -508,4 +508,39 @@
|
||||
product_attr = #{productAttr,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="selectByOrderId" resultType="com.buy507.mall.model.OmsOrderItem">
|
||||
select * from mall.oms_order_item where order_id = #{orderId}
|
||||
|
||||
</select>
|
||||
<select id="getByOrderSn" resultType="com.buy507.mall.model.OmsOrderItem">
|
||||
select id,
|
||||
order_id,
|
||||
order_sn,
|
||||
product_id,
|
||||
product_pic,
|
||||
product_name,
|
||||
product_brand,
|
||||
product_sn,
|
||||
product_price,
|
||||
product_quantity,
|
||||
product_sku_id,
|
||||
product_sku_code,
|
||||
product_category_id,
|
||||
promotion_name,
|
||||
promotion_amount,
|
||||
coupon_amount,
|
||||
integration_amount,
|
||||
real_amount,
|
||||
gift_integration,
|
||||
gift_growth,
|
||||
product_attr,
|
||||
sp1,
|
||||
sp2,
|
||||
sp3,
|
||||
intergrationPrice,
|
||||
intergrationExchange
|
||||
from oms_order_item
|
||||
where order_sn = #{orderSn}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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>
|
||||
@@ -926,4 +926,5 @@
|
||||
JOIN oms_order o ON oi.order_sn = o.order_sn
|
||||
WHERE o.order_sn = #{orderSn}
|
||||
</select>
|
||||
<select id="getPnameByOrderSn" resultType="java.lang.String"></select>
|
||||
</mapper>
|
||||
@@ -112,7 +112,7 @@
|
||||
verify_status, sort, sale, price, promotion_price, gift_growth, gift_point, use_point_limit,
|
||||
sub_title, original_price, stock, low_stock, unit, weight, preview_status, service_ids,
|
||||
keywords, note, album_pics, detail_title, promotion_start_time, promotion_end_time,
|
||||
promotion_per_limit, promotion_type, brand_name, product_category_name, distribution_flag
|
||||
promotion_per_limit, promotion_type, brand_name, product_category_name, distribution_flag,vip_status,points_area_status,points_exchange_status,intergration_price
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
description, detail_desc, detail_html, detail_mobile_html
|
||||
@@ -336,6 +336,9 @@
|
||||
<if test="detailMobileHtml != null">
|
||||
detail_mobile_html,
|
||||
</if>
|
||||
<if test="intergrationPrice != null">
|
||||
intergration_price,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="brandId != null">
|
||||
@@ -461,6 +464,9 @@
|
||||
<if test="detailMobileHtml != null">
|
||||
#{detailMobileHtml,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="intergrationPrice != null">
|
||||
#{intergration_price},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.buy507.mall.model.PmsProductExample" resultType="java.lang.Long">
|
||||
@@ -934,10 +940,118 @@
|
||||
SELECT p.*
|
||||
FROM pms_product p
|
||||
WHERE p.product_sn = (
|
||||
SELECT oi.product_sn
|
||||
SELECT DISTINCT oi.product_sn
|
||||
FROM oms_order_item oi
|
||||
WHERE oi.order_sn = #{orderSn}
|
||||
LIMIT 1
|
||||
)
|
||||
AND oi.product_sn IS NOT NULL
|
||||
limit 1
|
||||
);
|
||||
</select>
|
||||
|
||||
<select id="getPrimaryKey" resultType="com.buy507.mall.model.PmsProduct">
|
||||
SELECT p.id,
|
||||
p.brand_id,
|
||||
p.product_category_id,
|
||||
p.feight_template_id,
|
||||
p.product_attribute_category_id,
|
||||
p.name,
|
||||
p.pic,
|
||||
p.product_sn,
|
||||
p.delete_status,
|
||||
p.publish_status,
|
||||
p.new_status,
|
||||
p.recommand_status,
|
||||
p.verify_status,
|
||||
p.sort,
|
||||
p.sale,
|
||||
p.price,
|
||||
p.promotion_price,
|
||||
p.gift_growth,
|
||||
p.gift_point,
|
||||
p.use_point_limit,
|
||||
p.sub_title,
|
||||
p.description,
|
||||
p.original_price,
|
||||
p.stock,
|
||||
p.low_stock,
|
||||
p.unit,
|
||||
p.weight,
|
||||
p.preview_status,
|
||||
p.service_ids,
|
||||
p.keywords,
|
||||
p.note,
|
||||
p.album_pics,
|
||||
p.detail_title,
|
||||
p.detail_desc,
|
||||
p.detail_html,
|
||||
p.detail_mobile_html,
|
||||
p.promotion_start_time,
|
||||
p.promotion_end_time,
|
||||
p.promotion_per_limit,
|
||||
p.promotion_type,
|
||||
p.brand_name,
|
||||
p.product_category_name,
|
||||
p.distribution_flag,
|
||||
p.vip_status,
|
||||
p.points_area_status,
|
||||
p.points_exchange_status,
|
||||
p.intergration_price
|
||||
FROM pms_product p
|
||||
|
||||
WHERE id = #{id}
|
||||
</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>
|
||||
@@ -341,4 +341,5 @@
|
||||
on ppa.id=ppav.product_attribute_id
|
||||
where pst.product_id=#{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -109,10 +109,10 @@
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ums_member_account_transaction (member_id, order_id, revenue_amount,
|
||||
transaction_state, remarks, commission_ratio, transfer_payment_time, revenue_points)
|
||||
transaction_state, remarks, commission_ratio, transfer_payment_time, revenue_points, flow_type)
|
||||
values (#{memberId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{revenueAmount,jdbcType=DECIMAL},
|
||||
#{transactionState,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{commissionRatio,jdbcType=INTEGER},
|
||||
#{transferPaymentTime,jdbcType=TIMESTAMP}, #{revenuePoints,jdbcType=INTEGER})
|
||||
#{transferPaymentTime,jdbcType=TIMESTAMP}, #{revenuePoints,jdbcType=INTEGER}, #{flowType,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.buy507.mall.model.UmsMemberAccountTransaction">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
<!-- 微信小程序支付 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
|
||||
@@ -95,24 +95,24 @@ public class HomeController {
|
||||
@RequestMapping(value = "/getVipProductList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProduct>> getVipProductList(){
|
||||
List<PmsProduct> productList = homeService.getVipProductList();
|
||||
return CommonResult.success(productList);
|
||||
List<PmsProduct> vipProductList = homeService.getVipProductList();
|
||||
return CommonResult.success(vipProductList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取积分专区商品")
|
||||
@RequestMapping(value = "/getPointProductList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProduct>> getPointProductList(){
|
||||
List<PmsProduct> productList = homeService.getPointProductList();
|
||||
return CommonResult.success(productList);
|
||||
List<PmsProduct> pointProductList = homeService.getPointProductList();
|
||||
return CommonResult.success(pointProductList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取积分兑换专区")
|
||||
@RequestMapping(value = "/getPointExchangeProductList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProduct>> getPointExchangeProductList(){
|
||||
List<PmsProduct> productList = homeService.getPointExchangeProductList();
|
||||
return CommonResult.success(productList);
|
||||
List<PmsProduct> pointExchangeProductList = homeService.getPointExchangeProductList();
|
||||
return CommonResult.success(pointExchangeProductList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.buy507.mall.portal.controller;
|
||||
|
||||
import com.buy507.mall.common.api.CommonResult;
|
||||
import com.buy507.mall.portal.domain.WithdrawApplyParam;
|
||||
import com.buy507.mall.portal.service.MyWalletService;
|
||||
import com.buy507.mall.portal.service.UmsMemberService;
|
||||
import com.buy507.mall.portal.vo.WalletCashVo;
|
||||
import com.buy507.mall.portal.vo.WalletPointsVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wallet")
|
||||
@@ -17,25 +17,28 @@ public class MyWalletController {
|
||||
@Autowired
|
||||
private MyWalletService myWalletService;
|
||||
|
||||
/**
|
||||
* 获取现金余额和流水
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Autowired
|
||||
private UmsMemberService memberService;
|
||||
|
||||
|
||||
@ApiOperation("获取现金余额和流水")
|
||||
@GetMapping("/balance")
|
||||
public CommonResult<WalletCashVo> getBalance(@RequestParam Long userId){
|
||||
WalletCashVo walletCashVo = myWalletService.getBalanceAndCashFlow(userId);
|
||||
return CommonResult.success(walletCashVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分余额和流水
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ApiOperation("获取积分余额和流水")
|
||||
@GetMapping("/points")
|
||||
public CommonResult<WalletPointsVo> getIntegration(@RequestParam Long userId){
|
||||
WalletPointsVo walletPointsVo = myWalletService.getIntegrationAndPointsFlow(userId);
|
||||
return CommonResult.success(walletPointsVo);
|
||||
}
|
||||
|
||||
@ApiOperation("会员提现申请")
|
||||
@PostMapping(value = "/withdraw")
|
||||
public CommonResult withdrawApply(@RequestBody WithdrawApplyParam applyParam) {
|
||||
return memberService.withdrawApply(applyParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,11 +137,19 @@ public class OmsPortalOrderController {
|
||||
|
||||
@ApiOperation("积分支付")
|
||||
@ApiImplicitParam(name = "orderId", value = "订单ID", paramType = "query")
|
||||
@RequestMapping(value = "/pointPayment", method = RequestMethod.POST)
|
||||
public CommonResult pointPayment(@RequestParam Long orderId) {
|
||||
return portalOrderService.pointPayment(orderId);
|
||||
}
|
||||
|
||||
@ApiOperation("余额支付")
|
||||
@ApiImplicitParam(name = "orderId", value = "订单ID", paramType = "query")
|
||||
@RequestMapping(value = "/balancePayment", method = RequestMethod.POST)
|
||||
public CommonResult balancePayment(@RequestParam Long orderId) {
|
||||
return portalOrderService.balancePayment(orderId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("微信预支付")
|
||||
@ApiImplicitParam(name = "orderId", value = "订单ID", paramType = "query")
|
||||
@RequestMapping(value = "/wxPrePay", method = RequestMethod.POST)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,29 @@ public class OrderItemResult {
|
||||
|
||||
@ApiModelProperty(value = "商品SKU属性3")
|
||||
private String sp3;
|
||||
|
||||
|
||||
@ApiModelProperty("积分价格")
|
||||
private Integer intergrationPrice;
|
||||
|
||||
@ApiModelProperty("积分兑换专区")
|
||||
private Integer intergrationExchange;
|
||||
|
||||
public Integer getIntergrationPrice() {
|
||||
return intergrationPrice;
|
||||
}
|
||||
|
||||
public void setIntergrationPrice(Integer intergrationPrice) {
|
||||
this.intergrationPrice = intergrationPrice;
|
||||
}
|
||||
|
||||
public Integer getIntergrationExchange() {
|
||||
return intergrationExchange;
|
||||
}
|
||||
|
||||
public void setIntergrationExchange(Integer intergrationExchange) {
|
||||
this.intergrationExchange = intergrationExchange;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,38 @@ public class OrderResult {
|
||||
@ApiModelProperty(value = "快速排队订单还剩邀请成功的人数")
|
||||
private Integer invitedCount;
|
||||
|
||||
@ApiModelProperty(value = "积分价格")
|
||||
private Integer intergrationPrice;
|
||||
|
||||
@ApiModelProperty(value = "积分兑换专区")
|
||||
private Integer intergrationExchange;
|
||||
|
||||
@ApiModelProperty(value = "订单类型")
|
||||
private Integer orderType;
|
||||
|
||||
public Integer getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(Integer orderType) {
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public Integer getIntergrationExchange() {
|
||||
return intergrationExchange;
|
||||
}
|
||||
|
||||
public void setIntergrationExchange(Integer intergrationExchange) {
|
||||
this.intergrationExchange = intergrationExchange;
|
||||
}
|
||||
|
||||
public Integer getIntergrationPrice() {
|
||||
return intergrationPrice;
|
||||
}
|
||||
|
||||
public void setIntergrationPrice(Integer intergrationPrice) {
|
||||
this.intergrationPrice = intergrationPrice;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.buy507.mall.model.SmsCoupon;
|
||||
import com.buy507.mall.model.SmsCouponProductRelation;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
public class ProductDetailResult {
|
||||
private Long id;
|
||||
@@ -152,7 +153,53 @@ public class ProductDetailResult {
|
||||
private int countComent;
|
||||
|
||||
private int applauseRate;
|
||||
|
||||
|
||||
@Transient
|
||||
@ApiModelProperty(value = "积分专区状态")
|
||||
private Integer pointsAreaStatus;
|
||||
|
||||
@Transient
|
||||
@ApiModelProperty(value = "积分兑换专区状态")
|
||||
private Integer pointsExchangeStatus;
|
||||
|
||||
@ApiModelProperty(value = "会员中心:1->店长; 2->代理; 3->市代理")
|
||||
private Integer vipCenter;
|
||||
|
||||
@ApiModelProperty(value = "商品积分价格")
|
||||
private Integer intergrationPrice;
|
||||
|
||||
public Integer getPointsAreaStatus() {
|
||||
return pointsAreaStatus;
|
||||
}
|
||||
|
||||
public void setPointsAreaStatus(Integer pointsAreaStatus) {
|
||||
this.pointsAreaStatus = pointsAreaStatus;
|
||||
}
|
||||
|
||||
public Integer getPointsExchangeStatus() {
|
||||
return pointsExchangeStatus;
|
||||
}
|
||||
|
||||
public void setPointsExchangeStatus(Integer pointsExchangeStatus) {
|
||||
this.pointsExchangeStatus = pointsExchangeStatus;
|
||||
}
|
||||
|
||||
public Integer getVipCenter() {
|
||||
return vipCenter;
|
||||
}
|
||||
|
||||
public void setVipCenter(Integer vipCenter) {
|
||||
this.vipCenter = vipCenter;
|
||||
}
|
||||
|
||||
public Integer getIntergrationPrice() {
|
||||
return intergrationPrice;
|
||||
}
|
||||
|
||||
public void setIntergrationPrice(Integer intergrationPrice) {
|
||||
this.intergrationPrice = intergrationPrice;
|
||||
}
|
||||
|
||||
List<ProductAttributeResult> specList;
|
||||
|
||||
List<ProductAttributeResult> specChildList;
|
||||
|
||||
@@ -14,6 +14,16 @@ public class ProductSkuResult {
|
||||
|
||||
private String pic;
|
||||
|
||||
private Integer intergrationPrice;
|
||||
|
||||
public Integer getIntergrationPrice() {
|
||||
return intergrationPrice;
|
||||
}
|
||||
|
||||
public void setIntergrationPrice(Integer intergrationPrice) {
|
||||
this.intergrationPrice = intergrationPrice;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -80,12 +80,17 @@ public interface OmsPortalOrderService {
|
||||
CommonResult confirmReceiving(Long orderId);
|
||||
|
||||
/**
|
||||
* 余额支付
|
||||
* 积分支付
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
CommonResult pointPayment(Long orderId);
|
||||
|
||||
/**
|
||||
* 余额支付
|
||||
*/
|
||||
CommonResult balancePayment(Long orderId);
|
||||
|
||||
|
||||
/**
|
||||
* 微信预支付
|
||||
* @param orderId
|
||||
|
||||
@@ -13,7 +13,7 @@ public interface PortalCommonService {
|
||||
|
||||
/**
|
||||
* 获取会员的折扣
|
||||
* @param member
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getDiscount(Long memberId);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,66 +1,26 @@
|
||||
package com.buy507.mall.portal.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.buy507.mall.mapper.CmsSubjectMapper;
|
||||
import com.buy507.mall.mapper.PmsCommentMapper;
|
||||
import com.buy507.mall.mapper.PmsCommentReplayMapper;
|
||||
import com.buy507.mall.mapper.PmsProductAttributeMapper;
|
||||
import com.buy507.mall.mapper.PmsProductAttributeValueMapper;
|
||||
import com.buy507.mall.mapper.PmsProductCategoryMapper;
|
||||
import com.buy507.mall.mapper.PmsProductFullReductionMapper;
|
||||
import com.buy507.mall.mapper.PmsProductMapper;
|
||||
import com.buy507.mall.mapper.PmsSkuStockMapper;
|
||||
import com.buy507.mall.mapper.SmsFlashPromotionMapper;
|
||||
import com.buy507.mall.mapper.SmsFlashPromotionSessionMapper;
|
||||
import com.buy507.mall.mapper.SmsHomeAdvertiseMapper;
|
||||
import com.buy507.mall.model.CmsSubject;
|
||||
import com.buy507.mall.model.CmsSubjectExample;
|
||||
import com.buy507.mall.model.PmsComment;
|
||||
import com.buy507.mall.model.PmsCommentReplay;
|
||||
import com.buy507.mall.model.PmsProduct;
|
||||
import com.buy507.mall.model.PmsProductAttribute;
|
||||
import com.buy507.mall.model.PmsProductAttributeExample;
|
||||
import com.buy507.mall.model.PmsProductAttributeValue;
|
||||
import com.buy507.mall.model.PmsProductAttributeValueExample;
|
||||
import com.buy507.mall.model.PmsProductCategory;
|
||||
import com.buy507.mall.model.PmsProductCategoryExample;
|
||||
import com.buy507.mall.model.PmsProductExample;
|
||||
import com.buy507.mall.model.PmsProductFullReduction;
|
||||
import com.buy507.mall.model.PmsSkuStock;
|
||||
import com.buy507.mall.model.PmsSkuStockExample;
|
||||
import com.buy507.mall.model.SmsFlashPromotion;
|
||||
import com.buy507.mall.model.SmsFlashPromotionExample;
|
||||
import com.buy507.mall.model.SmsFlashPromotionSession;
|
||||
import com.buy507.mall.model.SmsFlashPromotionSessionExample;
|
||||
import com.buy507.mall.model.SmsHomeAdvertise;
|
||||
import com.buy507.mall.model.SmsHomeAdvertiseExample;
|
||||
import com.buy507.mall.model.UmsMember;
|
||||
import com.buy507.mall.mapper.*;
|
||||
import com.buy507.mall.model.*;
|
||||
import com.buy507.mall.portal.dao.HomeDao;
|
||||
import com.buy507.mall.portal.domain.FlashPromotionProduct;
|
||||
import com.buy507.mall.portal.domain.HomeContentResult;
|
||||
import com.buy507.mall.portal.domain.HomeFlashPromotion;
|
||||
import com.buy507.mall.portal.domain.MemberProductCollection;
|
||||
import com.buy507.mall.portal.domain.ProductAttributeResult;
|
||||
import com.buy507.mall.portal.domain.ProductCategoryOptions;
|
||||
import com.buy507.mall.portal.domain.ProductDetailResult;
|
||||
import com.buy507.mall.portal.domain.ProductSkuResult;
|
||||
import com.buy507.mall.portal.domain.*;
|
||||
import com.buy507.mall.portal.repository.MemberProductCollectionRepository;
|
||||
import com.buy507.mall.portal.service.HomeService;
|
||||
import com.buy507.mall.portal.service.PortalCommonService;
|
||||
import com.buy507.mall.portal.service.UmsMemberService;
|
||||
import com.buy507.mall.portal.util.DateUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页内容管理Service实现类
|
||||
@@ -134,9 +94,9 @@ public class HomeServiceImpl implements HomeService {
|
||||
for (PmsProduct product : PointAreaProductList) {
|
||||
product.setPrice(product.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
for (PmsProduct product : pointsExchangeProductList) {
|
||||
product.setPrice(product.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// for (PmsProduct product : pointsExchangeProductList) {
|
||||
// product.setPrice(product.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
// }
|
||||
for (PmsProduct product : allProductList) {
|
||||
product.setPrice(product.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
@@ -430,11 +390,16 @@ public class HomeServiceImpl implements HomeService {
|
||||
}
|
||||
List<PmsSkuStock> list = skuStockMapper.selectByExample(example);
|
||||
ProductSkuResult skuResult = new ProductSkuResult();
|
||||
|
||||
PmsProduct product = productMapper.selectByPrimaryKey(productId);
|
||||
|
||||
if(product.getPointsExchangeStatus() == 1){
|
||||
skuResult.setIntergrationPrice(product.getIntergrationPrice());
|
||||
}
|
||||
for (PmsSkuStock stock : list) {
|
||||
BeanUtils.copyProperties(stock, skuResult);
|
||||
}
|
||||
|
||||
//根据会员等级显示不同的商品价格
|
||||
//根据会员等级显示不同的商品价格
|
||||
UmsMember member = memberService.getCurrentMember();
|
||||
if (member != null) {
|
||||
BigDecimal discount = commonService.getDiscount(member.getId());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -55,7 +55,7 @@ public class PortalCommonServiceImpl implements PortalCommonService {
|
||||
|
||||
/**
|
||||
* 获取会员的折扣
|
||||
* @param member
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -240,7 +240,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
|
||||
//获取默认会员等级并设置
|
||||
UmsMemberLevelExample levelExample = new UmsMemberLevelExample();
|
||||
levelExample.createCriteria().andDefaultStatusEqualTo(0);
|
||||
levelExample.createCriteria().andDefaultStatusEqualTo(1);
|
||||
List<UmsMemberLevel> memberLevelList = memberLevelMapper.selectByExample(levelExample);
|
||||
if (!CollectionUtils.isEmpty(memberLevelList)) {
|
||||
umsMember.setMemberLevelId(memberLevelList.get(0).getId());
|
||||
@@ -516,6 +516,8 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
public MemberInfoResult getMemberInfo() {
|
||||
UmsMember loginMember = getCurrentMember();
|
||||
UmsMember member = memberMapper.selectByPrimaryKey(loginMember.getId());
|
||||
MemberLevel memberLevel = MemberLevel.fromOrdinal(loginMember.getMemberLevelId().intValue());
|
||||
member.setMemberLevel(memberLevel);
|
||||
DmsTeamTotalConsume teamTotalConsume = teamTotalConsumeMapper.selectOneByMemberId(loginMember.getId());
|
||||
|
||||
OmsOrderExample example = new OmsOrderExample();
|
||||
@@ -529,6 +531,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
BigDecimal totalIncome = BigDecimal.ZERO;
|
||||
accountTransactionExample.createCriteria()
|
||||
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
||||
.andFlowTypeEqualTo(1)
|
||||
.andMemberIdEqualTo(member.getId());
|
||||
|
||||
List<UmsMemberAccountTransaction> totalList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
||||
@@ -541,11 +544,12 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
}
|
||||
|
||||
//查询今天收入
|
||||
BigDecimal todayIncome = BigDecimal.ZERO;
|
||||
BigDecimal todayIncome = BigDecimal.ZERO;
|
||||
accountTransactionExample = new UmsMemberAccountTransactionExample();
|
||||
accountTransactionExample.createCriteria()
|
||||
.andTransferPaymentTimeBetween(DateUtil.beginOfDay(nowTime) ,nowTime)
|
||||
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
||||
.andFlowTypeEqualTo(1)
|
||||
.andMemberIdEqualTo(member.getId());
|
||||
List<UmsMemberAccountTransaction> todayIncomeList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
||||
if(todayIncomeList!= null && !todayIncomeList.isEmpty()){
|
||||
@@ -622,10 +626,6 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
result.setInviter(memberMapper.selectByPrimaryKey(teamLevel.getParentId()).getNickname());
|
||||
}
|
||||
|
||||
/*查询发展基金*/
|
||||
BigDecimal totalCash = umsDevelopmentFundMapper.getTotalCash();
|
||||
Integer totalPoints = umsDevelopmentFundMapper.getTotalPoints();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -862,6 +862,12 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提现申请列表
|
||||
* @param pageSize
|
||||
* @param pageNum
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MemberWithdrawApplyResult> getWithdrawApply(Integer pageSize, Integer pageNum) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
@@ -870,6 +876,11 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员提现申请
|
||||
* @param applyParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult withdrawApply(WithdrawApplyParam applyParam) {
|
||||
|
||||
@@ -911,13 +922,13 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
}
|
||||
|
||||
if(applyParam.getValue() <= 0) {
|
||||
return CommonResult.validateFailed("提现积分无效");
|
||||
return CommonResult.validateFailed("提现无效");
|
||||
}
|
||||
|
||||
String withdrawMultipleStr = commonService.getDictionaryValue(Constants.D_WITHDRAW_MULTIPLE);
|
||||
double withdrawMultiple = Double.valueOf(withdrawMultipleStr);
|
||||
if(applyParam.getValue() % withdrawMultiple != 0) {
|
||||
return CommonResult.validateFailed("提现积分必须是" + withdrawMultipleStr + "的倍数");
|
||||
return CommonResult.validateFailed("提现金额必须是" + withdrawMultipleStr + "的倍数");
|
||||
}
|
||||
|
||||
BigDecimal withdraw = new BigDecimal(applyParam.getValue());
|
||||
@@ -926,7 +937,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
//flag = -1,表示balance小于withdraw;flag = 0,表示balance等于withdraw;flag = 1,表示balance大于withdraw;
|
||||
int flag = member.getBalance().compareTo(withdraw);
|
||||
if(flag == -1) {
|
||||
return CommonResult.validateFailed("积分不足,不能提现");
|
||||
return CommonResult.validateFailed("余额不足,不能提现");
|
||||
}
|
||||
|
||||
while(true) {
|
||||
@@ -936,7 +947,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
//flag = -1,表示balance小于withdraw;flag = 0,表示balance等于withdraw;flag = 1,表示balance大于withdraw;
|
||||
flag = member.getBalance().compareTo(withdraw);
|
||||
if(flag == -1) {
|
||||
return CommonResult.validateFailed("积分不足,不能提现");
|
||||
return CommonResult.validateFailed("余额不足,不能提现");
|
||||
}
|
||||
member.setBalance(member.getBalance().subtract(withdraw)); //修改余额值
|
||||
member.setFreeze(member.getFreeze().add(withdraw)); //修改冻结值
|
||||
@@ -1301,6 +1312,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,110 @@
|
||||
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());
|
||||
result.put("orderType", order.getOrderType());
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ becomeVipAmount: 899
|
||||
# 同等级分润比例
|
||||
sameLevelProfit: 10
|
||||
#店长升级金额
|
||||
storeManagerAmount: 1000
|
||||
storeManagerAmount: 10000
|
||||
#代理升级金额
|
||||
agentAmount: 1000
|
||||
agentAmount: 50000
|
||||
#市代理升级金额
|
||||
cityAgentAmount: 1000
|
||||
cityAgentAmount: 100000
|
||||
@@ -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
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
<select id="selectMemberTeamList" parameterType="java.lang.Long" resultType="com.buy507.mall.portal.domain.TeamMemberResult">
|
||||
SELECT
|
||||
(SELECT nickname FROM ums_member m where m.id = tl.member_id) as username,
|
||||
tl.member_id as memberId,
|
||||
IFNULL((SELECT total FROM dms_team_member_number tmn where tmn.member_id = tl.member_id), 0) as teamNum,
|
||||
(SELECT value FROM dms_team_total_consume ttc where ttc.member_id = tl.member_id) as teamConsume
|
||||
(SELECT nickname FROM ums_member m where m.id = ur.member_id) as username,
|
||||
ur.member_id as memberId,
|
||||
IFNULL((SELECT total FROM dms_team_member_number tmn where tmn.member_id = ur.member_id), 0) as teamNum,
|
||||
(SELECT value FROM dms_team_total_consume ttc where ttc.member_id = ur.member_id) as teamConsume
|
||||
FROM
|
||||
dms_team_level tl
|
||||
ums_member_relation_tree ur
|
||||
WHERE
|
||||
tl.parent_id = #{member_id}
|
||||
ur.higher_level_id = #{member_id}
|
||||
</select>
|
||||
|
||||
<select id="selectMemberWithdrawApplyList" parameterType="java.lang.Long" resultType="java.util.HashMap">
|
||||
|
||||
Reference in New Issue
Block a user