Browse Source

项目信息上报,和查询

master
liushaowen 5 years ago
parent
commit
1f072c3e84
  1. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java
  2. 21
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java
  3. 124
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
  4. 32
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java
  5. 23
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  6. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  7. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  8. 49
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  9. 87
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  10. 172
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  11. 91
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java
  12. 136
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java
  13. 146
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java
  14. 112
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
  15. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java
  16. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java
  17. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  18. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java
  19. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java
  20. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java
  21. 142
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
  22. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java
  23. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java
  24. 110
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java
  25. 99
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
  26. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java
  27. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java
  28. 99
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java
  29. 222
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  30. 99
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java
  31. 98
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java
  32. 156
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java
  33. 43
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  34. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml
  35. 30
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml
  36. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml

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

@ -0,0 +1,19 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 16:12
*/
@Data
public class ScreenProjectDetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "projectId不能为空")
private String projectId;
}

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

@ -0,0 +1,21 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 15:22
*/
@Data
public class ScreenProjectDistributionFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String areaCode;
private String level;
private String agencyId;
}

124
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java

@ -0,0 +1,124 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 16:15
*/
@Data
public class ScreenProjectDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目id
*/
private String projectId;
/**
* 议题内容其实就是项目内容
*/
private String projectContent;
/**
* 上报时间对应的是立项时间;格式yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private String reportTime;
/**
* 所属类别名称
*/
private String categoryName;
/**
* 上报人名
*/
private String reportUserName;
/**
* 上报人电话
*/
private String mobile;
/**
* 上报位置
*/
private String reportAddress;
/**
* 图片列表
*/
private List<String> imgList;
/**
* 处理进展列表(返回的是按时间升序的集合)
*/
private List<processDTO> processList;
@Data
public static class processDTO{
@JsonIgnore
private String processId;
/**
* 处理部门名称
*/
private String handleDeptName;
/**
* 公开处理意见
*/
private String suggestion;
/**
* 处理时间yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reponseTime;
/**
* 关闭close; 回应 response结案closed_case退回return部门流转transfer创建项目created
*/
private String operation;
/**
* 被吹哨部门如果是多个以逗号隔开返给前端
*/
private String whistleDeptName;
private List<AttachmentDTO> attachments;
@Data
public static class AttachmentDTO{
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件名
*/
private String fileName;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 附件名uuid随机生成
*/
private String attachmentName;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 附件大小 字节为单位
*/
private String attachmentSize;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 语音或视频时长
*/
private String duration;
}
}
}

32
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 15:26
*/
@Data
public class ScreenProjectDistributionResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private String id;
/**
* 项目标题
*/
private String projectTitle;
/**
* 项目等级 1:红色事件2黄色事件3绿色事件
*/
private String level;
/**
* 经纬度
*/
private String longitude;
private String latitude;
}

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

@ -3,10 +3,14 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -37,6 +41,25 @@ public class ScreenProjectController {
return new Result<ProjectDetailResultDTO>().ok(screenProjectService.projectDetail(projectDetailFormDTO));
}
/**
* @Description 中央区事件分析-项目分布
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/24 16:10
*/
@PostMapping("projectdistribution")
public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){
if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){
formDTO.setAreaCode("370124");
}
return screenProjectService.projectDistribution(formDTO);
}
@PostMapping("projectdetail")
public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){
return screenProjectService.projectDistributionDetail(formDTO);
}
/**
* 事件分析类型分析
* @author zhaoqifeng

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

@ -0,0 +1,24 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ScreenProjectDataDao {
List<ScreenProjectDistributionResultDTO> projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List<String> ids, @Param("level") String level);
List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode);
List<ScreenProjectDetailResultDTO> projectDistributionDetail(@Param("projectId") String projectId);
List<String> selectProjectImgs(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO.processDTO> selectProjectProcess(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId);
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java

@ -1,5 +1,8 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
@ -33,4 +36,7 @@ public interface ScreenProjectService {
*/
List<CategoryAnalysisResultDTO> categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO);
Result projectDistribution(ScreenProjectDistributionFormDTO formDTO);
Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO);
}

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

