|
@ -19,15 +19,11 @@ package com.epmet.service.publicity.impl; |
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
|
|
import com.epmet.dao.publicity.PublicityDao; |
|
|
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|
|
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
|
|
import com.epmet.publicity.dto.result.*; |
|
|
|
|
|
|
|
|
import com.epmet.dao.publicity.PublicityDao; |
|
|
|
|
|
import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.publicity.dto.result.FactTagAgencyDTO; |
|
|
|
|
|
import com.epmet.service.publicity.PublicityService; |
|
|
import com.epmet.service.publicity.PublicityService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
@ -65,7 +61,7 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param tokenDto,formDTO |
|
|
* @param tokenDto,formDTO |
|
|
* @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 |
|
|
* @Description 宣传能力—工作端-获取阅读最多的分类数据 |
|
|
* @author jyy |
|
|
* @author jyy |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
@ -81,23 +77,20 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); |
|
|
return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
|
|
|
|
|
|
return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); |
|
|
return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param tokenDto pageSize type |
|
|
* @param tokenDto pageSize type |
|
|
* @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 |
|
|
* @Description 宣传能力—工作端-获取发表最多的分类数据 |
|
|
* @author jyy |
|
|
* @author jyy |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
@ -113,18 +106,102 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); |
|
|
return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
|
|
|
|
|
|
return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); |
|
|
return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param tokenDto type |
|
|
|
|
|
* @Description 获取下级机关发文数 |
|
|
|
|
|
* @author jyy |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) { |
|
|
|
|
|
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|
|
|
|
|
String agencyId = "1041fe5e8499dbd8add314291d2f6da4"; |
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
|
|
String yearId = strDate.substring(0, 4); |
|
|
|
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
|
|
|
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
|
|
|
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
|
|
|
return publicityDao.getSubAgencyPublishedYear(agencyId, yearId); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param tokenDto type |
|
|
|
|
|
* @Description 获取直属部门发文数 |
|
|
|
|
|
* @author jyy |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) { |
|
|
|
|
|
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|
|
|
|
|
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
|
|
String yearId = strDate.substring(0, 4); |
|
|
|
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
|
|
|
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
|
|
|
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
|
|
|
return publicityDao.getSubDepartPublishedYear(agencyId, yearId); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param tokenDto type |
|
|
|
|
|
* @Description 获取指数网格发文数 |
|
|
|
|
|
* @author jyy |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) { |
|
|
|
|
|
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|
|
|
|
|
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
|
|
String yearId = strDate.substring(0, 4); |
|
|
|
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
|
|
|
return publicityDao.getSubGridPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
|
|
|
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
|
|
|
return publicityDao.getSubGridPublishedYear(agencyId, yearId); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|