B2C功能提交
This commit is contained in:
11
DB/b2c.sql
Normal file
11
DB/b2c.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
物流公司增加电子面单参数
|
||||
*/
|
||||
ALTER TABLE li_logistics ADD `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客户代码';
|
||||
ALTER TABLE li_logistics ADD `customer_pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客户密码';
|
||||
ALTER TABLE li_logistics ADD `month_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '月结号/密钥';
|
||||
ALTER TABLE li_logistics ADD `send_site` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '归属网点';
|
||||
ALTER TABLE li_logistics ADD `send_staff` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '收件快递员';
|
||||
ALTER TABLE li_logistics ADD `face_sheet_flag` bit(1) DEFAULT NULL COMMENT '是否使用电子面单';
|
||||
ALTER TABLE li_logistics ADD `pay_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '支付方式';
|
||||
ALTER TABLE li_logistics ADD `exp_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '快递类型';
|
||||
@@ -0,0 +1,168 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.cache.Cache;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
import cn.lili.modules.system.entity.dto.*;
|
||||
import cn.lili.modules.system.entity.dto.connect.ConnectSetting;
|
||||
import cn.lili.modules.system.entity.dto.connect.QQConnectSetting;
|
||||
import cn.lili.modules.system.entity.dto.connect.WechatConnectSetting;
|
||||
import cn.lili.modules.system.entity.dto.payment.AlipayPaymentSetting;
|
||||
import cn.lili.modules.system.entity.dto.payment.PaymentSupportSetting;
|
||||
import cn.lili.modules.system.entity.dto.payment.UnionPaymentSetting;
|
||||
import cn.lili.modules.system.entity.dto.payment.WechatPaymentSetting;
|
||||
import cn.lili.modules.system.entity.dto.payment.dto.PaymentSupportForm;
|
||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author chc
|
||||
* @since 2022/6/2114:46
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,系统设置")
|
||||
@RequestMapping("/buyer/other/setting")
|
||||
public class SettingBuyerController {
|
||||
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@Autowired
|
||||
private Cache<String> cache;
|
||||
|
||||
@DemoSite
|
||||
@ApiOperation(value = "查看配置")
|
||||
@GetMapping(value = "/get/{key}")
|
||||
@ApiImplicitParam(name = "key", value = "配置key", paramType = "path"
|
||||
, allowableValues = "BASE_SETTING,EMAIL_SETTING,GOODS_SETTING,KUAIDI_SETTING,ORDER_SETTING,OSS_SETTING,POINT_SETTING," +
|
||||
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
|
||||
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING,IM"
|
||||
)
|
||||
public ResultMessage settingGet(@PathVariable String key) {
|
||||
return createSetting(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表单
|
||||
* 这里主要包含一个配置对象为空,导致转换异常问题的处理,解决配置项增加减少,带来的系统异常,无法直接配置
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @throws InstantiationException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
private ResultMessage createSetting(String key) {
|
||||
SettingEnum settingEnum = SettingEnum.valueOf(key);
|
||||
cache.remove(key);
|
||||
Setting setting = settingService.get(key);
|
||||
switch (settingEnum) {
|
||||
case BASE_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new BaseSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), BaseSetting.class));
|
||||
case WITHDRAWAL_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new WithdrawalSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), WithdrawalSetting.class));
|
||||
case DISTRIBUTION_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new DistributionSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), DistributionSetting.class));
|
||||
case EMAIL_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new EmailSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), EmailSetting.class));
|
||||
case GOODS_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new GoodsSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), GoodsSetting.class));
|
||||
case LOGISTICS_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new LogisticsSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), LogisticsSetting.class));
|
||||
case ORDER_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new OrderSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), OrderSetting.class));
|
||||
case OSS_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new OssSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), OssSetting.class));
|
||||
case SMS_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new SmsSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), SmsSetting.class));
|
||||
case POINT_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new PointSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), PointSetting.class));
|
||||
case QQ_CONNECT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new QQConnectSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), QQConnectSetting.class));
|
||||
case CONNECT_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new ConnectSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ConnectSetting.class));
|
||||
case PAYMENT_SUPPORT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new PaymentSupportSetting(new PaymentSupportForm())) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), PaymentSupportSetting.class));
|
||||
case ALIPAY_PAYMENT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new AlipayPaymentSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), AlipayPaymentSetting.class));
|
||||
case UNIONPAY_PAYMENT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new UnionPaymentSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), UnionPaymentSetting.class));
|
||||
case WECHAT_CONNECT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new WechatConnectSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), WechatConnectSetting.class));
|
||||
case WECHAT_PAYMENT:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new WechatPaymentSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), WechatPaymentSetting.class));
|
||||
case SECKILL_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new SeckillSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), SeckillSetting.class));
|
||||
case EXPERIENCE_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new ExperienceSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ExperienceSetting.class));
|
||||
case IM_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new ImSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ImSetting.class));
|
||||
case HOT_WORDS:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new HotWordsSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), HotWordsSetting.class));
|
||||
case DELIVERY_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new DeliverySetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), DeliverySetting.class));
|
||||
default:
|
||||
throw new ServiceException(ResultCode.SETTING_NOT_TO_SET);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 同步商品分类名称
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 -> {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.OperationalJudgment;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.vos.DraftGoodsVO;
|
||||
import cn.lili.modules.goods.service.DraftGoodsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 管理端,草稿商品接口
|
||||
*
|
||||
* @author paulG
|
||||
* @since 2021/2/20 2:26 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "管理端,草稿商品接口")
|
||||
@RequestMapping("/manager/goods/draftGoods")
|
||||
public class DraftGoodsManagerController {
|
||||
@Autowired
|
||||
private DraftGoodsService draftGoodsService;
|
||||
|
||||
|
||||
@ApiOperation(value = "分页获取草稿商品列表")
|
||||
@GetMapping(value = "/page")
|
||||
public ResultMessage<IPage<DraftGoods>> getDraftGoodsByPage(DraftGoodsSearchParams searchParams) {
|
||||
searchParams.setStoreId("-1");
|
||||
return ResultUtil.data(draftGoodsService.getDraftGoods(searchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取草稿商品")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<DraftGoodsVO> getDraftGoods(@PathVariable String id) {
|
||||
DraftGoodsVO draftGoods = OperationalJudgment.judgment(draftGoodsService.getDraftGoods(id));
|
||||
return ResultUtil.data(draftGoods);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存草稿商品")
|
||||
@PostMapping(value = "/save", consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<String> saveDraftGoods(@RequestBody DraftGoodsDTO draftGoodsVO) {
|
||||
draftGoodsVO.setStoreId("-1");
|
||||
draftGoodsService.saveGoodsDraft(draftGoodsVO);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除草稿商品")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
public ResultMessage<String> deleteDraftGoods(@PathVariable String id) {
|
||||
draftGoodsService.deleteGoodsDraft(id);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,16 +5,19 @@ import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsVO;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -27,6 +30,8 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 管理端,商品管理接口
|
||||
@@ -135,4 +140,38 @@ public class GoodsManagerController {
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商品库存")
|
||||
@PutMapping(value = "/update/stocks", consumes = "application/json")
|
||||
public ResultMessage<Object> updateStocks(@RequestBody List<GoodsSkuStockDTO> updateStockList) {
|
||||
// 获取商品skuId集合
|
||||
List<String> goodsSkuIds = updateStockList.stream().map(GoodsSkuStockDTO::getSkuId).collect(Collectors.toList());
|
||||
// 根据skuId集合查询商品信息
|
||||
List<GoodsSku> goodsSkuList = goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().in(GoodsSku::getId, goodsSkuIds));
|
||||
// 过滤不符合当前店铺的商品
|
||||
List<String> filterGoodsSkuIds = goodsSkuList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
||||
List<GoodsSkuStockDTO> collect = updateStockList.stream().filter(i -> filterGoodsSkuIds.contains(i.getSkuId())).collect(Collectors.toList());
|
||||
goodsSkuService.updateStocks(collect);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@DemoSite
|
||||
@ApiOperation(value = "删除商品")
|
||||
@PutMapping(value = "/delete")
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true)
|
||||
public ResultMessage<Object> deleteGoods(@RequestParam List<String> goodsId) {
|
||||
goodsService.deleteGoods(goodsId);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设置商品运费模板")
|
||||
@PutMapping(value = "/freight")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true),
|
||||
@ApiImplicitParam(name = "templateId", value = "运费模板ID", required = true, paramType = "query")
|
||||
})
|
||||
public ResultMessage<Object> freight(@RequestParam List<String> goodsId, @RequestParam String templateId) {
|
||||
goodsService.freight(goodsId, templateId);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,4 +99,19 @@ public class AfterSaleManagerController {
|
||||
public ResultMessage<StoreAfterSaleAddressDTO> getStoreAfterSaleAddress(@NotNull(message = "售后单号") @PathVariable("sn") String sn) {
|
||||
return ResultUtil.data(afterSaleService.getStoreAfterSaleAddressDTO(sn));
|
||||
}
|
||||
|
||||
@PreventDuplicateSubmissions
|
||||
@ApiOperation(value = "卖家确认收货")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "serviceStatus", value = "PASS:审核通过,REFUSE:审核未通过", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query")
|
||||
})
|
||||
@PutMapping(value = "/confirm/{afterSaleSn}")
|
||||
public ResultMessage<AfterSale> confirm(@NotNull(message = "请选择售后单") @PathVariable String afterSaleSn,
|
||||
@NotNull(message = "请审核") String serviceStatus,
|
||||
String remark) {
|
||||
|
||||
return ResultUtil.data(afterSaleService.storeConfirm(afterSaleSn, serviceStatus, remark));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.entity.dos.Logistics;
|
||||
import cn.lili.modules.system.entity.dto.LogisticsSearchParams;
|
||||
import cn.lili.modules.system.service.LogisticsService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -37,8 +37,8 @@ public class LogisticsManagerController {
|
||||
|
||||
@ApiOperation(value = "分页获取物流公司")
|
||||
@GetMapping(value = "/getByPage")
|
||||
public ResultMessage<IPage<Logistics>> getByPage(PageVO page) {
|
||||
return ResultUtil.data(logisticsService.page(PageUtil.initPage(page)));
|
||||
public ResultMessage<IPage<Logistics>> getByPage(LogisticsSearchParams page) {
|
||||
return ResultUtil.data(logisticsService.page(PageUtil.initPage(page),page.queryWrapper()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑物流公司")
|
||||
|
||||
@@ -73,6 +73,19 @@ public class FullDiscountManagerController {
|
||||
return ResultUtil.data(fullDiscountVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改满优惠活动")
|
||||
@PutMapping(consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<String> editFullDiscount(@RequestBody FullDiscountVO fullDiscountVO) {
|
||||
OperationalJudgment.judgment(fullDiscountService.getFullDiscount(fullDiscountVO.getId()));
|
||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||
fullDiscountVO.setStoreId(currentUser.getStoreId());
|
||||
fullDiscountVO.setStoreName(currentUser.getStoreName());
|
||||
if (!fullDiscountService.updatePromotions(fullDiscountVO)) {
|
||||
return ResultUtil.error(ResultCode.PINTUAN_EDIT_ERROR);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.FULL_DISCOUNT_EDIT_SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除满优惠活动")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResultMessage<String> deleteFullDiscount(@PathVariable String id) {
|
||||
|
||||
Reference in New Issue
Block a user