选装售后
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AflCenterUserInfoServiceImpl.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. package com.qtzl.alterSales.manager.service;
  2. import cn.com.taiji.common.manager.ManagerException;
  3. import cn.com.taiji.common.manager.net.http.ServiceHandleException;
  4. import cn.hutool.core.util.DesensitizedUtil;
  5. import com.alibaba.fastjson.JSONObject;
  6. import com.google.common.collect.Lists;
  7. import com.qtzl.alterSales.dao.entity.second.AflCenterUserInfo;
  8. import com.qtzl.alterSales.dao.repo.jpa.second.AflCenterUserInfoRepo;
  9. import com.qtzl.alterSales.manager.enums.AccountTypeEnum;
  10. import com.qtzl.alterSales.manager.enums.AuditStatusEnum;
  11. import com.qtzl.alterSales.manager.model.protocol.UcServiceError;
  12. import com.qtzl.alterSales.manager.model.protocol.sales.AflCenterUserInfoAuditRequest;
  13. import com.qtzl.alterSales.manager.model.protocol.sales.AflCenterUserInfoFindPageViewRequest;
  14. import com.qtzl.alterSales.manager.model.protocol.sales.AflCenterUserInfoUpdateRequest;
  15. import com.qtzl.alterSales.manager.service.third.ConstantConfig;
  16. import com.qtzl.alterSales.manager.service.third.FmsService;
  17. import com.qtzl.alterSales.manager.tools.ExcelUtils;
  18. import com.qtzl.alterSales.manager.vo.UpdateCompanyAccountInfoVo;
  19. import com.qtzl.alterSales.manager.vo.UpdatePersonalAccountInfoVo;
  20. import com.qtzl.alterSales.zt.enums.ZttxInterfaceCode;
  21. import com.qtzl.alterSales.zt.utils.ZtHttpResponse;
  22. import com.qtzl.alterSales.zt.utils.ZtHttpUtil;
  23. import com.qtzl.alterSales.zt.vo.RefreshTokenResponseVo;
  24. import com.qtzl.alterSales.zt.vo.UserInfoAuthenticationRequestVo;
  25. import com.qtzl.alterSales.zt.vo.UserInfoAuthenticationResponseVo;
  26. import org.apache.commons.lang3.StringUtils;
  27. import org.slf4j.Logger;
  28. import org.springframework.beans.BeanUtils;
  29. import org.springframework.beans.factory.annotation.Autowired;
  30. import org.springframework.data.domain.Sort;
  31. import org.springframework.stereotype.Service;
  32. import javax.annotation.Resource;
  33. import javax.persistence.criteria.Predicate;
  34. import java.io.File;
  35. import java.time.LocalDateTime;
  36. import java.util.List;
  37. import java.util.Map;
  38. @Service
  39. public class AflCenterUserInfoServiceImpl implements AflCenterUserInfoService{
  40. @Resource
  41. AflCenterUserInfoRepo aflCenterUserInfoRepo;
  42. @Resource
  43. FmsService fmsService;
  44. @Resource
  45. ConstantConfig constantConfig;
  46. @Autowired
  47. ZtHttpUtil httpUtil;
  48. @Resource
  49. TokenService tokenService;
  50. @Override
  51. public void audit(AflCenterUserInfoAuditRequest request) throws ServiceHandleException {
  52. if (StringUtils.isEmpty(request.getReviewer())){
  53. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核人不能为空");
  54. }
  55. if (AuditStatusEnum.REJECTED.getCode().equals(request.getStatus())){
  56. if (StringUtils.isEmpty(request.getRemark())){
  57. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核不通过原因不能为空");
  58. }
  59. }
  60. AflCenterUserInfo aflCenterUserInfo = selectById(request.getId());
  61. if (request.getStatus().equals(aflCenterUserInfo.getStatus())){
  62. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核状态未发生改变");
  63. }
  64. if (AuditStatusEnum.REVIEWED.getCode().toString().equals(request.getStatus())){
  65. // AflCenterUserInfo aflCenterUserInfo = aflCenterUserInfoRepo.findByAccountId(aflCenterVehicleInfo.getAccountId());
  66. getToken(aflCenterUserInfo);
  67. //设置修改账户信息参数
  68. //进行个人用户信息变更和单位用户信息变更
  69. if (AccountTypeEnum.PERSONAL.getCode().equals(aflCenterUserInfo.getAccountType())){
  70. //修改个人用户信息
  71. UpdatePersonalAccountInfoVo updatePersonalAccountInfoVo = new UpdatePersonalAccountInfoVo();
  72. getUpdatePersonalAccountInfoVo(updatePersonalAccountInfoVo,aflCenterUserInfo);
  73. Map<String, String> requestParam = updatePersonalAccountInfoVo.getRequestParam();
  74. ZtHttpResponse response = null;
  75. try {
  76. response = httpUtil.doPost(ZttxInterfaceCode.UPDATE_PERSONAL_USER_INFO, requestParam);
  77. } catch (ManagerException e) {
  78. e.getMessage();
  79. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改个人账户信息失败,请重新审核,错误原因:"+e.getMessage());
  80. }
  81. if (response == null || response.getRcode() != 0) {
  82. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改个人账户信息失败,请重新审核");
  83. }
  84. aflCenterUserInfo.setName(aflCenterUserInfo.getNewName());
  85. aflCenterUserInfo.setAddress(aflCenterUserInfo.getNewAddress());
  86. }else if (AccountTypeEnum.COMPANY.getCode().equals(aflCenterUserInfo.getAccountType())){
  87. //修改单位用户信息
  88. UpdateCompanyAccountInfoVo updateCompanyAccountInfoVo = new UpdateCompanyAccountInfoVo();
  89. getUpdateCompanyAccountInfoVo(updateCompanyAccountInfoVo,aflCenterUserInfo);
  90. Map<String, String> requestParam = updateCompanyAccountInfoVo.getRequestParam();
  91. ZtHttpResponse response = null;
  92. try {
  93. response = httpUtil.doPost(ZttxInterfaceCode.UPDATE_COMPANY_USER_INFO, requestParam);
  94. } catch (ManagerException e) {
  95. e.getMessage();
  96. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改单位账户信息失败,请重新审核,错误原因:"+e.getMessage());
  97. }
  98. if (response == null || response.getRcode() != 0) {
  99. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改单位账户信息失败,请重新审核");
  100. }
  101. aflCenterUserInfo.setName(aflCenterUserInfo.getNewName());
  102. aflCenterUserInfo.setAddress(aflCenterUserInfo.getNewAddress());
  103. if (StringUtils.isEmpty(aflCenterUserInfo.getNewBank())){
  104. aflCenterUserInfo.setBank(aflCenterUserInfo.getNewBank());
  105. }
  106. if (StringUtils.isEmpty(aflCenterUserInfo.getNewBankAddr())){
  107. updateCompanyAccountInfoVo.setBankAddr(aflCenterUserInfo.getNewBankAddr());
  108. }
  109. if (StringUtils.isEmpty(aflCenterUserInfo.getNewBankAccount())){
  110. updateCompanyAccountInfoVo.setBankAccount(aflCenterUserInfo.getNewBankAccount());
  111. }
  112. if (StringUtils.isEmpty(aflCenterUserInfo.getTaxpayerCode())){
  113. updateCompanyAccountInfoVo.setTaxpayerCode(aflCenterUserInfo.getNewTaxpayerCode());
  114. }
  115. }else {
  116. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核失败,账户类型未知");
  117. }
  118. }
  119. BeanUtils.copyProperties(request,aflCenterUserInfo);
  120. aflCenterUserInfo.setUpdateTime(LocalDateTime.now());
  121. try {
  122. aflCenterUserInfoRepo.save(aflCenterUserInfo);
  123. } catch (Exception e) {
  124. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核失败,保存变更信息失败");
  125. }
  126. }
  127. @Override
  128. public void update(AflCenterUserInfoUpdateRequest request) throws ServiceHandleException {
  129. if (StringUtils.isEmpty(request.getUpdater())){
  130. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改人不能为空");
  131. }
  132. if (StringUtils.isEmpty(request.getNewAddress())){
  133. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("地址不能为空");
  134. }
  135. if (StringUtils.isEmpty(request.getNewName())){
  136. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("姓名不能为空");
  137. }
  138. AflCenterUserInfo aflCenterUserInfo = selectById(request.getId());
  139. if (AccountTypeEnum.PERSONAL.getCode().equals(aflCenterUserInfo.getAccountType())&&
  140. (aflCenterUserInfo.getName().equals(request.getNewName())
  141. ||request.getNewName().equals(aflCenterUserInfo.getAddress())
  142. )
  143. ){
  144. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("个人用户变更前参数与变更后参数未发生改变");
  145. }
  146. aflCenterUserInfo.setNewName(request.getNewName());
  147. aflCenterUserInfo.setNewAddress(request.getNewAddress());
  148. aflCenterUserInfo.setNewBank(request.getNewBank());
  149. aflCenterUserInfo.setNewBankAddr(request.getNewBankAddr());
  150. aflCenterUserInfo.setNewBankAccount(request.getNewBankAccount());
  151. aflCenterUserInfo.setNewTaxpayerCode(request.getNewTaxpayerCode());
  152. aflCenterUserInfo.setUpdater(request.getUpdater());
  153. aflCenterUserInfo.setStatus(AuditStatusEnum.PENDINGREVIEW.getCode().toString());
  154. aflCenterUserInfo.setUpdateTime(LocalDateTime.now());
  155. try {
  156. aflCenterUserInfoRepo.save(aflCenterUserInfo);
  157. } catch (Exception e) {
  158. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改信息失败");
  159. }
  160. }
  161. /**
  162. * 由于导出存在全量导出,该功能需要优化,
  163. * @param request
  164. * @param logger
  165. * @return
  166. * @throws ServiceHandleException
  167. */
  168. @Override
  169. public String export(AflCenterUserInfoFindPageViewRequest request, Logger logger) throws ServiceHandleException {
  170. String pathFile =null;
  171. try {
  172. long count = count(request);
  173. if (count>10000l){
  174. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账户管理导出失败,数据量超过10000,不允许导出");
  175. }
  176. List<AflCenterUserInfo> aflCenterUserInfos = select(request);
  177. if (aflCenterUserInfos==null||aflCenterUserInfos.size()==0) {
  178. pathFile = ExcelUtils.export(null, "账户管理",constantConfig.getFilePath() ,null, AflCenterUserInfo.class);
  179. } else {
  180. for (AflCenterUserInfo aflCenterUserInfo : aflCenterUserInfos) {
  181. if (!StringUtils.isEmpty(aflCenterUserInfo.getIdNum())&&aflCenterUserInfo.getIdNum().length()==18){
  182. aflCenterUserInfo.setIdNum(DesensitizedUtil.idCardNum(aflCenterUserInfo.getIdNum(), 3, 4));
  183. }
  184. if (!StringUtils.isEmpty(aflCenterUserInfo.getMobile())&&aflCenterUserInfo.getMobile().length()==11){
  185. aflCenterUserInfo.setIdNum(DesensitizedUtil.mobilePhone(aflCenterUserInfo.getMobile()));
  186. }
  187. }
  188. pathFile = ExcelUtils.export(null, "账户管理",constantConfig.getFilePath(), aflCenterUserInfos, AflCenterUserInfo.class);
  189. }
  190. if (StringUtils.isEmpty(pathFile)){
  191. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账户管理导出失败");
  192. }
  193. String s = null;
  194. try {
  195. s = fmsService.uploadFile(constantConfig.getUploadFile(),pathFile, 90000);
  196. } catch (ServiceHandleException e) {
  197. logger.error("选装-账户管理导出失败:{}", e.getMessage());
  198. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException(e.getMessage());
  199. }
  200. if (StringUtils.isEmpty(s)){
  201. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账户管理导出失败");
  202. }
  203. return s;
  204. } catch (Exception e) {
  205. if (e instanceof ServiceHandleException) {
  206. throw e;
  207. }
  208. logger.error("选装-账户管理导出失败:{}", e.getMessage());
  209. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账户管理导出失败");
  210. }finally {
  211. File file = null;
  212. try {
  213. file = new File(pathFile);
  214. } catch (Exception e) {
  215. }
  216. if (file!=null){
  217. file.delete();
  218. }
  219. }
  220. }
  221. private List<AflCenterUserInfo> select(AflCenterUserInfoFindPageViewRequest request) throws ServiceHandleException {
  222. return aflCenterUserInfoRepo.findAll(((root, query, cb) -> {
  223. List<Predicate> list = Lists.newArrayList();
  224. if (!StringUtils.isEmpty(request.getAccountId())) {
  225. list.add(cb.equal(root.<String>get("accountId"), request.getAccountId()));
  226. }
  227. if (!StringUtils.isEmpty(request.getName())) {
  228. list.add(cb.like(root.<String>get("name"), "%"+request.getName()+"%"));
  229. }
  230. if (!StringUtils.isEmpty(request.getAccountType())) {
  231. list.add(cb.equal(root.<String>get("accountType"), request.getAccountType()));
  232. }
  233. if (!StringUtils.isEmpty(request.getIdType())) {
  234. list.add(cb.equal(root.<String>get("idType"), request.getIdType()));
  235. }
  236. if (!StringUtils.isEmpty(request.getIdNum())) {
  237. list.add(cb.equal(root.<String>get("idNum"), request.getIdNum()));
  238. }
  239. if (!StringUtils.isEmpty(request.getMobile())) {
  240. list.add(cb.equal(root.<String>get("mobile"), request.getMobile()));
  241. }
  242. if (!StringUtils.isEmpty(request.getAgentName())) {
  243. list.add(cb.like(root.<String>get("agentName"), "%"+request.getAgentName()+"%"));
  244. }
  245. if (!StringUtils.isEmpty(request.getAgentIdType())) {
  246. list.add(cb.equal(root.<String>get("agentIdType"), request.getAgentIdType()));
  247. }
  248. if (!StringUtils.isEmpty(request.getAccountId())) {
  249. list.add(cb.equal(root.<String>get("accountId"), request.getAccountId()));
  250. }
  251. if (!StringUtils.isEmpty(request.getStatus())) {
  252. list.add(cb.equal(root.<String>get("status"), request.getStatus()));
  253. }
  254. if (request.getInsertTimeStart() != null) {
  255. list.add(cb.greaterThanOrEqualTo(root.<LocalDateTime>get("insertTime"), request.getInsertTimeStart()));
  256. }
  257. if (request.getInsertTimeEnd() != null) {
  258. list.add(cb.lessThanOrEqualTo(root.<LocalDateTime>get("insertTime"), request.getInsertTimeEnd()));
  259. }
  260. Predicate[] p = new Predicate[list.size()];
  261. return cb.and(list.toArray(p));
  262. }), Sort.by(Sort.Direction.DESC, "insertTime"));
  263. }
  264. public AflCenterUserInfo selectById(String id) throws ServiceHandleException {
  265. if (StringUtils.isEmpty(id)){
  266. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账户编号不能为空");
  267. }
  268. AflCenterUserInfo aflCenterUserInfo = aflCenterUserInfoRepo.findById(id).orElse(null);
  269. if (aflCenterUserInfo == null){
  270. throw UcServiceError.NOT_FOUND_DATA.toHandleException("未查询到数据");
  271. }
  272. return aflCenterUserInfo;
  273. }
  274. private void getUpdatePersonalAccountInfoVo(UpdatePersonalAccountInfoVo updatePersonalAccountInfoVo,AflCenterUserInfo aflCenterUserInfo){
  275. updatePersonalAccountInfoVo.setOpenId(aflCenterUserInfo.getOpenId());
  276. updatePersonalAccountInfoVo.setAccountId(aflCenterUserInfo.getAccountId());
  277. updatePersonalAccountInfoVo.setAccessToken(aflCenterUserInfo.getAccessToken());
  278. updatePersonalAccountInfoVo.setName(aflCenterUserInfo.getNewName());
  279. updatePersonalAccountInfoVo.setAddress(aflCenterUserInfo.getNewAddress());
  280. }
  281. private void getUpdateCompanyAccountInfoVo(UpdateCompanyAccountInfoVo updateCompanyAccountInfoVo, AflCenterUserInfo aflCenterUserInfo){
  282. updateCompanyAccountInfoVo.setOpenId(aflCenterUserInfo.getOpenId());
  283. updateCompanyAccountInfoVo.setAccountId(aflCenterUserInfo.getAccountId());
  284. updateCompanyAccountInfoVo.setAccessToken(aflCenterUserInfo.getAccessToken());
  285. updateCompanyAccountInfoVo.setName(aflCenterUserInfo.getNewName());
  286. updateCompanyAccountInfoVo.setAddress(aflCenterUserInfo.getNewAddress());
  287. updateCompanyAccountInfoVo.setBank(aflCenterUserInfo.getNewBank());
  288. updateCompanyAccountInfoVo.setBankAddr(aflCenterUserInfo.getNewBankAddr());
  289. updateCompanyAccountInfoVo.setBankAccount(aflCenterUserInfo.getNewBankAccount());
  290. updateCompanyAccountInfoVo.setTaxpayerCode(aflCenterUserInfo.getNewTaxpayerCode());
  291. }
  292. public void getToken(AflCenterUserInfo aflCenterUserInfo) throws ServiceHandleException {
  293. if (StringUtils.isEmpty(aflCenterUserInfo.getOpenId())||StringUtils.isEmpty(aflCenterUserInfo.getAccessToken())){
  294. UserInfoAuthenticationRequestVo userInfoAuthenticationRequestVo = new UserInfoAuthenticationRequestVo();
  295. userInfoAuthenticationRequestVo.setId(aflCenterUserInfo.getIdNum());
  296. userInfoAuthenticationRequestVo.setMobile(aflCenterUserInfo.getMobile());
  297. userInfoAuthenticationRequestVo.setName(aflCenterUserInfo.getName());
  298. Integer i = null;
  299. try {
  300. i = Integer.parseInt(aflCenterUserInfo.getIdType());
  301. } catch (NumberFormatException e) {
  302. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("证件类型转换失败,请确认,请重新审核");
  303. }
  304. userInfoAuthenticationRequestVo.setUserIdType(i);
  305. Map<String, String> requestParam = userInfoAuthenticationRequestVo.getRequestParam();
  306. ZtHttpResponse response = null;
  307. try {
  308. response = httpUtil.doPost(ZttxInterfaceCode.USER_INFO_AUTHENTICATION, requestParam);
  309. } catch (ManagerException e) {
  310. e.getMessage();
  311. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取账号信息token失败,请重新审核。失败原因:"+e.getMessage());
  312. }
  313. if (response != null && response.getRcode() == 0) {
  314. try {
  315. UserInfoAuthenticationResponseVo res = JSONObject.parseObject(response.getData(), UserInfoAuthenticationResponseVo.class);
  316. aflCenterUserInfo.setOpenId(res.getOpenId());
  317. aflCenterUserInfo.setAccessToken(res.getAccessToken());
  318. aflCenterUserInfoRepo.save(aflCenterUserInfo);
  319. } catch (Exception e) {
  320. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("返回数据解析异常,请重新审核");
  321. }
  322. }
  323. }else {
  324. RefreshTokenResponseVo refreshTokenResponseVo = null;
  325. try {
  326. refreshTokenResponseVo = tokenService.refreshToken(aflCenterUserInfo.getOpenId(), aflCenterUserInfo.getAccessToken());
  327. } catch (ServiceHandleException e) {
  328. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取刷新令牌失败,请重新审核。失败原因:"+e.getMessage());
  329. }
  330. if (refreshTokenResponseVo==null){
  331. throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取刷新令牌失败,请重新审核");
  332. }
  333. aflCenterUserInfo.setAccessToken(refreshTokenResponseVo.getAccessToken());
  334. }
  335. }
  336. private long count(AflCenterUserInfoFindPageViewRequest request) throws ServiceHandleException {
  337. return aflCenterUserInfoRepo.count(((root, query, cb) -> {
  338. List<Predicate> list = Lists.newArrayList();
  339. if (!StringUtils.isEmpty(request.getAccountId())) {
  340. list.add(cb.equal(root.<String>get("accountId"), request.getAccountId()));
  341. }
  342. if (!StringUtils.isEmpty(request.getName())) {
  343. list.add(cb.like(root.<String>get("name"), "%"+request.getName()+"%"));
  344. }
  345. if (!StringUtils.isEmpty(request.getAccountType())) {
  346. list.add(cb.equal(root.<String>get("accountType"), request.getAccountType()));
  347. }
  348. if (!StringUtils.isEmpty(request.getIdType())) {
  349. list.add(cb.equal(root.<String>get("idType"), request.getIdType()));
  350. }
  351. if (!StringUtils.isEmpty(request.getIdNum())) {
  352. list.add(cb.equal(root.<String>get("idNum"), request.getIdNum()));
  353. }
  354. if (!StringUtils.isEmpty(request.getMobile())) {
  355. list.add(cb.equal(root.<String>get("mobile"), request.getMobile()));
  356. }
  357. if (!StringUtils.isEmpty(request.getAgentName())) {
  358. list.add(cb.like(root.<String>get("agentName"), "%"+request.getAgentName()+"%"));
  359. }
  360. if (!StringUtils.isEmpty(request.getAgentIdType())) {
  361. list.add(cb.equal(root.<String>get("agentIdType"), request.getAgentIdType()));
  362. }
  363. if (!StringUtils.isEmpty(request.getAccountId())) {
  364. list.add(cb.equal(root.<String>get("accountId"), request.getAccountId()));
  365. }
  366. if (!StringUtils.isEmpty(request.getStatus())) {
  367. list.add(cb.equal(root.<String>get("status"), request.getStatus()));
  368. }
  369. if (request.getInsertTimeStart() != null) {
  370. list.add(cb.greaterThanOrEqualTo(root.<LocalDateTime>get("insertTime"), request.getInsertTimeStart()));
  371. }
  372. if (request.getInsertTimeEnd() != null) {
  373. list.add(cb.lessThanOrEqualTo(root.<LocalDateTime>get("insertTime"), request.getInsertTimeEnd()));
  374. }
  375. Predicate[] p = new Predicate[list.size()];
  376. return cb.and(list.toArray(p));
  377. }));
  378. }
  379. }