| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | page.setSize(pageConvenientMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageConvenientMerchantDTO.getPageNum()); |
| | | IPage<ConvenientMerchantVO> iPage = this.baseMapper.pageMerchant(page, pageConvenientMerchantDTO); |
| | | if (nonNull(pageConvenientMerchantDTO.getServiceId())) { |
| | | List<ConvenientMerchantVO> records = iPage.getRecords(); |
| | | if (!records.isEmpty()) { |
| | | records.forEach(record -> { |
| | | String serviceScope = convenientServiceCategoryDAO.selectServiceScopeByMerchantId(record.getId()); |
| | | record.setServiceScope(serviceScope); |
| | | }); |
| | | } |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | page.setSize(pageClassifyMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageClassifyMerchantDTO.getPageNum()); |
| | | IPage<ConvenientMerchantVO> merchantVOList = this.baseMapper.getClassifyMerchants(page, pageClassifyMerchantDTO, currentMon); |
| | | List<ConvenientMerchantVO> records = merchantVOList.getRecords(); |
| | | if (!records.isEmpty()) { |
| | | records.forEach(record -> { |
| | | String serviceScope = convenientServiceCategoryDAO.selectServiceScopeByMerchantId(record.getId()); |
| | | record.setServiceScope(serviceScope); |
| | | }); |
| | | } |
| | | return R.ok(merchantVOList); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public R consultMerchant(Long merchantId) { |
| | | ConvenientMerchantDO merchantDO = this.baseMapper.selectById(merchantId); |
| | | if (isNull(merchantDO)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String nowDate = simpleDateFormat.format(new Date()); |
| | | ConvenientConsultationStatisticsDO statisticsDO = convenientConsultationStatisticsDAO.selectOne(new LambdaQueryWrapper<ConvenientConsultationStatisticsDO>() |
| | |
| | | |
| | | @Override |
| | | public R incrMerchantView(Long merchantId) { |
| | | ConvenientMerchantDO merchantDO = this.baseMapper.selectById(merchantId); |
| | | if (isNull(merchantDO)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String nowDate = simpleDateFormat.format(new Date()); |
| | | ConvenientViewStatisticsDO statisticsDO = convenientViewStatisticsDAO.selectOne(new LambdaQueryWrapper<ConvenientViewStatisticsDO>() |
| | |
| | | |
| | | @Override |
| | | public R exportMerchant(ExportMerchantDTO exportMerchantDTO) { |
| | | return R.ok(this.baseMapper.exportMerchant(exportMerchantDTO)); |
| | | List<Long> needExportIds = exportMerchantDTO.getIds(); |
| | | if (nonNull(needExportIds) && !needExportIds.isEmpty()) { |
| | | //根据id导出 |
| | | return R.ok(this.baseMapper.exportMerchantByIds(needExportIds)); |
| | | } |
| | | List<ExportMerchantVO> exportMerchantVOList = this.baseMapper.exportMerchantBySearch(exportMerchantDTO); |
| | | if (nonNull(exportMerchantDTO.getServiceId()) && !exportMerchantVOList.isEmpty()) { |
| | | exportMerchantVOList.forEach(merchant -> { |
| | | String serviceScope = convenientServiceCategoryDAO.selectServiceScopeByMerchantId(merchant.getId()); |
| | | merchant.setServiceScope(serviceScope); |
| | | }); |
| | | } |
| | | return R.ok(exportMerchantVOList); |
| | | } |
| | | |
| | | /** |