@ -1,16 +1,23 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -31,6 +38,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenEventDataDao screenEventDataDao;
@Autowired
private ScreenEventImgDataDao screenEventImgDataDao;
@Autowired
private ScreenProjectDataDao screenProjectDataDao;
@Autowired
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
@ -52,6 +62,43 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
return projectDetailResultDTO;
}
/**
* @Description 中央区事件分析-项目分布
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/24 15:25
*/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) {
List<String> areaIds = null;
if (StringUtils.isNotBlank(formDTO.getAreaCode())){
areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
}
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel());
return new Result().ok(resultDTOS);
}
@Override
public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) {
List<ScreenProjectDetailResultDTO> resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId());
resultDTOS.forEach(item -> {
//项目图片
List<String> imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId());
item.setImgList(imgList);
//项目处理流程
List<ScreenProjectDetailResultDTO.processDTO> processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId());
//流程附件
processDTOS.forEach(processDTO -> {
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId());
processDTO.setAttachments(attachmentDTOS);
});
item.setProcessList(processDTOS);
});
return new Result().ok(resultDTOS);
}
/**
* 事件分析类型分析
*
@ -66,4 +113,4 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId);
}
}
}

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

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao">
<!-- 查询事件 -->
<select id="projectDistribution" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO">
SELECT
IFNULL(project_title,'') AS projectTitle,
project_level AS level,
project_id AS id,
longitude AS longitude,
latitude AS latitude
FROM
screen_project_data
WHERE
del_flag = '0'
<if test="level != null">
and project_level = #{level}
</if>
<if test="ids != null">
and org_id in
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="ids == null and agencyId != null">
and org_id = #{agencyId}
</if>
</select>
<select id="selectIdsByAreaCode" resultType="java.lang.String">
select agency_id as id from screen_customer_agency where del_flag = '0' and area_code like concat(#{areaCode},'%')
union all
select dept_id as id from screen_customer_dept where del_flag = '0' and area_code like concat(#{areaCode},'%')
union all
select grid_id as id from screen_customer_grid where del_flag = '0' and area_code like concat(#{areaCode},'%')
</select>
<!-- 项目详情 -->
<select id="projectDistributionDetail" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO">
SELECT
project_id as projectId,
project_content AS projectContent,
project_create_time as reportTime,
ALL_CATEGORY_NAME as categoryName,
LINK_NAME as reportUserName,
link_mobile as mobile,
project_address as reportAddress
FROM
screen_project_data
WHERE
del_flag = '0'
AND project_id = #{projectId}
</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}
order by sort asc
</select>
<select id="selectProjectProcess" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO$processDTO">
select
process_id as processId,
HANDLER_NAME as handleDeptName,
PUBLIC_REPLY as suggestion,
PROCESS_TIME as reponseTime,
operation as operation,
TRANSFER_DEPT_NAME as whistleDeptName
from screen_project_process
where del_flag = '0'
and project_id = #{projectId}
order by process_time asc
</select>
<select id="selectProjectProcessAttachments" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO$processDTO$AttachmentDTO">
select
file_name as fileName,
attachment_name as attachmentName,
attachment_size as attachmentSize,
attachment_format as attachmentFormat,
attachment_type as attachmentType,
attachment_url as attachmentUrl,
if(duration != 0,duration,null) as duration
from screen_project_process_attachment
where del_flag = '0'
and file_place = 'public'
order by sort asc
</select>
</mapper>

172
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -0,0 +1,172 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectDataDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 原始事件Id
*/
private String projectId;
/**
* 事件名称
*/
private String projectTitle;
/**
* 事件时间
*/
private Date projectCreateTime;
/**
* 上报人
*/
private String linkName;
/**
* 电话
*/
private String linkMobile;
/**
* 事件描述
*/
private String projectContent;
/**
* 事件级别 红色1级已超期黄色2级:即将超期绿色3级未超期
*/
private Integer projectLevel;
/**
* 事件地址
*/
private String projectAddress;
/**
* 所有分类名 - 连接
*/
private String allCategoryName;
/**
* 事件所在经度
*/
private BigDecimal longitude;
/**
* 事件所在维度
*/
private BigDecimal latitude;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 事件状态key pending处理中 已结案closed_case 已关闭closed
*/
private String projectStatusCode;
/**
* 结案日期
*/
private String closeCaseTime;
/**
* 数据更新至: yyyy|yyyMM|yyyyMMdd
*/
private String dataEndTime;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
}

