提交修改

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

@ -7,13 +7,16 @@ package com.heyu.api.data.dao.vv;
* @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> {
@ -38,4 +41,10 @@ public interface VvBuyerAddressDao extends BaseMapper<VvBuyerAddressEntity> {
List<VvBuyerAddressEntity> selectAppByCondition(IPage page, Long buyerId); List<VvBuyerAddressEntity> selectAppByCondition(IPage page, Long buyerId);
@Bean2Map(key = VvBuyerAddressEntity.buyer_id)
Map<Long, List<VvBuyerAddressEntity>> selectMapByBuyerIds(List<Long> buyerIds);
} }

View File

@ -7,10 +7,16 @@ package com.heyu.api.data.dao.vv;
* @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> {
@ -33,4 +39,12 @@ public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
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

@ -28,6 +28,8 @@ 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 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

@ -66,9 +66,7 @@ public class AppIndexPageController {
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();
@ -121,6 +118,4 @@ public class AppIndexPageController {
} }
} }