Compare commits
1 Commits
master
...
1127/sunly
Author | SHA1 | Date |
---|---|---|
|
4a17fc7227 |
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id":"Long",
|
||||
"团购名称":"String",
|
||||
"团购商品ID":"Long",
|
||||
"团购商品图片":"String",
|
||||
"团购商品简介":"Text",
|
||||
"策略id":"Long",
|
||||
"策略类型":"String",
|
||||
"结束时间":"Date",
|
||||
"状态":"String",
|
||||
"轮播图集合":
|
||||
[
|
||||
"图片":"String"
|
||||
]
|
||||
"商品规格集合":
|
||||
[
|
||||
"商品规格":
|
||||
{
|
||||
"id":"Long",
|
||||
"规格" :"String",
|
||||
// "拼团价格":"Decimal",
|
||||
// "拼团库存":"Long",
|
||||
"价格变化值":"Decimal",
|
||||
"库存变化值":"Long"
|
||||
}
|
||||
]
|
||||
"团购规格ID集合"
|
||||
}
|
|
@ -21,7 +21,6 @@
|
|||
],
|
||||
"删除商品规格IdList" : ["Long", "Long"],
|
||||
"添加商品规格List": [
|
||||
"商品SKU": "String",
|
||||
"商品价格": "BigDecimal",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -33,7 +33,7 @@ spring:
|
|||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -32,11 +32,11 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
private long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
private String projectImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
|
@ -82,8 +82,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.projectId(activityTeamInfoAddModel.getProductId())
|
||||
.projectImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
.imageList(activityTeamInfoAddModel.getImageList())
|
||||
|
@ -99,8 +99,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoSaveModel.getName())
|
||||
.productId(activityTeamInfoSaveModel.getProductId())
|
||||
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||
.projectId(activityTeamInfoSaveModel.getProductId())
|
||||
.projectImage(activityTeamInfoSaveModel.getProductImage())
|
||||
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||
.unit(activityTeamInfoSaveModel.getUnit())
|
||||
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||
|
@ -116,8 +116,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
return ActivityTeamInfo.builder()
|
||||
.id(activityTeamInfoUpdModel.getId())
|
||||
.name(activityTeamInfoUpdModel.getName())
|
||||
.productId(activityTeamInfoUpdModel.getProductId())
|
||||
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||
.projectId(activityTeamInfoUpdModel.getProductId())
|
||||
.projectImage(activityTeamInfoUpdModel.getProductImage())
|
||||
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||
.unit(activityTeamInfoUpdModel.getUnit())
|
||||
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
@ -74,4 +75,12 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuUpdModel.getId())
|
||||
.teamPrice(activityTeamProductSkuUpdModel.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -86,8 +86,8 @@ public class ActivityTeamDetailModel {
|
|||
return function.apply(ActivityTeamDetailModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.productId(activityTeamInfo.getProjectId())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
.introduction(activityTeamInfo.getIntroduction())
|
||||
.unit(activityTeamInfo.getUnit())
|
||||
.imageList(activityTeamInfo.getImageList())
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ActivityTeamInfoAddModel {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
|
|
|
@ -79,7 +79,7 @@ public class ActivityTeamInfoListModel {
|
|||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
// .teamStock(teamProductStockModel.getTeamStock())
|
||||
|
@ -91,7 +91,7 @@ public class ActivityTeamInfoListModel {
|
|||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.productImage(activityTeamInfo.getProjectImage())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,56 +1,125 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
* 拼团活动修改模板
|
||||
*
|
||||
* @author SunLY
|
||||
* @version 1.0
|
||||
* @date 2024/11/27 17:13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamInfoUpdModel {
|
||||
/**
|
||||
* 拼团ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private String status;
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 修改商品规格list
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> TeamProductSkuUpdList;
|
||||
|
||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
/**
|
||||
* 删除商品规格IDList
|
||||
*/
|
||||
private List<Long> TeamProductSkuDelList;
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> TeamProductSkuAddList;
|
||||
|
||||
|
||||
|
||||
public static ActivityTeamInfoUpdModel buildModel(ActivityTeamInfoUpdReq activityTeamInfoUpdReq) {
|
||||
return ActivityTeamInfoUpdModel.builder()
|
||||
.id(activityTeamInfoUpdReq.getId())
|
||||
.name(activityTeamInfoUpdReq.getName())
|
||||
.productId(activityTeamInfoUpdReq.getProductId())
|
||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||
.productName(activityTeamInfoUpdReq.getProductName())
|
||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||
.unit(activityTeamInfoUpdReq.getUnit())
|
||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.sort(activityTeamInfoUpdReq.getSort())
|
||||
.content(activityTeamInfoUpdReq.getContent())
|
||||
.status(activityTeamInfoUpdReq.getStatus())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||
.TeamProductSkuAddList(activityTeamInfoUpdReq.getTeamProductSkuAddList())
|
||||
.TeamProductSkuDelList(activityTeamInfoUpdReq.getTeamProductSkuDelList())
|
||||
.TeamProductSkuUpdList(activityTeamInfoUpdReq.getTeamProductSkuUpdList())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -19,18 +22,75 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoUpdReq {
|
||||
/**
|
||||
* 拼团ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private String status;
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
private List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 修改商品规格list
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> TeamProductSkuUpdList;
|
||||
|
||||
/**
|
||||
* 删除商品规格IDList
|
||||
*/
|
||||
private List<Long> TeamProductSkuDelList;
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> TeamProductSkuAddList;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.muyu.marketing.domain.resp;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
|
@ -59,13 +59,24 @@ public class ActivityTeamController {
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询团购活动详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
}
|
||||
@PutMapping("/updateByTeamId")
|
||||
|
||||
/**
|
||||
* 修改拼团活动信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||
activityTeamInfoService.updateByTeamId(ActivityTeamInfoUpdModel.buildModel(activityTeamInfoUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,12 +28,9 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
*/
|
||||
ActivityTeamDetailModel findDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
|
||||
public boolean updateByTeamId(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
|
||||
|
||||
/**
|
||||
* 添加团购商品SKU
|
||||
* 批量添加团购商品SKU
|
||||
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||
*/
|
||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
@ -46,6 +46,25 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||
/**
|
||||
* 更新团购商品SKU
|
||||
* @param activityTeamProductSkuUpdModel 团购商品SKU更新模型
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
public boolean updateTeamProductSku(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||
|
||||
/**
|
||||
* 批量更新团购商品SKU
|
||||
* @param activityTeamProductSkuUpdModels
|
||||
* @return
|
||||
*/
|
||||
public boolean updateTeamProductSkuList(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModels);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除团购商品SKU
|
||||
* @param productSkuIdList
|
||||
* @return
|
||||
*/
|
||||
public boolean deleteTeamProductSkuList(List<Long> productSkuIdList);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
|
@ -93,16 +94,27 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||
io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败");
|
||||
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList());
|
||||
return update;
|
||||
public boolean updateByTeamId(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel);
|
||||
|
||||
this.updateById(activityTeamInfo);
|
||||
|
||||
|
||||
activityTeamProductSkuInfoService.deleteTeamProductSkuList(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuDelList()
|
||||
);
|
||||
|
||||
activityTeamProductSkuInfoService.batchSave(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuAddList()
|
||||
);
|
||||
|
||||
activityTeamProductSkuInfoService.updateTeamProductSkuList(
|
||||
activityTeamInfoUpdModel.getTeamProductSkuUpdList()
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
|
@ -19,6 +20,7 @@ import java.util.ArrayList;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
|
@ -95,9 +97,30 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||
public boolean updateTeamProductSku(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice, activityTeamProductSkuUpdModel.getTeamPrice());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getId, activityTeamProductSkuUpdModel.getId());
|
||||
return this.update(updateWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTeamProductSkuList(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||
return this.updateBatchById(
|
||||
activityTeamProductSkuUpdModelList.stream().
|
||||
map(ActivityTeamProductSkuInfo::updateModelBuild)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteTeamProductSkuList(List<Long> productSkuIdList) {
|
||||
return removeBatchByIds(productSkuIdList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ server:
|
|||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-buy
|
||||
name: muyu-marketing
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.46.147.226:8848
|
||||
server-addr: 121.37.131.224:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue