Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
oms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
oms
Commits
03bbca04
提交
03bbca04
authored
9月 07, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Order(update)
上级
df265922
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
242 行增加
和
1 行删除
+242
-1
NotRepeatSubmitConfig.java
...c/oms/controller/demand/commit/NotRepeatSubmitConfig.java
+28
-0
OrderLevelEnum.java
src/main/java/com/mmc/oms/entity/demand/OrderLevelEnum.java
+71
-0
ServiceRequirementsDO.java
...java/com/mmc/oms/entity/demand/ServiceRequirementsDO.java
+134
-0
application-dev.yml
src/main/resources/application-dev.yml
+3
-0
application-local.yml
src/main/resources/application-local.yml
+4
-1
application-prod.yml
src/main/resources/application-prod.yml
+2
-0
没有找到文件。
src/main/java/com/mmc/oms/controller/demand/commit/NotRepeatSubmitConfig.java
浏览文件 @
03bbca04
...
@@ -6,6 +6,7 @@ import com.mmc.oms.controller.BaseController;
...
@@ -6,6 +6,7 @@ import com.mmc.oms.controller.BaseController;
import
com.mmc.oms.dao.demand.DemandReleaseOrderDao
;
import
com.mmc.oms.dao.demand.DemandReleaseOrderDao
;
import
com.mmc.oms.entity.demand.GetOrderNumberDO
;
import
com.mmc.oms.entity.demand.GetOrderNumberDO
;
import
com.mmc.oms.entity.demand.GetOrderNumberDTO
;
import
com.mmc.oms.entity.demand.GetOrderNumberDTO
;
import
com.mmc.oms.entity.demand.ServiceRequirementsDO
;
import
com.mmc.oms.model.vo.demand.CommonPaymentVO
;
import
com.mmc.oms.model.vo.demand.CommonPaymentVO
;
import
com.mmc.oms.model.vo.demand.UserPayInfoVO
;
import
com.mmc.oms.model.vo.demand.UserPayInfoVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -57,6 +58,10 @@ public class NotRepeatSubmitConfig extends BaseController {
...
@@ -57,6 +58,10 @@ public class NotRepeatSubmitConfig extends BaseController {
@Value
(
"${payment.url}"
)
@Value
(
"${payment.url}"
)
private
String
paymentApp
;
private
String
paymentApp
;
@Value
(
"${ims.url}"
)
private
String
imsApp
;
@Pointcut
(
"@within(notRepeatSubmit)||@annotation(notRepeatSubmit)"
)
@Pointcut
(
"@within(notRepeatSubmit)||@annotation(notRepeatSubmit)"
)
public
void
pointcut
(
NotRepeatSubmit
notRepeatSubmit
)
{
public
void
pointcut
(
NotRepeatSubmit
notRepeatSubmit
)
{
...
@@ -111,6 +116,11 @@ public class NotRepeatSubmitConfig extends BaseController {
...
@@ -111,6 +116,11 @@ public class NotRepeatSubmitConfig extends BaseController {
log
.
info
(
"tryLock:"
+
tryLock
);
log
.
info
(
"tryLock:"
+
tryLock
);
if
(
tryLock
)
{
if
(
tryLock
)
{
try
{
try
{
ServiceRequirementsDO
repertory
=
repertory
(
requirementsInfoId
,
request
);
Integer
repertory1
=
repertory
.
getRepertory
();
if
(
repertory1
<=
0
){
return
ResultBody
.
error
(
"需求已被人抢走"
);
}
String
orderNumber
=
commonPaymentsVO
.
getOrderNumber
();
String
orderNumber
=
commonPaymentsVO
.
getOrderNumber
();
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
orderNumber
);
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
orderNumber
);
GetOrderNumberDTO
getOrderNumberDTO
=
JSONObject
.
parseObject
(
json
,
GetOrderNumberDTO
.
class
);
GetOrderNumberDTO
getOrderNumberDTO
=
JSONObject
.
parseObject
(
json
,
GetOrderNumberDTO
.
class
);
...
@@ -166,5 +176,23 @@ public class NotRepeatSubmitConfig extends BaseController {
...
@@ -166,5 +176,23 @@ public class NotRepeatSubmitConfig extends BaseController {
return
body
;
return
body
;
}
}
/**
* 通过订单编号查看是否支付成功
*
* @param requirementsInfoId
* @return
*/
public
ServiceRequirementsDO
repertory
(
Integer
requirementsInfoId
,
HttpServletRequest
request
)
{
String
token
=
request
.
getHeader
(
"token"
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
add
(
"token"
,
token
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
JSONObject
.
toJSONString
(
requirementsInfoId
),
headers
);
ResponseEntity
<
ServiceRequirementsDO
>
exchange
=
restTemplate
.
exchange
(
imsApp
+
"requirements/repertory?requirementsInfoId="
+
requirementsInfoId
,
HttpMethod
.
GET
,
entity
,
ServiceRequirementsDO
.
class
);
ServiceRequirementsDO
body
=
exchange
.
getBody
();
return
body
;
}
}
}
src/main/java/com/mmc/oms/entity/demand/OrderLevelEnum.java
0 → 100644
浏览文件 @
03bbca04
package
com
.
mmc
.
oms
.
entity
.
demand
;
import
java.math.BigDecimal
;
/**
* @Author small
* @Date 2023/9/7 15:54
* @Version 1.0
*/
public
enum
OrderLevelEnum
{
//普通订单
REGULAR_ORDER
(
"REGULAR_ORDER"
,
new
BigDecimal
(
0
)),
//紧急订单
RUSH_ORDER
(
"RUSH_ORDER"
,
new
BigDecimal
(
100
)),
//置顶订单
TOP_ORDER
(
"TOP_ORDER"
,
new
BigDecimal
(
300
));
private
String
key
;
private
BigDecimal
value
;
private
OrderLevelEnum
(
String
key
,
BigDecimal
value
)
{
this
.
key
=
key
;
this
.
value
=
value
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
BigDecimal
getValue
()
{
return
value
;
}
public
void
setValue
(
BigDecimal
value
)
{
this
.
value
=
value
;
}
public
static
OrderLevelEnum
match
(
String
key
)
{
OrderLevelEnum
result
=
null
;
for
(
OrderLevelEnum
s
:
values
())
{
if
(
s
.
getKey
()
==
key
)
{
result
=
s
;
break
;
}
}
return
result
;
}
public
static
OrderLevelEnum
catchMessage
(
BigDecimal
value
)
{
OrderLevelEnum
result
=
null
;
for
(
OrderLevelEnum
s
:
values
())
{
if
(
s
.
getValue
().
equals
(
value
))
{
result
=
s
;
break
;
}
}
return
result
;
}
}
src/main/java/com/mmc/oms/entity/demand/ServiceRequirementsDO.java
0 → 100644
浏览文件 @
03bbca04
package
com
.
mmc
.
oms
.
entity
.
demand
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mmc.oms.common.publicinterface.Insert
;
import
com.mmc.oms.common.publicinterface.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/9/7 15:50
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
ServiceRequirementsDO
{
private
static
final
long
serialVersionUID
=
-
447951390213113317L
;
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@ApiModelProperty
(
value
=
"id"
)
@NotBlank
(
message
=
"服务类型id不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
private
Integer
serviceId
;
@ApiModelProperty
(
value
=
"飞行日期——任务开始时间"
,
example
=
"2023-07-25"
,
required
=
true
)
@NotNull
(
message
=
"任务开始时间不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
taskStartTime
;
@ApiModelProperty
(
value
=
"飞行日期——任务结束时间"
,
example
=
"2023-07-26"
,
required
=
true
)
@NotNull
(
message
=
"任务开始时间不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
taskEndTime
;
@ApiModelProperty
(
value
=
"飞行位置——任务地址"
,
example
=
"广东省深圳市"
,
required
=
true
)
@NotBlank
(
message
=
"任务地址不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
private
String
taskAddress
;
@ApiModelProperty
(
value
=
"飞行位置——任务经度"
,
example
=
"23.344324"
,
required
=
true
)
@NotNull
(
message
=
"任务经度不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
private
Double
longitude
;
@ApiModelProperty
(
value
=
"飞行位置——任务纬度"
,
example
=
"44.344324"
,
required
=
true
)
@NotNull
(
message
=
"任务纬度不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
private
Double
latitude
;
@ApiModelProperty
(
value
=
"需求描述"
,
example
=
"描述一下"
,
required
=
true
)
@NotNull
(
message
=
"需求描述不能为空"
,
groups
=
{
Insert
.
class
})
@Length
(
max
=
300
,
message
=
"字符过长"
)
private
String
requireDescription
;
@ApiModelProperty
(
value
=
"订单金额"
,
example
=
"订单金额"
,
required
=
true
)
@NotNull
(
message
=
"订单金额"
,
groups
=
{
Insert
.
class
})
private
BigDecimal
orderAmount
;
@ApiModelProperty
(
value
=
"飞手保险"
,
example
=
"飞手保险"
,
required
=
true
)
@NotNull
(
message
=
"飞手保险"
,
groups
=
{
Insert
.
class
})
private
String
insurance
;
@ApiModelProperty
(
value
=
"订单级别"
,
example
=
"订单级别"
,
required
=
true
)
@NotNull
(
message
=
"订单级别"
,
groups
=
{
Insert
.
class
})
private
OrderLevelEnum
orderLevelEnum
;
@ApiModelProperty
(
value
=
"后台获取token里面的用户id"
,
hidden
=
true
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"发布者姓名"
,
example
=
"张三"
)
private
String
publishName
;
@ApiModelProperty
(
value
=
"发布者电话"
,
example
=
"1892994543"
,
required
=
true
)
@NotNull
(
message
=
"发布者电话不能为空"
,
groups
=
{
Insert
.
class
})
private
String
publishPhone
;
@ApiModelProperty
(
value
=
"发布者订单编号"
)
private
String
publisherNumber
;
@ApiModelProperty
(
value
=
"0普通 100急单 300置顶"
)
private
BigDecimal
orderLevelAmount
;
@ApiModelProperty
(
value
=
"订单级别 REGULAR_ORDER,RUSH_ORDER,TOP_ORDER"
)
private
String
orderLevel
;
@ApiModelProperty
(
value
=
"总金额"
,
example
=
"100"
,
required
=
true
)
@NotNull
(
message
=
"总金额"
,
groups
=
{
Insert
.
class
})
private
BigDecimal
totalAmount
;
@ApiModelProperty
(
value
=
"云享金"
,
example
=
"10"
)
private
BigDecimal
cashAmount
;
@ApiModelProperty
(
value
=
"佣金"
,
example
=
"10"
)
private
BigDecimal
salaryAmount
;
@ApiModelProperty
(
value
=
"微信金额"
,
example
=
"10"
)
private
BigDecimal
weChat
;
@ApiModelProperty
(
value
=
"微信支付订单编号"
,
example
=
"R202308191657303116170"
)
private
String
wechatPayOrderNumber
;
private
Integer
repertory
;
@ApiModelProperty
(
value
=
"支付方式,云享金:1,佣金:2,微信支付:3"
,
example
=
"1,2,3"
)
private
String
paymentType
;
@ApiModelProperty
(
value
=
"地区编码"
)
private
String
adcode
;
@ApiModelProperty
(
value
=
"置顶/加急 佣金支付多少"
,
example
=
"100"
)
private
BigDecimal
levelSalaryAmount
;
@ApiModelProperty
(
value
=
"置顶/加急 微信支付多少"
,
example
=
"100"
)
private
BigDecimal
levelWeChatAmount
;
@ApiModelProperty
(
value
=
"置顶/加急 云享金支付多少"
,
example
=
"100"
)
private
BigDecimal
levelCashAmount
;
@ApiModelProperty
(
value
=
"openid"
)
private
String
openid
;
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
}
src/main/resources/application-dev.yml
浏览文件 @
03bbca04
...
@@ -67,5 +67,8 @@ payment:
...
@@ -67,5 +67,8 @@ payment:
pms
:
pms
:
url
:
https://test.iuav.shop/pms/
url
:
https://test.iuav.shop/pms/
ims
:
url
:
https://test.iuav.shop/release/
src/main/resources/application-local.yml
浏览文件 @
03bbca04
...
@@ -7,8 +7,9 @@ spring:
...
@@ -7,8 +7,9 @@ spring:
password
:
IUAV_DEV@2023&MYSQL
password
:
IUAV_DEV@2023&MYSQL
redis
:
redis
:
database
:
1
database
:
1
host
:
127.0.0.1
host
:
r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
port
:
6379
port
:
6379
password
:
MMC@2022&REDIS
jedis
:
jedis
:
pool
:
pool
:
max-active
:
2
max-active
:
2
...
@@ -57,5 +58,7 @@ payment:
...
@@ -57,5 +58,7 @@ payment:
pms
:
pms
:
url
:
http://localhost:8099/pms/
url
:
http://localhost:8099/pms/
ims
:
url
:
http://localhost:10001/release/
src/main/resources/application-prod.yml
浏览文件 @
03bbca04
...
@@ -66,3 +66,5 @@ payment:
...
@@ -66,3 +66,5 @@ payment:
pms
:
pms
:
url
:
https://www.iuav.shop/pms/
url
:
https://www.iuav.shop/pms/
ims
:
url
:
https://www.iuav.shop/release/
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论