|
@ -45,6 +45,8 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
private PublicityDao publicityDao;//机关每日发文
|
|
|
private PublicityDao publicityDao;//机关每日发文
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
private Date dateFact = DateUtils.addDateDays( new Date(),-1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param tokenDto |
|
|
* @param tokenDto |
|
@ -66,16 +68,15 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
@Override |
|
|
@Override |
|
|
public List<FactTagViewedAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) { |
|
|
public List<FactTagViewedAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) { |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
Date date = new Date(); |
|
|
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); |
|
|
|
|
|
String yearId = strDate.substring(0, 4); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
|
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); |
|
|
|
|
|
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 = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); |
|
|
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
@ -94,16 +95,15 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
@Override |
|
|
@Override |
|
|
public List<FactTagUsedAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) { |
|
|
public List<FactTagUsedAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) { |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
Date date = new Date(); |
|
|
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); |
|
|
|
|
|
String yearId = strDate.substring(0, 4); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
|
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
if (StringUtils.equals("month", type)) {//当月
|
|
|
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); |
|
|
|
|
|
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 = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); |
|
|
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
@ -122,8 +122,8 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
@Override |
|
|
@Override |
|
|
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) { |
|
|
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) { |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
Date date = new Date(); |
|
|
// Date date = new Date();
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
@ -131,7 +131,7 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); |
|
|
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); |
|
|
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); |
|
|
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
@ -150,8 +150,8 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
@Override |
|
|
@Override |
|
|
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) { |
|
|
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) { |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
Date date = new Date(); |
|
|
// Date date = new Date();
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
@ -159,7 +159,7 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); |
|
|
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); |
|
|
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); |
|
|
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
@ -178,8 +178,8 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
@Override |
|
|
@Override |
|
|
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) { |
|
|
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) { |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
String agencyId = this.getLoginUserDetails(tokenDto); |
|
|
Date date = new Date(); |
|
|
// Date date = new Date();
|
|
|
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String yearId = strDate.substring(0, 4); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
String monthId = strDate.substring(0, 6); |
|
|
|
|
|
|
|
@ -187,7 +187,7 @@ public class PublicityServiceImpl implements PublicityService { |
|
|
return publicityDao.getSubGridPublishedMonth(agencyId, monthId); |
|
|
return publicityDao.getSubGridPublishedMonth(agencyId, monthId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
} else if (StringUtils.equals("quarter", type)) {//当季
|
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|
|
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); |
|
|
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); |
|
|
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); |
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|
} else if (StringUtils.equals("year", type)) {//当年
|
|
|