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
7e676a06
Commit
7e676a06
authored
Jul 20, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认美甲师按照客诉扣分排序
parent
c615bfc1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
209 additions
and
39 deletions
+209
-39
IRecentDeductedComplaintScoreService.java
...store/complaint/IRecentDeductedComplaintScoreService.java
+20
-0
RecentDeductedComplaintScoreServiceImpl.java
...mplaint/impl/RecentDeductedComplaintScoreServiceImpl.java
+29
-0
RecentDeductedComplaintScore.java
.../domain/store/complaint/RecentDeductedComplaintScore.java
+39
-0
RecentDeductedComplaintScoreMapper.java
...r/store/complaint/RecentDeductedComplaintScoreMapper.java
+24
-0
Schedule.java
...ain/java/com/gogirl/infrastructure/schedule/Schedule.java
+12
-15
TestPaperController.java
...a/com/gogirl/interfaces/customer/TestPaperController.java
+1
-1
RecentDeductedComplaintScoreController.java
...ore/complaint/RecentDeductedComplaintScoreController.java
+19
-0
StoreClassesTechnicianMapper.xml
...n/resources/mapper/store/StoreClassesTechnicianMapper.xml
+51
-23
RecentDeductedComplaintScoreMapper.xml
...er/store/complaint/RecentDeductedComplaintScoreMapper.xml
+14
-0
No files found.
src/main/java/com/gogirl/application/store/complaint/IRecentDeductedComplaintScoreService.java
0 → 100644
View file @
7e676a06
package
com
.
gogirl
.
application
.
store
.
complaint
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.gogirl.domain.store.complaint.RecentDeductedComplaintScore
;
/**
* <p>
* 服务类
* </p>
*
* @author robbendev
* @since 2020-07-20
*/
public
interface
IRecentDeductedComplaintScoreService
extends
IService
<
RecentDeductedComplaintScore
>
{
/***
* 同步美甲师近30天客诉扣分
*/
void
syncRecentDeductedComplaintScore
();
}
src/main/java/com/gogirl/application/store/complaint/impl/RecentDeductedComplaintScoreServiceImpl.java
0 → 100644
View file @
7e676a06
package
com
.
gogirl
.
application
.
store
.
complaint
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.gogirl.application.store.complaint.IRecentDeductedComplaintScoreService
;
import
com.gogirl.domain.store.complaint.RecentDeductedComplaintScore
;
import
com.gogirl.infrastructure.mapper.store.complaint.RecentDeductedComplaintScoreMapper
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2020-07-20
*/
@Service
public
class
RecentDeductedComplaintScoreServiceImpl
extends
ServiceImpl
<
RecentDeductedComplaintScoreMapper
,
RecentDeductedComplaintScore
>
implements
IRecentDeductedComplaintScoreService
{
@Override
public
void
syncRecentDeductedComplaintScore
()
{
LocalDate
localDate
=
LocalDate
.
now
().
minusDays
(
30
);
baseMapper
.
delete
(
new
LambdaQueryWrapper
<>());
baseMapper
.
syncRecentDeductedComplaintScore
(
localDate
);
}
}
src/main/java/com/gogirl/domain/store/complaint/RecentDeductedComplaintScore.java
0 → 100644
View file @
7e676a06
package
com
.
gogirl
.
domain
.
store
.
complaint
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020-07-20
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"RecentDeductedComplaintScore对象"
,
description
=
""
)
public
class
RecentDeductedComplaintScore
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"美甲师id"
)
private
Integer
technicianId
;
@ApiModelProperty
(
value
=
"最近30天扣除投诉分数"
)
private
Integer
score
;
}
src/main/java/com/gogirl/infrastructure/mapper/store/complaint/RecentDeductedComplaintScoreMapper.java
0 → 100644
View file @
7e676a06
package
com
.
gogirl
.
infrastructure
.
mapper
.
store
.
complaint
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.gogirl.domain.store.complaint.RecentDeductedComplaintScore
;
import
java.time.LocalDate
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author robbendev
* @since 2020-07-20
*/
public
interface
RecentDeductedComplaintScoreMapper
extends
BaseMapper
<
RecentDeductedComplaintScore
>
{
/**
* 同步美甲师近30天客诉扣分
*
* @param localDate
*/
void
syncRecentDeductedComplaintScore
(
LocalDate
localDate
);
}
src/main/java/com/gogirl/infrastructure/schedule/Schedule.java
View file @
7e676a06
...
...
@@ -5,6 +5,7 @@ import com.gogirl.application.order.mall.MallOrderService;
import
com.gogirl.application.order.serve.ScheduleManageService
;
import
com.gogirl.application.product.serve.FeaturesMappingService
;
import
com.gogirl.application.product.serve.ProduceSalesService
;
import
com.gogirl.application.store.complaint.IRecentDeductedComplaintScoreService
;
import
com.gogirl.application.store.store.StoreManageService
;
import
com.gogirl.application.store.store.StoreTechnicianService
;
import
com.gogirl.application.user.customer.CustomerService
;
...
...
@@ -46,7 +47,6 @@ import com.gogirl.infrastructure.mapper.store.career.CareerMapper;
import
com.gogirl.infrastructure.mapper.store.store.StoreDataMapper
;
import
com.gogirl.infrastructure.mapper.store.store.StoreManageMapper
;
import
com.gogirl.infrastructure.mapper.store.store.StoreTechnicianMapper
;
import
com.gogirl.infrastructure.mapper.store.training.TrainingStartClassMapper
;
import
com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMapper
;
import
com.gogirl.infrastructure.service.push.PushMsgService
;
import
com.gogirl.infrastructure.service.push.TechnicianPushService
;
...
...
@@ -128,7 +128,7 @@ public class Schedule {
private
final
TimesCardCustomerRelevanceMapper
timesCardCustomerRelevanceMapper
;
private
final
RestTemplate
restTemplate
;
private
final
TrainingStartClassMapper
trainingStartClassMapper
;
private
final
IRecentDeductedComplaintScoreService
recentDeductedComplaintScoreService
;
/**
* 每天3点判断优惠券是否过期。
...
...
@@ -715,19 +715,6 @@ public class Schedule {
log
.
info
(
"同步款式的服务类型id结束"
);
}
//
// /**
// * 每30分钟同步一次开课状态
// */
// @Scheduled(cron = "0 0/30 * * * *")
// public void syncTrainingStartClass() {
//
// log.info("同步开课状态开始");
// trainingStartClassMapper.syncTrainingStartClass();
// log.info("同步开课状态结束 ");
//
// }
/**
* 每天凌晨3点同步美甲师jobs
*/
...
...
@@ -737,4 +724,14 @@ public class Schedule {
storeTechnicianMapper
.
syncTechnicianJobs
();
log
.
info
(
"每天凌晨3点同步美甲师jobs 结束"
);
}
/**
* 每天凌晨3点同步美甲师近30天客诉扣分
*/
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
syncRecentDeductedComplaintScore
()
{
log
.
info
(
"每天凌晨3点同步美甲师jobs 开始"
);
recentDeductedComplaintScoreService
.
syncRecentDeductedComplaintScore
();
log
.
info
(
"每天凌晨3点同步美甲师jobs 结束"
);
}
}
src/main/java/com/gogirl/interfaces/customer/TestPaperController.java
View file @
7e676a06
...
...
@@ -23,7 +23,7 @@ public class TestPaperController {
private
final
BaseQuestionService
baseQuestionService
;
private
final
GogirlTokenService
gogirlTokenService
;
@ApiOperation
(
"获取调查问卷"
)
@ApiOperation
(
"获取
s
调查问卷"
)
@GetMapping
(
"/customer/testPaper/getTestPaper"
)
public
JsonResult
<
List
<
BaseQuestion
>>
getTestPaper
(
@RequestHeader
String
token
)
{
...
...
src/main/java/com/gogirl/interfaces/store/complaint/RecentDeductedComplaintScoreController.java
0 → 100644
View file @
7e676a06
package
com
.
gogirl
.
interfaces
.
store
.
complaint
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author robbendev
* @since 2020-07-20
*/
@RestController
@RequestMapping
(
"/recent-deducted-complaint-score"
)
public
class
RecentDeductedComplaintScoreController
{
}
src/main/resources/mapper/store/StoreClassesTechnicianMapper.xml
View file @
7e676a06
...
...
@@ -117,34 +117,62 @@
date_format(days, '%Y-%m-%d') = #{days}
</select>
<!-- <select id="listClassesTechnician" resultMap="classesTechnicianMap">-->
<!-- SELECT-->
<!-- <include refid="storeClassesTechnicianSql"/>,-->
<!-- <include refid="storeClassesSql"/>,-->
<!-- <include refid="storeTechnicianSql"/>,-->
<!-- <include refid="scheduleServeSql"/>-->
<!-- FROM store_classes_technician ct-->
<!-- LEFT JOIN store_classes cls ON cls.id = ct.classes-->
<!-- LEFT JOIN store_technician tech ON tech.id = ct.user_id-->
<!-- LEFT JOIN (-->
<!-- SELECT t4.*-->
<!-- FROM scheduled_serve t4-->
<!-- inner JOIN scheduled_manage t5 ON t4.sch_id = t5.id-->
<!-- AND t5.STATUS != 3-->
<!-- AND t5.STATUS != 4-->
<!-- AND t5.STATUS != 5-->
<!-- AND t5.STATUS != 2-->
<!-- and t4.status !=3-->
<!-- WHERE t4.start_time LIKE concat(#{days},'%')-->
<!-- <if test="scheduleId != null">-->
<!-- and t5.id != #{scheduleId}-->
<!-- </if>) ss ON ct.user_id = ss.technician_id-->
<!-- WHERE ct.days = #{days}-->
<!-- AND tech.user_id IN (SELECT user_id FROM staff_store_authority WHERE store_id = #{departmentId})-->
<!-- AND cls.department_id = #{departmentId}-->
<!-- and tech.`status`=1-->
<!-- </select>-->
<select
id=
"listClassesTechnician"
resultMap=
"classesTechnicianMap"
>
SELECT
<include
refid=
"storeClassesTechnicianSql"
/>
,
<include
refid=
"storeClassesSql"
/>
,
<include
refid=
"storeTechnicianSql"
/>
,
<include
refid=
"scheduleServeSql"
/>
FROM store_classes_technician ct
LEFT JOIN store_classes cls ON cls.id = ct.classes
LEFT JOIN store_technician tech ON tech.id = ct.user_id
LEFT JOIN (
SELECT t4.*
FROM scheduled_serve t4
inner JOIN scheduled_manage t5 ON t4.sch_id = t5.id
AND t5.STATUS != 3
AND t5.STATUS != 4
AND t5.STATUS != 5
AND t5.STATUS != 2
and t4.status !=3
WHERE t4.start_time LIKE concat(#{days},'%')
select *
from store_classes_technician ct
left join store_classes cls on cls.id = ct.classes
left join store_technician tech on tech.id = ct.user_id
left join (
select t4.*
from scheduled_serve t4
inner join scheduled_manage t5 on t4.sch_id = t5.id
and t5.`status` != 3
and t5.`status` != 4
and t5.`status` != 5
and t5.`status` != 2
and t4.`status` != 3
where t4.start_time = #{days}
<if
test=
"scheduleId != null"
>
and t5.id != #{scheduleId}
</if>
) ss ON ct.user_id = ss.technician_id
WHERE ct.days = #{days}
AND tech.user_id IN (SELECT user_id FROM staff_store_authority WHERE store_id = #{departmentId})
AND cls.department_id = #{departmentId}
and tech.`status`=1
</if>
) ss on ct.user_id = ss.technician_id
left join recent_deducted_complaint_score t5 on t5.technician_id = tech.id
where ct.days = #{days}
and tech.user_id in (select user_id from staff_store_authority where store_id = #{departmentId})
and cls.department_id = #{departmentId}
and tech.`status` = 1
order by t5.score
</select>
<select
id=
"listClassTimeByStartDate"
resultMap=
"classesTechnicianMap"
>
select
<include
refid=
"storeClassesTechnicianSql"
/>
,
...
...
src/main/resources/mapper/store/complaint/RecentDeductedComplaintScoreMapper.xml
0 → 100644
View file @
7e676a06
<?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.gogirl.infrastructure.mapper.store.complaint.RecentDeductedComplaintScoreMapper"
>
<insert
id=
"syncRecentDeductedComplaintScore"
>
insert into recent_deducted_complaint_score (technician_id, score)
select t1.technician_id, sum(t3.score) as score
from complaint_detailed_technician t1
left join complaint_detailed t2 on t1.complaint_detailed_id = t2.id
left join complaint_level_score_config t3 on t2.`level` = t3.`level`
where t2.create_date > '2020-06-20'
group by t1.technician_id
</insert>
</mapper>
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