diff --git a/doc/v1.1.3/sql.sql b/doc/v1.1.3/sql.sql index 1a47b3c..73a270c 100644 --- a/doc/v1.1.3/sql.sql +++ b/doc/v1.1.3/sql.sql @@ -34,4 +34,28 @@ create index secret_report_history_customer_id_index on secret_report_history (customer_id); create index secret_report_history_staff_id_index - on secret_report_history (staff_id); \ No newline at end of file + on secret_report_history (staff_id); + + + + +-- 报表字段调整 +alter table cas_015_d + add i10 int null comment '智能电话跟进有效数'; +alter table cas_015_d + add i11 int null comment '智能电话跟进数'; +alter table cas_015_d + add i12 int null comment '首次智能电话跟进有效数'; +alter table cas_015_d + add i13 int null comment '首次智能电话跟进数'; + + + +alter table cas_015_m + add i10 int null comment '智能电话跟进有效数'; +alter table cas_015_m + add i11 int null comment '智能电话跟进数'; +alter table cas_015_m + add i12 int null comment '首次智能电话跟进有效数'; +alter table cas_015_m + add i13 int null comment '首次智能电话跟进数'; \ No newline at end of file diff --git a/fw-valhalla-dao/src/main/resources/mapper/SecretReportHistoryMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/SecretReportHistoryMapper.xml index a2996ed..1243c02 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/SecretReportHistoryMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/SecretReportHistoryMapper.xml @@ -38,9 +38,11 @@ and t1.staff_name like concat('%', #{condition.userName}, '%') - and t2.plate_no like concat('%', #{condition.plateNo}, '%') + and (t2.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', #{condition.plateNo}, '%')) + + + and (t3.name like concat('%', #{condition.customerName}, '%') or t4.name like concat('%', #{condition.customerName}, '%')) - and t1.shop_id in @@ -85,9 +87,11 @@ and t1.staff_name like concat('%', #{condition.userName}, '%') - and t2.plate_no like concat('%', #{condition.plateNo}, '%') + and (t2.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', #{condition.plateNo}, '%')) + + + and (t3.name like concat('%', #{condition.customerName}, '%') or t4.name like concat('%', #{condition.customerName}, '%')) - and t1.shop_id in diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/SecretReportHistoryQuery.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/SecretReportHistoryQuery.java index d6d4512..f12ed80 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/SecretReportHistoryQuery.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/SecretReportHistoryQuery.java @@ -38,6 +38,10 @@ public class SecretReportHistoryQuery extends PoolQuery { * 通话时间段(区间) */ private String callTime; + /** + * 客户名称 + */ + private String customerName; public Date getStartTime1() { diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/PostUserVO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/PostUserVO.java index 51e1bcd..569b7a5 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/PostUserVO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/PostUserVO.java @@ -23,4 +23,8 @@ public class PostUserVO implements Serializable { * 用户姓名 */ private String userName; + /** + * 当前保有客数 + */ + private Integer curQuantity; } diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/SecretReportHistoryVO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/SecretReportHistoryVO.java index f96420c..ffae859 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/SecretReportHistoryVO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/SecretReportHistoryVO.java @@ -72,6 +72,10 @@ public class SecretReportHistoryVO { */ private Long shopId; /** + * 门店名称 + */ + private String shopName; + /** * 集团id */ private Long groupId; diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java index f5fda71..ff55ee6 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java @@ -56,15 +56,14 @@ public class CommonController { @GetMapping("/staff/list") @IgnoreAuth - public Message> list(@NotNull(message = "服务站ID不能为空") final Long shopId, - @NotNull(message = "跟进类型不能为空") final Integer type) { - final String msg = "查询跟进人员[app/common/staff/list]"; + public Message> list(@NotNull(message = "服务站ID不能为空") final Long shopId) { + final String msg = "查询人员[app/common/staff/list]"; try { - log.info("{}: param[shopId: {} type: {}]", msg, shopId, type); - List list = commonService.getUsers(shopId, type); + log.info("{}: param[shopId: {}]", msg, shopId); + List list = commonService.getUsers(shopId); return success(list, data -> log.info("{}", data)); } catch (Exception ex) { - handleException(ex, e -> log.error("{}失败:param[shopId: {} type: {}]", msg, shopId, type, e)); + handleException(ex, e -> log.error("{}失败:param[shopId: {}]", msg, shopId, e)); return failureWithMessage(SAVE_FAILURE); } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java index c81aae5..88c6414 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java @@ -5,24 +5,28 @@ import cn.fw.valhalla.common.constant.RoleCode; import cn.fw.valhalla.domain.db.customer.AccidentPool; import cn.fw.valhalla.domain.db.customer.Customer; import cn.fw.valhalla.domain.db.customer.CustomerBaseInfo; +import cn.fw.valhalla.domain.db.pool.StammkundePool; import cn.fw.valhalla.domain.enums.FollowTypeEnum; +import cn.fw.valhalla.domain.enums.StammkundeStatusEnum; import cn.fw.valhalla.domain.vo.PostUserVO; 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.order.OrderRpcService; import cn.fw.valhalla.rpc.pstn.PstnService; import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService; import cn.fw.valhalla.service.data.AccidentPoolService; import cn.fw.valhalla.service.data.CustomerBaseInfoService; import cn.fw.valhalla.service.data.CustomerService; +import cn.fw.valhalla.service.data.StammkundePoolService; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; 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.stream.Collectors; import static cn.fw.common.businessvalidator.Validator.BV; @@ -39,18 +43,33 @@ public class CommonService { private final UserService userService; private final CustomerService customerService; private final CustomerBaseInfoService customerBaseInfoService; - private final OrderRpcService orderRpcService; + private final StammkundePoolService stammkundePoolService; private final PstnService pstnService; private final EhrRpcService ehrRpcService; private final AccidentPoolService accidentPoolService; private final CustomerChangeBizService customerChangeBizService; - public List getUsers(final Long shopId, final Integer type) { - FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type); - BV.notNull(typeEnum, () -> "跟进类型错误"); - List userByRole = userService.getUserByRole(shopId, getRoleCode(typeEnum)); - return userByRole.stream().map(user -> new PostUserVO(user.getUserId(), user.getUserName())).collect(Collectors.toList()); + public List getUsers(final Long shopId) { + List list = new ArrayList<>(); + List userByRole = userService.getUserByRole(shopId, RoleCode.FWGW); + if (CollectionUtils.isEmpty(userByRole)) { + return list; + } + + for (PostUserDTO userDTO : userByRole) { + PostUserVO vo = new PostUserVO(userDTO.getUserId(), userDTO.getUserName(), 0); + int count = stammkundePoolService.count(Wrappers.lambdaQuery() + .eq(StammkundePool::getAdviserId, userDTO.getUserId()) + .eq(StammkundePool::getShopId, shopId) + .eq(StammkundePool::getPoolStatus, StammkundeStatusEnum.KUNDE) + .eq(StammkundePool::getAktiv, Boolean.TRUE) + .isNull(StammkundePool::getRejectTime) + ); + vo.setCurQuantity(count); + list.add(vo); + } + return list; } public void rollBack(String vin, Long groupId) { 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 aa34e76..69062c1 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 @@ -213,6 +213,7 @@ public class PoolBizService { for (SecretReportHistoryDTO dto : list) { SecretReportHistoryVO vo = new SecretReportHistoryVO(); BeanUtils.copyProperties(dto, vo); + vo.setShopName(Optional.ofNullable(oopService.shop(dto.getShopId())).map(ShopDTO::getShortName).orElse(null)); vo.setCallType(CallTypeEnum.ofValue(dto.getDialType())); appList.add(vo); }