|
|
@ -28,11 +28,14 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
|
|
|
import com.epmet.dataaggre.dao.epmettduck.PrUserProjectDao; |
|
|
|
import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.PrVistRecordDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.ProjectItemTypeEnum; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.form.ItemResDetailFormDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmettduck.form.ProjectKeyCommonDTO; |
|
|
@ -44,6 +47,8 @@ import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; |
|
|
|
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity; |
|
|
|
import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; |
|
|
|
import com.epmet.dataaggre.service.epmettduck.PrUserProjectService; |
|
|
|
import com.epmet.dataaggre.service.epmettduck.PrVistRecordService; |
|
|
|
import com.epmet.dataaggre.service.govorg.GovOrgService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -74,6 +79,10 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
private PrVistRecordDao visitRecordDao; |
|
|
|
@Resource |
|
|
|
private PrPublishRangeService prPublishRangeService; |
|
|
|
@Resource |
|
|
|
private GovOrgService govOrgService; |
|
|
|
@Resource |
|
|
|
private PrVistRecordService prVistRecordService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<PrUserProjectDTO> page(Map<String, Object> params) { |
|
|
@ -667,4 +676,35 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
resultDTO.setDataList(dataList); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 有新的问卷显示小红点 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @Param tokenDto |
|
|
|
* @Return {@link RedPointResultDTO} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2021/9/23 10:05 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public RedPointResultDTO redPoint(TokenDto tokenDto) { |
|
|
|
RedPointResultDTO result = new RedPointResultDTO(); |
|
|
|
List<String> orgList = govOrgService.getStaffOrgList(tokenDto.getUserId()); |
|
|
|
List<PrPublishRangeDTO> list = prPublishRangeService.getListByOrg(orgList); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
result.setRedPoint(NumConstant.ZERO_STR); |
|
|
|
return result; |
|
|
|
} |
|
|
|
PrVistRecordDTO visitRecord = prVistRecordService.getNewestRecord(tokenDto.getUserId()); |
|
|
|
if (null == visitRecord) { |
|
|
|
result.setRedPoint(NumConstant.ONE_STR); |
|
|
|
return result; |
|
|
|
} |
|
|
|
if (list.get(0).getCreatedTime().compareTo(visitRecord.getCreatedTime()) > 0) { |
|
|
|
result.setRedPoint(NumConstant.ONE_STR); |
|
|
|
} else { |
|
|
|
result.setRedPoint(NumConstant.ZERO_STR); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |