diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerAddressDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerAddressDao.java index abcf02e..f3b508c 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerAddressDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerAddressDao.java @@ -1,41 +1,50 @@ package com.heyu.api.data.dao.vv; /** -*

-* 买家地址 服务类 -*

-* -* @author quyixiao -* @since 2025-08-23 -*/ + *

+ * 买家地址 服务类 + *

+ * + * @author quyixiao + * @since 2025-08-23 + */ + import com.baomidou.mybatisplus.core.metadata.IPage; import com.heyu.api.data.entity.vv.VvBuyerAddressEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.mybatis.plugins.interceptor.annotation.Bean2Map; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; @Mapper public interface VvBuyerAddressDao extends BaseMapper { - VvBuyerAddressEntity selectVvBuyerAddressById(@Param("id")Long id); + VvBuyerAddressEntity selectVvBuyerAddressById(@Param("id") Long id); - Long insertVvBuyerAddress(VvBuyerAddressEntity vvBuyerAddress); + Long insertVvBuyerAddress(VvBuyerAddressEntity vvBuyerAddress); - Long insertOrUpdateVvBuyerAddress(VvBuyerAddressEntity vvBuyerAddress); + Long insertOrUpdateVvBuyerAddress(VvBuyerAddressEntity vvBuyerAddress); - int updateVvBuyerAddressById(VvBuyerAddressEntity vvBuyerAddress); + int updateVvBuyerAddressById(VvBuyerAddressEntity vvBuyerAddress); - int updateCoverVvBuyerAddressById(VvBuyerAddressEntity vvBuyerAddress); + int updateCoverVvBuyerAddressById(VvBuyerAddressEntity vvBuyerAddress); - int deleteVvBuyerAddressById(@Param("id")Long id); + int deleteVvBuyerAddressById(@Param("id") Long id); + + + List selectAppByCondition(IPage page, Long buyerId); + + + @Bean2Map(key = VvBuyerAddressEntity.buyer_id) + Map> selectMapByBuyerIds(List buyerIds); - List selectAppByCondition(IPage page, Long buyerId); } \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerDao.java index cd38aba..67a34bf 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvBuyerDao.java @@ -1,36 +1,50 @@ package com.heyu.api.data.dao.vv; /** -*

-* 买家信息 服务类 -*

-* -* @author quyixiao -* @since 2025-08-23 -*/ + *

+ * 买家信息 服务类 + *

