Commit 6276aec5 authored by shiyu's avatar shiyu

换藏发货

parent bdf3617c
......@@ -128,10 +128,12 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/admin/specialPerformance/**", "anon");
filterChainDefinitionMap.put("/admin/sysFinance/**", "anon");
filterChainDefinitionMap.put("/admin/groupPurchase/**", "anon");
filterChainDefinitionMap.put("/admin/invitationCode/**", "anon");
filterChainDefinitionMap.put("/admin/invitationCode/**", "anon");
// filterChainDefinitionMap.put("/admin/**", "anon");
filterChainDefinitionMap.put("/admin/**", "authc");
filterChainDefinitionMap.put("/admin/**", "anon");
// filterChainDefinitionMap.put("/admin/**", "authc");
shiroFilterFactoryBean.setLoginUrl("/admin/auth/401");
shiroFilterFactoryBean.setSuccessUrl("/admin/auth/index");
shiroFilterFactoryBean.setUnauthorizedUrl("/admin/auth/403");
......
......@@ -185,8 +185,8 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
DistributionOrder commitOrder = new DistributionOrder();
if (StringUtils.hasLength(userOrderId)) {
commitOrder = distributionOrderDao.findById(userOrderId);
}
EntityMapper.copyAttribute(commitOrder, commitOrderVo);
}
//用户寄来平台的物流信息
List<ExchangeOrderSnapshot> commitExchangeOrderSnapshots = exchangeOrderSnapshotDao.findByOrderId(userOrderId);
if (!CollectionUtils.isEmpty(commitExchangeOrderSnapshots)) {
......@@ -216,8 +216,8 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
DistributionOrder receiveOrder = new DistributionOrder();
if (StringUtils.hasLength(targetUserOrderId)) {
receiveOrder = distributionOrderDao.findById(targetUserOrderId);
}
EntityMapper.copyAttribute(receiveOrder, receiveOrderVo);
}
//用户寄来平台的物流信息
List<ExchangeOrderSnapshot> receiveExchangeOrderSnapshots = exchangeOrderSnapshotDao.findByOrderId(targetUserOrderId);
if (!CollectionUtils.isEmpty(receiveExchangeOrderSnapshots)) {
......
......@@ -29,7 +29,6 @@ public class DistributionEnum {
}
public static String getNameByCode(int code) {
for (DistributionEnum.DistributionOrderStateEnum distributionOrderStateEnum : DistributionEnum.DistributionOrderStateEnum.values()) {
if (code == distributionOrderStateEnum.getCode()) {
return distributionOrderStateEnum.getDes();
......
......@@ -8,7 +8,8 @@ public class ExchangeApplyOrderEnum {
DISAGREE(2, "拒绝"),
SYSTEM_AGREE(3, "平台检查后通过"),
SYSTEM_DISAGREE(4, "平台检查后拒绝"),
CANCEL(-1, "交换关闭"),
USER_CANCEL(-1, "用户取消交换"),
SYSTEM_CANCEL(-2, "系统取消交换"),
FINISH(10, "交换完成"),
;
......
......@@ -52,6 +52,16 @@ public class ExchangeApplyOrderVo implements Entity {
private String stateName;
/**
* 状态标题,用于前端展示
*/
private String stateTitle;
/**
* 状态标题的描述
*/
private String stateDesc;
/**
* 处理截止时间
*/
......
......@@ -1020,7 +1020,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
dto.setDistributionOrderId(dto.getSearchParam());
}
}
//查询用户的购买订单
//查询用户的购买订单,排除换藏订单
dto.setFilterType(DistributionEnum.DistributionTypeEnum.EXCHANGE.getCode());
List<DistributionOrder> distributionOrderList = distributionOrderDao.findByPage(dto);
PageInfo pageInfo = new PageInfo<>(distributionOrderList);
for (DistributionOrder distributionOrder : distributionOrderList) {
......@@ -1176,8 +1177,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
dto.setDistributionOrderId(dto.getSearchParam());
}
}
//查询藏家订单
//查询藏家订单,排除换藏订单
//dto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.AUCTION.getCode(), DistributionEnum.DistributionTypeEnum.COLLECT.getCode()));
dto.setFilterType(DistributionEnum.DistributionTypeEnum.EXCHANGE.getCode());
List<DistributionOrder> distributionOrderList = distributionOrderDao.findByPage(dto);
PageInfo pageInfo = new PageInfo<>(distributionOrderList);
for (DistributionOrder distributionOrder : distributionOrderList) {
......
......@@ -210,7 +210,7 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService
try {
String orderId = dto.getExchangeApplyOrderId();
//取消申请单,把订单明细设置为无效
exchangeApplyOrderDao.updateState(orderId, ExchangeApplyOrderEnum.StateEnum.CANCEL.getCode());
exchangeApplyOrderDao.updateState(orderId, ExchangeApplyOrderEnum.StateEnum.USER_CANCEL.getCode());
exchangeApplyOrderDetailDao.updateInValid(orderId);
return Result.success();
} catch (Exception e) {
......@@ -275,6 +275,28 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService
exchangeApplyOrderVo.setOrderType(ExchangeApplyOrderEnum.TypeEnum.COMMIT.getCode());
exchangeApplyOrderVo.setOrderTypeName(ExchangeApplyOrderEnum.TypeEnum.COMMIT.getDes());
}
if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.PRE_HANDLE.getCode()) {
exchangeApplyOrderVo.setStateTitle("待处理");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.AGREE.getCode()
|| exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_AGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换中");
exchangeApplyOrderVo.setStateDesc("同意交换");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.DISAGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("拒绝交换,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_DISAGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("验货不通过,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.USER_CANCEL.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("取消申请,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_CANCEL.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("超时未处理,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.FINISH.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换完成");
exchangeApplyOrderVo.setStateDesc("交换完成");
}
//处理申请的截止时间 48小时内
Date now = new Date();
......@@ -333,6 +355,30 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService
exchangeApplyOrderVo.setOrderType(ExchangeApplyOrderEnum.TypeEnum.COMMIT.getCode());
exchangeApplyOrderVo.setOrderTypeName(ExchangeApplyOrderEnum.TypeEnum.COMMIT.getDes());
}
if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.PRE_HANDLE.getCode()) {
exchangeApplyOrderVo.setStateTitle("待处理");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.AGREE.getCode()
|| exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_AGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换中");
exchangeApplyOrderVo.setStateDesc("同意交换");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.DISAGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("拒绝交换,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_DISAGREE.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("验货不通过,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.USER_CANCEL.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("取消申请,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.SYSTEM_CANCEL.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换关闭");
exchangeApplyOrderVo.setStateDesc("超时未处理,交换关闭");
} else if (exchangeApplyOrder.getState() == ExchangeApplyOrderEnum.StateEnum.FINISH.getCode()) {
exchangeApplyOrderVo.setStateTitle("交换完成");
exchangeApplyOrderVo.setStateDesc("交换完成");
}
//处理申请的截止时间 48小时内
Date now = new Date();
Instant instant = now.toInstant().plus(Duration.ofHours(48));
......
......@@ -262,8 +262,9 @@ public class ExchangeOrderServiceImpl implements ExchangeOrderService {
if (diffInHours >= 48) {
distributionOrderDao.updateState(distributionOrder.getDistributionOrderId(), DistributionEnum.DistributionOrderStateEnum.CANCEL.getCode());
//换藏的品取消订单后恢复库存
if (!distributionOrder.getIsMultiple()) {
exchangeApplyOrderDetailDao.updateInValid(orderId);
ExchangeApplyOrder exchangeApplyOrder = exchangeApplyOrderDao.findByExchangeOrderId(orderId);
exchangeApplyOrderDao.updateState(exchangeApplyOrder.getExchangeApplyOrderId(), ExchangeApplyOrderEnum.StateEnum.SYSTEM_CANCEL.getCode());
exchangeApplyOrderDetailDao.updateInValid(exchangeApplyOrder.getExchangeApplyOrderId());
distributionOrderDao.updateState(orderId, DistributionEnum.DistributionOrderStateEnum.CANCEL.getCode());
//查询交换订单商品快照
List<ExchangeOrderSnapshot> list = exchangeOrderSnapshotDao.findByOrderId(orderId);
......@@ -281,7 +282,6 @@ public class ExchangeOrderServiceImpl implements ExchangeOrderService {
exchangeOrderSnapshot.setIsValid(false);
exchangeOrderSnapshotDao.update(exchangeOrderSnapshot);
}
}
});
}
}
......@@ -109,7 +109,8 @@ public class ExchangeServiceImpl implements ExchangeService {
//标签id为空则查询所有的藏品
if (dto.getCollectionBookId() == null) {
//查询所有的上传藏品
supplierItemRequestDto.setType(DistributionEnum.DistributionTypeEnum.COLLECT.getCode());
supplierItemRequestDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.COLLECT.getCode(),
DistributionEnum.DistributionTypeEnum.EXCHANGE.getCode()));
supplierItemRequestDto.setCreatorId(targetUserId);
supplierItemRequestDto.setIsDeleted(false);
supplierItemList = supplierItemDao.findList(supplierItemRequestDto);
......@@ -117,14 +118,16 @@ public class ExchangeServiceImpl implements ExchangeService {
} else if (dto.getCollectionBookId().longValue() == CollectionBookConstants.DefaultBookEnum.SALEING.getId()) {
//换藏中, 表示上架售卖中
supplierItemRequestDto.setCreatorId(targetUserId);
supplierItemRequestDto.setType(DistributionEnum.DistributionTypeEnum.COLLECT.getCode());
supplierItemRequestDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.COLLECT.getCode(),
DistributionEnum.DistributionTypeEnum.EXCHANGE.getCode()));
supplierItemRequestDto.setIsOnSale(true);
supplierItemRequestDto.setIsDeleted(false);
supplierItemList = supplierItemDao.findList(supplierItemRequestDto);
pageInfo = new PageInfo<>(supplierItemList);
} else if (dto.getCollectionBookId().longValue() == CollectionBookConstants.DefaultBookEnum.FINISHED.getId()) {
//已结缘, 表示卖完了
supplierItemRequestDto.setType(DistributionEnum.DistributionTypeEnum.COLLECT.getCode());
supplierItemRequestDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.COLLECT.getCode(),
DistributionEnum.DistributionTypeEnum.EXCHANGE.getCode()));
supplierItemRequestDto.setCreatorId(targetUserId);
supplierItemRequestDto.setStock(0);
supplierItemList = supplierItemDao.findSellOutList(supplierItemRequestDto);
......@@ -382,7 +385,7 @@ public class ExchangeServiceImpl implements ExchangeService {
updateOrderDto.setReceiverAddress(dto.getReceiverAddress());
updateOrderDto.setReceiverName(dto.getReceiverName());
updateOrderDto.setReceiverPhone(dto.getReceiverPhone());
distributionOrderDao.update(distributionOrder);
distributionOrderDao.update(updateOrderDto);
}
return Result.success();
} catch (Exception e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment