From 34b20e3aec589e23702b274765ce840aadc4a08b Mon Sep 17 00:00:00 2001 From: Kurisu Date: Mon, 20 Feb 2023 16:38:11 +0800 Subject: [PATCH] :sparkles: feature(*): 清理过时的方法和类 --- doc/v2.0/update.sql | 3 +++ fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerCluePoolMapper.java | 57 --------------------------------------------------------- fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowClueMapper.java | 4 ++-- fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowTaskMapper.java | 40 ---------------------------------------- fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml | 300 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml | 181 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/follow/FollowTask.java | 101 ----------------------------------------------------------------------------------------------------- fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/CustomerCluePool.java | 98 -------------------------------------------------------------------------------------------------- fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java | 65 ----------------------------------------------------------------- fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowClueDTO.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/wx/CustomerWxController.java | 29 ----------------------------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java | 23 +++++++++++------------ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/StammkundeBizService.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++------------------ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java | 229 +++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java | 48 ++++++++++++++++++++++++------------------------ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java | 6 +++--- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerCluePoolService.java | 88 ---------------------------------------------------------------------------------------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowClueService.java | 4 ++-- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowTaskService.java | 68 -------------------------------------------------------------------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerCluePoolServiceImpl.java | 89 ----------------------------------------------------------------------------------------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowClueServiceImpl.java | 4 ++-- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowTaskServiceImpl.java | 77 ----------------------------------------------------------------------------- 22 files changed, 193 insertions(+), 1450 deletions(-) create mode 100644 doc/v2.0/update.sql delete mode 100644 fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerCluePoolMapper.java delete mode 100644 fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowTaskMapper.java delete mode 100644 fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml delete mode 100644 fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml delete mode 100644 fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/follow/FollowTask.java delete mode 100644 fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/CustomerCluePool.java delete mode 100644 fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java create mode 100644 fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowClueDTO.java delete mode 100644 fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerCluePoolService.java delete mode 100644 fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowTaskService.java delete mode 100644 fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerCluePoolServiceImpl.java delete mode 100644 fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowTaskServiceImpl.java diff --git a/doc/v2.0/update.sql b/doc/v2.0/update.sql new file mode 100644 index 0000000..ec0b726 --- /dev/null +++ b/doc/v2.0/update.sql @@ -0,0 +1,3 @@ +drop table if exists customer_clue_pool; + +drop table if exists follow_task; diff --git a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerCluePoolMapper.java b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerCluePoolMapper.java deleted file mode 100644 index 95448f8..0000000 --- a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerCluePoolMapper.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.fw.valhalla.dao.mapper; - -import cn.fw.valhalla.domain.db.pool.CustomerCluePool; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; -import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * @author : kurisu - * @className : CustomerCluePoolMapper - * @description : 客户线索池 - * @date: 2020-11-12 09:34 - */ -@Repository -public interface CustomerCluePoolMapper extends BaseMapper { - /** - * 客户线索池 - * fixme 数据量大的时候性能有问题 - * @param startIndex - * @param pageSize - * @param queryVO - * @return - */ - List clueList(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("condition") CustomerCluePoolQueryVO queryVO); - - /** - * 总数 - * @param queryVO - * @return - */ - Long clueListCount(@Param("condition") CustomerCluePoolQueryVO queryVO); - - /** - * 成交数 - * @param queryVO - * @return - */ - Long completeNum(@Param("condition") CustomerCluePoolQueryVO queryVO); - - /** - * 战败数 - * @param queryVO - * @return - */ - Long defeatNum(@Param("condition") CustomerCluePoolQueryVO queryVO); - - /** - * 进行中的数量 - * @param queryVO - * @return - */ - Long onGoingNum(@Param("condition") CustomerCluePoolQueryVO queryVO); -} diff --git a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowClueMapper.java b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowClueMapper.java index 3e731ca..2a2e1ca 100644 --- a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowClueMapper.java +++ b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowClueMapper.java @@ -1,7 +1,7 @@ package cn.fw.valhalla.dao.mapper; import cn.fw.valhalla.domain.db.follow.FollowClue; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; +import cn.fw.valhalla.domain.dto.FollowClueDTO; import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; @@ -27,7 +27,7 @@ public interface FollowClueMapper extends BaseMapper { * @param queryVO * @return */ - List clueList(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("condition") CustomerCluePoolQueryVO queryVO); + List clueList(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("condition") CustomerCluePoolQueryVO queryVO); /** * 总数 diff --git a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowTaskMapper.java b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowTaskMapper.java deleted file mode 100644 index accab23..0000000 --- a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/FollowTaskMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.fw.valhalla.dao.mapper; - -import cn.fw.valhalla.domain.db.follow.FollowTask; -import cn.fw.valhalla.domain.dto.FollowPoolDTO; -import cn.fw.valhalla.domain.dto.StammkundeAnalyseDTO; -import cn.fw.valhalla.domain.query.FollowPoolQueryVO; -import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * @author : kurisu - * @className : FollowTaskMapper - * @description : 跟进任务 - * @date: 2020-08-12 10:58 - */ -@Repository -public interface FollowTaskMapper extends BaseMapper { - /** - * 跟进池 - * fixme 性能有问题 - * - * @param startIndex - * @param pageSize - * @param queryVO - * @return - */ - List followList(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("condition") FollowPoolQueryVO queryVO); - - /** - * 查询跟进池总数 - * - * @param queryVO - * @return - */ - Long followListCount(@Param("condition") FollowPoolQueryVO queryVO); -} diff --git a/fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml deleted file mode 100644 index 326f821..0000000 --- a/fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml deleted file mode 100644 index eebe633..0000000 --- a/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/follow/FollowTask.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/follow/FollowTask.java deleted file mode 100644 index a75a073..0000000 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/follow/FollowTask.java +++ /dev/null @@ -1,101 +0,0 @@ -package cn.fw.valhalla.domain.db.follow; - -import cn.fw.common.data.entity.BaseAuditableTimeEntity; -import cn.fw.valhalla.domain.enums.FeedbackTypeEnum; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import cn.fw.valhalla.domain.enums.TaskDefeatTypeEnum; -import cn.fw.valhalla.domain.enums.TaskStateEnum; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 跟进任务 - * - * @author kurisu - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class FollowTask extends BaseAuditableTimeEntity { - /** - * 线索id - */ - private Long clueId; - /** - * 档案id - */ - private Long customerId; - /** - * 跟进类型 - */ - private FollowTypeEnum type; - /** - * 任务开始时间 - */ - private Date beginTime; - /** - * 是否是二次分配 - */ - private Boolean redistribution; - /** - * 截止日期 - */ - private Date deadline; - /** - * 是否完成 - */ - private TaskStateEnum state; - /** - * 终止时间 - */ - private Date closeTime; - /** - * 当前跟进人 - */ - private Long followUser; - private String followUserName; - /** - * 当前跟进人门店 - */ - private Long followShop; - /** - * 完成人 - */ - private Long finishUser; - private String finishUserName; - /** - * 接待人 - */ - private Long receptionUserId; - private String receptionUserName; - /** - * 接待门店 - */ - private Long receptionShopId; - private String receptionShopName; - /** - * 完成门店 - */ - private Long finishShop; - /** - * 任务战败原因 - */ - private TaskDefeatTypeEnum reason; - /** - * 跟进次数 - */ - private Integer times; - /** - * 反馈类型 - */ - private String feedback; - /** - * 最新反馈 - */ - private FeedbackTypeEnum lastFeedback; - /** - * 集团id - */ - private Long groupId; -} diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/CustomerCluePool.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/CustomerCluePool.java deleted file mode 100644 index eb15b2d..0000000 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/CustomerCluePool.java +++ /dev/null @@ -1,98 +0,0 @@ -package cn.fw.valhalla.domain.db.pool; - -import cn.fw.common.data.entity.BaseAuditableTimeEntity; -import cn.fw.valhalla.domain.enums.ClueStatusEnum; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -import java.util.Date; - -/** - * @author : kurisu - * @className : CustomerCluePool - * @description : 客户线索池 - * @date: 2020-11-11 18:02 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class CustomerCluePool extends BaseAuditableTimeEntity { - /** - * 档案id或者事故车线索id - */ - private Long refererId; - /** - * 车架号 - */ - private String frameNo; - /** - * 车牌号 - */ - private String plateNo; - /** - * 线索类型 同跟进类型 - */ - private FollowTypeEnum clueType; - /** - * 添加时间 - */ - private Date addTime; - /** - * 生效时间 - */ - private Date startTime; - /** - * 过期时间 - */ - private Date deadline; - /** - * 完成时间 - */ - private Date closeTime; - /** - * 是否过期 - */ - private ClueStatusEnum clueStatus; - /** - * 是否已经二次分配 - */ - private Boolean redistribution; - /** - * 初始跟进人id - */ - private Long originalUserId; - /** - * 初始跟进人名称 - */ - private String originalUserName; - /** - * 初始跟进门店id - */ - private Long originalShopId; - /** - * 初始跟进门店名称 - */ - private String originalShopName; - /** - * 成交人员id - */ - private Long finishUserId; - /** - * 成交人员名称 - */ - private String finishUserName; - /** - * 成交门店id - */ - private Long finishShopId; - /** - * 成交门店名称 - */ - private String finishShopName; - /** - * 集团id - */ - private Long groupId; -} diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java deleted file mode 100644 index 33d26fb..0000000 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.fw.valhalla.domain.dto; - -import lombok.Data; -import lombok.ToString; - -import java.util.Date; - -/** - * @author : kurisu - * @className : CustomerCluePoolDTO - * @description : 客户线索池 - * @date: 2020-11-20 15:27 - */ -@Data -@ToString -public class CustomerCluePoolDTO { - /** - * 档案id - */ - private Long customerId; - /** - * 车牌号 - */ - private String plateNo; - /** - * 线索类型 - */ - private Integer type; - /** - * 车架号 - */ - private String frameNo; - /** - * 购车时间 - */ - private Date buyDate; - /** - * 上次进站时间 - */ - private Date arrivalTime; - /** - * 保险到期时间 - */ - private Date insuranceExpires; - /** - * 线索开始时间 - */ - private Date createDate; - /** - * 线索到期时间 - */ - private Date deadline; - /** - * 线索状态 - */ - private Integer clueStatus; - /** - * 关单时间 - */ - private Date closeTime; - /** - * 贷款到期时间 - */ - private Date loanExpires; -} diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowClueDTO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowClueDTO.java new file mode 100644 index 0000000..1bed1b3 --- /dev/null +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowClueDTO.java @@ -0,0 +1,65 @@ +package cn.fw.valhalla.domain.dto; + +import lombok.Data; +import lombok.ToString; + +import java.util.Date; + +/** + * @author : kurisu + * @className : FollowClueDTO + * @description : 客户线索池 + * @date: 2020-11-20 15:27 + */ +@Data +@ToString +public class FollowClueDTO { + /** + * 档案id + */ + private Long customerId; + /** + * 车牌号 + */ + private String plateNo; + /** + * 线索类型 + */ + private Integer type; + /** + * 车架号 + */ + private String frameNo; + /** + * 购车时间 + */ + private Date buyDate; + /** + * 上次进站时间 + */ + private Date arrivalTime; + /** + * 保险到期时间 + */ + private Date insuranceExpires; + /** + * 线索开始时间 + */ + private Date createDate; + /** + * 线索到期时间 + */ + private Date deadline; + /** + * 线索状态 + */ + private Integer clueStatus; + /** + * 关单时间 + */ + private Date closeTime; + /** + * 贷款到期时间 + */ + private Date loanExpires; +} diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/wx/CustomerWxController.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/wx/CustomerWxController.java index 782fa84..7935a00 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/wx/CustomerWxController.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/wx/CustomerWxController.java @@ -7,7 +7,6 @@ import cn.fw.data.base.domain.common.Message; import cn.fw.security.auth.client.annotation.Authorization; import cn.fw.security.auth.client.enums.AuthType; import cn.fw.valhalla.domain.dto.CorrelationDto; -import cn.fw.valhalla.domain.dto.CustomerChangeDto; import cn.fw.valhalla.domain.dto.NewCustomerDTO; import cn.fw.valhalla.domain.vo.customer.CarArchiveVO; import cn.fw.valhalla.domain.vo.customer.CustomerChangeInfoVO; @@ -19,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.util.List; @@ -90,33 +88,6 @@ public class CustomerWxController { return success(changeBizService.mpGetById(cusId)); } - /** - * 回显用户修改的基本信息 - * - * @param user - * @param key - * @return - * @Deprecated 将在下版本移除此接口 2022-03-15 - */ - @Deprecated - @GetMapping("/change/info") - @ControllerMethod("保有客档案变更基本信息回显") - public Message changeInfo(@CurrentUser PassportAuthBean user, - @NotBlank(message = "口令不能为空") String key) { - return success(changeBizService.getInfo(user, key)); - } - - /** - * 档案详情修改 - * - * @param dto 档案信息 - */ - @Deprecated - @PostMapping("/save") - @ControllerMethod("修改档案信息") - public Message updateOrCreate(@CurrentUser PassportAuthBean user, @Validated @RequestBody final CustomerChangeDto dto) { - return success(changeBizService.updateOrSave(user, dto)); - } /** * 查询所有档案 diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java index 89865fe..8aa10a3 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java @@ -4,7 +4,7 @@ import cn.fw.valhalla.common.constant.RoleCode; import cn.fw.valhalla.common.utils.DateUtil; import cn.fw.valhalla.common.utils.StringUtils; import cn.fw.valhalla.domain.db.customer.CustomerReachLog; -import cn.fw.valhalla.domain.db.follow.FollowTask; +import cn.fw.valhalla.domain.db.follow.ClueTask; import cn.fw.valhalla.domain.db.pool.StammkundePool; import cn.fw.valhalla.domain.db.report.CustomerRetentionRatio; import cn.fw.valhalla.domain.enums.*; @@ -12,12 +12,11 @@ import cn.fw.valhalla.rpc.ehr.EhrRpcService; import cn.fw.valhalla.rpc.ehr.dto.StaffInfoDTO; import cn.fw.valhalla.rpc.erp.UserService; import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; -import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; import cn.fw.valhalla.rpc.oop.OopService; import cn.fw.valhalla.rpc.oop.dto.ShopDTO; +import cn.fw.valhalla.service.data.ClueTaskService; import cn.fw.valhalla.service.data.CustomerReachLogService; import cn.fw.valhalla.service.data.CustomerRetentionRatioService; -import cn.fw.valhalla.service.data.FollowTaskService; import cn.fw.valhalla.service.data.StammkundePoolService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; @@ -48,7 +47,7 @@ public class CustomerRetentionRatioBizService { private final EhrRpcService ehrRpcService; private final CustomerRetentionRatioService customerRetentionRatioService; private final StammkundePoolService stammkundePoolService; - private final FollowTaskService followTaskService; + private final ClueTaskService clueTaskService; private final CustomerReachLogService customerReachLogService; @Transactional(rollbackFor = Exception.class) @@ -203,14 +202,14 @@ public class CustomerRetentionRatioBizService { private int twiceNum(Long userId, Long shopId, Date preMonthEndDay, Date nowDate, FollowTypeEnum typeEnum) { Date endDay = DateUtil.getEndInTime(nowDate); - return followTaskService.count(Wrappers.lambdaQuery() - .eq(FollowTask::getState, TaskStateEnum.COMPLETE) - .eq(FollowTask::getRedistribution, Boolean.TRUE) - .eq(FollowTask::getType, typeEnum) - .eq(FollowTask::getFollowShop, shopId) - .eq(FollowTask::getFollowUser, userId) - .gt(FollowTask::getCloseTime, preMonthEndDay) - .le(FollowTask::getCloseTime, endDay) + return clueTaskService.count(Wrappers.lambdaQuery() + .eq(ClueTask::getState, TaskStateEnum.COMPLETE) + .eq(ClueTask::getRedistribution, Boolean.TRUE) + .eq(ClueTask::getType, typeEnum) + .eq(ClueTask::getFollowShop, shopId) + .eq(ClueTask::getFollowUser, userId) + .gt(ClueTask::getCloseTime, preMonthEndDay) + .le(ClueTask::getCloseTime, endDay) ); } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/StammkundeBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/StammkundeBizService.java index 0bd801a..5971b63 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/StammkundeBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/StammkundeBizService.java @@ -2,15 +2,18 @@ package cn.fw.valhalla.service.bus; import cn.fw.valhalla.common.utils.DateUtil; import cn.fw.valhalla.common.utils.GeoDistanceUtils; -import cn.fw.valhalla.domain.db.follow.FollowTask; +import cn.fw.valhalla.domain.db.customer.Customer; +import cn.fw.valhalla.domain.db.follow.ClueTask; +import cn.fw.valhalla.domain.db.follow.FollowClue; import cn.fw.valhalla.domain.dto.StammkundeAnalyseDTO; import cn.fw.valhalla.domain.enums.FollowTypeEnum; import cn.fw.valhalla.domain.enums.TaskStateEnum; import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; import cn.fw.valhalla.domain.vo.customer.StammkundeAddressAnalyseVO; import cn.fw.valhalla.domain.vo.customer.StammkundeAnalyseVO; +import cn.fw.valhalla.service.data.ClueTaskService; import cn.fw.valhalla.service.data.CustomerService; -import cn.fw.valhalla.service.data.FollowTaskService; +import cn.fw.valhalla.service.data.FollowClueService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -39,8 +42,9 @@ import static cn.fw.common.businessvalidator.Validator.BV; @RequiredArgsConstructor public class StammkundeBizService { - private final FollowTaskService followTaskService; + private final ClueTaskService clueTaskService; private final CustomerService customerService; + private final FollowClueService followClueService; public List stammkundeList(final StammkundeAnalyseQueryVO queryVO) { boolean verifyPoi = Objects.nonNull(queryVO.getLat()) && Objects.nonNull(queryVO.getLng()); @@ -58,18 +62,16 @@ public class StammkundeBizService { BV.notNull(typeEnum, () -> "跟进类型不正确"); boolean underway = Boolean.TRUE.equals(queryVO.getUnderway()); TaskStateEnum stateEnum = underway ? TaskStateEnum.ONGOING : TaskStateEnum.DEFEAT; - List tasks = followTaskService.list(Wrappers.lambdaQuery() - .eq(FollowTask::getType, typeEnum) - .eq(FollowTask::getState, stateEnum) - .in(!CollectionUtils.isEmpty(queryVO.getShopIds()), FollowTask::getFollowShop, queryVO.getShopIds()) - .between(!underway, FollowTask::getCloseTime, queryVO.getStartTime(), queryVO.getEndTime()) + List tasks = clueTaskService.list(Wrappers.lambdaQuery() + .eq(ClueTask::getType, typeEnum) + .eq(ClueTask::getState, stateEnum) + .in(!CollectionUtils.isEmpty(queryVO.getShopIds()), ClueTask::getFollowShop, queryVO.getShopIds()) + .between(!underway, ClueTask::getCloseTime, queryVO.getStartTime(), queryVO.getEndTime()) ); if (CollectionUtils.isEmpty(tasks)) { return new ArrayList<>(); } - queryVO.setShopIds(null); - Set customerIds = tasks.stream().map(FollowTask::getCustomerId).collect(Collectors.toSet()); - queryVO.setCustomerIds(customerIds); + fillCustomer(tasks, queryVO); } List list = customerService.analyseList(queryVO); @@ -101,18 +103,17 @@ public class StammkundeBizService { boolean underway = Boolean.TRUE.equals(queryVO.getUnderway()); FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(queryVO.getFollowType()); TaskStateEnum stateEnum = underway ? TaskStateEnum.ONGOING : TaskStateEnum.DEFEAT; - List tasks = followTaskService.list(Wrappers.lambdaQuery() - .eq(FollowTask::getType, typeEnum) - .eq(FollowTask::getState, stateEnum) - .in(!CollectionUtils.isEmpty(queryVO.getShopIds()), FollowTask::getFollowShop, queryVO.getShopIds()) - .between(!underway, FollowTask::getCloseTime, queryVO.getStartTime(), queryVO.getEndTime()) + List tasks = clueTaskService.list(Wrappers.lambdaQuery() + .eq(ClueTask::getType, typeEnum) + .eq(ClueTask::getState, stateEnum) + .in(!CollectionUtils.isEmpty(queryVO.getShopIds()), ClueTask::getFollowShop, queryVO.getShopIds()) + .between(!underway, ClueTask::getCloseTime, queryVO.getStartTime(), queryVO.getEndTime()) ); if (CollectionUtils.isEmpty(tasks)) { return new ArrayList<>(); } queryVO.setShopIds(null); - Set customerIds = tasks.stream().map(FollowTask::getCustomerId).collect(Collectors.toSet()); - queryVO.setCustomerIds(customerIds); + fillCustomer(tasks, queryVO); return customerService.analyseList(queryVO); } @@ -183,4 +184,31 @@ public class StammkundeBizService { queryVO.setMinLng(BigDecimal.valueOf(minLng)); queryVO.setMaxLng(BigDecimal.valueOf(maxLng)); } + + private void fillCustomer(List taskList, StammkundeAnalyseQueryVO queryVO) { + Set clueIdArr = taskList.stream().map(ClueTask::getClueId).collect(Collectors.toSet()); + if (CollectionUtils.isEmpty(clueIdArr)) { + return; + } + List list = followClueService.list(Wrappers.lambdaQuery() + .eq(FollowClue::getGroupId, queryVO.getGroupId()) + .in(FollowClue::getId, clueIdArr) + ); + if (CollectionUtils.isEmpty(list)) { + return; + } + Set vinArr = list.stream().map(FollowClue::getVin).collect(Collectors.toSet()); + if (CollectionUtils.isEmpty(vinArr)) { + return; + } + List custList = customerService.list(Wrappers.lambdaQuery() + .eq(Customer::getGroupId, queryVO.getGroupId()) + .in(Customer::getFrameNo, vinArr) + ); + if (CollectionUtils.isEmpty(custList)) { + return; + } + Set customerIds = custList.stream().map(Customer::getId).collect(Collectors.toSet()); + queryVO.setCustomerIds(customerIds); + } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java index 5b8c5e5..58518e8 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java @@ -1,14 +1,12 @@ package cn.fw.valhalla.service.bus.cust; -import cn.fw.common.exception.BusinessException; +import cn.fw.common.cache.locker.DistributedLocker; import cn.fw.common.web.annotation.DisLock; import cn.fw.common.web.auth.LoginAuthBean; -import cn.fw.common.web.auth.PassportAuthBean; import cn.fw.data.base.domain.common.Message; import cn.fw.hermes.sdk.api.para.BusinessType; import cn.fw.hermes.sdk.api.para.MsgParamCondition; import cn.fw.passport.sdk.api.param.WxBCodeParam; -import cn.fw.starter.redis.redis.RedisUtil; import cn.fw.valhalla.common.constant.RoleCode; import cn.fw.valhalla.common.utils.DateUtil; import cn.fw.valhalla.common.utils.MessageFormatUtil; @@ -17,11 +15,10 @@ import cn.fw.valhalla.common.utils.StringUtils; import cn.fw.valhalla.domain.db.customer.AffiliationRecord; import cn.fw.valhalla.domain.db.customer.Customer; import cn.fw.valhalla.domain.db.customer.CustomerBaseInfo; +import cn.fw.valhalla.domain.db.follow.ClueTask; import cn.fw.valhalla.domain.db.follow.FollowClue; import cn.fw.valhalla.domain.db.follow.FollowRecord; import cn.fw.valhalla.domain.db.follow.FollowRecordLog; -import cn.fw.valhalla.domain.db.follow.FollowTask; -import cn.fw.valhalla.domain.db.pool.CustomerCluePool; import cn.fw.valhalla.domain.db.pool.PublicCluePool; import cn.fw.valhalla.domain.db.pool.StammkundePool; import cn.fw.valhalla.domain.dto.*; @@ -39,19 +36,23 @@ import cn.fw.valhalla.rpc.passport.PassportService; import cn.fw.valhalla.sdk.enums.*; import cn.fw.valhalla.sdk.param.ChangeAdviserReq; import cn.fw.valhalla.sdk.result.CustomerInfoDto; +import cn.fw.valhalla.service.bus.CommonService; import cn.fw.valhalla.service.data.*; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import org.redisson.api.RLock; import org.springframework.beans.BeanUtils; -import org.springframework.context.ApplicationEventPublisher; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.TimeUnit; import static cn.fw.common.businessvalidator.Validator.BV; @@ -67,20 +68,21 @@ import static cn.fw.common.businessvalidator.Validator.BV; public class CustomerChangeBizService extends AbstractCustomerService { public final String CUSTOMER_CHANGE_CODE = "valhalla:customer:change:key:{0}:{1}"; - private final RedisUtil redisUtil; + private final DistributedLocker distributedLocker; + private final StringRedisTemplate stringRedisTemplate; /** * 会员服务 */ private final PassportService passportService; private final MemberRpcService memberRpcService; - private final FollowTaskService followTaskService; - private final CustomerCluePoolService customerCluePoolService; private final AffiliationRecordService affiliationRecordService; private final PublicPoolService publicPoolService; - private final ApplicationEventPublisher eventPublisher; private final FollowRecordService followRecordService; private final FollowNoticeRecordService followNoticeRecordService; private final FollowRecordLogService followRecordLogService; + private final FollowClueService followClueService; + private final ClueTaskService clueTaskService; + private final CommonService commonService; /** * 生成档案变更二维码 @@ -114,18 +116,16 @@ public class CustomerChangeBizService extends AbstractCustomerService { customerChangeDto.setAdviserId(user.getUserId()); } String key = MessageFormatUtil.MessageFormatTransfer(CUSTOMER_CHANGE_CODE, customerChangeDto.getShopId(), str); - try { - String customerString = JSON.toJSONString(customerChangeDto); - boolean flag = redisUtil.lock(key, 1000 * 15); - BV.isTrue(flag, "重复操作,请稍后重试"); - int expires = 60 * 30; - String s = redisUtil.STRINGS.setEx(key, expires, customerString); - BV.isTrue(StringUtils.isValid(s), "操作失败,请稍后重试"); - String code = createCode(key, expires, customerChangeDto.getDealerId()); - return new CustomerChangeQrCodeVO(code, key); - } finally { - redisUtil.unlock(key); - } + String customerString = JSON.toJSONString(customerChangeDto); + Pair lockPair = distributedLocker.tryLock(key, TimeUnit.SECONDS, 0, 1000 * 15); + RLock rLock = lockPair.getRight(); + boolean flag = rLock.isLocked(); + BV.isTrue(flag, "重复操作,请稍后重试"); + int expires = 60 * 30; + stringRedisTemplate.opsForValue().set(key, customerString, expires, TimeUnit.SECONDS); + String code = createCode(key, expires, customerChangeDto.getDealerId()); + distributedLocker.unlock(key); + return new CustomerChangeQrCodeVO(code, key); } /** @@ -154,33 +154,12 @@ public class CustomerChangeBizService extends AbstractCustomerService { /** - * 用户维护的基础信息查询 - * - * @param user - * @param key - * @return - */ - public CustomerChangeInfoVO getInfo(PassportAuthBean user, String key) { - String s = redisUtil.STRINGS.get(key); - BV.isTrue(StringUtils.isValid(s), "二维码已失效"); - CustomerChangeDto dto = JSON.parseObject(s, CustomerChangeDto.class); - final CustomerChangeInfoVO vo = new CustomerChangeInfoVO(); - BeanUtils.copyProperties(dto, vo); - MemberUserDTO userDto = memberRpcService.user(user.getUserId()); - if (userDto != null) { - vo.setMobile(userDto.getPhone()); - } - this.sendMsg(vo.getAdviserId(), false, key); - return vo; - } - - /** * C端 档案新增或者变更 * * @param dto */ @Transactional(rollbackFor = Exception.class) - @DisLock(prefix = "save-customer:", key = "#dto.memberId + ':' + #dto.frameNo", message = "系统繁忙,请5秒后再试") + @DisLock(prefix = "'save-customer:'", key = "#dto.memberId + ':' + #dto.frameNo", message = "系统繁忙,请5秒后再试") public Long saveCustomer(NewCustomerDTO dto) { Long memberId = dto.getMemberId(); // 客户类型 @@ -256,7 +235,7 @@ public class CustomerChangeBizService extends AbstractCustomerService { * @param dto */ @Transactional(rollbackFor = Exception.class) - @DisLock(prefix = "change-address-customer:", key = "#dto.id", message = "系统繁忙,请5秒后再试") + @DisLock(prefix = "'change-address-customer:'", key = "#dto.id", message = "系统繁忙,请5秒后再试") public void updateCustomerAddress(CustomerAddressChangeDTO dto) { Long id = dto.getId(); Customer customer = customerService.getById(id); @@ -275,93 +254,6 @@ public class CustomerChangeBizService extends AbstractCustomerService { customerBaseInfoService.updateById(baseInfo); } - /** - * 档案修改 - * - * @param saveDto - * @return - * @Deprecated 将在下版本移除此接口 2022-03-15 - */ - @Deprecated - @Transactional(rollbackFor = Exception.class) - public Long updateOrSave(PassportAuthBean user, CustomerChangeDto saveDto) { - final String key = saveDto.getKey(); - final Long adviserId = saveDto.getAdviserId(); - saveDto.setMemberId(user.getUserId()); - Long nid; - - CustomerBaseInfo baseInfo = new CustomerBaseInfo(); - BeanUtils.copyProperties(saveDto, baseInfo); - baseInfo.setId(null); - baseInfo.setGender(GenderEnum.ofValue(saveDto.getGender())); - baseInfo.setUpdateTime(new Date()); - - //客户主动修改信息 - if (StringUtils.isEmpty(key)) { - Customer customer = customerService.queryById(saveDto.getId()); - baseInfo.setId(customer.getBaseId()); - customerBaseInfoService.updateById(baseInfo); - return customer.getId(); - } - - //车牌号有档案 - if (Objects.nonNull(saveDto.getMotoId())) { - //vin有档案 - if (Objects.nonNull(saveDto.getId())) { - //档案和行驶证不一致 作废旧档案 更新档案 - boolean bool = saveDto.getId().equals(saveDto.getMotoId()); - if (!bool) { - stammkundePoolService.reject(saveDto.getId(), saveDto.getGroupId(), DefeatReasonEnum.CI); - publicCluePoolService.removeClue(saveDto.getId(), adviserId); - customerService.forbidden(saveDto.getMotoId()); - } - Customer customer = customerService.queryById(saveDto.getId()); - BV.notNull(customer, "档案信息异常"); - baseInfo.setId(customer.getBaseId()); - customerBaseInfoService.updateById(baseInfo); - if (Objects.isNull(customer.getAdviserId())) { - saveDto.setShopId(null); - saveDto.setAdviserId(null); - } - BeanUtils.copyProperties(saveDto, customer); - customer.setUseType(CarUseTypeEnum.ofValue(saveDto.getUseType())); - customer.setUpdateTime(new Date()); - customer.setYn(Boolean.TRUE); - nid = this.edit(customer); - } else { - stammkundePoolService.reject(saveDto.getId(), saveDto.getGroupId(), DefeatReasonEnum.CI); - publicCluePoolService.removeClue(saveDto.getId(), adviserId); - customerService.forbidden(saveDto.getMotoId()); - Customer customer = new Customer(); - BeanUtils.copyProperties(saveDto, customer); - customer.setUseType(CarUseTypeEnum.ofValue(saveDto.getUseType())); - customer.setSpecCode(saveDto.getModelCode()); - nid = create(customer, baseInfo); - } - } else { - //vin有档案 行驶证车主和vin档案车主一致的情况app直接替换车牌不会到这个流程 - if (Objects.nonNull(saveDto.getId())) { - stammkundePoolService.reject(saveDto.getId(), saveDto.getGroupId(), DefeatReasonEnum.CI); - publicCluePoolService.removeClue(saveDto.getId(), adviserId); - customerService.forbidden(saveDto.getId()); - saveDto.setId(null); - } - Customer customer = new Customer(); - BeanUtils.copyProperties(saveDto, customer); - customer.setUseType(CarUseTypeEnum.ofValue(saveDto.getUseType())); - customer.setSpecCode(saveDto.getModelCode()); - nid = create(customer, baseInfo); - if (Objects.nonNull(saveDto.getId())) { - changeTaskFollower(saveDto.getMotoId(), customer.getId(), customer.getGroupId()); - } - } - - if (StringUtils.isValid(key)) { - redisUtil.KEYS.del(key); - this.sendMsg(adviserId, true, key); - } - return nid; - } /** * 变更档案标签 @@ -555,26 +447,6 @@ public class CustomerChangeBizService extends AbstractCustomerService { } - /** - * 更换跟进人 - * - * @param task - * @return - */ - @Transactional(rollbackFor = Exception.class) - public PostUserDTO changeInsFollowUser(FollowTask task) throws BusinessException { - Customer customer = customerService.getById(task.getCustomerId()); - if (Objects.isNull(customer)) { - log.info("档案信息异常,custId: [{}]", task.getCustomerId()); - } - BV.notNull(customer, () -> "档案信息不存在"); - - List userList = userService.getUserByRole(task.getFollowShop(), RoleCode.XBGJ); - BV.isNotEmpty(userList, () -> String.format("更换跟进人员失败:更换跟进人员失败:门店[%s]没有续保跟进员", customer.getShopId())); - Collections.shuffle(userList); - return userList.stream().filter(u -> !u.getUserId().equals(task.getFollowUser())).findAny().orElse(null); - } - @Transactional(rollbackFor = Exception.class) public void rollBack(String vin, Long groupId) { Customer customer = customerService.queryByFrameNo(vin, groupId); @@ -582,24 +454,25 @@ public class CustomerChangeBizService extends AbstractCustomerService { boolean isTemporaryPlateNo = customer.getPlateNo().contains("临") || customer.getPlateNo().contains("商"); BV.isTrue(isTemporaryPlateNo, () -> "非临时牌照车辆,无法回滚"); Long customerId = customer.getId(); - List list = customerCluePoolService.list(Wrappers.lambdaQuery() - .eq(CustomerCluePool::getRefererId, customerId) - .eq(CustomerCluePool::getGroupId, groupId) + + List list = followClueService.list(Wrappers.lambdaQuery() + .eq(FollowClue::getVin, vin) + .eq(FollowClue::getGroupId, groupId) ); if (!CollectionUtils.isEmpty(list)) { List clueIds = new ArrayList<>(); - for (CustomerCluePool cluePool : list) { - boolean isWaiting = ClueStatusEnum.WAITING.equals(cluePool.getClueStatus()); + for (FollowClue cluePool : list) { + boolean isWaiting = ClueStatusEnum.WAITING.equals(cluePool.getClueState()); BV.isTrue(isWaiting, () -> "存在已开始的跟进任务,无法回滚档案"); clueIds.add(cluePool.getId()); } - followTaskService.remove(Wrappers.lambdaQuery() - .eq(FollowTask::getCustomerId, customerId) - .in(FollowTask::getClueId, clueIds) + clueTaskService.remove(Wrappers.lambdaQuery() + .eq(ClueTask::getGroupId, groupId) + .in(ClueTask::getClueId, clueIds) ); followRecordService.removeRecordByCustId(customerId, null); followNoticeRecordService.removeByClueIds(clueIds); - customerCluePoolService.removeByIds(clueIds); + followClueService.removeByIds(clueIds); } List stammkundePoolList = stammkundePoolService.list(Wrappers.lambdaQuery() .eq(StammkundePool::getCustomerId, customerId) @@ -665,39 +538,6 @@ public class CustomerChangeBizService extends AbstractCustomerService { } } - private void changeTaskFollower(Long motoId, Long curId, Long groupId) { - CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(motoId, groupId, FollowTypeEnum.FM); - if (Objects.nonNull(cluePool)) { - boolean equals = ClueStatusEnum.ONGOING.equals(cluePool.getClueStatus()) || ClueStatusEnum.WAITING.equals(cluePool.getClueStatus()); - if (equals) { - cluePool.setRefererId(curId); - customerCluePoolService.updateById(cluePool); - } - } - cluePool = customerCluePoolService.queryByRefererId(motoId, groupId, FollowTypeEnum.RM); - if (Objects.nonNull(cluePool)) { - boolean equals = ClueStatusEnum.ONGOING.equals(cluePool.getClueStatus()) || ClueStatusEnum.WAITING.equals(cluePool.getClueStatus()); - if (equals) { - cluePool.setRefererId(curId); - customerCluePoolService.updateById(cluePool); - } - } - cluePool = customerCluePoolService.queryByRefererId(motoId, groupId, FollowTypeEnum.IR); - if (Objects.nonNull(cluePool)) { - boolean equals = ClueStatusEnum.ONGOING.equals(cluePool.getClueStatus()) || ClueStatusEnum.WAITING.equals(cluePool.getClueStatus()); - if (equals) { - cluePool.setRefererId(curId); - customerCluePoolService.updateById(cluePool); - } - } - - List list = followTaskService.getListByCustomerId(motoId, null); - if (CollectionUtils.isEmpty(list)) { - return; - } - list.forEach(r -> r.setCustomerId(curId)); - followTaskService.updateBatchById(list); - } private void create(Customer customer, Long adviserId, Long shopId) { StammkundePool stammkundePool = createSimpleInfo(customer, adviserId); @@ -777,6 +617,7 @@ public class CustomerChangeBizService extends AbstractCustomerService { simpleInfo.setAktiv(Boolean.TRUE); simpleInfo.setActivationTime(new Date()); stammkundePoolService.save(simpleInfo); + commonService.createClue(customer); } final CustomerInfoDto customerInfoDto = new CustomerInfoDto(); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java index 04f7d65..4b5faec 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java @@ -3,9 +3,9 @@ package cn.fw.valhalla.service.bus.follow; import cn.fw.valhalla.common.utils.DateUtil; import cn.fw.valhalla.domain.db.customer.Customer; import cn.fw.valhalla.domain.db.customer.CustomerBaseInfo; +import cn.fw.valhalla.domain.db.follow.ClueTask; +import cn.fw.valhalla.domain.db.follow.FollowClue; import cn.fw.valhalla.domain.db.follow.FollowNoticeRecord; -import cn.fw.valhalla.domain.db.follow.FollowTask; -import cn.fw.valhalla.domain.db.pool.CustomerCluePool; import cn.fw.valhalla.domain.enums.*; import cn.fw.valhalla.domain.vo.setting.SettingVO; import cn.fw.valhalla.rpc.ehr.EhrRpcService; @@ -49,10 +49,10 @@ public class NoticeBizService { private final CustomerService customerService; private final CustomerBaseInfoService customerBaseInfoService; private final OopService oopService; - private final CustomerCluePoolService customerCluePoolService; private final SmsRpcService smsRpcService; - private final FollowTaskService followTaskService; + private final ClueTaskService clueTaskService; private final EhrRpcService ehrRpcService; + private final FollowClueService followClueService; private final String type = "d"; private final int day = 2; @@ -93,16 +93,16 @@ public class NoticeBizService { * @param record */ private void sendNoticeAndCreate(FollowNoticeRecord record) { - CustomerCluePool cluePool = customerCluePoolService.getById(record.getClueId()); + FollowClue cluePool = followClueService.getById(record.getClueId()); if (Objects.isNull(cluePool)) { followNoticeRecordService.removeById(record.getId()); return; } - if (ClueStatusEnum.FAILURE.equals(cluePool.getClueStatus()) || ClueStatusEnum.COMPLETE.equals(cluePool.getClueStatus()) || cluePool.getDeadline().before(new Date())) { + if (ClueStatusEnum.FAILURE.equals(cluePool.getClueState()) || ClueStatusEnum.COMPLETE.equals(cluePool.getClueState()) || cluePool.getEndTime().isBefore(LocalDateTime.now())) { followNoticeRecordService.removeById(record.getId()); return; } - Customer customer = customerService.queryById(cluePool.getRefererId()); + Customer customer = customerService.queryByFrameNo(cluePool.getVin(), cluePool.getGroupId()); if (Objects.isNull(customer)) { createNextNotice(record, cluePool.getGroupId()); return; @@ -114,7 +114,7 @@ public class NoticeBizService { } ShopDTO shop = oopService.shop(customer.getShopId()); if (Objects.isNull(shop)) { - shop = oopService.shop(cluePool.getOriginalShopId()); + shop = oopService.shop(cluePool.getSuggestShopId()); } String shopName = Objects.isNull(shop) ? "" : shop.getShortName(); boolean flag = false; @@ -132,12 +132,12 @@ public class NoticeBizService { } } - private boolean sendIR(final FollowNoticeRecord record, final CustomerCluePool cluePool, CustomerBaseInfo baseInfo, String shopName) { + private boolean sendIR(final FollowNoticeRecord record, final FollowClue cluePool, CustomerBaseInfo baseInfo, String shopName) { if (DateUtil.sub(new Date(), record.getSendTime(), type) > day) { record.setStatus(SendStatusEnum.SUCCESS); return followNoticeRecordService.updateById(record); } - Customer customer = Optional.ofNullable(customerService.getById(cluePool.getRefererId())).orElse(new Customer()); + Customer customer = Optional.ofNullable(customerService.queryByFrameNo(cluePool.getVin(), cluePool.getGroupId())).orElse(new Customer()); //页面附带参数 HashMap paramMap = new HashMap<>(1); paramMap.put("bizType", "2"); @@ -159,8 +159,8 @@ public class NoticeBizService { record.setStatus(Objects.nonNull(templateResult) ? SendStatusEnum.SUCCESS : SendStatusEnum.FAILED); record.setStatusDesc(templateResult.getSceneToken().toString()); if (SendStatusEnum.FAILED.equals(record.getStatus())) { - Long staffId = cluePool.getOriginalUserId(); - FollowTask task = followTaskService.queryOngoingTaskByClueId(cluePool.getId()); + Long staffId = customer.getAdviserId(); + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); if (Objects.nonNull(task)) { staffId = task.getFollowUser(); } @@ -171,13 +171,13 @@ public class NoticeBizService { map.put("shopName", shopName); map.put("userName", infoDTO.getName()); map.put("phone", infoDTO.getMobile()); - smsRpcService.sendSms(getIrTemplateCode(), baseInfo.getMobile(), map, cluePool.getOriginalShopId()); + smsRpcService.sendSms(getIrTemplateCode(), baseInfo.getMobile(), map, cluePool.getSuggestShopId()); } } return followNoticeRecordService.updateById(record); } - private boolean sendFM(final FollowNoticeRecord record, final CustomerCluePool cluePool, CustomerBaseInfo baseInfo, String shopName) { + private boolean sendFM(final FollowNoticeRecord record, final FollowClue cluePool, CustomerBaseInfo baseInfo, String shopName) { if (DateUtil.sub(new Date(), record.getSendTime(), type) > day) { record.setStatus(SendStatusEnum.SUCCESS); return followNoticeRecordService.updateById(record); @@ -185,7 +185,7 @@ public class NoticeBizService { //额外展示数据 HashMap extraMap = new HashMap<>(2); extraMap.put("车牌号", cluePool.getPlateNo()); - extraMap.put("到期时间", DateUtil.getStringDateShort(cluePool.getDeadline())); + extraMap.put("到期时间", DateUtil.getStringDateShort(DateUtil.localDateTime2Date(cluePool.getEndTime()))); //生成发送实体 TemplateDTO templateDTO = TemplateDTO.builder() .content("您好!您的爱车的首次保养即将到期,请尽快进店进行保养!") @@ -199,8 +199,8 @@ public class NoticeBizService { record.setStatus(Objects.nonNull(templateResult) ? SendStatusEnum.SUCCESS : SendStatusEnum.FAILED); record.setStatusDesc(templateResult.getSceneToken().toString()); if (SendStatusEnum.FAILED.equals(record.getStatus())) { - Long staffId = cluePool.getOriginalUserId(); - FollowTask task = followTaskService.queryOngoingTaskByClueId(cluePool.getId()); + Long staffId = null; + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); if (Objects.nonNull(task)) { staffId = task.getFollowUser(); } @@ -210,13 +210,13 @@ public class NoticeBizService { map.put("shopName", shopName); map.put("userName", infoDTO.getName()); map.put("phone", infoDTO.getMobile()); - smsRpcService.sendSms(getFmTemplateCode(), baseInfo.getMobile(), map, cluePool.getOriginalShopId()); + smsRpcService.sendSms(getFmTemplateCode(), baseInfo.getMobile(), map, cluePool.getSuggestShopId()); } } return followNoticeRecordService.updateById(record); } - private boolean sendRM(final FollowNoticeRecord record, final CustomerCluePool cluePool, CustomerBaseInfo baseInfo, String shopName) { + private boolean sendRM(final FollowNoticeRecord record, final FollowClue cluePool, CustomerBaseInfo baseInfo, String shopName) { if (DateUtil.sub(new Date(), record.getSendTime(), type) > day) { record.setStatus(SendStatusEnum.SUCCESS); return followNoticeRecordService.updateById(record); @@ -224,7 +224,7 @@ public class NoticeBizService { //额外展示数据 HashMap extraMap = new HashMap<>(2); extraMap.put("车牌号", cluePool.getPlateNo()); - extraMap.put("推荐保养时间", DateUtil.getStringDateShort(cluePool.getDeadline()) + " 前"); + extraMap.put("推荐保养时间", DateUtil.getStringDateShort(DateUtil.localDateTime2Date(cluePool.getEndTime())) + " 前"); //生成发送实体 TemplateDTO templateDTO = TemplateDTO.builder() .content("您好!即将到达您的爱车下次保养日期,请尽快进店进行保养!") @@ -238,20 +238,20 @@ public class NoticeBizService { record.setStatus(Objects.nonNull(templateResult) ? SendStatusEnum.SUCCESS : SendStatusEnum.FAILED); record.setStatusDesc(templateResult.getSceneToken().toString()); if (SendStatusEnum.FAILED.equals(record.getStatus())) { - Long staffId = cluePool.getOriginalUserId(); - FollowTask task = followTaskService.queryOngoingTaskByClueId(cluePool.getId()); + Long staffId = null; + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); if (Objects.nonNull(task)) { staffId = task.getFollowUser(); } StaffInfoDTO infoDTO = ehrRpcService.queryStaffInfo(staffId); if (Objects.nonNull(infoDTO)) { - Integer m = DateUtil.sub(cluePool.getAddTime(), new Date(), "m"); + Integer m = DateUtil.sub(DateUtil.localDateTime2Date(cluePool.getOriginTime()), new Date(), "m"); Map map = new HashMap<>(4); map.put("num", Math.abs(m)); map.put("shopName", shopName); map.put("userName", infoDTO.getName()); map.put("phone", infoDTO.getMobile()); - smsRpcService.sendSms(getRmTemplateCode(), baseInfo.getMobile(), map, cluePool.getOriginalShopId()); + smsRpcService.sendSms(getRmTemplateCode(), baseInfo.getMobile(), map, cluePool.getSuggestShopId()); } } return followNoticeRecordService.updateById(record); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java index 53df77c..1e1b8cd 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java @@ -162,9 +162,9 @@ public class PoolBizService { } page.setTotal(total); final HashSet scope = new HashSet<>(queryVO.getScope()); - List list = followClueService.clueList(queryVO); + List list = followClueService.clueList(queryVO); List appList = new ArrayList<>(); - for (CustomerCluePoolDTO dto : list) { + for (FollowClueDTO dto : list) { CustomerCluePoolVO vo = trans2CluePool(dto, scope); appList.add(vo); } @@ -299,7 +299,7 @@ public class PoolBizService { return vo; } - private CustomerCluePoolVO trans2CluePool(CustomerCluePoolDTO poolDTO, Set scope) { + private CustomerCluePoolVO trans2CluePool(FollowClueDTO poolDTO, Set scope) { CustomerCluePoolVO vo = new CustomerCluePoolVO(); BeanUtils.copyProperties(poolDTO, vo); vo.setStatus(poolDTO.getClueStatus()); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerCluePoolService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerCluePoolService.java deleted file mode 100644 index a0bd641..0000000 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerCluePoolService.java +++ /dev/null @@ -1,88 +0,0 @@ -package cn.fw.valhalla.service.data; - -import cn.fw.valhalla.domain.db.pool.CustomerCluePool; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; -import com.baomidou.mybatisplus.extension.service.IService; -import org.apache.ibatis.annotations.Param; -import org.springframework.lang.Nullable; - -import java.util.List; - -/** - * @author : kurisu - * @className : CustomerCluePoolService - * @description : 客户线索池 - * @date: 2020-11-12 09:35 - */ -public interface CustomerCluePoolService extends IService { - /** - * 通过refererId查询线索 - * - * @param refererId - * @param groupId - * @param type - * @return - */ - @Nullable - CustomerCluePool queryByRefererId(Long refererId, Long groupId, FollowTypeEnum type); - - /** - * 通过vin查询线索 - * - * @param vin - * @param groupId - * @param type - * @return - */ - @Nullable - CustomerCluePool queryByVin(String vin, Long groupId, FollowTypeEnum type); - - /** - * 通过车牌号查询线索 - * - * @param plateNo - * @param groupId - * @param type - * @return - */ - @Nullable - CustomerCluePool queryByPlateNo(String plateNo, Long groupId, FollowTypeEnum type); - - /** - * 查询客户线索池 - * - * @param queryVO - * @return - */ - List clueList(CustomerCluePoolQueryVO queryVO); - - /** - * 总数 - * @param queryVO - * @return - */ - Long clueListCount(CustomerCluePoolQueryVO queryVO); - - /** - * 成交数 - * @param queryVO - * @return - */ - Long completeNum(CustomerCluePoolQueryVO queryVO); - - /** - * 战败数 - * @param queryVO - * @return - */ - Long defeatNum(CustomerCluePoolQueryVO queryVO); - - /** - * 进行中的数量 - * @param queryVO - * @return - */ - Long onGoingNum(CustomerCluePoolQueryVO queryVO); -} diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowClueService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowClueService.java index 3d68730..fdcf647 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowClueService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowClueService.java @@ -1,7 +1,7 @@ package cn.fw.valhalla.service.data; import cn.fw.valhalla.domain.db.follow.FollowClue; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; +import cn.fw.valhalla.domain.dto.FollowClueDTO; import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; import com.baomidou.mybatisplus.extension.service.IService; @@ -23,7 +23,7 @@ public interface FollowClueService extends IService { * @param queryVO * @return */ - List clueList(CustomerCluePoolQueryVO queryVO); + List clueList(CustomerCluePoolQueryVO queryVO); /** * 总数 diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowTaskService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowTaskService.java deleted file mode 100644 index bfb7de9..0000000 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/FollowTaskService.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.fw.valhalla.service.data; - -import cn.fw.valhalla.domain.db.follow.FollowTask; -import cn.fw.valhalla.domain.dto.FollowPoolDTO; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import cn.fw.valhalla.domain.query.FollowPoolQueryVO; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - * @author : kurisu - * @className : FollowTaskService - * @description : 跟进任务 - * @date: 2020-08-12 11:04 - */ -public interface FollowTaskService extends IService { - /** - * 根据档案id查询 - * - * @param customerId - * @param list - * @return - */ - List getWaitListByCustomerId(Long customerId, List list); - - /** - * 跟进池查询 - * - * @param queryVO - * @return - */ - List followList(FollowPoolQueryVO queryVO); - - /** - * 跟进池查询总数 - * - * @param queryVO - * @return - */ - long followListCount(FollowPoolQueryVO queryVO); - - /** - * 查询客户所有的跟进信息 - * - * @param customerId - * @param list - * @return - */ - List getListByCustomerId(Long customerId, List list); - - /** - * 根据线索id查询正在进行中的任务 - * - * @param clueId - * @return - */ - FollowTask queryOngoingTaskByClueId(Long clueId); - - /** - * 查询是否有正在进行中的跟进任务 - * - * @param customerId - * @param followType - * @return - */ - boolean hasOngoingTask(Long customerId, Integer followType); -} diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerCluePoolServiceImpl.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerCluePoolServiceImpl.java deleted file mode 100644 index ef361bb..0000000 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerCluePoolServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -package cn.fw.valhalla.service.data.impl; - -import cn.fw.valhalla.dao.mapper.CustomerCluePoolMapper; -import cn.fw.valhalla.domain.db.pool.CustomerCluePool; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; -import cn.fw.valhalla.service.data.CustomerCluePoolService; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.lang.Nullable; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -/** - * @author : kurisu - * @className : CustomerCluePoolServiceImpl - * @description : 线索池 - * @date: 2020-11-12 09:36 - */ -@Service -public class CustomerCluePoolServiceImpl extends ServiceImpl implements CustomerCluePoolService { - @Override - @Nullable - public CustomerCluePool queryByRefererId(Long refererId, Long groupId, FollowTypeEnum type) { - return getOne(Wrappers.lambdaQuery() - .eq(CustomerCluePool::getRefererId, refererId) - .eq(CustomerCluePool::getGroupId, groupId) - .eq(CustomerCluePool::getClueType, type) - .orderByDesc(CustomerCluePool::getId) - .last(" limit 1") - ); - } - - @Override - @Nullable - public CustomerCluePool queryByVin(String vin, Long groupId, FollowTypeEnum type) { - return getOne(Wrappers.lambdaQuery() - .eq(CustomerCluePool::getFrameNo, vin) - .eq(CustomerCluePool::getGroupId, groupId) - .eq(CustomerCluePool::getClueType, type) - .orderByDesc(CustomerCluePool::getId) - .last(" limit 1") - ); - } - - @Override - @Nullable - public CustomerCluePool queryByPlateNo(String plateNo, Long groupId, FollowTypeEnum type) { - return getOne(Wrappers.lambdaQuery() - .eq(CustomerCluePool::getPlateNo, plateNo) - .eq(CustomerCluePool::getGroupId, groupId) - .eq(CustomerCluePool::getClueType, type) - .orderByDesc(CustomerCluePool::getId) - .last(" limit 1") - ); - } - - @Override - public List clueList(CustomerCluePoolQueryVO queryVO) { - Integer current = queryVO.getCurrent(); - Integer pageSize = queryVO.getPageSize(); - Integer startIndex = (current - 1) * pageSize; - return Optional.ofNullable(getBaseMapper().clueList(startIndex, pageSize, queryVO)).orElse(new ArrayList<>()); - } - - @Override - public Long clueListCount(CustomerCluePoolQueryVO queryVO) { - return Optional.ofNullable(getBaseMapper().clueListCount(queryVO)).orElse(0L); - } - - @Override - public Long completeNum(CustomerCluePoolQueryVO queryVO) { - return Optional.ofNullable(getBaseMapper().completeNum(queryVO)).orElse(0L); - } - - @Override - public Long defeatNum(CustomerCluePoolQueryVO queryVO) { - return Optional.ofNullable(getBaseMapper().defeatNum(queryVO)).orElse(0L); - } - - @Override - public Long onGoingNum(CustomerCluePoolQueryVO queryVO) { - return Optional.ofNullable(getBaseMapper().onGoingNum(queryVO)).orElse(0L); - } -} diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowClueServiceImpl.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowClueServiceImpl.java index 28393ac..2e8c76c 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowClueServiceImpl.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowClueServiceImpl.java @@ -2,7 +2,7 @@ package cn.fw.valhalla.service.data.impl; import cn.fw.valhalla.dao.mapper.FollowClueMapper; import cn.fw.valhalla.domain.db.follow.FollowClue; -import cn.fw.valhalla.domain.dto.CustomerCluePoolDTO; +import cn.fw.valhalla.domain.dto.FollowClueDTO; import cn.fw.valhalla.domain.query.CustomerCluePoolQueryVO; import cn.fw.valhalla.service.data.FollowClueService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -24,7 +24,7 @@ import java.util.Optional; @Service public class FollowClueServiceImpl extends ServiceImpl implements FollowClueService { @Override - public List clueList(CustomerCluePoolQueryVO queryVO) { + public List clueList(CustomerCluePoolQueryVO queryVO) { Integer current = queryVO.getCurrent(); Integer pageSize = queryVO.getPageSize(); Integer startIndex = (current - 1) * pageSize; diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowTaskServiceImpl.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowTaskServiceImpl.java deleted file mode 100644 index 960a612..0000000 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/FollowTaskServiceImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -package cn.fw.valhalla.service.data.impl; - -import cn.fw.valhalla.dao.mapper.FollowTaskMapper; -import cn.fw.valhalla.domain.db.follow.FollowTask; -import cn.fw.valhalla.domain.dto.FollowPoolDTO; -import cn.fw.valhalla.domain.enums.FollowTypeEnum; -import cn.fw.valhalla.domain.enums.TaskStateEnum; -import cn.fw.valhalla.domain.query.FollowPoolQueryVO; -import cn.fw.valhalla.service.data.FollowTaskService; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -/** - * @author : kurisu - * @className : FollowTaskServiceImpl - * @description : 跟进任务 - * @date: 2020-08-12 11:05 - */ -@Service -@Slf4j -public class FollowTaskServiceImpl extends ServiceImpl implements FollowTaskService { - @Override - public List getWaitListByCustomerId(Long customerId, List list) { - return Optional.ofNullable(list(Wrappers.lambdaQuery() - .eq(FollowTask::getCustomerId, customerId) - .eq(FollowTask::getState, TaskStateEnum.ONGOING) - .in(!CollectionUtils.isEmpty(list), FollowTask::getType, list) - )).orElse(new ArrayList<>()); - } - - @Override - public List followList(FollowPoolQueryVO queryVO) { - Integer current = queryVO.getCurrent(); - Integer pageSize = queryVO.getPageSize(); - Integer startIndex = (current - 1) * pageSize; - return Optional.ofNullable(getBaseMapper().followList(startIndex, pageSize, queryVO)).orElse(new ArrayList<>()); - } - - @Override - public long followListCount(FollowPoolQueryVO queryVO) { - return Optional.ofNullable(getBaseMapper().followListCount(queryVO)).orElse(0L); - } - - @Override - public List getListByCustomerId(Long customerId, List list) { - return Optional.ofNullable(list(Wrappers.lambdaQuery() - .eq(FollowTask::getCustomerId, customerId) - .eq(FollowTask::getState, TaskStateEnum.ONGOING) - .in(!CollectionUtils.isEmpty(list), FollowTask::getType, list) - )).orElse(new ArrayList<>()); - } - - @Override - public FollowTask queryOngoingTaskByClueId(Long clueId) { - return getOne(Wrappers.lambdaQuery() - .eq(FollowTask::getClueId, clueId) - .eq(FollowTask::getState, TaskStateEnum.ONGOING) - .last(" limit 1") - ); - } - - @Override - public boolean hasOngoingTask(Long customerId, Integer followType) { - return count(Wrappers.lambdaQuery() - .eq(FollowTask::getCustomerId, customerId) - .eq(FollowTask::getState, TaskStateEnum.ONGOING) - .eq(FollowTask::getType, followType) - ) > 0; - } -} -- libgit2 0.22.2