Commit d0bc8ee9538ab7e7eee194322977925ff57c6511
1 parent
b91e5d54
跟进池接口调整
Showing
5 changed files
with
100 additions
and
8 deletions
doc/v1.0.1/升级事项 deleted
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-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-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) { | ... | ... |