commit
259946e78f
10
DB/2024-1-5.sql
Normal file
10
DB/2024-1-5.sql
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
/**
|
||||
交易唤醒表,增加交易流水详情
|
||||
*/
|
||||
ALTER TABLE li_order_item ADD `is_refund` varchar(255) DEFAULT NULL COMMENT '是否退款';
|
||||
|
||||
/**
|
||||
交易表增加订单状态字段
|
||||
*/
|
||||
ALTER TABLE li_order_item ADD `refund_price` decimal(10,2) DEFAULT NULL COMMENT '退款金额';
|
@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -37,16 +38,18 @@ public class FileDirectoryController {
|
||||
|
||||
@ApiOperation(value = "添加文件目录")
|
||||
@PostMapping
|
||||
public ResultMessage<FileDirectory> addSceneFileList(@RequestBody FileDirectory fileDirectory) {
|
||||
public ResultMessage<FileDirectory> addSceneFileList(@RequestBody @Valid FileDirectory fileDirectory) {
|
||||
fileDirectory.setDirectoryType(UserContext.getCurrentUser().getRole().name());
|
||||
fileDirectory.setOwnerId(UserContext.getCurrentUser().getId());
|
||||
fileDirectoryService.save(fileDirectory);
|
||||
return ResultUtil.data(fileDirectory);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改文件目录")
|
||||
@PutMapping
|
||||
public ResultMessage<FileDirectory> editSceneFileList(@RequestBody FileDirectory fileDirectory) {
|
||||
public ResultMessage<FileDirectory> editSceneFileList(@RequestBody @Valid FileDirectory fileDirectory) {
|
||||
fileDirectory.setDirectoryType(UserContext.getCurrentUser().getRole().name());
|
||||
fileDirectory.setOwnerId(UserContext.getCurrentUser().getId());
|
||||
fileDirectoryService.updateById(fileDirectory);
|
||||
return ResultUtil.data(fileDirectory);
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
url: http://192.168.0.108:8000
|
||||
url: http://127.0.0.1:8000
|
||||
cache:
|
||||
type: redis
|
||||
# Redis
|
||||
redis:
|
||||
host: 192.168.31.108
|
||||
host: 192.168.31.100
|
||||
port: 30379
|
||||
password: lilishop
|
||||
lettuce:
|
||||
@ -60,7 +60,7 @@ spring:
|
||||
default-datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.31.108:30306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://192.168.31.100:30306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: lilishop
|
||||
maxActive: 50
|
||||
@ -241,16 +241,16 @@ lili:
|
||||
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
|
||||
#域名
|
||||
domain:
|
||||
pc: http://192.168.0.108:8888
|
||||
wap: http://192.168.0.108:8888
|
||||
seller: http://192.168.0.108:8888
|
||||
admin: http://192.168.0.108:8888
|
||||
pc: http://127.0.0.1:8888
|
||||
wap: http://127.0.0.1:8888
|
||||
seller: http://127.0.0.1:8888
|
||||
admin: http://127.0.0.1:8888
|
||||
#api地址
|
||||
api:
|
||||
buyer: https://z171l91606.51mypc.cn
|
||||
base: http://192.168.0.108:8888
|
||||
manager: http://192.168.0.108:8888
|
||||
seller: http://192.168.0.108:8888
|
||||
base: http://127.0.0.1:8888
|
||||
manager: http://127.0.0.1:8888
|
||||
seller: http://127.0.0.1:8888
|
||||
|
||||
# jwt 细节设定
|
||||
jwt-setting:
|
||||
@ -269,7 +269,7 @@ lili:
|
||||
data:
|
||||
elasticsearch:
|
||||
cluster-name: elasticsearch
|
||||
cluster-nodes: 192.168.31.108:30920
|
||||
cluster-nodes: 192.168.31.100:30920
|
||||
index:
|
||||
number-of-replicas: 0
|
||||
number-of-shards: 3
|
||||
@ -280,7 +280,7 @@ lili:
|
||||
# password: LiLiShopES
|
||||
|
||||
logstash:
|
||||
server: 127.0.0.1:4560
|
||||
server: 192.168.31.100:30560
|
||||
rocketmq:
|
||||
promotion-topic: shop_lili_promotion_topic
|
||||
promotion-group: shop_lili_promotion_group
|
||||
@ -301,7 +301,7 @@ lili:
|
||||
after-sale-topic: shop_lili_after_sale_topic
|
||||
after-sale-group: shop_lili_after_sale_group
|
||||
rocketmq:
|
||||
name-server: 192.168.31.108:30876
|
||||
name-server: 192.168.31.100:30876
|
||||
isVIPChannel: false
|
||||
producer:
|
||||
group: lili_group
|
||||
@ -310,7 +310,7 @@ rocketmq:
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://192.168.31.108:30001/xxl-job-admin
|
||||
addresses: http://192.168.31.100:30001/xxl-job-admin
|
||||
executor:
|
||||
appname: xxl-job-executor-lilishop
|
||||
address:
|
||||
|
@ -1,10 +1,13 @@
|
||||
package cn.lili.event.impl;
|
||||
|
||||
import cn.lili.common.utils.CurrencyUtil;
|
||||
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||
import cn.lili.event.TradeEvent;
|
||||
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
import cn.lili.modules.order.order.entity.dos.Order;
|
||||
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
||||
import cn.lili.modules.order.order.entity.enums.RefundStatusEnum;
|
||||
import cn.lili.modules.order.order.service.OrderItemService;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.order.order.service.TradeService;
|
||||
@ -43,16 +46,27 @@ public class OrderStatusHandlerExecute implements TradeEvent, AfterSaleStatusCha
|
||||
|
||||
@Override
|
||||
public void afterSaleStatusChange(AfterSale afterSale) {
|
||||
Order order = orderService.getBySn(afterSale.getOrderSn());
|
||||
OrderItem orderItem = orderItemService.getBySn(afterSale.getOrderItemSn());
|
||||
|
||||
if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
|
||||
if (orderItem.getReturnGoodsNumber().equals(orderItem.getNum())) {
|
||||
orderItem.setIsRefund(RefundStatusEnum.ALL_REFUND.name());
|
||||
} else {
|
||||
orderItem.setIsRefund(RefundStatusEnum.PART_REFUND.name());
|
||||
}
|
||||
orderItem.setRefundPrice(CurrencyUtil.add(afterSale.getActualRefundPrice(), orderItem.getRefundPrice()));
|
||||
orderItemService.updateByAfterSale(orderItem);
|
||||
|
||||
//循环订单货物,判断是否已经全部售后
|
||||
List<OrderItem> orderItems = orderItemService.getByOrderSn(afterSale.getOrderSn());
|
||||
// 总退货数量
|
||||
int returnCount = 0;
|
||||
// 总购买数量
|
||||
int deliverCount = 0;
|
||||
for (OrderItem orderItem : orderItems) {
|
||||
returnCount += orderItem.getReturnGoodsNumber();
|
||||
deliverCount += orderItem.getNum();
|
||||
for (OrderItem item : orderItems) {
|
||||
returnCount += item.getReturnGoodsNumber();
|
||||
deliverCount += item.getNum();
|
||||
}
|
||||
if (returnCount == deliverCount) {
|
||||
orderService.systemCancel(afterSale.getOrderSn(),"订单货物全部退款",false);
|
||||
|
@ -34,4 +34,11 @@ public class CommonUtil {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特定字符 + 6位随机数
|
||||
* @return
|
||||
*/
|
||||
public static String getSpecialStr(String value) {
|
||||
return value + getRandomNum();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@TableName("li_file_directory")
|
||||
@ -26,7 +27,9 @@ public class FileDirectory extends BaseEntity {
|
||||
private String ownerId;
|
||||
@ApiModelProperty(value = "父分类ID")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "层级")
|
||||
@NotNull(message = "层级不能为空")
|
||||
@Min(value = 0, message = "层级最小为0")
|
||||
@Max(value = 2, message = "层级最大为2")
|
||||
private Integer level;
|
||||
|
@ -1,10 +1,12 @@
|
||||
package cn.lili.modules.file.serviceimpl;
|
||||
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionOrder;
|
||||
import cn.lili.modules.file.entity.FileDirectory;
|
||||
import cn.lili.modules.file.entity.dto.FileDirectoryDTO;
|
||||
import cn.lili.modules.file.mapper.FileDirectoryMapper;
|
||||
import cn.lili.modules.file.service.FileDirectoryService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -34,8 +36,7 @@ public class FileDirectoryServiceImpl extends ServiceImpl<FileDirectoryMapper, F
|
||||
|
||||
@Override
|
||||
public List<FileDirectoryDTO> getFileDirectoryList(String scene) {
|
||||
|
||||
List<FileDirectory> fileDirectoryList = this.list();
|
||||
List<FileDirectory> fileDirectoryList = this.list(new LambdaQueryWrapper<FileDirectory>().eq(FileDirectory::getOwnerId, scene));
|
||||
List<FileDirectoryDTO> fileDirectoryDTOList = new ArrayList<>();
|
||||
|
||||
fileDirectoryList.forEach(item -> {
|
||||
|
@ -33,6 +33,7 @@ import cn.lili.modules.store.entity.dos.Store;
|
||||
import cn.lili.modules.store.entity.vos.StoreVO;
|
||||
import cn.lili.modules.store.service.FreightTemplateService;
|
||||
import cn.lili.modules.store.service.StoreService;
|
||||
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
import cn.lili.modules.system.entity.dto.GoodsSetting;
|
||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
@ -165,6 +166,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SystemLogPoint(description = "添加商品", customerLog = "'新增商品名称:['+#goodsOperationDTO.goodsName+']'")
|
||||
public void addGoods(GoodsOperationDTO goodsOperationDTO) {
|
||||
Goods goods = new Goods(goodsOperationDTO);
|
||||
//检查商品
|
||||
@ -192,6 +194,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SystemLogPoint(description = "修改商品", customerLog = "'操作的商品ID:['+#goodsId+']'")
|
||||
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
||||
Goods goods = new Goods(goodsOperationDTO);
|
||||
goods.setId(goodsId);
|
||||
@ -290,6 +293,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "审核商品", customerLog = "'操作的商品ID:['+#goodsIds+']', '操作后商品状态:['+#goodsAuthEnum+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {
|
||||
List<String> goodsCacheKeys = new ArrayList<>();
|
||||
@ -312,6 +316,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SystemLogPoint(description = "商品状态操作", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#goodsIds+']', 操作原因:['+#underReason+']'")
|
||||
public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||
boolean result;
|
||||
|
||||
@ -343,6 +348,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
@SystemLogPoint(description = "店铺关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#storeId+']', 操作原因:['+#underReason+']'")
|
||||
public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||
|
||||
|
||||
@ -358,6 +364,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "管理员关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#goodsIds+']', 操作原因:['+#underReason+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||
boolean result;
|
||||
@ -386,6 +393,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SystemLogPoint(description = "删除商品", customerLog = "操作对象:['+#goodsIds+']'")
|
||||
public Boolean deleteGoods(List<String> goodsIds) {
|
||||
|
||||
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
||||
@ -432,6 +440,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "修改商品库存", customerLog = "操作的商品ID:['+#goodsId+']', 修改后的库存:['+#quantity+']'")
|
||||
public void updateStock(String goodsId, Integer quantity) {
|
||||
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
||||
|
@ -3,6 +3,7 @@ package cn.lili.modules.member.entity.dos;
|
||||
import cn.lili.common.enums.ClientTypeEnum;
|
||||
import cn.lili.common.security.sensitive.Sensitive;
|
||||
import cn.lili.common.security.sensitive.enums.SensitiveStrategy;
|
||||
import cn.lili.common.utils.CommonUtil;
|
||||
import cn.lili.mybatis.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -101,7 +102,7 @@ public class Member extends BaseEntity {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.mobile = mobile;
|
||||
this.nickName = "临时昵称";
|
||||
this.nickName = CommonUtil.getSpecialStr("用户");
|
||||
this.disabled = true;
|
||||
this.haveStore = false;
|
||||
this.sex = 0;
|
||||
|
@ -241,7 +241,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
public Member autoRegister(ConnectAuthUser authUser) {
|
||||
|
||||
if (CharSequenceUtil.isEmpty(authUser.getNickname())) {
|
||||
authUser.setNickname("临时昵称");
|
||||
authUser.setNickname(CommonUtil.getSpecialStr("用户"));
|
||||
}
|
||||
if (CharSequenceUtil.isEmpty(authUser.getAvatar())) {
|
||||
authUser.setAvatar("https://i.loli.net/2020/11/19/LyN6JF7zZRskdIe.png");
|
||||
@ -841,4 +841,5 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
throw new ServiceException(ResultCode.USER_EXIST);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package cn.lili.modules.order.aftersale.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
@ -22,10 +23,7 @@ import cn.lili.modules.order.aftersale.mapper.AfterSaleMapper;
|
||||
import cn.lili.modules.order.aftersale.service.AfterSaleService;
|
||||
import cn.lili.modules.order.order.entity.dos.Order;
|
||||
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderTypeEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.*;
|
||||
import cn.lili.modules.order.order.service.OrderItemService;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleRefundWayEnum;
|
||||
@ -217,7 +215,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.WAIT_REFUND;
|
||||
}
|
||||
} else {
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.PASS;
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.COMPLETE;
|
||||
}
|
||||
} else {
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.REFUSE;
|
||||
@ -461,8 +459,9 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
case APPLY: {
|
||||
// 买家申请售后时已经输入了订单售后数量,这里不需要(+x)处理
|
||||
orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() + afterSale.getNum());
|
||||
orderItem.setRefundPrice(CurrencyUtil.add(orderItem.getRefundPrice(), afterSale.getApplyRefundPrice()));
|
||||
//修改orderItem订单
|
||||
this.updateOrderItem(orderItem);
|
||||
this.updateOrderItem(orderItem, afterSale);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -471,8 +470,9 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
case BUYER_CANCEL:
|
||||
case SELLER_TERMINATION: {
|
||||
orderItem.setReturnGoodsNumber(orderItem.getReturnGoodsNumber() - afterSale.getNum());
|
||||
orderItem.setRefundPrice(CurrencyUtil.sub(orderItem.getRefundPrice(), afterSale.getApplyRefundPrice()));
|
||||
//修改orderItem订单
|
||||
this.updateOrderItem(orderItem);
|
||||
this.updateOrderItem(orderItem, afterSale);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -627,7 +627,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
* @return void
|
||||
* @author ftyy
|
||||
**/
|
||||
private void updateOrderItem(OrderItem orderItem) {
|
||||
private void updateOrderItem(OrderItem orderItem, AfterSale afterSale) {
|
||||
//订单状态不能为新订单,已失效订单或未申请订单才可以去修改订单信息
|
||||
OrderItemAfterSaleStatusEnum afterSaleTypeEnum = OrderItemAfterSaleStatusEnum.valueOf(orderItem.getAfterSaleStatus());
|
||||
switch (afterSaleTypeEnum) {
|
||||
@ -652,10 +652,27 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
default:
|
||||
break;
|
||||
}
|
||||
orderItemService.update(new LambdaUpdateWrapper<OrderItem>()
|
||||
|
||||
LambdaUpdateWrapper<OrderItem> lambdaUpdateWrapper = new LambdaUpdateWrapper<OrderItem>()
|
||||
.eq(OrderItem::getSn, orderItem.getSn())
|
||||
.set(OrderItem::getAfterSaleStatus, orderItem.getAfterSaleStatus())
|
||||
.set(OrderItem::getReturnGoodsNumber, orderItem.getReturnGoodsNumber()));
|
||||
.set(OrderItem::getReturnGoodsNumber, orderItem.getReturnGoodsNumber());
|
||||
|
||||
if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
|
||||
if (orderItem.getReturnGoodsNumber().equals(orderItem.getNum())) {
|
||||
lambdaUpdateWrapper.set(OrderItem::getIsRefund, RefundStatusEnum.ALL_REFUND.name());
|
||||
} else {
|
||||
lambdaUpdateWrapper.set(OrderItem::getIsRefund, RefundStatusEnum.PART_REFUND.name());
|
||||
}
|
||||
} else if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.APPLY.name())) {
|
||||
lambdaUpdateWrapper.set(OrderItem::getIsRefund, RefundStatusEnum.REFUNDING.name());
|
||||
} else if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.REFUSE.name()) ||
|
||||
afterSale.getServiceStatus().equals(AfterSaleStatusEnum.BUYER_CANCEL.name()) ||
|
||||
afterSale.getServiceStatus().equals(AfterSaleStatusEnum.SELLER_TERMINATION.name())) {
|
||||
lambdaUpdateWrapper.set(OrderItem::getIsRefund, RefundStatusEnum.NO_REFUND.name());
|
||||
}
|
||||
|
||||
orderItemService.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
}
|
@ -11,6 +11,7 @@ import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||
import cn.lili.modules.order.order.entity.enums.CommentStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderComplaintStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.RefundStatusEnum;
|
||||
import cn.lili.modules.promotion.entity.vos.PromotionSkuVO;
|
||||
import cn.lili.mybatis.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@ -115,6 +116,15 @@ public class OrderItem extends BaseEntity {
|
||||
@ApiModelProperty(value = "退货商品数量")
|
||||
private Integer returnGoodsNumber;
|
||||
|
||||
/**
|
||||
* @see cn.lili.modules.order.order.entity.enums.RefundStatusEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "退款状态")
|
||||
private String isRefund;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private Double refundPrice;
|
||||
|
||||
@ApiModelProperty(value = "已发货数量")
|
||||
private Integer deliverNumber;
|
||||
|
||||
@ -155,6 +165,13 @@ public class OrderItem extends BaseEntity {
|
||||
|
||||
}
|
||||
|
||||
public String getIsRefund() {
|
||||
if (isRefund == null) {
|
||||
return RefundStatusEnum.NO_REFUND.name();
|
||||
}
|
||||
return isRefund;
|
||||
}
|
||||
|
||||
public PriceDetailDTO getPriceDetailDTO() {
|
||||
return JSONUtil.toBean(priceDetail, PriceDetailDTO.class);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public enum OrderStatusEnum {
|
||||
* 虚拟订单需要核验商品
|
||||
*/
|
||||
TAKE("待核验"),
|
||||
CANCELLED("已取消");
|
||||
CANCELLED("已关闭");
|
||||
|
||||
private final String description;
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
package cn.lili.modules.order.order.entity.enums;
|
||||
|
||||
/**
|
||||
* 退款状态枚举
|
||||
*
|
||||
* @author Lele
|
||||
* @since 2024-1-5 10:59:22
|
||||
*/
|
||||
public enum RefundStatusEnum {
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
*/
|
||||
ALL_REFUND("全部退款"),
|
||||
PART_REFUND("部分退款"),
|
||||
NO_REFUND("未退款"),
|
||||
REFUNDING("退款中");
|
||||
|
||||
private final String description;
|
||||
|
||||
RefundStatusEnum(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String description() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -56,6 +56,14 @@ public class OrderItemVO {
|
||||
@ApiModelProperty(value = "评论状态:未评论(UNFINISHED),待追评(WAIT_CHASE),评论完成(FINISHED),")
|
||||
private String commentStatus;
|
||||
|
||||
/**
|
||||
* @see cn.lili.modules.order.order.entity.enums.RefundStatusEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "退款状态")
|
||||
private String isRefund;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private String refundPrice;
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
|
@ -142,6 +142,12 @@ public class OrderSimpleVO {
|
||||
@ApiModelProperty(value = "订单促销类型")
|
||||
private String orderPromotionType;
|
||||
|
||||
@ApiModelProperty(value = "是否退款")
|
||||
private String groupIsRefund;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private String groupRefundPrice;
|
||||
|
||||
public List<OrderItemVO> getOrderItems() {
|
||||
if (CharSequenceUtil.isEmpty(groupGoodsId)) {
|
||||
return new ArrayList<>();
|
||||
@ -188,6 +194,12 @@ public class OrderSimpleVO {
|
||||
if (CharSequenceUtil.isNotEmpty(groupGoodsPrice) && groupGoodsPrice.split(",").length == groupGoodsId.split(",").length) {
|
||||
orderItemVO.setGoodsPrice(Double.parseDouble(groupGoodsPrice.split(",")[i]));
|
||||
}
|
||||
if (CharSequenceUtil.isNotEmpty(groupIsRefund) && groupIsRefund.split(",").length == groupGoodsId.split(",").length) {
|
||||
orderItemVO.setIsRefund(groupIsRefund.split(",")[i]);
|
||||
}
|
||||
if (CharSequenceUtil.isNotEmpty(groupRefundPrice) && groupRefundPrice.split(",").length == groupGoodsId.split(",").length) {
|
||||
orderItemVO.setRefundPrice(groupRefundPrice.split(",")[i]);
|
||||
}
|
||||
return orderItemVO;
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,8 @@ public interface OrderMapper extends BaseMapper<Order> {
|
||||
",GROUP_CONCAT(oi.comment_status) as group_comment_status" +
|
||||
",GROUP_CONCAT(oi.sn) as group_order_items_sn " +
|
||||
",GROUP_CONCAT(oi.goods_price) as group_goods_price " +
|
||||
",GROUP_CONCAT(oi.is_refund) as group_is_refund " +
|
||||
",GROUP_CONCAT(oi.refund_price) as group_refund_price " +
|
||||
" FROM li_order o LEFT JOIN li_order_item AS oi on o.sn = oi.order_sn ${ew.customSqlSegment} ")
|
||||
IPage<OrderSimpleVO> queryByParams(IPage<OrderSimpleVO> page, @Param(Constants.WRAPPER) Wrapper<OrderSimpleVO> queryWrapper);
|
||||
|
||||
|
@ -33,6 +33,12 @@ public interface OrderItemService extends IService<OrderItem> {
|
||||
*/
|
||||
void updateAfterSaleStatus(String orderItemSn, OrderItemAfterSaleStatusEnum orderItemAfterSaleStatusEnum);
|
||||
|
||||
/**
|
||||
* 更新售后状态
|
||||
* @param orderItem
|
||||
*/
|
||||
void updateByAfterSale(OrderItem orderItem);
|
||||
|
||||
/**
|
||||
* 更新订单可投诉状态
|
||||
*
|
||||
|
@ -44,6 +44,15 @@ public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateByAfterSale(OrderItem orderItem) {
|
||||
LambdaUpdateWrapper<OrderItem> lambdaUpdateWrapper = new LambdaUpdateWrapper<OrderItem>()
|
||||
.eq(OrderItem::getSn, orderItem.getSn())
|
||||
.set(OrderItem::getIsRefund, orderItem.getIsRefund())
|
||||
.set(OrderItem::getRefundPrice, orderItem.getRefundPrice());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单可投诉状态
|
||||
*
|
||||
|
@ -26,6 +26,7 @@ import cn.lili.modules.promotion.service.SeckillApplyService;
|
||||
import cn.lili.modules.promotion.tools.PromotionTools;
|
||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -273,6 +274,7 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "更新促销活动商品库存", customerLog = "操作的skuId:['+#skuId+']', 修改后的库存:['+#quantity+']'")
|
||||
public void updatePromotionGoodsStock(String skuId, Integer quantity) {
|
||||
LambdaQueryWrapper<PromotionGoods> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PromotionGoods::getSkuId, skuId);
|
||||
|
@ -11,6 +11,7 @@ import cn.lili.modules.member.entity.dto.MemberAddDTO;
|
||||
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberVO;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -51,6 +52,7 @@ public class MemberManagerController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加会员")
|
||||
@SystemLogPoint(description = "添加会员", customerLog = "'新增会员名称: ['+#member.username+']'")
|
||||
@PostMapping
|
||||
public ResultMessage<Member> save(@Valid MemberAddDTO member) {
|
||||
|
||||
@ -59,6 +61,7 @@ public class MemberManagerController {
|
||||
|
||||
@DemoSite
|
||||
@PreventDuplicateSubmissions
|
||||
@SystemLogPoint(description = "修改会员信息", customerLog = "'修改的会员名称: ['+#managerMemberEditDTO.username+']'")
|
||||
@ApiOperation(value = "修改会员基本信息")
|
||||
@PutMapping
|
||||
public ResultMessage<Member> update(@Valid ManagerMemberEditDTO managerMemberEditDTO) {
|
||||
@ -67,6 +70,7 @@ public class MemberManagerController {
|
||||
|
||||
@DemoSite
|
||||
@PreventDuplicateSubmissions
|
||||
@SystemLogPoint(description = "修改会员状态", customerLog = "'修改的会员名称: ['+#memberIds+']', '是否开启: ['+#disabled+']'")
|
||||
@ApiOperation(value = "修改会员状态,开启关闭会员")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "memberIds", value = "会员ID", required = true, dataType = "String", allowMultiple = true, paramType = "query"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user