Commit 9c292d1cd9469b89edf9684cdf6571b17687624c

Authored by shiyang
1 parent f2893e8be8

update

Showing 1 changed file with 9 additions and 16 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 9c292d1
... ... @@ -5431,30 +5431,23 @@
5431 5431 if(CollectionUtils.isNotEmpty(personIds)){
5432 5432 query.setPersonIds(personIds);
5433 5433 }
  5434 + //分页数据
  5435 + query.mysqlBuild(couponMapper.bookbuildingCouponCount(query));
5434 5436 //查询mysql 优惠券记录
5435 5437 List<Map> bookbuildingCouponList=couponMapper.bookbuildingCoupon(query);
5436   - //分页总数
5437   - int count = couponMapper.bookbuildingCouponCount(query);
  5438 +
5438 5439 List<Map> result=new ArrayList<>();
5439 5440 for (Map bookbuildingCoupon : bookbuildingCouponList) {
5440 5441 Map map=new HashedMap();
5441 5442 PersonModel personModel = mongoTemplate.findById(bookbuildingCoupon.get("userid").toString(), PersonModel.class);
5442   - if(null!=personModel){
5443   - map.put("name", personModel.getName());
5444   - map.put("phone", personModel.getPhone());
5445   - map.put("cardNo", personModel.getCardNo());
5446   - map.put("hospitalName", bookbuildingCoupon.get("hospitalname"));
5447   - map.put("created", bookbuildingCoupon.get("created"));
5448   - }else {
5449   - //处理分页计数
5450   - if(0!=count){
5451   - count--;
5452   - }
5453   - }
  5443 + map.put("name", StringUtils.isNotEmpty(personModel.getName())?personModel.getName():"");
  5444 + map.put("phone", StringUtils.isNotEmpty(personModel.getPhone())?personModel.getPhone():"");
  5445 + map.put("cardNo", StringUtils.isNotEmpty(personModel.getCardNo())?personModel.getCardNo():"");
  5446 + map.put("hospitalName", bookbuildingCoupon.get("hospitalname"));
  5447 + map.put("created", bookbuildingCoupon.get("created"));
  5448 +
5454 5449 result.add(map);
5455 5450 }
5456   - //分页数据
5457   - query.mysqlBuild(count);
5458 5451  
5459 5452 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
5460 5453 objectResponse.setErrormsg("成功");