+ * + * @author quyixiao + * @since 2025-08-23 + */ + +import com.baomidou.mybatisplus.core.metadata.IPage; import com.heyu.api.data.entity.vv.VvBuyerEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.mybatis.plugin.annotations.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + +import java.util.List; + @Mapper public interface VvBuyerDao extends BaseMapper { - VvBuyerEntity selectVvBuyerById(@Param("id")Long id); + VvBuyerEntity selectVvBuyerById(@Param("id") Long id); - Long insertVvBuyer(VvBuyerEntity vvBuyer); + Long insertVvBuyer(VvBuyerEntity vvBuyer); - Long insertOrUpdateVvBuyer(VvBuyerEntity vvBuyer); + Long insertOrUpdateVvBuyer(VvBuyerEntity vvBuyer); - int updateVvBuyerById(VvBuyerEntity vvBuyer); + int updateVvBuyerById(VvBuyerEntity vvBuyer); - int updateCoverVvBuyerById(VvBuyerEntity vvBuyer); + int updateCoverVvBuyerById(VvBuyerEntity vvBuyer); - int deleteVvBuyerById(@Param("id")Long id); + int deleteVvBuyerById(@Param("id") Long id); + @OrderBy(VvBuyerEntity.id_) + List selectBuyerByCondition(IPage page, + @IF @LIKE String buyerName, + @IF @LIKE String buyerPhone, + @IF @LIKE String buyerWeixin, + @IF @GE Long minCreateTimestamp, + @IF @LE Long maxCreateTimestamp, + @IF String createTimestampSort); } \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvBuyerEntity.java b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvBuyerEntity.java index 0784c3b..d271bf7 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvBuyerEntity.java +++ b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvBuyerEntity.java @@ -21,13 +21,15 @@ 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"; // 买家手机号 + 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"; // 买家手机号 + public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 买家创建时间 + public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 买家修改时间 // @TableId(value = "id", type = IdType.AUTO) private Long id; @@ -43,6 +45,10 @@ private static final long serialVersionUID = 1L; private String buyerWeixin; //买家手机号 private String buyerPhone; + //买家创建时间 + private Long createTimestamp; + //买家修改时间 + private Long modifyTimestamp; /** * * @return @@ -148,6 +154,36 @@ private static final long serialVersionUID = 1L; this.buyerPhone = buyerPhone; } + /** + * 买家创建时间 + * @return + */ + public Long getCreateTimestamp() { + return createTimestamp; + } + /** + * 买家创建时间 + * @param createTimestamp + */ + public void setCreateTimestamp(Long createTimestamp) { + this.createTimestamp = createTimestamp; + } + + /** + * 买家修改时间 + * @return + */ + public Long getModifyTimestamp() { + return modifyTimestamp; + } + /** + * 买家修改时间 + * @param modifyTimestamp + */ + public void setModifyTimestamp(Long modifyTimestamp) { + this.modifyTimestamp = modifyTimestamp; + } + @Override public String toString() { return "VvBuyerEntity{" + @@ -158,6 +194,8 @@ private static final long serialVersionUID = 1L; ",buyerName=" + buyerName + ",buyerWeixin=" + buyerWeixin + ",buyerPhone=" + buyerPhone + + ",createTimestamp=" + createTimestamp + + ",modifyTimestamp=" + modifyTimestamp + "}"; } } \ No newline at end of file diff --git a/api-mapper/src/test/java/com/test/xxx/MysqlMain_update.java b/api-mapper/src/test/java/com/test/xxx/MysqlMain_update.java index 156f1d6..4b23bde 100644 --- a/api-mapper/src/test/java/com/test/xxx/MysqlMain_update.java +++ b/api-mapper/src/test/java/com/test/xxx/MysqlMain_update.java @@ -49,7 +49,7 @@ public class MysqlMain_update { List list = new ArrayList(); - String a = "vv_buyer_address"; + String a = "vv_buyer"; for (String s : a.split(",")) { list.add(new TablesBean(s)); } diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvBuyerRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvBuyerRequest.java new file mode 100644 index 0000000..2aeeff3 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvBuyerRequest.java @@ -0,0 +1,38 @@ +package com.heyu.api.alibaba.request.mm; + + +import lombok.Data; + +@Data +public class VvBuyerRequest { + + private Integer pageNum; + + + private Integer pageSize; + + + //创建时间撮 + private Long minCreateTimestamp; + private Long maxCreateTimestamp; + + + //买家名称 + private String buyerName; + //买家微信 + private String buyerWeixin; + //买家手机号 + private String buyerPhone; + + + + /*** + * 按创建时间排序,,传ASC 或 DESC + */ + private String createTimestampSort; + + + + + +} diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/order/VvBuyerDTO.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/order/VvBuyerDTO.java new file mode 100644 index 0000000..54fc242 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/order/VvBuyerDTO.java @@ -0,0 +1,15 @@ +package com.heyu.api.alibaba.request.mm.order; + +import com.heyu.api.data.entity.vv.VvBuyerAddressEntity; +import com.heyu.api.data.entity.vv.VvBuyerEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class VvBuyerDTO extends VvBuyerEntity { + + + private List vvBuyerAddressEntityList; + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/BuyerController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/BuyerController.java new file mode 100644 index 0000000..861495d --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/BuyerController.java @@ -0,0 +1,80 @@ +package com.heyu.api.controller.mm; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.heyu.api.alibaba.request.mm.VvBuyerRequest; +import com.heyu.api.alibaba.request.mm.order.VvBuyerDTO; +import com.heyu.api.data.dao.vv.VvBuyerAddressDao; +import com.heyu.api.data.dao.vv.VvBuyerDao; +import com.heyu.api.data.entity.vv.VvBuyerAddressEntity; +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.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.List; +import java.util.Map; + +@Slf4j +@RestController +@RequestMapping("/mm/buyer") +public class BuyerController { + + + @Autowired + private VvBuyerDao vvBuyerDao; + + @Autowired + private VvBuyerAddressDao vvBuyerAddressDao; + + /*** + * 列表 + */ + @RequestMapping("/list") + public R list(VvBuyerRequest vvProductRequest) { + + PPageUtils pageUtils = PPageUtils.startPage(vvProductRequest.getPageNum(), vvProductRequest.getPageSize()) + .doSelect(new ISelect() { + @Override + public List doSelect(IPage page) { + return vvBuyerDao.selectBuyerByCondition(page, + vvProductRequest.getBuyerName(), + vvProductRequest.getBuyerPhone(), + vvProductRequest.getBuyerWeixin(), + vvProductRequest.getMinCreateTimestamp(), + vvProductRequest.getMaxCreateTimestamp(), + vvProductRequest.getCreateTimestampSort() + ); + } + }); + List vvBuyerAddressEntities = pageUtils.getRows(); + + List buyerIds = new ArrayList<>(); + + for (VvBuyerAddressEntity vvBuyerAddressEntity : vvBuyerAddressEntities) { + buyerIds.add(vvBuyerAddressEntity.getBuyerId()); + } + + + Map> listMap = vvBuyerAddressDao.selectMapByBuyerIds(buyerIds); + + List buyerDTOs = new ArrayList<>(); + + for (VvBuyerAddressEntity vvBuyerAddressEntity : vvBuyerAddressEntities) { + VvBuyerDTO vvBuyerDTO = new VvBuyerDTO(); + BeanUtils.copyProperties(vvBuyerAddressEntity, vvBuyerDTO); + vvBuyerDTO.setVvBuyerAddressEntityList(listMap.get(vvBuyerAddressEntity.getBuyerId())); + + + buyerDTOs.add(vvBuyerDTO); + } + pageUtils.setRows(buyerDTOs); + return R.ok().setData(pageUtils); + + } +} \ No newline at end of file diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/UploadOssController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/UploadOssController.java index 799ec01..9d253ea 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/UploadOssController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/UploadOssController.java @@ -32,6 +32,4 @@ public class UploadOssController { } - - } diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppBuyerAddressManagerController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppBuyerAddressManagerController.java index 5edfeab..ecd089b 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppBuyerAddressManagerController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppBuyerAddressManagerController.java @@ -54,8 +54,6 @@ public class AppBuyerAddressManagerController { @RequestMapping("/update") public R list(VvBuyerAddressEntity vvBuyerAddressEntity) { - - VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId()); vvBuyerAddressEntity.setBuyerName(vvBuyerEntity.getBuyerName()); diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppIndexPageController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppIndexPageController.java index d13b1af..40361e0 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppIndexPageController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppIndexPageController.java @@ -43,7 +43,7 @@ public class AppIndexPageController { @Autowired - private VvSkuPropertyValueDao vvSkuPropertyValueDao; + private VvSkuPropertyValueDao vvSkuPropertyValueDao; @Autowired private VvProductPropertyValueDao vvProductPropertyValueDao; @@ -59,16 +59,14 @@ public class AppIndexPageController { public List doSelect(IPage page) { return vvProductDao.selectIndexVvProduct(page, vvProductRequest.getProductName(), - vvProductRequest.getFrontPage() , + vvProductRequest.getFrontPage(), vvProductRequest.getCategoryIdOne(), vvProductRequest.getCategoryIdTwo(), vvProductRequest.getCategoryIdThree(), vvProductRequest.getSalePriceSort(), vvProductRequest.getSaleCountSort(), vvProductRequest.getCreateTimestampSort() - ); - } }); @@ -76,7 +74,6 @@ public class AppIndexPageController { } - @RequestMapping("/product/detail") public R detail(VvProductDetailRequest vvProductDetailRequest) { VvProductDTO vvProductDTO = new VvProductDTO(); @@ -89,11 +86,11 @@ public class AppIndexPageController { vvProductDTO.setVvProductDetailList(productDetailEntities); List vvSkuEntities = vvSkuDao.selectVvSkuByProductId(vvProductDetailRequest.getProductId()); - List vvSkuDTOS = new ArrayList<>(); + List vvSkuDTOS = new ArrayList<>(); for (VvSkuEntity vvSkuEntity : vvSkuEntities) { VvSkuDTO vvSkuDTO = new VvSkuDTO(); BeanUtils.copyProperties(vvSkuEntity, vvSkuDTO); - List vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId()); + List vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId()); vvSkuDTO.setVvSkuPropertyValueList(vvSkuPropertyValueEntities); vvSkuDTOS.add(vvSkuDTO); } @@ -102,7 +99,7 @@ public class AppIndexPageController { List vvProductPropertyEntities = vvProductPropertyDao.selectVvProductPropertyByProductId(vvProductDetailRequest.getProductId()); - List vvProductPropertyDTOS = new ArrayList<>(); + List vvProductPropertyDTOS = new ArrayList<>(); for (VvProductPropertyEntity vvProductPropertyEntity : vvProductPropertyEntities) { @@ -110,7 +107,7 @@ public class AppIndexPageController { BeanUtils.copyProperties(vvProductPropertyEntity, vvProductPropertyDTO); - List productPropertyValues = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdPropertyId(vvProductDetailRequest.getProductId(),vvProductPropertyEntity.getId()); + List productPropertyValues = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdPropertyId(vvProductDetailRequest.getProductId(), vvProductPropertyEntity.getId()); vvProductPropertyDTO.setVvProductPropertyValueList(productPropertyValues); @@ -121,6 +118,4 @@ public class AppIndexPageController { } - - }