Commit 8eb5c78f by huluobin

Merge branch 'master' into 3.7

parents 74b436a2 0ab93c37
...@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; ...@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -81,14 +82,14 @@ public class ComplaintMainServiceImpl extends ServiceImpl<ComplaintMainMapper, C ...@@ -81,14 +82,14 @@ public class ComplaintMainServiceImpl extends ServiceImpl<ComplaintMainMapper, C
complaintDetailedService.saveBatch(complaintDetailedList); complaintDetailedService.saveBatch(complaintDetailedList);
List<Integer> orderTechnicianIds = orderServeMapper.selectList( Set<Integer> orderTechnicianIds = orderServeMapper.selectList(
new LambdaQueryWrapper<OrderServe>().eq(OrderServe::getOrderId, complaintMain.getOrderId())) new LambdaQueryWrapper<OrderServe>().eq(OrderServe::getOrderId, complaintMain.getOrderId()))
.stream() .stream()
.map(OrderServe::getTechnicianId) .map(OrderServe::getTechnicianId)
.map(technicianIds -> Lists.newArrayList(technicianIds.split(","))) .map(technicianIds -> Lists.newArrayList(technicianIds.split(",")))
.flatMap(List::stream) .flatMap(List::stream)
.map(Integer::valueOf) .map(Integer::valueOf)
.collect(Collectors.toList()); .collect(Collectors.toSet());
List<ComplaintDetailedTechnician> complaintDetailedTechnicianList = complaintDetailedList List<ComplaintDetailedTechnician> complaintDetailedTechnicianList = complaintDetailedList
.stream() .stream()
......
...@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service; ...@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
@Service @Service
...@@ -37,7 +38,7 @@ public class GogirlTokenServiceImpl implements GogirlTokenService { ...@@ -37,7 +38,7 @@ public class GogirlTokenServiceImpl implements GogirlTokenService {
@Override @Override
public void save(GogirlToken gogirlToken) { public void save(GogirlToken gogirlToken) {
redisTemplate.opsForValue().set(gogirlToken.getToken(), JsonUtilByFsJson.beanToJson(gogirlToken)); redisTemplate.opsForValue().set(gogirlToken.getToken(), JsonUtilByFsJson.beanToJson(gogirlToken), 1, TimeUnit.DAYS);
} }
@Override @Override
...@@ -48,7 +49,7 @@ public class GogirlTokenServiceImpl implements GogirlTokenService { ...@@ -48,7 +49,7 @@ public class GogirlTokenServiceImpl implements GogirlTokenService {
@Override @Override
public void updateByToken(GogirlToken gogirlToken) { public void updateByToken(GogirlToken gogirlToken) {
redisTemplate.opsForValue().set(gogirlToken.getToken(), JsonUtilByFsJson.beanToJson(gogirlToken)); redisTemplate.opsForValue().set(gogirlToken.getToken(), JsonUtilByFsJson.beanToJson(gogirlToken), 1, TimeUnit.DAYS);
} }
@Override @Override
......
...@@ -233,6 +233,8 @@ public class OrderServe implements Serializable { ...@@ -233,6 +233,8 @@ public class OrderServe implements Serializable {
private BigDecimal leisurePrice; private BigDecimal leisurePrice;
public void addDiscountPrice(BigDecimal discountPrice) { public void addDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = this.discountPrice.add(discountPrice); this.discountPrice = this.discountPrice.add(discountPrice);
this.payPrice = this.payPrice.subtract(discountPrice); this.payPrice = this.payPrice.subtract(discountPrice);
......
...@@ -36,4 +36,9 @@ public interface BaseProduceMapper extends BaseMapper<BaseProduce> { ...@@ -36,4 +36,9 @@ public interface BaseProduceMapper extends BaseMapper<BaseProduce> {
@Param("featuresId") Integer featuresId, @Param("featuresId") Integer featuresId,
@Param("serveTypeId") Integer serveTypeId, @Param("serveTypeId") Integer serveTypeId,
@Param("sort") Integer sort); @Param("sort") Integer sort);
/**
* 同步款式服务类型id
*/
void syncProduceServeTypeId();
} }
...@@ -25,6 +25,7 @@ import com.gogirl.domain.user.customer.Customer; ...@@ -25,6 +25,7 @@ import com.gogirl.domain.user.customer.Customer;
import com.gogirl.domain.user.customer.CustomerBalanceRecord; import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import com.gogirl.domain.xcx.WeekConfig; import com.gogirl.domain.xcx.WeekConfig;
import com.gogirl.infrastructure.common.util.DateUtils; import com.gogirl.infrastructure.common.util.DateUtils;
import com.gogirl.infrastructure.common.util.JsonUtilByJackson;
import com.gogirl.infrastructure.common.util.ListUtil; import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.config.property.GogirlProperties; import com.gogirl.infrastructure.config.property.GogirlProperties;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
...@@ -36,6 +37,7 @@ import com.gogirl.infrastructure.mapper.order.serve.ScheduleManageMapper; ...@@ -36,6 +37,7 @@ import com.gogirl.infrastructure.mapper.order.serve.ScheduleManageMapper;
import com.gogirl.infrastructure.mapper.product.mall.MallCategoryMapper; import com.gogirl.infrastructure.mapper.product.mall.MallCategoryMapper;
import com.gogirl.infrastructure.mapper.product.mall.MallProductMapper; import com.gogirl.infrastructure.mapper.product.mall.MallProductMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper; import com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.infrastructure.mapper.product.serve.FeaturesMappingMapper; import com.gogirl.infrastructure.mapper.product.serve.FeaturesMappingMapper;
import com.gogirl.infrastructure.mapper.product.serve.ProduceSalesMapper; import com.gogirl.infrastructure.mapper.product.serve.ProduceSalesMapper;
import com.gogirl.infrastructure.mapper.store.career.CareerMapper; import com.gogirl.infrastructure.mapper.store.career.CareerMapper;
...@@ -46,14 +48,28 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe ...@@ -46,14 +48,28 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe
import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper; import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper;
import com.gogirl.infrastructure.service.push.PushMsgService; import com.gogirl.infrastructure.service.push.PushMsgService;
import com.gogirl.infrastructure.service.push.TechnicianPushService; import com.gogirl.infrastructure.service.push.TechnicianPushService;
import com.gogirl.shared.admin.AdminPage;
import com.gogirl.shared.admin.AdminResult;
import com.gogirl.shared.admin.AdminTechnicianScore;
import com.gogirl.shared.admin.GetTechnicianPageRequest;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -106,6 +122,8 @@ public class Schedule { ...@@ -106,6 +122,8 @@ public class Schedule {
private final TimesCardCustomerRelevanceMapper timesCardCustomerRelevanceMapper; private final TimesCardCustomerRelevanceMapper timesCardCustomerRelevanceMapper;
private final RestTemplate restTemplate;
/** /**
* 每天3点判断优惠券是否过期。 * 每天3点判断优惠券是否过期。
*/ */
...@@ -366,7 +384,7 @@ public class Schedule { ...@@ -366,7 +384,7 @@ public class Schedule {
/** /**
* 每天0点定时同步美甲师成长历程 * 每天0点定时同步美甲师成长历程
*/ */
@Scheduled(cron = "0 0 0 * * *") @Scheduled(cron = "0 0/1 * * * *")
public void syncTechnicianCareer() { public void syncTechnicianCareer() {
log.info("定时同步美甲师成长历程** 任务开始"); log.info("定时同步美甲师成长历程** 任务开始");
...@@ -376,50 +394,50 @@ public class Schedule { ...@@ -376,50 +394,50 @@ public class Schedule {
storeTechnicianList.forEach(storeTechnician -> { storeTechnicianList.forEach(storeTechnician -> {
// ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>> responseBodyType = new ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>>() { ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>> responseBodyType = new ParameterizedTypeReference<AdminResult<AdminPage<AdminTechnicianScore>>>() {
// }; };
// GetTechnicianPageRequest allRequest = GetTechnicianPageRequest.builder() GetTechnicianPageRequest allRequest = GetTechnicianPageRequest.builder()
// .page(1) .page(1)
// .rows(30) .rows(30)
// .sidx("grade") .sidx("grade")
// .sord("asc") .sord("asc")
// //在职 //在职
// .status(1) .status(1)
// .technician_id(storeTechnician.getId()) .technician_id(storeTechnician.getId())
// .build(); .build();
// HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON); headers.setContentType(MediaType.APPLICATION_JSON);
// HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest, headers); HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest, headers);
// AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType) AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType)
// .getBody() .getBody()
// .getData() .getData()
// .getItems() .getItems()
// .stream() .stream()
// .findAny() .findAny()
// .orElse(new AdminTechnicianScore()); .orElse(new AdminTechnicianScore());
// GetTechnicianPageRequest monthRequest = GetTechnicianPageRequest.builder() GetTechnicianPageRequest monthRequest = GetTechnicianPageRequest.builder()
// .page(1) .page(1)
// .rows(30) .rows(30)
// .sidx("grade") .sidx("grade")
// .sord("asc") .sord("asc")
// //在职 //在职
// .status(1) .status(1)
// .date_utc(Lists.newArrayList(LocalDateTime.of(LocalDate.of(2020, 4, 1), LocalTime.of(0, 0)).toString(), LocalDateTime.now().toString())) .date_utc(Lists.newArrayList(LocalDateTime.of(LocalDate.of(2020, LocalDate.now().getMonth(), 1), LocalTime.of(0, 0)).toString(), LocalDateTime.now().toString()))
// .technician_id(storeTechnician.getId()) .technician_id(storeTechnician.getId())
// .build(); .build();
//
// HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest, headers); HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest, headers);
// log.debug(JsonUtilByJackson.writeValueAsString(monthRequest)); log.debug(JsonUtilByJackson.writeValueAsString(monthRequest));
// AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType) AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType)
// .getBody() .getBody()
// .getData() .getData()
// .getItems() .getItems()
// .stream() .stream()
// .findAny() .findAny()
// .orElse(new AdminTechnicianScore()); .orElse(new AdminTechnicianScore());
Career career = careerMapper.selectOne(new LambdaQueryWrapper<Career>().eq(Career::getTechnicianId, storeTechnician.getId())); Career career = careerMapper.selectOne(new LambdaQueryWrapper<Career>().eq(Career::getTechnicianId, storeTechnician.getId()));
...@@ -443,66 +461,66 @@ public class Schedule { ...@@ -443,66 +461,66 @@ public class Schedule {
/*当月*/ /*当月*/
//当月开卡数量 //当月开卡数量
// career.setMonthBalanceCardNum(monthAdminResult.getCard_count()); career.setMonthBalanceCardNum(monthAdminResult.getCard_count());
//当月考勤准时 //当月考勤准时
career.setMonthAttendancePercent(null); career.setMonthAttendancePercent(null);
//当月信息录入完整度 //当月信息录入完整度
// career.setMonthInfoPercent(monthAdminResult.getAvg_data_integrity()); career.setMonthInfoPercent(monthAdminResult.getAvg_data_integrity());
//当月订单总数 //当月订单总数
Integer monthOrderNum = careerMapper.queryMonthOrderNum(storeTechnician.getId(), month); Integer monthOrderNum = careerMapper.queryMonthOrderNum(storeTechnician.getId(), month);
career.setMonthOrderNum(monthOrderNum); 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(); BigDecimal montInfoPercent = monthAdminResult.getAvg_data_integrity();
// if (montInfoPercent != null) { if (montInfoPercent != null) {
// career.setMonthInfoPercent(montInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); career.setMonthInfoPercent(montInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
// } }
/*总计*/ /*总计*/
//总考勤准时率 //总考勤准时率
career.setTotalAttendancePercent(null); career.setTotalAttendancePercent(null);
//总开卡数 //总开卡数
// career.setTotalBalanceCardNum(allAdminResult.getCard_count()); career.setTotalBalanceCardNum(allAdminResult.getCard_count());
//总信息录入完整度 //总信息录入完整度
// BigDecimal totalInfoPercent = allAdminResult.getAvg_data_integrity(); BigDecimal totalInfoPercent = allAdminResult.getAvg_data_integrity();
// if (totalInfoPercent != null) { if (totalInfoPercent != null) {
// career.setTotalInfoPercent(totalInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); career.setTotalInfoPercent(totalInfoPercent.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
// } }
//总订单数 //总订单数
Integer totalOrderNum = careerMapper.queryTotalOrderNum(storeTechnician.getId(), month); Integer totalOrderNum = careerMapper.queryTotalOrderNum(storeTechnician.getId(), month);
career.setTotalOrderNum(totalOrderNum); career.setTotalOrderNum(totalOrderNum);
//总好评率 //总好评率
// career.setTotalPraisePercent(allAdminResult.getPraise_proportion()); career.setTotalPraisePercent(allAdminResult.getPraise_proportion());
//总考勤准时比率 //总考勤准时比率
career.setTotalAttendancePercent(null); 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());
/*美甲师信息*/ /*美甲师信息*/
//美甲师名字 //美甲师名字
...@@ -663,4 +681,16 @@ public class Schedule { ...@@ -663,4 +681,16 @@ public class Schedule {
} }
private final BaseProduceMapper baseProduceMapper;
/**
* 每天凌晨3点同步款式的服务类型id
*/
@Scheduled(cron = "0 0 3 * * ?")
public void syncProduceServeTypeId() {
log.info("同步款式的服务类型id开始");
baseProduceMapper.syncProduceServeTypeId();
log.info("同步款式的服务类型id结束");
}
} }
...@@ -71,4 +71,9 @@ public class AchievementsPersonaResult { ...@@ -71,4 +71,9 @@ public class AchievementsPersonaResult {
private BigDecimal shop_item_val;//0.0000; private BigDecimal shop_item_val;//0.0000;
private BigDecimal shop_item_score;//100.0000; private BigDecimal shop_item_score;//100.0000;
private BigDecimal shop_item_proportion;//0.2000 private BigDecimal shop_item_proportion;//0.2000
private String activate_a_card_val_str;
private String praise_val_str;
private String service_time_val_str;
} }
...@@ -91,7 +91,7 @@ gogirl: ...@@ -91,7 +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/GetTechnicianPage
#后台接口地址 #后台接口地址
admin-backend-achievements-url: http://admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi admin-backend-achievements-url: http://admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
#企业微信预约消息推送 #企业微信预约消息推送
......
...@@ -69,6 +69,13 @@ ...@@ -69,6 +69,13 @@
<sql id="bpSql"> <sql id="bpSql">
bp.id, bp.name, bp.picture_path picturePath, bp.type, bp.label, bp.shop_sort shopSort, bp.req_grade reqQrade, bp.status, bp.remark, bp.details, bs.id serveId, bs.name serveName bp.id, bp.name, bp.picture_path picturePath, bp.type, bp.label, bp.shop_sort shopSort, bp.req_grade reqQrade, bp.status, bp.remark, bp.details, bs.id serveId, bs.name serveName
</sql> </sql>
<update id="syncProduceServeTypeId">
update base_produce t1
LEFT JOIN base_serve t2 on t1.service_id = t2.id
set t1.serve_type_id = t2.type_id
where t1.serve_type_id is null
and t2.id is not null
</update>
<select id="getProduceForDetail" resultMap="produceResultMap"> <select id="getProduceForDetail" resultMap="produceResultMap">
select select
......
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