B2C功能提交

This commit is contained in:
chc
2024-10-21 22:34:23 +08:00
parent 9d3ed4a4a7
commit dfb98c107e
13 changed files with 351 additions and 92 deletions

View File

@@ -28,13 +28,6 @@ public interface GoodsService extends IService<Goods> {
*/
List<Goods> getByBrandIds(List<String> brandIds);
/**
* 下架所有商家商品
*
* @param storeId 店铺ID
*/
void underStoreGoods(String storeId);
/**
* 更新商品参数
*
@@ -113,16 +106,6 @@ public interface GoodsService extends IService<Goods> {
Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason);
/**
* 更新商品上架状态状态
*
* @param storeId 店铺ID
* @param goodsStatusEnum 更新的商品状态
* @param underReason 下架原因
* @return 更新结果
*/
Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason);
/**
* 更新商品上架状态状态
*
@@ -177,12 +160,6 @@ public interface GoodsService extends IService<Goods> {
* @param store
*/
void updateStoreDetail(Store store);
/**
* 统计店铺的商品数量
* @param storeId 店铺id
* @return
*/
long countStoreGoodsNum(String storeId);
/**
* 同步商品分类名称

View File

@@ -129,19 +129,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
return list(lambdaQueryWrapper);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void underStoreGoods(String storeId) {
//获取商品ID列表
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
//下架店铺下的商品
this.updateGoodsMarketAbleByStoreId(storeId, GoodsStatusEnum.DOWN, "店铺关闭");
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("下架商品",
rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.DOWN.name(), JSONUtil.toJsonStr(list)));
}
/**
* 更新商品参数
*
@@ -340,29 +327,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
return result;
}
/**
* 更新商品上架状态状态
*
* @param storeId 店铺ID
* @param goodsStatusEnum 更新的商品状态
* @param underReason 下架原因
* @return 更新结果
*/
@Override
@SystemLogPoint(description = "店铺关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+'],操作对象:['+#storeId+'],操作原因:['+#underReason+']'")
public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason) {
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
updateWrapper.set(Goods::getMarketEnable, goodsStatusEnum.name());
updateWrapper.set(Goods::getUnderMessage, underReason);
updateWrapper.eq(Goods::getStoreId, storeId);
boolean result = this.update(updateWrapper);
//修改规格商品
this.goodsSkuService.updateGoodsSkuStatusByStoreId(storeId, goodsStatusEnum.name(), null);
return result;
}
@Override
@SystemLogPoint(description = "管理员关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+'],操作对象:['+#goodsIds+'],操作原因:['+#underReason+']'")
@@ -430,7 +394,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
if (freightTemplate == null) {
throw new ServiceException(ResultCode.FREIGHT_TEMPLATE_NOT_EXIST);
}
if (authUser != null && !freightTemplate.getStoreId().equals(authUser.getStoreId())) {
if (authUser != null) {
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
}
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
@@ -517,16 +481,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
goodsSkuService.update(updateWrapper);
}
@Override
public long countStoreGoodsNum(String storeId) {
return this.count(
new LambdaQueryWrapper<Goods>()
.eq(Goods::getStoreId, storeId)
.eq(Goods::getDeleteFlag, Boolean.FALSE)
.eq(Goods::getAuthFlag, GoodsAuthEnum.PASS.name())
.eq(Goods::getMarketEnable, GoodsStatusEnum.UPPER.name()));
}
@Override
public void categoryGoodsName(String categoryId) {
//获取分类下的商品
@@ -699,7 +653,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
LambdaUpdateWrapper<Goods> updateWrapper = new LambdaUpdateWrapper<>();
AuthUser authUser = this.checkStoreAuthority();
if (authUser != null) {
updateWrapper.eq(Goods::getStoreId, authUser.getStoreId());
updateWrapper.eq(Goods::getStoreId, "-1");
}
return updateWrapper;
}
@@ -713,7 +667,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
private AuthUser checkStoreAuthority() {
AuthUser currentUser = UserContext.getCurrentUser();
//如果当前会员不为空,且为店铺角色
if (currentUser != null && (currentUser.getRole().equals(UserEnums.STORE) && currentUser.getStoreId() != null)) {
if (currentUser != null) {
return currentUser;
}
return null;
@@ -743,7 +697,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
LambdaQueryWrapper<Goods> queryWrapper = new LambdaQueryWrapper<>();
AuthUser authUser = this.checkStoreAuthority();
if (authUser != null) {
queryWrapper.eq(Goods::getStoreId, authUser.getStoreId());
queryWrapper.eq(Goods::getStoreId, "-1");
}
return queryWrapper;
}

View File

@@ -241,10 +241,6 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
storeLambdaUpdateWrapper.eq(Store::getId, id);
storeLambdaUpdateWrapper.set(Store::getStoreDisable, StoreStatusEnum.CLOSED.value());
boolean update = this.update(storeLambdaUpdateWrapper);
//下架所有此店铺商品
if (update) {
goodsService.underStoreGoods(id);
}
//删除店员token
clerkService.list(new LambdaQueryWrapper<Clerk>().eq(Clerk::getStoreId, id)).forEach(clerk -> {

View File

@@ -63,14 +63,4 @@ public class Logistics extends BaseEntity {
@ApiModelProperty(value = "快递类型")
private String expType;
public Logistics(StoreLogisticsCustomerDTO storeLogisticsCustomerDTO){
this.customerName=storeLogisticsCustomerDTO.getCustomerName();
this.customerPwd=storeLogisticsCustomerDTO.getCustomerPwd();
this.sendSite=storeLogisticsCustomerDTO.getSendSite();
this.sendStaff=storeLogisticsCustomerDTO.getSendStaff();
this.monthCode=storeLogisticsCustomerDTO.getMonthCode();
this.faceSheetFlag=storeLogisticsCustomerDTO.isFaceSheetFlag();
this.payType = storeLogisticsCustomerDTO.getPayType();
this.expType = storeLogisticsCustomerDTO.getExpType();
}
}

View File

@@ -15,8 +15,14 @@ import java.io.Serializable;
public class ImSetting implements Serializable {
@ApiModelProperty(value = "平台地址")
private String httpUrl;
@ApiModelProperty(value = "地址")
private String url;
@ApiModelProperty(value = "企业Id")
private String companyId;
@ApiModelProperty(value = "二维码")
private String qrCode;
}

View File

@@ -0,0 +1,25 @@
package cn.lili.modules.system.entity.dto;
import cn.lili.common.vo.PageVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author chc
* @since 2022/6/2114:46
*/
@Data
public class LogisticsSearchParams extends PageVO {
@ApiModelProperty(value = "支持电子面单")
private Boolean standBy;
public <T> QueryWrapper<T> queryWrapper() {
QueryWrapper<T> wrapper = new QueryWrapper<>();
if(standBy != null){
wrapper.eq("standBy",standBy);
}
return wrapper;
}
}