Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
6e91c41c
提交
6e91c41c
authored
4月 27, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 零零碎碎的
- 退货申请,物流信息
上级
6e92e716
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
221 行增加
和
81 行删除
+221
-81
OrderLogisticsController.java
...pplication/controller/users/OrderLogisticsController.java
+13
-7
OrderLogisticsService.java
...java/cn/iocoder/mall/order/api/OrderLogisticsService.java
+22
-5
OrderReturnService.java
...in/java/cn/iocoder/mall/order/api/OrderReturnService.java
+2
-1
OrderLogisticsInfoBO.java
...va/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java
+29
-47
OrderReturnInfoBO.java
.../java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java
+8
-0
OrderErrorCodeEnum.java
...n/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java
+1
-0
OrderLogisticsConvert.java
...iocoder/mall/order/biz/convert/OrderLogisticsConvert.java
+21
-3
OrderLogisticsDetailConvert.java
...r/mall/order/biz/convert/OrderLogisticsDetailConvert.java
+1
-4
OrderLogisticsDetailMapper.java
...ocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java
+11
-1
OrderLogisticsMapper.java
...a/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java
+10
-0
OrderReturnDO.java
...a/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java
+4
-0
OrderLogisticsServiceImpl.java
...der/mall/order/biz/service/OrderLogisticsServiceImpl.java
+47
-7
OrderReturnServiceImpl.java
...ocoder/mall/order/biz/service/OrderReturnServiceImpl.java
+19
-2
OrderServiceImpl.java
...a/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
+1
-1
OrderLogisticsDetailMapper.xml
.../src/main/resources/mapper/OrderLogisticsDetailMapper.xml
+14
-1
OrderLogisticsMapper.xml
...e-impl/src/main/resources/mapper/OrderLogisticsMapper.xml
+12
-0
OrderReturnMapper.xml
...vice-impl/src/main/resources/mapper/OrderReturnMapper.xml
+6
-2
没有找到文件。
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderLogisticsController.java
浏览文件 @
6e91c41c
...
@@ -6,6 +6,7 @@ import cn.iocoder.mall.admin.api.DataDictService;
...
@@ -6,6 +6,7 @@ import cn.iocoder.mall.admin.api.DataDictService;
import
cn.iocoder.mall.admin.api.bo.DataDictBO
;
import
cn.iocoder.mall.admin.api.bo.DataDictBO
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO
;
import
cn.iocoder.mall.order.api.constant.DictKeyConstants
;
import
cn.iocoder.mall.order.api.constant.DictKeyConstants
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
...
@@ -39,14 +40,20 @@ public class OrderLogisticsController {
...
@@ -39,14 +40,20 @@ public class OrderLogisticsController {
@Reference
(
validation
=
"true"
)
@Reference
(
validation
=
"true"
)
private
DataDictService
dataDictService
;
private
DataDictService
dataDictService
;
@GetMapping
(
"logistics_info"
)
@GetMapping
(
"info"
)
@ApiOperation
(
"物流详细 - 返回订单所关联的所有物流信息"
)
@ApiOperation
(
"物流详细 - 物流通用"
)
public
CommonResult
<
OrderLogisticsInfoBO
>
logisticsInfo
(
@RequestParam
(
"orderId"
)
Integer
orderId
)
{
public
CommonResult
<
OrderLogisticsInfoBO
>
logistics
(
@RequestParam
(
"logisticsId"
)
Integer
logisticsId
)
{
return
orderLogisticsService
.
getLogisticsInfo
(
logisticsId
);
}
@GetMapping
(
"info_order"
)
@ApiOperation
(
"物流详细 - 返回订单所关联的所有物流信息(订单用的)"
)
public
CommonResult
<
OrderLogisticsInfoWithOrderBO
>
logisticsInfoWithOrder
(
@RequestParam
(
"orderId"
)
Integer
orderId
)
{
Integer
userId
=
UserSecurityContextHolder
.
getContext
().
getUserId
();
Integer
userId
=
UserSecurityContextHolder
.
getContext
().
getUserId
();
CommonResult
<
OrderLogisticsInfo
BO
>
commonResult
=
orderLogisticsService
.
l
ogisticsInfo
(
userId
,
orderId
);
CommonResult
<
OrderLogisticsInfo
WithOrderBO
>
commonResult
=
orderLogisticsService
.
getOrderL
ogisticsInfo
(
userId
,
orderId
);
if
(
commonResult
.
isSuccess
())
{
if
(
commonResult
.
isSuccess
())
{
OrderLogisticsInfoBO
orderLogisticsInfoBO
=
commonResult
.
getData
();
OrderLogisticsInfo
WithOrder
BO
orderLogisticsInfoBO
=
commonResult
.
getData
();
List
<
OrderLogisticsInfoBO
.
Logistics
>
logisticsList
=
orderLogisticsInfoBO
.
getLogistics
();
List
<
OrderLogisticsInfo
WithOrder
BO
.
Logistics
>
logisticsList
=
orderLogisticsInfoBO
.
getLogistics
();
// 获取字典值
// 获取字典值
Set
<
Integer
>
dictValues
=
logisticsList
.
stream
().
map
(
o
->
o
.
getLogistics
()).
collect
(
Collectors
.
toSet
());
Set
<
Integer
>
dictValues
=
logisticsList
.
stream
().
map
(
o
->
o
.
getLogistics
()).
collect
(
Collectors
.
toSet
());
...
@@ -72,7 +79,6 @@ public class OrderLogisticsController {
...
@@ -72,7 +79,6 @@ public class OrderLogisticsController {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
}
}
return
commonResult
;
return
commonResult
;
}
}
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderLogisticsService.java
浏览文件 @
6e91c41c
package
cn
.
iocoder
.
mall
.
order
.
api
;
package
cn
.
iocoder
.
mall
.
order
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.bo.OrderL
ogistics
BO
;
import
cn.iocoder.mall.order.api.bo.OrderL
astLogisticsInfo
BO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO
;
import
java.util.List
;
/**
/**
* 订单物流信息
* 订单物流信息
...
@@ -14,13 +13,31 @@ import java.util.List;
...
@@ -14,13 +13,31 @@ import java.util.List;
*/
*/
public
interface
OrderLogisticsService
{
public
interface
OrderLogisticsService
{
/**
* 获取物流信息 - 根据id
*
* @param id
* @return
*/
CommonResult
<
OrderLogisticsInfoBO
>
getLogisticsInfo
(
Integer
id
);
/**
* 获取 last 物流信息 - 根据id
*
* @param id
* @return
*/
CommonResult
<
OrderLastLogisticsInfoBO
>
getLastLogisticsInfo
(
Integer
id
);
/**
/**
*
物流信息
*
获取物流信息 - 根据 orderId
*
*
* @param userId
* @param userId
* @param orderId
* @param orderId
* @return
* @return
*/
*/
CommonResult
<
OrderLogisticsInfo
BO
>
l
ogisticsInfo
(
Integer
userId
,
Integer
orderId
);
CommonResult
<
OrderLogisticsInfo
WithOrderBO
>
getOrderL
ogisticsInfo
(
Integer
userId
,
Integer
orderId
);
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java
浏览文件 @
6e91c41c
package
cn
.
iocoder
.
mall
.
order
.
api
;
package
cn
.
iocoder
.
mall
.
order
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.bo.OrderReturnInfoBO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
/**
/**
...
@@ -38,5 +39,5 @@ public interface OrderReturnService {
...
@@ -38,5 +39,5 @@ public interface OrderReturnService {
* @param orderId
* @param orderId
* @return
* @return
*/
*/
CommonResult
orderApplyInfo
(
Integer
orderId
);
CommonResult
<
OrderReturnInfoBO
>
orderApplyInfo
(
Integer
orderId
);
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderLogisticsInfoBO.java
浏览文件 @
6e91c41c
...
@@ -18,60 +18,42 @@ import java.util.List;
...
@@ -18,60 +18,42 @@ import java.util.List;
public
class
OrderLogisticsInfoBO
implements
Serializable
{
public
class
OrderLogisticsInfoBO
implements
Serializable
{
/**
/**
*
订单
id
* id
*/
*/
private
Integer
orderI
d
;
private
Integer
i
d
;
/**
/**
*
订单
编号
*
收件区域
编号
*/
*/
private
String
order
No
;
private
String
area
No
;
/**
/**
*
物流信息
*
收件人名称
*/
*/
private
List
<
Logistics
>
logistics
;
private
String
name
;
/**
@Data
* 收件手机号
@Accessors
(
chain
=
true
)
*/
public
static
class
Logistics
{
private
String
mobile
;
/**
/**
* 收件详细地址
* id
*/
*/
private
String
address
;
private
Integer
id
;
/**
/**
* 物流 (字典)
* 收件区域编号
*/
*/
private
Integer
logistics
;
private
String
areaNo
;
/**
/**
* 物流 (字典) 转换后的值
* 收件人名称
*/
*/
private
String
logisticsText
;
private
String
name
;
/**
/**
* 物流编号
* 收件手机号
*/
*/
private
String
logisticsNo
;
private
String
mobile
;
/**
* 收件详细地址
*/
private
String
address
;
/**
* 物流 (字典)
*/
private
Integer
logistics
;
/**
* 物流 (字典) 转换后的值
*/
private
String
logisticsText
;
/**
* 物流编号
*/
private
String
logisticsNo
;
///
///
/// 物流信息
/// 物流信息
private
List
<
LogisticsDetail
>
details
;
private
List
<
LogisticsDetail
>
details
;
}
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderReturnInfoBO.java
浏览文件 @
6e91c41c
...
@@ -25,6 +25,10 @@ public class OrderReturnInfoBO implements Serializable {
...
@@ -25,6 +25,10 @@ public class OrderReturnInfoBO implements Serializable {
* 订单 item
* 订单 item
*/
*/
private
List
<
OrderItem
>
orderItems
;
private
List
<
OrderItem
>
orderItems
;
/**
* 最后一个物流信息/最新物流信息
*/
private
OrderLastLogisticsInfoBO
lastLogisticsInfo
;
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
...
@@ -80,6 +84,10 @@ public class OrderReturnInfoBO implements Serializable {
...
@@ -80,6 +84,10 @@ public class OrderReturnInfoBO implements Serializable {
///
///
/// 退货原因
/// 退货原因
/**
* 退货金额
*/
private
Integer
refundPrice
;
/**
/**
* 退货原因(字典值)
* 退货原因(字典值)
*/
*/
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderErrorCodeEnum.java
浏览文件 @
6e91c41c
...
@@ -42,6 +42,7 @@ public enum OrderErrorCodeEnum {
...
@@ -42,6 +42,7 @@ public enum OrderErrorCodeEnum {
// 工具类服务 1008004000
// 工具类服务 1008004000
DICT_SERVER_INVOKING_FAIL
(
1008004000
,
"字典服务调用失败!"
),
DICT_SERVER_INVOKING_FAIL
(
1008004000
,
"字典服务调用失败!"
),
ORDER_LOGISTICS_INVOKING_FAIL
(
1008004001
,
"订单物流调用失败!"
),
;
;
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsConvert.java
浏览文件 @
6e91c41c
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
import
cn.iocoder.mall.order.api.bo.OrderL
ogistics
BO
;
import
cn.iocoder.mall.order.api.bo.OrderL
astLogisticsInfo
BO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.
dto.OrderCreateDT
O
;
import
cn.iocoder.mall.order.api.
bo.OrderLogisticsInfoWithOrderB
O
;
import
cn.iocoder.mall.order.api.dto.OrderDeliveryDTO
;
import
cn.iocoder.mall.order.api.dto.OrderDeliveryDTO
;
import
cn.iocoder.mall.order.api.dto.OrderLogisticsUpdateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderLogisticsUpdateDTO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.Named
;
import
org.mapstruct.factory.Mappers
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
import
java.util.List
;
...
@@ -34,5 +36,21 @@ public interface OrderLogisticsConvert {
...
@@ -34,5 +36,21 @@ public interface OrderLogisticsConvert {
OrderLogisticsDO
convert
(
OrderRecipientDO
orderRecipientDO
);
OrderLogisticsDO
convert
(
OrderRecipientDO
orderRecipientDO
);
@Mappings
({})
@Mappings
({})
List
<
OrderLogisticsInfoBO
.
Logistics
>
convertLogistics
(
List
<
OrderLogisticsDO
>
orderLogisticsDOList
);
List
<
OrderLogisticsInfoWithOrderBO
.
Logistics
>
convertLogistics
(
List
<
OrderLogisticsDO
>
orderLogisticsDOList
);
@Mappings
({})
List
<
OrderLogisticsInfoWithOrderBO
.
LogisticsDetail
>
convertLogisticsDetail
(
List
<
OrderLogisticsDetailDO
>
orderLogisticsDOList
);
@Mappings
({})
OrderLogisticsInfoBO
convert
(
OrderLogisticsDO
orderLogisticsDO
);
@Mappings
({})
List
<
OrderLogisticsInfoBO
.
LogisticsDetail
>
convert
(
List
<
OrderLogisticsDetailDO
>
orderLogisticsDetailDOList
);
@Mappings
({})
@Named
(
value
=
"orderLastLogisticsInfoBO"
)
OrderLastLogisticsInfoBO
convertOrderLastLogisticsInfoBO
(
OrderLogisticsDO
orderLogisticsDO
);
@Mappings
({})
OrderLastLogisticsInfoBO
.
LogisticsDetail
convertLastLogisticsDetail
(
OrderLogisticsDetailDO
orderLogisticsDetailDO
);
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderLogisticsDetailConvert.java
浏览文件 @
6e91c41c
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
import
cn.iocoder.mall.order.api.bo.OrderInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfo
WithOrder
BO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.Mappings
;
...
@@ -20,9 +20,6 @@ public interface OrderLogisticsDetailConvert {
...
@@ -20,9 +20,6 @@ public interface OrderLogisticsDetailConvert {
OrderLogisticsDetailConvert
INSTANCE
=
Mappers
.
getMapper
(
OrderLogisticsDetailConvert
.
class
);
OrderLogisticsDetailConvert
INSTANCE
=
Mappers
.
getMapper
(
OrderLogisticsDetailConvert
.
class
);
@Mappings
({})
List
<
OrderLogisticsInfoBO
.
LogisticsDetail
>
convertLogisticsDetail
(
List
<
OrderLogisticsDetailDO
>
orderLogisticsDOList
);
@Mappings
({})
@Mappings
({})
OrderInfoBO
.
LogisticsDetail
convertLogisticsDetail
(
OrderLogisticsDetailDO
orderLogisticsDetailDO
);
OrderInfoBO
.
LogisticsDetail
convertLogisticsDetail
(
OrderLogisticsDetailDO
orderLogisticsDetailDO
);
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsDetailMapper.java
浏览文件 @
6e91c41c
...
@@ -50,7 +50,17 @@ public interface OrderLogisticsDetailMapper {
...
@@ -50,7 +50,17 @@ public interface OrderLogisticsDetailMapper {
* @param orderLogisticsIds
* @param orderLogisticsIds
* @return
* @return
*/
*/
OrderLogisticsDetailDO
selectLa
te
st
(
OrderLogisticsDetailDO
selectLast
(
@Param
(
"orderLogisticsIds"
)
Collection
<
Integer
>
orderLogisticsIds
@Param
(
"orderLogisticsIds"
)
Collection
<
Integer
>
orderLogisticsIds
);
);
/**
* 查询 - 根据 last 根据物理id
*
* @param orderLogisticsId
* @return
*/
OrderLogisticsDetailDO
selectLastByLogisticsId
(
@Param
(
"orderLogisticsId"
)
Integer
orderLogisticsId
);
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderLogisticsMapper.java
浏览文件 @
6e91c41c
...
@@ -30,6 +30,16 @@ public interface OrderLogisticsMapper {
...
@@ -30,6 +30,16 @@ public interface OrderLogisticsMapper {
*/
*/
void
updateById
(
OrderLogisticsDO
orderLogisticsDO
);
void
updateById
(
OrderLogisticsDO
orderLogisticsDO
);
/**
* 查询 - 根据 ids
*
* @param id
* @return
*/
OrderLogisticsDO
selectById
(
@Param
(
"id"
)
Integer
id
);
/**
/**
* 查询 - 根据 ids
* 查询 - 根据 ids
*
*
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java
浏览文件 @
6e91c41c
...
@@ -41,6 +41,10 @@ public class OrderReturnDO extends BaseDO {
...
@@ -41,6 +41,10 @@ public class OrderReturnDO extends BaseDO {
///
///
/// 退货原因
/// 退货原因
/**
* 退货金额
*/
private
Integer
refundPrice
;
/**
/**
* 退货原因(字典值)
* 退货原因(字典值)
*
*
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderLogisticsServiceImpl.java
浏览文件 @
6e91c41c
package
cn
.
iocoder
.
mall
.
order
.
biz
.
service
;
package
cn
.
iocoder
.
mall
.
order
.
biz
.
service
;
import
cn.iocoder.common.framework.constant.DeletedStatusEnum
;
import
cn.iocoder.common.framework.constant.DeletedStatusEnum
;
import
cn.iocoder.common.framework.util.CollectionUtil
;
import
cn.iocoder.common.framework.util.DateUtil
;
import
cn.iocoder.common.framework.util.DateUtil
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.biz.convert.OrderLogisticsConvert
;
import
cn.iocoder.mall.order.biz.convert.OrderLogisticsConvert
;
import
cn.iocoder.mall.order.biz.convert.OrderLogisticsDetailConvert
;
import
cn.iocoder.mall.order.biz.convert.OrderLogisticsDetailConvert
;
...
@@ -46,7 +47,46 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
...
@@ -46,7 +47,46 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
private
OrderLogisticsDetailMapper
orderLogisticsDetailMapper
;
private
OrderLogisticsDetailMapper
orderLogisticsDetailMapper
;
@Override
@Override
public
CommonResult
<
OrderLogisticsInfoBO
>
logisticsInfo
(
Integer
userId
,
Integer
orderId
)
{
public
CommonResult
<
OrderLogisticsInfoBO
>
getLogisticsInfo
(
Integer
id
)
{
OrderLogisticsDO
orderLogisticsDO
=
orderLogisticsMapper
.
selectById
(
id
);
if
(
orderLogisticsDO
==
null
)
{
return
CommonResult
.
success
(
null
);
}
List
<
OrderLogisticsDetailDO
>
orderLogisticsDetailDOList
=
orderLogisticsDetailMapper
.
selectByOrderLogisticsId
(
orderLogisticsDO
.
getId
());
// 转换数据结构
List
<
OrderLogisticsInfoBO
.
LogisticsDetail
>
logisticsDetails
=
OrderLogisticsConvert
.
INSTANCE
.
convert
(
orderLogisticsDetailDOList
);
OrderLogisticsInfoBO
orderLogisticsInfo2BO
=
OrderLogisticsConvert
.
INSTANCE
.
convert
(
orderLogisticsDO
);
orderLogisticsInfo2BO
.
setDetails
(
logisticsDetails
);
return
CommonResult
.
success
(
orderLogisticsInfo2BO
);
}
@Override
public
CommonResult
<
OrderLastLogisticsInfoBO
>
getLastLogisticsInfo
(
Integer
id
)
{
OrderLogisticsDO
orderLogisticsDO
=
orderLogisticsMapper
.
selectById
(
id
);
if
(
orderLogisticsDO
==
null
)
{
return
CommonResult
.
success
(
null
);
}
OrderLogisticsDetailDO
orderLastLogisticsDetailDO
=
orderLogisticsDetailMapper
.
selectLastByLogisticsId
(
id
);
// 转换数据结构
OrderLastLogisticsInfoBO
.
LogisticsDetail
lastLogisticsDetail
=
OrderLogisticsConvert
.
INSTANCE
.
convertLastLogisticsDetail
(
orderLastLogisticsDetailDO
);
OrderLastLogisticsInfoBO
lastLogisticsInfoBO
=
OrderLogisticsConvert
.
INSTANCE
.
convertOrderLastLogisticsInfoBO
(
orderLogisticsDO
);
lastLogisticsInfoBO
.
setLastLogisticsDetail
(
lastLogisticsDetail
);
return
CommonResult
.
success
(
lastLogisticsInfoBO
);
}
@Override
public
CommonResult
<
OrderLogisticsInfoWithOrderBO
>
getOrderLogisticsInfo
(
Integer
userId
,
Integer
orderId
)
{
OrderDO
orderDO
=
orderMapper
.
selectById
(
orderId
);
OrderDO
orderDO
=
orderMapper
.
selectById
(
orderId
);
if
(
orderDO
==
null
)
{
if
(
orderDO
==
null
)
{
...
@@ -75,18 +115,18 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
...
@@ -75,18 +115,18 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
}
}
// 转换 return 的数据
// 转换 return 的数据
List
<
OrderLogisticsInfoBO
.
Logistics
>
logistics
List
<
OrderLogisticsInfo
WithOrder
BO
.
Logistics
>
logistics
=
OrderLogisticsConvert
.
INSTANCE
.
convertLogistics
(
orderLogisticsDOList
);
=
OrderLogisticsConvert
.
INSTANCE
.
convertLogistics
(
orderLogisticsDOList
);
List
<
OrderLogisticsInfoBO
.
LogisticsDetail
>
logisticsDetails
List
<
OrderLogisticsInfo
WithOrder
BO
.
LogisticsDetail
>
logisticsDetails
=
OrderLogistics
Detail
Convert
.
INSTANCE
.
convertLogisticsDetail
(
orderLogisticsDetailDOList
);
=
OrderLogisticsConvert
.
INSTANCE
.
convertLogisticsDetail
(
orderLogisticsDetailDOList
);
logisticsDetails
.
stream
().
map
(
o
->
{
logisticsDetails
.
stream
().
map
(
o
->
{
o
.
setLogisticsTimeText
(
DateUtil
.
format
(
o
.
getLogisticsTime
(),
"yyyy-MM-dd HH:mm"
));
o
.
setLogisticsTimeText
(
DateUtil
.
format
(
o
.
getLogisticsTime
(),
"yyyy-MM-dd HH:mm"
));
return
o
;
return
o
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
OrderLogisticsInfoBO
.
LogisticsDetail
>>
logisticsDetailMultimap
Map
<
Integer
,
List
<
OrderLogisticsInfo
WithOrder
BO
.
LogisticsDetail
>>
logisticsDetailMultimap
=
logisticsDetails
.
stream
().
collect
(
=
logisticsDetails
.
stream
().
collect
(
Collectors
.
toMap
(
Collectors
.
toMap
(
o
->
o
.
getOrderLogisticsId
(),
o
->
o
.
getOrderLogisticsId
(),
...
@@ -106,7 +146,7 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
...
@@ -106,7 +146,7 @@ public class OrderLogisticsServiceImpl implements OrderLogisticsService {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
CommonResult
.
success
(
return
CommonResult
.
success
(
new
OrderLogisticsInfoBO
()
new
OrderLogisticsInfo
WithOrder
BO
()
.
setOrderId
(
orderId
)
.
setOrderId
(
orderId
)
.
setOrderNo
(
orderDO
.
getOrderNo
())
.
setOrderNo
(
orderDO
.
getOrderNo
())
.
setLogistics
(
logistics
)
.
setLogistics
(
logistics
)
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java
浏览文件 @
6e91c41c
...
@@ -4,18 +4,22 @@ import cn.iocoder.common.framework.constant.DeletedStatusEnum;
...
@@ -4,18 +4,22 @@ import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import
cn.iocoder.common.framework.exception.ServiceException
;
import
cn.iocoder.common.framework.exception.ServiceException
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.OrderReturnService
;
import
cn.iocoder.mall.order.api.OrderReturnService
;
import
cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnInfoBO
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum
;
import
cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
import
cn.iocoder.mall.order.biz.convert.OrderReturnConvert
;
import
cn.iocoder.mall.order.biz.convert.OrderReturnConvert
;
import
cn.iocoder.mall.order.biz.dao.OrderItemMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderItemMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderLogisticsMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderReturnMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderReturnMapper
;
import
cn.iocoder.mall.order.biz.dataobject.OrderDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderItemDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderItemDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderReturnDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderReturnDO
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -41,6 +45,9 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -41,6 +45,9 @@ public class OrderReturnServiceImpl implements OrderReturnService {
@Autowired
@Autowired
private
OrderReturnMapper
orderReturnMapper
;
private
OrderReturnMapper
orderReturnMapper
;
@Reference
(
validation
=
"true"
)
private
OrderLogisticsService
orderLogisticsService
;
@Override
@Override
public
CommonResult
orderReturnApply
(
OrderReturnApplyDTO
orderReturnDTO
)
{
public
CommonResult
orderReturnApply
(
OrderReturnApplyDTO
orderReturnDTO
)
{
OrderDO
checkOrder
=
orderMapper
.
selectById
(
orderReturnDTO
.
getOrderId
());
OrderDO
checkOrder
=
orderMapper
.
selectById
(
orderReturnDTO
.
getOrderId
());
...
@@ -71,7 +78,7 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -71,7 +78,7 @@ public class OrderReturnServiceImpl implements OrderReturnService {
}
}
@Override
@Override
public
CommonResult
orderApplyInfo
(
Integer
orderId
)
{
public
CommonResult
<
OrderReturnInfoBO
>
orderApplyInfo
(
Integer
orderId
)
{
// 检查订单是否退货
// 检查订单是否退货
OrderReturnDO
orderReturnDO
=
orderReturnMapper
.
selectByOrderId
(
orderId
);
OrderReturnDO
orderReturnDO
=
orderReturnMapper
.
selectByOrderId
(
orderId
);
...
@@ -91,9 +98,19 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -91,9 +98,19 @@ public class OrderReturnServiceImpl implements OrderReturnService {
OrderReturnInfoBO
.
ReturnInfo
returnInfo
=
OrderReturnConvert
.
INSTANCE
.
convert
(
orderReturnDO
);
OrderReturnInfoBO
.
ReturnInfo
returnInfo
=
OrderReturnConvert
.
INSTANCE
.
convert
(
orderReturnDO
);
List
<
OrderReturnInfoBO
.
OrderItem
>
itemList
=
OrderReturnConvert
.
INSTANCE
.
convert
(
orderItemDOList
);
List
<
OrderReturnInfoBO
.
OrderItem
>
itemList
=
OrderReturnConvert
.
INSTANCE
.
convert
(
orderItemDOList
);
// 物流信息
CommonResult
<
OrderLastLogisticsInfoBO
>
lastLogisticsCommonResult
=
orderLogisticsService
.
getLastLogisticsInfo
(
orderReturnDO
.
getOrderLogisticsId
());
if
(
lastLogisticsCommonResult
.
isError
())
{
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
ORDER_LOGISTICS_INVOKING_FAIL
.
getCode
());
}
OrderLastLogisticsInfoBO
lastLogisticsInfoBO
=
lastLogisticsCommonResult
.
getData
();
OrderReturnInfoBO
orderReturnInfoBO
=
new
OrderReturnInfoBO
()
OrderReturnInfoBO
orderReturnInfoBO
=
new
OrderReturnInfoBO
()
.
setOrderItems
(
itemList
)
.
setOrderItems
(
itemList
)
.
setReturnInfo
(
returnInfo
);
.
setReturnInfo
(
returnInfo
)
.
setLastLogisticsInfo
(
lastLogisticsInfoBO
);
return
CommonResult
.
success
(
orderReturnInfoBO
);
return
CommonResult
.
success
(
orderReturnInfoBO
);
}
}
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
浏览文件 @
6e91c41c
...
@@ -184,7 +184,7 @@ public class OrderServiceImpl implements OrderService {
...
@@ -184,7 +184,7 @@ public class OrderServiceImpl implements OrderService {
// 订单物流信息
// 订单物流信息
OrderLogisticsDetailDO
orderLogisticsDetailDO
=
null
;
OrderLogisticsDetailDO
orderLogisticsDetailDO
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
orderLogisticsIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
orderLogisticsIds
))
{
orderLogisticsDetailDO
=
orderLogisticsDetailMapper
.
selectLa
te
st
(
orderLogisticsIds
);
orderLogisticsDetailDO
=
orderLogisticsDetailMapper
.
selectLast
(
orderLogisticsIds
);
}
}
// 检查是否申请退货
// 检查是否申请退货
...
...
order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml
浏览文件 @
6e91c41c
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<!--
<!--
查询 - 最新的物流信息
查询 - 最新的物流信息
-->
-->
<select
id=
"selectLa
te
st"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO"
>
<select
id=
"selectLast"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO"
>
SELECT
SELECT
<include
refid=
"FIELDS"
/>
<include
refid=
"FIELDS"
/>
FROM order_logistics_detail
FROM order_logistics_detail
...
@@ -61,4 +61,17 @@
...
@@ -61,4 +61,17 @@
ORDER BY create_time DESC
ORDER BY create_time DESC
LIMIT 0, 1
LIMIT 0, 1
</select>
</select>
<!--
查询 - 根据 last 根据物理id
-->
<select
id=
"selectLastByLogisticsId"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM order_logistics_detail
WHERE order_logistics_id = #{orderLogisticsId}
ORDER BY create_time DESC
LIMIT 1
</select>
</mapper>
</mapper>
order/order-service-impl/src/main/resources/mapper/OrderLogisticsMapper.xml
浏览文件 @
6e91c41c
...
@@ -66,4 +66,15 @@
...
@@ -66,4 +66,15 @@
#{id}
#{id}
</foreach>
</foreach>
</select>
</select>
<!--
查询 - 根据 ids
-->
<select
id=
"selectById"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM `order_logistics`
WHERE `id` = #{id}
LIMIT 1
</select>
</mapper>
</mapper>
\ No newline at end of file
order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml
浏览文件 @
6e91c41c
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
order_id,
order_id,
order_no,
order_no,
order_logistics_id,
order_logistics_id,
refund_price,
reason,
reason,
`describe`,
`describe`,
approval_time,
approval_time,
...
@@ -26,13 +27,13 @@
...
@@ -26,13 +27,13 @@
<insert
id=
"insert"
parameterType=
"OrderReturnDO"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"OrderReturnDO"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
INSERT INTO `order_return` (
INSERT INTO `order_return` (
service_number, order_id, order_no, order_logistics_id,
service_number, order_id, order_no, order_logistics_id,
reason, `describe`,
re
fund_price, re
ason, `describe`,
approval_time, logistics_time, receiver_time, closing_time,
approval_time, logistics_time, receiver_time, closing_time,
service_type, status,
service_type, status,
create_time, update_time)
create_time, update_time)
VALUES (
VALUES (
#{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId},
#{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId},
#{reason}, #{describe},
${refundPrice},
#{reason}, #{describe},
#{approvalTime}, #{logisticsTime}, #{receiverTime}, #{closingTime},
#{approvalTime}, #{logisticsTime}, #{receiverTime}, #{closingTime},
#{serviceType}, #{status}, #{createTime}, #{updateTime})
#{serviceType}, #{status}, #{createTime}, #{updateTime})
</insert>
</insert>
...
@@ -45,6 +46,9 @@
...
@@ -45,6 +46,9 @@
<if
test=
"orderLogisticsId != null"
>
<if
test=
"orderLogisticsId != null"
>
, order_logistics_id = #{orderLogisticsId}
, order_logistics_id = #{orderLogisticsId}
</if>
</if>
<if
test=
"refundPrice != null"
>
, refund_price = #{refundPrice}
</if>
<if
test=
"reason != null"
>
<if
test=
"reason != null"
>
, reason = #{reason}
, reason = #{reason}
</if>
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论