提交修改
This commit is contained in:
parent
8ab71b41b7
commit
439032e44d
@ -0,0 +1,36 @@
|
|||||||
|
package com.heyu.api.data.dao.vv;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 买家信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2025-08-23
|
||||||
|
*/
|
||||||
|
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@Mapper
|
||||||
|
public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
VvBuyerEntity selectVvBuyerById(@Param("id")Long id);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertVvBuyer(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertOrUpdateVvBuyer(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int updateVvBuyerById(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int updateCoverVvBuyerById(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int deleteVvBuyerById(@Param("id")Long id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.heyu.api.data.entity.vv.VvShoppingCartEntity;
|
import com.heyu.api.data.entity.vv.VvShoppingCartEntity;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.lz.mybatis.plugin.annotations.IF;
|
import com.lz.mybatis.plugin.annotations.IF;
|
||||||
|
import com.lz.mybatis.plugin.annotations.IN;
|
||||||
import com.lz.mybatis.plugin.annotations.LIKE;
|
import com.lz.mybatis.plugin.annotations.LIKE;
|
||||||
import com.lz.mybatis.plugin.annotations.OrderBy;
|
import com.lz.mybatis.plugin.annotations.OrderBy;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -47,4 +48,15 @@ public interface VvShoppingCartDao extends BaseMapper<VvShoppingCartEntity> {
|
|||||||
@IF @LIKE String buyerPhone,
|
@IF @LIKE String buyerPhone,
|
||||||
@IF @LIKE String buyerName,
|
@IF @LIKE String buyerName,
|
||||||
@IF @LIKE String buyerWeixin);
|
@IF @LIKE String buyerWeixin);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<VvShoppingCartEntity> selectAppByCondition(IPage page,
|
||||||
|
@IF String productName,
|
||||||
|
Long buyerId
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Integer deleteVvShoppingCartByIds(@IN List<Long> id);
|
||||||
}
|
}
|
||||||
@ -52,4 +52,15 @@ public interface VvTradeOrderDao extends BaseMapper<VvTradeOrderEntity> {
|
|||||||
@IF @GE Long minCreateTimestamp,
|
@IF @GE Long minCreateTimestamp,
|
||||||
@IF @LE Long maxCreateTimestamp,
|
@IF @LE Long maxCreateTimestamp,
|
||||||
@OrderBy(VvTradeOrderEntity.create_timestamp) String createTimestampSort);
|
@OrderBy(VvTradeOrderEntity.create_timestamp) String createTimestampSort);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OrderBy(VvTradeOrderEntity.id_)
|
||||||
|
List<VvTradeOrderEntity> selectAppByCondition(IPage page,
|
||||||
|
@IF@IN List<Long> orderIds,
|
||||||
|
@IF String status,
|
||||||
|
@IF @GE Long minCreateTimestamp,
|
||||||
|
@IF@LE Long maxCreateTimestamp,
|
||||||
|
@IF String createTimestampSort);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
package com.heyu.api.data.entity.vv;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.lz.mybatis.plugin.annotations.AS;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;import java.util.Date;
|
||||||
|
/**
|
||||||
|
*买家信息
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2025-08-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("vv_buyer")
|
||||||
|
public class VvBuyerEntity implements java.io.Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvBuyerEntity:";
|
||||||
|
|
||||||
|
public final static String all = CLASS_NAME + "*";
|
||||||
|
public final static String id_ = CLASS_NAME + "id"; //
|
||||||
|
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||||
|
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||||
|
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||||
|
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名称
|
||||||
|
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
|
||||||
|
public final static String buyer_phone = CLASS_NAME + "buyer_phone"; // 买家手机号
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
//是否删除:0 否 1 删除
|
||||||
|
private Integer isDelete;
|
||||||
|
//创建时间
|
||||||
|
private Date createTime;
|
||||||
|
//修改时间
|
||||||
|
private Date modifyTime;
|
||||||
|
//买家名称
|
||||||
|
private String buyerName;
|
||||||
|
//买家微信
|
||||||
|
private String buyerWeixin;
|
||||||
|
//买家手机号
|
||||||
|
private String buyerPhone;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除:0 否 1 删除
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 是否删除:0 否 1 删除
|
||||||
|
* @param isDelete
|
||||||
|
*/
|
||||||
|
public void setIsDelete(Integer isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
* @param createTime
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getModifyTime() {
|
||||||
|
return modifyTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
* @param modifyTime
|
||||||
|
*/
|
||||||
|
public void setModifyTime(Date modifyTime) {
|
||||||
|
this.modifyTime = modifyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getBuyerName() {
|
||||||
|
return buyerName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 买家名称
|
||||||
|
* @param buyerName
|
||||||
|
*/
|
||||||
|
public void setBuyerName(String buyerName) {
|
||||||
|
this.buyerName = buyerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家微信
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getBuyerWeixin() {
|
||||||
|
return buyerWeixin;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 买家微信
|
||||||
|
* @param buyerWeixin
|
||||||
|
*/
|
||||||
|
public void setBuyerWeixin(String buyerWeixin) {
|
||||||
|
this.buyerWeixin = buyerWeixin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家手机号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getBuyerPhone() {
|
||||||
|
return buyerPhone;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 买家手机号
|
||||||
|
* @param buyerPhone
|
||||||
|
*/
|
||||||
|
public void setBuyerPhone(String buyerPhone) {
|
||||||
|
this.buyerPhone = buyerPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VvBuyerEntity{" +
|
||||||
|
",id=" + id +
|
||||||
|
",isDelete=" + isDelete +
|
||||||
|
",createTime=" + createTime +
|
||||||
|
",modifyTime=" + modifyTime +
|
||||||
|
",buyerName=" + buyerName +
|
||||||
|
",buyerWeixin=" + buyerWeixin +
|
||||||
|
",buyerPhone=" + buyerPhone +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,6 +33,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名
|
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名
|
||||||
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
|
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
|
||||||
public final static String all_price = CLASS_NAME + "all_price"; // 总价
|
public final static String all_price = CLASS_NAME + "all_price"; // 总价
|
||||||
|
public final static String buyer_id = CLASS_NAME + "buyer_id"; // 买家id
|
||||||
//
|
//
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -58,6 +59,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
private String buyerWeixin;
|
private String buyerWeixin;
|
||||||
//总价
|
//总价
|
||||||
private BigDecimal allPrice;
|
private BigDecimal allPrice;
|
||||||
|
//买家id
|
||||||
|
private Long buyerId;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -238,6 +241,21 @@ private static final long serialVersionUID = 1L;
|
|||||||
this.allPrice = allPrice;
|
this.allPrice = allPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getBuyerId() {
|
||||||
|
return buyerId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 买家id
|
||||||
|
* @param buyerId
|
||||||
|
*/
|
||||||
|
public void setBuyerId(Long buyerId) {
|
||||||
|
this.buyerId = buyerId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VvShoppingCartEntity{" +
|
return "VvShoppingCartEntity{" +
|
||||||
@ -253,6 +271,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
",buyerName=" + buyerName +
|
",buyerName=" + buyerName +
|
||||||
",buyerWeixin=" + buyerWeixin +
|
",buyerWeixin=" + buyerWeixin +
|
||||||
",allPrice=" + allPrice +
|
",allPrice=" + allPrice +
|
||||||
|
",buyerId=" + buyerId +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
package com.heyu.api.data.service.impl.vv;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 买家信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2025-08-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.heyu.api.data.dao.vv.VvBuyerDao;
|
||||||
|
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||||
|
import com.heyu.api.data.service.vv.VvBuyerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
@Service
|
||||||
|
public class VvBuyerServiceImpl extends ServiceImpl<VvBuyerDao, VvBuyerEntity> implements VvBuyerService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvBuyerDao vvBuyerDao;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VvBuyerEntity selectVvBuyerById(Long id){
|
||||||
|
return vvBuyerDao.selectVvBuyerById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long insertVvBuyer(VvBuyerEntity vvBuyer){
|
||||||
|
return vvBuyerDao.insertVvBuyer(vvBuyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long insertOrUpdateVvBuyer(VvBuyerEntity vvBuyer){
|
||||||
|
return vvBuyerDao.insertOrUpdateVvBuyer(vvBuyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateVvBuyerById(VvBuyerEntity vvBuyer){
|
||||||
|
return vvBuyerDao.updateVvBuyerById(vvBuyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateCoverVvBuyerById(VvBuyerEntity vvBuyer){
|
||||||
|
return vvBuyerDao.updateCoverVvBuyerById(vvBuyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteVvBuyerById(Long id){
|
||||||
|
return vvBuyerDao.deleteVvBuyerById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.heyu.api.data.service.vv;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 买家信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2025-08-23
|
||||||
|
*/
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||||
|
public interface VvBuyerService extends IService<VvBuyerEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VvBuyerEntity selectVvBuyerById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertVvBuyer(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertOrUpdateVvBuyer(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int updateVvBuyerById(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int updateCoverVvBuyerById(VvBuyerEntity vvBuyer);
|
||||||
|
|
||||||
|
|
||||||
|
int deleteVvBuyerById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
6
api-mapper/src/main/resources/mapper/vv/VvBuyerDao.xml
Normal file
6
api-mapper/src/main/resources/mapper/vv/VvBuyerDao.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?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.heyu.api.data.dao.vv.VvBuyerDao">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
||||||
@ -94,11 +94,8 @@ public class MysqlMain_insert {
|
|||||||
|
|
||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||||
|
|
||||||
list.add(new TablesBean("vv_package"));
|
list.add(new TablesBean("vv_buyer"));
|
||||||
list.add(new TablesBean("vv_trade_order"));
|
|
||||||
list.add(new TablesBean("vv_buyer_address"));
|
|
||||||
list.add(new TablesBean("vv_shopping_cart"));
|
|
||||||
list.add(new TablesBean("vv_trade_order_line"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import lombok.Data;
|
|||||||
public class AppIndexPageRequest {
|
public class AppIndexPageRequest {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private int pageNum = 1;
|
private int pageNum = 1;
|
||||||
|
|
||||||
|
|
||||||
@ -20,7 +19,6 @@ public class AppIndexPageRequest {
|
|||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//一级类目id
|
//一级类目id
|
||||||
private Integer categoryIdOne;
|
private Integer categoryIdOne;
|
||||||
//二级类目
|
//二级类目
|
||||||
@ -31,7 +29,6 @@ public class AppIndexPageRequest {
|
|||||||
private Integer frontPage;
|
private Integer frontPage;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//销售价格
|
//销售价格
|
||||||
private String salePriceSort;
|
private String salePriceSort;
|
||||||
|
|
||||||
@ -43,4 +40,5 @@ public class AppIndexPageRequest {
|
|||||||
private String createTimestampSort;
|
private String createTimestampSort;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.heyu.api.alibaba.request.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppOrderRequest {
|
||||||
|
|
||||||
|
private int pageNum = 1;
|
||||||
|
|
||||||
|
|
||||||
|
private int pageSize = 10;
|
||||||
|
|
||||||
|
|
||||||
|
private Long buyerId;
|
||||||
|
|
||||||
|
private List<Long> orderIds;
|
||||||
|
|
||||||
|
//商品名称 , 子单维度
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
|
||||||
|
//创建时间撮,最大
|
||||||
|
private Long minCreateTimestamp;
|
||||||
|
//创建时间撮 最小
|
||||||
|
private Long maxCreateTimestamp;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按时间排序
|
||||||
|
*/
|
||||||
|
private String createTimestampSort;
|
||||||
|
|
||||||
|
|
||||||
|
//wait_pay:待支付,待发货:wait_shipping, 已经发货: shipping , 已接收,delivered, all_refund:全部退款,part_refund,部分退款
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.heyu.api.alibaba.request.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppShippingCartDeleteRequest {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private List<Long> shoppingCartIds;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.heyu.api.alibaba.request.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AppShippingCartRequest {
|
||||||
|
|
||||||
|
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
|
||||||
|
//商品标题
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 买家id
|
||||||
|
*/
|
||||||
|
private Long buyerId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -23,8 +23,8 @@ import java.util.List;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/app")
|
@RequestMapping("/app/index")
|
||||||
public class VVIndexPageController {
|
public class AppIndexPageController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VvProductDao vvProductDao;
|
private VvProductDao vvProductDao;
|
||||||
@ -48,12 +48,10 @@ public class VVIndexPageController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private VvProductPropertyValueDao vvProductPropertyValueDao;
|
private VvProductPropertyValueDao vvProductPropertyValueDao;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/index/page/list")
|
@RequestMapping("/page/list")
|
||||||
public R list(AppIndexPageRequest vvProductRequest) {
|
public R list(AppIndexPageRequest vvProductRequest) {
|
||||||
PPageUtils pageUtils = PPageUtils.startPage(vvProductRequest.getPageNum(), vvProductRequest.getPageSize())
|
PPageUtils pageUtils = PPageUtils.startPage(vvProductRequest.getPageNum(), vvProductRequest.getPageSize())
|
||||||
.doSelect(new ISelect() {
|
.doSelect(new ISelect() {
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
package com.heyu.api.controller.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.heyu.api.alibaba.request.mm.order.resp.PackageDTO;
|
||||||
|
import com.heyu.api.alibaba.request.mm.order.resp.VVOrderListResp;
|
||||||
|
import com.heyu.api.alibaba.request.vv.AppOrderRequest;
|
||||||
|
import com.heyu.api.data.dao.vv.VvPackageDao;
|
||||||
|
import com.heyu.api.data.dao.vv.VvTradeOrderDao;
|
||||||
|
import com.heyu.api.data.dao.vv.VvTradeOrderLineDao;
|
||||||
|
import com.heyu.api.data.entity.vv.VvPackageEntity;
|
||||||
|
import com.heyu.api.data.entity.vv.VvTradeOrderEntity;
|
||||||
|
import com.heyu.api.data.entity.vv.VvTradeOrderLineEntity;
|
||||||
|
import com.heyu.api.data.utils.R;
|
||||||
|
import com.heyu.api.data.utils.StringUtils;
|
||||||
|
import com.heyu.api.utils.ISelect;
|
||||||
|
import com.heyu.api.utils.PPageUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/order")
|
||||||
|
public class AppOrderController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvTradeOrderLineDao vvTradeOrderLineDao;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvTradeOrderDao vvTradeOrderDao;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvPackageDao vvPackageDao;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public R list(AppOrderRequest vvOrderRequest) {
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(vvOrderRequest.getProductName())) {
|
||||||
|
List<VvTradeOrderLineEntity> list = vvTradeOrderLineDao.selectVvTradeOrderLineByProductName(vvOrderRequest.getProductName());
|
||||||
|
List<Long> orderIds = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(vvOrderRequest.getOrderIds())) {
|
||||||
|
orderIds.addAll(vvOrderRequest.getOrderIds());
|
||||||
|
}
|
||||||
|
for (VvTradeOrderLineEntity tradeOrderLineEntity : list) {
|
||||||
|
orderIds.add(tradeOrderLineEntity.getTradeOrderId());
|
||||||
|
}
|
||||||
|
|
||||||
|
vvOrderRequest.setOrderIds(orderIds);
|
||||||
|
}
|
||||||
|
PPageUtils pageUtils = PPageUtils.startPage(vvOrderRequest.getPageNum(), vvOrderRequest.getPageSize())
|
||||||
|
.doSelect(new ISelect() {
|
||||||
|
@Override
|
||||||
|
public List doSelect(IPage page) {
|
||||||
|
return vvTradeOrderDao.selectAppByCondition(page,
|
||||||
|
vvOrderRequest.getOrderIds(),
|
||||||
|
vvOrderRequest.getStatus(),
|
||||||
|
vvOrderRequest.getMinCreateTimestamp(),
|
||||||
|
vvOrderRequest.getMaxCreateTimestamp(),
|
||||||
|
vvOrderRequest.getCreateTimestampSort()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
List<VvTradeOrderEntity> vvTradeOrderEntities = pageUtils.getRows();
|
||||||
|
|
||||||
|
List<Long> tradeOrderIds = new ArrayList<>();
|
||||||
|
|
||||||
|
for (VvTradeOrderEntity vvTradeOrderEntity : vvTradeOrderEntities) {
|
||||||
|
tradeOrderIds.add(vvTradeOrderEntity.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<VvTradeOrderLineEntity> list = vvTradeOrderLineDao.selectVvTradeOrderLineByTradeOrderIds(tradeOrderIds);
|
||||||
|
|
||||||
|
|
||||||
|
List<String> trackNumbers = new ArrayList<>();
|
||||||
|
for (VvTradeOrderLineEntity vvTradeOrderLineEntity : list) {
|
||||||
|
trackNumbers.add(vvTradeOrderLineEntity.getTrackNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, VvPackageEntity> vvPackageEntityMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(trackNumbers)) {
|
||||||
|
List<VvPackageEntity> packageEntities = vvPackageDao.selectVvPackageByTrackNumbers(trackNumbers);
|
||||||
|
for (VvPackageEntity packageEntity : packageEntities) {
|
||||||
|
vvPackageEntityMap.put(packageEntity.getTrackNumber(), packageEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<VVOrderListResp> vvOrderListResps = new ArrayList<>();
|
||||||
|
for (VvTradeOrderEntity vvTradeOrderEntity : vvTradeOrderEntities) {
|
||||||
|
VVOrderListResp vvOrderListResp = new VVOrderListResp();
|
||||||
|
BeanUtils.copyProperties(vvTradeOrderEntity, vvOrderListResp);
|
||||||
|
|
||||||
|
List<VvTradeOrderLineEntity> vvTradeOrderLineEntityList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (VvTradeOrderLineEntity tradeOrderLineEntity : list) {
|
||||||
|
if (vvTradeOrderEntity.getId().equals(tradeOrderLineEntity.getTradeOrderId())) {
|
||||||
|
vvTradeOrderLineEntityList.add(tradeOrderLineEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 订单行信息
|
||||||
|
*/
|
||||||
|
List<VvTradeOrderLineEntity> vvTradeOrderLineList = new ArrayList<>();
|
||||||
|
Map<String, PackageDTO> packageDTOMap = new HashMap();
|
||||||
|
|
||||||
|
for (VvTradeOrderLineEntity tradeOrderLineEntity : vvTradeOrderLineEntityList) {
|
||||||
|
if (StringUtils.isNotBlank(tradeOrderLineEntity.getTrackNumber())) {
|
||||||
|
PackageDTO packageDTO = packageDTOMap.get(tradeOrderLineEntity.getTrackNumber());
|
||||||
|
|
||||||
|
if (packageDTO == null) {
|
||||||
|
VvPackageEntity vvPackage = vvPackageEntityMap.get(tradeOrderLineEntity.getTrackNumber());
|
||||||
|
packageDTO = new PackageDTO();
|
||||||
|
BeanUtils.copyProperties(vvPackage, packageDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<VvTradeOrderLineEntity> vvTradeOrderLineEntitys = packageDTO.getVvTradeOrderLineEntityList();
|
||||||
|
if (vvTradeOrderLineEntitys == null) {
|
||||||
|
vvTradeOrderLineEntitys.add(tradeOrderLineEntity);
|
||||||
|
}
|
||||||
|
packageDTO.setVvTradeOrderLineEntityList(vvTradeOrderLineEntitys);
|
||||||
|
|
||||||
|
packageDTOMap.put(tradeOrderLineEntity.getTrackNumber(), packageDTO);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
vvTradeOrderLineList.add(tradeOrderLineEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PackageDTO> packageList = new ArrayList<>();
|
||||||
|
for (Map.Entry<String, PackageDTO> entry : packageDTOMap.entrySet()) {
|
||||||
|
packageList.add(entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
vvOrderListResp.setVvTradeOrderLineList(vvTradeOrderLineList);
|
||||||
|
vvOrderListResp.setPackageList(packageList);
|
||||||
|
|
||||||
|
vvOrderListResps.add(vvOrderListResp);
|
||||||
|
}
|
||||||
|
return R.ok().setData(vvOrderListResps);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.heyu.api.controller.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.heyu.api.alibaba.request.vv.AppShippingCartDeleteRequest;
|
||||||
|
import com.heyu.api.alibaba.request.vv.AppShippingCartRequest;
|
||||||
|
import com.heyu.api.data.dao.vv.VvBuyerDao;
|
||||||
|
import com.heyu.api.data.dao.vv.VvShoppingCartDao;
|
||||||
|
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||||
|
import com.heyu.api.data.entity.vv.VvShoppingCartEntity;
|
||||||
|
import com.heyu.api.data.utils.R;
|
||||||
|
import com.heyu.api.utils.ISelect;
|
||||||
|
import com.heyu.api.utils.PPageUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/shipping/cart")
|
||||||
|
public class AppShoppingCartController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvShoppingCartDao vvShoppingCartDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvBuyerDao vvBuyerDao;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public R list(AppShippingCartRequest appShippingCartRequest) {
|
||||||
|
PPageUtils pageUtils = PPageUtils.startPage(appShippingCartRequest.getPageNum(), appShippingCartRequest.getPageSize())
|
||||||
|
.doSelect(new ISelect() {
|
||||||
|
@Override
|
||||||
|
public List doSelect(IPage page) {
|
||||||
|
return vvShoppingCartDao.selectAppByCondition(page,
|
||||||
|
appShippingCartRequest.getProductName(),
|
||||||
|
appShippingCartRequest.getBuyerId()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return R.ok().setData(pageUtils);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 更新 或 添加 ,如数量更新
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addOrUpdate")
|
||||||
|
public R add(VvShoppingCartEntity vvShoppingCartEntity) {
|
||||||
|
VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvShoppingCartEntity.getBuyerId());
|
||||||
|
vvShoppingCartEntity.setBuyerName(vvBuyerEntity.getBuyerName());
|
||||||
|
vvShoppingCartEntity.setBuyerPhone(vvBuyerEntity.getBuyerPhone());
|
||||||
|
vvShoppingCartEntity.setBuyerWeixin(vvBuyerEntity.getBuyerWeixin());
|
||||||
|
vvShoppingCartDao.insertOrUpdateVvShoppingCart(vvShoppingCartEntity);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public R delete(AppShippingCartDeleteRequest appShippingCartDeleteRequest) {
|
||||||
|
vvShoppingCartDao.deleteVvShoppingCartByIds(appShippingCartDeleteRequest.getShoppingCartIds());
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user