CustomerService.java 13 KB

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