91
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 中央区-项目数据图片
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectImgDataDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 原始事件Id
*/
private String projectId;
/**
* 图片图片地址
*/
private String projectImgUrl;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

136
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java

@ -0,0 +1,136 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 中央区-项目数据处理节点附件表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectProcessAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 附件id
*/
private String attachmentId;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表ID
*/
private String processId;
/**
* 文件所属位置(内部备注: internal 公开答复:public)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小单位b
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

146
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java

@ -0,0 +1,146 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 中央区-项目数据项目处理进展表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectProcessDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 处理进展id
*/
private String processId;
/**
* 项目ID
*/
private String projectId;
/**
* 被流转的部门名称
*/
private String transferDeptName;
/**
* 被流转的部门名称
*/
private String transferDeptIds;
/**
* 处理者名称
*/
private String handlerName;
/**
* 处理者类型 未知unknown,机关agency,部门department,网格grid
*/
private String handlerType;
/**
* 处理者ID
*/
private String handlerId;
/**
* 所属机关11:22:33
*/
private String orgIdPath;
/**
* 回应 response结案close退回return部门流转transfer创建项目created
*/
private String operation;
/**
* 公开答复
*/
private String publicReply;
/**
* 内部备注
*/
private String internalRemark;
/**
* 处理时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date processTime;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 数据截止日期
*/
private String DataEndTime;
}

112
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java

@ -0,0 +1,112 @@
package com.epmet.dto.screen.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/23 17:30
*/
@Data
public class ScreenProjectDataInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 原始事件Id
*/
private String projectId;
/**
* 事件名称
*/
private String projectTitle;
/**
* 事件时间
*/
private String projectCreateTime;
/**
* 上报人
*/
private String linkName;
/**
* 电话
*/
private String linkMobile;
/**
* 事件描述
*/
private String projectContent;
/**
* 事件级别 红色1级已超期黄色2级:即将超期绿色3级未超期
*/
private Integer projectLevel;
/**
* 事件地址
*/
private String projectAddress;
/**
* 所有分类名 - 连接
*/
private String allCategoryName;
/**
* 事件所在经度
*/
private BigDecimal longitude;
/**
* 事件所在维度
*/
private BigDecimal latitude;
/**
* 事件状态key pending处理中 已结案closed_case 已关闭closed
*/
private String projectStatusCode;
/**
* 结案日期
*/
private String closeCaseTime;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 议题图片地址
*/
private String[] projectImgUrl;
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.screen.form;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 14:06
*/
@Data
public class ScreenProjectProcessFormDTO extends ScreenProjectProcessDTO implements Serializable{
private static final long serialVersionUID = 1L;
private List<ScreenProjectProcessAttachmentDTO> attachments;
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java

@ -3,6 +3,8 @@ package com.epmet.controller;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.screen.*;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.service.evaluationindex.screen.*;
import lombok.extern.slf4j.Slf4j;
@ -37,6 +39,10 @@ public class ScreenProjectDataCollController {
private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService;
@Autowired
private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService;
@Autowired
private ScreenProjectDataService projectDataService;
@Autowired
private ScreenProjectProcessService projectProcessService;
/**
* @author wangc
@ -125,4 +131,35 @@ public class ScreenProjectDataCollController {
return new Result();
}
//上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算
/**
* @Description 项目信息上报
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/23 17:25
*/
@RequestMapping("uploadprojectinfo")
public Result uploadProjectInfo(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param){
if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) {
throw new ValidateException("参数错误:dataList不能为空且dataId不能为空");
}
projectDataService.collect(customerId,param);
return new Result();
}
/**
* @Description 项目处理进展上报
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/23 17:25
*/
@RequestMapping("uploadprojectprocess")
public Result uploadProjectProcess(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO<ScreenProjectProcessFormDTO> param){
if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) {
throw new ValidateException("参数错误:dataList不能为空且dataId不能为空");
}
projectProcessService.collect(customerId,param);
return new Result();
}
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId);
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 中央区-项目数据图片
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenProjectImgDataDao extends BaseDao<ScreenProjectImgDataEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 中央区-项目数据处理节点附件表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenProjectProcessAttachmentDao extends BaseDao<ScreenProjectProcessAttachmentEntity> {
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java

@ -0,0 +1,35 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 中央区-项目数据项目处理进展表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenProjectProcessDao extends BaseDao<ScreenProjectProcessEntity> {
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

142
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java

@ -0,0 +1,142 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_project_data")
public class ScreenProjectDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 原始事件Id
*/
private String projectId;
/**
* 事件名称
*/
private String projectTitle;
/**
* 事件时间
*/
private String projectCreateTime;
/**
* 上报人
*/
private String linkName;
/**
* 电话
*/
private String linkMobile;
/**
* 事件描述
*/
private String projectContent;
/**
* 事件级别 红色1级已超期黄色2级:即将超期绿色3级未超期
*/
private Integer projectLevel;
/**
* 事件地址
*/
private String projectAddress;
/**
* 所有分类名 - 连接
*/
private String allCategoryName;
/**
* 事件所在经度
*/
private BigDecimal longitude;
/**
* 事件所在维度
*/
private BigDecimal latitude;
/**
* 事件状态key
*/
private String projectStatusCode;
/**
* 结案日期
*/
private String closeCaseTime;
/**
* 数据更新至: yyyy|yyyMM|yyyyMMdd
*/
private String dataEndTime;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
}

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 中央区-项目数据图片
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_project_img_data")
public class ScreenProjectImgDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 原始事件Id
*/
private String projectId;
/**
* 图片图片地址
*/
private String projectImgUrl;
/**
* 排序
*/
private Integer sort;
}

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 中央区-项目数据处理节点附件表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_project_process_attachment")
public class ScreenProjectProcessAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 附件id
*/
private String attachmentId;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表ID
*/
private String processId;
/**
* 文件所属位置(内部备注: internal 公开答复:public)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小单位b
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
}

110
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java

@ -0,0 +1,110 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 中央区-项目数据项目处理进展表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_project_process")
public class ScreenProjectProcessEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 处理进展id
*/
private String processId;
/**
* 项目ID
*/
private String projectId;
/**
* 被流转的部门名称
*/
private String transferDeptName;
/**
* 被流转的部门名称
*/
private String transferDeptIds;
/**
* 处理者名称
*/
private String handlerName;
/**
* 处理者类型 未知unknown,机关agency,部门department,网格grid
*/
private String handlerType;
/**
* 处理者ID
*/
private String handlerId;
/**
* 所属机关11:22:33
*/
private String orgIdPath;
/**
* 回应 response结案close退回return部门流转transfer创建项目created
*/
private String operation;
/**
* 公开答复
*/
private String publicReply;
/**
* 内部备注
*/
private String internalRemark;
/**
* 处理时间
*/
private Date processTime;
/**
* 数据截止日期
*/
private String DataEndTime;
}

99
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenProjectDataService extends BaseService<ScreenProjectDataEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenProjectDataDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenProjectDataDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenProjectDataDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenProjectDataDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenProjectDataDTO
* @author generator
* @date 2021-02-23
*/
ScreenProjectDataDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenProjectDataDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenProjectDataDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
void collect(String customerId, ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据图片
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenProjectImgDataService extends BaseService<ScreenProjectImgDataEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenProjectImgDataDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenProjectImgDataDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenProjectImgDataDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenProjectImgDataDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenProjectImgDataDTO
* @author generator
* @date 2021-02-23
*/
ScreenProjectImgDataDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenProjectImgDataDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenProjectImgDataDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
}

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据处理节点附件表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenProjectProcessAttachmentService extends BaseService<ScreenProjectProcessAttachmentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenProjectProcessAttachmentDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenProjectProcessAttachmentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenProjectProcessAttachmentDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenProjectProcessAttachmentDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenProjectProcessAttachmentDTO
* @author generator
* @date 2021-02-23
*/
ScreenProjectProcessAttachmentDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenProjectProcessAttachmentDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenProjectProcessAttachmentDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
}

99
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据项目处理进展表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenProjectProcessService extends BaseService<ScreenProjectProcessEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenProjectProcessDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenProjectProcessDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenProjectProcessDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenProjectProcessDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenProjectProcessDTO
* @author generator
* @date 2021-02-23
*/
ScreenProjectProcessDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenProjectProcessDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenProjectProcessDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
void collect(String customerId, ScreenCollFormDTO<ScreenProjectProcessFormDTO> param);
}

222
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -0,0 +1,222 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.*;
import com.epmet.service.evaluationindex.screen.*;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Service
public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectDataDao, ScreenProjectDataEntity> implements ScreenProjectDataService {
@Resource
private ScreenProjectImgDataDao screenProjectImgDataDao;
@Resource
private ScreenCustomerAgencyDao agencyDao;
@Resource
private ScreenCustomerDeptDao deptDao;
@Resource
private ScreenCustomerGridDao gridDao;
@Override
public PageData<ScreenProjectDataDTO> page(Map<String, Object> params) {
IPage<ScreenProjectDataEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenProjectDataDTO.class);
}
@Override
public List<ScreenProjectDataDTO> list(Map<String, Object> params) {
List<ScreenProjectDataEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenProjectDataDTO.class);
}
private QueryWrapper<ScreenProjectDataEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenProjectDataEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenProjectDataDTO get(String id) {
ScreenProjectDataEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenProjectDataDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenProjectDataDTO dto) {
ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenProjectDataDTO dto) {
ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public void collect(String customerId, ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param) {
if (param.getIsFirst()) {
int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId());
while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId());
}
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date today = new Date();
param.getDataList().forEach(item -> {
String projectStatusCode = item.getProjectStatusCode();
//todo 动态获取超时时间
//如果结案 结案时间立项时间;
if ("closed_case".equals(projectStatusCode)) {
try {
Date createTime = sdf.parse(item.getProjectCreateTime());
Date closeCaseTime = sdf.parse(item.getCloseCaseTime());
if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) {
//如果结案时间-立项时间小于等于4天 未超期 level3
item.setProjectLevel(3);
} else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) {
//如果结案时间-立项时间大于4天小于5天 即将超期 level2
item.setProjectLevel(2);
} else {
//大于5天 已超期 level1
item.setProjectLevel(1);
}
} catch (ParseException e) {
e.printStackTrace();
}
} else if ("pending".equals(projectStatusCode)) {
//如果处理中 当前时间-立项时间;
try {
Date createTime = sdf.parse(item.getProjectCreateTime());
if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) {
//如果当前时间-立项时间小于等于4天 未超期 level3
item.setProjectLevel(3);
} else if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) {
//如果当前时间-立项时间大于4天小于5天 即将超期 level2
item.setProjectLevel(2);
} else {
//大于5天 已超期 level1
item.setProjectLevel(1);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
//先删除该projectId对应的旧数据
QueryWrapper<ScreenProjectDataEntity> deleteWrapper = new QueryWrapper<>();
deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(customerId), "customer_id", customerId);
baseDao.delete(deleteWrapper);
QueryWrapper<ScreenProjectImgDataEntity> screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>();
screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(customerId), "customer_id", customerId);
screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper);
//如果orgType未知,获取一下
// if ("unknown".equals(item.getOrgType())){
// ScreenCustomerAgencyEntity screenCustomerAgencyEntity = agencyDao.selectById(item.getOrgId());
// if (screenCustomerAgencyEntity != null){
// item.setOrgType("agency");
// }else {
// ScreenCustomerDeptEntity screenCustomerDeptEntity = deptDao.selectById(item.getOrgId());
// if (screenCustomerDeptEntity!=null){
// item.setOrgType("department");
// }else {
// ScreenCustomerGridEntity screenCustomerGridEntity = gridDao.selectById(item.getOrgId());
// if (screenCustomerGridEntity != null){
// item.setOrgType("grid");
// }
// }
// }
// }
//插入项目表
ScreenProjectDataEntity screenProjectDataEntity = ConvertUtils.sourceToTarget(item, ScreenProjectDataEntity.class);
screenProjectDataEntity.setCustomerId(customerId);
screenProjectDataEntity.setDataEndTime(param.getDateId());
baseDao.insert(screenProjectDataEntity);
//插入图片表
String[] projectImgUrl = item.getProjectImgUrl();
if (ArrayUtils.isNotEmpty(projectImgUrl)) {
for (int i = 0; i < projectImgUrl.length; i++) {
ScreenProjectImgDataEntity screenProjectImgDataEntity = new ScreenProjectImgDataEntity();
screenProjectImgDataEntity.setCustomerId(customerId);
screenProjectImgDataEntity.setProjectId(item.getProjectId());
screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]);
screenProjectImgDataEntity.setSort(i);
screenProjectImgDataDao.insert(screenProjectImgDataEntity);
}
}
});
}
}

