Merge remote-tracking branch 'remotes/origin/test_excel610' into test
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/common/pom.xml
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LangchaoApiConstants.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/KeyPersonLabelEnum.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/DisabledPersonsDTO.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActPopulationScreenVO.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActWorkScreenVO.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
# springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/DisablePersonApi.java
# springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
# springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/biz/KeyPersonBizServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbDynDAO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/DisabledPersonsDO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/KeyPersonInfoDO.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/DisabledPersonsServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/model/dos/EventDO.java
# springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
| | |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-core</artifactId> |
| | | <version>4.0.7</version> |
| | | <version>5.6.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | |
| | | <!-- go to https://search.maven.org/search?q=tencentcloud-sdk-java and get the latest version. --> |
| | | <!-- 请到https://search.maven.org/search?q=tencentcloud-sdk-java查询所有版本,最新版本如下 --> |
| | | <version>3.1.286</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-core</artifactId> |
| | | <version>4.0.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | |
| | | { |
| | | |
| | | /** |
| | | * 将浪潮对接接口中所需的token存在Redis里面的KEY |
| | | */ |
| | | public static final String LANG_CHAO_TOKEN ="lang_chao_token"; |
| | | /** |
| | | * 获取token |
| | | */ |
| | | public static final String GRID_GET_TOKEN_URL = "http://171.217.92.33:53303/aaToken?username=#username&password=#password"; |
| | |
| | | * 通过AREAID获取辖区网格树 |
| | | */ |
| | | public static final String GRID_GET_EVENT_INFO_AREA_ID_URL = "http://171.217.92.33:53303/area/getAreaGridTreeByAreaId"; |
| | | /** |
| | | * 获取所有或者根据姓名和工号查询,分页 |
| | | */ |
| | | public static final String GRID_GET_GETALL_SEARCH_PAGE_URL = "http://171.217.92.33:53303/gridOperator/getAllOrSearchByPage?areaId=jhRxqEQp&limit=200&page=1"; |
| | | } |
| | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | * |
| | | * @author huanghongfa |
| | | * |
| | | * |
| | | * @author manaiilin |
| | | */ |
| | | @Getter |
| | | public enum KeyPersonLabelEnum |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * desc 本地事件类型和浪潮接口对应的事件类型的对应关系 |
| | | * 本地事件类型1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报 7宣传教育 |
| | | * @author manaiilin |
| | | */ |
| | | @Getter |
| | | public enum LocalEventToLangChaoEventTypeEnum |
| | | { |
| | | ZA(1, "6","治安隐患"), |
| | | GG(2, "4","公共服务"), |
| | | MD(3, "5","矛盾纠纷"), |
| | | BWD(4, "55d8def10c1344dc853b9ccf0484c06d","不稳定因素"), |
| | | TF(5, "1b62afbccc2a4bb98125f999b7133242","突发事件"), |
| | | TSRQ(6, "7da14163537b4b7e9a73ae28f4a58b72","特殊人群信息上报"), |
| | | XC(7, "9306ca7327a44b5ca474426f2da0e206","宣传教育"), |
| | | QT(8, "55d8def10c1344dc853b9ccf0484c06d","其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | private final String eventName; |
| | | |
| | | LocalEventToLangChaoEventTypeEnum(Integer code, String name,String eventName) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | this.eventName = eventName; |
| | | } |
| | | public static String getCodeByName(Integer code) { |
| | | for (LocalEventToLangChaoEventTypeEnum item : LocalEventToLangChaoEventTypeEnum.values()) { |
| | | if (item.getCode().equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return BWD.getName(); |
| | | } |
| | | public static String getEventNameByCode(Integer code) { |
| | | for (LocalEventToLangChaoEventTypeEnum item : LocalEventToLangChaoEventTypeEnum.values()) { |
| | | if (item.getCode().equals(code)) { |
| | | return item.getEventName(); |
| | | } |
| | | } |
| | | return BWD.getEventName(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.api; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 上报事件关联的文件实体对象 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-17 15:30 |
| | | **/ |
| | | @Data |
| | | public class EventFile { |
| | | /** |
| | | * 事件业务ID,本地的ID |
| | | */ |
| | | private String dataId; |
| | | /** |
| | | * 事件关联的文件对象 |
| | | */ |
| | | private String files; |
| | | /** |
| | | * 文件类型 |
| | | */ |
| | | private String fileName; |
| | | /** |
| | | * 文件类型 |
| | | */ |
| | | private String type; |
| | | /** |
| | | * 关联模块 |
| | | */ |
| | | private String module; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.api; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 上报事件实体对象 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-17 15:30 |
| | | **/ |
| | | @Data |
| | | public class EventInfo { |
| | | /** |
| | | *网格id,APP端每个网格员应该是固定的网格 |
| | | */ |
| | | private String gridId; |
| | | /** |
| | | *网格 名称 |
| | | */ |
| | | private String gridName; |
| | | /** |
| | | *事件类型code |
| | | */ |
| | | private String caseTypeCode; |
| | | /** |
| | | *事件类型名称 |
| | | */ |
| | | private String caseTypeName; |
| | | /** |
| | | *事件发生时间,时间的实际发生时间,网格员可以修改的时间 |
| | | */ |
| | | private String happenTime; |
| | | /** |
| | | *地址,手动填写或通过天地图获取的地址信息 |
| | | */ |
| | | private String happenAddress; |
| | | /** |
| | | *经度,double字符串 |
| | | */ |
| | | private String longitude; |
| | | /** |
| | | *纬度,double字符串 |
| | | */ |
| | | private String latitude; |
| | | /** |
| | | *对本次事件的描述信息 |
| | | */ |
| | | private String caseDescription; |
| | | /** |
| | | *对本次事件记录的时间,APP记录本条数据的时间,网格员自己看不到 |
| | | */ |
| | | private String caseRecordTime; |
| | | /** |
| | | *处理方式,caseReport(立即上报)、caseHandler(事件自处)、caseCache(事件暂存) |
| | | */ |
| | | private String handleType; |
| | | /** |
| | | *处理的描述信息 |
| | | */ |
| | | private String handleDescription; |
| | | /** |
| | | *APP生产的数据id,用于平台判断重复提交 |
| | | */ |
| | | private String dataId; |
| | | /** |
| | | *用户id |
| | | */ |
| | | private String userId; |
| | | /** |
| | | *处理的时间,APP点击提交的时间,并非平台接收的时间(APP可以离线使用 |
| | | */ |
| | | private String handleTime; |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String caseName; |
| | | /** |
| | | *当事人姓名 |
| | | */ |
| | | private List<PartiesBody> partiesBody =new ArrayList<>(); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.api; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 上报事件关联的网格员实体对象 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-17 15:30 |
| | | **/ |
| | | @Data |
| | | public class LcGridMember { |
| | | /** |
| | | * 网格员名字 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 网格员电话 |
| | | */ |
| | | private String contactPhone; |
| | | /** |
| | | * 网格员工号 |
| | | */ |
| | | private String jobNum; |
| | | /** |
| | | * 网格员联系电话 |
| | | */ |
| | | private String imei; |
| | | /** |
| | | * 网格员登录密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 网格员任职时间 2021-06-18 |
| | | */ |
| | | private String orgDutyDate; |
| | | /** |
| | | * 网格员责任网格 8c86b8b467194270b6b066b9c32e3b9b,a028fe8a7fff455781fa0bc3f66132fd |
| | | */ |
| | | private String select; |
| | | /** |
| | | * 网格员责任网格 8c86b8b467194270b6b066b9c32e3b9b,a028fe8a7fff455781fa0bc3f66132fd |
| | | */ |
| | | private String gridDutyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.api; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 上报事件中当事人实体对象 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-17 15:30 |
| | | **/ |
| | | @Data |
| | | public class PartiesBody { |
| | | /** |
| | | * 当事人名字 |
| | | */ |
| | | private String partyName; |
| | | /** |
| | | * 当事人电话 |
| | | */ |
| | | private String partyPhone; |
| | | } |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | * 名字 |
| | | */ |
| | | @ExcelProperty(value = "名字" ,index = 0) |
| | | @Excel(name = "姓名(必填项)", width = 20, isImportField = "true_st") |
| | | private String name; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @ExcelProperty(value = "身份证号码" ,index = 1) |
| | | @Excel(name = "身份证号码(必填项)", width = 20, isImportField = "true_st") |
| | | private String cardNo; |
| | | /** |
| | | * 残疾人证编码 |
| | | */ |
| | | @ExcelProperty(value = "残疾人证编码" ,index = 2) |
| | | @Excel(name = "残疾人证编码(必填项)", width = 20, isImportField = "true_st") |
| | | private String disableSn; |
| | | /** |
| | | * 出生年月 |
| | |
| | | * 残疾人证 |
| | | */ |
| | | @ExcelProperty(value = "残疾人证" ,index = 3) |
| | | @Excel(name = "残疾人证等级(必填项)", width = 20, isImportField = "true_st") |
| | | private String level; |
| | | /** |
| | | * 性别(取字典表国家编码) |
| | | */ |
| | | @ExcelProperty(value = "性别" ,index = 4) |
| | | @Excel(name = "性别(必填项)", width = 20, isImportField = "true_st") |
| | | private String sex; |
| | | /** |
| | | * 性别名称 |
| | |
| | | * 文化程度(取字典表国家编码)) |
| | | */ |
| | | @ExcelProperty(value = "文化程度" ,index = 5) |
| | | @Excel(name = "文化程度(必填项)", width = 20, isImportField = "true_st") |
| | | private String cultureLevel; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ExcelProperty(value = "民族" ,index = 6) |
| | | @Excel(name = "民族(必填项)", width = 20, isImportField = "true_st") |
| | | private String nation; |
| | | /** |
| | | * 残疾部位/类别 |
| | | */ |
| | | @ExcelProperty(value = "残疾部位" ,index = 7) |
| | | @Excel(name = "残疾部位(必填项)", width = 20, isImportField = "true_st") |
| | | private String disableType; |
| | | /** |
| | | * 残疾级别 |
| | | */ |
| | | @ExcelProperty(value = "残疾级别" ,index = 8) |
| | | @Excel(name = "残疾级别(必填项)", width = 20, isImportField = "true_st") |
| | | private String disableLevel; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话" ,index = 9) |
| | | @Excel(name = "联系电话(必填项)", width = 20, isImportField = "true_st") |
| | | private String phone; |
| | | /** |
| | | * 监护人联系电话 |
| | | */ |
| | | @ExcelProperty(value = "监护人联系电话" ,index =10) |
| | | @Excel(name = "监护人联系电话(必填项)", width = 20, isImportField = "true_st") |
| | | private String guardianPhone; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | @ExcelProperty(value = "地址" ,index = 11) |
| | | @Excel(name = "地址(必填项)", width = 20, isImportField = "true_st") |
| | | private String address; |
| | | /** |
| | | * 创建用户 |
| | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty("已处理") |
| | | private List<PieElementVO> deal; |
| | | @ApiModelProperty("已处理随手拍") |
| | | private List<EastPhotoTypeVO> deal; |
| | | |
| | | @ApiModelProperty("已公示") |
| | | private List<PieElementVO> pub; |
| | | @ApiModelProperty("已公示随手拍") |
| | | private List<EastPhotoTypeVO> pub; |
| | | |
| | | @ApiModelProperty("已驳回") |
| | | private List<PieElementVO> approved; |
| | | @ApiModelProperty("已审核随手拍") |
| | | private List<EastPhotoTypeVO> approved; |
| | | |
| | | @ApiModelProperty("未处理") |
| | | private Long noneDeal; |
| | |
| | | private Integer pubPoint; |
| | | |
| | | @ApiModelProperty("平均耗时") |
| | | private String dealTime; |
| | | private Integer dealTime; |
| | | |
| | | @ApiModelProperty("线形图统计时间段") |
| | | private String listTimes; |
| | | |
| | | @ApiModelProperty("随手拍线形列表") |
| | | private List<EastPhotoVO> list; |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty("实有人口文化程度统计") |
| | | private List<ComActPopulationCultureVO> cultureGroup; |
| | | |
| | | @ApiModelProperty("大屏网格数据") |
| | | private List<EventGridStatisticsVO> gridStatisticsList; |
| | | |
| | | @ApiModelProperty("小区列表数据") |
| | | private List<CivilVillageStatisticsVO> villageStatisticsList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("每天完成") |
| | | private String everyDayNum; |
| | | |
| | | @ApiModelProperty("完成总数") |
| | | private Integer totalCompleted; |
| | | |
| | | @ApiModelProperty("未完成总数") |
| | | private Integer totalNoneCompleted; |
| | | @ApiModelProperty("总完成度") |
| | | private Integer totalCompletedPoint; |
| | | |
| | | @ApiModelProperty("已完成") |
| | | private List<PieElementVO> completetList; |
| | | private List<ActWorkCountVO> completetPoint; |
| | | |
| | | @ApiModelProperty("未完成") |
| | | private List<PieElementVO> noneList; |
| | | |
| | | |
| | | private List<ActWorkCountVO> nonePoint; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 16:21 |
| | | */ |
| | | @ApiModel("随手拍饼状图") |
| | | @Data |
| | | public class EasyPhotoPointVO { |
| | | |
| | | @ApiModelProperty("类型名") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty("占比") |
| | | private Integer point; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("党员活动") |
| | | private Long activity; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String start; |
| | | @ApiModelProperty(hidden = true) |
| | | private String end; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.api.EventFile; |
| | | import com.panzhihua.common.model.dtos.api.EventInfo; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @author manailin |
| | | * desc 主要是提供给浪潮服务器上传事件 |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @FeignClient(name = "serviceApi") |
| | | public interface ApiServiceFeign { |
| | | |
| | | |
| | | /** |
| | | * description 生成或更新redis里面的对接浪潮所需的token信息 |
| | | * @param name 账号 |
| | | * @param password 密码 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("get/token") |
| | | void getToken(@RequestParam("name") String name,@RequestParam("password") String password); |
| | | /** |
| | | * description 向浪潮服务器提交网格事件登记 * |
| | | * @param eventInfo 事件信息对象 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("lc/event/upload") |
| | | void automationUpload(@RequestBody EventInfo eventInfo); |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * @param eventFile 文件对象 |
| | | * @return R 上传结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("lc/event/upload/file") |
| | | R automationUploadFile(@RequestBody EventFile eventFile); |
| | | |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "提交事件登记关联的文件或者图片信息") |
| | | @PostMapping("lc/event/upload/event_and_file") |
| | | void automationUploadEventAndFile(); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticAgeGenderDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticPartyActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.PageBigScreenStatisticPartyOrg; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.utlis.ExcelSelectObject; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @PostMapping("/elders/records/page") |
| | | R pageQueryEldersAuthRecord(@RequestBody PageEldersAuthRecordDTO pageEldersAuthElderlyDTO); |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * |
| | | * @param list 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("/key_person/batch/save") |
| | | R saveBatchKeyPerson(@RequestBody List<KeyPersonInfoDTO> list); |
| | | |
| | | |
| | | @GetMapping("/screen/population/statistic") |
| | | R statistic(@RequestParam("communityId")Long communityId); |
| | | |
| | |
| | | |
| | | @PostMapping("/elders/getAuthHistoryExport") |
| | | R getAuthHistoryExport(@RequestBody PageEldersAuthHistoryDTO pageEldersAuthElderlyDTO); |
| | | |
| | | |
| | | @GetMapping("/screen/work/neighborCircle") |
| | | R statisticNeighborCircle(@RequestParam("communityId") Long communityId); |
| | | |
| | |
| | | */ |
| | | @GetMapping("/screen/getScreenCivil") |
| | | R getScreenCivil(@RequestParam("communityId")Long communityId); |
| | | |
| | | |
| | | /** |
| | | * 大屏统计邻里圈 |
| | | */ |
| | |
| | | */ |
| | | @GetMapping("/screen/work/workCount") |
| | | R workCount(@RequestParam("communityId")Long communityId); |
| | | |
| | | |
| | | /** |
| | | * description 批量保存残疾人人员信息 |
| | | * |
| | |
| | | */ |
| | | @PostMapping("/eventgridmemberwarnlog/judge") |
| | | R timedTaskGridMember(); |
| | | |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param id 本地网格ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/lc_compare/{id}") |
| | | String getLcGridIdByLocal(@PathVariable("id") Long id); |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param localUserId 本地网格员ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/lc_compare/getLcUserId") |
| | | String getLcUserIdByLocalUserId(@RequestParam("localUserId") String localUserId); |
| | | /** |
| | | * description 获取所有未上传到浪潮平台的事件列表 |
| | | * |
| | | * @return String 事件列表 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/event/getUnUploadEvent") |
| | | List<EventDetailsVO> getUnUploadEvent(); |
| | | /** |
| | | * description 更新上传是否成功标识 |
| | | * @param id 事件主键ID |
| | | * @return Boolean 上传是否成功 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/event/updateLcUploadFlag") |
| | | Boolean updateLcUploadFlag(@RequestParam("id")Long id); |
| | | } |
| | |
| | | return date1.before(date2); |
| | | } |
| | | |
| | | public static Date getDateM(Date start, int min) { |
| | | Calendar date1 = Calendar.getInstance(); |
| | | date1.setTime(start); |
| | | date1.add(Calendar.MONTH, min); |
| | | return date1.getTime(); |
| | | } |
| | | |
| | | public static int getMonth(Date date){ |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(date); |
| | | return instance.get(Calendar.MONTH); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "导出用于导入的模板EXCEL", notes = "导出用于导入的模板EXCEL") |
| | | @GetMapping("diabled_person/export/model") |
| | | public void exportUser(HttpServletResponse response) throws IOException { |
| | | List<ExcelSelectObject> selectListObject = keyPersonBizService.defineExcelModelData(); |
| | | List<ExcelSelectObject> selectListObject = keyPersonBizService.defineDisableUserExcelModelData(); |
| | | //导出操作 |
| | | ExcelUtil.exportExcelForSelectList(Collections.emptyList(), "残疾人员信息导入模版", "残疾人员信息导入模版", KeyPersonExcelExportDto.class, "残疾人员信息导入模版.xls", selectListObject, response); |
| | | ExcelUtil.exportExcelForSelectList(Collections.emptyList(), "残疾人员信息导入模版", "残疾人员信息导入模版", DisabledPersonsDTO.class, "残疾人员信息导入模版.xls", selectListObject, response); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public List<ExcelSelectObject> definePopulationExcelModelData() { |
| | | HashMap map = new HashMap(5); |
| | | |
| | | List<String> dictNames = Arrays.asList("sex", "family", "education", "nation", "key_person_type"); |
| | | dictNames.forEach(dictName -> { |
| | | List<BcDictionaryVO> dictionaryItem = communityService.listDictionaryByKey(dictName).getData(); |
| | |
| | | excelSelectObjectList.add(new ExcelSelectObject(17, 17, (String[]) map.get("family"))); |
| | | return excelSelectObjectList; |
| | | } |
| | | |
| | | public List<ExcelSelectObject> defineDisableUserExcelModelData() { |
| | | HashMap map = new HashMap(5); |
| | | List<String> dictNames = Arrays.asList("sex", "education", "nation"); |
| | | dictNames.forEach(dictName -> { |
| | | List<BcDictionaryVO> dictionaryItem = communityService.listDictionaryByKey(dictName).getData(); |
| | | String[] dataMap = dictionaryItem.stream().map(dictionaryVO -> dictionaryVO.getDictName() + split + dictionaryVO.getDictValue()).distinct().toArray(String[]::new); |
| | | map.put(dictName, dataMap); |
| | | }); |
| | | List<ExcelSelectObject> excelSelectObjectList = new ArrayList<>(); |
| | | excelSelectObjectList.add(new ExcelSelectObject(4, 4, (String[]) map.get("sex"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(5, 5, (String[]) map.get("education"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(6, 6, (String[]) map.get("nation"))); |
| | | return excelSelectObjectList; |
| | | } |
| | | } |
| | |
| | | <module>grid_backstage</module> |
| | | <!--网格治理-基础服务service--> |
| | | <module>service_grid</module> |
| | | <!--网格治理-对接浪潮的市平台综治接口--> |
| | | <module>service_api</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>zhihuishequ</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>service_api</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>service_api</name> |
| | | <description>对接第三方接口项目</description> |
| | | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-config</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.netflix.hystrix</groupId> |
| | | <artifactId>hystrix-javanica</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-http</artifactId> |
| | | <version>5.6.7</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.panzhihua.serviceapi.ServiceApiApplication</mainClass> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>docker-maven-plugin</artifactId> |
| | | <version>1.2.0</version> |
| | | <configuration> |
| | | <imageName>registry.cn-chengdu.aliyuncs.com/panzhihua/service_api:v1</imageName> |
| | | <serverId></serverId> |
| | | <baseImage>java</baseImage> |
| | | <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint> |
| | | <resources> |
| | | <resource> |
| | | <targetPath>/</targetPath> |
| | | <directory>${project.build.directory}</directory> |
| | | <include>${project.build.finalName}.jar</include> |
| | | </resource> |
| | | </resources> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>spring-snapshots</id> |
| | | <name>Spring Snapshots</name> |
| | | <url>https://repo.spring.io/snapshot</url> |
| | | <snapshots> |
| | | <enabled>true</enabled> |
| | | </snapshots> |
| | | </repository> |
| | | <repository> |
| | | <id>spring-milestones</id> |
| | | <name>Spring Milestones</name> |
| | | <url>https://repo.spring.io/milestone</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.panzhihua.serviceapi; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.cloud.client.SpringCloudApplication; |
| | | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
| | | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目-对接第三方接口 |
| | | * description 对接浪潮市平台事件管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-18 15:30 |
| | | **/ |
| | | @EnableSwagger2 |
| | | @SpringCloudApplication |
| | | @EnableCircuitBreaker |
| | | @EnableEurekaClient |
| | | @EnableFeignClients(basePackages = {"com.panzhihua.common.service"}) |
| | | @ComponentScan({"com.panzhihua.serviceapi","com.panzhihua.common"}) |
| | | public class ServiceApiApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ServiceApiApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.aop; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.SysOperLogVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.AES; |
| | | import com.panzhihua.common.utlis.IPUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 切面处理类,操作日志异常日志记录处理 |
| | | * |
| | | * @author wu |
| | | * @date 2019/03/21 |
| | | */ |
| | | @Slf4j |
| | | @Aspect |
| | | @Component |
| | | public class OperLogAspect { |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 设置操作日志切入点 记录操作日志 在注解的位置切入代码 |
| | | */ |
| | | @Pointcut("@annotation(com.panzhihua.common.interfaces.OperLog)") |
| | | public void operLogPoinCut() { |
| | | } |
| | | |
| | | // /** |
| | | // * 设置操作异常切入点记录异常日志 扫描所有controller包下操作 |
| | | // */ |
| | | // @Pointcut("execution(* com.hyd.zcar.cms.controller..*.*(..))") |
| | | // public void operExceptionLogPoinCut() { |
| | | // } |
| | | |
| | | /** |
| | | * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param keys 返回结果 |
| | | */ |
| | | @AfterReturning(value = "operLogPoinCut()", returning = "keys") |
| | | public void saveOperLog(JoinPoint joinPoint, Object keys) { |
| | | log.info("进入切面"); |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // 登录对象信息 |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("操作日志获取登录用户信息失败【{}】",joinPoint); |
| | | return; |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo=new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(userInfo,LoginUserInfoVO.class); |
| | | |
| | | SysOperLogVO operlog = new SysOperLogVO(); |
| | | try { |
| | | |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | // 获取操作 |
| | | OperLog opLog = method.getAnnotation(OperLog.class); |
| | | if (opLog != null) { |
| | | String operModul = opLog.operModul(); |
| | | int operType = opLog.operType(); |
| | | operlog.setTitle(operModul); // 操作模块 |
| | | operlog.setBusinessType(operType); // 操作类型 |
| | | } |
| | | // 获取请求的类名 |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | // 获取请求的方法名 |
| | | String methodName = method.getName(); |
| | | methodName = className + "." + methodName; |
| | | |
| | | operlog.setMethod(methodName); // 请求方法 |
| | | |
| | | if (joinPoint.getArgs().length > 0) { |
| | | for (Object o : joinPoint.getArgs()) { |
| | | if (o instanceof HttpServletRequest || o instanceof HttpServletResponse) { |
| | | continue; |
| | | } |
| | | operlog.setOperParam(JSONObject.toJSONString(o)); // 请求参数 |
| | | } |
| | | } |
| | | |
| | | operlog.setJsonResult(JSONObject.toJSONString(keys)); // 返回结果 |
| | | operlog.setAccount(loginUserInfoVO.getAccount()); |
| | | operlog.setOperName(loginUserInfoVO.getName()); // 请求用户名称 |
| | | operlog.setOperIp(IPUtil.getIpAddress(request)); // 请求IP |
| | | operlog.setOperUrl(request.getRequestURI()); // 请求URI |
| | | operlog.setRequestMethod(request.getMethod()); |
| | | operlog.setOperLocation(IPUtil.getIpBelongAddress(request)); |
| | | operlog.setOperTime(new Date()); // 创建时间 |
| | | operlog.setAccount(loginUserInfoVO.getAccount()); |
| | | Long communityId = loginUserInfoVO.getCommunityId(); |
| | | operlog.setCommunityId(null==communityId?0:communityId); |
| | | userService.addOperLog(operlog); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行 |
| | | // * |
| | | // * @param joinPoint 切入点 |
| | | // * @param e 异常信息 |
| | | // */ |
| | | // @AfterThrowing(pointcut = "operExceptionLogPoinCut()", throwing = "e") |
| | | // public void saveExceptionLog(JoinPoint joinPoint, Throwable e) { |
| | | // // 获取RequestAttributes |
| | | // RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | // HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | // .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // |
| | | // ExceptionLog excepLog = new ExceptionLog(); |
| | | // try { |
| | | // // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | // MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // // 获取切入点所在的方法 |
| | | // Method method = signature.getMethod(); |
| | | // excepLog.setExcId(UuidUtil.get32UUID()); |
| | | // // 获取请求的类名 |
| | | // String className = joinPoint.getTarget().getClass().getName(); |
| | | // // 获取请求的方法名 |
| | | // String methodName = method.getName(); |
| | | // methodName = className + "." + methodName; |
| | | // // 请求的参数 |
| | | // Map<String, String> rtnMap = converMap(request.getParameterMap()); |
| | | // // 将参数所在的数组转换成json |
| | | // String params = JSON.toJSONString(rtnMap); |
| | | // excepLog.setExcRequParam(params); // 请求参数 |
| | | // excepLog.setOperMethod(methodName); // 请求方法名 |
| | | // excepLog.setExcName(e.getClass().getName()); // 异常名称 |
| | | // excepLog.setExcMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace())); // 异常信息 |
| | | // excepLog.setOperUserId(UserShiroUtil.getCurrentUserLoginName()); // 操作员ID |
| | | // excepLog.setOperUserName(UserShiroUtil.getCurrentUserName()); // 操作员名称 |
| | | // excepLog.setOperUri(request.getRequestURI()); // 操作URI |
| | | // excepLog.setOperIp(IPUtil.getRemortIP(request)); // 操作员IP |
| | | // excepLog.setOperVer(operVer); // 操作版本号 |
| | | // excepLog.setOperCreateTime(new Date()); // 发生异常时间 |
| | | // |
| | | // exceptionLogService.insert(excepLog); |
| | | // |
| | | // } catch (Exception e2) { |
| | | // e2.printStackTrace(); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | /** |
| | | * 转换request 请求参数 |
| | | * |
| | | * @param paramMap request获取的参数数组 |
| | | */ |
| | | public Map<String, String> converMap(Map<String, String[]> paramMap) { |
| | | Map<String, String> rtnMap = new HashMap<String, String>(); |
| | | for (String key : paramMap.keySet()) { |
| | | rtnMap.put(key, paramMap.get(key)[0]); |
| | | } |
| | | return rtnMap; |
| | | } |
| | | |
| | | private String getPostData(HttpServletRequest request) { |
| | | StringBuffer data = new StringBuffer(); |
| | | String line = null; |
| | | BufferedReader reader = null; |
| | | try { |
| | | reader = request.getReader(); |
| | | while (null != (line = reader.readLine())) |
| | | data.append(line); |
| | | } catch (IOException e) { |
| | | } finally { |
| | | } |
| | | return data.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 转换异常信息为字符串 |
| | | * |
| | | * @param exceptionName 异常名称 |
| | | * @param exceptionMessage 异常信息 |
| | | * @param elements 堆栈信息 |
| | | */ |
| | | public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) { |
| | | StringBuffer strbuff = new StringBuffer(); |
| | | for (StackTraceElement stet : elements) { |
| | | strbuff.append(stet + "\n"); |
| | | } |
| | | String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); |
| | | return message; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.api.EventFile; |
| | | import com.panzhihua.common.model.dtos.api.EventInfo; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.serviceapi.biz.LcApiService; |
| | | import com.panzhihua.serviceapi.model.dto.LcGridData; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 浪潮事件管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"浪潮事件管理API"}) |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class LcEventApi extends BaseController { |
| | | |
| | | @Resource |
| | | private LcApiService lcApiService; |
| | | |
| | | |
| | | /** |
| | | * description 向浪潮服务器提交网格事件登记 |
| | | * |
| | | * @param eventInfo 事件信息对象 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "向浪潮服务器提交网格事件登记") |
| | | @PostMapping("lc/event/upload") |
| | | public void automationUpload(@RequestBody EventInfo eventInfo) { |
| | | try { |
| | | lcApiService.submitEventRegister(eventInfo); |
| | | } catch (Exception e) { |
| | | log.error("向浪潮服务器提交网格事件登记出现错误:{}", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * |
| | | * @param eventFile 文件对象 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "提交事件登记关联的文件或者图片信息") |
| | | @PostMapping("lc/event/upload/file") |
| | | public R automationUploadFile(@RequestBody EventFile eventFile) { |
| | | return lcApiService.submitEventRelationFile(eventFile); |
| | | } |
| | | |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "提交事件登记关联的文件或者图片信息") |
| | | @PostMapping("lc/event/upload/event_and_file") |
| | | public void automationUploadEventAndFile() { |
| | | try { |
| | | lcApiService.automationUploadEventAndFile(); |
| | | } catch (Exception e) { |
| | | log.error("提交事件登记关联的文件或者图片信息出现错误:{}", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * description 获取指定事件信息 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "获取指定事件信息") |
| | | @GetMapping("lc/event/getEventInfoById") |
| | | public String getEventInfoById(String eventId) { |
| | | try { |
| | | return lcApiService.getEventInfoById(eventId); |
| | | } catch (Exception e) { |
| | | log.error("获取指定事件信息出现错误:{}", e.getMessage()); |
| | | } |
| | | return eventId; |
| | | } |
| | | |
| | | /** |
| | | * description 获取所有或者根据姓名和工号查询,分页 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "获取所有或者根据姓名和工号查询,分页") |
| | | @GetMapping("lc/event/getGridMemberListByAreaIdOrName") |
| | | public String getGridMemberListByAreaIdOrName(String eventId) { |
| | | try { |
| | | return lcApiService.getGridMemberListByAreaIdOrName(eventId); |
| | | } catch (Exception e) { |
| | | log.error("获取所有或者根据姓名和工号查询,分页出现错误:{}", e.getMessage()); |
| | | } |
| | | return eventId; |
| | | } |
| | | |
| | | /** |
| | | * description 获取指定区域网格列表 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "获取指定区域网格列表") |
| | | @GetMapping("lc/grid/list") |
| | | public List<LcGridData> getGridListByAreaId(String areaId) { |
| | | try { |
| | | return lcApiService.getGridListByAreaId(areaId); |
| | | } catch (Exception e) { |
| | | log.error("获取指定区域网格列表出现错误:{}", e.getMessage()); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.serviceapi.biz.LcApiService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description token管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"token管理API"}) |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class TokenApi extends BaseController { |
| | | |
| | | @Resource |
| | | private LcApiService lcApiService; |
| | | |
| | | |
| | | /** |
| | | * description 生成或更新redis里面的对接浪潮所需的token信息 |
| | | * |
| | | * @param name 账号 |
| | | * @param password 密码 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "生成或更新redis里面的对接浪潮所需的token信息") |
| | | @GetMapping("get/token") |
| | | public void getToken(String name, String password) { |
| | | try { |
| | | lcApiService.saveTokenFromRemoteRequest(name, password); |
| | | } catch (Exception e) { |
| | | log.error("对接浪潮接口——更新或生成token出现错误:{}", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.biz; |
| | | |
| | | import com.panzhihua.common.model.dtos.api.EventFile; |
| | | import com.panzhihua.common.model.dtos.api.EventInfo; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.serviceapi.model.dto.LcGridData; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 浪潮综治市平台网格管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | public interface LcApiService { |
| | | |
| | | /** |
| | | * description 获取token,并将token存入到redis,设置失效时间是12小时 |
| | | * 超过12个小时,重新获取token存入到redis数据库 |
| | | * |
| | | * @param name 账号 |
| | | * @param password 密码 |
| | | * @return String token |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String saveTokenFromRemoteRequest(String name, String password); |
| | | |
| | | /** |
| | | * description 获取全部的事件类型信息 |
| | | * |
| | | * @return String token |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String getAllEventTypeList(); |
| | | |
| | | /** |
| | | * description 提交事件登记 |
| | | * |
| | | * @param eventInfo 事件信息 |
| | | * @return String 上传成功或失败信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String submitEventRegister(EventInfo eventInfo); |
| | | |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * |
| | | * @param eventFile 事件信息 |
| | | * @return String 上传成功或失败信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | R submitEventRelationFile(EventFile eventFile); |
| | | |
| | | /** |
| | | * description 获取指定事件信息 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String getEventInfoById(String eventId); |
| | | |
| | | /** |
| | | * description 获取指定区域网格列表 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | List<LcGridData> getGridListByAreaId(String areaId); |
| | | |
| | | /** |
| | | * description 获取所有或者根据姓名和工号查询,分页 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 网格员列表 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String getGridMemberListByAreaIdOrName(String areaId); |
| | | |
| | | /** |
| | | * description 提交事件登记关联的文件或者图片信息 |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | void automationUploadEventAndFile(); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.biz.impl; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.panzhihua.common.api.LangchaoApiConstants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.enums.LocalEventToLangChaoEventTypeEnum; |
| | | import com.panzhihua.common.model.dtos.api.EventFile; |
| | | import com.panzhihua.common.model.dtos.api.EventInfo; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.serviceapi.biz.LcApiService; |
| | | import com.panzhihua.serviceapi.model.dto.LcGridData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 第三方浪潮市平台对接接口管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class LcApiServiceImpl implements LcApiService { |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @Autowired |
| | | private StringRedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 从redis获取token |
| | | * |
| | | * @return String 浪潮对接的token |
| | | */ |
| | | private String getAuthToken() { |
| | | ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | | if(valueOperations.get(LangchaoApiConstants.LANG_CHAO_TOKEN) ==null){ |
| | | saveTokenFromRemoteRequest("18080799023", "123456"); |
| | | } |
| | | return valueOperations.get(LangchaoApiConstants.LANG_CHAO_TOKEN); |
| | | } |
| | | |
| | | @Override |
| | | public String saveTokenFromRemoteRequest(String name, String password) { |
| | | if (redisTemplate.hasKey(LangchaoApiConstants.LANG_CHAO_TOKEN)) { |
| | | //如果redis存在token,直接返回redis存储的token |
| | | ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | | return valueOperations.get(LangchaoApiConstants.LANG_CHAO_TOKEN); |
| | | } else { |
| | | //如果第一次请求浪潮的token请求,请求完成后,保存对于的token到数据库中。便于12小时内重复调用 |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_GET_TOKEN_URL.replace("#username", name).replace("#password", password)); |
| | | HttpResponse result = request.execute(); |
| | | ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | | valueOperations.set(LangchaoApiConstants.LANG_CHAO_TOKEN, result.body(), TokenConstant.EXPIRETIME, TimeUnit.MINUTES); |
| | | return result.toString(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getAllEventTypeList() { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_EVENT_CATEGORY_URL); |
| | | request.auth(getAuthToken()); |
| | | HttpResponse result = request.execute(); |
| | | return result.body(); |
| | | } |
| | | |
| | | @Override |
| | | public String submitEventRegister(EventInfo eventInfo) { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_REGIST_EVENT_URL); |
| | | request.auth(getAuthToken()); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | //对象转map |
| | | Map m = mapper.readValue(mapper.writeValueAsString(eventInfo), Map.class); |
| | | request.form(m); |
| | | } catch (JsonProcessingException e) { |
| | | log.info("方法submitEventRegister发生错误:{}",e.getMessage()); |
| | | } |
| | | HttpResponse result = request.execute(); |
| | | log.info(result.body()); |
| | | return result.body(); |
| | | } |
| | | |
| | | @Override |
| | | public R submitEventRelationFile(EventFile eventFile) { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_EVENT_FILE_UPLOAD_URL); |
| | | request.auth(getAuthToken()); |
| | | try { |
| | | HttpURLConnection httpUrl = (HttpURLConnection) new URL(eventFile.getFiles()).openConnection(); |
| | | httpUrl.connect(); |
| | | File file = inputStreamToFile(httpUrl.getInputStream(), eventFile.getFileName()); |
| | | request.form("files", file); |
| | | httpUrl.disconnect(); |
| | | request.form("dataId", eventFile.getDataId()); |
| | | request.form("type", eventFile.getType()); |
| | | request.form("module", eventFile.getModule()); |
| | | HttpResponse result = request.execute(); |
| | | file.delete(); |
| | | return R.ok(result.body()); |
| | | } catch (Exception e) { |
| | | log.info("方法submitEventRelationFile发生错误:{}",e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public String getEventInfoById(String eventId) { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_APP_EVENT_INFO_DETAIL_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("eventId", eventId); |
| | | HttpResponse result = request.execute(); |
| | | return result.body(); |
| | | } |
| | | |
| | | @Override |
| | | public List<LcGridData> getGridListByAreaId(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_GET_EVENT_INFO_AREA_ID_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | HttpResponse result = request.execute(); |
| | | return JSONArray.parseArray(result.body(), LcGridData.class); |
| | | } |
| | | |
| | | @Override |
| | | public String getGridMemberListByAreaIdOrName(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LangchaoApiConstants.GRID_GET_GETALL_SEARCH_PAGE_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | HttpResponse result = request.execute(); |
| | | return result.body(); |
| | | } |
| | | |
| | | @Override |
| | | public void automationUploadEventAndFile() { |
| | | List<EventDetailsVO> unUploadEventList = gridService.getUnUploadEvent(); |
| | | unUploadEventList.forEach(eventInfoVo -> { |
| | | log.info("定时向浪潮服务器提交网格事件登记开始"); |
| | | EventInfo eventInfo = new EventInfo(); |
| | | String lcGrid = gridService.getLcGridIdByLocal(eventInfoVo.getGridId()); |
| | | String lcGridUserId = gridService.getLcUserIdByLocalUserId(eventInfoVo.getGridMemberId().toString()); |
| | | eventInfo.setGridId(lcGrid); |
| | | R grid = gridService.eventGridDataDetails(eventInfoVo.getGridId()); |
| | | EventGridDataDetailsVO gridData = (EventGridDataDetailsVO) grid.getData(); |
| | | eventInfo.setGridName(gridData.getGridName()); |
| | | eventInfo.setCaseTypeCode(LocalEventToLangChaoEventTypeEnum.getCodeByName(eventInfoVo.getEventType())); |
| | | eventInfo.setCaseTypeName(LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType())); |
| | | eventInfo.setHappenTime(String.valueOf(eventInfoVo.getHappenTime().getTime())); |
| | | eventInfo.setHappenAddress(eventInfoVo.getHappenAddress()); |
| | | String[] data = eventInfoVo.getHappentLatLng().split(","); |
| | | eventInfo.setLongitude(data[0]); |
| | | eventInfo.setLatitude(data[1]); |
| | | eventInfo.setCaseDescription(eventInfoVo.getEventDes()); |
| | | eventInfo.setCaseRecordTime(String.valueOf(eventInfoVo.getCreateAt().getTime())); |
| | | eventInfo.setHandleType("REPORT"); |
| | | eventInfo.setHandleDescription(eventInfoVo.getProcessDesc()); |
| | | eventInfo.setDataId(eventInfoVo.getId().toString()); |
| | | //获取系统网格员映射的浪潮网格员对于的用户ID |
| | | eventInfo.setUserId(lcGridUserId); |
| | | eventInfo.setHandleTime(String.valueOf(eventInfoVo.getHappenTime().getTime())); |
| | | eventInfo.setCaseName(eventInfoVo.getEventTitle()); |
| | | submitEventRegister(eventInfo); |
| | | log.info("定时向浪潮服务器提交网格事件登记结束"); |
| | | log.info("开始上传附件信息"); |
| | | List<EventResourceVO> picsList = eventInfoVo.getPics(); |
| | | uploadLcApiEventFile(eventInfoVo, picsList, "png"); |
| | | List<EventResourceVO> audiosList = eventInfoVo.getAudios(); |
| | | uploadLcApiEventFile(eventInfoVo, audiosList, "mp3"); |
| | | List<EventResourceVO> videoList = eventInfoVo.getVideos(); |
| | | uploadLcApiEventFile(eventInfoVo, videoList, "mp4"); |
| | | log.info("结束上传附件信息"); |
| | | gridService.updateLcUploadFlag(eventInfoVo.getId()); |
| | | }); |
| | | } |
| | | |
| | | private void uploadLcApiEventFile(EventDetailsVO eventInfoVo, List<EventResourceVO> picsList, String type) { |
| | | picsList.forEach(eventResourceVO -> { |
| | | EventFile eventFile = new EventFile(); |
| | | eventFile.setDataId(eventInfoVo.getId().toString()); |
| | | eventFile.setFiles(eventResourceVO.getUrl()); |
| | | eventFile.setType(type); |
| | | eventFile.setModule("event"); |
| | | eventFile.setFileName(eventResourceVO.getResourceName()); |
| | | submitEventRelationFile(eventFile); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 工具方法 |
| | | * inputStream 转 File |
| | | */ |
| | | public static File inputStreamToFile(InputStream ins, String name) throws Exception { |
| | | File file = new File(System.getProperty("java.io.tmpdir") + File.separator + name); |
| | | log.info(System.getProperty("java.io.tmpdir") + File.separator + name); |
| | | if (file.exists()) { |
| | | return file; |
| | | } |
| | | OutputStream os = new FileOutputStream(file); |
| | | int bytesRead; |
| | | int len = 8192; |
| | | byte[] buffer = new byte[len]; |
| | | while ((bytesRead = ins.read(buffer, 0, len)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | os.close(); |
| | | ins.close(); |
| | | return file; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.config; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: swagger3 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-19 16:08 |
| | | **/ |
| | | @Configuration |
| | | public class SwaggerConfig { |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("社区后台管理接口") |
| | | .description("。") |
| | | .contact(new Contact("Ray。", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.serviceapi.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 浪潮接口返回的网格数据接口,网格按照区域层级展开 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-22 15:30 |
| | | **/ |
| | | @Data |
| | | public class LcGridData { |
| | | |
| | | private String id; |
| | | private String title; |
| | | private String level; |
| | | private String other; |
| | | private String other4; |
| | | private String name; |
| | | private String open; |
| | | private String checked; |
| | | private String count; |
| | | private String pid; |
| | | private List<LcGridData> children = new ArrayList<>(); |
| | | } |
New file |
| | |
| | | spring: |
| | | application: |
| | | name: serviceApi |
| | | cloud: |
| | | config: |
| | | discovery: |
| | | enabled: true |
| | | service-id: config # 注册中心的服务名 |
| | | profile: ${ENV:dev} # 指定配置文件的环境 |
| | | uri: http://${CONFIG_URL:localhost}:8193/ |
| | | profiles: |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: |
| | | defaultZone: http://${EUREKA_URL:localhost}:8192/eureka |
| | | server: |
| | | port: 8065 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration debug="false"> |
| | | <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> |
| | | <springProfile name="dev"> |
| | | <property name="LOG_HOME" value="F:/log" /> |
| | | </springProfile> |
| | | <springProfile name="test"> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | </springProfile> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | <!-- 控制台输出 --> |
| | | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | </appender> |
| | | <!-- 按照每天生成日志文件 --> |
| | | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!--日志文件输出的文件名--> |
| | | <FileNamePattern>${LOG_HOME}/community_backstage.log.%d{yyyy-MM-dd}.log</FileNamePattern> |
| | | <!--日志文件保留天数--> |
| | | <MaxHistory>30</MaxHistory> |
| | | </rollingPolicy> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | <!--日志文件最大的大小--> |
| | | <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
| | | <MaxFileSize>10MB</MaxFileSize> |
| | | </triggeringPolicy> |
| | | </appender> |
| | | |
| | | <!--myibatis log configure--> |
| | | <logger name="com.apache.ibatis" level="TRACE"/> |
| | | <logger name="java.sql.Connection" level="DEBUG"/> |
| | | <logger name="java.sql.Statement" level="DEBUG"/> |
| | | <logger name="java.sql.PreparedStatement" level="DEBUG"/> |
| | | <logger name="com.panzhihua.community_backstage" level="DEBUG"/> |
| | | |
| | | <!-- 日志输出级别 --> |
| | | <root level="DEBUG"> |
| | | <appender-ref ref="STDOUT" /> |
| | | </root> |
| | | <root level="INFO"> |
| | | <appender-ref ref="STDOUT" /> |
| | | <appender-ref ref="FILE" /> |
| | | </root> |
| | | </configuration> |
New file |
| | |
| | | package com.panzhihua.service_api.biz.impl; |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.panzhihua.common.enums.LocalEventToLangChaoEventTypeEnum; |
| | | import com.panzhihua.common.model.dtos.api.EventFile; |
| | | import com.panzhihua.common.model.dtos.api.EventInfo; |
| | | import com.panzhihua.common.model.dtos.api.PartiesBody; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import com.panzhihua.common.service.api.ApiServiceFeign; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.serviceapi.ServiceApiApplication; |
| | | import com.panzhihua.serviceapi.biz.LcApiService; |
| | | import com.panzhihua.serviceapi.model.dto.LcGridData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceApiApplication.class) |
| | | class LcApiServiceImplTest { |
| | | |
| | | @Autowired |
| | | private LcApiService lcApiService; |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @Resource |
| | | private ApiServiceFeign ApiServiceFeign; |
| | | |
| | | @Test |
| | | void saveTokenFromRemoteRequest() { |
| | | String result = lcApiService.saveTokenFromRemoteRequest("18080799023", "123456"); |
| | | log.info(JSONObject.toJSONString(result)); |
| | | } |
| | | |
| | | @Test |
| | | void getAllEventTypeList() { |
| | | String result = lcApiService.getAllEventTypeList(); |
| | | log.info(result); |
| | | } |
| | | |
| | | @Test |
| | | void submitEventRegister() { |
| | | EventInfo eventInfo = new EventInfo(); |
| | | eventInfo.setGridId("8c86b8b467194270b6b066b9c32e3b9b"); |
| | | eventInfo.setGridName("金沙社区网格1"); |
| | | eventInfo.setCaseTypeCode("04e0506d78884d218050a4c89a2e34c3"); |
| | | eventInfo.setCaseTypeName("18080799023"); |
| | | eventInfo.setHappenTime(String.valueOf(DateUtils.getCurrentDataLong())); |
| | | eventInfo.setHappenAddress("四川省攀枝花市"); |
| | | eventInfo.setLongitude("116.397128"); |
| | | eventInfo.setLatitude("39.916527"); |
| | | eventInfo.setCaseDescription("描述"); |
| | | eventInfo.setCaseRecordTime(String.valueOf(DateUtils.getCurrentDataLong())); |
| | | eventInfo.setHandleType("REPORT"); |
| | | eventInfo.setHandleDescription("处理描述"); |
| | | String dataID = String.valueOf(RandomUtil.randomLong(20)); |
| | | log.info("random:" + dataID); |
| | | eventInfo.setDataId(dataID); |
| | | eventInfo.setUserId("3e318dbeddc048328933d8b4ca759a36"); |
| | | eventInfo.setHandleTime(String.valueOf(DateUtils.getCurrentDataLong())); |
| | | eventInfo.setCaseName("测试标题17"); |
| | | List<PartiesBody> partiesBody = new ArrayList<>(); |
| | | PartiesBody partiesBody1 = new PartiesBody(); |
| | | partiesBody1.setPartyName("测试见证人"); |
| | | partiesBody1.setPartyPhone("17345623565"); |
| | | partiesBody.add(partiesBody1); |
| | | eventInfo.setPartiesBody(partiesBody); |
| | | String result = lcApiService.submitEventRegister(eventInfo); |
| | | log.info(result); |
| | | } |
| | | |
| | | @Test |
| | | void submitEventRelationFile() throws URISyntaxException { |
| | | EventFile eventFile = new EventFile(); |
| | | eventFile.setDataId("1111116"); |
| | | //eventFile.setFiles("https://www.baidu.com/img/flexible/logo/pc/result@2.png"); |
| | | eventFile.setFiles("http://image.panzhihua.nhys.cdnhxx.com//idcard/4f843ad2d756456e900d5f24b419aa7c.mp4"); |
| | | eventFile.setType("mp4"); |
| | | eventFile.setModule("event"); |
| | | eventFile.setFileName("4f843ad2d756456e900d5f24b419aa7c.mp4"); |
| | | R result = lcApiService.submitEventRelationFile(eventFile); |
| | | log.info(JSONObject.toJSONString(result)); |
| | | } |
| | | |
| | | @Test |
| | | void submitEventRegisterJobTest() { |
| | | log.info("定时向浪潮服务器提交网格事件登记开始"); |
| | | R<EventDetailsVO> event = gridService.eventDetails(1111113L); |
| | | EventDetailsVO eventInfoVo = event.getData(); |
| | | EventInfo eventInfo = new EventInfo(); |
| | | String lcGrid = gridService.getLcGridIdByLocal(eventInfoVo.getGridId()); |
| | | String lcGridUserId = gridService.getLcUserIdByLocalUserId(eventInfoVo.getGridMemberId().toString()); |
| | | eventInfo.setGridId(lcGrid); |
| | | R grid = gridService.eventGridDataDetails(eventInfoVo.getGridId()); |
| | | EventGridDataDetailsVO gridData = (EventGridDataDetailsVO) grid.getData(); |
| | | eventInfo.setGridName(gridData.getGridName()); |
| | | eventInfo.setCaseTypeCode(LocalEventToLangChaoEventTypeEnum.getCodeByName(eventInfoVo.getEventType())); |
| | | eventInfo.setCaseTypeName(LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType())); |
| | | eventInfo.setHappenTime(String.valueOf(eventInfoVo.getHappenTime().getTime())); |
| | | eventInfo.setHappenAddress(eventInfoVo.getHappenAddress()); |
| | | String[] data = eventInfoVo.getHappentLatLng().split(","); |
| | | eventInfo.setLongitude(data[0]); |
| | | eventInfo.setLatitude(data[1]); |
| | | eventInfo.setCaseDescription(eventInfoVo.getEventDes()); |
| | | eventInfo.setCaseRecordTime(String.valueOf(eventInfoVo.getCreateAt().getTime())); |
| | | eventInfo.setHandleType("REPORT"); |
| | | eventInfo.setHandleDescription(eventInfoVo.getProcessDesc()); |
| | | eventInfo.setDataId(eventInfoVo.getId().toString()); |
| | | //获取系统网格员映射的浪潮网格员对于的用户ID |
| | | eventInfo.setUserId(lcGridUserId); |
| | | eventInfo.setHandleTime(String.valueOf(eventInfoVo.getHappenTime().getTime())); |
| | | eventInfo.setCaseName(eventInfoVo.getEventTitle()); |
| | | lcApiService.submitEventRegister(eventInfo); |
| | | log.info("定时向浪潮服务器提交网格事件登记结束"); |
| | | log.info("开始上传附件图片信息"); |
| | | List<EventResourceVO> picsList = eventInfoVo.getPics(); |
| | | picsList.forEach(eventResourceVO -> { |
| | | EventFile eventFile = new EventFile(); |
| | | eventFile.setDataId(eventInfoVo.getId().toString()); |
| | | eventFile.setFiles(eventResourceVO.getUrl()); |
| | | eventFile.setType("png"); |
| | | eventFile.setModule("event"); |
| | | eventFile.setFileName(eventResourceVO.getResourceName()); |
| | | lcApiService.submitEventRelationFile(eventFile); |
| | | }); |
| | | List<EventResourceVO> audiosList = eventInfoVo.getAudios(); |
| | | audiosList.forEach(eventResourceVO -> { |
| | | EventFile eventFile = new EventFile(); |
| | | eventFile.setDataId(eventInfoVo.getId().toString()); |
| | | eventFile.setFiles(eventResourceVO.getUrl()); |
| | | eventFile.setType("mp3"); |
| | | eventFile.setModule("event"); |
| | | eventFile.setFileName(eventResourceVO.getResourceName()); |
| | | lcApiService.submitEventRelationFile(eventFile); |
| | | }); |
| | | List<EventResourceVO> videoList = eventInfoVo.getVideos(); |
| | | videoList.forEach(eventResourceVO -> { |
| | | EventFile eventFile = new EventFile(); |
| | | eventFile.setDataId(eventInfoVo.getId().toString()); |
| | | eventFile.setFiles(eventResourceVO.getUrl()); |
| | | eventFile.setType("mp4"); |
| | | eventFile.setModule("event"); |
| | | eventFile.setFileName(eventResourceVO.getResourceName()); |
| | | lcApiService.submitEventRelationFile(eventFile); |
| | | }); |
| | | log.info("结束上传附件图片信息"); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void getGridListByAreaId() { |
| | | //jhRxqEQp 代表西区 |
| | | List<LcGridData> list = lcApiService.getGridListByAreaId("jhRxqEQp"); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.service_community.service.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | /** |
| | | * 小程序用户车辆登记 |
| | | * |
| | | * @param comCvtBusinessDTO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 小程序用户车辆列表 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台车辆管理列表 |
| | | * |
| | | * @param pageComMngCarDTO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台添加修改车辆 |
| | | * |
| | | * @param comMngCarSaveDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/save") |
| | | public R saveComMngCar(@Validated({AddGroup.class}) @RequestBody ComMngCarSaveDTO comMngCarSaveDTO) { |
| | | public R saveComMngCar(@Validated({AddGroup.class}) @RequestBody ComMngCarSaveDTO comMngCarSaveDTO) { |
| | | return comMngCarService.saveComMngCar(comMngCarSaveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台删除车辆 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | public R deleteComMngCar(@RequestParam(value = "id") Long id) { |
| | | return comMngCarService.deleteComMngCar(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台导入车辆 |
| | | * @param list 车辆列表 |
| | | * |
| | | * @param list 车辆列表 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/import") |
| | | public R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comMngCarService.listSaveMngCarExcelVO(list,communityId); |
| | | public R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list, @RequestParam("communityId") Long communityId) { |
| | | return comMngCarService.listSaveMngCarExcelVO(list, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台实有单位管理列表 |
| | | * |
| | | * @param pageComMngRealCompanyDTO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台添加修改实有单位 |
| | | * |
| | | * @param comMngRealCompanyVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台删除实有单位 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | public R belongsComMngRealCompany(@RequestBody ComMngRealCompanyBelongsDTO comMngRealCompanyBelongsDTO) { |
| | | return comMngRealCompanyService.belongsComMngRealCompany(comMngRealCompanyBelongsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台导入实有单位 |
| | | * @param list 车实有单位列表 |
| | | * |
| | | * @param list 车实有单位列表 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/import") |
| | | public R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comMngRealCompanyService.listSaveMngRealCompanyExcelVO(list,communityId); |
| | | public R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list, @RequestParam("communityId") Long communityId) { |
| | | return comMngRealCompanyService.listSaveMngRealCompanyExcelVO(list, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 导出实有单位 |
| | | * |
| | | * @param exportRealCompanyExcelDTO 实有单位导出查询参数 |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/export") |
| | | public R exportRealCompanyExcel(@RequestBody ExportRealCompanyExcelDTO exportRealCompanyExcelDTO ){ |
| | | public R exportRealCompanyExcel(@RequestBody ExportRealCompanyExcelDTO exportRealCompanyExcelDTO) { |
| | | return comMngRealCompanyService.exportRealCompanyExcel(exportRealCompanyExcelDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 社区后台实有资产管理列表 |
| | | * |
| | | * @param pageComMngRealAssetsDTO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台添加修改实有资产 |
| | | * |
| | | * @param comMngRealAssetsVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台删除实有资产 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区后台导入实有资产 |
| | | * @param list 车实有资产列表 |
| | | * |
| | | * @param list 车实有资产列表 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/assets/import") |
| | | public R listSaveMngRealAssetsExcelVO(@RequestBody List<ComMngRealAssetsExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comMngRealAssetsService.listSaveMngRealAssetsExcelVO(list,communityId); |
| | | public R listSaveMngRealAssetsExcelVO(@RequestBody List<ComMngRealAssetsExcelVO> list, @RequestParam("communityId") Long communityId) { |
| | | return comMngRealAssetsService.listSaveMngRealAssetsExcelVO(list, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 导出实有资产 |
| | | * |
| | | * @param exportRealAssetsExcelDTO 实有资产导出查询参数 |
| | | * @return |
| | | */ |
| | | @PostMapping("/assets/export") |
| | | public R exportRealAssetsExcel(@RequestBody ExportRealAssetsExcelDTO exportRealAssetsExcelDTO ){ |
| | | public R exportRealAssetsExcel(@RequestBody ExportRealAssetsExcelDTO exportRealAssetsExcelDTO) { |
| | | return comMngRealAssetsService.exportRealAssetsExcel(exportRealAssetsExcelDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有省份 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/province") |
| | |
| | | |
| | | /** |
| | | * 查询省份下所有的城市 |
| | | * |
| | | * @param provinceAdcode |
| | | * @return |
| | | */ |
| | | @GetMapping("/city") |
| | | public R getCityByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode){ |
| | | public R getCityByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode) { |
| | | return comMngProvinceService.getCityByProvinceCode(provinceAdcode); |
| | | } |
| | | |
| | | /** |
| | | * 查询城市下所有的区县 |
| | | * |
| | | * @param cityAdcode |
| | | * @return |
| | | */ |
| | | @GetMapping("/district") |
| | | R getDistrictByCityCode(@RequestParam(value = "cityAdcode") Integer cityAdcode){ |
| | | R getDistrictByCityCode(@RequestParam(value = "cityAdcode") Integer cityAdcode) { |
| | | return comMngProvinceService.getDistrictByCityCode(cityAdcode); |
| | | } |
| | | |
| | | /** |
| | | * 查询特定省下所有区域 tree结构 |
| | | * |
| | | * @param provinceAdcode |
| | | * @return |
| | | */ |
| | | @GetMapping("/area/all") |
| | | R getCityTreeByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode){ |
| | | R getCityTreeByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode) { |
| | | return comMngProvinceService.getCityTreeByProvinceCode(provinceAdcode); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台实有人口管理列表 |
| | | * |
| | | * @param comMngPopulationVO 查询参数 |
| | | * @return 实有人口分页查询结果 |
| | | * @return 实有人口分页查询结果 |
| | | */ |
| | | @PostMapping("/population/page") |
| | | public R pagePopulation(@RequestBody ComMngPopulationDTO comMngPopulationVO) { |
| | |
| | | |
| | | /** |
| | | * 社区后台导入实有人口 |
| | | * @param list 数据 |
| | | * |
| | | * @param list 数据 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/import") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId) throws Exception{ |
| | | return comMngPopulationService.listSavePopulation(list,communityId); |
| | | public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId) throws Exception { |
| | | return comMngPopulationService.listSavePopulation(list, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | * |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/population/import/confirm") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulationConfirm(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){ |
| | | return comMngPopulationService.listSavePopulationConfirm(list,communityId); |
| | | public R listSavePopulationConfirm(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId) { |
| | | return comMngPopulationService.listSavePopulationConfirm(list, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 根据实有人口id查询详情 |
| | | * |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口详情查询结果 |
| | | * @return 实有人口详情查询结果 |
| | | */ |
| | | @PostMapping("/population/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | * |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | @PostMapping("/population/electronicArchives") |
| | | public R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | |
| | | |
| | | /** |
| | | * 根据实有人口id修改标签列表 |
| | | * |
| | | * @param populationTagDTO 请求参数 |
| | | * @return 修改结果 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/population/editTag") |
| | | public R editTagPopulation(@RequestBody ComMngPopulationTagDTO populationTagDTO) { |
| | |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * @param Ids 删除id集合 |
| | | * @return 删除结果 |
| | | * |
| | | * @param Ids 删除id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/population/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids) { |
| | |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/population/getAll") |
| | | public R getPopulationListByCommunityId(@RequestParam(value = "communityId") Long communityId) { |
| | |
| | | |
| | | /** |
| | | * 根据id集合查询实有人口 |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | * |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/population/getList") |
| | | public R getPopulationLists(@RequestBody List<Long> Ids) { |
| | |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * |
| | | * @param populationEditDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/edit") |
| | | R editPopulation(@RequestBody ComMngPopulationEditDTO populationEditDTO,@RequestParam("communityId") Long communityId) throws Exception{ |
| | | R editPopulation(@RequestBody ComMngPopulationEditDTO populationEditDTO, @RequestParam("communityId") Long communityId) throws Exception { |
| | | return comMngPopulationService.editPopulation(populationEditDTO, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询特殊群体 |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | * |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | */ |
| | | @PostMapping("/special/page") |
| | | public R specialInputUser(@RequestBody PageInputUserDTO pageInputUserDTO) { |
| | |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | * |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/special/delete") |
| | | public R deleteSpecialInputUser(@RequestParam(value = "id") Long id){ |
| | | public R deleteSpecialInputUser(@RequestParam(value = "id") Long id) { |
| | | return comMngPopulationService.deleteSpecialInputUser(id); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有人口_电子档案 |
| | | * |
| | | * @param userElectronicFileVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/edit/electronicArchives") |
| | | R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO){ |
| | | R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO) { |
| | | return comMngPopulationService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/population/statistics") |
| | | public R getPopulationTotalByAdmin(@RequestParam("communityId") Long communityId) { |
| | |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | * |
| | | * @param cascadeHouseDTO 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | @PostMapping("/population/cascade/list") |
| | | public R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO){ |
| | | public R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO) { |
| | | return comMngPopulationHouseService.getCascadeHouseAddress(cascadeHouseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询房屋列表 |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | * |
| | | * @param populationHouseAdminDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | @PostMapping("/population/page/house") |
| | | public R getPageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO){ |
| | | public R getPageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO) { |
| | | return comMngPopulationHouseService.getPageHouse(populationHouseAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询实有房屋信息 |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | * |
| | | * @param houseId 房屋id |
| | | * @return 房屋信息 |
| | | */ |
| | | @PostMapping("/population/house/detail") |
| | | public R getHouseDetail(@RequestParam(value = "houseId") Long houseId) { |
| | |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * |
| | | * @param houseEditAdminDTO 请求参数 |
| | | * @return 编辑结果 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/population/house/edit") |
| | | public R editHouse(@RequestBody ComMngPopulationHouseEditAdminDTO houseEditAdminDTO) { |
| | |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | * |
| | | * @param Ids 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/population/house/delete") |
| | | public R deleteHouses(@RequestBody List<Long> Ids){ |
| | | public R deleteHouses(@RequestBody List<Long> Ids) { |
| | | return comMngPopulationHouseService.deleteHouses(Ids); |
| | | } |
| | | |
| | | /** |
| | | * 实有房屋统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/population/house/statistics") |
| | | public R getHouseTotalByAdmin(@RequestParam("communityId") Long communityId) { |
| | |
| | | |
| | | /** |
| | | * 根据社区id查询社区所有省市区 |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 社区所在省市区 |
| | | */ |
| | | @PostMapping("/village/getRegion") |
| | | public R getRegion(@RequestParam("communityId") Long communityId) { |
| | |
| | | |
| | | /** |
| | | * 统计社区内小区数量 |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计小区数量 |
| | | */ |
| | | @PostMapping("/village/statistics") |
| | | public R villageStatistics(@RequestParam("communityId") Long communityId) { |
| | |
| | | private ScreenWorkService screenWorkService; |
| | | |
| | | /** |
| | | * |
| | | * 大屏统计邻里圈 |
| | | * 状态-显示(2) |
| | | * 本月新增-显示(2) |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计心愿单, |
| | | * 累计实现-已完成(6) |
| | | * 等待实现-非已完成(1、2、3、4、5) |
| | | * 本月新增-所有状态(1、2、3、4、5、6) |
| | | * 大屏统计心愿单 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 大屏统计社区活动 |
| | | * 状态:报名中(3)、进行中(4)、已结束(5) |
| | | * 本月新增:报名中(3)、进行中(4)、已结束(5) |
| | | * 志愿者活动-参与者人数上限为0 |
| | | * 居民活动-参与者人数上限>0 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 大屏统计一起议 |
| | | * 参与人数-点赞、评论、评论点赞 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 大屏统计党建工作 |
| | | * 党员活动:报名中(3)、进行中(4)、已结束(5) |
| | | * 党员宣传(党员动态): |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 大屏统计随手拍 |
| | | * 新增的-所有状态 |
| | | * 已处理-3已驳回 4已完成 |
| | | * 已公示-4已完成 |
| | | * 未公示-3已驳回 |
| | | * 未处理-1待审核 |
| | | * 公示比例-已公示/(已公示+已驳回) |
| | | * 平均耗时-创建时间至反馈时间(已完成状态) |
| | | * 线形图-随手拍数量-累计 |
| | | * 线形图-新增随手拍-时间段新增 |
| | | * 线形图-处理随手拍-时间段(已驳回和已完成) |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | |
| | | "\t\tAND a.community_id =#{communityId}") |
| | | CommunityActivitiesVO selectCommunityActivitiesVO(@Param("communityId") Long communityId, @Param("date")Date date); |
| | | |
| | | @Select("SELECT COUNT(id) AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max > 0)AS commonNum," + |
| | | "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.participant_max > 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + |
| | | @Select("SELECT COUNT(id) AS totalNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%'))AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND volunteer_max = 0)AS commonNum," + |
| | | "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.volunteer_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max = 0)AS volunteerNum," + |
| | | "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.community_id=#{communityId} AND a.participant_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5))AS volunteerPeopleNum" + |
| | | " FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%') ") |
| | | " FROM com_act_activity where community_id=#{communityId} AND (status = 3 OR status = 4 OR status = 5)") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT id,activity_name as content,IF(participant_max = 0,'志愿者活动','居民活动') AS typeName FROM com_act_activity " + |
| | | @Select("SELECT id,activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + |
| | | "WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) ORDER BY create_at DESC LIMIT #{pageSize}") |
| | | List<CarouselInfoVO> screenActivity(@Param("communityId")Long communityId, @Param("pageSize")Integer pageSize); |
| | | |
| | | @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5)") |
| | | @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId}") |
| | | List<String> listImg(@Param("communityId")Long communityId); |
| | | } |
| | |
| | | "GROUP BY d.id") |
| | | ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId); |
| | | |
| | | @Select(" SELECT COUNT(id) AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 1)AS imgNum," + |
| | | @Select(" SELECT COUNT(id) AS totalNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%'))AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND TYPE = 1)AS imgNum," + |
| | | "(" + |
| | | "SELECT COUNT(DISTINCT(user_id)) FROM (" + |
| | | " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | |
| | | " UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | | ")d " + |
| | | ")AS imgPeopleNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 2)AS voteNum," + |
| | | ")AS commonPeopleNum," + |
| | | "(" + |
| | | "SELECT COUNT(DISTINCT(user_id)) FROM (" + |
| | | " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | |
| | | " UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | | ")d " + |
| | | ")AS votePeopleNum " + |
| | | " FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%')") |
| | | ")AS volunteerPeopleNum " + |
| | | " FROM com_act_discuss") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId, @Param("date")String date); |
| | | |
| | | @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.model.vos.screen.EastPhotoTypeVO; |
| | | import com.panzhihua.common.model.vos.screen.EastPhotoVO; |
| | | import com.panzhihua.common.model.vos.screen.EasyPhotoDataVO; |
| | | import com.panzhihua.common.model.vos.screen.PbWorkVO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | IPage<ComActEasyPhotoVO> pageEasyPhotoApplets(Page page, @Param("comActEasyPhotoVO")ComActEasyPhotoVO comActEasyPhotoVO); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 1 " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.handle_status = 1 AND p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | List<PieElementVO> countDeal(@Param("communityId")Long communityId); |
| | | List<EastPhotoTypeVO> countDeal(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 4 " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.is_publicity = 1 AND p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | List<PieElementVO> countPub(@Param("communityId")Long communityId); |
| | | List<EastPhotoTypeVO> countPub(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id and p.community_id = #{communityId} AND p.status = 3 " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.status = 4 where p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | List<PieElementVO> countApproved(@Param("communityId")Long communityId); |
| | | List<EastPhotoTypeVO> countApproved(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id) AS noneDeal," + |
| | | "(" + |
| | | "SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = 2 AND create_at LIKE concat(#{nowDate},'%') " + |
| | | ") AS currentNum," + |
| | | "(" + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND status = 4 )*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} and (status = 3 or status = 4)) " + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 AND handle_status = 2)*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND handle_status = 2) " + |
| | | ") AS pubPoint," + |
| | | "(SELECT AVG(TIMESTAMPDIFF(MINUTE,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and status = 4 ) AS dealTime " + |
| | | "FROM com_act_easy_photo where community_id = #{communityId} and status = 1 ") |
| | | "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and handle_status = 2 ) AS dealTime " + |
| | | "FROM com_act_easy_photo where community_id = #{communityId}") |
| | | Map<String, Object> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate") String nowDate); |
| | | |
| | | @Select("SELECT COUNT(id) AS total, " + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ) AS adds, " + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND (status = 3 or status = 4) AND #{start} < create_at and create_at < #{end}) AS deal " + |
| | | "FROM com_act_easy_photo WHERE community_id = #{communityId} AND create_at < #{end} ") |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND handle_status = 2 AND #{start} < create_at and create_at < #{end}) AS deal " + |
| | | "FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ") |
| | | EastPhotoVO countByTime(@Param("start")String start, @Param("end")String end, @Param("nowDate")String nowDate, @Param("communityId")Long communityId); |
| | | } |
| | |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | @Select("SELECT COUNT(id) AS completedNum," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 4 OR status = 5)) AS willNum ," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | "FROM com_act_micro_wish WHERE community_id = #{communityId} AND status = 6 ") |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate); |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActNeighborCircleScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.PieElementVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | " where reply.comment_id = #{commentId} and reply.status = 1") |
| | | IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); |
| | | |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and status = 2 ORDER BY create_at DESC limit #{pageSize}") |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and(status = 2 or status = 3) ORDER BY create_at DESC limit #{pageSize}") |
| | | List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," + |
| | | " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2 AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2") |
| | | " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND (status = 2 OR status = 3) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 ") |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) ") |
| | | Map<String, Object> sumScreenNum(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 order by create_at desc limit #{pageSize}") |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") |
| | | List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = #{communityId} AND STATUS = 6 " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = #{communityId} " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND STATUS = 2 " + |
| | | "UNION ALL " + |
| | | "SELECT (SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND STATUS = 5)+(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2) as num, '党建工作' as name FROM DUAL " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'社区活动' as name FROM com_act_activity WHERE community_id = #{communityId} AND STATUS = 5 ") |
| | | List<PieElementVO> countAllCompletedWorkByCommunityId(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2) " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = #{communityId} " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND STATUS = 1 " + |
| | | "UNION ALL " + |
| | | "SELECT (SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) )+(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 1) as num ,'党建工作' as name FROM DUAL " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id),'社区活动' as name FROM com_act_activity WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) ") |
| | | List<PieElementVO> countAllNoneCompletedWorkByCommunityId(@Param("communityId")Long communityId); |
| | | |
| | | @Select(" SELECT AVG(b.t)AS avgTime " + |
| | | " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + |
| | | " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + |
| | | " )AS b ") |
| | | Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); |
| | | } |
| | |
| | | public interface ComPbDynDAO { |
| | | |
| | | @Select("SELECT COUNT(id) AS activityNum ," + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND dyn_type = 1 AND STATUS = 2) AS dynNum," + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2) AS dynNum," + |
| | | "(" + |
| | | " (SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 3 or STATUS = 4 or STATUS = 5 ) AND create_at LIKE CONCAT(#{nowDate},'%')) + " + |
| | | " (SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2 AND create_at LIKE CONCAT(#{nowDate},'%'))" + |
| | |
| | | |
| | | @Select("SELECT " + |
| | | "(SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 3 or STATUS = 4 or STATUS = 5 ) AND #{start} < create_at AND create_at < #{end}) AS activity," + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND dyn_type = 1 AND STATUS = 2 AND #{start} < create_at AND create_at < #{end}) AS dyn " + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2 AND #{start} < create_at AND create_at < #{end}) AS dyn " + |
| | | "FROM DUAL") |
| | | PbWorkVO countByTime(@Param("start")String start,@Param("end")String end, @Param("communityId")Long communityId); |
| | | } |
| | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | /** |
| | | * 监护人联系电话 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String guardianPhone; |
| | | /** |
| | | * 地址 |
| | |
| | | /** |
| | | * 户口所在地 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String censusRegister; |
| | | /** |
| | | * 居住地址 |
| | |
| | | /** |
| | | * (法轮功类填写)基本情况 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String basicInfo; |
| | | /** |
| | | * 是否有效 |
| | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String note; |
| | | /** |
| | | * 文化程度(取字典表国家编码)) |
| | |
| | | /** |
| | | * (精神类人群填写)目前诊断 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String diagnose; |
| | | /** |
| | | * 上报提交时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date submitDate; |
| | | /** |
| | | * (精神类人群填写)监护人名称 |
| | |
| | | /** |
| | | * (精神类人群填写)监护人电话 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String guardianPhone; |
| | | /** |
| | | * (精神类人群填写)监护人关系 |
| | |
| | | * @return 导入结果 |
| | | */ |
| | | R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | |
| | | /** |
| | | * 根据实有人口id修改用户标签 |
| | | * |
| | |
| | | * @return 统计结果 |
| | | */ |
| | | R getScreenCivil(Long communityId); |
| | | |
| | | |
| | | /** |
| | | * description 根据身份证信息修改用户标签信息 |
| | | * |
| | |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | |
| | | return R.ok(this.baseMapper.getPopulationTotalByAdmin(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R editTagPopulationByCardNo(ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO) { |
| | | ComMngPopulationDO comMngPopulationDO = getPopulationByCardNo(comMngPopulationTagCardNoDTO.getCardNo()); |
| | | if (comMngPopulationDO == null) { |
| | | return R.fail("未查询到人口记录"); |
| | | } |
| | | ComMngPopulationDO comMngPopulation = new ComMngPopulationDO(); |
| | | if (comMngPopulationDO.getLabel() != null) { |
| | | if (!comMngPopulationDO.getLabel().contains(comMngPopulationTagCardNoDTO.getLabel())) { |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel().concat(",").concat(comMngPopulationDO.getLabel())); |
| | | } |
| | | } else { |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel()); |
| | | } |
| | | comMngPopulation.setCardNo(null); |
| | | comMngPopulation.setId(comMngPopulationDO.getId()); |
| | | int nub = populationDAO.updateById(comMngPopulation); |
| | | if (nub < 1) { |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public ComMngPopulationDO getPopulationByCardNo(String cardNo) { |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(cardNo, aesKey); |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<ComMngPopulationDO>() |
| | | .eq("card_no", aesCardNo) |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询业务-加密证件信息出错:{}", e.getCause()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R screenStatistic(Long communityId) { |
| | | ComActPopulationScreenVO comActPopulationScreenVO = new ComActPopulationScreenVO(); |
| | | ComMngPopulationTotalVO vo = populationDAO.getPopulationTotalByAdmin(communityId); |
| | | comActPopulationScreenVO.setTotalNum(vo.getPopulationTotal() == null ? 0 : vo.getPopulationTotal()); |
| | | comActPopulationScreenVO.setLocalNum(vo.getLocalTotal() == null ? 0 : vo.getLocalTotal().longValue()); |
| | | comActPopulationScreenVO.setOutNum(vo.getOutTotal() == null ? 0 : vo.getOutTotal().longValue()); |
| | | comActPopulationScreenVO.setSpecialNum(vo.getSpecialTotal() == null ? 0 : vo.getSpecialTotal().longValue()); |
| | | //统计已使用社区通人数 |
| | | Long count = populationDAO.countUsedCommunityPopulation(communityId); |
| | | comActPopulationScreenVO.setUsedCommunityNum(count == null ? 0 : count); |
| | | |
| | | //统计性别 |
| | | Map<String, Long> sexMap = populationDAO.countBySex(communityId); |
| | | comActPopulationScreenVO.setWoman(sexMap.get("woman") == null ? 0L : sexMap.get("woman")); |
| | | comActPopulationScreenVO.setManNum(sexMap.get("man") == null ? 0L : sexMap.get("man")); |
| | | int manPoint = (int) (((double) comActPopulationScreenVO.getManNum() / (double) comActPopulationScreenVO.getTotalNum()) * 100); |
| | | comActPopulationScreenVO.setManPoint(manPoint); |
| | | comActPopulationScreenVO.setWomanPoint(100 - manPoint); |
| | | /** |
| | | * 首页大屏统计接口 |
| | | * @param communityId 社区id |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO; |
| | | import com.panzhihua.common.model.dtos.community.DisabledPersonsDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | public R saveBatchDisabledPerson(List<DisabledPersonsDTO> list) { |
| | | list.forEach(disabledPersonsDTO -> { |
| | | DisabledPersonsDO dbKeyPerson = checkExistFromDb(disabledPersonsDTO); |
| | | ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(disabledPersonsDTO.getCardNo()); |
| | | if (population != null) { |
| | | disabledPersonsDTO.setUserId(population.getId()); |
| | | } |
| | | if (dbKeyPerson != null) { |
| | | //已经存在数据,进行数据更新操作 |
| | | DisabledPersonsDO disabledPersonsDO = new DisabledPersonsDO(); |
| | | BeanUtils.copyProperties(disabledPersonsDTO, disabledPersonsDO); |
| | | disabledPersonsDO.setId(dbKeyPerson.getId()); |
| | | ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO = new ComMngPopulationTagCardNoDTO(); |
| | | comMngPopulationTagCardNoDTO.setCardNo(dbKeyPerson.getCardNo()); |
| | | ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(disabledPersonsDTO.getCardNo()); |
| | | if (population != null) { |
| | | disabledPersonsDO.setUserId(population.getId()); |
| | | } |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(disabledPersonsDTO.getCardNo(), aesKey); |
| | | String phone = AESUtil.encrypt128(disabledPersonsDTO.getPhone(), aesKey); |
| | | String guardianPhone = AESUtil.encrypt128(disabledPersonsDTO.getGuardianPhone(), aesKey); |
| | | disabledPersonsDO.setCardNo(aesCardNo); |
| | | disabledPersonsDO.setPhone(phone); |
| | | disabledPersonsDO.setGuardianPhone(guardianPhone); |
| | | updateById(disabledPersonsDO); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询残疾人群业务-加密证件信息出错"); |
| | |
| | | .eq("card_no", aesCardNo) |
| | | ); |
| | | } catch (Exception e) { |
| | | |
| | | log.error("根据身份证查询残疾人群业务-加密证件信息出错"); |
| | | } |
| | | return null; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * 处理逻辑:同一个人的信息可以被多个社区重复录入 |
| | |
| | | public R saveBatchKeyPerson(List<KeyPersonInfoDTO> list) { |
| | | list.forEach(keyPersonInfoDTO -> { |
| | | KeyPersonInfoDO dbKeyPerson = checkExistFromDb(keyPersonInfoDTO); |
| | | ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(keyPersonInfoDTO.getCardNo()); |
| | | if (population != null) { |
| | | keyPersonInfoDTO.setUserId(population.getId()); |
| | | } |
| | | if (dbKeyPerson != null) { |
| | | //已经存在数据,进行数据更新操作 |
| | | KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO(); |
| | |
| | | comMngPopulationTagCardNoDTO.setCardNo(dbKeyPerson.getCardNo()); |
| | | comMngPopulationTagCardNoDTO.setLabel(calculateLabel(dbKeyPerson)); |
| | | comMngPopulationService.editTagPopulationByCardNo(comMngPopulationTagCardNoDTO); |
| | | ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo()); |
| | | if(population !=null){ |
| | | keyPersonInfoDO.setUserId(population.getId()); |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(keyPersonInfoDTO.getCardNo(), aesKey); |
| | | String phone = AESUtil.encrypt128(keyPersonInfoDTO.getPhone(), aesKey); |
| | | String guardianPhone = AESUtil.encrypt128(keyPersonInfoDTO.getGuardianPhone(), aesKey); |
| | | keyPersonInfoDO.setCardNo(aesCardNo); |
| | | keyPersonInfoDO.setPhone(phone); |
| | | keyPersonInfoDO.setGuardianPhone(guardianPhone); |
| | | keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType())); |
| | | keyPersonInfoDO.setInvalid(false); |
| | | keyPersonInfoDO.setSubmitDate(new Date()); |
| | | updateById(keyPersonInfoDO); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询残疾人群业务-加密证件信息出错"); |
| | | } |
| | | keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType())); |
| | | keyPersonInfoDO.setInvalid(false); |
| | | updateById(keyPersonInfoDO); |
| | | } else { |
| | | KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO(); |
| | | BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO); |
| | | ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo()); |
| | | if(population !=null){ |
| | | keyPersonInfoDO.setUserId(population.getId()); |
| | | } |
| | | keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType())); |
| | | keyPersonInfoDO.setInvalid(false); |
| | | keyPersonInfoDO.setSubmitDate(new Date()); |
| | | save(keyPersonInfoDO); |
| | | } |
| | | }); |
| | |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<KeyPersonInfoDO>() |
| | | .eq("act_id", keyPersonInfoDTO.getActId()) |
| | | .eq("card_no",aesCardNo) |
| | | .eq("card_no", aesCardNo) |
| | | .eq("visiter_type", keyPersonInfoDTO.getVisiterType()) |
| | | ); |
| | | } catch (Exception e) { |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | @Resource |
| | | private ComActEasyPhotoDAO comActEasyPhotoDAO; |
| | | |
| | | @Resource ComActDAO comActDAO; |
| | | |
| | | /** |
| | | * 项目开始时间,超过的不统计 |
| | | */ |
| | | private final String initMonth = "2020-12"; |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | |
| | | private final String moth_format_ch = "yyyy年MM月"; |
| | | |
| | | private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; |
| | | |
| | |
| | | //统计本月新增、居民活动,志愿者活动 |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = actActivityDAO.countByCommunityId(communityId,date); |
| | | comActActivityScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); |
| | | comActActivityScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | comActActivityScreenVO.setCommonNum(countMap.get("commonNum") == null ? 0L : countMap.get("commonNum")); |
| | | comActActivityScreenVO.setCommonPeopleNum(countMap.get("commonPeopleNum") == null ? 0L : countMap.get("commonPeopleNum")); |
| | | comActActivityScreenVO.setVolunteerNum(countMap.get("volunteerNum") == null ? 0L : countMap.get("volunteerNum")); |
| | | comActActivityScreenVO.setVolunteerPeopleNum(countMap.get("volunteerPeopleNum") == null ? 0L : countMap.get("volunteerPeopleNum")); |
| | | comActActivityScreenVO.setTotalNum(comActActivityScreenVO.getCommonNum()+comActActivityScreenVO.getVolunteerNum()); |
| | | //最近活动 |
| | | comActActivityScreenVO.setList(actActivityDAO.screenActivity(communityId,pageSize)); |
| | | return R.ok(comActActivityScreenVO); |
| | |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = comActDiscussDAO.countByCommunityId(communityId,date); |
| | | discussScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | discussScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); |
| | | discussScreenVO.setImgNum(countMap.get("imgNum") == null ? 0L : countMap.get("imgNum")); |
| | | discussScreenVO.setImgPeopleNum(countMap.get("imgPeopleNum") == null ? 0L : countMap.get("imgPeopleNum")); |
| | | discussScreenVO.setVoteNum(countMap.get("voteNum") == null ? 0L : countMap.get("voteNum")); |
| | | discussScreenVO.setVoteNum(discussScreenVO.getTotalNum() - discussScreenVO.getImgNum()); |
| | | discussScreenVO.setVotePeopleNum(countMap.get("votePeopleNum") == null ? 0L : countMap.get("votePeopleNum")); |
| | | discussScreenVO.setTotalNum(discussScreenVO.getImgNum()+discussScreenVO.getVoteNum()); |
| | | discussScreenVO.setList(comActDiscussDAO.screenDiscuss(communityId,pageSize)); |
| | | return R.ok(discussScreenVO); |
| | | } |
| | |
| | | pbWorkScreenVO.setTotalNum(pbWorkScreenVO.getActivityNum() + pbWorkScreenVO.getDynNum()); |
| | | pbWorkScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | //统计近半年数据 |
| | | int n = 6; |
| | | List<PbWorkVO> list = new ArrayList<>(); |
| | | for(Map<String,String> map : listHalfYear(n)){ |
| | | PbWorkVO result = comPbDynDAO.countByTime(map.get("start"),map.get("end"),communityId); |
| | | result.setMonth(map.get("name")); |
| | | for(PbWorkVO workVO: listHalfYear()){ |
| | | PbWorkVO result = comPbDynDAO.countByTime(workVO.getStart(),workVO.getEnd(),communityId); |
| | | result.setMonth(workVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | pbWorkScreenVO.setList(list); |
| | |
| | | } |
| | | |
| | | |
| | | private List<Map<String,String>> listHalfYear(int num) { |
| | | List<Map<String,String>> dateList = new ArrayList<>(); |
| | | private List<PbWorkVO> listHalfYear() { |
| | | List<PbWorkVO> dateList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for(int i= num;i>=1;i--){ |
| | | for(int i= 6;i>=1;i--){ |
| | | Date date = DateUtils.getDateM(now,-i); |
| | | DateTime endDay = DateUtil.endOfMonth(date); |
| | | |
| | | int m = DateUtil.month(endDay); |
| | | if(m == 0){ |
| | | m = 12; |
| | | } |
| | | m--; |
| | | int day = DateUtil.dayOfMonth(endDay); |
| | | int half = day/2; |
| | | String month = DateUtil.format(date,moth_format_str); |
| | | if(Objects.equals(month,initMonth)){ |
| | | continue; |
| | | } |
| | | Map<String,String> startMap = new HashMap<>(); |
| | | startMap.put("name",monthStr[m]+"月上旬"); |
| | | startMap.put("start",month+ "-01 00:00:00"); |
| | | startMap.put("end",month+ "-"+half+" 23:59:58"); |
| | | dateList.add(startMap); |
| | | Map<String,String> endMap = new HashMap<>(); |
| | | endMap.put("name",monthStr[m]+"月下旬"); |
| | | endMap.put("start",month+ "-"+half+" 23:59:59"); |
| | | endMap.put("end",DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(endMap); |
| | | PbWorkVO pbWorkVO = new PbWorkVO(); |
| | | pbWorkVO.setMonth(monthStr[m]+"月上旬"); |
| | | pbWorkVO.setStart(month+ "-01 00:00:00"); |
| | | pbWorkVO.setEnd(month+ "-"+half+" 23:59:58"); |
| | | dateList.add(pbWorkVO); |
| | | PbWorkVO pbWorkVO2 = new PbWorkVO(); |
| | | pbWorkVO2.setMonth(monthStr[m]+"月下旬"); |
| | | pbWorkVO2.setStart(month+ "-"+half+" 23:59:58"); |
| | | pbWorkVO2.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(pbWorkVO2); |
| | | } |
| | | return dateList; |
| | | |
| | |
| | | Map<String,Object> countMap = comActEasyPhotoDAO.countByCommunityId(communityId,date); |
| | | comActEasyPhotoScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : Long.valueOf(countMap.get("currentNum").toString())); |
| | | comActEasyPhotoScreenVO.setNoneDeal(countMap.get("noneDeal") == null ? 0L : Long.valueOf(countMap.get("noneDeal").toString())); |
| | | comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0 : Double.valueOf(countMap.get("pubPoint").toString()).intValue()); |
| | | comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? "0h" : convertTimeStr(Double.valueOf(countMap.get("dealTime").toString()).intValue())); |
| | | comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0 : Integer.valueOf(countMap.get("pubPoint").toString())); |
| | | comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue()); |
| | | List<EastPhotoVO> list = new ArrayList<>(); |
| | | //统计半年数据 |
| | | int n = 6; |
| | | List<Map<String,String>> timeList = listHalfYear(n); |
| | | for(Map<String,String> map : timeList){ |
| | | String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(map.get("start")),moth_format_str); |
| | | EastPhotoVO result = comActEasyPhotoDAO.countByTime(map.get("start"),map.get("end"),nowDate,communityId); |
| | | result.setMonth(map.get("name")); |
| | | for(PbWorkVO workVO: listHalfYear()){ |
| | | String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(workVO.getStart()),moth_format_str); |
| | | EastPhotoVO result = comActEasyPhotoDAO.countByTime(workVO.getStart(),workVO.getEnd(),nowDate,communityId); |
| | | result.setMonth(workVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | comActEasyPhotoScreenVO.setList(list); |
| | | comActEasyPhotoScreenVO.setListTimes(DateUtil.format(DateUtil.parse(timeList.get(0).get("start"),DatePattern.NORM_DATETIME_FORMAT),moth_format_ch)+"-"+DateUtil.format(DateUtil.parse(timeList.get(timeList.size()-1).get("start"),DatePattern.NORM_DATETIME_FORMAT),moth_format_ch)); |
| | | return R.ok(comActEasyPhotoScreenVO); |
| | | } |
| | | |
| | | private String convertTimeStr(int minute) { |
| | | int hour = minute/60; |
| | | int min = minute%60; |
| | | StringBuilder timestr = new StringBuilder(); |
| | | if(hour > 0){ |
| | | timestr.append(hour).append("h"); |
| | | } |
| | | if(min > 0){ |
| | | timestr.append(min).append("min"); |
| | | } |
| | | return timestr.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | private List<EasyPhotoPointVO> getList(Map<String, Long> dealMap) { |
| | | Set<Map.Entry<String,Long>> entrySet = dealMap.entrySet(); |
| | | |
| | | List<EasyPhotoPointVO> list = new ArrayList<>(); |
| | | for(Map.Entry<String,Long> en:entrySet){ |
| | | EasyPhotoPointVO easyPhotoPointVO = new EasyPhotoPointVO(); |
| | | easyPhotoPointVO.setTypeName(en.getKey()); |
| | | easyPhotoPointVO.setPoint(en.getValue().intValue()); |
| | | list.add(easyPhotoPointVO); |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R workCount(Long communityId) { |
| | | ComActWorkScreenVO comActWorkScreenVO = new ComActWorkScreenVO(); |
| | | //已完成 |
| | | comActWorkScreenVO.setCompletetList(comActNeighborCircleDAO.countAllCompletedWorkByCommunityId(communityId)); |
| | | comActWorkScreenVO.setAvgTime("1小时"); |
| | | comActWorkScreenVO.setTotalCompletedPoint(70); |
| | | comActWorkScreenVO.setEveryDayNum("0.3"); |
| | | List<ActWorkCountVO> completetPoint = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto = new ActWorkCountVO(); |
| | | easyPhoto.setName("随手拍"); |
| | | easyPhoto.setNum(10); |
| | | completetPoint.add(easyPhoto); |
| | | ActWorkCountVO wish = new ActWorkCountVO(); |
| | | wish.setName("微心愿"); |
| | | wish.setNum(23); |
| | | completetPoint.add(wish); |
| | | ActWorkCountVO discuss = new ActWorkCountVO(); |
| | | discuss.setName("一起议"); |
| | | discuss.setNum(33); |
| | | completetPoint.add(discuss); |
| | | ActWorkCountVO neighbor = new ActWorkCountVO(); |
| | | neighbor.setName("邻里圈"); |
| | | neighbor.setNum(43); |
| | | completetPoint.add(neighbor); |
| | | ActWorkCountVO pbWork = new ActWorkCountVO(); |
| | | pbWork.setName("党建工作"); |
| | | pbWork.setNum(13); |
| | | completetPoint.add(pbWork); |
| | | ActWorkCountVO activity = new ActWorkCountVO(); |
| | | activity.setName("社区活动"); |
| | | activity.setNum(63); |
| | | completetPoint.add(activity); |
| | | comActWorkScreenVO.setCompletetPoint(completetPoint); |
| | | |
| | | //未完成 |
| | | comActWorkScreenVO.setNoneList(comActNeighborCircleDAO.countAllNoneCompletedWorkByCommunityId(communityId)); |
| | | comActWorkScreenVO.setTotalCompleted(comActWorkScreenVO.getCompletetList().stream().mapToInt(PieElementVO::getNum).sum()); |
| | | comActWorkScreenVO.setTotalNoneCompleted(comActWorkScreenVO.getNoneList().stream().mapToInt(PieElementVO::getNum).sum()); |
| | | |
| | | //统计平均耗时、平均每天完成个数 |
| | | Map<String,Object> avgMap = comActNeighborCircleDAO.countAvgByCommunityId(communityId); |
| | | comActWorkScreenVO.setAvgTime(avgMap.get("avgTime") == null?"0h":convertTimeStr(Double.valueOf(avgMap.get("avgTime").toString()).intValue())); |
| | | |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | BigDecimal days = new BigDecimal(DateUtil.betweenDay(comActDO.getCreateAt(),new Date(),false)); |
| | | BigDecimal num = new BigDecimal(comActWorkScreenVO.getTotalCompleted()); |
| | | BigDecimal rt = num.divide(days,1,RoundingMode.HALF_UP); |
| | | comActWorkScreenVO.setEveryDayNum(rt.toString()); |
| | | List<ActWorkCountVO> completetPoint2 = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto2 = new ActWorkCountVO(); |
| | | easyPhoto2.setName("随手拍"); |
| | | easyPhoto2.setNum(10); |
| | | completetPoint2.add(easyPhoto2); |
| | | ActWorkCountVO wish2 = new ActWorkCountVO(); |
| | | wish2.setName("微心愿"); |
| | | wish2.setNum(23); |
| | | completetPoint2.add(wish2); |
| | | ActWorkCountVO discuss2 = new ActWorkCountVO(); |
| | | discuss2.setName("一起议"); |
| | | discuss2.setNum(33); |
| | | completetPoint2.add(discuss2); |
| | | ActWorkCountVO neighbor2 = new ActWorkCountVO(); |
| | | neighbor2.setName("邻里圈"); |
| | | neighbor2.setNum(43); |
| | | completetPoint2.add(neighbor2); |
| | | ActWorkCountVO pbWork2 = new ActWorkCountVO(); |
| | | pbWork2.setName("党建工作"); |
| | | pbWork2.setNum(13); |
| | | completetPoint2.add(pbWork2); |
| | | ActWorkCountVO activity2 = new ActWorkCountVO(); |
| | | activity2.setName("社区活动"); |
| | | activity2.setNum(63); |
| | | completetPoint2.add(activity2); |
| | | comActWorkScreenVO.setNonePoint(completetPoint2); |
| | | return R.ok(comActWorkScreenVO); |
| | | } |
| | | |
| | |
| | | package com.panzhihua.service_community; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @Slf4j |
| | | @SpringBootTest |
| | | class ServiceCommunityApplicationTests { |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | | log.info("test"); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | private EventService eventService; |
| | | |
| | | /** |
| | | * description 获取所有未上传到浪潮平台的事件列表 |
| | | * |
| | | * @return String 事件列表 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/getUnUploadEvent") |
| | | List<EventDetailsVO> getUnUploadEvent(){ |
| | | return eventService.getUnUploadEvent(); |
| | | } |
| | | /** |
| | | * description 更新上传是否成功标识 |
| | | * @param id 事件主键ID |
| | | * @return Boolean 上传是否成功 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/updateLcUploadFlag") |
| | | Boolean updateLcUploadFlag(Long id){ |
| | | return eventService.updateLcUploadFlag(id); |
| | | } |
| | | /** |
| | | * 分页查找事件 |
| | | * @param pageEventDTO |
| | | * @return 维护结果 |
New file |
| | |
| | | package com.panzhihua.service_grid.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataDetailsVO; |
| | | import com.panzhihua.service_grid.service.EventGridDataService; |
| | | import com.panzhihua.service_grid.service.LcCompareCodeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/lc_compare") |
| | | public class LcCompareCodeApi { |
| | | |
| | | @Resource |
| | | private LcCompareCodeService lcCompareCodeService; |
| | | |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param id 本地网格ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | String getLcGridIdByLocal(@PathVariable("id") Long id){ |
| | | return lcCompareCodeService.getLcGridIdByLocal(id); |
| | | } |
| | | |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param localUserId 本地网格员ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @GetMapping("/getLcUserId") |
| | | String getLcUserIdByLocalUserId(String localUserId){ |
| | | return lcCompareCodeService.getLcUserIdByLocal(localUserId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 本地网格和浪潮的对码表管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Mapper |
| | | public interface LcCompareCodeMapper extends BaseMapper<LcCompareCodeDO> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeMemberDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 本地网格和浪潮的对码表管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Mapper |
| | | public interface LcCompareMemberCodeMapper extends BaseMapper<LcCompareCodeMemberDO> { |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | private Boolean upload; |
| | | |
| | | /** |
| | | * 撤销人/社区ID 列: revoke_id |
| | | */ |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | private Boolean upload; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Description 本地网格和浪潮的对码表 |
| | | * ClassName LcCompareCode |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | @TableName("lc_compare_code") |
| | | public class LcCompareCodeDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | /**主键*/ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /**本地网格ID*/ |
| | | private String localGridId; |
| | | /**网格名称*/ |
| | | private String gridName; |
| | | /**浪潮市平台网格ID*/ |
| | | private String lcGridId; |
| | | /**浪潮市平台网格名称*/ |
| | | private String lcGridName; |
| | | /**创建时间*/ |
| | | private Date createAt; |
| | | /**修改时间*/ |
| | | private Date updateAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Description 本地网格和浪潮的对码表 |
| | | * ClassName LcCompareCode |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | @TableName("lc_compare_code_member") |
| | | public class LcCompareCodeMemberDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | /**主键*/ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /**本地网格ID*/ |
| | | private String localGridMemberId; |
| | | /**网格名称*/ |
| | | private String gridMemberName; |
| | | /**浪潮市平台网格ID*/ |
| | | private String lcGridMemberId; |
| | | /**浪潮市平台网格名称*/ |
| | | private String lcGridMemberName; |
| | | /**浪潮网格员绑定的用户ID*/ |
| | | private String lcBindUserId; |
| | | /**创建时间*/ |
| | | private Date createAt; |
| | | /**修改时间*/ |
| | | private Date updateAt; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.grid.EventVO; |
| | | import com.panzhihua.service_grid.model.dos.EventDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 事件 service |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | R reportDirect(CommonEventDirectReportDTO commonEventDirectReportDTO); |
| | | /** |
| | | * description 获取所有未上传到浪潮平台的事件列表 |
| | | * |
| | | * @return String 事件列表 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | List<EventDetailsVO> getUnUploadEvent(); |
| | | /** |
| | | * description 更新上传是否成功标识 |
| | | * @param id 事件主键ID |
| | | * @return Boolean 上传是否成功 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | Boolean updateLcUploadFlag(Long id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeDO; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 本地网格和浪潮的对码表管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | public interface LcCompareCodeService extends IService<LcCompareCodeDO> { |
| | | |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param id 本地网格ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String getLcGridIdByLocal(Long id); |
| | | /** |
| | | * description 根据本地网格ID,查询对于的浪潮市平台对应的ID |
| | | * |
| | | * @param localUserId 本地网格员ID |
| | | * @return String 浪潮市平台对应的ID |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | String getLcUserIdByLocal(String localUserId); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ExcelSelectListUtil; |
| | | import com.panzhihua.common.utlis.LngLatUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_grid.dao.*; |
| | |
| | | private EventGridDataMapper eventGridDataMapper; |
| | | @Resource |
| | | private EventGridMemberRelationMapper eventGridMemberRelationMapper; |
| | | |
| | | @Resource |
| | | private EventGridDataService eventGridDataService; |
| | | @Resource |
| | | private EventResourceMapper eventResourceMapper; |
| | | /** |
| | | * 分页查找事件 |
| | | * |
| | |
| | | |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public List<EventDetailsVO> getUnUploadEvent() { |
| | | List<EventDetailsVO> eventDetailsVOList =new ArrayList<>(); |
| | | List<EventDO> unEventList = baseMapper.selectList( |
| | | new QueryWrapper<EventDO>() |
| | | .eq("upload", false) |
| | | ); |
| | | unEventList.forEach(eventDO -> { |
| | | eventDetailsVOList.add(eventDetails(eventDO.getId()).getData()); |
| | | }); |
| | | return eventDetailsVOList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateLcUploadFlag(Long id) { |
| | | EventDO event = baseMapper.selectById(id); |
| | | event.setUpload(true); |
| | | baseMapper.updateById(event); |
| | | EventResourceDO eventResourceDO =new EventResourceDO(); |
| | | eventResourceDO.setUpload(true); |
| | | int flag = eventResourceMapper.update(eventResourceDO, new QueryWrapper<EventResourceDO>() |
| | | .eq("ref_id", id)); |
| | | if(flag>0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.service_grid.dao.LcCompareCodeMapper; |
| | | import com.panzhihua.service_grid.dao.LcCompareMemberCodeMapper; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeDO; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeMemberDO; |
| | | import com.panzhihua.service_grid.service.LcCompareCodeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 本地网格和浪潮的对码表管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class LcCompareCodeServiceImpl extends ServiceImpl<LcCompareCodeMapper, LcCompareCodeDO> implements LcCompareCodeService { |
| | | |
| | | @Resource |
| | | private LcCompareMemberCodeMapper compareMemberCodeMapper; |
| | | |
| | | @Override |
| | | public String getLcGridIdByLocal(Long id) { |
| | | try { |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<LcCompareCodeDO>() |
| | | .eq("local_grid_id", id) |
| | | ).getLcGridId(); |
| | | } catch (Exception e) { |
| | | log.error("根据本地GRID查询浪潮网格对应表数据出错"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getLcUserIdByLocal(String localUserId) { |
| | | try { |
| | | return compareMemberCodeMapper.selectOne( |
| | | new QueryWrapper<LcCompareCodeMemberDO>() |
| | | .eq("local_grid_member_id", localUserId) |
| | | ).getLcBindUserId(); |
| | | } catch (Exception e) { |
| | | log.error("根据本地GRID查询浪潮网格对应表数据出错"); |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.panzhihua.common.model.vos.grid.EventDetailsVO; |
| | | import com.panzhihua.service_grid.ServiceGridApplication; |
| | | import com.panzhihua.service_grid.service.EventService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.*; |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceGridApplication.class) |
| | | class EventServiceImplTest { |
| | | |
| | | @Resource |
| | | private EventService eventService; |
| | | |
| | | @Test |
| | | void getUnUploadEvent() { |
| | | List<EventDetailsVO> eventList = eventService.getUnUploadEvent(); |
| | | String pretty = JSONArray.toJSONString(eventList, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | |
| | | @Test |
| | | void updateLcUploadFlag() { |
| | | Boolean uploadFlag = eventService.updateLcUploadFlag(1111115L); |
| | | log.info(uploadFlag.toString()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import com.panzhihua.service_grid.ServiceGridApplication; |
| | | import com.panzhihua.service_grid.service.LcCompareCodeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceGridApplication.class) |
| | | class LcCompareCodeServiceImplTest { |
| | | |
| | | @Autowired |
| | | private LcCompareCodeService lcCompareCodeService; |
| | | |
| | | @Test |
| | | void getLcGridIdByLocal() { |
| | | } |
| | | |
| | | @Test |
| | | void getLcUserIdByLocal() { |
| | | String lcUserId = lcCompareCodeService.getLcUserIdByLocal("2614"); |
| | | log.info(lcUserId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.timejob.jobhandler; |
| | | |
| | | import com.panzhihua.common.service.api.ApiServiceFeign; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 定时上报事件信息 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-17 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | public class LangChaoEventUploadJobHandler { |
| | | |
| | | |
| | | @Resource |
| | | private ApiServiceFeign ApiServiceFeign; |
| | | |
| | | /** |
| | | * description 生成或更新redis里面的对接浪潮所需的token信息,token有效期12小时 |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @XxlJob("langChaoGetToken") |
| | | public ReturnT<String> langChaoGetToken(String param) { |
| | | log.info("定时更新浪潮对接token。token有效期12小时"); |
| | | ApiServiceFeign.getToken("18080799023", "123456"); |
| | | log.info("定时更新浪潮对接token完成"); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * description 向浪潮服务器提交网格事件登记包括基础信息和文件(图片、mp3、mp4)信息 |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @XxlJob("langChaoAutomationUpload") |
| | | public ReturnT<String> langChaoAutomationUpload(String param) { |
| | | log.info("向浪潮服务器提交网格事件登记开始"); |
| | | ApiServiceFeign.automationUploadEventAndFile(); |
| | | log.info("向浪潮服务器提交网格事件登记完成"); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |