Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
c34f9e97
Commit
c34f9e97
authored
Apr 13, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美甲师评分
parent
a02897e3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
394 additions
and
240 deletions
+394
-240
ScheduleManageService.java
...gogirl/application/order/serve/ScheduleManageService.java
+5
-5
ScheduleManageServiceImpl.java
...plication/order/serve/impl/ScheduleManageServiceImpl.java
+0
-0
TechScoreRulesServiceImpl.java
...lication/store/career/impl/TechScoreRulesServiceImpl.java
+81
-14
CustomerServiceImpl.java
...l/application/user/customer/impl/CustomerServiceImpl.java
+18
-17
TechScoreRules.java
...n/java/com/gogirl/domain/store/career/TechScoreRules.java
+2
-0
IdleTimeProgramQuery.java
src/main/java/com/gogirl/dto/IdleTimeProgramQuery.java
+0
-127
IdleTimeQry.java
src/main/java/com/gogirl/dto/IdleTimeQry.java
+33
-0
TechScore.java
src/main/java/com/gogirl/dto/TechScore.java
+1
-1
AchievementsPersonaResult.java
.../java/com/gogirl/dto/admin/AchievementsPersonaResult.java
+71
-0
AchievementsPersonaResultPageApiRequest.java
...rl/dto/admin/AchievementsPersonaResultPageApiRequest.java
+20
-0
GogirlProperties.java
...girl/infrastructure/config/property/GogirlProperties.java
+2
-0
PrefixUtils.java
...main/java/com/gogirl/infrastructure/util/PrefixUtils.java
+45
-0
ScheduleManageController.java
...girl/interfaces/order/serve/ScheduleManageController.java
+15
-9
CustomerController.java
...n/java/com/gogirl/interfaces/user/CustomerController.java
+30
-49
FileController.java
src/main/java/com/gogirl/interfaces/user/FileController.java
+40
-0
MessageController.java
...in/java/com/gogirl/interfaces/user/MessageController.java
+15
-14
IdleTimeQuery.java
...om/gogirl/shared/order/serve/query/qry/IdleTimeQuery.java
+5
-4
Period.java
.../java/com/gogirl/shared/order/serve/query/qry/Period.java
+7
-0
application-dev.yml
src/main/resources/application-dev.yml
+1
-0
application-pre.yml
src/main/resources/application-pre.yml
+1
-0
application-prod.yml
src/main/resources/application-prod.yml
+1
-0
application-test.yml
src/main/resources/application-test.yml
+1
-0
No files found.
src/main/java/com/gogirl/application/order/serve/ScheduleManageService.java
View file @
c34f9e97
...
@@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.gogirl.domain.order.serve.ScheduleManage
;
import
com.gogirl.domain.order.serve.ScheduleManage
;
import
com.gogirl.domain.order.serve.ScheduleServe
;
import
com.gogirl.domain.order.serve.ScheduleServe
;
import
com.gogirl.domain.store.store.StoreTechnician
;
import
com.gogirl.domain.store.store.StoreTechnician
;
import
com.gogirl.dto.IdleTimeProgramQuery
;
import
com.gogirl.dto.LeisureScheduleServe
;
import
com.gogirl.dto.LeisureScheduleServe
;
import
com.gogirl.dto.LeisureScheduleServeQuery
;
import
com.gogirl.dto.LeisureScheduleServeQuery
;
import
com.gogirl.shared.order.serve.command.schedule.CancelScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.CancelScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.SubmitScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.SubmitScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.UpdateScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.UpdateScheduleCommand
;
import
com.gogirl.shared.order.serve.query.dto.IdleTimeDTO
;
import
com.gogirl.shared.order.serve.query.dto.IdleTimeDTO
;
import
com.gogirl.shared.order.serve.query.qry.IdleTimeQuery
;
import
com.gogirl.shared.order.serve.query.qry.StoreTechnicianPeriod
;
import
com.gogirl.shared.order.serve.query.qry.StoreTechnicianPeriod
;
import
com.gogirl.shared.order.serve.query.qry.schedule.ScheduleManagePageQuery
;
import
com.gogirl.shared.order.serve.query.qry.schedule.ScheduleManagePageQuery
;
...
@@ -31,11 +31,11 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
...
@@ -31,11 +31,11 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
/**
/**
* 普通预约入口查询预约时间
* 普通预约入口查询预约时间
*
*
* @param
param
param
* @param
query
param
* @return list
* @return list
* @throws ParseException exception
* @throws ParseException exception
*/
*/
List
<
IdleTimeDTO
>
queryIdleTime
(
IdleTime
ProgramQuery
param
)
throws
ParseException
,
ExecutionException
,
InterruptedException
;
List
<
IdleTimeDTO
>
queryIdleTime
(
IdleTime
Query
query
)
throws
ParseException
,
ExecutionException
,
InterruptedException
;
/**
/**
* 闲时入口查询预约时间
* 闲时入口查询预约时间
...
@@ -89,7 +89,7 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
...
@@ -89,7 +89,7 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
*
*
* @param cmd 提交预约命令
* @param cmd 提交预约命令
*/
*/
void
submitSchedule
(
SubmitScheduleCommand
cmd
);
void
submitSchedule
(
SubmitScheduleCommand
cmd
)
throws
ParseException
,
ExecutionException
,
InterruptedException
;
/**
/**
* 更新预约
* 更新预约
...
@@ -97,7 +97,7 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
...
@@ -97,7 +97,7 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
* @param cmd
* @param cmd
* @return
* @return
*/
*/
void
updateSchedule
(
SubmitScheduleCommand
cmd
);
void
updateSchedule
(
SubmitScheduleCommand
cmd
)
throws
ParseException
,
ExecutionException
,
InterruptedException
;
/**
/**
* 更新预约前检查
* 更新预约前检查
...
...
src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
View file @
c34f9e97
This diff is collapsed.
Click to expand it.
src/main/java/com/gogirl/application/store/career/impl/TechScoreRulesServiceImpl.java
View file @
c34f9e97
package
com
.
gogirl
.
application
.
store
.
career
.
impl
;
package
com
.
gogirl
.
application
.
store
.
career
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.gogirl.application.store.career.ITechScoreRulesService
;
import
com.gogirl.application.store.career.ITechScoreRulesService
;
import
com.gogirl.domain.store.career.Career
;
import
com.gogirl.domain.store.career.TechScoreRules
;
import
com.gogirl.domain.store.career.TechScoreRules
;
import
com.gogirl.dto.TechScore
;
import
com.gogirl.dto.TechScore
;
import
com.gogirl.dto.admin.AchievementsPersonaResult
;
import
com.gogirl.dto.admin.AchievementsPersonaResultPageApiRequest
;
import
com.gogirl.dto.admin.AdminPage
;
import
com.gogirl.dto.admin.AdminResult
;
import
com.gogirl.infrastructure.config.property.GogirlProperties
;
import
com.gogirl.infrastructure.mapper.store.career.CareerMapper
;
import
com.gogirl.infrastructure.mapper.store.career.CareerMapper
;
import
com.gogirl.infrastructure.mapper.store.career.TechScoreRulesMapper
;
import
com.gogirl.infrastructure.mapper.store.career.TechScoreRulesMapper
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
lombok.AllArgsConstructor
;
import
org.springframework.core.ParameterizedTypeReference
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -23,24 +34,80 @@ import java.util.List;
...
@@ -23,24 +34,80 @@ import java.util.List;
* @since 2020-03-12
* @since 2020-03-12
*/
*/
@Service
@Service
@AllArgsConstructor
public
class
TechScoreRulesServiceImpl
extends
ServiceImpl
<
TechScoreRulesMapper
,
TechScoreRules
>
implements
ITechScoreRulesService
{
public
class
TechScoreRulesServiceImpl
extends
ServiceImpl
<
TechScoreRulesMapper
,
TechScoreRules
>
implements
ITechScoreRulesService
{
private
final
CareerMapper
careerMapper
;
@Resource
private
CareerMapper
careerMapper
;
@Resource
RestTemplate
restTemplate
;
@Resource
GogirlProperties
gogirlProperties
;
@Override
@Override
public
TechScore
getTechScore
()
{
public
TechScore
getTechScore
()
{
Integer
technicianId
=
SessionUtils
.
getTechnicianId
();
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
List
<
TechScoreRules
>
techScoreRulesList
=
this
.
list
();
httpHeaders
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
Career
career
=
careerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Career
>()
.
eq
(
Career:
:
getTechnicianId
,
technicianId
));
Calendar
calendar
=
Calendar
.
getInstance
();
AchievementsPersonaResultPageApiRequest
resultPageApiRequest
=
AchievementsPersonaResultPageApiRequest
.
builder
()
.
page
(
1
)
.
year
(
calendar
.
get
(
Calendar
.
YEAR
))
.
month
(
calendar
.
get
(
Calendar
.
MONTH
))
.
status
(
1
)
.
page
(
1
)
.
rows
(
30
)
.
sidx
(
""
)
.
sord
(
"desc"
)
.
technician_id
(
SessionUtils
.
getTechnicianId
())
.
build
();
HttpEntity
<
AchievementsPersonaResultPageApiRequest
>
httpEntity
=
new
HttpEntity
<>(
resultPageApiRequest
,
httpHeaders
);
ParameterizedTypeReference
<
AdminResult
<
AdminPage
<
AchievementsPersonaResult
>>>
responseBodyType
=
new
ParameterizedTypeReference
<
AdminResult
<
AdminPage
<
AchievementsPersonaResult
>>>()
{
};
AdminResult
<
AdminPage
<
AchievementsPersonaResult
>>
result
=
restTemplate
.
exchange
(
gogirlProperties
.
getAdminBackendAchievementsUrl
(),
HttpMethod
.
POST
,
httpEntity
,
responseBodyType
).
getBody
();
AchievementsPersonaResult
achievementsPersonaResult
=
result
.
getData
().
getItems
().
stream
().
findAny
().
orElseThrow
(
NullPointerException:
:
new
);
TechScore
techScore
=
new
TechScore
();
TechScore
techScore
=
new
TechScore
();
techScore
.
setTechScore
(
achievementsPersonaResult
.
getMonth_score
().
doubleValue
());
List
<
TechScoreRules
>
techScoreRulesList
=
new
ArrayList
<>();
String
card
=
String
.
format
(
"开卡得分:%s。开卡率:%s。权重:%s。规则:20%%该项满分、5%%该项0分。可以超过100分"
,
achievementsPersonaResult
.
getActivate_a_card_score
().
toString
(),
achievementsPersonaResult
.
getActivate_a_card_val
().
toString
()
,
achievementsPersonaResult
.
getActivate_a_card_proportion_str
());
TechScoreRules
t1
=
TechScoreRules
.
builder
().
sort
(
1
).
techScoreRules
(
card
).
build
();
techScoreRulesList
.
add
(
t1
);
//好评得分
String
comment
=
String
.
format
(
"好评率得分:%s。好评率:%s。权重:%s。规则:分数=好评(>3星)数/总评论数*100,评论包括所有渠道投诉。"
,
achievementsPersonaResult
.
getPraise_score
().
toString
()
,
achievementsPersonaResult
.
getPraise_val
().
toString
()
,
achievementsPersonaResult
.
getPraise_proportion_str
());
TechScoreRules
t2
=
TechScoreRules
.
builder
().
sort
(
2
).
techScoreRules
(
comment
).
build
();
techScoreRulesList
.
add
(
t2
);
//服务准时得分
String
serviceTime
=
String
.
format
(
"服务准时得分: %s。服务准时得分率:%s。权重: %s。规则:+10%%,-20%%以内为准。90%%出勤率为满分"
,
achievementsPersonaResult
.
getService_time_score
().
toString
()
,
achievementsPersonaResult
.
getService_time_val
().
toString
()
,
achievementsPersonaResult
.
getService_time_proportion_str
());
TechScoreRules
t3
=
TechScoreRules
.
builder
().
sort
(
3
).
techScoreRules
(
serviceTime
).
build
();
techScoreRulesList
.
add
(
t3
);
//店务得分
String
shop
=
String
.
format
(
"店务得分:%s。权重:%s。规则:该项得分为满分,抽查发现问题时一个问题扣1分"
,
achievementsPersonaResult
.
getShop_item_score
().
toString
()
,
achievementsPersonaResult
.
getShop_item_proportion_str
());
TechScoreRules
t4
=
TechScoreRules
.
builder
().
sort
(
4
).
techScoreRules
(
shop
).
build
();
techScoreRulesList
.
add
(
t4
);
//总分
String
total
=
String
.
format
(
"总分:%s。规则:按月计算,达到满分以上奖励300元,低于80分罚500元"
,
achievementsPersonaResult
.
getMonth_score
().
toString
());
TechScoreRules
t5
=
TechScoreRules
.
builder
().
sort
(
5
).
techScoreRules
(
total
).
build
();
techScoreRulesList
.
add
(
t5
);
techScore
.
setTechScoreRulesList
(
techScoreRulesList
);
techScore
.
setTechScoreRulesList
(
techScoreRulesList
);
if
(
career
!=
null
)
{
techScore
.
setTechScore
(
career
.
getTechScore
());
}
else
{
techScore
.
setTechScore
(
0
);
}
return
techScore
;
return
techScore
;
}
}
}
}
src/main/java/com/gogirl/application/user/customer/impl/CustomerServiceImpl.java
View file @
c34f9e97
...
@@ -12,7 +12,6 @@ import com.gogirl.application.xcx.WechatService;
...
@@ -12,7 +12,6 @@ import com.gogirl.application.xcx.WechatService;
import
com.gogirl.domain.order.serve.OrderManage
;
import
com.gogirl.domain.order.serve.OrderManage
;
import
com.gogirl.domain.order.serve.OrderRecord
;
import
com.gogirl.domain.order.serve.OrderRecord
;
import
com.gogirl.domain.order.serve.OrderServe
;
import
com.gogirl.domain.order.serve.OrderServe
;
import
com.gogirl.domain.order.serve.ScheduleManage
;
import
com.gogirl.domain.product.serve.BaseServe
;
import
com.gogirl.domain.product.serve.BaseServe
;
import
com.gogirl.domain.store.store.StoreManage
;
import
com.gogirl.domain.store.store.StoreManage
;
import
com.gogirl.domain.user.customer.Customer
;
import
com.gogirl.domain.user.customer.Customer
;
...
@@ -22,7 +21,6 @@ import com.gogirl.domain.xcx.GogirlConfig;
...
@@ -22,7 +21,6 @@ import com.gogirl.domain.xcx.GogirlConfig;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.dto.customer.CustomerOrderDetail
;
import
com.gogirl.dto.customer.CustomerOrderDetail
;
import
com.gogirl.infrastructure.common.exception.RRException
;
import
com.gogirl.infrastructure.common.exception.RRException
;
import
com.gogirl.infrastructure.common.util.ListUtil
;
import
com.gogirl.infrastructure.common.util.StringUtils
;
import
com.gogirl.infrastructure.common.util.StringUtils
;
import
com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.OrderRecordMapper
;
import
com.gogirl.infrastructure.mapper.order.serve.OrderRecordMapper
;
...
@@ -206,11 +204,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
...
@@ -206,11 +204,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
}
}
@Override
@Override
public
Customer
authorized1
(
String
token
,
String
encryptedData
,
String
iv
)
throws
InvalidAlgorithmParameterException
{
public
Customer
authorized1
(
String
token
,
String
encryptedData
,
String
iv
)
{
GogirlToken
gogirlToken
=
gogirlTokenService
.
getByToken
(
token
);
GogirlToken
gogirlToken
=
gogirlTokenService
.
getByToken
(
token
);
JSONObject
data
=
WxUtils
.
decrypt
(
encryptedData
,
gogirlToken
.
getSessionKey
(),
iv
);
JSONObject
data
=
WxUtils
.
decrypt
(
encryptedData
,
gogirlToken
.
getSessionKey
(),
iv
);
/*1、解密微信用户数据*/
String
unionid
=
(
String
)
data
.
get
(
"unionId"
);
String
unionid
=
(
String
)
data
.
get
(
"unionId"
);
String
openid
=
(
String
)
data
.
get
(
"openId"
);
String
openid
=
(
String
)
data
.
get
(
"openId"
);
Integer
gender
=
(
Integer
)
data
.
get
(
"gender"
);
Integer
gender
=
(
Integer
)
data
.
get
(
"gender"
);
...
@@ -220,8 +219,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
...
@@ -220,8 +219,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
String
province
=
(
String
)
data
.
get
(
"province"
);
String
province
=
(
String
)
data
.
get
(
"province"
);
String
nickName
=
filterEmoji
((
String
)
data
.
get
(
"nickName"
));
String
nickName
=
filterEmoji
((
String
)
data
.
get
(
"nickName"
));
/*2、根据openid查询用户*/
Customer
customer
=
customerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getOpenid1
,
openid
));
Customer
customer
=
customerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getOpenid1
,
openid
));
/*3、更新用户*/
customer
.
setSex
(
gender
==
1
?
"男"
:
gender
==
2
?
"女"
:
"未知"
);
customer
.
setSex
(
gender
==
1
?
"男"
:
gender
==
2
?
"女"
:
"未知"
);
customer
.
setHeadimgurl
(
avatarUrl
);
customer
.
setHeadimgurl
(
avatarUrl
);
customer
.
setNickname
(
nickName
);
customer
.
setNickname
(
nickName
);
...
@@ -237,21 +238,25 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
...
@@ -237,21 +238,25 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
public
Customer
authorizedPhone
(
String
token
,
String
encryptedData
,
String
iv
)
throws
InvalidAlgorithmParameterException
{
public
Customer
authorizedPhone
(
String
token
,
String
encryptedData
,
String
iv
)
throws
InvalidAlgorithmParameterException
{
GogirlToken
gogirlToken
=
gogirlTokenService
.
getByToken
(
token
);
GogirlToken
gogirlToken
=
gogirlTokenService
.
getByToken
(
token
);
/*1、获取微信用户手机号数据*/
JSONObject
data
=
WxUtils
.
decrypt
(
encryptedData
,
gogirlToken
.
getSessionKey
(),
iv
);
JSONObject
data
=
WxUtils
.
decrypt
(
encryptedData
,
gogirlToken
.
getSessionKey
(),
iv
);
String
phone
=
(
String
)
data
.
get
(
"purePhoneNumber"
);
String
phone
=
(
String
)
data
.
get
(
"purePhoneNumber"
);
/*2、更新用户token*/
gogirlToken
.
setPhone
(
phone
);
gogirlToken
.
setPhone
(
phone
);
gogirlTokenService
.
updateByToken
(
gogirlToken
);
gogirlTokenService
.
updateByToken
(
gogirlToken
);
Customer
customer
=
customerMapper
.
selectById
(
gogirlToken
.
getCustomerId
());
Customer
customer
=
customerMapper
.
selectById
(
gogirlToken
.
getCustomerId
());
Customer
phoneCustomer
=
customerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getPhone
,
phone
));
Customer
phoneCustomer
=
customerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getPhone
,
phone
));
//如果存在手机号
if
(
StringUtils
.
isNotEmpty
(
customer
.
getPhone
()))
{
throw
new
RRException
(
"您已经授权过手机号"
);
}
//当前用户没有绑定手机号 ,并且授权的手机号已经存在对应的用户
if
(
phoneCustomer
!=
null
)
{
if
(
phoneCustomer
!=
null
)
{
/*3、将当前用户的信息绑定到授权手机号对应的用户上*/
phoneCustomer
.
setSex
(
customer
.
getSex
());
phoneCustomer
.
setSex
(
customer
.
getSex
());
phoneCustomer
.
setHeadimgurl
(
customer
.
getHeadimgurl
());
phoneCustomer
.
setHeadimgurl
(
customer
.
getHeadimgurl
());
phoneCustomer
.
setNickname
(
customer
.
getNickname
());
phoneCustomer
.
setNickname
(
customer
.
getNickname
());
...
@@ -268,23 +273,19 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
...
@@ -268,23 +273,19 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
phoneCustomer
.
setState
(
customer
.
getState
());
phoneCustomer
.
setState
(
customer
.
getState
());
phoneCustomer
.
setUpdateTime
(
new
Date
());
phoneCustomer
.
setUpdateTime
(
new
Date
());
/*3、删除当前用户*/
customerMapper
.
deleteById
(
customer
);
customerMapper
.
deleteById
(
customer
);
/*4、更新授权手机号对应的用户*/
customerMapper
.
updateById
(
phoneCustomer
);
customerMapper
.
updateById
(
phoneCustomer
);
List
<
ScheduleManage
>
scheduleManageList
=
scheduleManageMapper
.
selectList
(
new
LambdaQueryWrapper
<
ScheduleManage
>()
/*5、清空当前用户登录token*/
.
eq
(
ScheduleManage:
:
getTelephone
,
phone
));
if
(
ListUtil
.
isNotEmpty
(
scheduleManageList
))
{
scheduleManageList
.
forEach
(
scheduleManage
->
{
scheduleManage
.
setTelephone
(
phone
);
scheduleManageMapper
.
updateById
(
scheduleManage
);
});
}
//清除token
gogirlTokenService
.
remove
(
token
);
gogirlTokenService
.
remove
(
token
);
return
phoneCustomer
;
return
phoneCustomer
;
}
}
//
不存在手机号
//
当前用户没有绑定手机号 ,授权手机号没有对应用户存在
else
{
else
{
/*6、更新当前用户*/
customer
.
setPhone
(
phone
);
customer
.
setPhone
(
phone
);
customerMapper
.
updateById
(
customer
);
customerMapper
.
updateById
(
customer
);
return
customer
;
return
customer
;
...
...
src/main/java/com/gogirl/domain/store/career/TechScoreRules.java
View file @
c34f9e97
...
@@ -3,6 +3,7 @@ package com.gogirl.domain.store.career;
...
@@ -3,6 +3,7 @@ package com.gogirl.domain.store.career;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -18,6 +19,7 @@ import java.io.Serializable;
...
@@ -18,6 +19,7 @@ import java.io.Serializable;
* @since 2020-03-12
* @since 2020-03-12
*/
*/
@Data
@Data
@Builder
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"TechScoreRules对象"
,
description
=
""
)
@ApiModel
(
value
=
"TechScoreRules对象"
,
description
=
""
)
...
...
src/main/java/com/gogirl/dto/IdleTimeProgramQuery.java
deleted
100644 → 0
View file @
a02897e3
package
com
.
gogirl
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.gogirl.domain.order.serve.ScheduleServe
;
import
com.gogirl.domain.user.customer.Customer
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
IdleTimeProgramQuery
{
private
Integer
id
;
//修改预约的时候,修改前的id
@ApiModelProperty
(
"修改预约的时候,修改前的id"
)
private
Integer
oldId
;
@ApiModelProperty
(
"预约订单号"
)
private
String
scheduledNo
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"预约时间"
)
private
Date
scheduledTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"最近修改时间"
)
private
Date
lastUpdateTime
;
@ApiModelProperty
(
"下单人id"
)
private
Integer
scheduledUser
;
@ApiModelProperty
(
"店铺端预约用户名"
)
private
String
storeScheduleUsername
;
@ApiModelProperty
(
"店铺端预约手机号码"
)
private
String
telephone
;
@ApiModelProperty
(
"预约到达时间字符串"
)
private
String
arriveTimeString
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"预约到达时间"
)
private
Date
arriveTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"上次服务时间"
)
private
Date
lastServiceTime
;
@ApiModelProperty
(
"到店人"
)
private
String
arriveUser
;
@ApiModelProperty
(
"下单店铺id"
)
private
Integer
departmentId
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"删除备注"
)
private
String
delRemaerk
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"开单时间"
)
private
Date
openbillTime
;
@ApiModelProperty
(
"已预约#1 失约#2 守约#3 已取消#4 已删除#5"
)
private
Integer
status
;
@ApiModelProperty
(
"创建人"
)
private
String
createUser
;
@ApiModelProperty
(
"店铺名称"
)
private
String
departmentName
;
@ApiModelProperty
(
"删除服务字段"
)
private
String
deleteServe
;
@ApiModelProperty
(
"id"
)
private
Integer
scheduledType
;
@ApiModelProperty
(
"提醒类型"
)
private
Integer
remindStatus
;
@ApiModelProperty
(
"已读状态"
)
private
Integer
isRead
;
@ApiModelProperty
(
"统计开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
"统计结束时间"
)
private
String
endTime
;
@ApiModelProperty
(
"分页查询当天预约"
)
private
String
sameDayTime
;
@ApiModelProperty
(
"发送服务通知需要的formId"
)
private
String
formId
;
/**
* 非数据库字段
*/
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"token"
)
private
String
token
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"预约时间"
)
private
String
scheduleDate
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"预约下服务列表"
)
private
List
<
ScheduleServe
>
listScheduleServer
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"预约用户信息"
)
private
Customer
customer
;
@TableField
(
exist
=
false
)
private
List
<
Long
>
dateTimeList
;
@TableField
(
exist
=
false
)
private
Boolean
showNodeDetail
;
}
src/main/java/com/gogirl/dto/IdleTimeQry.java
0 → 100644
View file @
c34f9e97
//package com.gogirl.dto;
//
//import com.baomidou.mybatisplus.annotation.TableField;
//import com.gogirl.domain.order.serve.ScheduleServe;
//import com.gogirl.domain.user.customer.Customer;
//import com.gogirl.shared.order.serve.query.qry.ScheduleServeQuery;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//
//import java.util.List;
//
//@Data
//public class IdleTimeQry {
//
// private Integer id;
//
// @ApiModelProperty("下单店铺id")
// private Integer departmentId;
//
// @TableField(exist = false)
// @ApiModelProperty("预约时间")
// private String scheduleDate;
//
// @TableField(exist = false)
// @ApiModelProperty("预约下服务列表")
// private List<ScheduleServeQuery> listScheduleServer;
//
// @TableField(exist = false)
// private List<Long> dateTimeList;
//
// @TableField(exist = false)
// private Boolean showNodeDetail;
//}
src/main/java/com/gogirl/dto/TechScore.java
View file @
c34f9e97
...
@@ -10,5 +10,5 @@ public class TechScore {
...
@@ -10,5 +10,5 @@ public class TechScore {
private
List
<
TechScoreRules
>
techScoreRulesList
;
private
List
<
TechScoreRules
>
techScoreRulesList
;
private
Integer
techScore
;
private
Double
techScore
;
}
}
src/main/java/com/gogirl/dto/admin/AchievementsPersonaResult.java
0 → 100644
View file @
c34f9e97
package
com
.
gogirl
.
dto
.
admin
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
AchievementsPersonaResult
{
private
String
shop_item_proportion_str
;
//20.00 %;
private
String
marketing_proportion_str
;
//0.00 %;
private
String
activate_a_card_proportion_str
;
//40.00 %;
private
String
repeat_purchase_45_proportion_str
;
//0.00 %;
private
String
complaint_proportion_str
;
//0.00 %;
private
String
study_personal_proportion_str
;
//0.00 %;
private
String
external_training_proportion_str
;
//0.00 %;
private
String
old_belt_new_proportion_str
;
//0.00 %;
private
String
time_weight_month_proportion_str
;
//50.00 %;
private
String
time_weight_quarter_proportion_str
;
//40.00 %;
private
String
time_weight_year_proportion_str
;
//10.00 %;
private
String
information_complete_proportion_str
;
//0.00 %;
private
String
service_time_proportion_str
;
//20.00 %;
private
String
praise_proportion_str
;
//20.00 %;
private
Integer
id
;
//334;
private
Integer
year
;
//2020;
private
Integer
month
;
//4;
private
String
time
;
//2020-04-01T00;//00;//00;
private
Integer
technician_id
;
//99;
private
Integer
store_id
;
//17;
private
String
technician_name
;
//姜晴文;
private
BigDecimal
marketing_score
;
//0.0000;
private
BigDecimal
marketing_val
;
//0.0000;
private
BigDecimal
marketing_proportion
;
//0.0000;
private
BigDecimal
activate_a_card_score
;
//26.6667;
private
BigDecimal
activate_a_card_val
;
//0.0900;
private
BigDecimal
activate_a_card_proportion
;
//0.4000;
private
BigDecimal
repeat_purchase_45_score
;
//0.0000;
private
BigDecimal
repeat_purchase_45_val
;
//0.0000;
private
BigDecimal
repeat_purchase_45_proportion
;
//0.0000;
private
BigDecimal
complaint_score
;
//0.0000;
private
BigDecimal
complaint_val
;
//0.0000;
private
BigDecimal
complaint_proportion
;
//0.0000;
private
BigDecimal
study_personal_score
;
//0.0000;
private
BigDecimal
study_personal_val
;
//0.0000;
private
BigDecimal
study_personal_proportion
;
//0.0000;
private
BigDecimal
external_training_score
;
//0.0000;
private
BigDecimal
external_training_val
;
//0.0000;
private
BigDecimal
external_training_proportion
;
//0.0000;
private
BigDecimal
old_belt_new_score
;
//0.0000;
private
BigDecimal
old_belt_new_val
;
//0.0000;
private
BigDecimal
old_belt_new_proportion
;
//0.0000;
private
BigDecimal
month_score
;
//52.5087;
private
BigDecimal
time_weight_month_proportion
;
//0.5000;
private
BigDecimal
quarter_score
;
//52.5087;
private
BigDecimal
time_weight_quarter_proportion
;
//0.4000;
private
BigDecimal
year_score
;
//65.6661;
private
BigDecimal
time_weight_year_proportion
;
//0.1000;
private
BigDecimal
final_score
;
//53.8244;
private
BigDecimal
information_complete_val
;
//0.0000;
private
BigDecimal
information_complete_score
;
//0.0000;
private
BigDecimal
information_complete_proportion
;
//0.0;
private
BigDecimal
service_time_val
;
//0.2250;
private
BigDecimal
service_time_score
;
//25.0000;
private
BigDecimal
service_time_proportion
;
//0.2000;
private
BigDecimal
praise_val
;
//0.8421;
private
BigDecimal
praise_score
;
//84.2100;
private
BigDecimal
praise_proportion
;
//0.2000;
private
BigDecimal
shop_item_val
;
//0.0000;
private
BigDecimal
shop_item_score
;
//100.0000;
private
BigDecimal
shop_item_proportion
;
//0.2000
}
src/main/java/com/gogirl/dto/admin/AchievementsPersonaResultPageApiRequest.java
0 → 100644
View file @
c34f9e97
package
com
.
gogirl
.
dto
.
admin
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
public
class
AchievementsPersonaResultPageApiRequest
{
private
Integer
year
;
private
Integer
month
;
private
Integer
status
;
private
Integer
page
;
private
Integer
rows
;
private
String
sidx
;
private
String
sord
;
private
Integer
technician_id
;
}
src/main/java/com/gogirl/infrastructure/config/property/GogirlProperties.java
View file @
c34f9e97
...
@@ -60,4 +60,6 @@ public class GogirlProperties {
...
@@ -60,4 +60,6 @@ public class GogirlProperties {
* 后台地址
* 后台地址
*/
*/
private
String
adminBackendUrl
;
private
String
adminBackendUrl
;
private
String
adminBackendAchievementsUrl
;
}
}
src/main/java/com/gogirl/infrastructure/util/PrefixUtils.java
View file @
c34f9e97
package
com
.
gogirl
.
infrastructure
.
util
;
package
com
.
gogirl
.
infrastructure
.
util
;
import
com.gogirl.infrastructure.common.util.ListUtil
;
import
com.google.common.collect.Lists
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
...
@@ -56,4 +59,46 @@ public class PrefixUtils {
...
@@ -56,4 +59,46 @@ public class PrefixUtils {
}
}
static
<
T
>
void
permutation
(
List
<
T
>
source
,
int
i
,
List
<
List
<
T
>>
list
)
{
// 如果为空
if
(
ListUtil
.
isEmpty
(
source
))
return
;
// 如果i指向了最后一个字符
if
(
i
==
source
.
size
()
-
1
)
{
if
(
list
.
contains
(
source
))
return
;
list
.
add
(
source
);
}
else
{
// i指向当前我们做排列操作的字符串的第一个字符
for
(
int
j
=
i
;
j
<
source
.
size
();
j
++)
{
// 把做排列操作的字符串的第一个字符和后面的所有字符交换
T
temp
=
source
.
get
(
j
);
source
.
set
(
j
,
source
.
get
(
i
));
source
.
set
(
i
,
temp
);
// obj[j] = obj[i];
// obj[i] = temp;
// 交换后对i后面的字符串递归做排列操作
permutation
(
source
,
i
+
1
,
list
);
// 每一轮结束后换回来进行下一轮排列操作
// temp = obj[j];
temp
=
source
.
get
(
j
);
// obj[j] = obj[i];
// obj[i] = temp;
source
.
set
(
j
,
source
.
get
(
i
));
source
.
set
(
i
,
temp
);
}
}
}
public
static
void
main
(
String
[]
args
)
{
List
<
List
<
String
>>
lists
=
new
ArrayList
<>();
List
<
String
>
source
=
Lists
.
newArrayList
(
"a1"
,
"b2"
,
"c3"
);
PrefixUtils
.
permutation
(
source
,
0
,
lists
);
for
(
int
i
=
0
;
i
<
lists
.
size
();
i
++)
{
System
.
out
.
println
(
lists
.
get
(
i
)
+
" "
);
}
}
}
}
src/main/java/com/gogirl/interfaces/order/serve/ScheduleManageController.java
View file @
c34f9e97
...
@@ -14,7 +14,6 @@ import com.gogirl.domain.order.serve.ScheduleManage;
...
@@ -14,7 +14,6 @@ import com.gogirl.domain.order.serve.ScheduleManage;
import
com.gogirl.domain.product.serve.BaseProduce
;
import
com.gogirl.domain.product.serve.BaseProduce
;
import
com.gogirl.domain.store.store.StoreTechnician
;
import
com.gogirl.domain.store.store.StoreTechnician
;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.dto.IdleTimeProgramQuery
;
import
com.gogirl.dto.LeisureScheduleServe
;
import
com.gogirl.dto.LeisureScheduleServe
;
import
com.gogirl.dto.LeisureScheduleServeQuery
;
import
com.gogirl.dto.LeisureScheduleServeQuery
;
import
com.gogirl.dto.QueryLeisureTechnicianReq
;
import
com.gogirl.dto.QueryLeisureTechnicianReq
;
...
@@ -24,6 +23,7 @@ import com.gogirl.infrastructure.common.util.ListUtil;
...
@@ -24,6 +23,7 @@ import com.gogirl.infrastructure.common.util.ListUtil;
import
com.gogirl.infrastructure.mapper.product.purchase.PurchaseSkuMapper
;
import
com.gogirl.infrastructure.mapper.product.purchase.PurchaseSkuMapper
;
import
com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper
;
import
com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.gogirl.infrastructure.util.lock.CustomerIdLock
;
import
com.gogirl.infrastructure.util.lock.ScheduleServeIdLock
;
import
com.gogirl.infrastructure.util.lock.ScheduleServeIdLock
;
import
com.gogirl.infrastructure.util.lock.ScheduledLock
;
import
com.gogirl.infrastructure.util.lock.ScheduledLock
;
import
com.gogirl.shared.order.serve.command.schedule.CancelScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.CancelScheduleCommand
;
...
@@ -31,6 +31,7 @@ import com.gogirl.shared.order.serve.command.schedule.SubmitScheduleCommand;
...
@@ -31,6 +31,7 @@ import com.gogirl.shared.order.serve.command.schedule.SubmitScheduleCommand;
import
com.gogirl.shared.order.serve.command.schedule.UpdateScheduleCommand
;
import
com.gogirl.shared.order.serve.command.schedule.UpdateScheduleCommand
;
import
com.gogirl.shared.order.serve.query.dto.IdleTimeDTO
;
import
com.gogirl.shared.order.serve.query.dto.IdleTimeDTO
;
import
com.gogirl.shared.order.serve.query.dto.ScheduleManageDTO
;
import
com.gogirl.shared.order.serve.query.dto.ScheduleManageDTO
;
import
com.gogirl.shared.order.serve.query.qry.IdleTimeQuery
;
import
com.gogirl.shared.order.serve.query.qry.schedule.ScheduleManagePageQuery
;
import
com.gogirl.shared.order.serve.query.qry.schedule.ScheduleManagePageQuery
;
import
com.gogirl.shared.product.query.dto.PurchaseSkuDTO
;
import
com.gogirl.shared.product.query.dto.PurchaseSkuDTO
;
import
com.gogirl.shared.user.query.qry.VipServeQuery
;
import
com.gogirl.shared.user.query.qry.VipServeQuery
;
...
@@ -64,7 +65,7 @@ public class ScheduleManageController {
...
@@ -64,7 +65,7 @@ public class ScheduleManageController {
@ApiModelProperty
(
"查询可预约时间列表"
)
@ApiModelProperty
(
"查询可预约时间列表"
)
@PostMapping
(
"/customer/schedule/queryIdleTime"
)
@PostMapping
(
"/customer/schedule/queryIdleTime"
)
public
JsonResult
<
List
<
IdleTimeDTO
>>
queryIdleTime
(
@RequestBody
IdleTime
Program
Query
qry
)
throws
ParseException
,
ExecutionException
,
InterruptedException
{
public
JsonResult
<
List
<
IdleTimeDTO
>>
queryIdleTime
(
@RequestBody
IdleTimeQuery
qry
)
throws
ParseException
,
ExecutionException
,
InterruptedException
{
List
<
IdleTimeDTO
>
idleTimeDTOList
=
scheduleManageService
.
queryIdleTime
(
qry
);
List
<
IdleTimeDTO
>
idleTimeDTOList
=
scheduleManageService
.
queryIdleTime
(
qry
);
return
JsonResult
.
success
(
idleTimeDTOList
);
return
JsonResult
.
success
(
idleTimeDTOList
);
}
}
...
@@ -82,9 +83,16 @@ public class ScheduleManageController {
...
@@ -82,9 +83,16 @@ public class ScheduleManageController {
@ApiOperation
(
"提交预约"
)
@ApiOperation
(
"提交预约"
)
@PostMapping
(
"/customer/schedule/submitSchedule"
)
@PostMapping
(
"/customer/schedule/submitSchedule"
)
public
JsonResult
<
Void
>
submitSchedule
(
@RequestHeader
String
token
,
public
JsonResult
<
Void
>
submitSchedule
(
@RequestHeader
String
token
,
@RequestBody
SubmitScheduleCommand
cmd
)
{
@RequestBody
SubmitScheduleCommand
cmd
)
throws
ParseException
,
ExecutionException
,
InterruptedException
{
cmd
.
getScheduleManageDTO
().
setScheduledUser
(
SessionUtils
.
getCustomerId
());
Integer
customerId
=
SessionUtils
.
getCustomerId
();
CustomerIdLock
lock
=
CustomerIdLock
.
getInsatance
();
try
{
lock
.
lock
(
customerId
);
cmd
.
getScheduleManageDTO
().
setScheduledUser
(
customerId
);
scheduleManageService
.
submitSchedule
(
cmd
);
scheduleManageService
.
submitSchedule
(
cmd
);
}
finally
{
lock
.
unlock
(
customerId
);
}
return
JsonResult
.
success
();
return
JsonResult
.
success
();
}
}
...
@@ -105,10 +113,8 @@ public class ScheduleManageController {
...
@@ -105,10 +113,8 @@ public class ScheduleManageController {
@ApiOperation
(
"用户更新预约"
)
@ApiOperation
(
"用户更新预约"
)
@PostMapping
(
"/customer/schedule/updateSchedule"
)
@PostMapping
(
"/customer/schedule/updateSchedule"
)
public
JsonResult
<
Void
>
updateSchedule
(
@RequestHeader
String
token
,
public
JsonResult
<
Void
>
updateSchedule
(
@RequestHeader
String
token
,
@RequestBody
SubmitScheduleCommand
cmd
)
{
@RequestBody
SubmitScheduleCommand
cmd
)
throws
ParseException
,
ExecutionException
,
InterruptedException
{
Integer
currentCustomerId
=
SessionUtils
.
getCustomerId
();
Integer
currentCustomerId
=
Optional
.
ofNullable
(
gogirlTokenService
.
getByToken
(
token
).
getCustomerId
())
.
orElseThrow
(()
->
new
RRException
(
500
,
"token不存在"
));
cmd
.
getScheduleManageDTO
().
setScheduledUser
(
currentCustomerId
);
cmd
.
getScheduleManageDTO
().
setScheduledUser
(
currentCustomerId
);
ScheduledLock
scheduledLock
=
ScheduledLock
.
getInsatance
();
ScheduledLock
scheduledLock
=
ScheduledLock
.
getInsatance
();
...
@@ -211,7 +217,7 @@ public class ScheduleManageController {
...
@@ -211,7 +217,7 @@ public class ScheduleManageController {
@ApiOperation
(
"更新预约"
)
@ApiOperation
(
"更新预约"
)
@PostMapping
(
"/technician/schedule/updateSchedule"
)
@PostMapping
(
"/technician/schedule/updateSchedule"
)
public
JsonResult
<
Void
>
updateSchedule
(
@RequestBody
SubmitScheduleCommand
cmd
)
{
public
JsonResult
<
Void
>
updateSchedule
(
@RequestBody
SubmitScheduleCommand
cmd
)
throws
ParseException
,
ExecutionException
,
InterruptedException
{
cmd
.
getScheduleManageDTO
().
setDepartmentId
(
SessionUtils
.
getTechnicianToken
().
getDepartmentId
());
cmd
.
getScheduleManageDTO
().
setDepartmentId
(
SessionUtils
.
getTechnicianToken
().
getDepartmentId
());
scheduleManageService
.
updateSchedule
(
cmd
);
scheduleManageService
.
updateSchedule
(
cmd
);
return
JsonResult
.
success
();
return
JsonResult
.
success
();
...
...
src/main/java/com/gogirl/interfaces/user/CustomerController.java
View file @
c34f9e97
...
@@ -5,13 +5,11 @@ import com.gogirl.domain.user.customer.Customer;
...
@@ -5,13 +5,11 @@ import com.gogirl.domain.user.customer.Customer;
import
com.gogirl.dto.customer.CustomerOrderDetail
;
import
com.gogirl.dto.customer.CustomerOrderDetail
;
import
com.gogirl.infrastructure.common.base.JsonResult
;
import
com.gogirl.infrastructure.common.base.JsonResult
;
import
com.gogirl.infrastructure.service.file.FileService
;
import
com.gogirl.infrastructure.service.file.FileService
;
import
com.gogirl.infrastructure.util.Base64Utils
;
import
com.gogirl.shared.user.query.qry.CustomerQuery
;
import
com.gogirl.shared.user.query.qry.CustomerQuery
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.security.InvalidAlgorithmParameterException
;
import
java.security.InvalidAlgorithmParameterException
;
...
@@ -50,19 +48,7 @@ public class CustomerController {
...
@@ -50,19 +48,7 @@ public class CustomerController {
return
JsonResult
.
success
();
return
JsonResult
.
success
();
}
}
/*cmd接口结束*/
@ApiOperation
(
value
=
"小程序用户登录"
)
/*query接口开始*/
/*query接口结束*/
@ApiOperation
((
"查询会员"
))
@PostMapping
(
"/customer/xcx/query"
)
public
JsonResult
<
Customer
>
query
(
@RequestBody
CustomerQuery
qry
)
{
Customer
customer
=
customerService
.
getById
(
qry
.
getCustomerId
());
return
JsonResult
.
success
(
customer
);
}
@ApiOperation
(
value
=
"客户根据code获取token"
)
@GetMapping
(
"/customer/xcx/login"
)
@GetMapping
(
"/customer/xcx/login"
)
public
JsonResult
<
String
>
login
(
@RequestParam
String
code
)
{
public
JsonResult
<
String
>
login
(
@RequestParam
String
code
)
{
String
token
=
customerService
.
login
(
code
);
String
token
=
customerService
.
login
(
code
);
...
@@ -81,6 +67,32 @@ public class CustomerController {
...
@@ -81,6 +67,32 @@ public class CustomerController {
return
JsonResult
.
success
(
customer
);
return
JsonResult
.
success
(
customer
);
}
}
@ApiOperation
(
value
=
"h5用户登录"
)
@GetMapping
(
"/customer/no_h5Login"
)
public
JsonResult
<
String
>
h5Login
(
@RequestParam
Integer
orderId
)
{
String
token
=
customerService
.
h5Login
(
orderId
);
return
JsonResult
.
success
(
token
);
}
@ApiOperation
(
value
=
"超时测试接口"
)
@RequestMapping
(
"/customer/testTimeOut"
)
public
JsonResult
<
Void
>
testTimeOut
()
throws
InterruptedException
{
Thread
.
sleep
(
36000L
);
return
JsonResult
.
success
();
}
/*cmd接口结束*/
/*query接口开始*/
@ApiOperation
(
"查询会员"
)
@PostMapping
(
"/customer/xcx/query"
)
public
JsonResult
<
Customer
>
query
(
@RequestBody
CustomerQuery
qry
)
{
Customer
customer
=
customerService
.
getById
(
qry
.
getCustomerId
());
return
JsonResult
.
success
(
customer
);
}
@ApiOperation
(
value
=
"客户授权手机号码"
)
@ApiOperation
(
value
=
"客户授权手机号码"
)
@RequestMapping
(
method
=
{
RequestMethod
.
POST
},
value
=
"/customer/xcx/authorizedPhone"
)
@RequestMapping
(
method
=
{
RequestMethod
.
POST
},
value
=
"/customer/xcx/authorizedPhone"
)
public
JsonResult
<
Customer
>
authorizedPhone
(
@RequestHeader
String
token
,
public
JsonResult
<
Customer
>
authorizedPhone
(
@RequestHeader
String
token
,
...
@@ -91,31 +103,14 @@ public class CustomerController {
...
@@ -91,31 +103,14 @@ public class CustomerController {
return
JsonResult
.
success
(
customer
);
return
JsonResult
.
success
(
customer
);
}
}
@GetMapping
(
"/customer/xcx/getUserInfo"
)
@ApiOperation
(
value
=
"客户根据token获取用户信息"
)
@ApiOperation
(
value
=
"客户根据token获取用户信息"
)
@GetMapping
(
"/customer/xcx/getUserInfo"
)
public
JsonResult
<
Customer
>
getUserInfo
(
@RequestParam
String
token
)
throws
Exception
{
public
JsonResult
<
Customer
>
getUserInfo
(
@RequestParam
String
token
)
throws
Exception
{
log
.
info
(
"根据token:"
+
token
+
",查询用户信息."
);
log
.
info
(
"根据token:"
+
token
+
",查询用户信息."
);
Customer
customer
=
customerService
.
getUserInfo
(
token
);
Customer
customer
=
customerService
.
getUserInfo
(
token
);
return
JsonResult
.
success
(
customer
);
return
JsonResult
.
success
(
customer
);
}
}
@ApiOperation
(
value
=
"图片上传"
)
@PostMapping
(
"/customer/xcx/upload"
)
public
JsonResult
<
String
>
upload
(
MultipartFile
multipartFile
)
throws
Exception
{
log
.
info
(
"图片上传"
);
String
imgUrl
=
fileService
.
saveImage
(
multipartFile
);
return
JsonResult
.
success
(
imgUrl
);
}
@ApiOperation
(
value
=
"base64图片上传"
)
@PostMapping
(
"/customer/xcx/no_base64Upload"
)
public
JsonResult
<
String
>
base64Upload
(
@RequestBody
String
base64
)
throws
Exception
{
log
.
info
(
"图片上传"
);
MultipartFile
multipartFile
=
Base64Utils
.
base64ToMultipart
(
base64
);
String
imgUrl
=
fileService
.
saveImage
(
multipartFile
);
return
JsonResult
.
success
(
imgUrl
);
}
@ApiOperation
(
value
=
"查询用户可选年龄段"
)
@ApiOperation
(
value
=
"查询用户可选年龄段"
)
@PostMapping
(
"/technician/getAgeGroups"
)
@PostMapping
(
"/technician/getAgeGroups"
)
public
JsonResult
<
List
<
String
>>
getAgeGroups
()
{
public
JsonResult
<
List
<
String
>>
getAgeGroups
()
{
...
@@ -125,10 +120,8 @@ public class CustomerController {
...
@@ -125,10 +120,8 @@ public class CustomerController {
@ApiOperation
(
value
=
"用户详情数据查看"
)
@ApiOperation
(
value
=
"用户详情数据查看"
)
@PostMapping
(
"/technician/queryCustomerDetail"
)
@PostMapping
(
"/technician/queryCustomerDetail"
)
public
JsonResult
<
CustomerOrderDetail
>
queryCustomerDetail
(
@RequestHeader
String
token
,
public
JsonResult
<
CustomerOrderDetail
>
queryCustomerDetail
(
@RequestParam
Integer
customerId
,
@RequestParam
Integer
customerId
,
@RequestParam
(
required
=
false
)
Integer
orderId
)
{
@RequestParam
(
required
=
false
)
Integer
orderId
)
{
CustomerOrderDetail
customerOrderDetail
=
customerService
.
queryCustomerDetail
(
customerId
,
orderId
);
CustomerOrderDetail
customerOrderDetail
=
customerService
.
queryCustomerDetail
(
customerId
,
orderId
);
return
JsonResult
.
success
(
customerOrderDetail
);
return
JsonResult
.
success
(
customerOrderDetail
);
}
}
...
@@ -152,18 +145,6 @@ public class CustomerController {
...
@@ -152,18 +145,6 @@ public class CustomerController {
customerService
.
updateCustomerDetail
(
birthdayMonth
,
birthdayDay
,
ageGroup
,
customerId
,
orderId
,
orderServeId
,
storeRecordRealName
,
sex
,
age
,
job
,
preference
,
character
,
customerSource
);
customerService
.
updateCustomerDetail
(
birthdayMonth
,
birthdayDay
,
ageGroup
,
customerId
,
orderId
,
orderServeId
,
storeRecordRealName
,
sex
,
age
,
job
,
preference
,
character
,
customerSource
);
return
JsonResult
.
success
();
return
JsonResult
.
success
();
}
}
/*query接口结束*/
@ApiOperation
(
value
=
"h5用户登录"
)
@GetMapping
(
"/customer/no_h5Login"
)
public
JsonResult
<
String
>
h5Login
(
@RequestParam
Integer
orderId
)
{
String
token
=
customerService
.
h5Login
(
orderId
);
return
JsonResult
.
success
(
token
);
}
@ApiOperation
(
value
=
"超时测试接口"
)
@RequestMapping
(
"/customer/testTimeOut"
)
public
JsonResult
<
Void
>
testTimeOut
()
throws
InterruptedException
{
Thread
.
sleep
(
36000L
);
return
JsonResult
.
success
();
}
}
}
src/main/java/com/gogirl/interfaces/user/FileController.java
0 → 100644
View file @
c34f9e97
package
com
.
gogirl
.
interfaces
.
user
;
import
com.gogirl.infrastructure.common.base.JsonResult
;
import
com.gogirl.infrastructure.service.file.FileService
;
import
com.gogirl.infrastructure.util.Base64Utils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
@RestController
@Api
(
tags
=
"文件服务接口"
)
@Slf4j
public
class
FileController
{
@Resource
FileService
fileService
;
@ApiOperation
(
value
=
"图片上传"
)
@PostMapping
(
"/customer/xcx/upload"
)
public
JsonResult
<
String
>
upload
(
MultipartFile
multipartFile
)
throws
Exception
{
log
.
info
(
"图片上传"
);
String
imgUrl
=
fileService
.
saveImage
(
multipartFile
);
return
JsonResult
.
success
(
imgUrl
);
}
@ApiOperation
(
value
=
"base64图片上传"
)
@PostMapping
(
"/customer/xcx/no_base64Upload"
)
public
JsonResult
<
String
>
base64Upload
(
@RequestBody
String
base64
)
throws
Exception
{
log
.
info
(
"图片上传"
);
MultipartFile
multipartFile
=
Base64Utils
.
base64ToMultipart
(
base64
);
String
imgUrl
=
fileService
.
saveImage
(
multipartFile
);
return
JsonResult
.
success
(
imgUrl
);
}
}
src/main/java/com/gogirl/interfaces/user/MessageController.java
View file @
c34f9e97
...
@@ -8,7 +8,7 @@ import com.gogirl.domain.user.customer.CustomerMessage;
...
@@ -8,7 +8,7 @@ import com.gogirl.domain.user.customer.CustomerMessage;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.domain.xcx.GogirlToken
;
import
com.gogirl.domain.xcx.VisitsLog
;
import
com.gogirl.domain.xcx.VisitsLog
;
import
com.gogirl.infrastructure.common.base.JsonResult
;
import
com.gogirl.infrastructure.common.base.JsonResult
;
import
com.gogirl.infrastructure.
common.exception.RRException
;
import
com.gogirl.infrastructure.
util.SessionUtils
;
import
com.gogirl.shared.user.command.ReadMessageCommand
;
import
com.gogirl.shared.user.command.ReadMessageCommand
;
import
com.gogirl.shared.user.query.qry.CustomerMessagePageQuery
;
import
com.gogirl.shared.user.query.qry.CustomerMessagePageQuery
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -23,19 +23,13 @@ import org.springframework.web.bind.annotation.*;
...
@@ -23,19 +23,13 @@ import org.springframework.web.bind.annotation.*;
@Api
(
tags
=
{
"用户消息消息接口"
})
@Api
(
tags
=
{
"用户消息消息接口"
})
@Slf4j
@Slf4j
public
class
MessageController
{
public
class
MessageController
{
private
final
GogirlTokenService
gogirlTokenService
;
private
final
GogirlTokenService
gogirlTokenService
;
private
final
VisitLogService
visitLogService
;
private
final
VisitLogService
visitLogService
;
private
final
CustomerMessageService
customerMessageService
;
private
final
CustomerMessageService
customerMessageService
;
@ApiModelProperty
(
"我的消息"
)
@PostMapping
(
"/customer/message/queryPageMessage"
)
public
JsonResult
<
Page
<
CustomerMessage
>>
queryPageMessage
(
@RequestHeader
String
token
,
@RequestBody
CustomerMessagePageQuery
qry
)
{
Page
<
CustomerMessage
>
customerMessagePage
=
customerMessageService
.
queryPageMessage
(
qry
);
return
JsonResult
.
success
(
customerMessagePage
);
}
/*cmd接口开始*/
@ApiModelProperty
(
"已读消息"
)
@ApiModelProperty
(
"已读消息"
)
@PostMapping
(
"/customer/message/customer/readMessage"
)
@PostMapping
(
"/customer/message/customer/readMessage"
)
public
JsonResult
<
Void
>
readMessage
(
@RequestBody
ReadMessageCommand
cmd
)
{
public
JsonResult
<
Void
>
readMessage
(
@RequestBody
ReadMessageCommand
cmd
)
{
...
@@ -82,11 +76,7 @@ public class MessageController {
...
@@ -82,11 +76,7 @@ public class MessageController {
@RequestParam
(
required
=
false
)
String
pageName
,
@RequestParam
(
required
=
false
)
String
pageName
,
@RequestParam
(
required
=
false
)
Integer
produceId
)
{
@RequestParam
(
required
=
false
)
Integer
produceId
)
{
GogirlToken
gt
=
gogirlTokenService
.
getByToken
(
token
);
Integer
customerId
=
SessionUtils
.
getCustomerId
();
if
(
gt
==
null
)
{
throw
new
RRException
(
2000
,
"token失效"
);
}
Integer
customerId
=
gt
.
getCustomerId
();
VisitsLog
visitsLog
=
visitLogService
.
pageIn
(
customerId
,
type
,
activityId
,
shareType
,
shareUserId
,
serviceId
,
departmentId
,
pageName
,
produceId
);
VisitsLog
visitsLog
=
visitLogService
.
pageIn
(
customerId
,
type
,
activityId
,
shareType
,
shareUserId
,
serviceId
,
departmentId
,
pageName
,
produceId
);
return
JsonResult
.
success
(
visitsLog
.
getId
());
return
JsonResult
.
success
(
visitsLog
.
getId
());
}
}
...
@@ -100,5 +90,16 @@ public class MessageController {
...
@@ -100,5 +90,16 @@ public class MessageController {
return
JsonResult
.
success
();
return
JsonResult
.
success
();
}
}
/*cmd接口结束*/
/*query接口开始*/
@ApiModelProperty
(
"我的消息"
)
@PostMapping
(
"/customer/message/queryPageMessage"
)
public
JsonResult
<
Page
<
CustomerMessage
>>
queryPageMessage
(
@RequestHeader
String
token
,
@RequestBody
CustomerMessagePageQuery
qry
)
{
Page
<
CustomerMessage
>
customerMessagePage
=
customerMessageService
.
queryPageMessage
(
qry
);
return
JsonResult
.
success
(
customerMessagePage
);
}
/*query接口结束*/
}
}
src/main/java/com/gogirl/shared/order/serve/query/qry/IdleTimeQuery.java
View file @
c34f9e97
...
@@ -8,18 +8,19 @@ import java.util.List;
...
@@ -8,18 +8,19 @@ import java.util.List;
@Data
@Data
public
class
IdleTimeQuery
{
public
class
IdleTimeQuery
{
@ApiModelProperty
(
"所有美甲师"
)
List
<
StoreTechnicianPeriod
>
storeTechnicianDTOList
;
@ApiModelProperty
(
"时间节点"
)
@ApiModelProperty
(
"时间节点"
)
List
<
Long
>
dateTimeList
;
List
<
Long
>
dateTimeList
;
private
Integer
id
;
private
Integer
id
;
private
Integer
DepartmentId
;
private
Integer
DepartmentId
;
@ApiModelProperty
(
"预约时间"
)
@ApiModelProperty
(
"预约时间"
)
private
String
scheduleDate
;
private
String
scheduleDate
;
@ApiModelProperty
(
"预约"
)
@ApiModelProperty
(
"预约"
)
private
List
<
ScheduleServeQuery
>
scheduleServeQueryList
;
private
List
<
ScheduleServeQuery
>
listScheduleServer
;
private
Boolean
showNodeDetail
;
}
}
src/main/java/com/gogirl/shared/order/serve/query/qry/Period.java
View file @
c34f9e97
...
@@ -3,6 +3,7 @@ package com.gogirl.shared.order.serve.query.qry;
...
@@ -3,6 +3,7 @@ package com.gogirl.shared.order.serve.query.qry;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
/**
* 时间段类
* 时间段类
...
@@ -20,6 +21,12 @@ public class Period implements Serializable {
...
@@ -20,6 +21,12 @@ public class Period implements Serializable {
this
.
length
=
endTime
-
startTime
;
this
.
length
=
endTime
-
startTime
;
}
}
public
Period
(
Date
startTime
,
Date
endTime
)
{
this
.
startTime
=
startTime
.
getTime
();
this
.
endTime
=
endTime
.
getTime
();
this
.
length
=
this
.
endTime
-
this
.
startTime
;
}
public
Period
()
{
public
Period
()
{
}
}
...
...
src/main/resources/application-dev.yml
View file @
c34f9e97
...
@@ -92,6 +92,7 @@ gogirl:
...
@@ -92,6 +92,7 @@ gogirl:
test-paper-time
:
1440
test-paper-time
:
1440
#后台后端接口访问地址
#后台后端接口访问地址
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-achievements-url
:
http://test.admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
wx
:
wx
:
pay
:
pay
:
...
...
src/main/resources/application-pre.yml
View file @
c34f9e97
...
@@ -93,6 +93,7 @@ gogirl:
...
@@ -93,6 +93,7 @@ gogirl:
test-paper-time
:
1
test-paper-time
:
1
#后台后端接口访问地址
#后台后端接口访问地址
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-achievements-url
:
http://test.admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
wx
:
wx
:
pay
:
pay
:
...
...
src/main/resources/application-prod.yml
View file @
c34f9e97
...
@@ -91,6 +91,7 @@ gogirl:
...
@@ -91,6 +91,7 @@ gogirl:
test-paper-time
:
1440
test-paper-time
:
1440
#后台后端接口访问地址
#后台后端接口访问地址
admin-backend-url
:
http://admin.begogirls.com:7712/api/ReportTable/GetTechnicianPageApi
admin-backend-url
:
http://admin.begogirls.com:7712/api/ReportTable/GetTechnicianPageApi
admin-backend-achievements-url
:
http://admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
wx
:
wx
:
pay
:
pay
:
...
...
src/main/resources/application-test.yml
View file @
c34f9e97
...
@@ -92,6 +92,7 @@ gogirl:
...
@@ -92,6 +92,7 @@ gogirl:
test-paper-time
:
1440
test-paper-time
:
1440
#后台后端接口访问地址
#后台后端接口访问地址
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-url
:
http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-achievements-url
:
http://test.admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
wx
:
wx
:
pay
:
pay
:
...
...
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