提交 e8106efb 作者: 张小凤

Rental(add)

上级 8f2a4b44
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:07
* @Version 1.0
*/
public enum ChannelAuthStatus {
WAIT("0", "未申请"), SUCCESS("1", "认证通过"), FAIL("2", "申请未通过"), APPROVE("3", "审批中");
ChannelAuthStatus(String code, String status) {
this.code = code;
this.status = status;
}
private String code;
private String status;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 10:55
* @Version 1.0
*/
public interface Confirm {
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:06
* @Version 1.0
*/
public enum EntAuthStatus {
WAIT("0", "未认证"), SUCCESS("1", "认证通过");
EntAuthStatus(String code, String status) {
this.code = code;
this.status = status;
}
private String code;
private String status;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:05
* @Version 1.0
*/
public enum RealAuthStatus {
WAIT("0", "未认证"), SUCCESS("1", "认证通过"), FAIL("2", "未通过");
RealAuthStatus(String code, String status) {
this.code = code;
this.status = status;
}
private String code;
private String status;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:29
* @Version 1.0
*/
public enum ReceiptMethod {
EXPRESS(0, "邮寄"), SHOP(1, "门店自取");
ReceiptMethod(Integer code, String status) {
this.code = code;
this.status = status;
}
private Integer code;
private String status;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.common;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @Author small
* @Date 2023/5/26 13:29
* @Version 1.0
*/
@Target(ElementType.METHOD) // 作用于方法上
@Retention(RetentionPolicy.RUNTIME) // 运行时
public @interface RepeatSubmit {
/**
* 设置请求锁定时间 默认5秒
*/
long lockTime() default 5000L;
/**
* 当发生重复提交时候默认返回的错误信息
*/
String errMsg() default "重复提交,请 second 秒后重试";
/**
* 是否允许lockTime时间内可以再次提交
*/
boolean allowAgain() default true;
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:28
* @Version 1.0
*/
public enum TranStatusDic {
INIT("100", "已下单", "等待买家付款"),
YFK("200", "已付款", "等待卖家发货"),
YFH("300", "已发货", "待买家收货"),
ZLZ("400", "租赁中", "待归还"),
GHZ("500", "归还中", "待完成"),
JYWC("600", "交易完成", "交易完成"),
TKSQ("700", "退款申请中", "待退款完成"),
CLOSE("999", "订单关闭", "订单关闭")
;
private String status;
private String waiting;
private String doing;
TranStatusDic(String status, String doing, String waiting) {
this.status = status;
this.doing = doing;
this.waiting = waiting;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getWaiting() {
return waiting;
}
public void setWaiting(String waiting) {
this.waiting = waiting;
}
public String getDoing() {
return doing;
}
public void setDoing(String doing) {
this.doing = doing;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/26 11:30
* @Version 1.0
*/
public enum WarePayStatus {
BEFORE("0", "买家拍下减库存"),
AFTER("1", "卖家付款减库存");
private String status;
private String name;
WarePayStatus(String status, String name) {
this.status = status;
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.mmc.oms.controller;
import com.mmc.oms.common.ResultBody;
import com.mmc.oms.model.dto.OrderInfoDTO;
import com.mmc.oms.model.vo.LeaseOrderVO;
import com.mmc.oms.service.RentalOrdersService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Author small @Date 2023/5/26 10:49 @Version 1.0
*/
@RestController
@RequestMapping("/RentalOrders")
@Api(tags = {"web租赁订单"})
public class RentalOrdersController {
@Autowired private RentalOrdersService rentalOrdersService;
@ApiOperation(value = "租赁-下单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderInfoDTO.class)})
@PostMapping("feignAddLease")
public OrderInfoDTO feignAddLease(@RequestBody LeaseOrderVO param) {
return rentalOrdersService.feignAddLease(param);
}
@ApiOperation(value = "订单-详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderInfoDTO.class)})
@GetMapping("orderDetail")
public ResultBody<OrderInfoDTO> orderDetail(
@ApiParam(value = "订单编号") @RequestParam(required = true) String orderNo) {
return ResultBody.success(rentalOrdersService.getOrderDetail(orderNo));
}
}
package com.mmc.oms.dao;
import com.mmc.oms.entity.CouponUserDO;
import com.mmc.oms.entity.OrderInfoDO;
import com.mmc.oms.entity.OrderReceiptDO;
import com.mmc.oms.entity.OrderRefundDO;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author small @Date 2023/5/26 14:47 @Version 1.0
*/
@Mapper
public interface RentalOrdersDao {
CouponUserDO coupon(Integer couponId);
OrderInfoDO getOrderDetail(String orderNo);
OrderRefundDO getNewOrderRefund(Integer id);
OrderReceiptDO getOrderReceiptInfo(Integer id);
void insertOrderInfo(OrderInfoDO orderInfo);
void insertOrderReceipt(OrderReceiptDO receipt);
}
package com.mmc.oms.entity;
import com.mmc.oms.common.CodeUtil;
import com.mmc.oms.common.TranStatusDic;
import com.mmc.oms.model.dto.OrderInfoDTO;
import com.mmc.oms.model.vo.LeaseOrderVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 15:46 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderInfoDO implements Serializable {
private static final long serialVersionUID = 6544149196885009444L;
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商品id")
private Integer wareInfoId;
@ApiModelProperty(value = "商品id")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品图片")
private String wareImg;
@ApiModelProperty(value = "套餐id")
private Integer skuInfoId;
@ApiModelProperty(value = "套餐名称")
private String skuTitle;
@ApiModelProperty(value = "购买用户id")
private Integer repoAccountId;
@ApiModelProperty(value = "购买用户uid")
private String uid;
@ApiModelProperty(value = "用买用户的名称")
private String buyerName;
@ApiModelProperty(value = "用买用户的手机号")
private String buyerPhone;
@ApiModelProperty(value = "用买用户单价 元/天")
private BigDecimal unitPrice;
@ApiModelProperty(value = "用买商品数量")
private Integer wareNum;
@ApiModelProperty(value = "应付金额")
private BigDecimal shouldPay;
@ApiModelProperty(value = "实付金额")
private BigDecimal actualPay;
@ApiModelProperty(value = "0 租赁 100 购买")
private Integer orderType;
@ApiModelProperty(value = "押金")
private BigDecimal deposit;
@ApiModelProperty(value = "租金总金额")
private BigDecimal rentPrice;
@ApiModelProperty(value = "租期开始日期")
private Date startDate;
@ApiModelProperty(value = "租期结束日期")
private Date endDate;
@ApiModelProperty(value = "付款天数")
private Integer payDay;
@ApiModelProperty(value = "交易订单状态 查订单状态字典")
private String tranStatus;
@ApiModelProperty(value = "减库方式")
private Integer exWare;
@ApiModelProperty(value = "用户备注")
private String remark;
@ApiModelProperty(value = "平台备注")
private String pfRemark;
@ApiModelProperty(value = "关闭原因")
private String shutReason;
@ApiModelProperty(value = "交易编号")
private String payNo;
@ApiModelProperty(value = "付款时间")
private Date payTime;
@ApiModelProperty(value = "发货时间")
private Date sendWareTime;
private Integer rcdCompanyId;
private Date createTime;
private Date updateTime;
private Date returnTime;
@ApiModelProperty(value = "优惠券id", example = "221")
private Integer couponId;
@ApiModelProperty(value = "规格id", example = "1")
private Integer specsId;
/**
* 辅助字段
*
* @return
*/
private OrderReceiptDO receipt;
public OrderInfoDTO buildOrderInfoDTO() {
return OrderInfoDTO.builder()
.id(this.id)
.orderNo(this.orderNo)
.wareInfoId(this.wareInfoId)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.repoAccountId(this.repoAccountId)
.uid(this.uid)
.buyerName(this.buyerName)
.buyerPhone(this.buyerPhone)
.unitPrice(this.unitPrice)
.wareNum(this.wareNum)
.shouldPay(this.shouldPay)
.actualPay(this.actualPay)
.orderType(this.orderType)
.deposit(this.deposit)
.rentPrice(this.rentPrice)
.startDate(this.startDate)
.endDate(this.endDate)
.payDay(this.payDay)
.tranStatus(this.tranStatus)
.createTime(this.createTime)
.payTime(this.payTime)
.payNo(this.payNo)
.wareImg(this.wareImg)
.pfRemark(this.pfRemark)
.shutReason(this.shutReason)
.remark(this.remark)
.receipt(this.receipt == null ? null : receipt.buildOrderReceiptDTO())
.exWare(this.exWare)
.sendWareTime(this.sendWareTime)
.returnTime(this.returnTime)
.couponId(this.couponId)
.specsId(this.specsId)
.build();
}
public OrderInfoDO(LeaseOrderVO lease) {
this.orderNo = CodeUtil.createRepoOrderNo();
this.wareInfoId = lease.getWareInfoId();
this.wareNo = lease.getWareNo();
this.wareTitle = lease.getWareTitle();
this.wareImg = lease.getWareImg();
this.skuInfoId = lease.getSkuInfoId();
this.skuTitle = lease.getSkuTitle();
this.repoAccountId = lease.getRepoAccountId();
this.uid = lease.getUid();
this.buyerName = lease.getBuyerName();
this.buyerPhone = lease.getBuyerPhone();
this.unitPrice = lease.getUnitPrice();
this.wareNum = lease.getWareNum();
this.shouldPay = lease.getShouldPay();
this.actualPay = lease.getActualPay();
this.orderType = lease.getOrderType();
this.deposit = lease.getDeposit();
this.rentPrice = lease.getRentPrice();
this.startDate = lease.getStartDate();
this.endDate = lease.getEndDate();
this.payDay = lease.getPayDay();
this.exWare = lease.getExWare();
this.tranStatus = lease.getTranStatus();
this.remark = lease.getRemark();
this.createTime = lease.getCreateTime();
this.rcdCompanyId = lease.getRcdCompanyId();
this.returnTime = lease.getReturnDate();
this.couponId = lease.getCouponId();
this.specsId = lease.getSpecsId();
this.tranStatus = TranStatusDic.INIT.getStatus();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.OrderReceiptDTO;
import com.mmc.oms.model.vo.OrderReceiptVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 11:15 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderReceiptDO implements Serializable {
private static final long serialVersionUID = 7590192330910329668L;
private Integer id;
private Integer orderInfoId;
private Integer receiptMethod;
private String takeName;
private String takePhone;
private String region;
private String detailAddress;
private String repoName;
private String repoAddress;
private String bookPhone;
private String sendExCode;
private String sendExNo;
private String sendAddress;
private Integer renMethod;
private String renPhone;
private String renName;
private String renExCode;
private String renExNo;
private String renAddress;
private String exName;
private String renRepoName;
private String renRepoAddr;
private String renRepoPhone;
private Date createTime;
public OrderReceiptDO(OrderReceiptVO d) {
this.orderInfoId = d.getOrderInfoId();
this.receiptMethod = d.getReceiptMethod();
this.takeName = d.getTakeName();
this.takePhone = d.getTakePhone();
this.region = d.getRegion();
this.detailAddress = d.getDetailAddress();
this.repoName = d.getRepoName();
this.repoAddress = d.getRepoAddress();
this.bookPhone = d.getBookPhone();
}
public OrderReceiptDTO buildOrderReceiptDTO() {
return OrderReceiptDTO.builder()
.id(this.id)
.receiptMethod(this.receiptMethod)
.takeName(this.takeName)
.takePhone(this.takePhone)
.region(this.region)
.detailAddress(this.detailAddress)
.repoName(this.repoName)
.repoAddress(this.repoAddress)
.bookPhone(this.bookPhone)
.sendExCode(this.sendExCode)
.sendExNo(this.sendExNo)
.sendAddress(this.sendAddress)
.renMethod(this.renMethod)
.renPhone(this.renPhone)
.renName(this.renName)
.renExCode(this.renExCode)
.renExNo(this.renExNo)
.renAddress(this.renAddress)
.renRepoName(this.renRepoName)
.renRepoAddr(this.renRepoAddr)
.renRepoPhone(this.renRepoPhone)
.build();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.OrderRefundDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 17:13 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderRefundDO implements Serializable {
private static final long serialVersionUID = 4323688698785079576L;
private Integer id;
private Integer orderInfoId;
private String refundNo;
private Integer refundStatus;
private BigDecimal shouldRefund;
private BigDecimal actualRefund;
private String reason;
private String pfRemark;
private Date createTime;
private OrderInfoDO orderInfo;
public OrderRefundDTO buildOrderRefundDTO() {
return OrderRefundDTO.builder()
.id(this.id)
.orderInfoId(this.orderInfoId)
.refundStatus(this.refundStatus)
.shouldRefund(this.shouldRefund)
.actualRefund(this.actualRefund)
.reason(this.reason)
.refundNo(this.refundNo)
.orderInfo(this.orderInfo == null ? null : this.orderInfo.buildOrderInfoDTO())
.pfRemark(this.pfRemark)
.createTime(this.createTime)
.build();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.RepoCashDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 11:25 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepoCashDO implements Serializable {
private static final long serialVersionUID = -7930603317037474755L;
private Integer id;
private Integer repoAccountId;
private String uid;
private String accountName;
private Integer orderInfoId;
private String orderNo;
private Integer skuInfoId;
private String skuTitle;
private Integer wareInfoId;
private String wareNo;
private String wareTitle;
private String payNo;
private Integer payMethod;
private BigDecimal amtPaid;
private BigDecimal cashAmt;
private Date payTime;
private String refundNo;
private String voucher;
private String remark;
private Integer createUser;
private Date createTime;
private Integer updateUser;
private Date updateTime;
public RepoCashDTO buildRepoCashDTO() {
return RepoCashDTO.builder()
.id(this.id)
.repoAccountId(this.repoAccountId)
.uid(this.uid)
.accountName(this.accountName)
.orderInfoId(this.orderInfoId)
.orderNo(this.orderNo)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.wareInfoId(this.wareInfoId)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.payNo(this.payNo)
.payMethod(this.payMethod)
.amtPaid(this.amtPaid)
.refundNo(this.refundNo)
.createUser(this.createUser)
.voucher(StringUtils.isBlank(this.voucher) ? null : Arrays.asList(this.voucher.split(",")))
.cashAmt(this.cashAmt)
.payTime(this.payTime)
.remark(this.remark)
.build();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.WareImgDTO;
import com.mmc.oms.model.vo.WareImgVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 11:31 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WareImgDO implements Serializable {
private static final long serialVersionUID = -1711990559893951800L;
private Integer id;
private Integer wareInfoId;
private String imgUrl;
private Integer imgType;
private Integer deleted;
private Date createTime;
public WareImgDTO buildWareImgDTO() {
return WareImgDTO.builder()
.id(this.id)
.wareInfoId(this.wareInfoId)
.imgType(this.imgType)
.imgUrl(this.imgUrl)
.build();
}
public WareImgDO(WareImgVO d) {
this.id = d.getId();
this.imgUrl = d.getImgUrl();
this.imgType = d.getImgType();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.AppletWareInfoDTO;
import com.mmc.oms.model.dto.WareInfoDTO;
import com.mmc.oms.model.dto.WareInfoFirstPageDTO;
import com.mmc.oms.model.dto.WareInfoItemDTO;
import com.mmc.oms.model.vo.WareInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author small @Date 2023/5/26 11:31 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WareInfoDO implements Serializable {
private static final long serialVersionUID = 5530961803742843304L;
private Integer id;
private String wareNo;
private String wareTitle;
private Integer wareTypeId;
private Integer wareStatus;
private Integer payStatus;
private BigDecimal minDeposit;
private BigDecimal maxDeposit;
private BigDecimal minRent;
private BigDecimal maxRent;
private Integer totalStock;
private Integer totalSale;
private Integer skuNum;
private String tags;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer pid;
/** 辅助字段-start */
private List<WareImgDO> wareImgs;
// private List<WareVideoDO> wareVideos;
private WarePropDO warePropDO;
private String wareDetailContent;
// private WareDetailDO wareDetailDO;
// private List<SkuInfoDO> skuInfoDOList;
/** 辅助字段-end */
public WareInfoDTO buildWareInfoDTO() {
return WareInfoDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.payStatus(this.payStatus)
.minDeposit(this.minDeposit)
.maxDeposit(this.maxDeposit)
.minRent(this.minRent)
.maxRent(this.maxRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.skuNum(this.skuNum)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.warePropDTO(this.warePropDO == null ? null : warePropDO.buildWarePropDTO())
.wareDetailContent(this.wareDetailContent)
.build();
}
public WareInfoItemDTO buildWareInfoItemDTO() {
return WareInfoItemDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.minDeposit(this.minDeposit)
.minRent(this.minRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.propInfoId(this.warePropDO.getPropInfoId())
.createTime(this.createTime)
.build();
}
public AppletWareInfoDTO buildAppletWareInfoDTO() {
return AppletWareInfoDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.payStatus(this.payStatus)
.minDeposit(this.minDeposit)
.minRent(this.minRent)
.totalStock(this.totalStock)
.totalSale(this.totalSale)
.skuNum(this.skuNum)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(
d -> {
return d.buildWareImgDTO();
})
.collect(Collectors.toList()))
.build();
}
public WareInfoFirstPageDTO buildWareInfoFirstPageDTO() {
return WareInfoFirstPageDTO.builder()
.id(this.id)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.wareTypeId(this.wareTypeId)
.wareStatus(this.wareStatus)
.minDeposit(this.minDeposit)
.minRent(this.minRent)
.tags(StringUtils.isEmpty(this.tags) ? null : Arrays.asList(this.tags.split(",")))
.wareImgs(
CollectionUtils.isEmpty(this.wareImgs)
? null
: this.wareImgs.stream()
.map(WareImgDO::buildWareImgDTO)
.collect(Collectors.toList()))
.warePropDTO(this.warePropDO == null ? null : warePropDO.buildWarePropDTO())
.build();
}
public WareInfoDO(WareInfoVO wareInfoVO) {
this.id = wareInfoVO.getId();
this.wareTitle = wareInfoVO.getWareTitle();
this.wareTypeId = wareInfoVO.getWareTypeId();
this.wareStatus = wareInfoVO.getWareStatus();
this.payStatus = wareInfoVO.getPayStatus();
this.minDeposit = wareInfoVO.getMinDeposit();
this.minRent = wareInfoVO.getMinRent();
this.minRent = wareInfoVO.getMinRent();
this.totalStock = wareInfoVO.getTotalStock();
this.skuNum = wareInfoVO.getSkuNum();
this.tags = wareInfoVO.getTags();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.WarePropDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/26 11:33
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarePropDO implements Serializable {
private static final long serialVersionUID = -8305801318237157082L;
private Integer id;
private Integer wareInfoId;
private Integer propInfoId;
private String propPoster;
private Date createTime;
public WarePropDTO buildWarePropDTO(){
return WarePropDTO.builder().id(this.id).wareInfoId(this.wareInfoId).propInfoId(this.propInfoId).propPoster(this.propPoster).createTime(this.createTime).build();
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small @Date 2023/5/26 13:20 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppletWareInfoDTO implements Serializable {
private static final long serialVersionUID = -8861604532607064616L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品名称")
private String wareName;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "减库方式")
private Integer payStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "总库存数量")
private Integer totalStock;
@ApiModelProperty(value = "总销量")
private Integer totalSale;
@ApiModelProperty(value = "sku数量")
private Integer skuNum;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
@ApiModelProperty(value = "商品图片集合")
private List<WareImgDTO> wareImgs;
@ApiModelProperty(value = "商品视频集合")
private List<WareVideoDTO> wareVideos;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/26 11:25
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.ExpStationsDTO", description = "物流信息DTO")
public class ExpStationsDTO implements Serializable {
private static final long serialVersionUID = 8737447241343561076L;
@ApiModelProperty(value = "物流状态:查字典")
private String Action;
@ApiModelProperty(value = "描述")
private String AcceptStation;
@ApiModelProperty(value = "时间")
private String AcceptTime;
@ApiModelProperty(value = "所在城市")
private String Location;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small
* @Date 2023/5/26 11:24
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.KdnExpDTO", description = "物流信息DTO")
public class KdnExpDTO implements Serializable {
private static final long serialVersionUID = 4129710329541565557L;
@ApiModelProperty(value = "物流状态:查字典")
private String StateEx;
@ApiModelProperty(value = "快递公司编码:查字典")
private String ShipperCode;
@ApiModelProperty(value = "物流单号")
private String LogisticCode;
@ApiModelProperty(value = "快递流转信息")
private List<ExpStationsDTO> Traces;
}
package com.mmc.oms.model.dto;
import com.mmc.oms.entity.RepoCashDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/26 10:51 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderInfoDTO", description = "云仓订单DTO")
public class OrderInfoDTO implements Serializable {
private static final long serialVersionUID = 1572467108563651846L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商品ID")
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品图片")
private String wareImg;
@ApiModelProperty(value = "套餐(sku)ID")
private Integer skuInfoId;
@ApiModelProperty(value = "套餐(sku)名称")
private String skuTitle;
@ApiModelProperty(value = "购买用户ID")
private Integer repoAccountId;
@ApiModelProperty(value = "用户UID")
private String uid;
@ApiModelProperty(value = "买家name")
private String buyerName;
@ApiModelProperty(value = "买家电话")
private String buyerPhone;
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "购买的商品数量")
private Integer wareNum;
@ApiModelProperty(value = "应付款金额")
private BigDecimal shouldPay;
@ApiModelProperty(value = "实收款金额")
private BigDecimal actualPay;
@ApiModelProperty(value = "订单类型:0租赁 100购买")
private Integer orderType;
@ApiModelProperty(value = "押金")
private BigDecimal deposit;
@ApiModelProperty(value = "租金总金额")
private BigDecimal rentPrice;
@ApiModelProperty(value = "租约开始日")
private Date startDate;
@ApiModelProperty(value = "租约结束日")
private Date endDate;
@ApiModelProperty(value = "付款天数")
private Integer payDay;
@ApiModelProperty(value = "交易状态:查订单状态字典")
private String tranStatus;
@ApiModelProperty(value = "减库方式 0:买家拍下减库存 1:卖家付款减库存")
private Integer exWare;
@ApiModelProperty(value = "用户备注")
private String remark;
@ApiModelProperty(value = "平台人员备注")
private String pfRemark;
@ApiModelProperty(value = "关闭原因")
private String shutReason;
@ApiModelProperty(value = "交易编号")
private String payNo;
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "发货时间")
private Date sendWareTime;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "物流信息/收货地址信息")
private OrderReceiptDTO receipt;
@ApiModelProperty(value = "退款单详情信息,无则为null")
private OrderRefundDTO orderRefund;
@ApiModelProperty(value = "发货-物流动态,无则为null")
private KdnExpDTO express;
@ApiModelProperty(value = "退货-物流动态,无则为null")
private KdnExpDTO refundExpress;
@ApiModelProperty(value = "质检详情,无则为null")
private List<OrderVcuDTO> vcus;
@ApiModelProperty(value = "归还时间")
private Date returnTime;
@ApiModelProperty(value = "优惠券id", example = "221")
private Integer couponId;
@ApiModelProperty(value = "规格id", example = "1")
private Integer specsId;
public RepoCashDO buildRepoCashDO() {
return RepoCashDO.builder()
.uid(this.uid)
.accountName(this.buyerName)
.orderInfoId(this.id)
.orderNo(this.orderNo)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.wareInfoId(this.wareInfoId)
.wareTitle(this.wareTitle)
.wareNo(this.wareNo)
.build();
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/26 11:21 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderReceiptDTO", description = "订单收货信息DTO")
public class OrderReceiptDTO implements Serializable {
private static final long serialVersionUID = -6212026509857770276L;
@ApiModelProperty(value = "地址ID")
private Integer id;
@ApiModelProperty(value = "收货方式:0邮寄 1门店地址")
private Integer receiptMethod;
@ApiModelProperty(value = "0-收货人姓名")
private String takeName;
@ApiModelProperty(value = "0-收货人电话")
private String takePhone;
@ApiModelProperty(value = "0-收货区域")
private String region;
@ApiModelProperty(value = "0-收获详细地址")
private String detailAddress;
@ApiModelProperty(value = "1-门店名称")
private String repoName;
@ApiModelProperty(value = "1-门店详细地址")
private String repoAddress;
@ApiModelProperty(value = "1-预留手机号")
private String bookPhone;
@ApiModelProperty(value = "发货-物流公司码")
private String sendExCode;
@ApiModelProperty(value = "发货-物流单号")
private String sendExNo;
@ApiModelProperty(value = "发货地址")
private String sendAddress;
@ApiModelProperty(value = "退还货方式:0邮寄 1门店地址")
private Integer renMethod;
@ApiModelProperty(value = "退还货-收货电话")
private String renPhone;
@ApiModelProperty(value = "退还货-收货人")
private String renName;
@ApiModelProperty(value = "退还货-物流公司码")
private String renExCode;
@ApiModelProperty(value = "退还货-物流单号")
private String renExNo;
@ApiModelProperty(value = "退还货-地址")
private String renAddress;
@ApiModelProperty(value = "退还货-门店名称")
private String renRepoName;
@ApiModelProperty(value = "退还货-门店地址")
private String renRepoAddr;
@ApiModelProperty(value = "退还货-门店联系电话")
private String renRepoPhone;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/26 11:23 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderRefundDTO", description = "退款单DTO")
public class OrderRefundDTO implements Serializable {
private static final long serialVersionUID = -6124933008580173589L;
@ApiModelProperty(value = "退款单ID")
private Integer id;
@ApiModelProperty(value = "订单ID")
private Integer orderInfoId;
@ApiModelProperty(value = "退款单号")
private String refundNo;
@ApiModelProperty(value = "退款单状态:查字典")
private Integer refundStatus;
@ApiModelProperty(value = "应退款金额")
private BigDecimal shouldRefund;
@ApiModelProperty(value = "实际退款金额")
private BigDecimal actualRefund;
@ApiModelProperty(value = "退款理由")
private String reason;
@ApiModelProperty(value = "创建时间/申请时间")
private Date createTime;
@ApiModelProperty(value = "退款-设备情况(图片&视频)")
private OrderVcuDTO orderVcu;
@ApiModelProperty(value = "订单信息")
private OrderInfoDTO orderInfo;
@ApiModelProperty(value = "退款协商历史")
private List<RefundLogDTO> rlogs;
@ApiModelProperty(value = "退款流水信息")
private RepoCashDTO refundCash;
@ApiModelProperty(value = "平台备注")
private String pfRemark;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small
* @Date 2023/5/26 11:24
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.OrderVcuDTO", description = "订单凭证DTO")
public class OrderVcuDTO implements Serializable {
private static final long serialVersionUID = -7101242524092899210L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "订单ID")
private Integer orderInfoId;
@ApiModelProperty(value = "0:发货 1:收货 2:归还 3:平台收货")
private Integer vcuType;
@ApiModelProperty(value = "设备状况:0无问题 1有问题")
private Integer vcuSatus;
@ApiModelProperty(value = "描述-备注")
private String remark;
@ApiModelProperty(value = "图片集合")
private List<String> imgs;
@ApiModelProperty(value = "视频")
private String videoUrl;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/26 11:27
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.RefundLogDTO", description = "退款logDTO")
public class RefundLogDTO implements Serializable {
private static final long serialVersionUID = 6524395508534109389L;
@ApiModelProperty(value = "内容")
private String msg;
@ApiModelProperty(value = "账号")
private String opAccount;
@ApiModelProperty(value = "名称")
private String opName;
@ApiModelProperty(value = "创建/发送时间")
private Date createTime;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/26 11:25 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.RepoBannerDTO", description = "现金流水DTO")
public class RepoCashDTO implements Serializable {
private static final long serialVersionUID = 4569221850373256579L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "用户ID", hidden = true)
private Integer repoAccountId;
@ApiModelProperty(value = "用户UID", hidden = true)
private String uid;
@ApiModelProperty(value = "用户名", hidden = true)
private String accountName;
@ApiModelProperty(value = "订单ID", hidden = true)
private Integer orderInfoId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "skuID", hidden = true)
private Integer skuInfoId;
@ApiModelProperty(value = "sku标题", hidden = true)
private String skuTitle;
@ApiModelProperty(value = "商品ID", hidden = true)
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号", hidden = true)
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "流水编号")
private String payNo;
@ApiModelProperty(value = "流水类型:查字典")
private Integer payMethod;
@ApiModelProperty(value = "变动金额")
private BigDecimal amtPaid;
@ApiModelProperty(value = "当前余额")
private BigDecimal cashAmt;
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "退款流水编号")
private String refundNo;
@ApiModelProperty(value = "凭证")
private List<String> voucher;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "操作人账号")
private String opNo;
@ApiModelProperty(value = "操作人姓名")
private String opName;
private Integer createUser;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/26 11:15
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.RepoInfoDTO", description = "仓库/门店DTO")
public class RepoInfoDTO implements Serializable {
private static final long serialVersionUID = 8002261035352227237L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "仓库名称")
private String repoName;
@ApiModelProperty(value = "仓库编号")
private String repoNo;
@ApiModelProperty(value = "仓库地址")
private String repoAddress;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "仓库营业时间")
private String repoBusinessHours;
@ApiModelProperty(value = "管理员Id")
private Integer userAccountId;
@ApiModelProperty(value = "管理员账号")
private String accountNo;
@ApiModelProperty(value = "管理员姓名")
private String userName;
@ApiModelProperty(value = "管理员手机号")
private String phoneNum;
@ApiModelProperty(value = "仓库库存")
private Integer repoInventory;
@ApiModelProperty(value = "是否删除")
private Integer deleted;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "设备个数")
private Integer deviceNum;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author small
* @Date 2023/5/26 11:06
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.SkuOrderDTO", description = "计算租金QO")
public class SkuOrderDTO implements Serializable {
private static final long serialVersionUID = -8313939232076188505L;
@ApiModelProperty(value = "商品ID")
private Integer wareInfoId;
@ApiModelProperty(value = "skuID")
private Integer skuInfoId;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品主图片Url")
private String mainImg;
@ApiModelProperty(value = "sku标题")
private String skuTitle;
@ApiModelProperty(value = "减库方式- 0:买家拍下减库存 1:卖家付款减库存", hidden = true)
private Integer payStatus;
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "购买数量")
private Integer wareNum;
@ApiModelProperty(value = "库存数量")
private Integer stockNum;
@ApiModelProperty(value = "租赁天数")
private Integer rentDay;
@ApiModelProperty(value = "押金总额")
private BigDecimal deposit;
@ApiModelProperty(value = "租金总额")
private BigDecimal rentPrice;
@ApiModelProperty(value = "应付款总额")
private BigDecimal shouldPay;
@ApiModelProperty(value = "辅助字段---数据库版本号")
private Integer pid;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/26 11:32 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.WareImgDTO", description = "商品图片DTO")
public class WareImgDTO implements Serializable {
private static final long serialVersionUID = 1195966760401573468L;
@ApiModelProperty(value = "图片ID")
private Integer id;
@ApiModelProperty(value = "商品ID")
private Integer wareInfoId;
@ApiModelProperty(value = "图片类型:0:主图 1:副图")
private String imgUrl;
@ApiModelProperty(value = "图片ID")
private Integer imgType;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small @Date 2023/5/26 13:18 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.WareInfoDTO", description = "商品视频DTO")
public class WareInfoDTO implements Serializable {
private static final long serialVersionUID = -4916469576205012865L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "减库方式")
private Integer payStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最大押金")
private BigDecimal maxDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "最大租金")
private BigDecimal maxRent;
@ApiModelProperty(value = "总库存数量")
private Integer totalStock;
@ApiModelProperty(value = "总销量")
private Integer totalSale;
@ApiModelProperty(value = "sku数量")
private Integer skuNum;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
@ApiModelProperty(value = "商品图片集合")
private List<WareImgDTO> wareImgs;
// @ApiModelProperty(value = "商品视频集合")
// private List<WareVideoDTO> wareVideos;
@ApiModelProperty(value = "商品活动对象")
private WarePropDTO warePropDTO;
@ApiModelProperty(value = "商品介绍详情")
private String wareDetailContent;
// @ApiModelProperty(value = "商品介绍详情")
// private WareDetailDTO wareDetailDTO;
// @ApiModelProperty(value = "商品sku信息")
// private List<SkuInfoDTO> skuInfoDTOList;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small @Date 2023/5/26 13:20 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.WareInfoFirstPageDTO", description = "商品首页DTO")
public class WareInfoFirstPageDTO implements Serializable {
private static final long serialVersionUID = -220701135688609035L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
@ApiModelProperty(value = "商品图片集合")
private List<WareImgDTO> wareImgs;
// @ApiModelProperty(value = "商品视频集合")
// private List<WareVideoDTO> wareVideos;
@ApiModelProperty(value = "商品活动对象")
private WarePropDTO warePropDTO;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/26 13:18 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.WareInfoItemDTO", description = "商品列表ItemDTO")
public class WareInfoItemDTO implements Serializable {
private static final long serialVersionUID = -4354269497656808831L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品类型ID")
private Integer wareTypeId;
@ApiModelProperty(value = "商品状态")
private Integer wareStatus;
@ApiModelProperty(value = "最小押金")
private BigDecimal minDeposit;
@ApiModelProperty(value = "最小租金")
private BigDecimal minRent;
@ApiModelProperty(value = "总库存数量")
private Integer totalStock;
@ApiModelProperty(value = "总销量")
private Integer totalSale;
@ApiModelProperty(value = "商品活动属性Id")
private Integer propInfoId;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "商品图片")
private List<WareImgDTO> wareImgs;
@ApiModelProperty(value = "标签集合")
private List<String> tags;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/26 11:33
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.WarePropDTO", description = "商品活动海报信息DTO")
public class WarePropDTO implements Serializable {
private static final long serialVersionUID = 7641929218904130060L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品id")
private Integer wareInfoId;
@ApiModelProperty(value = "活动信息id")
private Integer propInfoId;
@ApiModelProperty(value = "活动海报")
private String propPoster;
@ApiModelProperty(value = "生成时间")
private Date createTime;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/26 13:20
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.WareVideoDTO", description = "商品视频DTO")
public class WareVideoDTO implements Serializable {
private static final long serialVersionUID = 8707716829904299103L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "商品信息id")
private Integer wareInfoId;
@ApiModelProperty(value = "视频url")
private String videoUrl;
@ApiModelProperty(value = "0:主视频 1:副视频")
private Integer videoType;
}
package com.mmc.oms.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 11:28 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseOrderVO implements Serializable {
private static final long serialVersionUID = 3876353091071918771L;
@ApiModelProperty(value = "订单编号", hidden = true)
private String orderNo;
@ApiModelProperty(value = "商品id", example = "1")
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号", example = "mmcKu001")
private String wareNo;
@ApiModelProperty(value = "商品标题", example = "入云龙")
private String wareTitle;
@ApiModelProperty(
value = "商品图片",
example =
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/4edf7f84-1586-4f33-ad79-c37b9f31cbce.jpg")
private String wareImg;
@ApiModelProperty(value = "套餐sku id", hidden = true)
private Integer skuInfoId;
@ApiModelProperty(value = "套餐sku名称", hidden = true)
private String skuTitle;
@ApiModelProperty(value = "租赁的用户id", example = "1")
private Integer repoAccountId;
@ApiModelProperty(value = "租赁的用户uid", example = "UID008123")
private String uid;
@ApiModelProperty(value = "租赁的用户名称", example = "xiaoXiao")
private String buyerName;
@ApiModelProperty(value = "租赁的用户手机", example = "18923131232")
private String buyerPhone;
@ApiModelProperty(value = "单价 元/天", hidden = true)
private BigDecimal unitPrice;
@ApiModelProperty(value = "租赁商品数量", example = "3")
private Integer wareNum;
@ApiModelProperty(value = "应付款金额", example = "120")
private BigDecimal shouldPay;
@ApiModelProperty(value = "实付款金额", example = "30")
private BigDecimal actualPay;
@ApiModelProperty(value = "订单类型 0租赁 100购买", hidden = true)
private Integer orderType;
@ApiModelProperty(value = "押金 默认0", example = "0")
private BigDecimal deposit;
@ApiModelProperty(value = "租金总金额", example = "90")
private BigDecimal rentPrice;
@ApiModelProperty(value = "租赁开始日期", example = "2023-05-20")
@JsonFormat(locale = "zh", timezone = "CMT+8", pattern = "yyyy-MM-dd")
private Date startDate;
@JsonFormat(locale = "zh", timezone = "CMT+8", pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "租赁结束日期", example = "2023-05-27")
private Date endDate;
@JsonFormat(locale = "zh", timezone = "CMT+8", pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "租赁归还日期", example = "2023-05-28")
private Date returnDate;
@ApiModelProperty(value = "付款天数", hidden = true)
private Integer payDay;
@ApiModelProperty(value = "减库方式---0:买家拍下减库存 1:卖家付款减库存", hidden = true)
private Integer exWare;
@ApiModelProperty(value = "交易状态: 查订单状态字典")
private String tranStatus;
@ApiModelProperty(value = "用户备注", example = "包装需要完好")
private String remark;
@ApiModelProperty(value = "")
private Integer rcdCompanyId;
@ApiModelProperty(value = "添加时间", hidden = true)
private Date createTime;
@ApiModelProperty(value = "收获地址")
private OrderReceiptVO orderReceipt;
@ApiModelProperty(value = "优惠券id", example = "221")
private Integer couponId;
@ApiModelProperty(value = "规格id", example = "1")
private Integer specsId;
}
package com.mmc.oms.model.vo;
import com.mmc.oms.entity.OrderReceiptDO;
import com.mmc.oms.model.dto.RepoInfoDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/26 11:14 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.OrderReceiptVO", description = "收货地址类")
public class OrderReceiptVO implements Serializable {
private static final long serialVersionUID = -3695743775258866831L;
@ApiModelProperty(value = "", hidden = true)
private Integer id;
@ApiModelProperty(value = "订单id", example = "1")
private Integer orderInfoId;
@ApiModelProperty(value = "收货方式:0邮寄 1门店地址", example = "0")
private Integer receiptMethod;
@ApiModelProperty(value = "收货人姓名", example = "xiao")
private String takeName;
@ApiModelProperty(value = "收货人手机号", example = "18923323223")
private String takePhone;
@ApiModelProperty(value = "收获区域", example = "广东省深圳市")
private String region;
@ApiModelProperty(value = "收获详细地址", example = "南山区XXXX")
private String detailAddress;
@ApiModelProperty(value = "门店名称", hidden = true)
private String repoName;
@ApiModelProperty(value = "门店地址", hidden = true)
private String repoAddress;
@ApiModelProperty(value = "预留手机号", hidden = true)
private String bookPhone;
@ApiModelProperty(value = "物流公司编码")
private String sendExCode;
@ApiModelProperty(value = "物流单号")
private String sendExNo;
public void buildAddress(RepoAddressDTO d) {
this.takeName = d.getRealName();
this.takePhone = d.getPhoneNum();
this.region = d.getRegion();
this.detailAddress = d.getDetailAddress();
}
public void buildAddress(RepoInfoDTO d, String bookPhone) {
this.repoName = d.getRepoName();
this.repoAddress = d.getRepoAddress();
this.bookPhone = bookPhone;
}
public OrderReceiptDO buildOrderReceiptDO() {
return OrderReceiptDO.builder()
.orderInfoId(this.orderInfoId)
.sendExCode(this.sendExCode)
.sendExNo(this.sendExNo)
.build();
}
}
package com.mmc.oms.model.vo;
import com.mmc.oms.common.Confirm;
import com.mmc.oms.common.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* @Author small
* @Date 2023/5/26 14:10
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PriceAcquisition {
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "规格id")
private Integer specsId;
@ApiModelProperty(value = "天数")
private Integer day;
@ApiModelProperty(value = "渠道等级id")
private Integer channelLevelId;
}
package com.mmc.oms.model.vo;
import com.mmc.oms.common.Confirm;
import com.mmc.oms.common.Query;
import com.mmc.oms.common.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 10:54 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.MathOrderVO", description = "计算租金VO")
public class RentalOrderVO implements Serializable {
private static final long serialVersionUID = -7517024869922103415L;
@ApiModelProperty(value = "id")
@NotNull(
message = "订单id",
groups = {Update.class, Query.class})
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商品id")
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品图片")
private String wareImg;
@ApiModelProperty(value = "购买用户id")
private Integer repoAccountId;
@ApiModelProperty(value = "购买用户uid")
private String uid;
@ApiModelProperty(value = "购买用户名称")
private String buyerName;
@ApiModelProperty(value = "购买用户手机号")
private String buyerPhone;
@ApiModelProperty(value = "购买用户地址")
private String buyerAddress;
@ApiModelProperty(value = "备注")
private String remark;
private String shutReason;
private String payNo;
private Date payTime;
private Date sendWareTime;
private Integer rcdCompanyId;
@ApiModelProperty(value = "购买数量")
@Min(value = 1)
@NotNull(
message = "商品数量不能为空",
groups = {Confirm.class, Query.class})
private Integer wareNum;
@ApiModelProperty(value = "起租时间")
@NotNull(
message = "起租时间不能为空",
groups = {Confirm.class, Query.class})
private Date startDate;
@ApiModelProperty(value = "结束时间")
@NotNull(
message = "结束时间不能为空",
groups = {Confirm.class, Query.class})
private Date endDate;
@ApiModelProperty(value = "归还时间")
@NotNull(
message = "归还时间不能为空",
groups = {Confirm.class, Query.class})
private Date returnTime;
@ApiModelProperty(value = "规格id")
@NotNull(
message = "规格id不能为null",
groups = {Confirm.class, Query.class})
private Integer specsId;
@ApiModelProperty(value = "优惠券的id")
private Integer couponId;
}
package com.mmc.oms.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/26 11:14
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.RepoAddressDTO", description = "云仓地址信息DTO")
public class RepoAddressDTO implements Serializable {
private static final long serialVersionUID = 610413683850745833L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "用户id")
private Integer repoAccountId;
@ApiModelProperty(value = "姓名")
private String realName;
@ApiModelProperty(value = "电话")
private String phoneNum;
@ApiModelProperty(value = "地区")
private String region;
@ApiModelProperty(value = "详细地址")
private String detailAddress;
@ApiModelProperty(value = "使用类型")
private Integer type;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
}
package com.mmc.oms.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/26 11:32
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.WareImgVO", description = "新增/修改参数类")
public class WareImgVO implements Serializable {
private static final long serialVersionUID = 7742617679026160607L;
@ApiModelProperty(value = "图片id")
private Integer id;
@ApiModelProperty(value = "商品图片地址")
private String imgUrl;
@ApiModelProperty(value = "商品图片类型")
private Integer imgType;
}
package com.mmc.oms.model.vo;
import com.mmc.oms.common.Create;
import com.mmc.oms.common.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small
* @Date 2023/5/26 13:22
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.WareInfoVO", description = "新增/修改参数类")
public class WareInfoVO implements Serializable {
private static final long serialVersionUID = -4503117649945902464L;
@ApiModelProperty(value = "id")
@NotNull(message = "更新时ID不能为空", groups = { Update.class})
private Integer id;
@ApiModelProperty(value = "商品名称")
@NotEmpty(message = "商品名称不能为空", groups = { Create.class})
@Size(max = 60, message = "商品名称不能超过60个字符", groups = { Create.class, Update.class })
private String wareTitle;
@ApiModelProperty(value = "商品类型id")
@NotNull(message = "商品类型ID不能为空", groups = {Create.class})
private Integer wareTypeId;
@ApiModelProperty(value = "商品活动id")
private Integer propInfoId;
@ApiModelProperty(value = "商品活动海报url")
private String propPoster;
@ApiModelProperty(value = "商品状态")
@NotNull(message = "商品状态不能为空", groups = {Create.class})
private Integer wareStatus;
@ApiModelProperty(value = "支付信息(减库方式)")
@NotNull(message = "支付信息(减库方式)不能为空", groups = {Create.class})
private Integer payStatus;
@ApiModelProperty(value = "一口押金-最小押金")
@NotNull(message = "最小押金不能为空", groups = {Create.class})
@Min(value = 0, groups = {Create.class, Update.class })
private BigDecimal minDeposit;
@ApiModelProperty(value = "一口价-最小日租金")
@NotNull(message = "最小租金不能为空", groups = {Create.class})
@Min(value = 0, groups = {Create.class, Update.class })
private BigDecimal minRent;
@ApiModelProperty(value = "商品标签")
private String tags;
@ApiModelProperty(value = "商品总量")
@Min(value = 0, groups = {Create.class})
private Integer totalStock;
@ApiModelProperty(value = "商品详情")
@NotEmpty(message = "商品详情不能为空", groups = { Create.class })
private String wareDetailContent;
@ApiModelProperty(value = "sku总数量")
@Min(value = 0, groups = {Create.class, Update.class })
private Integer skuNum;
@ApiModelProperty(value = "商品图片")
@NotEmpty(message = "商品图片不能为空", groups = { Create.class })
private List<WareImgVO> imgList;
@ApiModelProperty(value = "新加的商品sku")
@NotEmpty(message = "商品sku不能为空", groups = {Create.class })
private List<WareSkuInfoVO> wareSkuInfoList;
@ApiModelProperty(value = "更新的商品sku")
private List<WareSkuInfoVO> updateSkuList;
@ApiModelProperty(value = "需要删除的sku的id列表")
private List<Integer> deleteSkuIds;
@ApiModelProperty(value = "需要删除的照片id列表")
private List<Integer> deleteImgIds;
}
package com.mmc.oms.model.vo;
import com.mmc.oms.common.Create;
import com.mmc.oms.common.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author small
* @Date 2023/5/26 13:22
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.WareSkuInfoVO", description = "新增/修改参数类")
public class WareSkuInfoVO implements Serializable {
private static final long serialVersionUID = 7401232386069965527L;
@ApiModelProperty(value = "sku的id")
@NotNull(message = "sku的id不能为空", groups = {Update.class })
private Integer id;
@ApiModelProperty(value = "商品skuTitle名称")
@NotEmpty(message = "商品skuTitle名称不能为空", groups = { Create.class})
private String skuTitle;
@ApiModelProperty(value = "出租押金")
@NotNull(message = "出租押金不能为空", groups = {Create.class})
@Min(value = 0, message = "出租押金不能小于0", groups = {Create.class, Update.class })
@Max(value = 100000000, message = "出租押金不能大于100000000", groups = {Create.class, Update.class })
private BigDecimal rentDeposit;
@ApiModelProperty(value = "sku库存数量")
@NotNull(message = "sku库存数量不能为空", groups = {Create.class})
@Min(value = 0, message = "sku库存数量不能小于0", groups = {Create.class, Update.class })
private Integer stockNum;
@ApiModelProperty(value = "sku对应价格列表")
@NotEmpty(message = "sku对应价格列表不能为空", groups = { Create.class})
List<WareSkuPriceVO> wareSkuPriceVOList;
}
package com.mmc.oms.model.vo;
import com.mmc.oms.common.Create;
import com.mmc.oms.common.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author small
* @Date 2023/5/26 13:23
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.WareSkuInfoVO", description = "新增/修改参数类")
public class WareSkuPriceVO implements Serializable {
private static final long serialVersionUID = -3033801564005806565L;
@ApiModelProperty(value = "sku对应的id")
@NotNull(message = "sku对应的id不能为空", groups = {Update.class })
private Integer id;
@ApiModelProperty(value = "出租价格")
@NotNull(message = "出租价格不能为空", groups = {Create.class})
@Min(value = 0, message = "出租价格不能小于0", groups = {Create.class, Update.class })
@Max(value = 100000000, message = "出租价格不能大于100000000", groups = {Create.class, Update.class })
private BigDecimal rentPrice;
@ApiModelProperty(value = "起租天数")
@NotNull(message = "起租天数不能为空", groups = {Create.class })
@Min(value = 0, message = "起租天数不能小于0", groups = {Create.class, Update.class })
private Integer minDay;
@ApiModelProperty(value = "最大天数")
@NotNull(message = "最大天数不能为空", groups = {Create.class })
@Min(value = 0, message = "最大天数不能小于0", groups = {Create.class, Update.class })
private Integer maxDay;
}
package com.mmc.oms.service.Impl;
import com.mmc.oms.common.CodeUtil;
import com.mmc.oms.common.ResultBody;
import com.mmc.oms.common.ResultEnum;
import com.mmc.oms.common.TranStatusDic;
import com.mmc.oms.dao.RentalOrdersDao;
import com.mmc.oms.entity.*;
import com.mmc.oms.model.dto.*;
import com.mmc.oms.model.vo.LeaseOrderVO;
import com.mmc.oms.model.vo.OrderReceiptVO;
import com.mmc.oms.model.vo.PriceAcquisition;
import com.mmc.oms.model.vo.RentalOrderVO;
import com.mmc.oms.service.RentalOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/26 10:53 @Version 1.0
*/
@Service
public class RentalOrdersServiceImpl implements RentalOrdersService {
// @Autowired
// private RestTemplate restTemplate;
@Autowired private RentalOrdersDao rentalOrdersDao;
@Override
public OrderInfoDTO feignAddLease(LeaseOrderVO param) {
OrderInfoDO orderInfo = new OrderInfoDO(param);
// 每天单价
BigDecimal unitPrice = orderInfo.getUnitPrice();
int i = 12;
BigDecimal bigDecimal = BigDecimal.valueOf(i);
orderInfo.setUnitPrice(bigDecimal);
// 天数
orderInfo.setPayDay(2);
rentalOrdersDao.insertOrderInfo(orderInfo);
// 添加收货地址
Date cdate = new Date();
OrderReceiptVO rv = param.getOrderReceipt();
OrderReceiptDO receipt = new OrderReceiptDO(rv);
receipt.setOrderInfoId(orderInfo.getId());
receipt.setCreateTime(cdate);
rentalOrdersDao.insertOrderReceipt(receipt);
OrderInfoDTO dto = orderInfo.buildOrderInfoDTO();
return dto;
}
@Override
@Transactional
public ResultBody addLease(BaseAccountDTO account, RentalOrderVO param) {
// 通过用户获取渠道等级id 未完善
Integer channelLevelId = getChannelLevel(account.getId());
// 通过渠道等级获取每一天的单价 未完善
Double unitPrice = getUnitPrice(param, channelLevelId);
Integer day = day(param);
// 计算方式 单价 乘以 数量*天数 减去优惠券的价格最后得到需要支付的价格是吗
// 需要支付的价格
Double payment = null;
payment = unitPrice * param.getWareNum() * day;
CouponUserDO coupon = rentalOrdersDao.coupon(param.getCouponId());
// 优惠券是否过期
long now = System.currentTimeMillis();
long time = coupon.getEndTime().getTime();
if (now > time) {
return ResultBody.error("优惠券过期");
}
BigDecimal couponMoney = coupon.getCouponMoney();
double v = couponMoney.doubleValue();
payment -= v;
// 下单
OrderInfoDO orderInfoDO = new OrderInfoDO();
// rentalOrdersDao.insertOrderInfo(orderInfo);
return ResultBody.success();
}
/**
* 获取渠道等级
*
* @param userId
* @return
*/
public Integer getChannelLevel(Integer userId) {
// 远程接口调用 传一个userId获取到渠道等级的id 接口找洁
// 需要调整
/* ResponseEntity<String> response =
restTemplate.getForEntity("http://localhost:35150/userapp/user-account/feignGetUserSimpleInfo?userAccountId=1",String.class);
String body1 = response.getBody();
UserAccountSimpleDTO account = JSON.parseObject(body1, UserAccountSimpleDTO.class);*/
return 1;
}
/**
* 获取每一天的价格
*
* @param param
* @param channelLevelId
* @return
*/
private Double getUnitPrice(RentalOrderVO param, Integer channelLevelId) {
PriceAcquisition priceAcquisition = new PriceAcquisition();
// 传 规格id ,用户id,天数,渠道等级id 给刘,获取到价格
Date startDate = param.getStartDate();
Date endDate = param.getEndDate();
long start = startDate.getTime();
long end = endDate.getTime();
long day = end - start;
int i = (int) day;
// 调用远程接口获取单价 计算方式 单价 乘以 数量*天数 减去优惠券的价格最后得到需要支付的价格是吗
// 单价
Integer unitPrice = 1;
// 需要支付的价格
return 12.09;
}
public Integer day(RentalOrderVO param) {
Date startDate = param.getStartDate();
Date endDate = param.getEndDate();
long start = startDate.getTime();
long end = endDate.getTime();
long day = end - start;
int i = (int) day;
return i;
}
private LeaseOrderVO buildLease(
RepoAccountDTO account, RentalOrderVO param, SkuOrderDTO sku, OrderReceiptVO rv) {
Date cdate = new Date();
return LeaseOrderVO.builder()
.orderNo(CodeUtil.createRepoOrderNo())
.wareInfoId(sku.getWareInfoId())
.wareTitle(sku.getWareTitle())
.wareNo(sku.getWareNo())
.skuInfoId(sku.getSkuInfoId())
.skuTitle(sku.getSkuTitle())
.repoAccountId(account.getId())
.uid(account.getUid())
.buyerName(account.getAccountName())
.buyerPhone(account.getPhoneNum())
.unitPrice(sku.getUnitPrice())
.wareNum(sku.getWareNum())
.shouldPay(sku.getShouldPay())
.actualPay(BigDecimal.ZERO)
.orderType(0)
.deposit(sku.getDeposit())
.rentPrice(sku.getRentPrice())
.startDate(param.getStartDate())
.endDate(param.getEndDate())
.payDay(sku.getRentDay())
.tranStatus(TranStatusDic.INIT.getStatus())
.remark(param.getRemark())
.rcdCompanyId(account.getRcdCompanyId())
.exWare(sku.getPayStatus())
.wareImg(sku.getMainImg())
.createTime(cdate)
.orderReceipt(rv)
.build();
}
@Transactional
public ResultBody computeStockNum(
Integer wareInfoId, Integer skuInfoId, Integer addStock, Integer addSale) {
if (addStock != null && addStock < 0) {
int stock = (addStock * -1);
WareInfoDO ware = null;
// wareInfoDao.getWareSimpleInfo(wareInfoId);
if (ware.getTotalStock() < stock) {
return ResultBody.error(ResultEnum.WARE_NOT_ENOUGH_ERROR);
}
int newStock = ware.getTotalStock() - stock;
if (newStock == 0) {
// 下架
// wareInfoDao.updateDownWare(wareInfoId);
}
}
if (addStock == null) {
addStock = 0;
}
int count = 0;
// skuInfoDao.updateSkuNumInfo(skuInfoId,addStock,addSale);
if (count != 1) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultBody.error(ResultEnum.OPERATION_SYS_ERROR);
}
int updateCount = 0;
// wareInfoDao.updateWareNumInfo(wareInfoId,addStock,addSale);
if (updateCount != 1) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultBody.error(ResultEnum.OPERATION_SYS_ERROR);
}
return ResultBody.success();
}
@Override
public OrderInfoDTO getOrderDetail(String orderNo) {
OrderInfoDO order = rentalOrdersDao.getOrderDetail(orderNo);
OrderInfoDTO orderInfo = order.buildOrderInfoDTO();
OrderReceiptDO rd = rentalOrdersDao.getOrderReceiptInfo(order.getId());
OrderReceiptDTO receipt = rd.buildOrderReceiptDTO();
orderInfo.setReceipt(receipt);
// 查询-最新的退款详情单
OrderRefundDO orderRefund = rentalOrdersDao.getNewOrderRefund(order.getId());
if (orderRefund != null) {
OrderRefundDTO refund = orderRefund.buildOrderRefundDTO();
orderInfo.setOrderRefund(refund);
}
return orderInfo;
}
}
package com.mmc.oms.service;
import com.mmc.oms.common.ResultBody;
import com.mmc.oms.model.dto.BaseAccountDTO;
import com.mmc.oms.model.dto.OrderInfoDTO;
import com.mmc.oms.model.vo.LeaseOrderVO;
import com.mmc.oms.model.vo.RentalOrderVO;
/**
* @Author small @Date 2023/5/26 10:52 @Version 1.0
*/
public interface RentalOrdersService {
ResultBody addLease(BaseAccountDTO account, RentalOrderVO rentalOrderVO);
OrderInfoDTO getOrderDetail(String orderNo);
OrderInfoDTO feignAddLease(LeaseOrderVO param);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.oms.dao.RentalOrdersDao">
<resultMap id="orderInfoResultMap"
type="com.mmc.oms.entity.OrderInfoDO">
<id property="id" column="id"/>
<result property="orderNo" column="order_no"/>
<result property="wareInfoId" column="ware_info_id"/>
<result property="wareNo" column="ware_no"/>
<result property="wareTitle" column="ware_title"/>
<result property="wareImg" column="ware_img"/>
<result property="skuInfoId" column="sku_info_id"/>
<result property="skuTitle" column="sku_title"/>
<result property="repoAccountId" column="repo_account_id"/>
<result property="uid" column="uid"/>
<result property="buyerName" column="buyer_name"/>
<result property="buyerPhone" column="buyer_phone"/>
<result property="unitPrice" column="unit_price"/>
<result property="wareNum" column="ware_num"/>
<result property="shouldPay" column="should_pay"/>
<result property="actualPay" column="actual_pay"/>
<result property="orderType" column="order_type"/>
<result property="deposit" column="deposit"/>
<result property="rentPrice" column="rent_price"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="payDay" column="pay_day"/>
<result property="tranStatus" column="tran_status"/>
<result property="exWare" column="ex_ware"/>
<result property="remark" column="remark"/>
<result property="pfRemark" column="pf_remark"/>
<result property="shutReason" column="shut_reason"/>
<result property="payNo" column="pay_no"/>
<result property="payTime" column="pay_time"/>
<result property="sendWareTime" column="send_ware_time"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="rcdCompanyId" column="rcd_company_id"/>
<association property="receipt"
javaType="com.mmc.oms.entity.OrderReceiptDO"
resultMap="orderReceiptResultMap"></association>
</resultMap>
<resultMap id="orderReceiptResultMap"
type="com.mmc.oms.entity.OrderReceiptDO">
<id property="id" column="id"/>
<result property="orderInfoId" column="order_info_id"/>
<result property="receiptMethod" column="receipt_method"/>
<result property="takeName" column="take_name"/>
<result property="takePhone" column="take_phone"/>
<result property="region" column="region"/>
<result property="detailAddress" column="detail_address"/>
<result property="repoName" column="repo_name"/>
<result property="repoAddress" column="repo_address"/>
<result property="bookPhone" column="book_phone"/>
<result property="sendExCode" column="send_ex_code"/>
<result property="sendExNo" column="send_ex_no"/>
<result property="sendAddress" column="send_address"/>
<result property="renMethod" column="ren_method"/>
<result property="renPhone" column="ren_phone"/>
<result property="renName" column="ren_name"/>
<result property="renExCode" column="ren_ex_code"/>
<result property="renExNo" column="ren_ex_no"/>
<result property="renAddress" column="ren_address"/>
<result property="renRepoName" column="ren_repo_name"/>
<result property="renRepoAddr" column="ren_repo_addr"/>
<result property="renRepoPhone" column="ren_repo_phone"/>
<result property="createTime" column="create_time"/>
<result property="exName" column="ex_name"/>
</resultMap>
<resultMap id="orderRefundResultMap"
type="com.mmc.oms.entity.OrderRefundDO">
<id property="id" column="id"/>
<result property="orderInfoId" column="order_info_id"/>
<result property="refundNo" column="refund_no"/>
<result property="refundStatus" column="refund_status"/>
<result property="shouldRefund" column="should_refund"/>
<result property="actualRefund" column="actual_refund"/>
<result property="reason" column="reason"/>
<result property="pfRemark" column="pf_remark"/>
<result property="createTime" column="create_time"/>
<association property="orderInfo"
javaType="com.mmc.oms.entity.OrderInfoDO"
resultMap="refundOrderResultMap"></association>
</resultMap>
<resultMap id="refundOrderResultMap"
type="com.mmc.oms.entity.OrderInfoDO">
<id property="id" column="order_info_id"/>
<result property="orderNo" column="order_no"/>
<result property="wareInfoId" column="ware_info_id"/>
<result property="wareNo" column="ware_no"/>
<result property="wareTitle" column="ware_title"/>
<result property="wareImg" column="ware_img"/>
<result property="skuInfoId" column="sku_info_id"/>
<result property="skuTitle" column="sku_title"/>
<result property="repoAccountId" column="repo_account_id"/>
<result property="uid" column="uid"/>
<result property="buyerName" column="buyer_name"/>
<result property="buyerPhone" column="buyer_phone"/>
<result property="unitPrice" column="unit_price"/>
<result property="wareNum" column="ware_num"/>
<result property="shouldPay" column="should_pay"/>
<result property="actualPay" column="actual_pay"/>
<result property="orderType" column="order_type"/>
<result property="deposit" column="deposit"/>
<result property="rentPrice" column="rent_price"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="tranStatus" column="tran_status"/>
<result property="exWare" column="ex_ware"/>
<result property="remark" column="remark"/>
<result property="pfRemark" column="pf_remark"/>
<result property="shutReason" column="shut_reason"/>
<result property="payNo" column="pay_no"/>
<result property="payTime" column="pay_time"/>
<result property="sendWareTime" column="send_ware_time"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="coupon" resultType="com.mmc.oms.entity.CouponUserDO">
select coupon_money AS couponMoney, `status`, end_time AS endTime
from coupon_user
</select>
<select id="getOrderDetail" resultMap="orderInfoResultMap">
select o.id,
o.order_no,
o.ware_img,
o.ware_title,
o.sku_title,
o.unit_price,
o.tran_status,
o.ware_num,
o.should_pay,
o.actual_pay,
o.start_date,
o.end_date,
o.deposit,
o.pf_remark,
o.shut_reason,
o.ex_ware,
o.pay_time,
o.send_ware_time,
o.create_time,
o.remark,
o.ware_info_id,
o.pay_day,
o.repo_account_id,
o.rcd_company_id
from order_info o
where o.order_no = #{orderNo}
</select>
<select id="getNewOrderRefund" resultMap="orderRefundResultMap">
select r.id,
r.order_info_id,
r.refund_status,
r.should_refund,
r.actual_refund,
r.reason
from order_refund r
where r.order_info_id = #{orderInfoId}
order by r.create_time desc limit 0,1
</select>
<select id="getOrderReceiptInfo" resultMap="orderReceiptResultMap">
select r.*
from order_receipt r
where r.order_info_id = #{orderInfoId}
</select>
<insert id="insertOrderInfo" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.oms.entity.OrderInfoDO">
insert into order_info
(order_no, ware_info_id, ware_no, ware_title, ware_img, sku_info_id, sku_title, repo_account_id,
uid, buyer_name, buyer_phone, unit_price, ware_num, should_pay, actual_pay, order_type,
deposit, rent_price, start_date, end_date, pay_day, tran_status, ex_ware, remark, pay_time,
send_ware_time, create_time, rcd_company_id, return_time, coupon_id, specs_id)
values (#{orderNo}, #{wareInfoId}, #{wareNo}, #{wareTitle}, #{wareImg}, #{skuInfoId}, #{skuTitle},
#{repoAccountId},
#{uid}, #{buyerName}, #{buyerPhone}, #{unitPrice}, #{wareNum}, #{shouldPay}, #{actualPay}, #{orderType},
#{deposit}, #{rentPrice}, #{startDate}, #{endDate}, #{payDay}, #{tranStatus}, #{exWare}, #{remark},
#{payTime},
#{sendWareTime}, now(), #{rcdCompanyId}, #{returnTime}, #{couponId}, #{specsId})
</insert>
<insert id="insertOrderReceipt" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.oms.entity.OrderReceiptDO">
insert into order_receipt
(order_info_id, receipt_method, take_name, take_phone, region, detail_address, repo_name,
repo_address, book_phone, create_time)
values (#{orderInfoId}, #{receiptMethod}, #{takeName}, #{takePhone}, #{region}, #{detailAddress}, #{repoName},
#{repoAddress}, #{bookPhone}, #{createTime})
</insert>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论