Commit 9faf8fc5b35ac3c521e44e4bd730ef95370fb6b9

Authored by 张志伟
2 parents 91f54383 119139c6

Merge remote-tracking branch 'origin/dev' into test

doc/v1.0.1/升级事项 deleted
1   -1. 新增角色 :
2   - 保有客分配 BYKFP 一个服务站一个
3   -
4   -2.资源路径
5   - /app/leave2do/** 保有客分配
6 0 \ No newline at end of file
doc/v1.0.1/升级事项.md 0 → 100644
  1 +##### 新增角色:
  2 +
  3 + |名称|角色码|备注|
  4 + | --|--|--|
  5 + |保有客分配 |BYKFP |一个服务站一个|
  6 +
  7 +
  8 +##### 资源路径:
  9 + ASCustomerDistribute 保有客分配 菜单
  10 + /app/leave2do/customer/** 保有客分配url
  11 + AsCrmOwnFollowUpPool 跟进池 菜单
  12 + /app/pool/follow/** 跟进池列表请求url
  13 +
  14 +##### 升级内容:
  15 +
  16 +1. 去掉战败池和成交池
  17 +2. 跟进池调整(菜单只能看自己的)
  18 +3. 事故车线索新增备案手机号
  19 +4. 新增离职分配功能(需等人事下个版本)
  20 +4. 跟进算法调整
  21 +5. 首保设置新增项目
  22 +7. 报表
  23 +8. 成交、战败 逻辑调整
... ...
fw-valhalla-common/src/main/java/cn/fw/valhalla/common/utils/DateUtil.java
... ... @@ -7,6 +7,7 @@ import java.time.*;
7 7 import java.time.temporal.TemporalAdjusters;
8 8 import java.util.Calendar;
9 9 import java.util.Date;
  10 +import java.util.Objects;
10 11  
11 12 /**
12 13 * 日期处理工具
... ... @@ -453,6 +454,74 @@ public final class DateUtil {
453 454 return (int) result;
454 455 }
455 456  
  457 + /**
  458 + * 判断是否是凌晨
  459 + *
  460 + * @param date
  461 + * @return
  462 + */
  463 + public static boolean isBeforeDawn(Date date) {
  464 + if (Objects.isNull(date)) {
  465 + return false;
  466 + }
  467 + LocalDateTime dateTime = date2LocalDateTime(date);
  468 + SimpleDateFormat df = new SimpleDateFormat("HH");
  469 + String str = df.format(localDateTime2Date(dateTime));
  470 + int a = Integer.parseInt(str);
  471 + return a >= 0 && a <= 6;
  472 + }
  473 +
  474 + /**
  475 + * 判断是否是上午
  476 + *
  477 + * @param date
  478 + * @return
  479 + */
  480 + public static boolean isMorning(Date date) {
  481 + if (Objects.isNull(date)) {
  482 + return false;
  483 + }
  484 + LocalDateTime dateTime = date2LocalDateTime(date);
  485 + SimpleDateFormat df = new SimpleDateFormat("HH");
  486 + String str = df.format(localDateTime2Date(dateTime));
  487 + int a = Integer.parseInt(str);
  488 + return a > 6 && a <= 12;
  489 + }
  490 +
  491 + /**
  492 + * 判断是否是下午
  493 + *
  494 + * @param date
  495 + * @return
  496 + */
  497 + public static boolean isAfternoon(Date date) {
  498 + if (Objects.isNull(date)) {
  499 + return false;
  500 + }
  501 + LocalDateTime dateTime = date2LocalDateTime(date);
  502 + SimpleDateFormat df = new SimpleDateFormat("HH");
  503 + String str = df.format(localDateTime2Date(dateTime));
  504 + int a = Integer.parseInt(str);
  505 + return a > 12 && a <= 18;
  506 + }
  507 +
  508 + /**
  509 + * 判断是否是晚上
  510 + *
  511 + * @param date
  512 + * @return
  513 + */
  514 + public static boolean isEvening(Date date) {
  515 + if (Objects.isNull(date)) {
  516 + return false;
  517 + }
  518 + LocalDateTime dateTime = date2LocalDateTime(date);
  519 + SimpleDateFormat df = new SimpleDateFormat("HH");
  520 + String str = df.format(localDateTime2Date(dateTime));
  521 + int a = Integer.parseInt(str);
  522 + return a > 18 && a <= 23;
  523 + }
  524 +
