提交修改

This commit is contained in:
quyixiao 2025-08-23 15:12:30 +08:00
parent 2cc9d6707e
commit 21f3c45111
10 changed files with 235 additions and 50 deletions

View File

@ -1,41 +1,50 @@
package com.heyu.api.data.dao.vv; package com.heyu.api.data.dao.vv;
/** /**
* <p> * <p>
* 买家地址 服务类 * 买家地址 服务类
* </p> * </p>
* *
* @author quyixiao * @author quyixiao
* @since 2025-08-23 * @since 2025-08-23
*/ */
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity; import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface VvBuyerAddressDao extends BaseMapper<VvBuyerAddressEntity> { public interface VvBuyerAddressDao extends BaseMapper<VvBuyerAddressEntity> {
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<VvBuyerAddressEntity> selectAppByCondition(IPage page, Long buyerId);
@Bean2Map(key = VvBuyerAddressEntity.buyer_id)
Map<Long, List<VvBuyerAddressEntity>> selectMapByBuyerIds(List<Long> buyerIds);
List<VvBuyerAddressEntity> selectAppByCondition(IPage page, Long buyerId);
} }

View File

@ -1,36 +1,50 @@
package com.heyu.api.data.dao.vv; package com.heyu.api.data.dao.vv;
/** /**
* <p> * <p>
* 买家信息 服务类 * 买家信息 服务类
* </p> * </p>
* *
* @author quyixiao * @author quyixiao
* @since 2025-08-23 * @since 2025-08-23
*/ */
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvBuyerEntity; import com.heyu.api.data.entity.vv.VvBuyerEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> { public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
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<VvBuyerEntity> 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);
} }

View File

