CustomerService.java 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. package com.goafanti.customer.service;
  2. import com.goafanti.common.bo.Result;
  3. import com.goafanti.common.bo.userDaysBo;
  4. import com.goafanti.common.error.BusinessException;
  5. import com.goafanti.common.model.Admin;
  6. import com.goafanti.common.model.AdminUserCount;
  7. import com.goafanti.common.model.OrganizationContactBook;
  8. import com.goafanti.common.model.User;
  9. import com.goafanti.core.mybatis.page.Pagination;
  10. import com.goafanti.customer.bo.*;
  11. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  12. import org.springframework.web.multipart.MultipartFile;
  13. import java.text.ParseException;
  14. import java.util.Date;
  15. import java.util.List;
  16. import java.util.Set;
  17. public interface CustomerService {
  18. /**
  19. * 私有个人客户列表查询
  20. * @param pageSize
  21. * @return
  22. */
  23. Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  24. /**
  25. * 公共个人客户列表查询
  26. * @param pageSize
  27. * @return
  28. */
  29. Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  30. /**
  31. * 所有个人客户列表查询
  32. * @param pageSize
  33. * @return
  34. */
  35. Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  36. /**
  37. * 管理个人客户查询(所属人同部门客户管理)
  38. * @param pageSize
  39. * @return
  40. */
  41. Pagination<CustomerListOut> listAllManagePersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  42. /**
  43. * 私有单位客户列表查询
  44. * @return
  45. */
  46. Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli,Integer sort,Integer sortType,Integer power, Integer pageNo, Integer pageSize);
  47. /**
  48. * 公共单位客户列表查询
  49. * @param pageSize
  50. * @return
  51. */
  52. Pagination<CustomerListOut> listPublicOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  53. /**
  54. * 所有单位客户列表查询
  55. * @param pageSize
  56. * @return
  57. */
  58. Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  59. /**
  60. * 管理单位客户列表查询
  61. * @param pageSize
  62. * @return
  63. */
  64. Pagination<CustomerListOut> listAllManageOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  65. /**
  66. * 使用客户名检索客户
  67. * @param name 客户名称
  68. * @return
  69. */
  70. List<CustomerSimpleBo> findCustomerByName(String name);
  71. /**
  72. * 使用客户名检索私有客户
  73. * @param name
  74. * @return
  75. */
  76. List<CustomerSimpleBo> getPrivateCustomerByName(String name);
  77. /**
  78. * 使用客户名称检索已签单客户
  79. * @param name
  80. * @return
  81. */
  82. List<CustomerSimpleBo> getSignedCustomerByName(String name);
  83. /**
  84. * 客户全查询
  85. * @param name
  86. * @return
  87. */
  88. Object getUserByName(String name);
  89. /**
  90. * 判断是否存在某个单位客户
  91. * @param name
  92. * @return
  93. */
  94. int judgeCustomerByName(String name);
  95. /**
  96. *
  97. * @return
  98. */
  99. int addCustomer(InputAddCustomer in) throws BusinessException;
  100. /**
  101. * 查询单位客户详情
  102. * @param uid 用户ID
  103. * @return
  104. */
  105. CustomerPersonalDetailBo findPersonalCustomerDetail(String uid);
  106. /**
  107. * 查询单位客户详情
  108. * @param uid 用户ID
  109. * @return
  110. */
  111. CustomerOrganizationDetailBo findOrganizationCustomerDetail(String uid);
  112. /**
  113. * 修改单位客户信息
  114. * @param bo
  115. * @return
  116. */
  117. int updateOrganizationCustomer(CustomerOrganizationDetailBo bo);
  118. /**
  119. * 修改个人客户信息
  120. * @param bo
  121. * @return
  122. */
  123. int updatePersonalCustomer(CustomerPersonalDetailBo bo);
  124. /**
  125. * 查看客户账户信息
  126. * @param uid 客户ID
  127. * @return
  128. */
  129. User findUserAccountDetail(String uid);
  130. /**
  131. * 更新用户基本信息
  132. * @param user
  133. */
  134. int updateUserAccount(User user);
  135. /**
  136. * 客户联系人列表
  137. * @param uid
  138. * @return
  139. */
  140. List<OrganizationContactBook> findCustomerContacts(String uid);
  141. /**
  142. * 添加拜访记录
  143. * @param fbb
  144. * @param mainStatus 0辅助跟进 1主要跟进
  145. */
  146. int addFollow(FollowBusinessBo fbb,String ufid,Integer mainStatus,Integer type,String pid) throws BusinessException;
  147. /**
  148. * 查询拜访记录详情
  149. * @param followId
  150. * @return
  151. */
  152. FollowBusinessBo findFollowById(String followId);
  153. /**
  154. * 查询单词拜访推进的客户意向
  155. * @param followId
  156. * @return
  157. */
  158. List<BusinessListBo> findBusinessByFollowId(String followId);
  159. /**
  160. * 修改拜访记录
  161. * @param fbb
  162. */
  163. int updateFollow(FollowBusinessBo fbb) throws BusinessException;
  164. /**
  165. * 查询客户的所有联系人
  166. * @param uid
  167. * @return
  168. */
  169. Set<OrganizationContactBook> findAllContacts(String uid);
  170. /**
  171. * 更新客户联系人
  172. * @param ocbList
  173. * @return
  174. */
  175. int updateCustomerContacts(List<OrganizationContactBook> ocbList,String uid);
  176. /**
  177. * 删除拜访记录
  178. * @param followId
  179. * @return
  180. */
  181. int deleteFollow(String followId);
  182. /**
  183. * 检查客户业务
  184. * @param boSet
  185. * @param existRows
  186. */
  187. void checkCustomer(Set<CustomerExcelBo> boSet,Set<Integer> existRows, Set<Integer> filterRows);
  188. /**
  189. * 保存上传数据
  190. * @param boSet
  191. */
  192. int saveUploadData(Set<CustomerExcelBo> boSet);
  193. /**
  194. * 通过操作类型更新客户
  195. * @param uid
  196. * @param operatorType
  197. * @return
  198. */
  199. List<String> updateByOperatorType(String uid,String aid,String oldAid,Integer operatorType,Integer data);
  200. /**
  201. * 客户统计
  202. * @param sDate
  203. * @param eDate
  204. * @return
  205. */
  206. Pagination<StatisticBo> customerStatistics(Date sDate, Date eDate, String depNo, String businessGlossoryId, Integer pageNo, Integer pageSize);
  207. /**
  208. * 业务进度统计
  209. * @param sDate
  210. * @param eDate
  211. * @return
  212. */
  213. Pagination<StatisticBo> businessStatistic(Date sDate, Date eDate, String depNo, String businessGlossoryId,Integer pageNo, Integer pageSize);
  214. /**
  215. * 拜访统计
  216. * @param sDate
  217. * @param eDate
  218. * @return
  219. */
  220. Pagination<StatisticBo> followStatistic(Date sDate, Date eDate, String depNo, Integer pageNo, Integer pageSize);
  221. /**
  222. * 查询我的业务列表
  223. * @param blo
  224. * @return
  225. */
  226. Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize);
  227. /**
  228. * 查询所有的业务列表
  229. * @return
  230. */
  231. Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize);
  232. /**
  233. * 业务管理列表
  234. * @param blo
  235. * @return
  236. */
  237. Pagination<BusinessListBo> listManageBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize);
  238. /**
  239. * 意向字典
  240. * @return
  241. */
  242. List<BusinessListBo> findBusinessGlossory();
  243. /**
  244. *
  245. * @param uid 客户ID
  246. * @param businessProjectId 业务项目的ID
  247. * @return
  248. */
  249. int judgeBusiness(String uid,String businessProjectId);
  250. /**
  251. * 添加意向服务和跟进记录
  252. * @param bfb
  253. */
  254. void addBusinessAndFollow(BussinessFollowBo bfb) throws ParseException ;
  255. /**
  256. * 查询业务列表
  257. * @param uid 客户ID
  258. * @param aid 营销员ID
  259. * @return
  260. */
  261. List<BusinessListBo> findBusinessByUAid(String uid,String aid);
  262. /**
  263. * 查询锁定的业务列表
  264. * @param uid
  265. * @param aid
  266. * @return
  267. */
  268. List<BusinessListBo> findLockedBusinessByUAid(String uid,String aid);
  269. /**
  270. * 查看业务意向详情
  271. * @param businessId
  272. * @return
  273. */
  274. BussinessFollowBo findBusinessDetail(String businessId);
  275. /**
  276. * 修改业务意向
  277. * @param bfb
  278. * @return
  279. */
  280. int updateBusiness(BussinessFollowBo bfb);
  281. /**
  282. * 跟进单个业务意向
  283. * @param bfb
  284. * @return
  285. */
  286. int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException;
  287. /**
  288. * 查询某个客户的一个意向的当次拜访
  289. * @param ufbId
  290. * @return
  291. */
  292. BussinessFollowBo findFollowOneBusiness(String ufbId);
  293. /**
  294. * 修改某个客户的一个意向的当次拜访
  295. * @param bfb
  296. * @return
  297. */
  298. int updateFollowOneBusiness(BussinessFollowBo bfb);
  299. /**
  300. * 添加单个联系人
  301. * @param ocb
  302. * @return
  303. */
  304. int addOneContact(OrganizationContactBook ocb);
  305. /**
  306. * 删除业务
  307. * @param businessId
  308. * @return
  309. */
  310. int deleteBusiness(String businessId);
  311. /**
  312. * 停止业务
  313. * @param businessId
  314. * @return
  315. */
  316. int updateBusinessToStop(String businessId);
  317. /**
  318. * 删除跟进记录中间表记录
  319. * @param ufbId
  320. * @return
  321. */
  322. int deleteFollowOneBusiness(String ufbId);
  323. /**
  324. * 删除单个联系人
  325. * @param ocbId
  326. * @return
  327. */
  328. int deleteOneContact(String ocbId);
  329. List<Admin> findAdminName();
  330. int updatePersonalCustomerz(CustomerPersonalDetailBo bo);
  331. Pagination<CustomerListOut> findEnteringAudit(CustomerListOut clo, Integer pageNo, Integer pageSize);
  332. Pagination<CustomerListOut> findEnteringAuditIsNo(CustomerListOut clo, Integer pageNo, Integer pageSize);
  333. int updateEnteringAudit(User bo);
  334. /**
  335. * 修改为主要联系人
  336. * @param ocbId
  337. * @return
  338. */
  339. int updateMainContact(String ocbId,String uid);
  340. /** 修改拒绝客户信息 **/
  341. int updateRefusedCustomer(String id,String nickname, String mobile, String societyTag);
  342. /**
  343. * 签单的单位客户
  344. * @param cli
  345. * @param pageNo
  346. * @param pageSize
  347. * @return
  348. */
  349. Pagination<CustomerListOut> listSignOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  350. /**
  351. * 签单的个人客户
  352. * @param cli
  353. * @param pageNo
  354. * @param pageSize
  355. * @return
  356. */
  357. Pagination<CustomerListOut> listSignPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
  358. /**
  359. * 查询需要释放的客户
  360. * @param uid 客户Id
  361. * @return
  362. */
  363. List<LockingReleaseBo> selectWaitReleaseCustomer(String uid);
  364. List<LockingReleaseBo> selectWaitReleaseBusiness(String uid);
  365. void updateReleaseLock(Date releaseTime);
  366. /**
  367. * 查询客户的锁定业务
  368. * @param uid
  369. * @return
  370. */
  371. List<LockingReleaseBo> selectLockedProject(String uid);
  372. /**
  373. * 再次签订项目任务
  374. * @param aid
  375. * @return
  376. */
  377. int updateAgainProjectTask(String uid, String projectId, String aid);
  378. /**
  379. * 客户资料转交
  380. * @param id
  381. * @param aid
  382. * @return
  383. */
  384. int updateInformationMaintainerr(String id, String aid);
  385. /**
  386. * 个人客户资料列表
  387. * @param cli
  388. * @param pageNo
  389. * @param pageSize
  390. * @return
  391. */
  392. Pagination<CustomerListIn> listCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize);
  393. /**
  394. * 部门客户资料列表
  395. * @param cli
  396. * @param pageNo
  397. * @param pageSize
  398. * @return
  399. */
  400. Pagination<CustomerListIn> listDepCustomerInformation(CustomerListIn cli, Integer pageNo, Integer pageSize);
  401. void updatePendingReleaseLock(List<LockingReleaseBo> newList);
  402. List<LockingReleaseBo> selectPendinglockUserList();
  403. int updateUserLevel(User u);
  404. public Double countIntegrity(CustomerOrganizationDetailBo bo);
  405. XSSFWorkbook privateUnitCustomerOutXls(CustomerListIn cli ,Integer sort,Integer sortType,Integer pageNo, Integer pageSize);
  406. int customerHandOver(String userIds, String receiveId);
  407. List<transferListBo> transferList(String uid);
  408. int updatePrivateBusinessTransfer(String inputId, String uid, String pid);
  409. int pushReleaseUser(String id);
  410. /**
  411. *
  412. * @param id
  413. * @return
  414. */
  415. List<userDaysBo> selectReleaseUserDays(String id);
  416. List<userDaysBo> selectChannelUserDays(String id);
  417. int addGuidance(String followId, String guidance);
  418. /**
  419. * 查看跟进记录列表
  420. * @param pageNo
  421. * @param pageSize
  422. * @return
  423. */
  424. Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId,Integer type);
  425. int pushGuidance(String uid);
  426. boolean checkMax(String uid,String aid);
  427. /**
  428. *
  429. * @param list 释放客户
  430. * @param type 0 未跟进 1未签单
  431. * @throws InterruptedException
  432. */
  433. void pushReleaseLog(List<LockingReleaseBo> list,Integer type) throws InterruptedException;
  434. Object listChannelCustomer(InputListChannel in);
  435. /**
  436. *
  437. * @param uids 用户集
  438. * @param receiveId 接受者
  439. * @param remarks 备注
  440. * @param type 0总监分配 1经理分配 2回退
  441. * @return
  442. */
  443. Object pushChannelDeliver(List<String> uids, String receiveId, String remarks, Integer type);
  444. Object getChannelCustomerByName(String name);
  445. boolean checkChannel(List<String> uids);
  446. boolean checkBeforeChannel(String uid);
  447. boolean checkRecovery(List<String> uids);
  448. List<userDaysBo> selectChannelNotFollow(String string);
  449. Object listChannelCounts(InputChannelCounts in);
  450. int updateUserName(String uid, String userName);
  451. List<UserNamesListBo> listUserName(String uid);
  452. boolean checkUserName(String uid,String userName);
  453. Object getUserByNames(String name,Integer type, Integer pageNo, Integer pageSize);
  454. Pagination<OutUserMianProducts> mainProductsList(InputMainProductsList in) ;
  455. List<OutUserDateLogList> userDateLogList(String uid);
  456. int updateuserBusinessScope(String id, String businessScope);
  457. boolean checkData(String uid, String aid);
  458. int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
  459. String introduction,Integer channelType,String orgCode);
  460. Pagination<OutChannelListBo> channelUserList(InputChannelListBo in);
  461. List<?> selectChannelUserList(InputChannelListBo in);
  462. /**
  463. *
  464. * @param uid
  465. * @return 0 正常 1 被其他人领取 2领取上限
  466. */
  467. Integer receiveEveryDay(String uid);
  468. int pushReceiveAsChannel(String uid);
  469. boolean checkOrgCode(String orgCode);
  470. Integer queryUserMax();
  471. Pagination<?> selectUserLastSign(InputSelectUserLastSignBo in);
  472. Result selectUserLastSignExport(InputSelectUserLastSignBo in);
  473. /**
  474. * 判断管理员角色
  475. * @param aid
  476. * @param roleType
  477. * @return
  478. */
  479. boolean checkAid(String aid, Integer roleType);
  480. void transferUser(List<String> uList, String aid, String uid);
  481. /**
  482. *
  483. * @param aid
  484. * @param transferTime
  485. */
  486. void updateAdminUserCount(String aid,Date transferTime);
  487. AdminUserCount getAdminUserCount(String aid, String startTime);
  488. Result importExcel(MultipartFile file);
  489. Object getRestrictCustomerByName(String name);
  490. UserArchivesDetails selectUserByUid(String id);
  491. List<PublicReleaseListBo> getPublicReleaseList(String uid);
  492. }