Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
d922aaa8
Commit
d922aaa8
authored
Sep 20, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户端代码提交
parent
4f122287
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
12 deletions
+42
-12
pz-applet/src/main/java/com/pz/applet/AppletEmployeesController.java
+4
-2
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+37
-9
pz-system/src/main/resources/mapper/merchant/EmployeesMapper.xml
+1
-1
No files found.
pz-applet/src/main/java/com/pz/applet/AppletEmployeesController.java
View file @
d922aaa8
...
@@ -47,7 +47,8 @@ public class AppletEmployeesController extends BaseController {
...
@@ -47,7 +47,8 @@ public class AppletEmployeesController extends BaseController {
* 需求广场
* 需求广场
*/
*/
@GetMapping
(
"/needList"
)
@GetMapping
(
"/needList"
)
public
TableDataInfo
<
EmployeesVo
>
needList
(
EmployeesBo
bo
,
PageQuery
pageQuery
)
{
public
TableDataInfo
<
EmployeesVo
>
needList
(
EmployeesBo
bo
,
PageQuery
pageQuery
,
HttpServletRequest
reques
)
{
bo
.
setCityId
(
CityIdUtils
.
setCityIdPasLong
(
reques
));
return
iEmployeesService
.
queryPageAppNeed
(
bo
,
pageQuery
);
return
iEmployeesService
.
queryPageAppNeed
(
bo
,
pageQuery
);
}
}
...
@@ -55,7 +56,8 @@ public class AppletEmployeesController extends BaseController {
...
@@ -55,7 +56,8 @@ public class AppletEmployeesController extends BaseController {
* 排行榜
* 排行榜
*/
*/
@GetMapping
(
"/rankingList"
)
@GetMapping
(
"/rankingList"
)
public
TableDataInfo
<
EmployeesVo
>
rankingList
(
EmployeesBo
bo
,
PageQuery
pageQuery
)
{
public
TableDataInfo
<
EmployeesVo
>
rankingList
(
EmployeesBo
bo
,
PageQuery
pageQuery
,
HttpServletRequest
reques
)
{
bo
.
setCityId
(
CityIdUtils
.
setCityIdPasLong
(
reques
));
return
iEmployeesService
.
queryPageAppRanking
(
bo
,
pageQuery
);
return
iEmployeesService
.
queryPageAppRanking
(
bo
,
pageQuery
);
}
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
d922aaa8
...
@@ -47,6 +47,7 @@ import com.pz.system.mapper.*;
...
@@ -47,6 +47,7 @@ import com.pz.system.mapper.*;
import
com.pz.system.service.IPayService
;
import
com.pz.system.service.IPayService
;
import
com.pz.system.service.ITotalOrderService
;
import
com.pz.system.service.ITotalOrderService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -69,6 +70,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -69,6 +70,7 @@ import java.util.concurrent.TimeUnit;
*/
*/
@RequiredArgsConstructor
@RequiredArgsConstructor
@Service
@Service
@Slf4j
public
class
TotalOrderServiceImpl
implements
ITotalOrderService
{
public
class
TotalOrderServiceImpl
implements
ITotalOrderService
{
private
final
TotalOrderMapper
baseMapper
;
private
final
TotalOrderMapper
baseMapper
;
...
@@ -663,15 +665,15 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -663,15 +665,15 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
employeesDivideMapper
.
insert
(
employeesDivide
);
employeesDivideMapper
.
insert
(
employeesDivide
);
if
(
totalOrder1
.
getBusinessId
()
==
0
){
ISonOrderService
orderService
=
serviceBuilder
.
getSonOrderService
(
totalOrder1
.
getBusinessId
());
// 修改子订单状态
orderService
.
switchSonOrderStatus
(
totalOrder1
.
getId
(),
CommonOrderStatus
.
DONE
.
getCode
());
}
}
}
if
(
totalOrder1
.
getBusinessId
()
==
0
&&
totalOrder1
.
getStatus
()
==
1
){
ISonOrderService
orderService
=
serviceBuilder
.
getSonOrderService
(
totalOrder1
.
getBusinessId
());
// 修改子订单状态
orderService
.
switchSonOrderStatus
(
totalOrder1
.
getId
(),
CommonOrderStatus
.
DONE
.
getCode
());
}
return
baseMapper
.
updateById
(
totalOrder
)
>
0
;
return
baseMapper
.
updateById
(
totalOrder
)
>
0
;
}
}
...
@@ -876,7 +878,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -876,7 +878,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
}
else
{
}
else
{
// 一般陪诊订单
// 一般陪诊订单
// 一般订单开始服务时间
// 一般订单开始服务时间
String
serveTime
=
orderService
.
getFinishTime
(
totalOrder
.
get
BusinessId
());
String
serveTime
=
orderService
.
getFinishTime
(
totalOrder
.
get
Id
().
intValue
());
if
(
StringUtils
.
isNotEmpty
(
serveTime
))
{
if
(
StringUtils
.
isNotEmpty
(
serveTime
))
{
money
=
getMoney
(
serveTime
,
totalOrder
.
getPayMoney
());
// 计算退款金额
money
=
getMoney
(
serveTime
,
totalOrder
.
getPayMoney
());
// 计算退款金额
}
else
{
}
else
{
...
@@ -1199,14 +1201,14 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -1199,14 +1201,14 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
}
}
}
}
public
long
getHour
(
String
date
)
{
public
static
long
getHour
(
String
date
)
{
LocalDateTime
startTime
=
LocalDateTime
.
parse
(
date
,
FORMATTER
);
LocalDateTime
startTime
=
LocalDateTime
.
parse
(
date
,
FORMATTER
);
// 获取当前时间
// 获取当前时间
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
// 计算当前时间和订单开始时间之间的时间差
// 计算当前时间和订单开始时间之间的时间差
Duration
duration
=
Duration
.
between
(
startTime
,
now
);
Duration
duration
=
Duration
.
between
(
now
,
startTime
);
return
duration
.
toHours
();
return
duration
.
toHours
();
}
}
...
@@ -1234,6 +1236,32 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -1234,6 +1236,32 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
return
money
;
return
money
;
}
}
public
static
void
main
(
String
[]
args
)
{
String
serveTime
=
"2023-09-20 20:45:42"
;
double
payMoney
=
0.5
;
double
money
=
0
;
double
deduction
=
0
;
double
remainingAmount
=
0
;
long
hour
=
getHour
(
serveTime
);
if
(
hour
>
6
)
{
money
=
payMoney
;
}
else
if
(
hour
>=
3
)
{
// 计算扣除30%后的金额
deduction
=
payMoney
*
0.3
;
remainingAmount
=
payMoney
-
deduction
;
money
=
remainingAmount
;
}
else
if
(
hour
>=
0
)
{
// 计算扣除50%后的金额
deduction
=
payMoney
*
0.5
;
remainingAmount
=
payMoney
-
deduction
;
money
=
remainingAmount
;
}
System
.
out
.
println
(
money
);
}
public
int
getIsRefund
(
int
businessId
,
int
businessStatus
,
int
ServiceStatus
)
{
public
int
getIsRefund
(
int
businessId
,
int
businessStatus
,
int
ServiceStatus
)
{
int
IsRefund
=
0
;
int
IsRefund
=
0
;
if
((
businessStatus
==
1
&&
ServiceStatus
==
0
)
||
(
businessStatus
==
1
&&
ServiceStatus
==
1
))
{
if
((
businessStatus
==
1
&&
ServiceStatus
==
0
)
||
(
businessStatus
==
1
&&
ServiceStatus
==
1
))
{
...
...
pz-system/src/main/resources/mapper/merchant/EmployeesMapper.xml
View file @
d922aaa8
...
@@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join total_order o on o.em_id = e.id
left join total_order o on o.em_id = e.id
left join company c on c.id = e.company_id
left join company c on c.id = e.company_id
left join sys_user s on s.user_id = e.uid
left join sys_user s on s.user_id = e.uid
WHERE e.`status` = 1 and e.del_flag= 0
WHERE e.`status` = 1 and e.del_flag= 0
and e.city_id = #{bo.cityId}
<if
test=
"bo.companyId > 0"
>
<if
test=
"bo.companyId > 0"
>
and e.company_id = #{bo.companyId}
and e.company_id = #{bo.companyId}
</if>
</if>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment