Browse Source

项目详情接口修改v2

dev_shibei_match
yinzuomei 5 years ago
parent
commit
23517e4cd2
  1. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  3. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  4. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  5. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java

@ -16,4 +16,7 @@ public class ScreenProjectDetailFormDTO implements Serializable {
@NotBlank(message = "projectId不能为空")
private String projectId;
@NotBlank(message = "customerId不能为空")
private String customerId;
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -74,7 +74,9 @@ public class ScreenProjectController {
* @Date 2021/2/24 16:10
*/
@PostMapping("projectdetailv2")
public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){
public Result projectDetail(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenProjectDetailFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return screenProjectService.projectDistributionDetail(formDTO);
}

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -17,11 +17,16 @@ public interface ScreenProjectDataDao {
List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode);
List<ScreenProjectDetailResultDTO> projectDistributionDetail(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO> projectDistributionDetail(@Param("projectId") String projectId,
@Param("customerId") String customerId);
List<String> selectProjectImgs(@Param("projectId") String projectId);
List<String> selectProjectImgs(@Param("projectId") String projectId,
@Param("customerId") String customerId);
List<ScreenProjectDetailResultDTO.processDTO> selectProjectProcess(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO.processDTO> selectProjectProcess(@Param("projectId") String projectId,
@Param("customerId") String customerId);
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId);
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId,
@Param("projectId") String projectId,
@Param("customerId") String customerId);
}

16
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -74,29 +74,31 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
// 1:红色:为刚提交未做任何响应处理未结案的项目;
// 2:黄色: 至少做过一次响应处理答复但未结案的项目;
// 3:绿色:已经结案的项目。
List<String> areaIds = null;
List<String> orgIds = null;
if (StringUtils.isNotBlank(formDTO.getAreaCode())){
areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
//所有组织+网格
orgIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
}
if (formDTO.getPageSize() == null){
formDTO.setPageSize(NumConstant.TWO_HUNDRED);
}
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getPageSize());
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),orgIds,formDTO.getLevel(),formDTO.getPageSize());
return resultDTOS;
}
@Override
public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) {
List<ScreenProjectDetailResultDTO> resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId());
List<ScreenProjectDetailResultDTO> resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId(),formDTO.getCustomerId());
resultDTOS.forEach(item -> {
//项目图片
List<String> imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId());
List<String> imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId(),formDTO.getCustomerId());
item.setImgList(imgList);
//项目处理流程
List<ScreenProjectDetailResultDTO.processDTO> processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId());
List<ScreenProjectDetailResultDTO.processDTO> processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId(),formDTO.getCustomerId());
//流程附件
processDTOS.forEach(processDTO -> {
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId());
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> attachmentDTOS =
screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId(),formDTO.getProjectId(),formDTO.getCustomerId());
processDTO.setAttachments(attachmentDTOS);
});
item.setProcessList(processDTOS);

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -72,11 +72,13 @@
WHERE
del_flag = '0'
AND project_id = #{projectId}
and CUSTOMER_ID= #{customerId}
</select>
<select id="selectProjectImgs" resultType="java.lang.String">
select PROJECT_IMG_URL from screen_project_img_data
where del_flag = '0'
and project_id = #{projectId}
and CUSTOMER_ID= #{customerId}
order by sort asc
</select>
<select id="selectProjectProcess" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO$processDTO">
@ -90,6 +92,7 @@
from screen_project_process
where del_flag = '0'
and project_id = #{projectId}
and CUSTOMER_ID= #{customerId}
order by process_time asc
</select>
<select id="selectProjectProcessAttachments" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO$processDTO$AttachmentDTO">
@ -106,6 +109,8 @@
where del_flag = '0'
and file_place = 'public'
AND PROCESS_ID=#{processId}
and project_id = #{projectId}
and CUSTOMER_ID= #{customerId}
order by sort asc
</select>
</mapper>

Loading…
Cancel
Save