Commit 7e676a06 by huluobin

默认美甲师按照客诉扣分排序

parent c615bfc1
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();
}
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);
}
}
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;
}
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);
}
......@@ -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 结束");
}
}
......@@ -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) {
......
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 {
}
......@@ -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"/>,
......
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment