提交修改
This commit is contained in:
parent
ad2b5d4c5d
commit
6442c25a08
@ -11,6 +11,8 @@ package com.heyu.api.data.dao.vv;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
|
||||
import com.lz.mybatis.plugin.annotations.By;
|
||||
import com.lz.mybatis.plugin.annotations.Column;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -42,9 +44,10 @@ public interface VvBuyerAddressDao extends BaseMapper<VvBuyerAddressEntity> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
List<VvBuyerAddressEntity> selectMapByBuyerIds(List<Long> buyerId);
|
||||
|
||||
|
||||
int updateVvBuyerAddressStatusById(@Column(VvBuyerAddressEntity.status_) String status,
|
||||
@By @Column(VvBuyerAddressEntity.status_) String status1,
|
||||
@By@Column(VvBuyerAddressEntity.buyer_id) Long buyerId);
|
||||
}
|
||||
@ -69,9 +69,10 @@ public interface VvProductDao extends BaseMapper<VvProductEntity> {
|
||||
List<VvProductEntity> selectIndexVvProduct(IPage page,
|
||||
@IF @LIKE String title,
|
||||
@IF Integer frontPage,
|
||||
@IF Integer categoryIdOne,
|
||||
@IF Integer categoryIdTwo,
|
||||
@IF Integer categoryIdThree,
|
||||
@IF String status,
|
||||
@IF Integer appCategoryId1,
|
||||
@IF Integer appCategoryId2,
|
||||
@IF Integer appCategoryId3,
|
||||
@IF @OrderBy(VvProductEntity.show_sale_price) String salePriceSort,
|
||||
@IF @OrderBy(VvProductEntity.show_sale_count) String saleCountSort,
|
||||
@IF @OrderBy(VvProductEntity.create_timestamp) String createTimestampSort);
|
||||
|
||||
@ -10,6 +10,7 @@ package com.heyu.api.data.dao.vv;
|
||||
import com.heyu.api.data.entity.vv.VvProductPropertyEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.mybatis.plugin.annotations.OrderBy;
|
||||
import com.lz.mybatis.plugin.annotations.OrderType;
|
||||
import com.lz.mybatis.plugin.annotations.Realy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -38,7 +39,7 @@ public interface VvProductPropertyDao extends BaseMapper<VvProductPropertyEntity
|
||||
int deleteVvProductPropertyById(@Param("id")Long id);
|
||||
|
||||
|
||||
@OrderBy(VvProductPropertyEntity.defalut_sort)
|
||||
@OrderBy(value={VvProductPropertyEntity.defalut_sort}, type={OrderType.ASC})
|
||||
List<VvProductPropertyEntity> selectVvProductPropertyByProductId(Long productId);
|
||||
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ package com.heyu.api.data.dao.vv;
|
||||
import com.heyu.api.data.entity.vv.VvProductPropertyValueEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.mybatis.plugin.annotations.OrderBy;
|
||||
import com.lz.mybatis.plugin.annotations.OrderType;
|
||||
import com.lz.mybatis.plugin.annotations.Realy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -39,7 +40,7 @@ public interface VvProductPropertyValueDao extends BaseMapper<VvProductPropertyV
|
||||
int deleteVvProductPropertyValueById(@Param("id") Long id);
|
||||
|
||||
|
||||
@OrderBy(VvProductPropertyValueEntity.defalut_sort)
|
||||
@OrderBy(value={VvProductPropertyValueEntity.defalut_sort},type={OrderType.ASC})
|
||||
List<VvProductPropertyValueEntity> selectVvProductPropertyValueByProductIdPropertyId(Long productPropertyId);
|
||||
|
||||
|
||||
@ -48,4 +49,7 @@ public interface VvProductPropertyValueDao extends BaseMapper<VvProductPropertyV
|
||||
|
||||
@Realy
|
||||
int deleteVvProductPropertyValueRealByProductPropertyId(Long productPropertyId);
|
||||
|
||||
@OrderBy(value={VvProductPropertyValueEntity.defalut_sort},type={OrderType.ASC})
|
||||
List<VvProductPropertyValueEntity> selectVvProductPropertyValueByProductIdProductId(Long productId);
|
||||
}
|
||||
@ -42,9 +42,12 @@ public interface VvSkuPropertyValueDao extends BaseMapper<VvSkuPropertyValueEnti
|
||||
|
||||
|
||||
|
||||
List<VvSkuPropertyValueEntity> selectVvSkuPropertyValueByProductId(Long productId);
|
||||
|
||||
@Realy
|
||||
int deleteVvSkuPropertyValueRealBySkuId(Long skuId);
|
||||
|
||||
@Realy
|
||||
int deleteVvSkuPropertyValueRealById(Long id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import java.util.Date;import java.util.Date;
|
||||
/**
|
||||
*商品表
|
||||
* @author quyixiao
|
||||
* @since 2025-08-23
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -21,24 +21,29 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvProductEntity:";
|
||||
|
||||
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 main_image_url = CLASS_NAME + "main_image_url"; // 主图
|
||||
public final static String video_url = CLASS_NAME + "video_url"; // 视频url
|
||||
public final static String title_ = CLASS_NAME + "title"; // 商品标题
|
||||
public final static String show_sale_price = CLASS_NAME + "show_sale_price"; // 销售价格
|
||||
public final static String show_sale_count = CLASS_NAME + "show_sale_count"; // 销售数量
|
||||
public final static String default_sort = CLASS_NAME + "default_sort"; // 默认排序
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间撮
|
||||
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间撮
|
||||
public final static String category_id_one = CLASS_NAME + "category_id_one"; // 一级类目id
|
||||
public final static String category_id_two = CLASS_NAME + "category_id_two"; // 二级类目
|
||||
public final static String category_id_three = CLASS_NAME + "category_id_three"; // 三级类目
|
||||
public final static String front_page = CLASS_NAME + "front_page"; // 是否是首页
|
||||
public final static String status_ = CLASS_NAME + "status"; // delete 删除,down 下架,online 在线,draft 草稿
|
||||
public final static String real_sale_count = CLASS_NAME + "real_sale_count"; // 真实销售量
|
||||
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 main_image_url = CLASS_NAME + "main_image_url"; // 主图
|
||||
public final static String video_url = CLASS_NAME + "video_url"; // 视频url
|
||||
public final static String title_ = CLASS_NAME + "title"; // 商品标题
|
||||
public final static String show_sale_price = CLASS_NAME + "show_sale_price"; // 销售价格
|
||||
public final static String show_sale_count = CLASS_NAME + "show_sale_count"; // 销售数量
|
||||
public final static String default_sort = CLASS_NAME + "default_sort"; // 默认排序
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间撮
|
||||
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间撮
|
||||
public final static String front_page = CLASS_NAME + "front_page"; // 是否是首页
|
||||
public final static String status_ = CLASS_NAME + "status"; // delete 删除,down 下架,online 在线,draft 草稿
|
||||
public final static String real_sale_count = CLASS_NAME + "real_sale_count"; // 真实销售量
|
||||
public final static String app_category_id1 = CLASS_NAME + "app_category_id1"; // app一级类目id
|
||||
public final static String app_category_id2 = CLASS_NAME + "app_category_id2"; // app二级类目
|
||||
public final static String app_category_id3 = CLASS_NAME + "app_category_id3"; // app三级类目
|
||||
public final static String admin_category_id1 = CLASS_NAME + "admin_category_id1"; // admin1级类目
|
||||
public final static String admin_category_id2 = CLASS_NAME + "admin_category_id2"; // admin2级类目
|
||||
public final static String admin_category_id3 = CLASS_NAME + "admin_category_id3"; // admin3级类目
|
||||
public final static String admin_category_id4 = CLASS_NAME + "admin_category_id4"; // admin4级类目
|
||||
public final static String admin_category_id5 = CLASS_NAME + "admin_category_id5"; // admin5级类目
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@ -64,18 +69,28 @@ private static final long serialVersionUID = 1L;
|
||||
private Long createTimestamp;
|
||||
//修改时间撮
|
||||
private Long modifyTimestamp;
|
||||
//一级类目id
|
||||
private Integer categoryIdOne;
|
||||
//二级类目
|
||||
private Integer categoryIdTwo;
|
||||
//三级类目
|
||||
private Integer categoryIdThree;
|
||||
//是否是首页
|
||||
private Integer frontPage;
|
||||
//delete 删除,down 下架,online 在线,draft 草稿
|
||||
private String status;
|
||||
//真实销售量
|
||||
private Integer realSaleCount;
|
||||
//app一级类目id
|
||||
private Integer appCategoryId1;
|
||||
//app二级类目
|
||||
private Integer appCategoryId2;
|
||||
//app三级类目
|
||||
private Integer appCategoryId3;
|
||||
//admin1级类目
|
||||
private String adminCategoryId1;
|
||||
//admin2级类目
|
||||
private String adminCategoryId2;
|
||||
//admin3级类目
|
||||
private String adminCategoryId3;
|
||||
//admin4级类目
|
||||
private String adminCategoryId4;
|
||||
//admin5级类目
|
||||
private String adminCategoryId5;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -256,51 +271,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.modifyTimestamp = modifyTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 一级类目id
|
||||
* @return
|
||||
*/
|
||||
public Integer getCategoryIdOne() {
|
||||
return categoryIdOne;
|
||||
}
|
||||
/**
|
||||
* 一级类目id
|
||||
* @param categoryIdOne
|
||||
*/
|
||||
public void setCategoryIdOne(Integer categoryIdOne) {
|
||||
this.categoryIdOne = categoryIdOne;
|
||||
}
|
||||
|
||||
/**
|
||||
* 二级类目
|
||||
* @return
|
||||
*/
|
||||
public Integer getCategoryIdTwo() {
|
||||
return categoryIdTwo;
|
||||
}
|
||||
/**
|
||||
* 二级类目
|
||||
* @param categoryIdTwo
|
||||
*/
|
||||
public void setCategoryIdTwo(Integer categoryIdTwo) {
|
||||
this.categoryIdTwo = categoryIdTwo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 三级类目
|
||||
* @return
|
||||
*/
|
||||
public Integer getCategoryIdThree() {
|
||||
return categoryIdThree;
|
||||
}
|
||||
/**
|
||||
* 三级类目
|
||||
* @param categoryIdThree
|
||||
*/
|
||||
public void setCategoryIdThree(Integer categoryIdThree) {
|
||||
this.categoryIdThree = categoryIdThree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是首页
|
||||
* @return
|
||||
@ -346,6 +316,126 @@ private static final long serialVersionUID = 1L;
|
||||
this.realSaleCount = realSaleCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* app一级类目id
|
||||
* @return
|
||||
*/
|
||||
public Integer getAppCategoryId1() {
|
||||
return appCategoryId1;
|
||||
}
|
||||
/**
|
||||
* app一级类目id
|
||||
* @param appCategoryId1
|
||||
*/
|
||||
public void setAppCategoryId1(Integer appCategoryId1) {
|
||||
this.appCategoryId1 = appCategoryId1;
|
||||
}
|
||||
|
||||
/**
|
||||
* app二级类目
|
||||
* @return
|
||||
*/
|
||||
public Integer getAppCategoryId2() {
|
||||
return appCategoryId2;
|
||||
}
|
||||
/**
|
||||
* app二级类目
|
||||
* @param appCategoryId2
|
||||
*/
|
||||
public void setAppCategoryId2(Integer appCategoryId2) {
|
||||
this.appCategoryId2 = appCategoryId2;
|
||||
}
|
||||
|
||||
/**
|
||||
* app三级类目
|
||||
* @return
|
||||
*/
|
||||
public Integer getAppCategoryId3() {
|
||||
return appCategoryId3;
|
||||
}
|
||||
/**
|
||||
* app三级类目
|
||||
* @param appCategoryId3
|
||||
*/
|
||||
public void setAppCategoryId3(Integer appCategoryId3) {
|
||||
this.appCategoryId3 = appCategoryId3;
|
||||
}
|
||||
|
||||
/**
|
||||
* admin1级类目
|
||||
* @return
|
||||
*/
|
||||
public String getAdminCategoryId1() {
|
||||
return adminCategoryId1;
|
||||
}
|
||||
/**
|
||||
* admin1级类目
|
||||
* @param adminCategoryId1
|
||||
*/
|
||||
public void setAdminCategoryId1(String adminCategoryId1) {
|
||||
this.adminCategoryId1 = adminCategoryId1;
|
||||
}
|
||||
|
||||
/**
|
||||
* admin2级类目
|
||||
* @return
|
||||
*/
|
||||
public String getAdminCategoryId2() {
|
||||
return adminCategoryId2;
|
||||
}
|
||||
/**
|
||||
* admin2级类目
|
||||
* @param adminCategoryId2
|
||||
*/
|
||||
public void setAdminCategoryId2(String adminCategoryId2) {
|
||||
this.adminCategoryId2 = adminCategoryId2;
|
||||
}
|
||||
|
||||
/**
|
||||
* admin3级类目
|
||||
* @return
|
||||
*/
|
||||
public String getAdminCategoryId3() {
|
||||
return adminCategoryId3;
|
||||
}
|
||||
/**
|
||||
* admin3级类目
|
||||
* @param adminCategoryId3
|
||||
*/
|
||||
public void setAdminCategoryId3(String adminCategoryId3) {
|
||||
this.adminCategoryId3 = adminCategoryId3;
|
||||
}
|
||||
|
||||
/**
|
||||
* admin4级类目
|
||||
* @return
|
||||
*/
|
||||
public String getAdminCategoryId4() {
|
||||
return adminCategoryId4;
|
||||
}
|
||||
/**
|
||||
* admin4级类目
|
||||
* @param adminCategoryId4
|
||||
*/
|
||||
public void setAdminCategoryId4(String adminCategoryId4) {
|
||||
this.adminCategoryId4 = adminCategoryId4;
|
||||
}
|
||||
|
||||
/**
|
||||
* admin5级类目
|
||||
* @return
|
||||
*/
|
||||
public String getAdminCategoryId5() {
|
||||
return adminCategoryId5;
|
||||
}
|
||||
/**
|
||||
* admin5级类目
|
||||
* @param adminCategoryId5
|
||||
*/
|
||||
public void setAdminCategoryId5(String adminCategoryId5) {
|
||||
this.adminCategoryId5 = adminCategoryId5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VvProductEntity{" +
|
||||
@ -361,12 +451,17 @@ private static final long serialVersionUID = 1L;
|
||||
",defaultSort=" + defaultSort +
|
||||
",createTimestamp=" + createTimestamp +
|
||||
",modifyTimestamp=" + modifyTimestamp +
|
||||
",categoryIdOne=" + categoryIdOne +
|
||||
",categoryIdTwo=" + categoryIdTwo +
|
||||
",categoryIdThree=" + categoryIdThree +
|
||||
",frontPage=" + frontPage +
|
||||
",status=" + status +
|
||||
",realSaleCount=" + realSaleCount +
|
||||
",appCategoryId1=" + appCategoryId1 +
|
||||
",appCategoryId2=" + appCategoryId2 +
|
||||
",appCategoryId3=" + appCategoryId3 +
|
||||
",adminCategoryId1=" + adminCategoryId1 +
|
||||
",adminCategoryId2=" + adminCategoryId2 +
|
||||
",adminCategoryId3=" + adminCategoryId3 +
|
||||
",adminCategoryId4=" + adminCategoryId4 +
|
||||
",adminCategoryId5=" + adminCategoryId5 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -49,7 +49,7 @@ public class MysqlMain_update {
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
|
||||
String a = "vv_sku_property_value";
|
||||
String a = "vv_product";
|
||||
for (String s : a.split(",")) {
|
||||
list.add(new TablesBean(s));
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.test.xxx.mysql;
|
||||
|
||||
import com.heyu.api.data.dao.vv.VvProductDetailDao;
|
||||
import com.heyu.api.data.dao.vv.VvBuyerAddressDao;
|
||||
import com.lz.mybatis.plugin.utils.TestParseUtils;
|
||||
import com.lz.mybatis.plugin.utils.t.Tuple2;
|
||||
import org.junit.Test;
|
||||
@ -12,7 +12,7 @@ SqlParseUtilsTest {
|
||||
public void test1() {
|
||||
|
||||
|
||||
Tuple2<Boolean, String> tuple = TestParseUtils.testSql(VvProductDetailDao::selectVvProductDetailByProductId).getData();
|
||||
Tuple2<Boolean, String> tuple = TestParseUtils.testSql(VvBuyerAddressDao::updateVvBuyerAddressStatusById).getData();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.heyu.api.alibaba.request.mm.enums;
|
||||
|
||||
public enum BuyerAddressEnums {
|
||||
|
||||
common("common","默认"),
|
||||
default_address("default","默认地址"),
|
||||
delete("delete","删除")
|
||||
;
|
||||
|
||||
|
||||
|
||||
BuyerAddressEnums(String status, String desc) {
|
||||
this.status = status;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private String status;
|
||||
|
||||
private String desc;
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.heyu.api.alibaba.request.mm;
|
||||
package com.heyu.api.alibaba.request.mm.enums;
|
||||
|
||||
public enum OrderStatusEnums {
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.heyu.api.alibaba.request.mm.enums;
|
||||
|
||||
public enum ProductStatusEnums {
|
||||
|
||||
|
||||
|
||||
draft("draft","草稿"),
|
||||
online("online","在线"),
|
||||
down("down","下架"),
|
||||
delete("delete","删除"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
ProductStatusEnums(String status, String desc) {
|
||||
this.status = status;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private String status;
|
||||
|
||||
private String desc;
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@ -20,11 +20,11 @@ public class AppIndexPageRequest {
|
||||
|
||||
|
||||
//一级类目id
|
||||
private Integer categoryIdOne;
|
||||
private Integer categoryId1;
|
||||
//二级类目
|
||||
private Integer categoryIdTwo;
|
||||
private Integer categoryId2;
|
||||
//三级类目
|
||||
private Integer categoryIdThree;
|
||||
private Integer categoryId3;
|
||||
//是否是首页
|
||||
private Integer frontPage;
|
||||
|
||||
@ -39,6 +39,10 @@ public class AppIndexPageRequest {
|
||||
*/
|
||||
private String createTimestampSort;
|
||||
|
||||
/***
|
||||
* 状态
|
||||
*/
|
||||
private String status ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public class LogAop {
|
||||
.append("class:").append(className).append("#").append(methodName).append(BLANK_SPACE)
|
||||
.append("uri:").append(uri);
|
||||
|
||||
if(uri.startsWith("/mm/")){
|
||||
if(uri.startsWith("/mm/") || uri.startsWith("/app/")){
|
||||
return point.proceed();
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -114,6 +116,22 @@ public class ProductController {
|
||||
|
||||
List<VvSkuEntity> vvSkuEntities = vvSkuDao.selectVvSkuByProductId(vvProductDetailRequest.getProductId());
|
||||
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueList = vvSkuPropertyValueDao.selectVvSkuPropertyValueByProductId(vvProduct.getId());
|
||||
|
||||
Map<Long, List<VvSkuPropertyValueEntity>> vvSkuPropertyValueMap = new LinkedHashMap<>();
|
||||
|
||||
for (VvSkuPropertyValueEntity vvSkuPropertyValueEntity : vvSkuPropertyValueList) {
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueMap.get(vvSkuPropertyValueEntity.getSkuId());
|
||||
if (vvSkuPropertyValueEntities == null) {
|
||||
vvSkuPropertyValueEntities = new ArrayList<>();
|
||||
}
|
||||
|
||||
vvSkuPropertyValueEntities.add(vvSkuPropertyValueEntity);
|
||||
|
||||
vvSkuPropertyValueMap.put(vvSkuPropertyValueEntity.getSkuId(), vvSkuPropertyValueEntities);
|
||||
}
|
||||
|
||||
|
||||
List<VvSkuDTO> vvSkuDTOS = new ArrayList<>();
|
||||
for (VvSkuEntity vvSkuEntity : vvSkuEntities) {
|
||||
|
||||
@ -121,7 +139,7 @@ public class ProductController {
|
||||
|
||||
BeanUtils.copyProperties(vvSkuEntity, vvSkuDTO);
|
||||
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId());
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueMap.get(vvSkuEntity.getId());
|
||||
|
||||
vvSkuDTO.setVvSkuPropertyValueList(vvSkuPropertyValueEntities);
|
||||
|
||||
@ -405,5 +423,4 @@ public class ProductController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.heyu.api.controller.vv;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.alibaba.request.mm.enums.BuyerAddressEnums;
|
||||
import com.heyu.api.alibaba.request.vv.AppBuyerAddressRequest;
|
||||
import com.heyu.api.data.dao.vv.VvBuyerAddressDao;
|
||||
import com.heyu.api.data.dao.vv.VvBuyerDao;
|
||||
@ -12,6 +13,7 @@ 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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -34,8 +36,7 @@ public class AppBuyerAddressManagerController {
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(AppBuyerAddressRequest appBuyerAddressRequest) {
|
||||
|
||||
public R list(@RequestBody AppBuyerAddressRequest appBuyerAddressRequest) {
|
||||
|
||||
PPageUtils pageUtils = PPageUtils.startPage(appBuyerAddressRequest.getPageNum(), appBuyerAddressRequest.getPageSize())
|
||||
.doSelect(new ISelect() {
|
||||
@ -52,15 +53,19 @@ public class AppBuyerAddressManagerController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/update")
|
||||
public R list(VvBuyerAddressEntity vvBuyerAddressEntity) {
|
||||
@RequestMapping("/insertOrUpdate")
|
||||
public R inserOrUpdate(@RequestBody VvBuyerAddressEntity vvBuyerAddressEntity) {
|
||||
VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId());
|
||||
|
||||
// 如果当前状态是默认地址,
|
||||
if (BuyerAddressEnums.default_address.equals(vvBuyerAddressEntity.getStatus())) {
|
||||
vvBuyerAddressDao.updateVvBuyerAddressStatusById(BuyerAddressEnums.common.getStatus(),
|
||||
BuyerAddressEnums.default_address.getStatus(),
|
||||
vvBuyerAddressEntity.getBuyerId());
|
||||
}
|
||||
vvBuyerAddressEntity.setBuyerName(vvBuyerEntity.getBuyerName());
|
||||
vvBuyerAddressEntity.setBuyerPhone(vvBuyerEntity.getBuyerPhone());
|
||||
vvBuyerAddressEntity.setBuyerWeixin(vvBuyerEntity.getBuyerWeixin());
|
||||
vvBuyerAddressDao.insertOrUpdateVvBuyerAddress(vvBuyerAddressEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.heyu.api.controller.vv;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.alibaba.request.mm.VvProductDetailRequest;
|
||||
import com.heyu.api.alibaba.request.mm.enums.ProductStatusEnums;
|
||||
import com.heyu.api.alibaba.request.vv.AppIndexPageRequest;
|
||||
import com.heyu.api.data.dao.vv.*;
|
||||
import com.heyu.api.data.dto.vv.VvProductDTO;
|
||||
@ -15,11 +16,11 @@ 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.RequestBody;
|
||||
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.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -52,7 +53,9 @@ public class AppIndexPageController {
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/page/list")
|
||||
public R list(AppIndexPageRequest vvProductRequest) {
|
||||
public R list(@RequestBody AppIndexPageRequest vvProductRequest) {
|
||||
vvProductRequest.setFrontPage(1);
|
||||
vvProductRequest.setStatus(ProductStatusEnums.online.getStatus());
|
||||
PPageUtils pageUtils = PPageUtils.startPage(vvProductRequest.getPageNum(), vvProductRequest.getPageSize())
|
||||
.doSelect(new ISelect() {
|
||||
@Override
|
||||
@ -60,9 +63,10 @@ public class AppIndexPageController {
|
||||
return vvProductDao.selectIndexVvProduct(page,
|
||||
vvProductRequest.getProductName(),
|
||||
vvProductRequest.getFrontPage(),
|
||||
vvProductRequest.getCategoryIdOne(),
|
||||
vvProductRequest.getCategoryIdTwo(),
|
||||
vvProductRequest.getCategoryIdThree(),
|
||||
vvProductRequest.getStatus(),
|
||||
vvProductRequest.getCategoryId1(),
|
||||
vvProductRequest.getCategoryId2(),
|
||||
vvProductRequest.getCategoryId3(),
|
||||
vvProductRequest.getSalePriceSort(),
|
||||
vvProductRequest.getSaleCountSort(),
|
||||
vvProductRequest.getCreateTimestampSort()
|
||||
@ -75,7 +79,7 @@ public class AppIndexPageController {
|
||||
|
||||
|
||||
@RequestMapping("/product/detail")
|
||||
public R detail(VvProductDetailRequest vvProductDetailRequest) {
|
||||
public R detail(@RequestBody VvProductDetailRequest vvProductDetailRequest) {
|
||||
VvProductDTO vvProductDTO = new VvProductDTO();
|
||||
|
||||
VvProductEntity vvProduct = vvProductDao.selectVvProductById(vvProductDetailRequest.getProductId());
|
||||
@ -87,13 +91,30 @@ public class AppIndexPageController {
|
||||
vvProductDTO.setVvProductDetailList(productDetailEntities);
|
||||
List<VvSkuEntity> vvSkuEntities = vvSkuDao.selectVvSkuByProductId(vvProductDetailRequest.getProductId());
|
||||
List<VvSkuDTO> vvSkuDTOS = new ArrayList<>();
|
||||
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueList = vvSkuPropertyValueDao.selectVvSkuPropertyValueByProductId(vvProduct.getId());
|
||||
|
||||
Map<Long, List<VvSkuPropertyValueEntity>> vvSkuPropertyValueMap = new LinkedHashMap<>();
|
||||
|
||||
for (VvSkuPropertyValueEntity vvSkuPropertyValueEntity : vvSkuPropertyValueList) {
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueMap.get(vvSkuPropertyValueEntity.getSkuId());
|
||||
if (vvSkuPropertyValueEntities == null) {
|
||||
vvSkuPropertyValueEntities = new ArrayList<>();
|
||||
}
|
||||
|
||||
vvSkuPropertyValueEntities.add(vvSkuPropertyValueEntity);
|
||||
|
||||
vvSkuPropertyValueMap.put(vvSkuPropertyValueEntity.getSkuId(), vvSkuPropertyValueEntities);
|
||||
}
|
||||
|
||||
|
||||
for (VvSkuEntity vvSkuEntity : vvSkuEntities) {
|
||||
|
||||
VvSkuDTO vvSkuDTO = new VvSkuDTO();
|
||||
|
||||
BeanUtils.copyProperties(vvSkuEntity, vvSkuDTO);
|
||||
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueDao.selectVvSkuPropertyValueBySkuId(vvSkuEntity.getId());
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueMap.get(vvSkuEntity.getId());
|
||||
|
||||
vvSkuDTO.setVvSkuPropertyValueList(vvSkuPropertyValueEntities);
|
||||
|
||||
@ -104,6 +125,20 @@ public class AppIndexPageController {
|
||||
|
||||
List<VvProductPropertyEntity> vvProductPropertyEntities = vvProductPropertyDao.selectVvProductPropertyByProductId(vvProductDetailRequest.getProductId());
|
||||
|
||||
|
||||
List<VvProductPropertyValueEntity> productPropertyValueList = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdProductId(vvProduct.getId());
|
||||
|
||||
Map<Long, List<VvProductPropertyValueEntity>> productPropertyValueMap = new LinkedHashMap<>();
|
||||
for (VvProductPropertyValueEntity productPropertyValueEntity : productPropertyValueList) {
|
||||
List<VvProductPropertyValueEntity> vvProductPropertyValueEntities = productPropertyValueMap.get(productPropertyValueEntity.getProductPropertyId());
|
||||
if (vvProductPropertyValueEntities == null) {
|
||||
vvProductPropertyValueEntities = new ArrayList<>();
|
||||
}
|
||||
vvProductPropertyValueEntities.add(productPropertyValueEntity);
|
||||
productPropertyValueMap.put(productPropertyValueEntity.getProductPropertyId(), vvProductPropertyValueEntities);
|
||||
}
|
||||
|
||||
|
||||
List<VvProductPropertyDTO> vvProductPropertyDTOS = new ArrayList<>();
|
||||
|
||||
for (VvProductPropertyEntity vvProductPropertyEntity : vvProductPropertyEntities) {
|
||||
@ -112,13 +147,14 @@ public class AppIndexPageController {
|
||||
|
||||
BeanUtils.copyProperties(vvProductPropertyEntity, vvProductPropertyDTO);
|
||||
|
||||
List<VvProductPropertyValueEntity> productPropertyValues = vvProductPropertyValueDao.selectVvProductPropertyValueByProductIdPropertyId(vvProductPropertyEntity.getId());
|
||||
List<VvProductPropertyValueEntity> productPropertyValues = productPropertyValueMap.get(vvProductPropertyEntity.getId());
|
||||
|
||||
vvProductPropertyDTO.setVvProductPropertyValueList(productPropertyValues);
|
||||
|
||||
vvProductPropertyDTOS.add(vvProductPropertyDTO);
|
||||
}
|
||||
vvProductDTO.setVvProductPropertyList(vvProductPropertyDTOS);
|
||||
|
||||
return R.ok().setData(vvProductDTO);
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ package com.heyu.api.controller.vv;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.alibaba.request.mm.OrderStatusEnums;
|
||||
import com.heyu.api.alibaba.request.mm.enums.OrderStatusEnums;
|
||||
import com.heyu.api.alibaba.request.mm.order.resp.*;
|
||||
import com.heyu.api.alibaba.request.vv.AppOrderRequest;
|
||||
import com.heyu.api.data.dao.vv.*;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user