@ -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 CLASS_NAME ="com.heyu.api.data.entity.vv.VvBuyerEntity:";
public final static String all = CLASS_NAME + "*"; public final static String all = CLASS_NAME + "*";
public final static String id_ = CLASS_NAME + "id"; // public final static String id_ = CLASS_NAME + "id"; //
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除0 1 删除 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 create_time = CLASS_NAME + "create_time"; // 创建时间
public final static String modify_time = CLASS_NAME + "modify_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_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 buyer_phone = CLASS_NAME + "buyer_phone"; // 买家手机号 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) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@ -43,6 +45,10 @@ private static final long serialVersionUID = 1L;
private String buyerWeixin; private String buyerWeixin;
//买家手机号 //买家手机号
private String buyerPhone; private String buyerPhone;
//买家创建时间
private Long createTimestamp;
//买家修改时间
private Long modifyTimestamp;
/** /**
* *
* @return * @return
@ -148,6 +154,36 @@ private static final long serialVersionUID = 1L;
this.buyerPhone = buyerPhone; 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 @Override
public String toString() { public String toString() {
return "VvBuyerEntity{" + return "VvBuyerEntity{" +
@ -158,6 +194,8 @@ private static final long serialVersionUID = 1L;
",buyerName=" + buyerName + ",buyerName=" + buyerName +
",buyerWeixin=" + buyerWeixin + ",buyerWeixin=" + buyerWeixin +
",buyerPhone=" + buyerPhone + ",buyerPhone=" + buyerPhone +
",createTimestamp=" + createTimestamp +
",modifyTimestamp=" + modifyTimestamp +
"}"; "}";
} }
} }

View File

@ -49,7 +49,7 @@ public class MysqlMain_update {
List<TablesBean> list = new ArrayList<TablesBean>(); List<TablesBean> list = new ArrayList<TablesBean>();
String a = "vv_buyer_address"; String a = "vv_buyer";
for (String s : a.split(",")) { for (String s : a.split(",")) {
list.add(new TablesBean(s)); list.add(new TablesBean(s));
} }

View File

@ -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;
}

View File

@ -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<VvBuyerAddressEntity> vvBuyerAddressEntityList;
}

View File

@ -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<VvBuyerAddressEntity> vvBuyerAddressEntities = pageUtils.getRows();
List<Long> buyerIds = new ArrayList<>();
for (VvBuyerAddressEntity vvBuyerAddressEntity : vvBuyerAddressEntities) {
buyerIds.add(vvBuyerAddressEntity.getBuyerId());
}
Map<Long, List<VvBuyerAddressEntity>> listMap = vvBuyerAddressDao.selectMapByBuyerIds(buyerIds);
List<VvBuyerDTO> 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);
}
}

View File

@ -32,6 +32,4 @@ public class UploadOssController {
} }
} }

View File

@ -54,8 +54,6 @@ public class AppBuyerAddressManagerController {
@RequestMapping("/update") @RequestMapping("/update")
public R list(VvBuyerAddressEntity vvBuyerAddressEntity) { public R list(VvBuyerAddressEntity vvBuyerAddressEntity) {
VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId()); VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId());
vvBuyerAddressEntity.setBuyerName(vvBuyerEntity.getBuyerName()); vvBuyerAddressEntity.setBuyerName(vvBuyerEntity.getBuyerName());

View File

@ -43,7 +43,7 @@ public class AppIndexPageController {
@Autowired @Autowired
private VvSkuPropertyValueDao vvSkuPropertyValueDao; private VvSkuPropertyValueDao vvSkuPropertyValueDao;
@Autowired @Autowired
private VvProductPropertyValueDao vvProductPropertyValueDao; private VvProductPropertyValueDao vvProductPropertyValueDao;
@ -59,16 +59,14 @@ public class AppIndexPageController {
public List doSelect(IPage page) { public List doSelect(IPage page) {
return vvProductDao.selectIndexVvProduct(page, return vvProductDao.selectIndexVvProduct(page,
vvProductRequest.getProductName(), vvProductRequest.getProductName(),
vvProductRequest.getFrontPage() , vvProductRequest.getFrontPage(),
vvProductRequest.getCategoryIdOne(), vvProductRequest.getCategoryIdOne(),
vvProductRequest.getCategoryIdTwo(), vvProductRequest.getCategoryIdTwo(),
vvProductRequest.getCategoryIdThree(), vvProductRequest.getCategoryIdThree(),
vvProductRequest.getSalePriceSort(), vvProductRequest.getSalePriceSort(),
vvProductRequest.getSaleCountSort(), vvProductRequest.getSaleCountSort(),
vvProductRequest.getCreateTimestampSort() vvProductRequest.getCreateTimestampSort()
); );
} }
}); });
@ -76,7 +74,6 @@ public class AppIndexPageController {
} }
@RequestMapping("/product/detail") @RequestMapping("/product/detail")
public R detail(VvProductDetailRequest vvProductDetailRequest) { public R detail(VvProductDetailRequest vvProductDetailRequest) {
VvProductDTO vvProductDTO = new VvProductDTO(); VvProductDTO vvProductDTO = new VvProductDTO();
@ -89,11 +86,11 @@ public class AppIndexPageController {
vvProductDTO.setVvProductDetailList(productDetailEntities); vvProductDTO.setVvProductDetailList(productDetailEntities);
List<VvSkuEntity> vvSkuEntities = vvSkuDao.selectVvSkuByProductId(vvProductDetailRequest.getProductId()); List<VvSkuEntity> vvSkuEntities = vvSkuDao.selectVvSkuByProductId(vvProductDetailRequest.getProductId());
List<VvSkuDTO> vvSkuDTOS = new ArrayList<>(); List<VvSkuDTO> vvSkuDTOS = new ArrayList<>();
for (VvSkuEntity vvSkuEntity : vvSkuEntities) { for (VvSkuEntity vvSkuEntity : vvSkuEntities) {
VvSkuDTO vvSkuDTO = new VvSkuDTO(); VvSkuDTO vvSkuDTO = new VvSkuDTO();
BeanUtils.copyProperties(vvSkuEntity, vvSkuDTO); BeanUtils.copyProperties(vvSkuEntity, vvSkuDTO);
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId()); List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId());
vvSkuDTO.setVvSkuPropertyValueList(vvSkuPropertyValueEntities); vvSkuDTO.setVvSkuPropertyValueList(vvSkuPropertyValueEntities);
vvSkuDTOS.add(vvSkuDTO); vvSkuDTOS.add(vvSkuDTO);
} }
@ -102,7 +99,7 @@ public class AppIndexPageController {
List<VvProductPropertyEntity> vvProductPropertyEntities = vvProductPropertyDao.selectVvProductPropertyByProductId(vvProductDetailRequest.getProductId()); List<VvProductPropertyEntity> vvProductPropertyEntities = vvProductPropertyDao.selectVvProductPropertyByProductId(vvProductDetailRequest.getProductId());
List<VvProductPropertyDTO> vvProductPropertyDTOS = new ArrayList<>(); List<VvProductPropertyDTO> vvProductPropertyDTOS = new ArrayList<>();
for (VvProductPropertyEntity vvProductPropertyEntity : vvProductPropertyEntities) { for (VvProductPropertyEntity vvProductPropertyEntity : vvProductPropertyEntities) {
@ -110,7 +107,7 @@ public class AppIndexPageController {
BeanUtils.copyProperties(vvProductPropertyEntity, vvProductPropertyDTO); BeanUtils.copyProperties(vvProductPropertyEntity, vvProductPropertyDTO);
List<VvProductPropertyValueEntity> productPropertyValues = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdPropertyId(vvProductDetailRequest.getProductId(),vvProductPropertyEntity.getId()); List<VvProductPropertyValueEntity> productPropertyValues = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdPropertyId(vvProductDetailRequest.getProductId(), vvProductPropertyEntity.getId());
vvProductPropertyDTO.setVvProductPropertyValueList(productPropertyValues); vvProductPropertyDTO.setVvProductPropertyValueList(productPropertyValues);
@ -121,6 +118,4 @@ public class AppIndexPageController {
} }
} }