99
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据图片
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Service
public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl<ScreenProjectImgDataDao, ScreenProjectImgDataEntity> implements ScreenProjectImgDataService {
@Override
public PageData<ScreenProjectImgDataDTO> page(Map<String, Object> params) {
IPage<ScreenProjectImgDataEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenProjectImgDataDTO.class);
}
@Override
public List<ScreenProjectImgDataDTO> list(Map<String, Object> params) {
List<ScreenProjectImgDataEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenProjectImgDataDTO.class);
}
private QueryWrapper<ScreenProjectImgDataEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenProjectImgDataEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenProjectImgDataDTO get(String id) {
ScreenProjectImgDataEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenProjectImgDataDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenProjectImgDataDTO dto) {
ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenProjectImgDataDTO dto) {
ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

98
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java

@ -0,0 +1,98 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据处理节点附件表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Service
public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl<ScreenProjectProcessAttachmentDao, ScreenProjectProcessAttachmentEntity> implements ScreenProjectProcessAttachmentService {
@Override
public PageData<ScreenProjectProcessAttachmentDTO> page(Map<String, Object> params) {
IPage<ScreenProjectProcessAttachmentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenProjectProcessAttachmentDTO.class);
}
@Override
public List<ScreenProjectProcessAttachmentDTO> list(Map<String, Object> params) {
List<ScreenProjectProcessAttachmentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessAttachmentDTO.class);
}
private QueryWrapper<ScreenProjectProcessAttachmentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenProjectProcessAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenProjectProcessAttachmentDTO get(String id) {
ScreenProjectProcessAttachmentEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessAttachmentDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenProjectProcessAttachmentDTO dto) {
ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenProjectProcessAttachmentDTO dto) {
ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

156
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java

@ -0,0 +1,156 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao;
import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessDao;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 中央区-项目数据项目处理进展表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Service
public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProjectProcessDao, ScreenProjectProcessEntity> implements ScreenProjectProcessService {
@Resource
private ScreenProjectProcessAttachmentDao screenProjectProcessAttachmentDao;
@Override
public PageData<ScreenProjectProcessDTO> page(Map<String, Object> params) {
IPage<ScreenProjectProcessEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenProjectProcessDTO.class);
}
@Override
public List<ScreenProjectProcessDTO> list(Map<String, Object> params) {
List<ScreenProjectProcessEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessDTO.class);
}
private QueryWrapper<ScreenProjectProcessEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenProjectProcessEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenProjectProcessDTO get(String id) {
ScreenProjectProcessEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenProjectProcessDTO dto) {
ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenProjectProcessDTO dto) {
ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public void collect(String customerId, ScreenCollFormDTO<ScreenProjectProcessFormDTO> param) {
if (param.getIsFirst()) {
int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId());
while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId());
}
}
param.getDataList().forEach(item -> {
//先删除旧数据
QueryWrapper<ScreenProjectProcessEntity> screenProjectProcessEntityQueryWrapper = new QueryWrapper<>();
screenProjectProcessEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(customerId), "customer_id", customerId)
.eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId());
baseDao.delete(screenProjectProcessEntityQueryWrapper);
QueryWrapper<ScreenProjectProcessAttachmentEntity> screenProjectProcessAttachmentEntityQueryWrapper = new QueryWrapper<>();
screenProjectProcessAttachmentEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(customerId), "customer_id", customerId)
.eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId());
screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper);
//插入
ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class);
screenProjectProcessEntity.setCustomerId(customerId);
screenProjectProcessEntity.setDataEndTime(param.getDateId());
baseDao.insert(screenProjectProcessEntity);
List<ScreenProjectProcessAttachmentDTO> attachments = item.getAttachments();
if (!CollectionUtils.isEmpty(attachments)){
for (int i = 0; i < attachments.size(); i++) {
ScreenProjectProcessAttachmentEntity attachmentEntity = ConvertUtils.sourceToTarget(attachments.get(i), ScreenProjectProcessAttachmentEntity.class);
attachmentEntity.setCustomerId(customerId);
attachmentEntity.setProcessId(item.getProcessId());
attachmentEntity.setProjectId(item.getProjectId());
if (attachmentEntity.getSort() == null) {
attachmentEntity.setSort(i);
}
screenProjectProcessAttachmentDao.insert(attachmentEntity);
}
}
});
}
}

