Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
oms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
oms-ci-test
Commits
8826de2a
提交
8826de2a
authored
6月 02, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rental(add)
上级
3797d10c
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
1217 行增加
和
82 行删除
+1217
-82
RefundStatus.java
src/main/java/com/mmc/oms/common/RefundStatus.java
+34
-0
ResultEnum.java
src/main/java/com/mmc/oms/common/ResultEnum.java
+9
-7
OrderLogisticsController.java
...java/com/mmc/oms/controller/OrderLogisticsController.java
+14
-16
OrderRefundController.java
...in/java/com/mmc/oms/controller/OrderRefundController.java
+49
-0
RentalOrdersController.java
...n/java/com/mmc/oms/controller/RentalOrdersController.java
+27
-1
OrderRefundDao.java
src/main/java/com/mmc/oms/dao/OrderRefundDao.java
+7
-2
RentalOrdersDao.java
src/main/java/com/mmc/oms/dao/RentalOrdersDao.java
+5
-0
OrderRefundDO.java
src/main/java/com/mmc/oms/entity/OrderRefundDO.java
+26
-25
OrderStatusDO.java
src/main/java/com/mmc/oms/entity/OrderStatusDO.java
+3
-3
BaseAccountDTO.java
src/main/java/com/mmc/oms/model/dto/BaseAccountDTO.java
+2
-7
OrderStatusDTO.java
src/main/java/com/mmc/oms/model/dto/OrderStatusDTO.java
+3
-2
OrderRefundVO.java
src/main/java/com/mmc/oms/model/vo/OrderRefundVO.java
+44
-0
RefundYesOrNoVO.java
src/main/java/com/mmc/oms/model/vo/RefundYesOrNoVO.java
+32
-0
ReturnWareVO.java
src/main/java/com/mmc/oms/model/vo/ReturnWareVO.java
+2
-3
OrderRefundServiceImpl.java
...java/com/mmc/oms/service/Impl/OrderRefundServiceImpl.java
+140
-0
RentalOrdersServiceImpl.java
...ava/com/mmc/oms/service/Impl/RentalOrdersServiceImpl.java
+102
-0
OrderRefundService.java
src/main/java/com/mmc/oms/service/OrderRefundService.java
+17
-0
RentalOrdersService.java
src/main/java/com/mmc/oms/service/RentalOrdersService.java
+15
-14
application-local.yml
src/main/resources/application-local.yml
+2
-0
OrderLogisticsDao.xml
src/main/resources/mapper/OrderLogisticsDao.xml
+636
-0
OrderRefundDao.xml
src/main/resources/mapper/OrderRefundDao.xml
+31
-0
RentalOrdersDao.xml
src/main/resources/mapper/RentalOrdersDao.xml
+17
-2
没有找到文件。
src/main/java/com/mmc/oms/common/RefundStatus.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
common
;
/**
* @Author small
* @Date 2023/6/1 16:23
* @Version 1.0
*/
public
enum
RefundStatus
{
INIT
(
100
,
"提交申请"
),
YSP
(
200
,
"已审批"
),
FINISH
(
300
,
"退款完成"
),
CLOSE
(
999
,
"已关闭"
);
RefundStatus
(
Integer
code
,
String
status
)
{
this
.
code
=
code
;
this
.
status
=
status
;
}
private
Integer
code
;
private
String
status
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
}
src/main/java/com/mmc/oms/common/ResultEnum.java
浏览文件 @
8826de2a
...
...
@@ -381,14 +381,14 @@ public enum ResultEnum implements BaseErrorInfoInterface {
SCORE_ERROR
(
"40177"
,
"您输入的积分数量有误,请重新输入!"
),
PLEASE_FILL_IN_THE_CONTRACT_TEMPLATE_FIRST
(
"40178"
,
"请先填充合同模板!"
),
SCORE_NOT_GIVE_MYSELF
(
"40179"
,
"积分不能转赠给本人,请重新操作"
),
SCORE_NOT_GIVE_MYSELF
(
"40179"
,
"积分不能转赠给本人,请重新操作"
),
ALREADY_FINISH_ENT_AUTH_ERROR
(
"2000"
,
"助力已完成!"
),
SYSTEM_ERROR
(
"2001"
,
"系统错误,请稍后重试"
)
,
RULE_ERROR
(
"2002"
,
"当前兑换比例已失效,请刷新后重试"
),
SYSTEM_ERROR
(
"2001"
,
"系统错误,请稍后重试"
)
,
RULE_ERROR
(
"2002"
,
"当前兑换比例已失效,请刷新后重试"
),
COUNT_LIMIT_ERROR
(
"2003"
,
"参与次数已达上线"
),
ALREADY_ENT_AUTH_ERROR
(
"2004"
,
"助力失败,您已完成企业认证!"
),
ALREADY_REAL_NAME_AUTH_ERROR
(
"2005"
,
"助力失败,您已完成实名认证!"
),
ALREADY_ENT_AUTH_ERROR
(
"2004"
,
"助力失败,您已完成企业认证!"
),
ALREADY_REAL_NAME_AUTH_ERROR
(
"2005"
,
"助力失败,您已完成实名认证!"
),
PARTICIPATE_BUT_NOT_AUTH_ERROR
(
"2006"
,
"待完成授权或认证"
),
ALREADY_HELP_ERROR
(
"2007"
,
"已助力"
),
ALREADY_STOP_ERROR
(
"2008"
,
"活动已下线"
),
...
...
@@ -396,8 +396,10 @@ public enum ResultEnum implements BaseErrorInfoInterface {
ALREADY_BINDING_ERROR
(
"2010"
,
"优惠券已被绑定"
),
ALREADY_DIVIDE_ERROR
(
"2011"
,
"订单已分成"
),
DIVIDE_OBJ_NOT_EXIST
(
"2012"
,
"先点击确认添加分成对象"
),
THE_REQUEST_IS_NOT_AUTHENTICATED
(
"2013"
,
"请求未经过鉴权"
),
THE_TOKEN_IS_INVALID
(
"2014"
,
"token失效"
)
;
THE_REQUEST_IS_NOT_AUTHENTICATED
(
"2013"
,
"请求未经过鉴权"
),
THE_TOKEN_IS_INVALID
(
"2014"
,
"token失效"
),
REFUND_FAILED
(
"2015"
,
"退款失败,请联系客服"
),
NO_PERMISSION_TEMPORARILY
(
"2016"
,
"当前账号没有权限,只有后台账号拥有权限"
);
/**
* 错误码
...
...
src/main/java/com/mmc/oms/controller/OrderLogisticsController.java
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
controller
;
import
com.mmc.oms.common.ResultBody
;
import
com.mmc.oms.model.dto.OrderInfoDTO
;
import
com.mmc.oms.model.dto.OrderReceiptDTO
;
import
com.mmc.oms.model.dto.TranStatusDicDTO
;
import
com.mmc.oms.model.dto.*
;
import
com.mmc.oms.service.OrderLogisticsService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -20,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
* @Date 2023/5/31 16:14
* @Version 1.0
*/
@Api
(
tags
=
{
"订单-物流-接口"
})
@Api
(
tags
=
{
"订单-物流-接口"
})
@RestController
@RequestMapping
(
"/express/"
)
public
class
OrderLogisticsController
extends
BaseController
{
...
...
@@ -29,37 +27,37 @@ public class OrderLogisticsController extends BaseController {
private
OrderLogisticsService
orderLogisticsService
;
@ApiOperation
(
value
=
"物流-状态码-字典"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TranStatusDicDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TranStatusDicDTO
.
class
)
})
@GetMapping
(
"listKdnDic"
)
public
ResultBody
listKdnDic
()
{
public
ResultBody
<
KdnDicDTO
>
listKdnDic
()
{
return
ResultBody
.
success
(
orderLogisticsService
.
listKdnDic
());
}
@ApiOperation
(
value
=
"
物流公司
-字典"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TranStatusDicDTO
.
class
)
})
@ApiOperation
(
value
=
"
v1.0.1 物流公司列表
-字典"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TranStatusDicDTO
.
class
)
})
@GetMapping
(
"listExpressInfo"
)
public
ResultBody
listExpressInfo
()
{
public
ResultBody
<
ExpressInfoDTO
>
listExpressInfo
()
{
return
ResultBody
.
success
(
orderLogisticsService
.
listExpressInfo
());
}
@ApiOperation
(
value
=
"
查询订单的发货、收货、退换货等
信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderReceiptDTO
.
class
)
})
@ApiOperation
(
value
=
"
v1.0.1查询订单的发货、收货、退换货等信息——用户
信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderReceiptDTO
.
class
)
})
@GetMapping
(
"getOrderExpress"
)
public
ResultBody
getOrderExpress
(
@RequestParam
Integer
orderInfoId
)
{
public
ResultBody
<
OrderReceiptDTO
>
getOrderExpress
(
@RequestParam
Integer
orderInfoId
)
{
return
ResultBody
.
success
(
orderLogisticsService
.
getOrderReceiptInfo
(
orderInfoId
));
}
@ApiOperation
(
value
=
"查看发货物流信息-订单"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderInfoDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderInfoDTO
.
class
)
})
@GetMapping
(
"orderExpressInfo"
)
public
ResultBody
orderExpressInfo
(
@RequestParam
Integer
orderInfoId
)
{
public
ResultBody
<
OrderInfoDTO
>
orderExpressInfo
(
@RequestParam
Integer
orderInfoId
)
{
return
orderLogisticsService
.
orderExpressInfo
(
orderInfoId
);
}
@ApiOperation
(
value
=
"查看退货物流信息-订单"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderInfoDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
OrderInfoDTO
.
class
)
})
@GetMapping
(
"refundExpressInfo"
)
public
ResultBody
refundExpressInfo
(
@RequestParam
Integer
orderInfoId
)
{
public
ResultBody
<
OrderInfoDTO
>
refundExpressInfo
(
@RequestParam
Integer
orderInfoId
)
{
return
orderLogisticsService
.
refundExpressInfo
(
orderInfoId
);
}
}
src/main/java/com/mmc/oms/controller/OrderRefundController.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
controller
;
import
com.mmc.oms.common.ResultBody
;
import
com.mmc.oms.model.vo.OrderRefundVO
;
import
com.mmc.oms.model.vo.RefundYesOrNoVO
;
import
com.mmc.oms.service.OrderRefundService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author small
* @Date 2023/6/1 16:02
* @Version 1.0
*/
@Api
(
tags
=
{
"订单-退款相关-接口"
})
@RestController
@RequestMapping
(
"/refund/"
)
public
class
OrderRefundController
extends
BaseController
{
@Autowired
private
OrderRefundService
orderRefundService
;
@ApiOperation
(
value
=
"web——发起退款申请"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"applyRetreat"
)
public
ResultBody
applyRetreat
(
HttpServletRequest
request
,
@RequestBody
OrderRefundVO
param
)
{
return
orderRefundService
.
applyRetreat
(
this
.
getCurrentAccount
(
request
),
param
);
}
@ApiOperation
(
value
=
"后台管理——驳回/同意退款"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"refund"
)
public
ResultBody
refund
(
HttpServletRequest
request
,
@RequestBody
RefundYesOrNoVO
param
)
{
return
orderRefundService
.
refund
(
this
.
getCurrentAccount
(
request
),
param
);
}
}
src/main/java/com/mmc/oms/controller/RentalOrdersController.java
浏览文件 @
8826de2a
...
...
@@ -2,11 +2,13 @@ package com.mmc.oms.controller;
import
com.mmc.oms.common.ResultBody
;
import
com.mmc.oms.common.Send
;
import
com.mmc.oms.common.Take
;
import
com.mmc.oms.model.dto.OrderInfoDTO
;
import
com.mmc.oms.model.qo.OrderInfoQO
;
import
com.mmc.oms.model.vo.LeaseOrderVO
;
import
com.mmc.oms.model.vo.OrderStatusVO
;
import
com.mmc.oms.model.vo.OrderVcuVO
;
import
com.mmc.oms.model.vo.ReturnWareVO
;
import
com.mmc.oms.service.RentalOrdersService
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -77,7 +79,7 @@ public class RentalOrdersController extends BaseController {
}
@ApiOperation
(
value
=
"
后台管理——发货-订单
"
)
@ApiOperation
(
value
=
"
v1.0.1后台管理——发货-订单/ 卖家发货
"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"sendOrderWare"
)
public
ResultBody
sendOrderWare
(
HttpServletRequest
request
,
...
...
@@ -86,4 +88,28 @@ public class RentalOrdersController extends BaseController {
}
@ApiOperation
(
value
=
"web 确认收货-订单"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"renterTakeOrder"
)
public
ResultBody
renterTakeOrder
(
@Validated
({
Take
.
class
})
@RequestBody
OrderVcuVO
param
)
{
return
rentalOrdersService
.
renterTakeOrder
(
param
);
}
@ApiOperation
(
value
=
"web 商品归还-订单"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"returnOrderWare"
)
public
ResultBody
returnOrderWare
(
@RequestBody
ReturnWareVO
param
)
{
return
rentalOrdersService
.
returnOrderWare
(
param
);
}
@ApiOperation
(
value
=
"后台管理——平台确认归还"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"pfConfirmOrderWare"
)
public
ResultBody
pfConfirmOrderWare
(
HttpServletRequest
request
,
@RequestBody
OrderVcuVO
param
)
{
return
rentalOrdersService
.
pfConfirmOrderWare
(
this
.
getCurrentAccount
(
request
),
param
);
}
}
src/main/java/com/mmc/oms/dao/OrderRefundDao.java
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
dao
;
import
com.mmc.oms.entity.OrderRefundDO
;
import
com.mmc.oms.entity.OrderVcuDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/5/31 16:25
...
...
@@ -13,4 +12,10 @@ import java.util.List;
@Mapper
public
interface
OrderRefundDao
{
OrderRefundDO
getNewOrderRefund
(
Integer
orderInfoId
);
int
countValidRefund
(
Integer
orderInfoId
);
void
insertOrderRefund
(
OrderRefundDO
refund
);
void
insertOrderVcu
(
OrderVcuDO
vcu
);
}
src/main/java/com/mmc/oms/dao/RentalOrdersDao.java
浏览文件 @
8826de2a
...
...
@@ -47,4 +47,9 @@ public interface RentalOrdersDao {
List
<
OrderStatusDO
>
listOfRentalOrders
(
OrderStatusVO
orderStatusVO
);
int
rentalOrdersCount
(
OrderStatusVO
orderStatusVO
);
void
updateOrder
(
String
orderNo
,
Integer
code
);
OrderRefundDO
getApplicationInformation
(
Integer
id
);
}
src/main/java/com/mmc/oms/entity/OrderRefundDO.java
浏览文件 @
8826de2a
...
...
@@ -16,31 +16,32 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
public
class
OrderRefundDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4323688698785079576L
;
private
Integer
id
;
private
Integer
orderInfoId
;
private
String
refundNo
;
private
Integer
refundStatus
;
private
BigDecimal
shouldRefund
;
private
BigDecimal
actualRefund
;
private
String
reason
;
private
String
pfRemark
;
private
Date
createTime
;
private
static
final
long
serialVersionUID
=
4323688698785079576L
;
private
Integer
id
;
private
Integer
orderInfoId
;
private
String
refundNo
;
private
Integer
refundStatus
;
private
BigDecimal
shouldRefund
;
private
BigDecimal
actualRefund
;
private
String
reason
;
private
String
pfRemark
;
private
Date
createTime
;
private
OrderInfoDO
orderInfo
;
private
OrderInfoDO
orderInfo
;
private
Integer
userAccountId
;
public
OrderRefundDTO
buildOrderRefundDTO
()
{
return
OrderRefundDTO
.
builder
()
.
id
(
this
.
id
)
.
orderInfoId
(
this
.
orderInfoId
)
.
refundStatus
(
this
.
refundStatus
)
.
shouldRefund
(
this
.
shouldRefund
)
.
actualRefund
(
this
.
actualRefund
)
.
reason
(
this
.
reason
)
.
refundNo
(
this
.
refundNo
)
.
orderInfo
(
this
.
orderInfo
==
null
?
null
:
this
.
orderInfo
.
buildOrderInfoDTO
())
.
pfRemark
(
this
.
pfRemark
)
.
createTime
(
this
.
createTime
)
.
build
();
}
public
OrderRefundDTO
buildOrderRefundDTO
()
{
return
OrderRefundDTO
.
builder
()
.
id
(
this
.
id
)
.
orderInfoId
(
this
.
orderInfoId
)
.
refundStatus
(
this
.
refundStatus
)
.
shouldRefund
(
this
.
shouldRefund
)
.
actualRefund
(
this
.
actualRefund
)
.
reason
(
this
.
reason
)
.
refundNo
(
this
.
refundNo
)
.
orderInfo
(
this
.
orderInfo
==
null
?
null
:
this
.
orderInfo
.
buildOrderInfoDTO
())
.
pfRemark
(
this
.
pfRemark
)
.
createTime
(
this
.
createTime
)
.
build
();
}
}
src/main/java/com/mmc/oms/entity/OrderStatusDO.java
浏览文件 @
8826de2a
...
...
@@ -31,8 +31,8 @@ public class OrderStatusDO {
@ApiModelProperty
(
value
=
"商品图片"
)
private
String
wareImg
;
@ApiModelProperty
(
value
=
"
租金总金额
"
)
private
BigDecimal
rentPrice
;
@ApiModelProperty
(
value
=
"
实际付款
"
)
private
BigDecimal
actualPay
;
@ApiModelProperty
(
value
=
"订单描述"
)
private
String
wareDescription
;
...
...
@@ -54,7 +54,7 @@ public class OrderStatusDO {
.
id
(
this
.
id
)
.
orderNo
(
this
.
orderNo
)
.
wareImg
(
this
.
wareImg
)
.
rentPrice
(
this
.
rentPrice
)
.
actualPay
(
this
.
actualPay
)
.
wareDescription
(
this
.
wareDescription
)
.
tranStatus
(
this
.
tranStatus
)
.
waiting
(
this
.
waiting
)
...
...
src/main/java/com/mmc/oms/model/dto/BaseAccountDTO.java
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -36,12 +35,8 @@ public class BaseAccountDTO implements Serializable {
private
String
userName
;
@ApiModelProperty
(
value
=
"用户昵称"
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"0是后台管理 100客户端 小程序"
)
private
Integer
portType
;
}
src/main/java/com/mmc/oms/model/dto/OrderStatusDTO.java
浏览文件 @
8826de2a
...
...
@@ -19,6 +19,7 @@ import java.math.BigDecimal;
@Builder
public
class
OrderStatusDTO
{
private
static
final
long
serialVersionUID
=
6544149196885009444L
;
@ApiModelProperty
(
value
=
"订单id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"订单编号"
)
...
...
@@ -30,8 +31,8 @@ public class OrderStatusDTO {
@ApiModelProperty
(
value
=
"商品图片"
)
private
String
wareImg
;
@ApiModelProperty
(
value
=
"
租金总金额
"
)
private
BigDecimal
rentPrice
;
@ApiModelProperty
(
value
=
"
实际付款
"
)
private
BigDecimal
actualPay
;
@ApiModelProperty
(
value
=
"订单描述"
)
private
String
wareDescription
;
...
...
src/main/java/com/mmc/oms/model/vo/OrderRefundVO.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
model
.
vo
;
import
com.mmc.oms.entity.OrderVcuDO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.util.CollectionUtils
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/6/1 16:09
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.OrderRefundVO", description = "发货/收货类")
public
class
OrderRefundVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5392913587235842548L
;
@ApiModelProperty
(
value
=
"订单ID"
)
@NotNull
private
Integer
orderInfoId
;
@ApiModelProperty
(
value
=
"退款理由/原因"
)
private
String
reason
;
@ApiModelProperty
(
value
=
"补充描述和凭证"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"图片集合"
)
private
List
<
String
>
imgs
;
@ApiModelProperty
(
value
=
"视频"
)
private
String
videoUrl
;
public
OrderVcuDO
buildOrdeVcu
()
{
return
OrderVcuDO
.
builder
().
remark
(
this
.
remark
)
.
imgs
(
CollectionUtils
.
isEmpty
(
this
.
imgs
)
?
null
:
String
.
join
(
","
,
this
.
imgs
)).
videoUrl
(
this
.
videoUrl
)
.
orderInfoId
(
this
.
orderInfoId
).
build
();
}
}
src/main/java/com/mmc/oms/model/vo/RefundYesOrNoVO.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
/**
* @Author small
* @Date 2023/6/1 16:40
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
RefundYesOrNoVO
{
private
static
final
long
serialVersionUID
=
5392913587235842548L
;
@ApiModelProperty
(
value
=
"订单ID"
)
@NotNull
private
Integer
orderInfoId
;
@ApiModelProperty
(
value
=
"是否同意退款 true 同意 false驳回 "
)
@NotNull
private
Boolean
refund
;
}
src/main/java/com/mmc/oms/model/vo/ReturnWareVO.java
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
model
.
vo
;
import
com.mmc.oms.entity.OrderVcuDO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -23,11 +22,11 @@ import java.util.List;
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.vo.ReturnWareVO", description = "退换货类")
public
class
ReturnWareVO
{
@ApiModelProperty
(
value
=
"订单ID"
)
@ApiModelProperty
(
value
=
"订单ID"
,
required
=
true
)
@NotNull
private
Integer
orderInfoId
;
@ApiModelProperty
(
value
=
"退还货方式:0邮寄 1门店地址"
)
@ApiModelProperty
(
value
=
"退还货方式:0邮寄 1门店地址
默认0 暂无门店"
,
example
=
"0
"
)
@NotNull
(
message
=
"归还方式不能为空"
)
private
Integer
renMethod
;
...
...
src/main/java/com/mmc/oms/service/Impl/OrderRefundServiceImpl.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
service
.
Impl
;
import
com.mmc.oms.common.*
;
import
com.mmc.oms.dao.OrderRefundDao
;
import
com.mmc.oms.dao.RentalOrdersDao
;
import
com.mmc.oms.entity.OrderInfoDO
;
import
com.mmc.oms.entity.OrderRefundDO
;
import
com.mmc.oms.entity.OrderVcuDO
;
import
com.mmc.oms.model.dto.BaseAccountDTO
;
import
com.mmc.oms.model.vo.OrderRefundVO
;
import
com.mmc.oms.model.vo.RefundYesOrNoVO
;
import
com.mmc.oms.service.OrderRefundService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestTemplate
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/6/1 16:03
* @Version 1.0
*/
@Service
public
class
OrderRefundServiceImpl
implements
OrderRefundService
{
@Autowired
private
OrderRefundDao
orderRefundDao
;
@Autowired
private
RentalOrdersDao
rentalOrdersDao
;
@Value
(
"${payment.url}"
)
private
String
paymentUrl
;
@Autowired
private
RestTemplate
restTemplate
;
@Override
@Transactional
public
ResultBody
applyRetreat
(
BaseAccountDTO
account
,
OrderRefundVO
param
)
{
OrderInfoDO
order
=
rentalOrdersDao
.
getOrderInfo
(
param
.
getOrderInfoId
());
if
(!
TranStatusDic
.
YFK
.
getStatus
().
equals
(
order
.
getTranStatus
()))
{
return
ResultBody
.
error
(
ResultEnum
.
ORDER_STATUS_ERROR
);
}
int
count
=
orderRefundDao
.
countValidRefund
(
param
.
getOrderInfoId
());
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
ORDER_REFUND_EXIT_ERROR
);
}
Date
cdate
=
new
Date
();
// 添加申请单
OrderRefundDO
refund
=
new
OrderRefundDO
();
refund
.
setOrderInfoId
(
order
.
getId
());
refund
.
setRefundNo
(
CodeUtil
.
createOrderRefund
());
refund
.
setRefundStatus
(
RefundStatus
.
INIT
.
getCode
());
refund
.
setShouldRefund
(
order
.
getActualPay
());
refund
.
setActualRefund
(
BigDecimal
.
ZERO
);
refund
.
setReason
(
param
.
getReason
());
refund
.
setCreateTime
(
cdate
);
refund
.
setUserAccountId
(
account
.
getUserAccountId
());
orderRefundDao
.
insertOrderRefund
(
refund
);
// 订单-视频、图片
OrderVcuDO
vcu
=
param
.
buildOrdeVcu
();
vcu
.
setOrderRefundId
(
refund
.
getId
());
vcu
.
setVcuType
(
VcuType
.
RETREAT
.
getCode
());
vcu
.
setCreateTime
(
cdate
);
orderRefundDao
.
insertOrderVcu
(
vcu
);
// 申请进度log
/* RefundLogDO rlog = new RefundLogDO();
rlog.setOrderRefundId(refund.getId());
rlog.setRefundCode(RefundShd.INIT.getStatus());
String msg = "发起退款申请,货物状态:未发货,原因:" + param.getReason() + ",金额:" + order.getActualPay() + "元";
rlog.setMsg(msg);
rlog.setOpAccount(account.getUid());
rlog.setOpName(account.getAccountName());
rlog.setCreateTime(cdate);
orderRefundDao.insertRefundLog(rlog);*/
// 修改订单状态
OrderInfoDO
upOrder
=
new
OrderInfoDO
();
upOrder
.
setId
(
param
.
getOrderInfoId
());
upOrder
.
setTranStatus
(
TranStatusDic
.
TKSQ
.
getStatus
());
rentalOrdersDao
.
updateOrderInfo
(
upOrder
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
refund
(
BaseAccountDTO
currentAccount
,
RefundYesOrNoVO
param
)
{
if
(
currentAccount
.
getPortType
()
!=
0
)
{
ResultBody
.
error
(
ResultEnum
.
NO_PERMISSION_TEMPORARILY
);
}
OrderInfoDO
order
=
rentalOrdersDao
.
getOrderInfo
(
param
.
getOrderInfoId
());
OrderRefundDO
applicationInformation
=
rentalOrdersDao
.
getApplicationInformation
(
order
.
getId
());
//同意退款就订单关闭
//驳回订单还处于当前状态
Boolean
refund
=
param
.
getRefund
();
//同意退款
if
(
refund
.
equals
(
true
))
{
rentalOrdersDao
.
updateOrder
(
order
.
getOrderNo
(),
RefundStatus
.
CLOSE
.
getCode
());
refundChanges
(
currentAccount
.
getToken
(),
order
.
getActualPay
(),
order
.
getOrderNo
(),
applicationInformation
.
getUserAccountId
(),
applicationInformation
.
getRefundNo
());
return
ResultBody
.
success
(
RefundStatus
.
FINISH
.
getStatus
());
}
rentalOrdersDao
.
updateOrder
(
order
.
getOrderNo
(),
RefundStatus
.
INIT
.
getCode
());
return
ResultBody
.
error
(
ResultEnum
.
REFUND_FAILED
);
}
/**
* 退款金额变更
*
* @param orderNo
* @return
*/
private
void
refundChanges
(
String
token
,
BigDecimal
actualPay
,
String
orderNo
,
Integer
userAccountId
,
String
refundNo
)
{
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
"token"
,
token
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
formEntity
=
new
HttpEntity
<
MultiValueMap
<
String
,
Object
>>(
headers
);
ResponseEntity
<
String
>
exchange
=
restTemplate
.
exchange
(
paymentUrl
+
"/amountOfRefund?actualPay="
+
actualPay
+
"&orderNo="
+
orderNo
+
"&repoAccountId="
+
userAccountId
+
"&refundNo="
+
refundNo
,
HttpMethod
.
GET
,
formEntity
,
String
.
class
);
System
.
out
.
println
(
exchange
);
}
}
src/main/java/com/mmc/oms/service/Impl/RentalOrdersServiceImpl.java
浏览文件 @
8826de2a
...
...
@@ -10,6 +10,7 @@ import com.mmc.oms.model.qo.OrderInfoQO;
import
com.mmc.oms.model.vo.*
;
import
com.mmc.oms.service.RentalOrdersService
;
import
com.mmc.oms.wx.WxMsgTemplete
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
...
@@ -378,6 +379,80 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
return
PageResult
.
buildPage
(
pageNo
,
orderStatusVO
.
getPageSize
(),
count
,
collect
);
}
@Override
public
ResultBody
renterTakeOrder
(
OrderVcuVO
param
)
{
OrderInfoDO
order
=
rentalOrdersDao
.
getOrderInfo
(
param
.
getOrderInfoId
());
if
(!
TranStatusDic
.
YFH
.
getStatus
().
equals
(
order
.
getTranStatus
()))
{
return
ResultBody
.
error
(
ResultEnum
.
ORDER_STATUS_ERROR
);
}
// 订单-视频、图片
OrderVcuDO
vcu
=
param
.
buildOrdeVcu
();
vcu
.
setVcuType
(
VcuType
.
REC
.
getCode
());
vcu
.
setCreateTime
(
new
Date
());
rentalOrdersDao
.
insertOrderVcu
(
vcu
);
// 修改订单状态
OrderInfoDO
upOrder
=
new
OrderInfoDO
();
upOrder
.
setId
(
param
.
getOrderInfoId
());
upOrder
.
setTranStatus
(
TranStatusDic
.
ZLZ
.
getStatus
());
rentalOrdersDao
.
updateOrderInfo
(
upOrder
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
returnOrderWare
(
ReturnWareVO
param
)
{
OrderInfoDO
order
=
rentalOrdersDao
.
getOrderInfo
(
param
.
getOrderInfoId
());
if
(!
TranStatusDic
.
ZLZ
.
getStatus
().
equals
(
order
.
getTranStatus
()))
{
return
ResultBody
.
error
(
ResultEnum
.
ORDER_STATUS_ERROR
);
}
if
(
param
.
getRenMethod
()
==
RenMethod
.
EXPRESS
.
getCode
())
{
if
(
StringUtils
.
isBlank
(
param
.
getRenExCode
())
||
StringUtils
.
isBlank
(
param
.
getRenExNo
()))
{
return
ResultBody
.
error
(
ResultEnum
.
EXPRESS_RETURN_ERROR
);
}
OrderReceiptDO
receipt
=
new
OrderReceiptDO
();
receipt
.
setOrderInfoId
(
param
.
getOrderInfoId
());
receipt
.
setRenMethod
(
RenMethod
.
EXPRESS
.
getCode
());
receipt
.
setRenExCode
(
param
.
getRenExCode
());
receipt
.
setRenExNo
(
param
.
getRenExNo
());
rentalOrdersDao
.
updateOrderReceipt
(
receipt
);
}
else
{
if
(
param
.
getRepoInfoId
()
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
SHOP_RETURN_ERROR
);
}
//门店信息
// RepoInfoDTO repoInfo = repoDeviceServletClient.feignGetRepoShop(param.getRepoInfoId());
/*if (repoInfo == null) {
return ResultBody.error(ResultEnum.FEIGN_DEVICE_SERVLET_ERROR);
}*/
OrderReceiptDO
receipt
=
new
OrderReceiptDO
();
receipt
.
setOrderInfoId
(
param
.
getOrderInfoId
());
receipt
.
setRenMethod
(
RenMethod
.
SHOP
.
getCode
());
// receipt.setRenRepoName(repoInfo.getRepoName());
// receipt.setRenRepoAddr(repoInfo.getRepoAddress());
//UserAccountDTO repoUser = userServletClient.feignGetUserSimpleInfo(repoInfo.getUserAccountId());
/* if (repoUser == null) {
return ResultBody.error(ResultEnum.FEIGN_USER_SERVLET_ERROR);
}
receipt.setRenRepoPhone(repoUser.getPhoneNum());*/
rentalOrdersDao
.
updateOrderReceipt
(
receipt
);
}
// 订单-视频、图片
OrderVcuDO
vcu
=
param
.
buildOrdeVcu
();
vcu
.
setVcuType
(
VcuType
.
RETURN
.
getCode
());
vcu
.
setCreateTime
(
new
Date
());
rentalOrdersDao
.
insertOrderVcu
(
vcu
);
// 修改订单状态
OrderInfoDO
upOrder
=
new
OrderInfoDO
();
upOrder
.
setId
(
param
.
getOrderInfoId
());
upOrder
.
setTranStatus
(
TranStatusDic
.
GHZ
.
getStatus
());
rentalOrdersDao
.
updateOrderInfo
(
upOrder
);
return
ResultBody
.
success
();
}
private
void
sendShipMsg
(
Integer
orderInfoId
)
{
OrderInfoDO
orderInfo
=
rentalOrdersDao
.
getOrderInfo
(
orderInfoId
);
...
...
@@ -443,4 +518,31 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
}
return
null
;
}
@Override
public
ResultBody
pfConfirmOrderWare
(
BaseAccountDTO
cuser
,
OrderVcuVO
param
)
{
// 密码认证
ResultBody
body
=
passwordAuthentication
(
cuser
,
param
.
getAuthPwd
());
if
(
body
!=
null
)
{
return
body
;
}
OrderInfoDO
order
=
rentalOrdersDao
.
getOrderInfo
(
param
.
getOrderInfoId
());
if
(!
TranStatusDic
.
GHZ
.
getStatus
().
equals
(
order
.
getTranStatus
()))
{
return
ResultBody
.
error
(
ResultEnum
.
ORDER_STATUS_ERROR
);
}
// 订单-视频、图片
OrderVcuDO
vcu
=
param
.
buildOrdeVcu
();
vcu
.
setVcuType
(
VcuType
.
PFREC
.
getCode
());
vcu
.
setCreateTime
(
new
Date
());
rentalOrdersDao
.
insertOrderVcu
(
vcu
);
// 修改订单状态
OrderInfoDO
upOrder
=
new
OrderInfoDO
();
upOrder
.
setId
(
param
.
getOrderInfoId
());
upOrder
.
setTranStatus
(
TranStatusDic
.
JYWC
.
getStatus
());
rentalOrdersDao
.
updateOrderInfo
(
upOrder
);
// 以异步方式同步数据到分成明细表 云仓
// this.SynchronousDataToPushMoney(order.getOrderNo());
return
ResultBody
.
success
();
}
}
src/main/java/com/mmc/oms/service/OrderRefundService.java
0 → 100644
浏览文件 @
8826de2a
package
com
.
mmc
.
oms
.
service
;
import
com.mmc.oms.common.ResultBody
;
import
com.mmc.oms.model.dto.BaseAccountDTO
;
import
com.mmc.oms.model.vo.OrderRefundVO
;
import
com.mmc.oms.model.vo.RefundYesOrNoVO
;
/**
* @Author small
* @Date 2023/6/1 16:03
* @Version 1.0
*/
public
interface
OrderRefundService
{
ResultBody
applyRetreat
(
BaseAccountDTO
currentAccount
,
OrderRefundVO
param
);
ResultBody
refund
(
BaseAccountDTO
currentAccount
,
RefundYesOrNoVO
param
);
}
src/main/java/com/mmc/oms/service/RentalOrdersService.java
浏览文件 @
8826de2a
...
...
@@ -5,30 +5,31 @@ import com.mmc.oms.common.ResultBody;
import
com.mmc.oms.model.dto.BaseAccountDTO
;
import
com.mmc.oms.model.dto.OrderInfoDTO
;
import
com.mmc.oms.model.qo.OrderInfoQO
;
import
com.mmc.oms.model.vo.LeaseOrderVO
;
import
com.mmc.oms.model.vo.OrderStatusVO
;
import
com.mmc.oms.model.vo.OrderVcuVO
;
import
com.mmc.oms.model.vo.RentalOrderVO
;
import
javax.servlet.http.HttpServletRequest
;
import
com.mmc.oms.model.vo.*
;
/**
* @Author small @Date 2023/5/26 10:52 @Version 1.0
*/
public
interface
RentalOrdersService
{
ResultBody
addLease
(
BaseAccountDTO
account
,
RentalOrderVO
rentalOrderVO
);
ResultBody
addLease
(
BaseAccountDTO
account
,
RentalOrderVO
rentalOrderVO
);
OrderInfoDTO
getOrderDetail
(
String
orderNo
);
OrderInfoDTO
feignAddLease
(
BaseAccountDTO
user
,
LeaseOrderVO
param
);
PageResult
listPcOrderInfo
(
OrderInfoQO
param
,
BaseAccountDTO
cuser
);
OrderInfoDTO
getOrderDetail
(
String
orderNo
);
PageResult
listPageWechatOrder
(
BaseAccountDTO
account
,
OrderInfoQO
param
);
OrderInfoDTO
feignAddLease
(
BaseAccountDTO
user
,
LeaseOrderVO
param
);
Object
orderStatusChanges
(
String
orderNo
,
Integer
tranStatus
);
PageResult
listPcOrderInfo
(
OrderInfoQO
param
,
BaseAccountDTO
cuser
);
ResultBody
sendOrderWare
(
BaseAccountDTO
currentAccount
,
OrderVcuVO
param
);
PageResult
listPageWechatOrder
(
BaseAccountDTO
account
,
OrderInfoQO
param
);
PageResult
listOfRentalOrders
(
OrderStatusVO
orderStatusVO
,
BaseAccountDTO
currentAccount
);
Object
orderStatusChanges
(
String
orderNo
,
Integer
tranStatus
);
ResultBody
renterTakeOrder
(
OrderVcuVO
param
);
ResultBody
sendOrderWare
(
BaseAccountDTO
currentAccount
,
OrderVcu
VO
param
);
ResultBody
returnOrderWare
(
ReturnWare
VO
param
);
PageResult
listOfRentalOrders
(
OrderStatusVO
orderStatusVO
,
BaseAccountDTO
currentAccount
);
ResultBody
pfConfirmOrderWare
(
BaseAccountDTO
currentAccount
,
OrderVcuVO
param
);
}
src/main/resources/application-local.yml
浏览文件 @
8826de2a
...
...
@@ -53,5 +53,7 @@ workFlyerInfoKey: TEST_WORK_FLYER_INFO
userapp
:
url
:
http://localhost:35150/userapp/
payment
:
url
:
http://localhost:8088/payment/
src/main/resources/mapper/OrderLogisticsDao.xml
0 → 100644
浏览文件 @
8826de2a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mmc.oms.dao.OrderLogisticsDao"
>
<resultMap
id=
"orderInfoResultMap"
type=
"com.mmc.oms.entity.OrderInfoDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"orderNo"
column=
"order_no"
/>
<result
property=
"wareInfoId"
column=
"ware_info_id"
/>
<result
property=
"wareNo"
column=
"ware_no"
/>
<result
property=
"wareTitle"
column=
"ware_title"
/>
<result
property=
"wareImg"
column=
"ware_img"
/>
<result
property=
"skuInfoId"
column=
"sku_info_id"
/>
<result
property=
"skuTitle"
column=
"sku_title"
/>
<result
property=
"repoAccountId"
column=
"repo_account_id"
/>
<result
property=
"uid"
column=
"uid"
/>
<result
property=
"buyerName"
column=
"buyer_name"
/>
<result
property=
"buyerPhone"
column=
"buyer_phone"
/>
<result
property=
"unitPrice"
column=
"unit_price"
/>
<result
property=
"wareNum"
column=
"ware_num"
/>
<result
property=
"shouldPay"
column=
"should_pay"
/>
<result
property=
"actualPay"
column=
"actual_pay"
/>
<result
property=
"orderType"
column=
"order_type"
/>
<result
property=
"deposit"
column=
"deposit"
/>
<result
property=
"rentPrice"
column=
"rent_price"
/>
<result
property=
"startDate"
column=
"start_date"
/>
<result
property=
"endDate"
column=
"end_date"
/>
<result
property=
"payDay"
column=
"pay_day"
/>
<result
property=
"tranStatus"
column=
"tran_status"
/>
<result
property=
"exWare"
column=
"ex_ware"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"pfRemark"
column=
"pf_remark"
/>
<result
property=
"shutReason"
column=
"shut_reason"
/>
<result
property=
"payNo"
column=
"pay_no"
/>
<result
property=
"payTime"
column=
"pay_time"
/>
<result
property=
"sendWareTime"
column=
"send_ware_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"rcdCompanyId"
column=
"rcd_company_id"
/>
<association
property=
"receipt"
javaType=
"com.mmc.oms.entity.OrderReceiptDO"
resultMap=
"orderReceiptResultMap"
></association>
</resultMap>
<resultMap
id=
"tranStatusResultMap"
type=
"com.mmc.oms.entity.TranStatusDicDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"doing"
column=
"doing"
/>
<result
property=
"waiting"
column=
"waiting"
/>
<result
property=
"sort"
column=
"sort"
/>
</resultMap>
<resultMap
id=
"kdnDicResultMap"
type=
"com.mmc.oms.entity.KdnDicDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"msg"
column=
"msg"
/>
</resultMap>
<resultMap
id=
"orderReceiptResultMap"
type=
"com.mmc.oms.entity.OrderReceiptDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"orderInfoId"
column=
"order_info_id"
/>
<result
property=
"receiptMethod"
column=
"receipt_method"
/>
<result
property=
"takeName"
column=
"take_name"
/>
<result
property=
"takePhone"
column=
"take_phone"
/>
<result
property=
"region"
column=
"region"
/>
<result
property=
"detailAddress"
column=
"detail_address"
/>
<result
property=
"repoName"
column=
"repo_name"
/>
<result
property=
"repoAddress"
column=
"repo_address"
/>
<result
property=
"bookPhone"
column=
"book_phone"
/>
<result
property=
"sendExCode"
column=
"send_ex_code"
/>
<result
property=
"sendExNo"
column=
"send_ex_no"
/>
<result
property=
"sendAddress"
column=
"send_address"
/>
<result
property=
"renMethod"
column=
"ren_method"
/>
<result
property=
"renPhone"
column=
"ren_phone"
/>
<result
property=
"renName"
column=
"ren_name"
/>
<result
property=
"renExCode"
column=
"ren_ex_code"
/>
<result
property=
"renExNo"
column=
"ren_ex_no"
/>
<result
property=
"renAddress"
column=
"ren_address"
/>
<result
property=
"renRepoName"
column=
"ren_repo_name"
/>
<result
property=
"renRepoAddr"
column=
"ren_repo_addr"
/>
<result
property=
"renRepoPhone"
column=
"ren_repo_phone"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"exName"
column=
"ex_name"
/>
</resultMap>
<resultMap
id=
"expressInfoResultMap"
type=
"com.mmc.oms.entity.ExpressInfoDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"exName"
column=
"ex_name"
/>
<result
property=
"exCode"
column=
"ex_code"
/>
</resultMap>
<resultMap
id=
"orderVcuResultMap"
type=
"com.mmc.oms.entity.OrderVcuDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"orderInfoId"
column=
"order_info_id"
/>
<result
property=
"orderRefundId"
column=
"order_refund_id"
/>
<result
property=
"vcuType"
column=
"vcu_type"
/>
<result
property=
"vcuSatus"
column=
"vcu_satus"
/>
<result
property=
"imgs"
column=
"imgs"
/>
<result
property=
"videoUrl"
column=
"video_url"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
<select
id=
"getOrderInfo"
resultMap=
"orderInfoResultMap"
>
select o.id,
o.order_no,
o.ware_img,
o.ware_title,
o.sku_title,
o.unit_price,
o.tran_status,
o.ware_num,
o.should_pay,
o.actual_pay,
o.start_date,
o.end_date,
o.deposit,
o.ex_ware,
o.pay_no,
o.pay_time,
o.send_ware_time,
o.create_time,
o.remark,
o.buyer_name,
o.buyer_phone,
o.uid,
o.repo_account_id,
o.shut_reason,
o.pf_remark,
o.sku_info_id,
o.ware_info_id
from order_info o
where o.id = #{orderInfoId}
</select>
<insert
id=
"insertOrderInfo"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.OrderInfoDO"
>
insert into order_info
(order_no, ware_info_id, ware_no, ware_title, ware_img, sku_info_id, sku_title, repo_account_id,
uid, buyer_name, buyer_phone, unit_price, ware_num, should_pay, actual_pay, order_type,
deposit, rent_price, start_date, end_date, pay_day, tran_status, ex_ware, remark, pay_time,
send_ware_time, create_time, rcd_company_id)
values (#{orderNo}, #{wareInfoId}, #{wareNo}, #{wareTitle}, #{wareImg}, #{skuInfoId}, #{skuTitle},
#{repoAccountId},
#{uid}, #{buyerName}, #{buyerPhone}, #{unitPrice}, #{wareNum}, #{shouldPay}, #{actualPay}, #{orderType},
#{deposit}, #{rentPrice}, #{startDate}, #{endDate}, #{payDay}, #{tranStatus}, #{exWare}, #{remark},
#{payTime},
#{sendWareTime}, #{createTime}, #{rcdCompanyId})
</insert>
<insert
id=
"insertOrderReceipt"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.OrderReceiptDO"
>
insert into order_receipt
(order_info_id, receipt_method, take_name, take_phone, region, detail_address, repo_name,
repo_address, book_phone, create_time)
values (#{orderInfoId}, #{receiptMethod}, #{takeName}, #{takePhone}, #{region}, #{detailAddress}, #{repoName},
#{repoAddress}, #{bookPhone}, #{createTime})
</insert>
<select
id=
"listTranStatus"
resultMap=
"tranStatusResultMap"
>
select t.id, t.`status`, t.doing, t.waiting
from tran_status_dic t
order by t.sort asc
</select>
<select
id=
"getOrderDetail"
resultMap=
"orderInfoResultMap"
>
select o.id,
o.order_no,
o.ware_img,
o.ware_title,
o.sku_title,
o.unit_price,
o.tran_status,
o.ware_num,
o.should_pay,
o.actual_pay,
o.start_date,
o.end_date,
o.deposit,
o.pf_remark,
o.shut_reason,
o.ex_ware,
o.pay_time,
o.send_ware_time,
o.create_time,
o.remark,
o.ware_info_id,
o.pay_day,
o.repo_account_id,
o.rcd_company_id
from order_info o
where o.order_no = #{orderNo}
</select>
<select
id=
"getOrderReceiptByOrder"
resultMap=
"orderReceiptResultMap"
parameterType=
"java.lang.Integer"
>
select r.id,
r.order_info_id,
r.receipt_method,
r.take_name,
r.send_ex_no,
r.take_phone,
r.region,
r.detail_address,
r.repo_name,
r.repo_address,
r.book_phone,
r.create_time,
ei.ex_name
from order_receipt r
LEFT JOIN express_info ei ON ei.ex_code = r.send_ex_code
where r.order_info_id = #{orderInfoId}
</select>
<select
id=
"getAccountOrderInfo"
resultMap=
"orderInfoResultMap"
>
select o.id,
o.order_no,
o.ware_img,
o.ware_title,
o.sku_title,
o.unit_price,
o.tran_status,
o.ware_num,
o.should_pay,
o.actual_pay,
o.start_date,
o.end_date,
o.deposit,
o.ex_ware,
o.pay_time,
o.send_ware_time,
o.create_time,
o.remark
from order_info o
where o.id = #{orderInfoId}
and o.repo_account_id = #{repoAccountId}
</select>
<update
id=
"updateOrderInfo"
parameterType=
"com.mmc.oms.entity.OrderInfoDO"
>
update order_info
<set>
<if
test=
"tranStatus != null and tranStatus != '' "
>
tran_status = #{tranStatus},
</if>
<if
test=
"shutReason != null and shutReason != '' "
>
shut_reason = #{shutReason},
</if>
<if
test=
" actualPay != null "
>
actual_pay = #{actualPay},
</if>
<if
test=
"pfRemark != null"
>
pf_remark = #{pfRemark},
</if>
<if
test=
"payTime != null"
>
pay_time = #{payTime},
</if>
<if
test=
"sendWareTime != null"
>
send_ware_time = #{sendWareTime},
</if>
<if
test=
"payNo != null and payNo != '' "
>
pay_no = #{payNo},
</if>
</set>
where id = #{id}
</update>
<update
id=
"updateOrderReceipt"
parameterType=
"com.mmc.oms.entity.OrderReceiptDO"
>
update order_receipt
<set>
<if
test=
" takeName != null and takeName != '' "
>
take_name = #{takeName},
</if>
<if
test=
" takePhone != null and takePhone != '' "
>
take_phone = #{takePhone},
</if>
<if
test=
"region != null"
>
region = #{region},
</if>
<if
test=
" detailAddress != null and detailAddress!='' "
>
detail_address = #{detailAddress},
</if>
<if
test=
" repoName != null and repoName!='' "
>
repo_name = #{repoName},
</if>
<if
test=
" repoAddress != null and repoAddress!='' "
>
repo_address = #{repoAddress},
</if>
<if
test=
"bookPhone != null and bookPhone!='' "
>
book_phone = #{bookPhone},
</if>
<if
test=
"sendExCode != null and sendExCode != '' "
>
send_ex_code = #{sendExCode},
</if>
<if
test=
"sendExNo != null and sendExNo != '' "
>
send_ex_no = #{sendExNo},
</if>
<if
test=
"sendAddress != null and sendAddress != '' "
>
send_address = #{sendAddress},
</if>
<if
test=
"renMethod != null"
>
ren_method = #{renMethod},
</if>
<if
test=
"renPhone != null and renPhone != '' "
>
ren_phone = #{renPhone},
</if>
<if
test=
"renName != null and renName != '' "
>
ren_name = #{renName},
</if>
<if
test=
"renExCode != null and renExCode != '' "
>
ren_ex_code = #{renExCode},
</if>
<if
test=
"renExNo != null and renExNo != '' "
>
ren_ex_no = #{renExNo},
</if>
<if
test=
"renAddress != null and renAddress != '' "
>
ren_address = #{renAddress},
</if>
<if
test=
"renRepoName != null and renRepoName != '' "
>
ren_repo_name = #{renRepoName},
</if>
<if
test=
"renRepoAddr != null and renRepoAddr != '' "
>
ren_repo_addr = #{renRepoAddr},
</if>
<if
test=
"renRepoPhone != null and renRepoPhone != '' "
>
ren_repo_phone = #{renRepoPhone},
</if>
</set>
where order_info_id = #{orderInfoId}
</update>
<select
id=
"getOrderSimpleInfo"
resultMap=
"orderInfoResultMap"
>
select o.id,
o.order_no,
o.sku_info_id,
o.sku_title,
o.ware_info_id,
o.ware_no,
o.ware_img,
o.ware_title,
o.buyer_name,
o.uid,
o.buyer_phone,
o.unit_price,
o.tran_status,
o.ware_num,
o.should_pay,
o.actual_pay,
o.start_date,
o.end_date,
o.deposit,
o.ex_ware,
o.pay_time,
o.send_ware_time,
o.create_time,
o.remark
from order_info o
where o.id = #{orderInfoId}
</select>
<select
id=
"countPageOrderInfo"
resultType=
"java.lang.Integer"
parameterType=
"com.mmc.oms.model.qo.OrderInfoQO"
>
select count(*)
from order_info o
<where>
o.repo_account_id = #{repoAccountId}
<if
test=
" tranStatus!=null and tranStatus!='' "
>
and o.tran_status = #{tranStatus}
</if>
<if
test=
" keyword!=null and keyword!='' "
>
and (
o.ware_title like CONCAT('%',#{keyword},'%')
or o.order_no like CONCAT('%',#{keyword},'%')
)
</if>
</where>
</select>
<select
id=
"listPageOrderInfo"
resultMap=
"orderInfoResultMap"
parameterType=
"com.mmc.oms.model.qo.OrderInfoQO"
>
select o.id,o.order_no,o.ware_title,o.ware_img,o.sku_title,o.tran_status,
o.ware_num,o.should_pay,o.actual_pay,
rp.order_info_id,rp.receipt_method,rp.take_name,
rp.take_phone,rp.region,rp.detail_address,rp.repo_name,rp.repo_address,
rp.book_phone,rp.send_ex_code,rp.send_ex_no,rp.send_address,rp.ren_method,
rp.ren_phone,rp.ren_name,rp.ren_ex_code,rp.ren_ex_no,rp.ren_address,rp.ren_repo_name,
rp.ren_repo_addr,rp.ren_repo_phone
from order_info o
inner join order_receipt rp on rp.order_info_id=o.id
<where>
o.repo_account_id = #{repoAccountId}
<if
test=
" tranStatus!=null and tranStatus!='' "
>
and o.tran_status = #{tranStatus}
</if>
<if
test=
" keyword!=null and keyword!='' "
>
and (
o.ware_title like CONCAT('%',#{keyword},'%')
or o.order_no like CONCAT('%',#{keyword},'%')
)
</if>
</where>
order by o.create_time DESC
limit #{pageNo},#{pageSize}
</select>
<select
id=
"listKdnDic"
resultMap=
"kdnDicResultMap"
>
select id, code, msg
from kdn_dic
</select>
<select
id=
"listPcOrderInfo"
resultMap=
"orderInfoResultMap"
parameterType=
"com.mmc.oms.model.qo.OrderInfoQO"
>
select o.id,o.order_no,o.ware_title,o.sku_title,o.ware_img,o.deposit,
o.unit_price,o.ware_num,o.buyer_name,o.buyer_phone,o.uid,o.remark,
o.tran_status,o.should_pay,o.actual_pay,o.pf_remark,o.create_time,o.ware_no,
rp.order_info_id,rp.receipt_method,rp.take_name,
rp.take_phone,rp.region,rp.detail_address,rp.repo_name,rp.repo_address,
rp.book_phone,rp.send_ex_code,rp.send_ex_no,rp.send_address,rp.ren_method,
rp.ren_phone,rp.ren_name,rp.ren_ex_code,rp.ren_ex_no,rp.ren_address,rp.ren_repo_name,
rp.ren_repo_addr,rp.ren_repo_phone
from order_info o
inner join order_receipt rp on rp.order_info_id=o.id
<where>
1=1
<if
test=
" keyword1 != null and keyword1 != '' "
>
and (
o.uid like CONCAT('%',#{keyword1},'%')
or o.buyer_name like CONCAT('%',#{keyword1},'%')
)
</if>
<if
test=
" keyword2 != null and keyword2 != '' "
>
and (
o.order_no like CONCAT('%',#{keyword2},'%')
)
</if>
<if
test=
" keyword3 != null and keyword3 != '' "
>
and (
o.ware_no like CONCAT('%',#{keyword3},'%')
)
</if>
<if
test=
" keyword4 != null and keyword4 != '' "
>
and (
o.ware_title like CONCAT('%',#{keyword4},'%')
)
</if>
<if
test=
" startTime != null and startTime != '' "
>
and o.create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
" endTime != null and endTime != '' "
>
and o.create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
" tranStatus != null and tranStatus != '' "
>
and o.tran_status = #{tranStatus}
</if>
<if
test=
" userIds != null"
>
<foreach
collection=
"userIds"
item=
"id"
open=
"and o.repo_account_id in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
<if
test=
" companys != null "
>
<foreach
collection=
"companys"
item=
"id"
open=
"and o.rcd_company_id in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
</where>
order by o.create_time DESC
limit #{pageNo},#{pageSize}
</select>
<select
id=
"countPcOrderInfo"
resultType=
"java.lang.Integer"
parameterType=
"com.mmc.oms.model.qo.OrderInfoQO"
>
select count(*)
from order_info o
<where>
1=1
<if
test=
" keyword1 != null and keyword1 != '' "
>
and (
o.uid like CONCAT('%',#{keyword1},'%')
or o.buyer_name like CONCAT('%',#{keyword1},'%')
)
</if>
<if
test=
" keyword2 != null and keyword2 != '' "
>
and (
o.order_no like CONCAT('%',#{keyword2},'%')
)
</if>
<if
test=
" keyword3 != null and keyword3 != '' "
>
and (
o.ware_no like CONCAT('%',#{keyword3},'%')
)
</if>
<if
test=
" keyword4 != null and keyword4 != '' "
>
and (
o.ware_title like CONCAT('%',#{keyword4},'%')
)
</if>
<if
test=
" startTime != null and startTime != '' "
>
and o.create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
" endTime != null and endTime != '' "
>
and o.create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
" tranStatus != null and tranStatus != '' "
>
and o.tran_status = #{tranStatus}
</if>
<if
test=
" userIds != null"
>
<foreach
collection=
"userIds"
item=
"id"
open=
"and o.repo_account_id in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
<if
test=
" companys != null "
>
<foreach
collection=
"companys"
item=
"id"
open=
"and o.rcd_company_id in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
</where>
</select>
<select
id=
"countOrderInfo"
resultType=
"java.lang.Integer"
>
select count(*)
from order_info o
<where>
o.tran_status = #{tranStatus}
<if
test=
" companys != null "
>
<foreach
collection=
"companys"
item=
"id"
open=
"and o.rcd_company_id in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
</where>
</select>
<select
id=
"listExpressInfo"
resultMap=
"expressInfoResultMap"
>
select ex_name, ex_code
from express_info
</select>
<insert
id=
"insertOrderVcu"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.OrderVcuDO"
>
insert into order_vcu
(order_info_id, order_refund_id, vcu_type, vcu_satus, imgs, video_url, remark, create_time)
values (#{orderInfoId}, #{orderRefundId}, #{vcuType}, #{vcuSatus}, #{imgs}, #{videoUrl}, #{remark},
#{createTime})
</insert>
<select
id=
"getOrderReceiptInfo"
resultMap=
"orderReceiptResultMap"
>
select r.*
from order_receipt r
where r.order_info_id = #{orderInfoId}
</select>
<select
id=
"getOrderVcuInfo"
resultMap=
"orderVcuResultMap"
>
select v.id,v.order_info_id,v.vcu_satus,v.imgs,v.video_url
from order_vcu v
where v.order_info_id = #{orderInfoId}
<if
test=
"vcuType != null"
>
and v.vcu_type = #{vcuType}
</if>
</select>
<select
id=
"getRefundVcuInfo"
resultMap=
"orderVcuResultMap"
>
select v.id,v.order_info_id,v.vcu_satus,v.imgs,v.video_url
from order_vcu v
where v.order_refund_id = #{orderRefundId}
<if
test=
"vcuType != null"
>
and v.vcu_type = #{vcuType}
</if>
</select>
<select
id=
"listOrderVcuInfo"
resultMap=
"orderVcuResultMap"
>
select v.id, v.order_info_id, v.vcu_type, v.vcu_satus, v.imgs, v.video_url, v.remark
from order_vcu v
where v.order_info_id = #{orderInfoId}
</select>
<select
id=
"listOrderByTranStatus"
resultMap=
"orderInfoResultMap"
>
select o.id, o.order_no, o.create_time
from order_info o
where o.tran_status = #{tranStatus}
</select>
<select
id=
"listPcOrderInfoCount"
resultType=
"java.lang.Integer"
>
SELECT COUNT(*)
FROM order_info o
INNER JOIN order_receipt rp ON rp.order_info_id = o.id
WHERE o.tran_status in (200, 500)
</select>
<select
id=
"getOrderInfoCount"
resultType=
"java.lang.Integer"
>
SELECT count(*) count
FROM
order_info
WHERE
date ( create_time )
>
= date_sub( DATE_FORMAT(#{date}
, "%Y-%m-%d")
, INTERVAL ${day} DAY )
AND
date ( create_time )
<
= date_sub( DATE_FORMAT(#{date}
, "%Y-%m-%d")
, INTERVAL 1 DAY)
</select>
<select
id=
"getOrderInfoCountToYesterday"
resultType=
"java.lang.Integer"
>
SELECT count(*)
FROM order_info
WHERE
date ( create_time ) = date_sub( DATE_FORMAT(#{date}
, "%Y-%m-%d")
, INTERVAL ${day} DAY )
</select>
<update
id=
"batchUpdateConfirmTake"
>
update order_info
set tran_status = 400
where tran_status = 300
and update_time
<
= DATE_SUB(CURDATE(), INTERVAL 10 DAY)
</update>
</mapper>
src/main/resources/mapper/OrderRefundDao.xml
0 → 100644
浏览文件 @
8826de2a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mmc.oms.dao.OrderRefundDao"
>
<select
id=
"countValidRefund"
resultType=
"Integer"
>
select count(*)
from order_refund r
where r.order_info_id = #{orderInfoId}
and r.refund_status != '999'
</select>
<insert
id=
"insertOrderRefund"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.OrderRefundDO"
>
insert into order_refund
(order_info_id, refund_no, refund_status, should_refund, actual_refund, reason, create_time, user_account_id)
values (#{orderInfoId}, #{refundNo}, #{refundStatus}, #{shouldRefund}, #{actualRefund}, #{reason},
#{createTime}, #{userAccountId})
</insert>
<insert
id=
"insertOrderVcu"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.OrderVcuDO"
>
insert into order_vcu
(order_info_id, order_refund_id, vcu_type, vcu_satus, imgs, video_url, remark, create_time)
values (#{orderInfoId}, #{orderRefundId}, #{vcuType}, #{vcuSatus}, #{imgs}, #{videoUrl}, #{remark},
#{createTime})
</insert>
</mapper>
src/main/resources/mapper/RentalOrdersDao.xml
浏览文件 @
8826de2a
...
...
@@ -509,7 +509,7 @@
where id = #{id}
</update>
<select
id=
"getOrderReceiptByOrder"
resultMap=
"orderReceiptResultMap"
parameterType=
"Integer"
>
<select
id=
"getOrderReceiptByOrder"
resultMap=
"orderReceiptResultMap"
parameterType=
"
java.lang.
Integer"
>
select r.id,
r.order_info_id,
r.receipt_method,
...
...
@@ -535,7 +535,7 @@
o.order_no AS orderNo,
o.ware_title AS wareTitle,
o.ware_img AS wareImg,
o.
rent_price AS rentPrice
,
o.
actual_pay AS actualPay
,
o.ware_description AS wareDescription,
o.tran_status AS tranStatus,
tsd.waiting,
...
...
@@ -568,4 +568,19 @@
and o.tran_status = #{orderStatus}
</if>
</select>
<update
id=
"updateOrder"
>
update order_info
set tran_status=#{code}
where order_no = #{orderNo}
</update>
<select
id=
"getApplicationInformation"
resultType=
"com.mmc.oms.entity.OrderRefundDO"
>
SELECT id,
order_info_id AS orderInfoId,
refund_no AS refundNo,
user_account_id AS userAccountId
FROM order_refund
where order_info_id = #{id}
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论