CustomerService.java 13 KB

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