Commit 97caf669 by huluobin

update

parent 034545f5
......@@ -3,6 +3,7 @@ package com.gogirl.domain.store.training;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
......@@ -12,23 +13,34 @@ public class TrainingCourse {
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty("课程分类")
private Integer typeId;
@ApiModelProperty("课程名称")
private String name;
@ApiModelProperty("课程sku")
private String no;
private String modality;
@ApiModelProperty("能力对象")
private String object;
@ApiModelProperty("展示内容")
private String content;
@ApiModelProperty("课程简述")
private String describe;
@ApiModelProperty("教材文件路径")
private String teachingMaterialPath;
private String assessmentMethods;
@ApiModelProperty("实操性")
private String practicality;
private Integer duration;
@ApiModelProperty("课程时长,分钟")
private String duration;
@ApiModelProperty("课程优势")
private String advantage;
}
......@@ -23,11 +23,6 @@ import com.gogirl.domain.store.store.StoreTechnician;
import com.gogirl.domain.user.customer.Customer;
import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import com.gogirl.domain.xcx.WeekConfig;
import com.gogirl.dto.admin.AdminPage;
import com.gogirl.dto.admin.AdminResult;
import com.gogirl.dto.admin.AdminTechnicianScore;
import com.gogirl.dto.admin.GetTechnicianPageRequest;
import com.gogirl.infrastructure.common.util.JsonUtilByJackson;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.config.property.GogirlProperties;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
......@@ -48,24 +43,15 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe
import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper;
import com.gogirl.infrastructure.service.push.PushMsgService;
import com.gogirl.infrastructure.service.push.TechnicianPushService;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -371,50 +357,50 @@ public class Schedule {
storeTechnicianList.forEach(storeTechnician -> {
ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>> responseBodyType = new ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>>() {
};
GetTechnicianPageRequest allRequest = GetTechnicianPageRequest.builder()
.page(1)
.rows(30)
.sidx("grade")
.sord("asc")
//在职
.status(1)
.technician_id(storeTechnician.getId())
.build();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest, headers);
AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType)
.getBody()
.getData()
.getItems()
.stream()
.findAny()
.orElse(new AdminTechnicianScore());
GetTechnicianPageRequest monthRequest = GetTechnicianPageRequest.builder()
.page(1)
.rows(30)
.sidx("grade")
.sord("asc")
//在职
.status(1)
.date_utc(Lists.newArrayList(LocalDateTime.of(LocalDate.of(2020, 4, 1), LocalTime.of(0, 0)).toString(), LocalDateTime.now().toString()))
.technician_id(storeTechnician.getId())
.build();
HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest, headers);
log.debug(JsonUtilByJackson.writeValueAsString(monthRequest));
AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType)
.getBody()
.getData()
.getItems()
.stream()
.findAny()
.orElse(new AdminTechnicianScore());
// ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>> responseBodyType = new ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>>() {
// };
// GetTechnicianPageRequest allRequest = GetTechnicianPageRequest.builder()
// .page(1)
// .rows(30)
// .sidx("grade")
// .sord("asc")
// //在职
// .status(1)
// .technician_id(storeTechnician.getId())
// .build();
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest, headers);
// AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType)
// .getBody()
// .getData()
// .getItems()
// .stream()
// .findAny()
// .orElse(new AdminTechnicianScore());
// GetTechnicianPageRequest monthRequest = GetTechnicianPageRequest.builder()
// .page(1)
// .rows(30)
// .sidx("grade")
// .sord("asc")
// //在职
// .status(1)
// .date_utc(Lists.newArrayList(LocalDateTime.of(LocalDate.of(2020, 4, 1), LocalTime.of(0, 0)).toString(), LocalDateTime.now().toString()))
// .technician_id(storeTechnician.getId())
// .build();
//
// HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest, headers);
// log.debug(JsonUtilByJackson.writeValueAsString(monthRequest));
// AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType)
// .getBody()
// .getData()
// .getItems()
// .stream()
// .findAny()
// .orElse(new AdminTechnicianScore());
Career career = careerMapper.selectOne(new LambdaQueryWrapper<Career>().eq(Career::getTechnicianId, storeTechnician.getId()));
......@@ -438,66 +424,66 @@ public class Schedule {
/*当月*/
//当月开卡数量
career.setMonthBalanceCardNum(monthAdminResult.getCard_count());
// career.setMonthBalanceCardNum(monthAdminResult.getCard_count());
//当月考勤准时
career.setMonthAttendancePercent(null);
//当月信息录入完整度
career.setMonthInfoPercent(monthAdminResult.getAvg_data_integrity());
// career.setMonthInfoPercent(monthAdminResult.getAvg_data_integrity());
//当月订单总数
Integer monthOrderNum = careerMapper.queryMonthOrderNum(storeTechnician.getId(), month);
career.setMonthOrderNum(monthOrderNum);
//当月客户好评率
career.setMonthPraisePercent(monthAdminResult.getPraise_proportion());
// career.setMonthPraisePercent(monthAdminResult.getPraise_proportion());
//当月复购率
career.setMonthRepurchasePercent(monthAdminResult.getRepeat_purchase_client_roportion());
// career.setMonthRepurchasePercent(monthAdminResult.getRepeat_purchase_client_roportion());
//当月服务客户数
career.setMonthServeCustomerNum(monthAdminResult.getTotal_client_count());
// career.setMonthServeCustomerNum(monthAdminResult.getTotal_client_count());
//当月服务次数
career.setMonthServeNum(monthAdminResult.getTotal_service_count());
// career.setMonthServeNum(monthAdminResult.getTotal_service_count());
//当月信息录入完整度
BigDecimal montInfoPercent = monthAdminResult.getAvg_data_integrity();
if (montInfoPercent != null) {
career.setMonthInfoPercent(montInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
}
// BigDecimal montInfoPercent = monthAdminResult.getAvg_data_integrity();
// if (montInfoPercent != null) {
// career.setMonthInfoPercent(montInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
// }
/*总计*/
//总考勤准时率
career.setTotalAttendancePercent(null);
//总开卡数
career.setTotalBalanceCardNum(allAdminResult.getCard_count());
// career.setTotalBalanceCardNum(allAdminResult.getCard_count());
//总信息录入完整度
BigDecimal totalInfoPercent = allAdminResult.getAvg_data_integrity();
if (totalInfoPercent != null) {
career.setTotalInfoPercent(totalInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
}
// BigDecimal totalInfoPercent = allAdminResult.getAvg_data_integrity();
// if (totalInfoPercent != null) {
// career.setTotalInfoPercent(totalInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
// }
//总订单数
Integer totalOrderNum = careerMapper.queryTotalOrderNum(storeTechnician.getId(), month);
career.setTotalOrderNum(totalOrderNum);
//总好评率
career.setTotalPraisePercent(allAdminResult.getPraise_proportion());
// career.setTotalPraisePercent(allAdminResult.getPraise_proportion());
//总考勤准时比率
career.setTotalAttendancePercent(null);
//总复购率
career.setTotalRepurchasePercent(allAdminResult.getRepeat_purchase_client_roportion());
// career.setTotalRepurchasePercent(allAdminResult.getRepeat_purchase_client_roportion());
//服务客户总数
career.setTotalServeCustomerNum(allAdminResult.getTotal_client_count());
// career.setTotalServeCustomerNum(allAdminResult.getTotal_client_count());
//服务总次数
career.setTotalServeNum(allAdminResult.getTotal_service_count());
// career.setTotalServeNum(allAdminResult.getTotal_service_count());
/*美甲师信息*/
//美甲师名字
......
spring:
profiles:
active: dev
active: prod
servlet:
#文件上传最大容量
multipart:
......
......@@ -44,6 +44,7 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe
import com.gogirl.infrastructure.mapper.user.customer.CustomerMapper;
import com.gogirl.infrastructure.mapper.xcx.TimeNodeMapper;
import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper;
import com.gogirl.infrastructure.schedule.Schedule;
import com.gogirl.infrastructure.service.mail.MailService;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
......@@ -481,4 +482,13 @@ public class Test {
public void testMail() {
mailService.sendSimpleMail("robbendev@qq.com","pre","test");
}
@Resource
Schedule schedule;
@org.junit.Test
public void career(){
schedule.syncTechnicianCareer();
}
}
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