43
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity" id="screenProjectDataMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="orgId" column="ORG_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="orgName" column="ORG_NAME"/>
<result property="projectId" column="PROJECT_ID"/>
<result property="projectTitle" column="PROJECT_TITLE"/>
<result property="projectCreateTime" column="PROJECT_CREATE_TIME"/>
<result property="linkName" column="LINK_NAME"/>
<result property="linkMobile" column="LINK_MOBILE"/>
<result property="projectContent" column="PROJECT_CONTENT"/>
<result property="projectLevel" column="PROJECT_LEVEL"/>
<result property="projectAddress" column="PROJECT_ADDRESS"/>
<result property="allCategoryName" column="ALL_CATEGORY_NAME"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="projectStatusCode" column="PROJECT_STATUS_CODE"/>
<result property="closeCaseTime" column="CLOSE_CASE_TIME"/>
<result property="dataEndTime" column="DATA_END_TIME"/>
<result property="allParentIds" column="ALL_PARENT_IDS"/>
</resultMap>
<delete id="deleteByDateIdAndCustomerId">
delete from screen_project_data
where customer_id = #{customerId}
and DATA_END_TIME = #{dateId}
limit 1000
</delete>
</mapper>

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity" id="screenProjectImgDataMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="projectId" column="PROJECT_ID"/>
<result property="projectImgUrl" column="PROJECT_IMG_URL"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

30
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity" id="screenProjectProcessAttachmentMap">
<result property="id" column="ID"/>
<result property="attachmentId" column="ATTACHMENT_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="projectId" column="PROJECT_ID"/>
<result property="processId" column="PROCESS_ID"/>
<result property="filePlace" column="FILE_PLACE"/>
<result property="fileName" column="FILE_NAME"/>
<result property="attachmentName" column="ATTACHMENT_NAME"/>
<result property="attachmentSize" column="ATTACHMENT_SIZE"/>
<result property="attachmentFormat" column="ATTACHMENT_FORMAT"/>
<result property="attachmentType" column="ATTACHMENT_TYPE"/>
<result property="attachmentUrl" column="ATTACHMENT_URL"/>
<result property="sort" column="SORT"/>
<result property="duration" column="DURATION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenProjectProcessDao">
<delete id="deleteByDateIdAndCustomerId">
delete from screen_project_process
where customer_id = #{customerId}
and DATA_END_TIME = #{dateId}
limit 1000
</delete>
</mapper>
Loading…
Cancel
Save