456 525 public static void main(String[] args) throws ParseException {
457 526 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
458 527 Date date = format.parse("2020-09-19 09:45:30");
... ...
fw-valhalla-rpc/src/main/java/cn/fw/valhalla/rpc/erp/UserRoleRpcService.java
... ... @@ -5,6 +5,7 @@ import cn.fw.erp.sdk.api.UserRoleApi;
5 5 import cn.fw.erp.sdk.api.result.UserRoleDataRange;
6 6 import cn.fw.erp.sdk.api.result.UserRoleInfo;
7 7 import com.alibaba.fastjson.JSON;
  8 +import com.alibaba.fastjson.JSONObject;
8 9 import lombok.extern.slf4j.Slf4j;
9 10 import org.springframework.stereotype.Service;
10 11  
... ... @@ -43,7 +44,7 @@ public class UserRoleRpcService {
43 44 }
44 45 try {
45 46 Message<List<UserRoleDataRange>> msg = userRoleApi.queryUserRoleDataRange(userId, roleCode);
46   - log.warn("调用ERP系统查询用户数据范围,userId:{},roleCode:{}, result:{}", userId, roleCode, msg);
  47 + log.warn("调用ERP系统查询用户数据范围,userId:{},roleCode:{}, result:{}", userId, roleCode, JSONObject.toJSONString(msg));
47 48 if (!msg.isSuccess()) {
48 49 return Collections.emptyList();
49 50 }
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java
... ... @@ -43,7 +43,7 @@ public class CommonController {
43 43  
44 44 @GetMapping("/staff/list")
45 45 public Message<List<PostUserVO>> list(@NotNull(message = "服务站ID不能为空") final Long shopId,
46   - @NotNull(message = "跟进类型ID不能为空") final Integer type) {
  46 + @NotNull(message = "跟进类型不能为空") final Integer type) {
47 47 final String msg = "查询跟进人员[app/common/staff/list]";
48 48 try {
49 49 log.info("{}: param[shopId: {} type: {}]", msg, shopId, type);
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/converter/Timestamp2LocalDateConverter.java deleted
1   -package cn.fw.valhalla.converter;
2   -
3   -import org.apache.commons.lang3.StringUtils;
4   -import org.apache.commons.lang3.math.NumberUtils;
5   -import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
6   -import org.springframework.core.convert.converter.Converter;
7   -import org.springframework.lang.Nullable;
8   -import org.springframework.stereotype.Component;
9   -
10   -import java.time.Instant;
11   -import java.time.LocalDate;
12   -import java.time.ZoneId;
13   -
14   -/**
15   - * create at 2020-10-19
16   - *
17   - * @author kurisu
18   - */
19   -@Component
20   -@ConfigurationPropertiesBinding
21   -public class Timestamp2LocalDateConverter implements Converter<String, LocalDate> {
22   - @Override
23   - @Nullable
24   - public LocalDate convert(@Nullable final String value) {
25   - if (StringUtils.isNotBlank(value) && NumberUtils.isDigits(value)) {
26   - return Instant.ofEpochMilli(NumberUtils.toLong(value)).atZone(ZoneId.systemDefault()).toLocalDate();
27   - }
28   - return null;
29   - }
30   -}
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java
... ... @@ -12,7 +12,6 @@ import cn.fw.valhalla.domain.db.follow.FollowTask;
12 12 import cn.fw.valhalla.domain.dto.CustomerDetailDto;
13 13 import cn.fw.valhalla.domain.dto.FollowAttachmentDTO;
14 14 import cn.fw.valhalla.domain.enums.*;
15   -import cn.fw.valhalla.domain.vo.follow.ACDetailVO;
16 15 import cn.fw.valhalla.domain.vo.follow.FollowDetailVO;
17 16 import cn.fw.valhalla.domain.vo.follow.FollowRecordVO;
18 17 import cn.fw.valhalla.domain.vo.setting.SettingVO;
... ... @@ -595,6 +594,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
595 594 return null;
596 595 }
597 596 Integer value = vo.getDetailValue();
  597 + SettingUnitEnum unit = Objects.requireNonNull(SettingUnitEnum.ofValue(vo.getUnit()));
598 598 if (value == null || value <= 0) {
599 599 log.info("关键设置数据异常,请检查数据 : settingType[{}] settingId[{}]", vo.getType(), vo.getId());
600 600 return null;
... ... @@ -602,7 +602,12 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
602 602 if (reverse) {
603 603 value = -1 * value;
604 604 }
605   - return DateUtil.getExpired(origin, value, getCalendarType(Objects.requireNonNull(SettingUnitEnum.ofValue(vo.getUnit()))));
  605 + Timestamp expired = DateUtil.getExpired(origin, value, getCalendarType(unit));
  606 + DateUtil.date2LocalDateTime(expired);
  607 + if (SettingUnitEnum.DAY.equals(unit) && !DateUtil.isBeforeDawn(expired)) {
  608 + expired = DateUtil.getExpired(DateUtil.startDate(expired), 1, Calendar.DATE);
  609 + }
  610 + return expired;
606 611 }
607 612  
608 613 protected String getItemCode(FollowTypeEnum type) {
... ...