Merge branch 'test' into 'master'
Test
See merge request root/zhihuishequ!83
| | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-core</artifactId> |
| | | <version>5.6.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context</artifactId> |
| | | </dependency> |
| | |
| | | <!-- 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"; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.api; |
| | | |
| | | import lombok.Data; |
| | | /** |
| | | * 攀枝花综治网格化-事件接口请求返回的对象 |
| | | * des |
| | | * @author manailin |
| | | * @date 2021/06/20 |
| | | */ |
| | | @Data |
| | | public class LcReturnObject { |
| | | /** |
| | | * 返回code |
| | | */ |
| | | private String code; |
| | | /** |
| | | *返回消息信息 |
| | | */ |
| | | private String message; |
| | | /** |
| | | *返回对象信息 |
| | | */ |
| | | private String data; |
| | | /** |
| | | *返回的是否成功标识 |
| | | */ |
| | | private Boolean success; |
| | | } |
| | |
| | | public static final String GRID_DEFAULT_ROLE_KEY="grid_member_default_role"; |
| | | |
| | | public static final String ZONG_ZHI_GRID_MEMBER_IMAGE_URL = "https://www.psciio.com//idcard/57bf4104a76741cfabfead0bb8218307.jpg"; |
| | | |
| | | public static final String ZZ_APP_TAG_LIST = "{\"list\":[\"流动人口\",\"户籍人口\",\"社区矫正\",\"吸毒人员\",\"重精患者\",\"刑满释放\"]}"; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | /** 走访任务状态 |
| | | * @author xyh |
| | | * @date 2021/6/21 17:22 |
| | | */ |
| | | public enum EventTasksStatusEnum { |
| | | |
| | | DZF(1,"待走访"), |
| | | JXZ(2,"进行中"), |
| | | ZJJJ(3,"自己解决"), |
| | | DYZ(4,"待验证"), |
| | | CG(5,"草稿"), |
| | | YCX(6,"已撤销"), |
| | | YC(7,"异常"), |
| | | ; |
| | | |
| | | |
| | | private final int code; |
| | | private final String name; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | EventTasksStatusEnum(int code, String name){ |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static String getName(int code){ |
| | | for (EventTasksStatusEnum item : EventTasksStatusEnum.values()) { |
| | | if (item.code == (code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return YC.getName(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | /** 被走访人标签 |
| | | * @author xyh |
| | | * @date 2021/6/21 17:22 |
| | | */ |
| | | public enum EventTasksVisitorTypeEnum { |
| | | |
| | | DZF(1,"待走访"), |
| | | JXZ(2,"进行中"), |
| | | ZJJJ(3,"自己解决"), |
| | | DYZ(4,"待验证"), |
| | | CG(5,"草稿"), |
| | | YCX(6,"已撤销"), |
| | | YC(7,"异常"), |
| | | ; |
| | | |
| | | |
| | | private final int code; |
| | | private final String name; |
| | | |
| | | EventTasksVisitorTypeEnum(int code, String name){ |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static String getName(int code){ |
| | | for (EventTasksVisitorTypeEnum item : EventTasksVisitorTypeEnum.values()) { |
| | | if (item.code == (code)) { |
| | | return item.name(); |
| | | } |
| | | } |
| | | return YC.name; |
| | | } |
| | | } |
| | |
| | | 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","矛盾纠纷"), |
| | | TF(5, "1b62afbccc2a4bb98125f999b7133242","突发事件"), |
| | | TSRQ(6, "7da14163537b4b7e9a73ae28f4a58b72","特殊人群信息上报"), |
| | | XC(8, "9306ca7327a44b5ca474426f2da0e206","宣传教育"); |
| | | |
| | | 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 ZA.getName(); |
| | | } |
| | | public static String getEventNameByCode(Integer code) { |
| | | for (LocalEventToLangChaoEventTypeEnum item : LocalEventToLangChaoEventTypeEnum.values()) { |
| | | if (item.getCode().equals(code)) { |
| | | return item.getEventName(); |
| | | } |
| | | } |
| | | return ZA.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) |
| | | @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) |
| | | @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; |
| | | /** |
| | | * 创建用户 |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("大屏事件列表请求参数") |
| | |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value="网格id") |
| | | private Long gridId; |
| | | private List<Long> gridIds; |
| | | |
| | | @ApiModelProperty(value="事件类型(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报 8宣传教育)") |
| | | private Integer eventType; |
| | | private List<Integer> eventTypes; |
| | | |
| | | @ApiModelProperty(value="事件分类(1、办件事件2、宣传事件3、阅读事件)",hidden = true) |
| | | private Integer eventCategory = 1; |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.bigscreen.work; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("工作大屏一起议列表请求参数") |
| | | public class ScreenActActivityListDTO { |
| | | |
| | | @ApiModelProperty(value = "分页每页数量",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "社区id", example = "2", required = true) |
| | | @NotNull(message = "社区id不能为空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value="查询开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value="查询结束时间") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value="发布类型 1 图文 2 投票") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 发布类型 1 图文 2 投票 |
| | | */ |
| | | public interface type{ |
| | | int tw = 1; |
| | | int tp = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.bigscreen.work; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("工作大屏一起议列表请求参数") |
| | | public class ScreenActActivityPeopleListDTO { |
| | | |
| | | @ApiModelProperty(value = "分页每页数量",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "活动id", example = "2", required = true) |
| | | @NotNull(message = "活动id不可为空") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String cardNo; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.bigscreen.work; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("工作大屏微心愿列表请求参数") |
| | | public class ScreenMicroListDTO { |
| | | |
| | | @ApiModelProperty(value = "分页每页数量",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "社区id", example = "2", required = true) |
| | | @NotNull(message = "社区id不能为空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value="查询开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value="查询结束时间") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value="状态 1待审核 2待分配 3进行中 4已驳回 5待确认6 已完成") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | public class CommonEventAddDTO { |
| | | |
| | | @Max(127) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1", required = true) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报", hidden = false, example = "1", required = true) |
| | | @NotNull(message = "事件分类不能为空") |
| | | private Integer eventType; |
| | | |
| | |
| | | @Length(max = 11) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "上报人口id列表,当事件类型为特殊人群上报时此字段不为空", hidden = false) |
| | | private List<Long> populationIds; |
| | | |
| | | } |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | public class CommonEventEditDTO { |
| | | |
| | | @Max(127) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1", required = true) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报", hidden = false, example = "1", required = true) |
| | | @NotNull(message = "事件分类不能为空") |
| | | private Integer eventType; |
| | | |
| | |
| | | @Length(max = 11) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "上报人口id列表,当事件类型为特殊人群上报时此字段不为空", hidden = false) |
| | | private List<Long> populationIds; |
| | | |
| | | } |
| | |
| | | private Long gridId; |
| | | |
| | | @Max(127) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1", required = true) |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报", hidden = false, example = "1", required = true) |
| | | @NotNull(message = "事件分类不能为空") |
| | | private Integer eventType; |
| | | |
| | |
| | | @ApiModelProperty(value = "网格员名字", hidden = false, example = "") |
| | | private String gridMemberName; |
| | | |
| | | @Length(max=100) |
| | | @ApiModelProperty(value = "事件类型", hidden = false, example = "") |
| | | private String eventClazz; |
| | | |
| | | |
| | | @Length(max=20) |
| | | @ApiModelProperty(value = "网格员联系方式", hidden = false, example = "") |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 分页查询表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询事件特殊人群请求参数") |
| | | public class PageEventSpecialPopulationDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true, example = "2") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid; |
| | | |
| | | import com.google.common.base.CaseFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | /** |
| | | * 分页查询表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询事件请求参数") |
| | | public class PagePopulationListDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "关键字", example = "1") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "社区ID", hidden = true, example = "1") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "特殊人员标签") |
| | | private String label; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value="发布状态(1.待审核 2.显示 3.隐藏 4.驳回)") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.query.visit; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/21 15:44 |
| | | */ |
| | | @ApiModel("走访任务查询") |
| | | @Data |
| | | public class EventTasksQuery extends PageDTO implements Serializable { |
| | | |
| | | @ApiModelProperty("状态:0全部,1已完成,2未完成") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("人员标签") |
| | | private Integer tag; |
| | | |
| | | @ApiModelProperty("是否异常") |
| | | private Integer isExp; |
| | | |
| | | @ApiModelProperty("关键字") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty("需走访人ID") |
| | | private Long visiterId; |
| | | |
| | | private Long communityId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.query.visit; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /**后台查询需走访人员 |
| | | * @author xyh |
| | | * @date 2021/6/21 15:44 |
| | | */ |
| | | @ApiModel("需走访人员查询") |
| | | @Data |
| | | public class EventVisitListQuery extends PageDTO implements Serializable { |
| | | |
| | | @ApiModelProperty("最近一次走访状态") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("人员标签") |
| | | private Integer tag; |
| | | |
| | | @ApiModelProperty("性别") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("政治面貌") |
| | | private Integer political; |
| | | |
| | | @ApiModelProperty("户主") |
| | | private Integer houseHolder; |
| | | |
| | | @ApiModelProperty("关联实有房屋") |
| | | private Integer relationHouse; |
| | | |
| | | @ApiModelProperty("关键字") |
| | | private String keyWord; |
| | | |
| | | private Long communityId; |
| | | } |
| | |
| | | @ApiModelProperty("特殊群体") |
| | | private Integer specialTotal; |
| | | |
| | | /** |
| | | * 小区总数 |
| | | */ |
| | | @ApiModelProperty("小区总数") |
| | | private Integer villageTotal; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class ComMngVillageVO { |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using= ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | |
| | | private String villageImages; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | private String villageId; |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("总人数") |
| | | private Integer peopleNum; |
| | | |
| | | @ApiModelProperty("户籍人数") |
| | | private Integer registerNum; |
| | | |
| | | @ApiModelProperty("流动人数") |
| | | private Integer flowNum; |
| | | |
| | | @ApiModelProperty("楼栋长数量") |
| | | private Integer buildingPeopleNum; |
| | | |
| | | @ApiModelProperty("居民小组长数量") |
| | | private Integer smallHeadmanNum; |
| | | |
| | | @ApiModelProperty("党小组长数量") |
| | | private Integer partyPeopleNum; |
| | | |
| | | @ApiModelProperty("妇女小组长数量") |
| | | private Integer womanPeopleNum; |
| | | |
| | | @ApiModelProperty("卫生员数量") |
| | | private Integer hygienePeopleNum; |
| | | |
| | | @ApiModelProperty("安全员数量") |
| | | private Integer securityPeopleNum; |
| | | |
| | | @ApiModelProperty("监督员数量") |
| | | private Integer supervisePeopleNum; |
| | | |
| | | @ApiModelProperty("其他人员") |
| | | private Integer otherPeopleNum; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.event; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | public class EventGridStatisticsVO { |
| | | |
| | | @ApiModelProperty("网格id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("网格名称") |
| | |
| | | @ApiModelProperty("发生区域") |
| | | private String gridName; |
| | | |
| | | @ApiModelProperty(value = "音频") |
| | | private List<EventResourceVO> audios; |
| | | |
| | | @ApiModelProperty(value = "视频") |
| | | private List<EventResourceVO> videos; |
| | | |
| | | @ApiModelProperty(value = "图片") |
| | | private List<EventResourceVO> pics; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.event; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("社区事件数据") |
| | | private List<EventGridIncidentStatisticsVO> gridIncidentList; |
| | | |
| | | @ApiModelProperty("小区列表数据") |
| | | private List<CivilVillageStatisticsVO> villageStatisticsList; |
| | | |
| | | @ApiModelProperty("人口统计数据") |
| | | private ComMngPopulationTotalVO populationTotalVO; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.event; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | @ApiModel("大屏事件播报流转记录详情返回参数") |
| | | public class EventTransferRecordDetailVO { |
| | | |
| | | @ApiModelProperty("街道名称") |
| | | private String streetName; |
| | | @ApiModelProperty("社区名称") |
| | | private String communityName; |
| | | @ApiModelProperty("网格名称") |
| | | private String gridName; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("事件处理结果") |
| | | private String processResult; |
| | | |
| | | @ApiModelProperty("业务处理类型 1 网格员处理 2 派发到社区 3 社区处理 4 社区标为无效 5 标为无效后处理 6 验证 7 撤销 8 重新发布已撤销事件 9 社区重新发布已标为无效的事件") |
| | | private Integer processType; |
| | | |
| | | @ApiModelProperty("事件处理人") |
| | | private String fromName; |
| | | |
| | | @ApiModelProperty(value = "来源类型(1、网格员2、社区3、是街道)",hidden = true) |
| | | private Integer fromType; |
| | | |
| | | @ApiModelProperty(value = "事件来源机构或网格员",hidden = true) |
| | | private Long fromId; |
| | | |
| | | @ApiModelProperty("上级关系") |
| | | private String superiorRelationship; |
| | | |
| | | @ApiModelProperty(value = "事件id",hidden = true) |
| | | private Long eventId; |
| | | |
| | | /** |
| | | * 来源类型(1、网格员2、社区3、是街道) |
| | | */ |
| | | public interface fromType{ |
| | | int wgy = 1; |
| | | int sq = 2; |
| | | int jd = 3; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.work; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussOptionVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("大屏社区活动列表返回参数") |
| | | public class ActActivityListVO { |
| | | |
| | | @ApiModelProperty("主键id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("负责人姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("负责人id") |
| | | private Long sponsorId; |
| | | |
| | | @ApiModelProperty("负责人头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("活动状态 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("活动开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date beginAt; |
| | | |
| | | @ApiModelProperty("活动结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endAt; |
| | | |
| | | @ApiModelProperty("报名开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signUpBegin; |
| | | |
| | | @ApiModelProperty("报名结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signUpEnd; |
| | | |
| | | @ApiModelProperty("志愿者人数下限") |
| | | private Integer volunteerMin; |
| | | |
| | | @ApiModelProperty("志愿者人数上限") |
| | | private Integer volunteerMax; |
| | | |
| | | @ApiModelProperty("参与者人数下限") |
| | | private Integer participantMin; |
| | | |
| | | @ApiModelProperty("参与者人数上限") |
| | | private Integer participantMax; |
| | | |
| | | @ApiModelProperty("活动名称") |
| | | private String activityName; |
| | | |
| | | @ApiModelProperty("活动内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("活动封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("活动地址") |
| | | private String activityAddr; |
| | | |
| | | @ApiModelProperty("居民参加人数") |
| | | private Integer participantCount; |
| | | |
| | | @ApiModelProperty("志愿者参加人数") |
| | | private Integer volunteerCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.work; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("大屏社区活动报名详情返回参数") |
| | | public class ActActivityPeopleListVO { |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("报名时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.work; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("大屏微心愿列表返回参数") |
| | | public class MicroListVO { |
| | | |
| | | @ApiModelProperty("主键id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("发起人姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("发起人id") |
| | | private Long sponsorId; |
| | | |
| | | @ApiModelProperty("发起人头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("发起人手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("状态 1待审核 2待分配 3进行中 4已驳回 5待确认6 已完成") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("发起时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("微心愿名称") |
| | | private String wishName; |
| | | |
| | | @ApiModelProperty("微心愿内容") |
| | | private String detail; |
| | | |
| | | @ApiModelProperty("活动封面") |
| | | private String photoPathList; |
| | | |
| | | @ApiModelProperty("集星数") |
| | | private Integer starNum; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date evaluateAt; |
| | | |
| | | @ApiModelProperty("评价星数") |
| | | private Integer score; |
| | | |
| | | @ApiModelProperty("负责人名字") |
| | | private String responsibleName; |
| | | |
| | | @ApiModelProperty("形式 1分配人员 2发起活动") |
| | | private Integer form; |
| | | |
| | | @ApiModelProperty("分配时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date distributionAt; |
| | | |
| | | @ApiModelProperty("完成情况描述") |
| | | private String finish; |
| | | |
| | | @ApiModelProperty("完成情况图片列表,逗号分隔") |
| | | private String finishPhotoPathList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "事件处理数据") |
| | | private List<EventTransferRecordVO> trans; |
| | | |
| | | @ApiModelProperty(value = "特殊人群列表") |
| | | private List<EventSpecialPopulationDetailsVO> populationList; |
| | | |
| | | @ApiModelProperty(value = "网格绑定社区id") |
| | | private Long communityId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | @ApiModel("特殊人群信息返回参数") |
| | | public class EventSpecialPopulationDetailsVO { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "身份证号码") |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | private Integer politicalOutlook; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("特殊人群上报-人口数据返回参数") |
| | | @EncryptDecryptClass |
| | | public class EventSpecialPopulationVO { |
| | | |
| | | @ApiModelProperty("实有人口id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty("人员标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty("居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("性别(1.男 2.女 3.保密)") |
| | | private Integer sex; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("居民详情返回参数") |
| | | @EncryptDecryptClass |
| | | public class PopulationDetailVO { |
| | | |
| | | @ApiModelProperty(value = "主键ID") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "身份证号码") |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty(value = "性别(1.男 2.女)") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "出生年月") |
| | | private String birthday; |
| | | |
| | | @ApiModelProperty(value = "籍贯") |
| | | private String nativePlace; |
| | | |
| | | @ApiModelProperty(value = "婚姻状况") |
| | | private String marriage; |
| | | |
| | | @ApiModelProperty(value = "文化程度") |
| | | private String cultureLevel; |
| | | |
| | | @ApiModelProperty(value = "健康状况") |
| | | private String healthy; |
| | | |
| | | @ApiModelProperty(value = "是否租住(0.否 1.是)") |
| | | private Integer isRent; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | private String road; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String doorNo; |
| | | |
| | | @ApiModelProperty("楼排号") |
| | | private String floor; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("户室(房间号)") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("工作单位") |
| | | private String workCompany; |
| | | |
| | | @ApiModelProperty("户口所在地") |
| | | private String censusRegister; |
| | | |
| | | @ApiModelProperty("外地or本地(1.本地 2.外地)") |
| | | private Integer outOrLocal; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("居民列表返回参数") |
| | | @EncryptDecryptClass |
| | | public class PopulationListVO { |
| | | |
| | | @ApiModelProperty(value = "主键ID") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "身份证号码") |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty(value = "性别(1.男 2.女)") |
| | | private String sex; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("发布人id") |
| | | private Long releaseId; |
| | | |
| | | @ApiModelProperty("发布人头像url") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("发布人") |
| | | private String releaseName; |
| | | |
| | |
| | | @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 List<PieElementVO> noneList; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:38 |
| | | */ |
| | | @ApiModel("大屏-工作-社区动态") |
| | | @Data |
| | | public class ComDynamicWorkScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("全部动态") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty("平均每天动态") |
| | | private Integer currentAvgNum = 0; |
| | | |
| | | @ApiModelProperty("最新动态列表") |
| | | private List<String> dynList; |
| | | |
| | | @ApiModelProperty("动态柱状图列表数据") |
| | | private List<DynamicWorkVO> list; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("事件格式化类") |
| | | public class DateScreenVO { |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("累计动态、新增动态") |
| | | public class DynamicWorkVO implements Serializable { |
| | | |
| | | @ApiModelProperty("月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("累计动态") |
| | | private Long dynTotal; |
| | | |
| | | @ApiModelProperty("新增动态") |
| | | private Long dynAdd; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String start; |
| | | @ApiModelProperty(hidden = true) |
| | | private String end; |
| | | } |
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; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("工作-事件管理-事件播报数据") |
| | | public class EventDetailWorkVO implements Serializable { |
| | | |
| | | @ApiModelProperty("事件id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("发布人昵称") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("发布人头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("事件上报时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("事件描述") |
| | | private String eventDes; |
| | | |
| | | @ApiModelProperty("危险级别:0 (无) 1(特别重大)、2(重大)、3(较大)、4(一般)") |
| | | private String dangerLevel; |
| | | |
| | | @ApiModelProperty("是否紧急") |
| | | private Boolean urgent; |
| | | |
| | | @ApiModelProperty("是否重大") |
| | | private Boolean major; |
| | | |
| | | @ApiModelProperty("事件发生地点") |
| | | private String happenAddress; |
| | | |
| | | @ApiModelProperty("事件发生地点备注") |
| | | private String happentAddress; |
| | | |
| | | @ApiModelProperty("事件发生经纬度(长在前短在后)") |
| | | private String happentLatLng; |
| | | |
| | | @ApiModelProperty("事件分类1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报") |
| | | private Integer eventType; |
| | | |
| | | @ApiModelProperty("事件处理状态(1待处理、2待验证、3已上报、4已解决、5草稿箱、6已撤销、7已失效 8 已发布)") |
| | | private Integer eventDealStatus; |
| | | |
| | | @ApiModelProperty(value = "是否红牌") |
| | | private Boolean redCard; |
| | | |
| | | @ApiModelProperty(value = "是否黄牌") |
| | | private Boolean yellowCard; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("解决事件、新增事件、事件数量") |
| | | public class EventTypeWorkVO implements Serializable { |
| | | |
| | | @ApiModelProperty("治安隐患") |
| | | private Integer zaTotal; |
| | | |
| | | @ApiModelProperty("公共服务") |
| | | private Integer ggTotal; |
| | | |
| | | @ApiModelProperty("矛盾纠纷") |
| | | private Integer mdTotal; |
| | | |
| | | @ApiModelProperty("不稳定因素") |
| | | private Integer bwdTotal; |
| | | |
| | | @ApiModelProperty("突发事件") |
| | | private Integer tfTotal; |
| | | |
| | | @ApiModelProperty("特殊人群上报") |
| | | private Integer tsTotal; |
| | | |
| | | @ApiModelProperty("随手拍") |
| | | private Integer sspTotal; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:38 |
| | | */ |
| | | @ApiModel("大屏-工作-事件管理") |
| | | @Data |
| | | public class EventWorkScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("已解决事件") |
| | | private Long resolvedNum = 0L; |
| | | |
| | | @ApiModelProperty("待处理事件") |
| | | private Long pendingNum = 0L; |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum = 0L; |
| | | |
| | | @ApiModelProperty("平均耗时") |
| | | private Integer avgCost = 0; |
| | | |
| | | @ApiModelProperty("宣传教育") |
| | | private Long propagandaNum = 0L; |
| | | |
| | | @ApiModelProperty("事件最新动态列表") |
| | | private List<EventDetailWorkVO> eventList; |
| | | |
| | | @ApiModelProperty("动态柱状图列表数据") |
| | | private List<EventWorkVO> list; |
| | | |
| | | @ApiModelProperty("已完成事件数据") |
| | | private EventTypeWorkVO complete; |
| | | |
| | | @ApiModelProperty("未完成事件数据") |
| | | private EventTypeWorkVO noComplete; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("解决事件、新增事件、事件数量") |
| | | public class EventWorkVO implements Serializable { |
| | | |
| | | @ApiModelProperty("月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("事件数量") |
| | | private Long eventTotal; |
| | | |
| | | @ApiModelProperty("新增事件") |
| | | private Long eventAdd; |
| | | |
| | | @ApiModelProperty("解决事件") |
| | | private Long eventSolve; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String start; |
| | | @ApiModelProperty(hidden = true) |
| | | private String end; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("党员活动") |
| | | private Long activity; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String start; |
| | | @ApiModelProperty(hidden = true) |
| | | private String end; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.enums.EventTasksStatusEnum; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/23 9:03 |
| | | */ |
| | | @ApiModel("app走访任务VO") |
| | | @Data |
| | | public class AppVisitTasksVO implements Serializable { |
| | | private static final long serialVersionUID = -5758072851661612412L; |
| | | |
| | | @ApiModelProperty("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("网格员id") |
| | | private Long gridMember; |
| | | |
| | | @ApiModelProperty("网格员") |
| | | private String gridMemberName; |
| | | |
| | | @ApiModelProperty("处理人id") |
| | | private Long dellUserId; |
| | | |
| | | @ApiModelProperty("处理人") |
| | | private String dellUserName; |
| | | |
| | | @ApiModelProperty("需走访人电话") |
| | | private String visiterTele; |
| | | |
| | | @ApiModelProperty("完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date submitDate; |
| | | |
| | | private Integer eventStatus; |
| | | |
| | | @ApiModelProperty("状态") |
| | | private String eventStatusName; |
| | | |
| | | public String getEventStatusName() { |
| | | |
| | | return EventTasksStatusEnum.getName(eventStatus); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/24 11:30 |
| | | */ |
| | | @ApiModel("完成走访DTO") |
| | | @Data |
| | | public class EventVisitCompleteDTO implements Serializable { |
| | | |
| | | @NotNull(message = "id不能为空") |
| | | @ApiModelProperty("id") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty("经纬度(,隔开)") |
| | | @NotEmpty(message = "经纬度不能为空") |
| | | private String latLng; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @NotEmpty(message = "地址不能为空") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("地址备注") |
| | | private String addressRemark; |
| | | |
| | | @ApiModelProperty("异常类型") |
| | | private Integer exception; |
| | | |
| | | @ApiModelProperty("异常描述") |
| | | private String dellDesc; |
| | | |
| | | @ApiModelProperty("异常选择") |
| | | private String option; |
| | | |
| | | @ApiModelProperty("家庭联系方式") |
| | | @NotEmpty(message = "家庭联系方式不能为空") |
| | | private String familyPhone; |
| | | |
| | | @ApiModelProperty("生活来源") |
| | | @NotEmpty(message = "生活来源不能为空") |
| | | private String familySource; |
| | | |
| | | private Integer eventStatus; |
| | | |
| | | @ApiModelProperty(value = "音频列表") |
| | | List<String> vosList; |
| | | |
| | | @ApiModelProperty(value = "图片列表") |
| | | List<String> imgList; |
| | | |
| | | @ApiModelProperty(value = "视频列表") |
| | | List<String> videoList; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** 后台走访统计 |
| | | * @author xyh |
| | | * @date 2021/6/21 14:34 |
| | | */ |
| | | @ApiModel("走访统计VO") |
| | | @Data |
| | | public class EventVisitCountVO { |
| | | |
| | | @ApiModelProperty("待走访") |
| | | private Long visit; |
| | | |
| | | @ApiModelProperty("已走访") |
| | | private Long visited; |
| | | |
| | | @ApiModelProperty("已撤销") |
| | | private Long canceled; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.enums.EventTasksStatusEnum; |
| | | import com.panzhihua.common.enums.EventTasksVisitorTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** 后台需走访人员VO |
| | | * @author xyh |
| | | * @date 2021/6/21 14:34 |
| | | */ |
| | | @ApiModel("需走访人员VO") |
| | | @Data |
| | | public class EventVisitListVO { |
| | | |
| | | @ApiModelProperty("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("真实姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号码") |
| | | private String cardNoStr; |
| | | |
| | | @ApiModelProperty(value = "人员标签") |
| | | private String visiterTypeName; |
| | | |
| | | private Integer visiterType; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "性别名称") |
| | | private String sexName; |
| | | |
| | | @ApiModelProperty(value = "现居地址") |
| | | private String address; |
| | | |
| | | private String politicalOutlook; |
| | | |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlookName; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("户籍地址") |
| | | private String censusRegister; |
| | | |
| | | @ApiModelProperty("户主") |
| | | private String houseHolder; |
| | | |
| | | @ApiModelProperty("关联实有房屋") |
| | | private String relationHouse; |
| | | |
| | | @ApiModelProperty("最近一次走访任务时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | private Integer eventStatus; |
| | | |
| | | @ApiModelProperty("最近一次走访任务状态") |
| | | private String eventStatusName; |
| | | |
| | | public String getEventStatusName() { |
| | | |
| | | return EventTasksStatusEnum.getName(eventStatus); |
| | | } |
| | | |
| | | public String getVisiterTypeName(){ |
| | | return EventTasksVisitorTypeEnum.getName(visiterType); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("重点人群走访记录详细返回参数") |
| | | public class EventVisitingTasksDetailsVO { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "网格员所处的街道") |
| | | private Long gridMemberStreet; |
| | | |
| | | @ApiModelProperty(value = "网格员所处社区") |
| | | private Long gridMemberCommunity; |
| | | |
| | | @ApiModelProperty(value = "网格员") |
| | | private Long gridMember; |
| | | |
| | | @ApiModelProperty(value = "网格员名字") |
| | | private String gridMemberName; |
| | | |
| | | @ApiModelProperty(value = "网格员联系方式") |
| | | private String gridMenberTele; |
| | | |
| | | @ApiModelProperty(value = "需走访人ID") |
| | | private Long visiterId; |
| | | |
| | | @ApiModelProperty(value = "需走访人名字") |
| | | private String visiterName; |
| | | |
| | | @ApiModelProperty(value = "需走访人员性别") |
| | | private Integer visiterSex; |
| | | |
| | | @ApiModelProperty(value = "需走访人电话") |
| | | private String visiterTele; |
| | | |
| | | @ApiModelProperty(value = "需走访人居住地址") |
| | | private String visiterAddress; |
| | | |
| | | @ApiModelProperty(value = "人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员") |
| | | private Integer visiterType; |
| | | |
| | | @ApiModelProperty(value = "事件标题") |
| | | private String eventTitle; |
| | | |
| | | @ApiModelProperty(value = "事件类型") |
| | | private Integer eventType; |
| | | |
| | | @ApiModelProperty(value = "事件描述") |
| | | private String eventDes; |
| | | |
| | | @ApiModelProperty(value = "社区处理(0是无需社区1是社区处理)") |
| | | private Integer actOpara; |
| | | |
| | | @ApiModelProperty(value = "发生时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date happenTime; |
| | | |
| | | @ApiModelProperty(value = "发生地点") |
| | | private String happentAddress; |
| | | |
| | | @ApiModelProperty(value = "发生的精度纬度信息(逗号隔开)") |
| | | private String happentLatLng; |
| | | |
| | | @ApiModelProperty(value = "事件状态(1待处理2自己已解决3待验证4草稿箱5已撤销6异常)") |
| | | private Integer eventStatus; |
| | | |
| | | @ApiModelProperty(value = "上报状态") |
| | | private Integer reporting; |
| | | |
| | | @ApiModelProperty(value = "当前处理对象类型(1、网格员2、社区3、是街道)") |
| | | private Integer dellType; |
| | | |
| | | @ApiModelProperty(value = "处理人ID") |
| | | private Long dellUserId; |
| | | |
| | | @ApiModelProperty(value = "处理人名称") |
| | | private String dellUserName; |
| | | |
| | | @ApiModelProperty(value = "处理时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date dellDate; |
| | | |
| | | @ApiModelProperty(value = "解决人针对解决事件的处理描述") |
| | | private String dellDesc; |
| | | |
| | | @ApiModelProperty(value = "是否有效") |
| | | private Boolean invalid; |
| | | |
| | | @ApiModelProperty(value = "是否紧急") |
| | | private Boolean urgent; |
| | | |
| | | @ApiModelProperty(value = "是否催办") |
| | | private Boolean urgentDell; |
| | | |
| | | @ApiModelProperty(value = "上报提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date submitDate; |
| | | |
| | | @ApiModelProperty(value = "是否异常行为") |
| | | private Boolean exception; |
| | | |
| | | @ApiModelProperty(value = "走访内容根据重点人员类型输入项不同,录入全部的表单内容数据") |
| | | private JSONObject tableContentJson; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createBy; |
| | | |
| | | @ApiModelProperty(value = "创建事件") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty(value = "修改人") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty(value = "异常选项") |
| | | private List<String> optionList; |
| | | |
| | | @ApiModelProperty(value = "音频列表") |
| | | List<String> vosList; |
| | | |
| | | @ApiModelProperty(value = "图片列表") |
| | | List<String> imgList; |
| | | |
| | | @ApiModelProperty(value = "视频列表") |
| | | List<String> videoList; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.visit; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.enums.EventTasksStatusEnum; |
| | | import com.panzhihua.common.enums.EventTasksVisitorTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("重点人群走访记录返回参数") |
| | | public class EventVisitingTasksVO { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ExcelProperty(value = "序号",index = 0) |
| | | private Integer rowNum; |
| | | |
| | | @ExcelProperty(value = "创建时间",index = 1) |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "创建人",index = 2) |
| | | @ApiModelProperty(value = "创建人") |
| | | private String creator; |
| | | |
| | | @ExcelProperty(value = "走访对象",index = 3) |
| | | @ApiModelProperty(value = "需走访人名字") |
| | | private String visiterName; |
| | | |
| | | |
| | | @ExcelProperty(value = "身份证号码",index = 4) |
| | | @ApiModelProperty(value = "身份证号码") |
| | | private String cardNoStr; |
| | | |
| | | @ExcelProperty(value = "走访地址",index = 5) |
| | | @ApiModelProperty(value = "走访地址") |
| | | private String visiterAddress; |
| | | |
| | | @ExcelProperty(value = "人员标签",index = 6) |
| | | @ApiModelProperty(value = "人员标签") |
| | | private String visiterTypeName; |
| | | |
| | | @ExcelProperty(value = "走访人",index = 7) |
| | | @ApiModelProperty(value = "走访人") |
| | | private String dellUserName; |
| | | |
| | | @ExcelProperty(value = "完成走访时间",index = 8) |
| | | @ApiModelProperty(value = "完成走访时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date submitDate; |
| | | |
| | | @ExcelProperty(value = "撤销时间",index = 9) |
| | | @ApiModelProperty(value = "撤销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date cancelTime; |
| | | |
| | | @ExcelProperty(value = "状态",index = 10) |
| | | @ApiModelProperty(value = "状态") |
| | | private String eventStatusName; |
| | | |
| | | |
| | | |
| | | @ExcelIgnore |
| | | @ApiModelProperty(value = "需走访人ID") |
| | | private Long visiterId; |
| | | |
| | | // @ApiModelProperty(value = "网格员所处的街道") |
| | | // private Long gridMemberStreet; |
| | | // |
| | | // @ApiModelProperty(value = "网格员所处社区") |
| | | // private Long gridMemberCommunity; |
| | | // |
| | | // @ApiModelProperty(value = "网格员") |
| | | // private Long gridMember; |
| | | // |
| | | // @ApiModelProperty(value = "网格员名字") |
| | | // private String gridMemberName; |
| | | // |
| | | // @ApiModelProperty(value = "网格员联系方式") |
| | | // private String gridMenberTele; |
| | | // |
| | | // |
| | | // @ApiModelProperty(value = "需走访人员性别") |
| | | // private Integer visiterSex; |
| | | // |
| | | // @ApiModelProperty(value = "需走访人电话") |
| | | // private String visiterTele; |
| | | // |
| | | // |
| | | @ExcelIgnore |
| | | private Integer visiterType; |
| | | // |
| | | // @ApiModelProperty(value = "事件标题") |
| | | // private String eventTitle; |
| | | // |
| | | // @ApiModelProperty(value = "事件类型") |
| | | // private Integer eventType; |
| | | // |
| | | // @ApiModelProperty(value = "事件描述") |
| | | // private String eventDes; |
| | | // |
| | | // @ApiModelProperty(value = "社区处理(0是无需社区1是社区处理)") |
| | | // private Integer actOpara; |
| | | // |
| | | // @ApiModelProperty(value = "发生时间") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | // private Date happenTime; |
| | | // |
| | | // @ApiModelProperty(value = "发生地点") |
| | | // private String happentAddress; |
| | | // |
| | | // @ApiModelProperty(value = "发生的精度纬度信息(逗号隔开)") |
| | | // private String happentLatLng; |
| | | // |
| | | @ExcelIgnore |
| | | private Integer eventStatus; |
| | | |
| | | public String getEventStatusName() { |
| | | if(eventStatus == null){ |
| | | return null; |
| | | } |
| | | return EventTasksStatusEnum.getName(eventStatus); |
| | | } |
| | | |
| | | public String getVisiterTypeName(){ |
| | | if(visiterType == null){ |
| | | return null; |
| | | } |
| | | return EventTasksVisitorTypeEnum.getName(visiterType); |
| | | } |
| | | // |
| | | // @ApiModelProperty(value = "上报状态") |
| | | // private Integer reporting; |
| | | // |
| | | // @ApiModelProperty(value = "当前处理对象类型(1、网格员2、社区3、是街道)") |
| | | // private Integer dellType; |
| | | // |
| | | // @ApiModelProperty(value = "处理人ID") |
| | | // private Long dellUserId; |
| | | // |
| | | // |
| | | // |
| | | // @ApiModelProperty(value = "处理时间") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | // private Date dellDate; |
| | | // |
| | | // |
| | | // @ApiModelProperty(value = "解决人针对解决事件的处理描述") |
| | | // private String dellDesc; |
| | | // |
| | | // @ApiModelProperty(value = "是否有效") |
| | | // private Boolean invalid; |
| | | // |
| | | // @ApiModelProperty(value = "是否紧急") |
| | | // private Boolean urgent; |
| | | // |
| | | // @ApiModelProperty(value = "是否催办") |
| | | // private Boolean urgentDell; |
| | | // |
| | | // @ApiModelProperty(value = "上报提交时间") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | // private Date submitDate; |
| | | // |
| | | // @ApiModelProperty(value = "是否异常行为") |
| | | // private Boolean exception; |
| | | // |
| | | // @ApiModelProperty(value = "走访内容根据重点人员类型输入项不同,录入全部的表单内容数据") |
| | | // private String tableContentJson; |
| | | // |
| | | // @ApiModelProperty(value = "创建人id") |
| | | // private Long createBy; |
| | | // |
| | | // |
| | | // @ApiModelProperty(value = "修改人") |
| | | // private Long updateBy; |
| | | // |
| | | // @ApiModelProperty(value = "修改时间") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | // private Date updateAt; |
| | | // |
| | | // @ApiModelProperty(value = "标签") |
| | | // private String label; |
| | | |
| | | |
| | | |
| | | } |
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.community.bigscreen.BigScreenStatisticPartyActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.PageBigScreenStatisticPartyOrg; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | 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.grid.PagePopulationListDTO; |
| | | 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("/screen/work/getScreenDiscussList") |
| | | R getScreenDiscussList(@RequestBody ScreenDiscussListDTO discussListDTO); |
| | | |
| | | /** |
| | | * 工作大屏-社区活动列表 |
| | | * @param actActivityListDTO 请求参数 |
| | | * @return 活动列表 |
| | | */ |
| | | @PostMapping("/screen/work/getScreenActActivityList") |
| | | R getScreenActActivityList(@RequestBody ScreenActActivityListDTO actActivityListDTO); |
| | | |
| | | /** |
| | | * 工作大屏-社区活动报名人员列表 |
| | | * @param activityPeopleListDTO 请求参数 |
| | | * @return 社区活动报名人员列表 |
| | | */ |
| | | @PostMapping("/screen/work/getActActivityPeopleList") |
| | | R getActActivityPeopleList(@RequestBody ScreenActActivityPeopleListDTO activityPeopleListDTO); |
| | | |
| | | /** |
| | | * 工作大屏-微心愿列表 |
| | | * @param microListDTO 请求参数 |
| | | * @return 微心愿列表 |
| | | */ |
| | | @PostMapping("/screen/work/getScreenMicroList") |
| | | R getScreenMicroList(@RequestBody ScreenMicroListDTO microListDTO); |
| | | |
| | | /** |
| | | * 获取系统参数接口 |
| | | * @param code 参数code |
| | | * @return 系统参数 |
| | | */ |
| | | @GetMapping("/sys/conf/get") |
| | | R getConf(@RequestParam("code") String code); |
| | | |
| | | /** |
| | | * 根据社区id获取社区下人口数据信息 |
| | | * @param populationListDTO 请求参数 |
| | | * @return 人口数据 |
| | | */ |
| | | @PostMapping("/population/list/app") |
| | | R getPopulationListByApp(@RequestBody PagePopulationListDTO populationListDTO); |
| | | |
| | | /** |
| | | * 根据人口id获取人口详情 |
| | | * @param populationId |
| | | * @return |
| | | */ |
| | | @GetMapping("/population/detail/app") |
| | | R getPopulationDetailByApp(@RequestParam("populationId") Long populationId); |
| | | |
| | | /** |
| | | * 修复人口加密问题 |
| | | * @return 修复结果 |
| | | */ |
| | | @GetMapping("/population/repair") |
| | | R getPopulationRepairByApp(); |
| | | |
| | | /** |
| | | * 工作大屏-社区动态模块数据统计 |
| | | * @param communityId 社区id |
| | | * @return 社区动态数据统计 |
| | | */ |
| | | @GetMapping("/screen/work/dynamic") |
| | | R dynamicWork(@RequestParam("communityId")Long communityId); |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/screen/event/list") |
| | | R getScreenEventList(@RequestBody ScreenEventListDTO eventListDTO); |
| | | |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | @PostMapping("/event/special/population/list") |
| | | R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO); |
| | | |
| | | /** |
| | | * 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); |
| | | |
| | | /** |
| | | * 工作大屏-事件管理模块数据统计 |
| | | * @param communityId 社区id |
| | | * @return 事件管理数据统计 |
| | | */ |
| | | @GetMapping("/screen/work/event") |
| | | R eventWork(@RequestParam("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 后台统计走访任务 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/eventvisitingtasks/count") |
| | | R countVisit(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询走访记录 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/list") |
| | | R list(@RequestBody EventTasksQuery query); |
| | | |
| | | /** |
| | | * 走访任务列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/taskList") |
| | | R taskList(@RequestBody EventTasksQuery query); |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/exportTaskList") |
| | | List<EventVisitingTasksVO> exportTaskList(@RequestBody EventTasksQuery query); |
| | | |
| | | /** |
| | | * 删除走访任务 |
| | | * @param ids |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/delete") |
| | | R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 被走访人员列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/visitorList") |
| | | R visitorList(@RequestBody EventVisitListQuery query); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 走访详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/eventvisitingtasks/detail/{id}") |
| | | R detail(@PathVariable("id") Long id); |
| | | |
| | | |
| | | /** |
| | | * 撤销走访 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/cancel/{id}") |
| | | R cancel(@PathVariable("id") Long id); |
| | | |
| | | /** |
| | | * 恢复走访 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/reset/{id}") |
| | | R reset(@PathVariable("id") Long id); |
| | | |
| | | /** |
| | | * 新增走访 |
| | | * @param ids |
| | | * @param communityId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/add") |
| | | R addVisitingTask(@RequestParam("ids") String ids,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 开始走访 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/start") |
| | | R start(@RequestParam("id")Long id,@RequestParam("userId")Long userId); |
| | | |
| | | /** |
| | | * 完成走访记录 |
| | | * @param taskCompleteDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/complete") |
| | | R complete(@RequestBody EventVisitCompleteDTO taskCompleteDTO); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 返回当前事件的时间戳 |
| | | * @return |
| | | */ |
| | | public static Long getCurrentDateTimeStamp(){ |
| | | return LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli(); |
| | | } |
| | | /** |
| | | * 获取当前时间字符串,格式为yyyy-MM-dd HH:mm:ss |
| | | * @return |
| | | */ |
| | |
| | | return date1.before(date2); |
| | | } |
| | | |
| | | /** |
| | | * date2比date1多的天数 |
| | | * @param date1 |
| | | * @param date2 |
| | | * @return |
| | | */ |
| | | public static int differentDays(Date date1,Date date2) |
| | | { |
| | | Calendar cal1 = Calendar.getInstance(); |
| | | cal1.setTime(date1); |
| | | |
| | | Calendar cal2 = Calendar.getInstance(); |
| | | cal2.setTime(date2); |
| | | int day1= cal1.get(Calendar.DAY_OF_YEAR); |
| | | int day2 = cal2.get(Calendar.DAY_OF_YEAR); |
| | | |
| | | int year1 = cal1.get(Calendar.YEAR); |
| | | int year2 = cal2.get(Calendar.YEAR); |
| | | if(year1 != year2) //同一年 |
| | | { |
| | | int timeDistance = 0 ; |
| | | for(int i = year1 ; i < year2 ; i ++) |
| | | { |
| | | if(i%4==0 && i%100!=0 || i%400==0) //闰年 |
| | | { |
| | | timeDistance += 366; |
| | | } |
| | | else //不是闰年 |
| | | { |
| | | timeDistance += 365; |
| | | } |
| | | } |
| | | |
| | | return timeDistance + (day2-day1) ; |
| | | } |
| | | else //不同年 |
| | | { |
| | | // System.out.println("判断day2 - day1 : " + (day2-day1)); |
| | | return day2-day1; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static void main(String[]args)throws Exception{ |
| | | isValidDate("2020/12/4"); |
| | | // Date date= new Date(); |
| | | // Date after = new Date(); |
| | | // System.out.println(calTimeDifference(date,after)); |
| | | System.out.println(getYearMonthStart(2021,2)); |
| | | |
| | | } |
| | | } |
| | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityPeopleListVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.DiscussListVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.MicroListVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.DetailNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | /** |
| | | * 邻里圈 |
| | |
| | | return communityService.pbWork(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区动态@lyq",response = ComDynamicWorkScreenVO.class) |
| | | @GetMapping("/dynamicWork") |
| | | public R dynamicWork(@RequestParam("communityId") Long communityId){ |
| | | return communityService.dynamicWork(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "事件管理@lyq",response = EventWorkScreenVO.class) |
| | | @GetMapping("/eventWork") |
| | | public R eventWork(@RequestParam("communityId") Long communityId){ |
| | | return gridService.eventWork(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍 |
| | | * @param communityId |
| | |
| | | return communityService.getScreenDiscussList(discussListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏社区活动列表接口@lyq",response = ActActivityListVO.class) |
| | | @PostMapping("/act/activity/list") |
| | | public R actActivityList(@RequestBody ScreenActActivityListDTO actActivityListDTO) { |
| | | if(actActivityListDTO.getCommunityId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.getScreenActActivityList(actActivityListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏社区活动报名详情接口@lyq",response = ActActivityPeopleListVO.class) |
| | | @PostMapping("/act/activity/people/list") |
| | | public R actActivityPeopleList(@RequestBody ScreenActActivityPeopleListDTO activityPeopleListDTO) { |
| | | return communityService.getActActivityPeopleList(activityPeopleListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏微心愿列表接口@lyq",response = MicroListVO.class) |
| | | @PostMapping("/micro/list") |
| | | public R microList(@RequestBody ScreenMicroListDTO microListDTO) { |
| | | if(microListDTO.getCommunityId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.getScreenMicroList(microListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏邻里圈列表接口@lyq",response = ComActNeighborCircleAdminVO.class) |
| | | @PostMapping("/neighbor/list") |
| | | public R neighborList(@RequestBody ComActNeighborCircleAdminDTO neighborCircleAdminDTO) { |
| | | if(neighborCircleAdminDTO.getCommunityId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.pageNeighborByAdmin(neighborCircleAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏邻里圈详情接口@lyq",response = ComActNeighborCircleAdminVO.class) |
| | | @GetMapping("/neighbor/detail") |
| | | public R neighborDetail(@RequestParam("id")Long id) { |
| | | return communityService.detailNeighborByAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏邻里圈详情的所有评论接口@lyq",response = ComActNeighborCommentByAdminVO.class) |
| | | @PostMapping("/neighbor/detail/comment") |
| | | public R detailNeighborAllCommentByAdmin(@RequestBody DetailNeighborAllCommentByAdminDTO dto){ |
| | | return communityService.detailNeighborAllCommentByAdmin(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏邻里圈评论详情接口@lyq",response = ComActNeighborCommentByAdminVO.class) |
| | | @GetMapping("/neighbor/detail/comment/detail") |
| | | public R detailNeighborCommentByAdmin(@RequestParam("id") Long id){ |
| | | return communityService.detailNeighborCommentByAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作大屏邻里圈评论详情回复列表接口@lyq",response = ComActNeighborCommentReplyByAdminVO.class) |
| | | @PostMapping("/neighbor/detail/comment/reply") |
| | | public R detailNeighborCommentAllReply(@RequestBody DetailNeighborCommentReplyByAdminDTO dto){ |
| | | return communityService.detailNeighborCommentAllReply(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区动态", response = ComActDynVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | if(comActDynVO.getCommunityId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.pageDynamicByAdmin(comActDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区动态详情", response = ComActDynVO.class) |
| | | @GetMapping("detaildynamic") |
| | | @ApiImplicitParam(name = "id", value = "社区动态主键", required = true) |
| | | public R detailDynamic(@RequestParam("id") Long id) { |
| | | return communityService.detailDynamic(id); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 允许的图片文件后缀 |
| | |
| | | sftp.logout(); |
| | | return R.ok(urlList); |
| | | } |
| | | |
| | | @GetMapping("/getConf/noToken") |
| | | @ApiOperation(value = "根据code查询系统配置") |
| | | public R getConf(@RequestParam("code") String code){ |
| | | return communityService.getConf(code); |
| | | } |
| | | } |
| | |
| | | if(eventType==null){ |
| | | return false; |
| | | } |
| | | boolean inType = eventType==1 | eventType==2 |eventType==3| eventType==4| eventType==5; |
| | | boolean inType = eventType==1 | eventType==2 |eventType==3| eventType==4| eventType==5| eventType==6; |
| | | return inType; |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataAreaVO; |
| | | import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return gridService.getNearByGrid(pageEventGridNearbyDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区特殊人群列表", response = EventSpecialPopulationVO.class) |
| | | @PostMapping("/special/population/list") |
| | | public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){ |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | specialPopulationDTO.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | return gridService.specialPopulationList(specialPopulationDTO); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridNearbyDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataAreaVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/population") |
| | | @Api(tags = {"网格综治居民管理 @lyq"}) |
| | | public class PopulationApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @PostMapping("/list") |
| | | @ApiOperation(value = "查询居民列表", response = PopulationListVO.class) |
| | | public R list(@RequestBody PagePopulationListDTO populationListDTO){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | populationListDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.getPopulationListByApp(populationListDTO); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "查询居民详情", response = PopulationDetailVO.class) |
| | | public R detail(@RequestParam("populationId") Long populationId){ |
| | | if(populationId == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.getPopulationDetailByApp(populationId); |
| | | } |
| | | |
| | | @GetMapping("/repair/noToken") |
| | | @ApiOperation(value = "修复居民身份证号码加密接口-不要乱调用") |
| | | public R repair(){ |
| | | return communityService.getPopulationRepairByApp(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksEditDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.visit.AppVisitTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** 走访任务 |
| | | * @author xyh |
| | | * @date 2021/6/23 9:01 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/visit/") |
| | | @Api(tags = {"走访任务"}) |
| | | public class VisitingTasksApi extends BaseController { |
| | | |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @ApiOperation(value = "走访记录-xyh", response = AppVisitTasksVO.class) |
| | | @PostMapping("/list") |
| | | public R list(@RequestBody EventTasksQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | return gridService.list(query); |
| | | } |
| | | |
| | | @ApiOperation(value = "走访任务-xyh", response = AppVisitTasksVO.class) |
| | | @PostMapping("/taskList") |
| | | public R taskList(@RequestBody EventTasksQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | return gridService.taskList(query); |
| | | } |
| | | |
| | | @ApiOperation(value = "走访详情-xyh", response = EventVisitingTasksDetailsVO.class) |
| | | @GetMapping("/detail/{id}") |
| | | public R detail(@PathVariable Long id){ |
| | | return gridService.detail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "开始走访-xyh") |
| | | @PostMapping("/start") |
| | | public R start(@RequestParam("id") Long id){ |
| | | return gridService.start(id,this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "完成走访记录-xyh") |
| | | @PostMapping("/complete") |
| | | public R complete(@RequestBody @Validated EventVisitCompleteDTO taskCompleteDTO){ |
| | | return gridService.complete(taskCompleteDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksAddDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.IPageVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.visit.AppVisitTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCountVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitListVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | 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 javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** 走访任务 |
| | | * @author xyh |
| | | * @date 2021/6/21 14:20 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/event/visit") |
| | | @Api(tags = {"走访任务 @xyh"}) |
| | | public class EventVisitingTasksApi extends BaseController { |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | |
| | | /** |
| | | * 走访任务统计 |
| | | * @return |
| | | */ |
| | | @GetMapping("/count") |
| | | @ApiOperation(value = "走访任务统计", response= EventVisitCountVO.class) |
| | | public R count(){ |
| | | return gridService.countVisit(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 走访任务列表 |
| | | * @return |
| | | */ |
| | | @PostMapping("/taskList") |
| | | @ApiOperation(value = "走访任务列表", response= EventVisitingTasksVO.class) |
| | | public R taskList(@RequestBody EventTasksQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | return gridService.taskList(query); |
| | | } |
| | | |
| | | /** |
| | | * 走访任务记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | @ApiOperation(value = "走访任务记录", response= AppVisitTasksVO.class) |
| | | public R list(@RequestBody EventTasksQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | return gridService.list(query); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 走访任务删除 |
| | | * @return |
| | | */ |
| | | @PostMapping("/delete") |
| | | @ApiOperation(value = "删除走访任务") |
| | | public R delete(@RequestParam("ids") String ids){ |
| | | return gridService.delete(ids,this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 走访任务导出 |
| | | * @return |
| | | */ |
| | | @GetMapping("/export") |
| | | @ApiOperation(value = "导出走访任务") |
| | | public void export(HttpServletResponse response,EventTasksQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | query.setPageNum(1L); |
| | | query.setPageSize(2000L); |
| | | ServletOutputStream os = null; |
| | | try { |
| | | os = response.getOutputStream(); |
| | | List<EventVisitingTasksVO> list = gridService.exportTaskList(query); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = "走访任务-"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20") + ".xlsx"); |
| | | // 如果不用模板的方式导出的话,是doWrite |
| | | EasyExcel.write(response.getOutputStream(), EventVisitingTasksVO.class).sheet(fileName).doWrite(list); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | if(os != null){ |
| | | try { |
| | | os.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 待走访人员列表 |
| | | * @return |
| | | */ |
| | | @PostMapping("/visitorList") |
| | | @ApiOperation(value = "待走访人员列表", response= EventVisitListVO.class) |
| | | public R visitorList(@RequestBody EventVisitListQuery query){ |
| | | query.setCommunityId(this.getCommunityId()); |
| | | return gridService.visitorList(query); |
| | | } |
| | | |
| | | /** |
| | | * 待走访人员详情 |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "待走访人员详情") |
| | | public R detail(@PathVariable("id") Long id){ |
| | | return gridService.detail(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增走访任务 |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "新增走访任务") |
| | | public R add(@RequestParam("ids") String ids){ |
| | | return gridService.addVisitingTask(ids,this.getCommunityId(),this.getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 撤销走访任务 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancel") |
| | | @ApiOperation(value = "撤销走访任务") |
| | | public R cancel(@RequestParam("id") Long id){ |
| | | return gridService.cancel(id); |
| | | } |
| | | |
| | | /** |
| | | * 恢复走访任务 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/reset") |
| | | @ApiOperation(value = "新增走访任务") |
| | | public R reset(@RequestParam("id") Long id){ |
| | | return gridService.reset(id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <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.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.panzhihua.common.api.LangchaoApiConstants; |
| | | import com.panzhihua.common.api.LcReturnObject; |
| | | 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.common.utlis.DateUtils; |
| | | 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("submit上传浪潮事件信息:{}", 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())); |
| | | String caseTypeName = LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType()); |
| | | eventInfo.setCaseTypeName(caseTypeName); |
| | | if (eventInfoVo.getEventCategory() != 1L) { |
| | | eventInfo.setHappenTime(String.valueOf(eventInfoVo.getPropagandaTime().getTime())); |
| | | } else { |
| | | 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(DateUtils.getCurrentDateTimeStamp().toString()); |
| | | eventInfo.setCaseName(gridData.getGridName().concat(caseTypeName)); |
| | | log.info("事件请求数据:{}", JSONObject.toJSONString(eventInfo)); |
| | | String remoteData = submitEventRegister(eventInfo); |
| | | LcReturnObject lcReturnObject = JSONObject.parseObject(remoteData, LcReturnObject.class); |
| | | log.info("提交浪潮服务器,接口返回结果为:{}", remoteData); |
| | | if (lcReturnObject.getSuccess()) { |
| | | 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 automationUploadEventAndFile() { |
| | | lcApiService.automationUploadEventAndFile(); |
| | | } |
| | | |
| | | |
| | | @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(4545676L); |
| | | 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())); |
| | | String caseTypeName= LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType()); |
| | | eventInfo.setCaseTypeName(caseTypeName); |
| | | 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(gridData.getGridName().concat(caseTypeName).concat(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) { |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/population/") |
| | | public class PopulationApi { |
| | | |
| | | @Resource |
| | | private ComMngPopulationService comMngPopulationService; |
| | | |
| | | @PostMapping("/list/app") |
| | | public R pagePopulationList(@RequestBody PagePopulationListDTO populationListDTO) { |
| | | return comMngPopulationService.pagePopulationListApp(populationListDTO); |
| | | } |
| | | |
| | | @GetMapping("/detail/app") |
| | | public R getPopulationDetail(@RequestParam("populationId") Long populationId) { |
| | | return comMngPopulationService.getPopulationDetailApp(populationId); |
| | | } |
| | | |
| | | @GetMapping("/repair") |
| | | public R repair() { |
| | | return comMngPopulationService.getPopulationRepairByApp(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | import com.panzhihua.service_community.service.ComActDiscussService; |
| | | import com.panzhihua.service_community.service.ComActMicroWishService; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private ScreenWorkService screenWorkService; |
| | | @Resource |
| | | private ComActDiscussService comActDiscussService; |
| | | @Resource |
| | | private ComActActivityService comActActivityService; |
| | | @Resource |
| | | private ComActMicroWishService comActMicroWishService; |
| | | |
| | | /** |
| | | * |
| | | * 大屏统计邻里圈 |
| | | * 状态-显示(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 |
| | | */ |
| | |
| | | */ |
| | | @PostMapping("/getScreenDiscussList") |
| | | public R getScreenDiscussList(@RequestBody ScreenDiscussListDTO discussListDTO) { |
| | | return R.ok(comActDiscussService.getScreenDiscussList(discussListDTO)); |
| | | return comActDiscussService.getScreenDiscussList(discussListDTO); |
| | | } |
| | | |
| | | @PostMapping("/getScreenActActivityList") |
| | | public R getScreenActActivityList(@RequestBody ScreenActActivityListDTO actActivityListDTO) { |
| | | return comActActivityService.getScreenActActivityList(actActivityListDTO); |
| | | } |
| | | |
| | | @PostMapping("/getActActivityPeopleList") |
| | | public R getActActivityPeopleList(@RequestBody ScreenActActivityPeopleListDTO activityPeopleListDTO) { |
| | | return comActActivityService.getActActivityPeopleList(activityPeopleListDTO); |
| | | } |
| | | |
| | | @PostMapping("/getScreenMicroList") |
| | | public R getScreenMicroList(@RequestBody ScreenMicroListDTO microListDTO) { |
| | | return comActMicroWishService.getScreenMicroList(microListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 工作大屏-社区动态模块数据统计 |
| | | * @param communityId 社区id |
| | | * @return 社区动态数据统计 |
| | | */ |
| | | @GetMapping("/dynamic") |
| | | public R dynamic(@RequestParam("communityId")Long communityId){ |
| | | return screenWorkService.dynamicWork(communityId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.SysConfDO; |
| | | import com.panzhihua.service_community.service.SysConfService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/sys/conf/") |
| | | public class SysConfApi { |
| | | |
| | | @Resource |
| | | private SysConfService sysConfService; |
| | | |
| | | @GetMapping("get") |
| | | public R get(@RequestParam("code") String code) { |
| | | SysConfDO sysConfDO = sysConfService.getOne(new QueryWrapper<SysConfDO>().lambda().eq(SysConfDO::getCode,code)); |
| | | String value = Constants.ZZ_APP_TAG_LIST; |
| | | if(sysConfDO != null){ |
| | | value = sysConfDO.getValue(); |
| | | } |
| | | return R.ok(value); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityPeopleListVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface ComActActSignDAO extends BaseMapper<ComActActSignDO> { |
| | | // 居民 党员 志愿者 1 2 3 |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "u.user_id id,\n" + |
| | | "u.image_url,\n" + |
| | | "u.name,\n" + |
| | | "u.nick_name,\n" + |
| | | "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity,\n" + |
| | | "u.phone,\n" + |
| | | "a.create_at, \n" + |
| | | "a.is_volunteer \n" + |
| | | "FROM\n" + |
| | | "com_act_act_sign a\n" + |
| | | "JOIN sys_user u ON a.user_id = u.user_id \n" + |
| | | "WHERE\n" + |
| | | "a.activity_id = #{activityId} \n" + |
| | | "SELECT " + |
| | | "u.user_id id, " + |
| | | "u.image_url, " + |
| | | "u.name, " + |
| | | "u.nick_name, " + |
| | | "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " + |
| | | "u.phone, " + |
| | | "a.create_at, " + |
| | | "a.is_volunteer " + |
| | | "FROM " + |
| | | "com_act_act_sign a " + |
| | | "JOIN sys_user u ON a.user_id = u.user_id " + |
| | | "WHERE " + |
| | | "a.activity_id = #{activityId} " + |
| | | "<if test='phone != null and phone.trim() != ""'>" + |
| | | "AND u.phone = #{phone} \n" + |
| | | "AND u.phone = #{phone} " + |
| | | " </if> " + |
| | | "<if test='name != null and name.trim() != ""'>" + |
| | | "AND u.`name` = #{name} \n" + |
| | | "AND u.`name` = #{name} " + |
| | | " </if> " + |
| | | "<if test='identity != null and identity.trim() != "" and identity==1'>" + |
| | | "AND u.is_partymember = 0 and a.is_volunteer=0 \n" + |
| | | "AND u.is_partymember = 0 and a.is_volunteer=0 " + |
| | | " </if> " + |
| | | "<if test='identity != null and identity.trim() != "" and identity==2'>" + |
| | | "AND u.is_partymember = 1 \n" + |
| | | "AND u.is_partymember = 1 " + |
| | | " </if> " + |
| | | "<if test='identity != null and identity.trim() != "" and identity==3'>" + |
| | | "AND a.is_volunteer=1 \n" + |
| | | "AND a.is_volunteer=1 " + |
| | | " </if> " + |
| | | "<if test='type != null and type != 0'>" + |
| | | "AND a.is_volunteer=#{type}-1 \n" + |
| | | "AND a.is_volunteer=#{type}-1 " + |
| | | " </if> " + |
| | | " order by a.create_at desc "+ |
| | | "</script>") |
| | | List<ActivitySignVO> listActivitySign(ActivitySignVO activitySignVO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " caas.user_id, " + |
| | | " su.NAME, " + |
| | | "CASE " + |
| | | " WHEN su.is_volunteer = 1 THEN " + |
| | | " '志愿者' ELSE '居民' " + |
| | | " END identity, " + |
| | | " su.phone, " + |
| | | " caas.create_at " + |
| | | "FROM " + |
| | | " com_act_act_sign AS caas " + |
| | | " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id where caas.activity_id = #{activityPeopleListDTO.activityId} " + |
| | | "<if test='activityPeopleListDTO.phone != null and activityPeopleListDTO.phone != ""'>" + |
| | | " and su.phone like concat (#{activityPeopleListDTO.phone},'%') "+ |
| | | " </if> " + |
| | | "<if test='activityPeopleListDTO.cardNo != null and activityPeopleListDTO.cardNo != ""'>" + |
| | | " AND su.id_card = #{activityPeopleListDTO.cardNo} " + |
| | | " </if> " + |
| | | "<if test='activityPeopleListDTO.name != null and activityPeopleListDTO.name != ""'>" + |
| | | " AND su.name like concat (#{activityPeopleListDTO.name},'%') "+ |
| | | " </if> " + |
| | | " </script>") |
| | | IPage<ActActivityPeopleListVO> getActActivityPeopleList(Page page,@Param("activityPeopleListDTO") ScreenActActivityPeopleListDTO activityPeopleListDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityActivitiesVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityGovernanceTrendsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.PageActivityMembersVO; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + |
| | | "SELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "u.`name` sponsorName,\n" + |
| | | "a.activity_addr,\n" + |
| | | "a.`status`,\n" + |
| | | "a.publish_at,\n" + |
| | | "a.begin_at,\n" + |
| | | "a.cover,\n" + |
| | | "a.end_at,\n" + |
| | | "a.volunteer_max,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now,\n"+ |
| | | "a.participant_max,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end,\n" + |
| | | "ca.name as communityName \n" + |
| | | "FROM\n" + |
| | | "com_act_activity a \n" + |
| | | "join sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "left join com_act_act_sign s on a.id=s.activity_id \n"+ |
| | | "left join com_act ca on a.community_id=ca.community_id \n"+ |
| | | "SELECT " + |
| | | "a.id, " + |
| | | "a.activity_name, " + |
| | | "u.`name` sponsorName, " + |
| | | "a.activity_addr, " + |
| | | "a.`status`, " + |
| | | "a.publish_at, " + |
| | | "a.begin_at, " + |
| | | "a.cover, " + |
| | | "a.end_at, " + |
| | | "a.volunteer_max, " + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now, "+ |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now, "+ |
| | | "a.participant_max, " + |
| | | "a.sign_up_begin, " + |
| | | "a.sign_up_end, " + |
| | | "ca.name as communityName " + |
| | | "FROM " + |
| | | "com_act_activity a " + |
| | | "join sys_user u on a.sponsor_id=u.user_id " + |
| | | "left join com_act_act_sign s on a.id=s.activity_id "+ |
| | | "left join com_act ca on a.community_id=ca.community_id "+ |
| | | " where 1=1 " + |
| | | |
| | | "<if test='comActActivityVO.choice == 0 '>" + |
| | | "AND a.community_id=#{comActActivityVO.communityId}\n" + |
| | | "AND a.community_id=#{comActActivityVO.communityId} " + |
| | | " </if> " + |
| | | |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != ""'>" + |
| | | " and a.activity_name like concat(#{comActActivityVO.activityName},'%') \n" + |
| | | " and a.activity_name like concat(#{comActActivityVO.activityName},'%') " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng==null'>" + |
| | | "AND a.`status` = #{comActActivityVO.status} \n" + |
| | | "AND a.`status` = #{comActActivityVO.status} " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng!=null and comActActivityVO.isIng==1'>" + |
| | | "AND a.`status` in (3,4) \n" + |
| | | "AND a.`status` in (3,4) " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" + |
| | | "AND a.`status` != 1 AND a.`status` != 6 \n" + |
| | | "AND a.`status` != 1 AND a.`status` != 6 " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.type != null and comActActivityVO.type==1 '>" + |
| | | "AND a.volunteer_max!=0 \n" + |
| | | "AND a.volunteer_max!=0 " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.type != null and comActActivityVO.type==2 '>" + |
| | | "AND a.participant_max!=0 \n" + |
| | | "AND a.participant_max!=0 " + |
| | | " </if> " + |
| | | " group by a.id "+ |
| | | " order by a.status asc,a.publish_at desc "+ |
| | | "</script>") |
| | | IPage<ComActActivityVO> pageActivity( Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Select("SELECT \n" + |
| | | "u.name sponsorName,\n" + |
| | | "ca.name communityName,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now,\n"+ |
| | | "a.* \n" + |
| | | "FROM \n" + |
| | | "com_act_activity a \n" + |
| | | "join sys_user u on a.sponsor_id=u.user_id \n"+ |
| | | "left join com_act_act_sign s on a.id=s.activity_id \n"+ |
| | | "left join com_act ca on a.community_id=ca.community_id \n"+ |
| | | "where a.id=#{id} \n"+ |
| | | @Select("SELECT " + |
| | | "u.name sponsorName, " + |
| | | "ca.name communityName, " + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now, "+ |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now, "+ |
| | | "a.* " + |
| | | "FROM " + |
| | | "com_act_activity a " + |
| | | "join sys_user u on a.sponsor_id=u.user_id "+ |
| | | "left join com_act_act_sign s on a.id=s.activity_id "+ |
| | | "left join com_act ca on a.community_id=ca.community_id "+ |
| | | "where a.id=#{id} "+ |
| | | " group by a.id " |
| | | ) |
| | | ComActActivityVO inforActivity(Long id); |
| | | |
| | | @Select("SELECT\n" + |
| | | "a.* \n" + |
| | | "FROM\n" + |
| | | "com_act_act_sign s\n" + |
| | | "JOIN com_act_activity a ON s.activity_id = a.id \n" + |
| | | "WHERE\n" + |
| | | "s.user_id = #{comActActivityVO.sponsorId} \n" + |
| | | "ORDER BY\n" + |
| | | @Select("SELECT " + |
| | | "a.* " + |
| | | "FROM " + |
| | | "com_act_act_sign s " + |
| | | "JOIN com_act_activity a ON s.activity_id = a.id " + |
| | | "WHERE " + |
| | | "s.user_id = #{comActActivityVO.sponsorId} " + |
| | | "ORDER BY " + |
| | | "s.create_at DESC") |
| | | IPage<ComActActivityVO> pageMyActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | |
| | | "join sys_user u on s.user_id=u.user_id and u.phone=#{phone} and s.is_volunteer=1 " + |
| | | "join com_act_activity t on s.activity_id=t.id and t.status=5") |
| | | List<ComActActivityVO> listActivityByPhone(String phone); |
| | | @Select("select t.id from (\n" + |
| | | "SELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "COUNT(case when s.is_volunteer=1 then s.id else null end )volunteernum,\n" + |
| | | "COUNT(case when s.is_volunteer=0 then s.id else null end)usernum,\n" + |
| | | "a.participant_min,\n" + |
| | | "a.volunteer_min\n" + |
| | | "FROM\n" + |
| | | "com_act_activity a \n" + |
| | | "LEFT JOIN com_act_act_sign s on a.id=s.activity_id \n" + |
| | | "WHERE\n" + |
| | | "a.`status` in(3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),a.sign_up_end)<=0\n" + |
| | | @Select("select t.id from ( " + |
| | | "SELECT " + |
| | | "a.id, " + |
| | | "a.activity_name, " + |
| | | "COUNT(case when s.is_volunteer=1 then s.id else null end )volunteernum, " + |
| | | "COUNT(case when s.is_volunteer=0 then s.id else null end)usernum, " + |
| | | "a.participant_min, " + |
| | | "a.volunteer_min " + |
| | | "FROM " + |
| | | "com_act_activity a " + |
| | | "LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + |
| | | "WHERE " + |
| | | "a.`status` in(3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),a.sign_up_end)<=0 " + |
| | | "GROUP BY a.id)t WHERE t.usernum<participant_min or t.volunteernum<volunteer_min") |
| | | List<Long> selectTimedTaskActActivity(); |
| | | |
| | | @Update("<script> " + |
| | | "update com_act_activity set `status`=6 where id in\n" + |
| | | "<foreach item=\"item\" collection=\"longs\" separator=\",\" open=\"(\" close=\")\" index=\"\">\n"+ |
| | | "#{item}\n"+ |
| | | "</foreach>\n"+ |
| | | "update com_act_activity set `status`=6 where id in " + |
| | | "<foreach item=\"item\" collection=\"longs\" separator=\",\" open=\"(\" close=\")\" index=\"\"> "+ |
| | | "#{item} "+ |
| | | "</foreach> "+ |
| | | "</script>") |
| | | int updateIdBatch(@Param("longs") List<Long> longs); |
| | | |
| | |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | @Select("<script> " + |
| | | "select t.* from (\n" + |
| | | "SELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "u.`name` sponsorName,\n" + |
| | | "a.activity_addr,\n" + |
| | | "a.participant_max,\n" + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now,\n"+ |
| | | "a.volunteer_max,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "a.`status`,\n" + |
| | | "a.publish_at,\n" + |
| | | "a.begin_at,\n" + |
| | | "a.end_at,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_activity a \n" + |
| | | "\tLEFT JOIN sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "\tLEFT JOIN com_act_act_sign s on a.id=s.activity_id\n" + |
| | | "WHERE\n" + |
| | | "\t a.`status` = 1 and a.community_id=#{comActActivityVO.communityId}\n" + |
| | | "select t.* from ( " + |
| | | "SELECT " + |
| | | "a.id, " + |
| | | "a.activity_name, " + |
| | | "u.`name` sponsorName, " + |
| | | "a.activity_addr, " + |
| | | "a.participant_max, " + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now, "+ |
| | | "a.volunteer_max, " + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now, "+ |
| | | "a.`status`, " + |
| | | "a.publish_at, " + |
| | | "a.begin_at, " + |
| | | "a.end_at, " + |
| | | "a.sign_up_begin, " + |
| | | "a.sign_up_end " + |
| | | "FROM " + |
| | | " com_act_activity a " + |
| | | " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + |
| | | " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + |
| | | "WHERE " + |
| | | " a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} " + |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" + |
| | | "\tand a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) \n" + |
| | | " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>" + |
| | | "AND a.`status` = 99 \n" + |
| | | "AND a.`status` = 99 " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " + |
| | | " </if> " + |
| | | "group by a.id\n" + |
| | | "\t\n" + |
| | | "\tunion all\n" + |
| | | "select t1.* from (\n"+ |
| | | "\t\n" + |
| | | "\tSELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "u.`name` sponsorName,\n" + |
| | | "a.activity_addr,\n" + |
| | | "a.participant_max,\n" + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now,\n"+ |
| | | "a.volunteer_max,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "a.`status`,\n" + |
| | | "a.publish_at,\n" + |
| | | "a.begin_at,\n" + |
| | | "a.end_at,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_activity a \n" + |
| | | "\tLEFT JOIN sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "\tLEFT JOIN com_act_act_sign s on a.id=s.activity_id\n" + |
| | | "WHERE\n" + |
| | | "\t a.`status` != 1 and a.community_id=#{comActActivityVO.communityId}\n" + |
| | | "group by a.id " + |
| | | " " + |
| | | " union all " + |
| | | "select t1.* from ( "+ |
| | | " " + |
| | | " SELECT " + |
| | | "a.id, " + |
| | | "a.activity_name, " + |
| | | "u.`name` sponsorName, " + |
| | | "a.activity_addr, " + |
| | | "a.participant_max, " + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now, "+ |
| | | "a.volunteer_max, " + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now, "+ |
| | | "a.`status`, " + |
| | | "a.publish_at, " + |
| | | "a.begin_at, " + |
| | | "a.end_at, " + |
| | | "a.sign_up_begin, " + |
| | | "a.sign_up_end " + |
| | | "FROM " + |
| | | " com_act_activity a " + |
| | | " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + |
| | | " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + |
| | | "WHERE " + |
| | | " a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} " + |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" + |
| | | "\tand a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) \n" + |
| | | " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>" + |
| | | "AND a.`status` = #{comActActivityVO.status} \n" + |
| | | "AND a.`status` = #{comActActivityVO.status} " + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " + |
| | | " </if> " + |
| | | " group by a.id order by a.publish_at desc)t1 )t"+ |
| | | "</script>") |
| | |
| | | |
| | | @Update("update com_act_activity set `status`=4 where `status`=3 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginAfterSingEnd(); |
| | | @Select("select GROUP_CONCAT(t.x1,',',t.x2,',',t.x3,',',t.x4) from (\n" + |
| | | "SELECT\n" + |
| | | "(select COUNT(d.id) from com_act_discuss d where d.community_id=#{communityId})x1,\n" + |
| | | "(select COUNT(w.id) from com_act_micro_wish w where w.community_id=#{communityId})x2,\n" + |
| | | "(select COUNT(p.id) from com_act_easy_photo p where p.community_id=#{communityId})x3,\n" + |
| | | "\tCOUNT( a.id ) x4\n" + |
| | | "FROM\n" + |
| | | "\tcom_pb_activity a \n" + |
| | | "WHERE\n" + |
| | | "\t a.community_id =#{communityId})t") |
| | | @Select("select GROUP_CONCAT(t.x1,',',t.x2,',',t.x3,',',t.x4) from ( " + |
| | | "SELECT " + |
| | | "(select COUNT(d.id) from com_act_discuss d where d.community_id=#{communityId})x1, " + |
| | | "(select COUNT(w.id) from com_act_micro_wish w where w.community_id=#{communityId})x2, " + |
| | | "(select COUNT(p.id) from com_act_easy_photo p where p.community_id=#{communityId})x3, " + |
| | | " COUNT( a.id ) x4 " + |
| | | "FROM " + |
| | | " com_pb_activity a " + |
| | | "WHERE " + |
| | | " a.community_id =#{communityId})t") |
| | | String selectCommunityGovernanceTrendsVO(Long communityId); |
| | | @Select("\n" + |
| | | "\tSELECT\n" + |
| | | "\t(select COUNT(d.id) from com_act_discuss d where DATE_FORMAT(d.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and d.community_id=#{communityId})discuss,\n" + |
| | | "\t(select COUNT(w.id) from com_act_micro_wish w where DATE_FORMAT(w.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and w.community_id=#{communityId})microWish,\n" + |
| | | "\t(select COUNT(p.id) from com_act_easy_photo p where DATE_FORMAT(p.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and p.community_id=#{communityId})eashPhoto,\n" + |
| | | "\t(select COUNT(pa.id) from com_pb_activity pa where DATE_FORMAT(pa.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and pa.community_id=#{communityId})pbActivity,\n" + |
| | | "\t\tCOUNT( a.id ) actActivity\n" + |
| | | "\tFROM\n" + |
| | | "\t\tcom_pb_activity a \n" + |
| | | "\tWHERE\n" + |
| | | "\t\tDATE_FORMAT( a.create_at, '%Y-%m-%d' )=DATE_FORMAT(#{date},'%Y-%m-%d') \n" + |
| | | "\t\tAND a.community_id =#{communityId}") |
| | | @Select(" " + |
| | | " SELECT " + |
| | | " (select COUNT(d.id) from com_act_discuss d where DATE_FORMAT(d.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and d.community_id=#{communityId})discuss, " + |
| | | " (select COUNT(w.id) from com_act_micro_wish w where DATE_FORMAT(w.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and w.community_id=#{communityId})microWish, " + |
| | | " (select COUNT(p.id) from com_act_easy_photo p where DATE_FORMAT(p.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and p.community_id=#{communityId})eashPhoto, " + |
| | | " (select COUNT(pa.id) from com_pb_activity pa where DATE_FORMAT(pa.create_at,'%Y-%m-%d')=DATE_FORMAT(#{date},'%Y-%m-%d') and pa.community_id=#{communityId})pbActivity, " + |
| | | " COUNT( a.id ) actActivity " + |
| | | " FROM " + |
| | | " com_pb_activity a " + |
| | | " WHERE " + |
| | | " DATE_FORMAT( a.create_at, '%Y-%m-%d' )=DATE_FORMAT(#{date},'%Y-%m-%d') " + |
| | | " AND 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); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " caa.id, " + |
| | | " su.`name` AS userName , " + |
| | | " su.image_url, " + |
| | | " caa.sponsor_id, " + |
| | | " caa.`status`, " + |
| | | " caa.create_at, " + |
| | | " caa.begin_at, " + |
| | | " caa.end_at, " + |
| | | " caa.sign_up_begin, " + |
| | | " caa.sign_up_end, " + |
| | | " caa.volunteer_min, " + |
| | | " caa.volunteer_max, " + |
| | | " caa.participant_min, " + |
| | | " caa.participant_max, " + |
| | | " caa.activity_name, " + |
| | | " caa.cover, " + |
| | | " caa.content, " + |
| | | " caa.activity_addr " + |
| | | "FROM " + |
| | | " com_act_activity AS caa " + |
| | | " LEFT JOIN sys_user AS su ON su.user_id = caa.sponsor_id" + |
| | | " <where> "+ |
| | | "<if test='actActivityListDTO.communityId != null '>" + |
| | | " and caa.community_id = #{actActivityListDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='actActivityListDTO.startTime!=null and actActivityListDTO.startTime != ""'>" + |
| | | " AND DATE_FORMAT(caa.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{actActivityListDTO.startTime} " + |
| | | " </if> " + |
| | | "<if test='actActivityListDTO.endTime!=null and actActivityListDTO.endTime != ""'>" + |
| | | " AND DATE_FORMAT(caa.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{actActivityListDTO.endTime} " + |
| | | " </if> " + |
| | | "<if test='actActivityListDTO.type!=null'>" + |
| | | " AND caa.type = #{actActivityListDTO.type} " + |
| | | " </if> " + |
| | | " </where> "+ |
| | | "ORDER BY " + |
| | | " caa.create_at DESC " + |
| | | " </script>") |
| | | IPage<ActActivityListVO> getScreenActActivityList(Page page, @Param("actActivityListDTO") ScreenActActivityListDTO actActivityListDTO); |
| | | |
| | | @Select("SELECT " + |
| | | " count( caas.id ) AS volunteerCount,( " + |
| | | " SELECT " + |
| | | " count( caas1.id ) " + |
| | | " FROM " + |
| | | " com_act_act_sign AS caas1 " + |
| | | " LEFT JOIN sys_user AS su1 ON su1.user_id = caas1.user_id " + |
| | | " WHERE " + |
| | | " su1.is_volunteer = 0 " + |
| | | " AND caas1.activity_id = #{activityId} " + |
| | | " ) AS participantCount " + |
| | | "FROM " + |
| | | " com_act_act_sign AS caas " + |
| | | " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id " + |
| | | "WHERE " + |
| | | " su.is_volunteer = 1 " + |
| | | " AND activity_id = #{activityId} ") |
| | | ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); |
| | | } |
| | |
| | | "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}") |
| | |
| | | " LEFT JOIN sys_user AS su ON su.user_id = cad.user_id " + |
| | | " <where> "+ |
| | | "<if test='discussListDTO.communityId != null '>" + |
| | | " and cad.community_id = #{discussListDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='discussListDTO.startTime != null '>" + |
| | | " and cad.community_id = #{discussListDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='discussListDTO.startTime!=null and discussListDTO.startTime != ""'>" + |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.screen.DateScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.DynamicWorkVO; |
| | | import com.panzhihua.service_community.model.dos.ComActDynDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | @Mapper |
| | | public interface ComActDynDAO extends BaseMapper<ComActDynDO> { |
| | | @Select("<script> " + |
| | | "SELECT \n" + |
| | | "d.id,\n" + |
| | | "d.title,\n" + |
| | | "COUNT(u.id)readNum,\n" + |
| | | "d.`status`,\n" + |
| | | "d.`content`,\n" + |
| | | "d.`cover`,\n" + |
| | | "d.`type`,\n" + |
| | | "d.`cover_mode`,\n" + |
| | | "d.is_topping,\n" + |
| | | "d.publish_at,\n" + |
| | | "d.create_at,\n" + |
| | | "ca.name as communityName \n" + |
| | | "FROM\n" + |
| | | "com_act_dyn d\n" + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id \n" + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id \n" + |
| | | "WHERE 1=1 \n" + |
| | | "SELECT " + |
| | | "d.id, " + |
| | | "d.title, " + |
| | | "COUNT(u.id)readNum, " + |
| | | "d.`status`, " + |
| | | "d.`content`, " + |
| | | "d.`cover`, " + |
| | | "d.`type`, " + |
| | | "d.`cover_mode`, " + |
| | | "d.is_topping, " + |
| | | "d.publish_at, " + |
| | | "d.create_at, " + |
| | | "ca.name as communityName " + |
| | | "FROM " + |
| | | "com_act_dyn d " + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id " + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id " + |
| | | "WHERE 1=1 " + |
| | | "<if test='comActDynVO.choice == 0 '>" + |
| | | "and d.community_id=#{comActDynVO.communityId}\n" + |
| | | "and d.community_id=#{comActDynVO.communityId} " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.title != null and comActDynVO.title.trim() != ""'>" + |
| | | "AND d.title like concat(#{comActDynVO.title},'%') \n" + |
| | | "AND d.title like concat(#{comActDynVO.title},'%') " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.isTopping != null '>" + |
| | | "AND d.is_topping = #{comActDynVO.isTopping} \n" + |
| | | "AND d.is_topping = #{comActDynVO.isTopping} " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.status != null '>" + |
| | | "AND d.`status` = #{comActDynVO.status} \n" + |
| | | "AND d.`status` = #{comActDynVO.status} " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.publishAtBegin != null '>" + |
| | | "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} \n" + |
| | | "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} " + |
| | | "AND #{comActDynVO.publishAtEnd}" + |
| | | " </if> " + |
| | | " group by d.id "+ |
| | |
| | | int timedTaskDynStatus(); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT \n" + |
| | | "d.id,\n" + |
| | | "d.title,\n" + |
| | | "COUNT(u.id)readNum,\n" + |
| | | "d.`status`,\n" + |
| | | "d.`content`,\n" + |
| | | "d.`cover`,\n" + |
| | | "d.`type`,\n" + |
| | | "d.`cover_mode`,\n" + |
| | | "d.is_topping,\n" + |
| | | "d.publish_at,\n" + |
| | | "d.create_at,\n" + |
| | | "ca.name as communityName \n" + |
| | | "FROM\n" + |
| | | "com_act_dyn d\n" + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id \n" + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id \n" + |
| | | "WHERE \n" + |
| | | "d.community_id=#{comActDynVO.communityId}\n" + |
| | | "SELECT " + |
| | | "d.id, " + |
| | | "d.title, " + |
| | | "COUNT(u.id)readNum, " + |
| | | "d.`status`, " + |
| | | "d.`content`, " + |
| | | "d.`cover`, " + |
| | | "d.`type`, " + |
| | | "d.`cover_mode`, " + |
| | | "d.is_topping, " + |
| | | "d.publish_at, " + |
| | | "d.create_at, " + |
| | | "ca.name as communityName " + |
| | | "FROM " + |
| | | "com_act_dyn d " + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id " + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id " + |
| | | "WHERE " + |
| | | "d.community_id=#{comActDynVO.communityId} " + |
| | | "<if test='comActDynVO.title != null and comActDynVO.title.trim() != ""'>" + |
| | | "AND d.title like concat(#{comActDynVO.title},'%') \n" + |
| | | "AND d.title like concat(#{comActDynVO.title},'%') " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.isTopping != null '>" + |
| | | "AND d.is_topping = #{comActDynVO.isTopping} \n" + |
| | | "AND d.is_topping = #{comActDynVO.isTopping} " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.status != null '>" + |
| | | "AND d.`status` = #{comActDynVO.status} \n" + |
| | | "AND d.`status` = #{comActDynVO.status} " + |
| | | " </if> " + |
| | | "<if test='comActDynVO.publishAtBegin != null '>" + |
| | | "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} \n" + |
| | | "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} " + |
| | | "AND #{comActDynVO.publishAtEnd}" + |
| | | " </if> " + |
| | | " group by d.id "+ |
| | | " order by d.is_topping desc, d.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActDynVO> pageDynamicByAdmin(Page page, @Param("comActDynVO") ComActDynVO comActDynVO); |
| | | |
| | | @Select("SELECT " + |
| | | " count( cad.id ) AS dynTotal, " + |
| | | " (select count(id) from com_act_dyn where community_id = #{communityId} and create_at LIKE CONCAT(#{nowDate},'%')) as currentNum " + |
| | | "FROM " + |
| | | " com_act_dyn AS cad " + |
| | | "WHERE " + |
| | | " community_id = #{communityId}") |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("nowDate")String nowDate); |
| | | |
| | | @Select("select create_at as startTime,(select create_at from com_act_dyn where community_id = #{communityId} order by create_at desc LIMIT 1 ) as endTime from com_act_dyn where community_id = #{communityId} order by create_at asc LIMIT 1") |
| | | DateScreenVO countByAvgCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + |
| | | "(SELECT COUNT(id) FROM com_act_dyn WHERE community_id = #{communityId} AND create_at < #{end}) AS dynTotal, " + |
| | | "(SELECT COUNT(id) FROM com_act_dyn WHERE community_id = #{communityId} AND #{start} < create_at AND create_at < #{end}) AS dynAdd " + |
| | | " FROM DUAL") |
| | | DynamicWorkVO countByTime(@Param("start")String start, @Param("end")String end, @Param("communityId")Long communityId); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.MicroListVO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | public interface ComActMicroWishDAO extends BaseMapper<ComActMicroWishDO> { |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "w.id,\n" + |
| | | "u.name sponsor_name,\n" + |
| | | "u.nick_name userNickName,\n" + |
| | | "u.image_url ,\n" + |
| | | "w.sponsor_phone,\n" + |
| | | "w.wish_name,\n" + |
| | | "w.`status`,\n" + |
| | | "w.`feedback_at`,\n" + |
| | | "w.`examine_at`,\n" + |
| | | "w.`distribution_at`,\n" + |
| | | "w.`evaluate_at`,\n" + |
| | | "w.`photo_path_list`,\n" + |
| | | "count(wu.id)star_num,\n" + |
| | | "w.`detail`,\n" + |
| | | "w.form,\n" + |
| | | "w.reject_reason,\n" + |
| | | "su.`name` responsible_name,\n" + |
| | | "w.score,\n" + |
| | | "w.create_at \n" + |
| | | "FROM\n" + |
| | | "com_act_micro_wish w\n" + |
| | | "SELECT " + |
| | | "w.id, " + |
| | | "u.name sponsor_name, " + |
| | | "u.nick_name userNickName, " + |
| | | "u.image_url , " + |
| | | "w.sponsor_phone, " + |
| | | "w.wish_name, " + |
| | | "w.`status`, " + |
| | | "w.`feedback_at`, " + |
| | | "w.`examine_at`, " + |
| | | "w.`distribution_at`, " + |
| | | "w.`evaluate_at`, " + |
| | | "w.`photo_path_list`, " + |
| | | "count(wu.id)star_num, " + |
| | | "w.`detail`, " + |
| | | "w.form, " + |
| | | "w.reject_reason, " + |
| | | "su.`name` responsible_name, " + |
| | | "w.score, " + |
| | | "w.create_at " + |
| | | "FROM " + |
| | | "com_act_micro_wish w " + |
| | | "left join com_act_micro_wish_user wu on w.id=wu.micro_wish_id "+ |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id \n" + |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "<if test='comActMicroWishVO.sponsorName != null and comActMicroWishVO.sponsorName.trim() != ""'>" + |
| | | "AND u.name like concat(#{comActMicroWishVO.sponsorName},'%') \n" + |
| | | "AND u.name like concat(#{comActMicroWishVO.sponsorName},'%') " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.responsibleName == null or comActMicroWishVO.responsibleName.trim() == ""'>" + |
| | | "LEFT JOIN sys_user su ON w.responsible_id = su.user_id \n" + |
| | | "LEFT JOIN sys_user su ON w.responsible_id = su.user_id " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName.trim() != ""'>" + |
| | | " JOIN sys_user su ON w.responsible_id = su.user_id \n" + |
| | | "AND su.`name` like concat(#{comActMicroWishVO.responsibleName},'%') \n" + |
| | | " JOIN sys_user su ON w.responsible_id = su.user_id " + |
| | | "AND su.`name` like concat(#{comActMicroWishVO.responsibleName},'%') " + |
| | | " </if> " + |
| | | " <where>" + |
| | | "<if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'>" + |
| | | " and w.community_id=#{comActMicroWishVO.communityId} \n" + |
| | | " and w.community_id=#{comActMicroWishVO.communityId} " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone.trim() != ""'>" + |
| | | "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%') \n" + |
| | | "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%') " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.status!=3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND w.`status` = #{comActMicroWishVO.status} \n" + |
| | | "AND w.`status` = #{comActMicroWishVO.status} " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status == 3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND ( w.`status` = 3 or w.`status` = 5 )\n" + |
| | | "AND ( w.`status` = 3 or w.`status` = 5 ) " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" + |
| | | "AND w.`status` =1 \n" + |
| | | "AND w.`status` =1 " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status==3 and comActMicroWishVO.isPageMyWish!=null '>" + |
| | | "AND w.`status` in (2, 3) \n" + |
| | | "AND w.`status` in (2, 3) " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.createBegin != null '>" + |
| | | "AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} \n" + |
| | | "AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} " + |
| | | "AND #{comActMicroWishVO.createEnd}" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'>" + |
| | | "AND w.status in (3, 5, 6) \n" + |
| | | "AND w.status in (3, 5, 6) " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" + |
| | | "AND w.sponsor_id =#{comActMicroWishVO.userId} \n" + |
| | | "AND w.sponsor_id =#{comActMicroWishVO.userId} " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.backUserId != null and comActMicroWishVO.backUserId != 0 and comActMicroWishVO.status==3 '>" + |
| | | "AND w.responsible_id =#{comActMicroWishVO.backUserId} \n" + |
| | | "AND w.responsible_id =#{comActMicroWishVO.backUserId} " + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.backUserId != null and comActMicroWishVO.backUserId != 0 and comActMicroWishVO.status==0 '>" + |
| | | "and (w.status in(1,2,4,5,6) or (w.status=3 and w.responsible_id =#{comActMicroWishVO.backUserId}))\n" + |
| | | "and (w.status in(1,2,4,5,6) or (w.status=3 and w.responsible_id =#{comActMicroWishVO.backUserId})) " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " group by w.id \n"+ |
| | | " group by w.id "+ |
| | | "ORDER BY w.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); |
| | | @Select("SELECT\n" + |
| | | "w.id,\n" + |
| | | "u.name sponsor_name,\n" + |
| | | "u.nick_name userNickName,\n" + |
| | | "w.create_at,\n" + |
| | | "u.image_url,\n" + |
| | | "w.sponsor_phone,\n" + |
| | | "w.`status`,\n" + |
| | | "w.`sponsor_id`,\n" + |
| | | "w.wish_name,\n" + |
| | | "count(wu.id)starNum,\n" + |
| | | "w.detail,\n" + |
| | | "w.photo_path_list,\n" + |
| | | "su.`name` responsible_name,\n" + |
| | | "w.form,\n" + |
| | | "w.reject_reason,\n" + |
| | | "w.examine_at,\n" + |
| | | "w.finish,\n" + |
| | | "w.finish_photo_path_list,\n" + |
| | | "w.finish_at,\n" + |
| | | "w.score,\n" + |
| | | "w.feedback,\n" + |
| | | "w.feedback_at,\n" + |
| | | "w.feedback_photo_path_list,\n" + |
| | | "w.distribution_at,\n" + |
| | | "w.evaluate_at,\n" + |
| | | "w.evaluate \n" + |
| | | "FROM\n" + |
| | | "com_act_micro_wish w\n" + |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id\n" + |
| | | "LEFT JOIN sys_user su ON w.responsible_id = su.user_id \n" + |
| | | "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id \n" + |
| | | "WHERE\n" + |
| | | @Select("SELECT " + |
| | | "w.id, " + |
| | | "u.name sponsor_name, " + |
| | | "u.nick_name userNickName, " + |
| | | "w.create_at, " + |
| | | "u.image_url, " + |
| | | "w.sponsor_phone, " + |
| | | "w.`status`, " + |
| | | "w.`sponsor_id`, " + |
| | | "w.wish_name, " + |
| | | "count(wu.id)starNum, " + |
| | | "w.detail, " + |
| | | "w.photo_path_list, " + |
| | | "su.`name` responsible_name, " + |
| | | "w.form, " + |
| | | "w.reject_reason, " + |
| | | "w.examine_at, " + |
| | | "w.finish, " + |
| | | "w.finish_photo_path_list, " + |
| | | "w.finish_at, " + |
| | | "w.score, " + |
| | | "w.feedback, " + |
| | | "w.feedback_at, " + |
| | | "w.feedback_photo_path_list, " + |
| | | "w.distribution_at, " + |
| | | "w.evaluate_at, " + |
| | | "w.evaluate " + |
| | | "FROM " + |
| | | "com_act_micro_wish w " + |
| | | "JOIN sys_user u ON w.sponsor_id = u.user_id " + |
| | | "LEFT JOIN sys_user su ON w.responsible_id = su.user_id " + |
| | | "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id " + |
| | | "WHERE " + |
| | | "w.id =#{id}"+ |
| | | " group by w.id " + |
| | | "order by w.create_at desc" |
| | | ) |
| | | ComActMicroWishVO detailMicroWish(Long id); |
| | | @Select("SELECT\n" + |
| | | "'2' type\n" + |
| | | "FROM\n" + |
| | | "com_act_micro_wish w \n" + |
| | | "WHERE\n" + |
| | | "w.community_id = #{communityId} \n" + |
| | | "AND w.`status` = 1\n" + |
| | | "\n" + |
| | | "union all \n" + |
| | | "\n" + |
| | | "SELECT\n" + |
| | | "'2' type\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_micro_wish w \n" + |
| | | "WHERE\n" + |
| | | "\tw.community_id = #{communityId} \n" + |
| | | "\tAND w.`status` = 3 \n" + |
| | | "\tAND w.form = 1 \n" + |
| | | "\tAND w.responsible_id = #{userId} \n" + |
| | | "GROUP BY\n" + |
| | | "\tw.community_id\n") |
| | | @Select("SELECT " + |
| | | "'2' type " + |
| | | "FROM " + |
| | | "com_act_micro_wish w " + |
| | | "WHERE " + |
| | | "w.community_id = #{communityId} " + |
| | | "AND w.`status` = 1 " + |
| | | " " + |
| | | "union all " + |
| | | " " + |
| | | "SELECT " + |
| | | "'2' type " + |
| | | "FROM " + |
| | | " com_act_micro_wish w " + |
| | | "WHERE " + |
| | | " w.community_id = #{communityId} " + |
| | | " AND w.`status` = 3 " + |
| | | " AND w.form = 1 " + |
| | | " AND w.responsible_id = #{userId} " + |
| | | "GROUP BY " + |
| | | " w.community_id ") |
| | | List<TodoEventsVO> selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId); |
| | | |
| | | @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72") |
| | | 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); |
| | | |
| | | @Select("SELECT photo_path_list FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) ORDER BY create_at DESC limit #{pageSize}") |
| | | List<String> getAllImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " camw.id, " + |
| | | " su.`name` AS userName, " + |
| | | " camw.sponsor_id, " + |
| | | " su.image_url, " + |
| | | " su.phone, " + |
| | | " camw.`status`, " + |
| | | " camw.create_at, " + |
| | | " camw.wish_name, " + |
| | | " camw.finish, " + |
| | | " camw.finish_photo_path_list, " + |
| | | " camw.form, " + |
| | | " camw.evaluate_at, " + |
| | | " su1.name as responsibleName, " + |
| | | " camw.score, " + |
| | | " camw.distribution_at, " + |
| | | " camw.detail, " + |
| | | " camw.photo_path_list " + |
| | | "FROM " + |
| | | " com_act_micro_wish AS camw " + |
| | | " LEFT JOIN sys_user AS su ON su.user_id = camw.sponsor_id " + |
| | | " LEFT JOIN sys_user AS su1 ON su1.user_id = camw.responsible_id " + |
| | | " <where> " + |
| | | "<if test='microListDTO.status != null'>" + |
| | | "AND camw.`status` =#{microListDTO.status} " + |
| | | " </if> " + |
| | | "<if test='microListDTO.communityId != null'>" + |
| | | "AND camw.community_id =#{microListDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='microListDTO.startTime!=null and microListDTO.startTime != ""'>" + |
| | | " AND DATE_FORMAT(camw.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{microListDTO.startTime} " + |
| | | " </if> " + |
| | | "<if test='microListDTO.endTime!=null and microListDTO.endTime != ""'>" + |
| | | " AND DATE_FORMAT(camw.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{microListDTO.endTime} " + |
| | | " </if> " + |
| | | " </where>" + |
| | | "ORDER BY camw.create_at desc "+ |
| | | " </script>") |
| | | IPage<MicroListVO> getScreenMicroList(Page page, @Param("microListDTO") ScreenMicroListDTO microListDTO); |
| | | } |
| | |
| | | "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 " + |
| | | "SELECT COUNT( e.id ) AS num,'网格事件' AS name FROM `event` as e left join event_grid_data as egd on egd.id = e.grid_id WHERE egd.grid_community_id = #{communityId} AND e.event_process_status = 2 " + |
| | | "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); |
| | |
| | | "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 " + |
| | | "SELECT COUNT( e.id ) AS num,'网格事件' AS NAME FROM `event` as e left join event_grid_data as egd on egd.id = e.grid_id WHERE egd.grid_community_id = #{communityId} AND e.event_status = 2 and e.event_deal_status in (1,2,3) " + |
| | | "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); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.event.*; |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.model.vos.community.PageComActMessageVO; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 1) as localTotal " + |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 2) as outTotal " + |
| | | ",(select count(id) from com_mng_population where act_id = #{communityId} and label is not null) as specialTotal " + |
| | | ",(select count(village_id) from com_mng_village where community_id = #{communityId}) as villageTotal " + |
| | | " from com_mng_population as cmp where act_id = #{communityId}") |
| | | ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); |
| | | |
| | |
| | | " community_id = #{communityId}") |
| | | List<CivilVillageStatisticsVO> getCivilScreenVillageList(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + |
| | | " count( id ) AS peopleNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population_house AS cmph WHERE village_id = #{villageId} ) AS houseNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population WHERE village_id = #{villageId} AND out_or_local = 1 ) AS registerNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population WHERE village_id = #{villageId} AND out_or_local = 2 ) AS flowNum " + |
| | | "FROM " + |
| | | " com_mng_population AS cmp " + |
| | | "WHERE " + |
| | | " village_id = #{villageId}") |
| | | CivilVillageStatisticsVO getCivilScreenVillageStatistics(@Param("villageId") Long villageId); |
| | | |
| | | |
| | | @Select("SELECT COUNT(id) AS man,(SELECT COUNT(id) FROM com_mng_population WHERE sex = 2 AND act_id = #{communityId}) AS woman FROM com_mng_population WHERE sex = 1 AND act_id = #{communityId}") |
| | | Map<String, Long> countBySex(@Param("communityId") Long communityId); |
| | |
| | | " e.id = #{eventId}") |
| | | EventNewStatisticsVO getEventScreenEventDetail(@Param("eventId") Long eventId); |
| | | |
| | | @Select("select process_date,process_result from event_transfer_record where event_id = #{eventId}") |
| | | @Select("select process_date,process_result,process_type,from_type,from_id,from_name,event_id from event_transfer_record where event_id = #{eventId}") |
| | | List<EventTransferRecordVO> getEventScreenEventTransList(@Param("eventId") Long eventId); |
| | | |
| | | @Select("SELECT " + |
| | | " cs.address AS streetName, " + |
| | | " ca.`name` AS communityName, " + |
| | | " egd.grid_name " + |
| | | "FROM " + |
| | | " `event` AS e " + |
| | | " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + |
| | | " LEFT JOIN com_act AS ca ON egd.grid_community_id = ca.community_id " + |
| | | " LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id " + |
| | | "WHERE " + |
| | | " e.id = #{eventId}") |
| | | EventTransferRecordDetailVO getEventScreenEventTransDetail(@Param("eventId") Long eventId); |
| | | |
| | | @Select("select ca.`name` AS communityName,cs.address AS streetName from com_act as ca LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id where ca.community_id = #{communityId}") |
| | | EventTransferRecordDetailVO getEventScreenEventTransDetailByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select count(id) from com_elders_auth_elderly WHERE community_id = #{communityId}") |
| | | Integer getStatisticsCount(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + |
| | | "select cmp.id,cmp.`name`,cmp.phone,cmp.card_no,cmp.label,cmp.address,cmp.nation,cmp.political_outlook,cmp.sex from com_mng_population as cmp " + |
| | | " where cmp.act_id = #{populationListDTO.communityId}" + |
| | | "<if test='populationListDTO.keyWord != null and populationListDTO.keyWord != ""'>" + |
| | | "AND (cmp.`name` like concat (#{populationListDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationListDTO.keyWord},'%')) " + |
| | | " </if> " + |
| | | "<if test='populationListDTO.label != null and populationListDTO.label != ""'>" + |
| | | "AND cmp.label like concat ('%',#{populationListDTO.label},'%') " + |
| | | " </if> " + |
| | | " </script>") |
| | | IPage<PopulationListVO> pagePopulationListApp(Page page, @Param("populationListDTO") PagePopulationListDTO populationListDTO); |
| | | |
| | | @Select("SELECT " + |
| | | " cmp.id, " + |
| | | " cmp.`name`, " + |
| | | " cmp.phone, " + |
| | | " cmp.card_no, " + |
| | | " cmp.label, " + |
| | | " cmp.address, " + |
| | | " cmp.nation, " + |
| | | " cmp.political_outlook, " + |
| | | " cmp.sex, " + |
| | | " cmp.birthday, " + |
| | | " cmp.native_place, " + |
| | | " cmp.healthy, " + |
| | | " cmp.is_rent, " + |
| | | " cmv.alley AS road, " + |
| | | " cmv.house_num AS doorNo, " + |
| | | " cmp.floor, " + |
| | | " cmp.unit_no, " + |
| | | " cmp.house_no, " + |
| | | " cmp.work_company, " + |
| | | " cmp.census_register, " + |
| | | " cmp.out_or_local, " + |
| | | " cmp.remark, " + |
| | | " cmp.marriage " + |
| | | "FROM " + |
| | | " com_mng_population AS cmp " + |
| | | " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + |
| | | "WHERE " + |
| | | " id = #{populationId}") |
| | | PopulationDetailVO getPopulationDetailApp(@Param("populationId") Long populationId); |
| | | |
| | | } |
| | |
| | | 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); |
| | | |
| | | |
| | | } |
| | |
| | | private String healthy; |
| | | |
| | | /** |
| | | * 房屋地址 |
| | | * 居住地址 |
| | | */ |
| | | // private String houseAddress; |
| | | private String address; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @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; |
| | | /** |
| | | * (精神类人群填写)监护人关系 |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | |
| | | */ |
| | | R indexDataCommunityBackstageEchart(Long communityId); |
| | | |
| | | R getScreenActActivityList(ScreenActActivityListDTO actActivityListDTO); |
| | | |
| | | R getActActivityPeopleList(ScreenActActivityPeopleListDTO activityPeopleListDTO); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | |
| | | * @return |
| | | */ |
| | | R timedTaskActMicroWishAll(); |
| | | |
| | | R getScreenMicroList(ScreenMicroListDTO microListDTO); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | |
| | | * @return 导入结果 |
| | | */ |
| | | R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | |
| | | /** |
| | | * 根据实有人口id修改用户标签 |
| | | * |
| | |
| | | * @return 统计结果 |
| | | */ |
| | | R getScreenCivil(Long communityId); |
| | | |
| | | |
| | | /** |
| | | * description 根据身份证信息修改用户标签信息 |
| | | * |
| | |
| | | R getScreenGirds(Long communityId); |
| | | |
| | | R getScreenEventDetail(BigScreenEventDetailDTO eventDetailDTO); |
| | | |
| | | R pagePopulationListApp(PagePopulationListDTO populationListDTO); |
| | | |
| | | R getPopulationDetailApp(Long populationId); |
| | | |
| | | R getPopulationRepairByApp(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R workCount(Long communityId); |
| | | |
| | | R dynamicWork(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.SysConfDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-23 10:41:36 |
| | | * @describe 系统配置表服务类 |
| | | */ |
| | | public interface SysConfService extends IService<SysConfDO> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.ExcelElderAuthDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | |
| | | return R.ok(indexDataVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getScreenActActivityList(ScreenActActivityListDTO actActivityListDTO){ |
| | | IPage<ActActivityListVO> actActivityListVOIPage = comActActivityDAO.getScreenActActivityList( |
| | | new Page(actActivityListDTO.getPageNum(),actActivityListDTO.getPageSize()),actActivityListDTO); |
| | | if(!actActivityListVOIPage.getRecords().isEmpty()){ |
| | | actActivityListVOIPage.getRecords().forEach(actActivityListVO -> { |
| | | ActActivityListVO activityListVO = comActActivityDAO.getScreenActActivityPeopleCount(actActivityListVO.getId()); |
| | | if(activityListVO != null){ |
| | | actActivityListVO.setParticipantCount(activityListVO.getParticipantCount()); |
| | | actActivityListVO.setVolunteerCount(activityListVO.getVolunteerCount()); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(actActivityListVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R getActActivityPeopleList(ScreenActActivityPeopleListDTO activityPeopleListDTO){ |
| | | return R.ok(comActActSignDAO.getActActivityPeopleList(new Page(activityPeopleListDTO.getPageNum(),activityPeopleListDTO.getPageSize()),activityPeopleListDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 获取最近七天的时间 |
| | | * @return |
| | |
| | | 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.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.MicroListVO; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.service_community.dao.ComActMicroWishDAO; |
| | | import com.panzhihua.service_community.dao.ComActMicroWishUserDAO; |
| | |
| | | log.info("定时任务--修改待自动确认微心愿状态数量【{}】",num); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R getScreenMicroList(ScreenMicroListDTO microListDTO){ |
| | | IPage<MicroListVO> microListVOIPage = comActMicroWishDAO.getScreenMicroList(new Page(microListDTO.getPageNum(),microListDTO.getPageSize()),microListDTO); |
| | | if(!microListVOIPage.getRecords().isEmpty()){ |
| | | microListVOIPage.getRecords().forEach(microListVO -> { |
| | | Integer count = comActMicroWishUserDAO.selectCount(new QueryWrapper<ComActMicroWishUserDO>().lambda() |
| | | .eq(ComActMicroWishUserDO::getMicroWishId,microListVO.getId())); |
| | | microListVO.setStarNum(count); |
| | | }); |
| | | } |
| | | return R.ok(microListVOIPage); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.enums.PopulCultureLevelEnum; |
| | | import com.panzhihua.common.enums.PopulHouseUseEnum; |
| | | import com.panzhihua.common.enums.PopulIsOksEnum; |
| | | import com.panzhihua.common.enums.PopulMarriageEnum; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | 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.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | 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.*; |
| | | import com.panzhihua.common.utlis.*; |
| | | 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.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | // } |
| | | |
| | | //查询当前用户电子档信息 |
| | | if(!StringUtils.isEmpty(comMngPopulationDO.getCardNo())){ |
| | | if (!StringUtils.isEmpty(comMngPopulationDO.getCardNo())) { |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserElectronicFile(comMngPopulationDO.getCardNo()); |
| | | if(electronicFileVO != null){ |
| | | if (electronicFileVO != null) { |
| | | comMngPopulationVO.setUserElectronicFileVO(electronicFileVO); |
| | | //查询家庭成员信息 |
| | | List<ComMngFamilyInfoVO> familyInfoVOList = populationDAO.listFamilyByUserId(electronicFileVO.getUserId()); |
| | | if(!familyInfoVOList.isEmpty()){ |
| | | if (!familyInfoVOList.isEmpty()) { |
| | | comMngPopulationVO.setFamilyInfoVOList(familyInfoVOList); |
| | | } |
| | | } |
| | |
| | | |
| | | //查询当前用户房屋信息 |
| | | List<ComMngHouseVo> houseList = comMngPopulationHouseDAO.getPopulHouseListByPopulId(populationId); |
| | | if(!houseList.isEmpty()){ |
| | | houseList.forEach(house ->{ |
| | | if (!houseList.isEmpty()) { |
| | | houseList.forEach(house -> { |
| | | |
| | | }); |
| | | comMngPopulationVO.setHouseList(houseList); |
| | |
| | | |
| | | //查询当前实有人口车辆信息 |
| | | List<ComMngPopulationCarVO> carList = comMngCarDAO.getPopulationCarListByIdCard(comMngPopulationDO.getCardNo()); |
| | | if(!carList.isEmpty()){ |
| | | if (!carList.isEmpty()) { |
| | | comMngPopulationVO.setCarList(carList); |
| | | } |
| | | return R.ok(comMngPopulationVO); |
| | |
| | | Long pageNum = comMngPopulationVO.getPageNum(); |
| | | Long pageSize = comMngPopulationVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | pageNum = 1L; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | pageSize = 10L; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | |
| | | if(comMngPopulationVO.getHouseId() != null){ |
| | | if (comMngPopulationVO.getHouseId() != null) { |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(comMngPopulationVO.getHouseId()); |
| | | if(houseDO != null){ |
| | | switch (comMngPopulationVO.getLevel()){ |
| | | if (houseDO != null) { |
| | | switch (comMngPopulationVO.getLevel()) { |
| | | case 1: |
| | | comMngPopulationVO.setRoad(houseDO.getAlley()); |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(comMngPopulationVO.getAgeStart())){ |
| | | String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(),-(Integer.parseInt(comMngPopulationVO.getAgeStart()) + 1)),"yyyy-MM-dd"); |
| | | if(StringUtils.isNotEmpty(ageStartTime)){ |
| | | if (StringUtils.isNotEmpty(comMngPopulationVO.getAgeStart())) { |
| | | String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(), -(Integer.parseInt(comMngPopulationVO.getAgeStart()) + 1)), "yyyy-MM-dd"); |
| | | if (StringUtils.isNotEmpty(ageStartTime)) { |
| | | comMngPopulationVO.setAgeStartTime(ageStartTime); |
| | | } |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(comMngPopulationVO.getAgeEnd())){ |
| | | String ageEndTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(),-(Integer.parseInt(comMngPopulationVO.getAgeEnd()) + 1)),"yyyy-MM-dd"); |
| | | if(StringUtils.isNotEmpty(ageEndTime)){ |
| | | if (StringUtils.isNotEmpty(comMngPopulationVO.getAgeEnd())) { |
| | | String ageEndTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(), -(Integer.parseInt(comMngPopulationVO.getAgeEnd()) + 1)), "yyyy-MM-dd"); |
| | | if (StringUtils.isNotEmpty(ageEndTime)) { |
| | | comMngPopulationVO.setAgeEndTime(ageEndTime); |
| | | } |
| | | } |
| | | |
| | | IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO); |
| | | if(!iPage.getRecords().isEmpty()){ |
| | | if (!iPage.getRecords().isEmpty()) { |
| | | iPage.getRecords().forEach(populDO -> { |
| | | if(StringUtils.isNotEmpty(populDO.getBirthday())){ |
| | | if (StringUtils.isNotEmpty(populDO.getBirthday())) { |
| | | populDO.setAge(AgeUtils.getAgeFromBirthTimes(populDO.getBirthday())); |
| | | } |
| | | }); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception{ |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception { |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | //查询该社区 |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | //查询该社区的省市区地址 |
| | | AreaAddressVO areaAddressVO = populationDAO.getAreaAddress(comActDO.getProvinceCode(),comActDO.getCityCode(),comActDO.getAreaCode()); |
| | | AreaAddressVO areaAddressVO = populationDAO.getAreaAddress(comActDO.getProvinceCode(), comActDO.getCityCode(), comActDO.getAreaCode()); |
| | | //查询社区上街道信息 |
| | | String streetName = ""; |
| | | if(comActDO.getStreetId() != null){ |
| | | if (comActDO.getStreetId() != null) { |
| | | ComStreetDO streetDO = comStreetDAO.selectById(comActDO.getStreetId()); |
| | | if(streetDO != null){ |
| | | if (streetDO != null) { |
| | | streetName = streetDO.getName(); |
| | | } |
| | | } |
| | |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | String address = ""; |
| | | //查询街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley", vo.getRoad()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId)); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("街路巷或小区号不存在"); |
| | | importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:"+vo.getDoorNo()); |
| | | importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | continue; |
| | | } |
| | | |
| | | if(!comMngVillageDO.getHouseNum().contains("号")){ |
| | | if (!comMngVillageDO.getHouseNum().contains("号")) { |
| | | comMngVillageDO.setHouseNum(comMngVillageDO.getHouseNum() + "号"); |
| | | } |
| | | |
| | |
| | | |
| | | //先判断房屋是否存在 |
| | | ComMngPopulationHouseDO populationHouseDO = comMngPopulationHouseDAO.selectOne(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getCommunityId,communityId).eq(ComMngPopulationHouseDO::getVillageId,comMngVillageDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,vo.getFloor()).eq(ComMngPopulationHouseDO::getUnitNo,vo.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,vo.getHouseNo())); |
| | | if(populationHouseDO == null){ |
| | | .eq(ComMngPopulationHouseDO::getCommunityId, communityId).eq(ComMngPopulationHouseDO::getVillageId, comMngVillageDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor, vo.getFloor()).eq(ComMngPopulationHouseDO::getUnitNo, vo.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo, vo.getHouseNo())); |
| | | if (populationHouseDO == null) { |
| | | //房屋信息不存在建立房屋信息 |
| | | populationHouseDO = savePopulationHouse(vo,comMngVillageDO,communityId,address,areaPath,comActDO.getName()); |
| | | populationHouseDO = savePopulationHouse(vo, comMngVillageDO, communityId, address, areaPath, comActDO.getName()); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { |
| | | //空户处理完房屋信息,直接返回 |
| | | continue; |
| | | } |
| | | String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); |
| | | //判断实有人口是否已存在 |
| | | ComMngPopulationDO populationDO = this.baseMapper.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo,cardNoAES)); |
| | | if(populationDO == null){ |
| | | .eq(ComMngPopulationDO::getCardNo, cardNoAES)); |
| | | if (populationDO == null) { |
| | | //不存在实有人口,则新增 |
| | | populationDO = savePopulationDO(vo,comActDO,comMngVillageDO,cardNoAES); |
| | | }else { |
| | | populationDO = savePopulationDO(vo, comActDO, comMngVillageDO); |
| | | } else { |
| | | //如果存在人口信息,且是自用房,则更新人口默认的房屋信息 |
| | | if(vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())){ |
| | | populationDO = updatePopulationHouseUse(vo,populationDO,cardNoAES); |
| | | if (vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) { |
| | | populationDO = updatePopulationHouseUse(vo, populationDO); |
| | | } |
| | | } |
| | | |
| | | //处理实有人口房屋居住信息 |
| | | if(populationDO != null){ |
| | | if (populationDO != null) { |
| | | ComMngPopulationHouseUserDO populationHouseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>() |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getHouseId,populationHouseDO.getId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,populationDO.getId())); |
| | | if(populationHouseUserDO == null){ |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getHouseId, populationHouseDO.getId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId, populationDO.getId())); |
| | | if (populationHouseUserDO == null) { |
| | | populationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | populationHouseUserDO.setId(Snowflake.getId()); |
| | | populationHouseUserDO.setHouseId(populationHouseDO.getId()); |
| | |
| | | } |
| | | this.saveBatch(populationDOList);*/ |
| | | |
| | | if(!populationImportErrorVOList.isEmpty()){ |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | private ComMngPopulationDO updatePopulationHouseUse(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO,String cardNoAES) throws Exception { |
| | | private ComMngPopulationDO updatePopulationHouseUse(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception { |
| | | populationDO.setRoad(vo.getRoad()); |
| | | populationDO.setDoorNo(vo.getDoorNo()); |
| | | populationDO.setFloor(vo.getFloor()); |
| | | populationDO.setUnitNo(vo.getUnitNo()); |
| | | populationDO.setHouseNo(vo.getHouseNo()); |
| | | populationDO.setCardNo(cardNoAES); |
| | | populationDO.setCardNo(vo.getCardNo()); |
| | | populationDO.setCardNoStr(vo.getCardNo()); |
| | | if(StringUtils.isNotEmpty(populationDO.getPhone())){ |
| | | populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | if (StringUtils.isNotEmpty(populationDO.getPhone())) { |
| | | // populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | populationDO.setPhone(populationDO.getPhone()); |
| | | } |
| | | this.baseMapper.updateById(populationDO); |
| | | return populationDO; |
| | | } |
| | | |
| | | private ComMngPopulationDO savePopulationDO(ComMngPopulationServeExcelVO vo, ComActDO comActDO, ComMngVillageDO comMngVillageDO,String cardNoAES) { |
| | | private ComMngPopulationDO savePopulationDO(ComMngPopulationServeExcelVO vo, ComActDO comActDO, ComMngVillageDO comMngVillageDO) { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | BeanUtils.copyProperties(vo, populationDO); |
| | | populationDO.setId(Snowflake.getId()); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setCardNo(cardNoAES); |
| | | populationDO.setCardNo(vo.getCardNo()); |
| | | populationDO.setCardNoStr(vo.getCardNo()); |
| | | populationDO.setUpdateAt(new Date()); |
| | | this.baseMapper.insert(populationDO); |
| | | return populationDO; |
| | | } |
| | | |
| | | private ComMngPopulationHouseDO savePopulationHouse(ComMngPopulationServeExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, String address, StringBuilder areaPath,String actName) { |
| | | private ComMngPopulationHouseDO savePopulationHouse(ComMngPopulationServeExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, String address, StringBuilder areaPath, String actName) { |
| | | //查询该房屋未建立,执行建立房屋信息 |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | |
| | | populationHouseDO.setConstructPurpose(vo.getBuildPurpose()); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | housePath.append(populationHouseDO.getAlley()).append(">").append(actName).append(">").append(comMngVillageDO.getName()).append(">").append(address); |
| | | populationHouseDO.setPath(areaPath.toString()+ housePath.toString()); |
| | | populationHouseDO.setPath(areaPath.toString() + housePath.toString()); |
| | | try { |
| | | populationHouseDO.setConstructArea(new BigDecimal(vo.getBuildArea())); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | } |
| | | if(vo.getHouseStatus() != null){ |
| | | if (vo.getHouseStatus() != null) { |
| | | populationHouseDO.setStatus(vo.getHouseStatus()); |
| | | } |
| | | if(vo.getHousePurpose() != null){ |
| | | if (vo.getHousePurpose() != null) { |
| | | populationHouseDO.setPurpose(vo.getHousePurpose()); |
| | | } |
| | | if(vo.getControlStatus() != null){ |
| | | if (vo.getControlStatus() != null) { |
| | | populationHouseDO.setControlStatus(vo.getControlStatus()); |
| | | } |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | * |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | public R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId) { |
| | |
| | | list.forEach(vo -> { |
| | | ComMngPopulationDO comMngPopulationDO = new ComMngPopulationDO(); |
| | | //查询街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley", vo.getRoad()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId)); |
| | | // ComMngVillageDO comMngVillageDO = villageDOList.stream().filter(village -> village.getAlley().equals(vo.getRoad()) && village.getHouseNum().equals(Integer.valueOf(vo.getDoorNo()))).findFirst().orElse(null); |
| | | BeanUtils.copyProperties(vo, comMngPopulationDO); |
| | | if (comMngVillageDO == null) { |
| | |
| | | populationDOList.add(comMngPopulationDO); |
| | | }); |
| | | |
| | | if(!populationDOList.isEmpty()){ |
| | | if (!populationDOList.isEmpty()) { |
| | | //循环遍历待导入人员信息,如果数据库存在则更新,如果不存在则新建 |
| | | populationDOList.forEach(population -> { |
| | | try { |
| | |
| | | //查询这个用户是否存在 |
| | | ComMngPopulationDO comMngPopulationDO = this.populationDAO.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo, population.getCardNo())); |
| | | if(comMngPopulationDO != null){ |
| | | if (comMngPopulationDO != null) { |
| | | population.setId(comMngPopulationDO.getId()); |
| | | BeanUtils.copyProperties(population,comMngPopulationDO); |
| | | BeanUtils.copyProperties(population, comMngPopulationDO); |
| | | this.populationDAO.updateById(population); |
| | | }else{ |
| | | } else { |
| | | this.populationDAO.insert(population); |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("导入实有人口失败"); |
| | | } |
| | | }); |
| | |
| | | |
| | | /** |
| | | * 根据id修改实有人口标签 |
| | | * |
| | | * @param populationTagDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | |
| | | if (comMngPopulationDO == null) { |
| | | return R.fail("未查询到人口记录"); |
| | | } |
| | | BeanUtils.copyProperties(populationTagDTO,comMngPopulationDO); |
| | | BeanUtils.copyProperties(populationTagDTO, comMngPopulationDO); |
| | | |
| | | int nub = populationDAO.updateById(comMngPopulationDO); |
| | | if(nub < 1){ |
| | | if (nub < 1) { |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deletePopulations(List<Long> Ids) { |
| | | if(!Ids.isEmpty()){ |
| | | if (!Ids.isEmpty()) { |
| | | Ids.forEach(id -> { |
| | | //清除用户房屋居住信息 |
| | | comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(id); |
| | |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R getPopulationListByCommunityId(Long communityId) { |
| | | List<ComMngPopulationDO> list = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().eq("act_id",communityId)); |
| | | List<ComMngPopulationDO> list = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().eq("act_id", communityId)); |
| | | List<ComMngPopulationVO> resultList = new ArrayList<>(); |
| | | if(list.size() > 0){ |
| | | if (list.size() > 0) { |
| | | list.forEach(populationDO -> { |
| | | ComMngPopulationVO populationVO=new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(populationDO,populationVO); |
| | | ComMngPopulationVO populationVO = new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(populationDO, populationVO); |
| | | resultList.add(populationVO); |
| | | }); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据id集合查询实有人口 |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | * |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R getPopulationLists(List<Long> Ids) { |
| | | List<ComMngPopulationDO> list = populationDAO.selectBatchIds(Ids); |
| | | List<ComMngPopulationVO> resultList = new ArrayList<>(); |
| | | if(list.size() > 0){ |
| | | if (list.size() > 0) { |
| | | list.forEach(populationDO -> { |
| | | ComMngPopulationVO populationVO = new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(populationDO,populationVO); |
| | | BeanUtils.copyProperties(populationDO, populationVO); |
| | | resultList.add(populationVO); |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editPopulation(ComMngPopulationEditDTO vo, Long communityId) throws Exception{ |
| | | public R editPopulation(ComMngPopulationEditDTO vo, Long communityId) throws Exception { |
| | | ComMngPopulationDO populationDO = populationDAO.selectById(vo.getId()); |
| | | if(populationDO == null){ |
| | | if (populationDO == null) { |
| | | return R.fail(); |
| | | } |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | if(StringUtils.isEmpty(vo.getLabel())){ |
| | | BeanUtils.copyProperties(vo, populationDO); |
| | | if (StringUtils.isEmpty(vo.getLabel())) { |
| | | populationDO.setLabel(null); |
| | | } |
| | | if(StringUtils.isEmpty(vo.getRemark())){ |
| | | if (StringUtils.isEmpty(vo.getRemark())) { |
| | | populationDO.setRemark(null); |
| | | } |
| | | populationDO.setCardNo(null); |
| | | populationDO.setPhone(AESUtil.encrypt128(vo.getPhone(), aesKey)); |
| | | |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | if(comActDO != null){ |
| | | if (comActDO != null) { |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | } |
| | |
| | | List<Long> houseIds = comMngPopulationHouseUserDAO.getPopulationHouseIdByUserId(vo.getId()); |
| | | //清除用户房屋居住信息 |
| | | comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(vo.getId()); |
| | | if(!houseIds.isEmpty()){ |
| | | if (!houseIds.isEmpty()) { |
| | | houseIds.forEach(houseId -> { |
| | | //查询当前房屋下是否有人口信息,如果没有则将房屋设置为空户 |
| | | List<Long> oldHouseIds = comMngPopulationHouseUserDAO.getPopulationHouseIdByhHosueId(houseId); |
| | | if(oldHouseIds.isEmpty()){ |
| | | if (oldHouseIds.isEmpty()) { |
| | | //修改房屋信息为空户 |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseId,1); |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseId, 1); |
| | | } |
| | | }); |
| | | } |
| | |
| | | //更新用户的房屋信息 |
| | | Long houseId = null; |
| | | List<ComMngPopulationHouseUserDO> populationHouseUserDOList = new ArrayList<>(); |
| | | if(!vo.getHouseEditDTOList().isEmpty()){ |
| | | for (ComMngPopulationHouseEditDTO houseEditDto:vo.getHouseEditDTOList()) { |
| | | if (!vo.getHouseEditDTOList().isEmpty()) { |
| | | for (ComMngPopulationHouseEditDTO houseEditDto : vo.getHouseEditDTOList()) { |
| | | ComMngPopulationHouseUserDO populationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | populationHouseUserDO.setPopulId(populationDO.getId()); |
| | | populationHouseUserDO.setHouseId(houseEditDto.getId()); |
| | | if(houseEditDto.getIsResidence().equals(ComMngPopulationHouseEditDTO.isResidence.yes)){ |
| | | if (houseEditDto.getIsResidence().equals(ComMngPopulationHouseEditDTO.isResidence.yes)) { |
| | | houseId = houseEditDto.getId();//居住地 |
| | | } |
| | | populationHouseUserDOList.add(populationHouseUserDO); |
| | | |
| | | //修改房屋信息不为空户 |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseEditDto.getId(),2); |
| | | comMngPopulationHouseDAO.updateHouseByIsEmpty(houseEditDto.getId(), 2); |
| | | } |
| | | } |
| | | comMngPopulationHouseUserService.saveBatch(populationHouseUserDOList); |
| | | |
| | | if(houseId != null){//居住地更新 |
| | | if (houseId != null) {//居住地更新 |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(houseId); |
| | | if(houseDO != null){ |
| | | if (houseDO != null) { |
| | | populationDO.setRoad(houseDO.getAlley()); |
| | | populationDO.setDoorNo(houseDO.getHouseNum()); |
| | | populationDO.setFloor(houseDO.getFloor()); |
| | | populationDO.setUnitNo(houseDO.getUnitNo()); |
| | | populationDO.setHouseNo(houseDO.getHouseNo()); |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().lambda() |
| | | .eq(ComMngVillageDO::getAlley,houseDO.getAlley()).eq(ComMngVillageDO::getHouseNum,houseDO.getHouseNum()) |
| | | .eq(ComMngVillageDO::getCommunityId,communityId)); |
| | | .eq(ComMngVillageDO::getAlley, houseDO.getAlley()).eq(ComMngVillageDO::getHouseNum, houseDO.getHouseNum()) |
| | | .eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | if (comMngVillageDO != null) { |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | if(!StringUtils.isEmpty(comMngVillageDO.getGroupAt())){ |
| | | if (!StringUtils.isEmpty(comMngVillageDO.getGroupAt())) { |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | populationDO.setUpdateAt(new Date()); |
| | | if(populationDAO.updateById(populationDO) > 0){ |
| | | if (populationDAO.updateById(populationDO) > 0) { |
| | | return R.ok(); |
| | | }else{ |
| | | } else { |
| | | return R.fail("修改失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R specialInputUser(PageInputUserDTO pageInputUserDTO){ |
| | | public R specialInputUser(PageInputUserDTO pageInputUserDTO) { |
| | | IPage<InputUserInfoVO> iPage = populationDAO.specialInputUser(new Page<>(pageInputUserDTO.getPageNum() |
| | | ,pageInputUserDTO.getPageSize()), pageInputUserDTO); |
| | | , pageInputUserDTO.getPageSize()), pageInputUserDTO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | * |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteSpecialInputUser(Long id){ |
| | | public R deleteSpecialInputUser(Long id) { |
| | | //查询特殊群体人员 |
| | | ComMngPopulationDO populationDO = this.baseMapper.selectById(id); |
| | | if(populationDO == null){ |
| | | if (populationDO == null) { |
| | | return R.fail("未查询到该记录"); |
| | | } |
| | | populationDO.setLabel(null); |
| | | if(this.baseMapper.updateById(populationDO) > 0){ |
| | | if (this.baseMapper.updateById(populationDO) > 0) { |
| | | return R.ok(); |
| | | }else{ |
| | | } else { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | * |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | @Override |
| | | public R electronicArchivesPopulation(Long populationId){ |
| | | public R electronicArchivesPopulation(Long populationId) { |
| | | ComMngPopulationDO comMngPopulationDO = populationDAO.selectById(populationId); |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail("用户信息不存在"); |
| | | } |
| | | //查询当前用户电子档信息 |
| | | if(!StringUtils.isEmpty(comMngPopulationDO.getCardNo())){ |
| | | if (!StringUtils.isEmpty(comMngPopulationDO.getCardNo())) { |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserElectronicFile(comMngPopulationDO.getCardNo()); |
| | | if(electronicFileVO != null){ |
| | | if (electronicFileVO != null) { |
| | | return R.ok(electronicFileVO); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public R editUserElectronicFile(UserElectronicFileVO userElectronicFileVO) { |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserById(userElectronicFileVO.getUserId()); |
| | | if(electronicFileVO==null){ |
| | | if (electronicFileVO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | populationDAO.updateSysUserElectronicFile(userElectronicFileVO); |
| | | populationDAO.updateSysUserElectronicFile(userElectronicFileVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getPopulationTotalByAdmin(Long communityId){ |
| | | public R getPopulationTotalByAdmin(Long communityId) { |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | | * 首页大屏统计接口 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getScreenIndex(Long communityId){ |
| | | public R getScreenIndex(Long communityId) { |
| | | //创建统计返回参数 |
| | | IndexStatisticsVO statisticsVO = new IndexStatisticsVO(); |
| | | |
| | |
| | | eventGridStatisticsVO.setGridEventStatisticsList(gridEventStatistics); |
| | | //查询网格数据 |
| | | List<EventGridDataVO> gridDataList = comMngPopulationDAO.getGridDataListByCommunityId(communityId); |
| | | if(!gridDataList.isEmpty()){ |
| | | if (!gridDataList.isEmpty()) { |
| | | gridDataList.forEach(gridData -> { |
| | | if(gridData != null){ |
| | | if (gridData != null) { |
| | | IndexGridStatisticsVO gridStatisticsVO = new IndexGridStatisticsVO(); |
| | | gridStatisticsVO.setEventData(gridData.getGridName()); |
| | | //根据网格id查询网格事件列表 |
| | |
| | | IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO(); |
| | | otherSpecialVO.setTitle("其他"); |
| | | otherSpecialVO.setSum(0); |
| | | if(!userTagList.isEmpty()){ |
| | | if (!userTagList.isEmpty()) { |
| | | userTagList.forEach(userTag -> { |
| | | if(userTag != null){ |
| | | if(userTag.getSysFlag().equals(0)){ |
| | | if (userTag != null) { |
| | | if (userTag.getSysFlag().equals(0)) { |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | otherSpecialVO.setSum(otherSpecialVO.getSum() + count); |
| | | }else{ |
| | | if(StringUtils.isNotEmpty(userTag.getTagName())){ |
| | | if(userTag.getTagName().equals("特扶家庭")){ |
| | | } else { |
| | | if (StringUtils.isNotEmpty(userTag.getTagName())) { |
| | | if (userTag.getTagName().equals("特扶家庭")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(22); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("低保户")){ |
| | | } else if (userTag.getTagName().equals("低保户")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(94); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("低收入人群")){ |
| | | } else if (userTag.getTagName().equals("低收入人群")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(2); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("退役军人")){ |
| | | } else if (userTag.getTagName().equals("退役军人")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(264); |
| | |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | private List<IndexPopulationAgeStatisticsVO> statisticsAge(Long communityId){ |
| | | Map<String,Long> ageMap = populationDAO.indexCountByAge(communityId); |
| | | private List<IndexPopulationAgeStatisticsVO> statisticsAge(Long communityId) { |
| | | Map<String, Long> ageMap = populationDAO.indexCountByAge(communityId); |
| | | List<IndexPopulationAgeStatisticsVO> agePopulationList = new ArrayList<>(); |
| | | IndexPopulationAgeStatisticsVO ageStatisticsVO1 = new IndexPopulationAgeStatisticsVO(); |
| | | IndexPopulationAgeStatisticsVO ageStatisticsVO2 = new IndexPopulationAgeStatisticsVO(); |
| | |
| | | ageStatisticsVO5.setType(5); |
| | | ageStatisticsVO6.setType(6); |
| | | |
| | | if(ageMap.isEmpty()){ |
| | | if (ageMap.isEmpty()) { |
| | | ageStatisticsVO1.setSum(0); |
| | | ageStatisticsVO2.setSum(0); |
| | | ageStatisticsVO3.setSum(0); |
| | | ageStatisticsVO4.setSum(0); |
| | | ageStatisticsVO5.setSum(0); |
| | | ageStatisticsVO6.setSum(0); |
| | | }else{ |
| | | } else { |
| | | ageStatisticsVO1.setSum(ageMap.get("age16").intValue()); |
| | | ageStatisticsVO2.setSum(ageMap.get("age27").intValue()); |
| | | ageStatisticsVO3.setSum(ageMap.get("age35").intValue()); |
| | |
| | | |
| | | /** |
| | | * 事件大屏统计接口 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getScreenEvent(Long communityId){ |
| | | public R getScreenEvent(Long communityId) { |
| | | //创建统计返回参数 |
| | | EventStatisticsVO statisticsVO = new EventStatisticsVO(); |
| | | |
| | |
| | | |
| | | //查询事件播报模块数据 |
| | | EventNewStatisticsVO newStatisticsVO = this.baseMapper.getEventScreenRightTop(communityId); |
| | | if(newStatisticsVO != null){ |
| | | if (newStatisticsVO != null) { |
| | | //查询事件资源文件 |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | |
| | | List<EventGridIncidentStatisticsVO> gridIncidentList = this.baseMapper.getEventScreenEventList(communityId); |
| | | statisticsVO.setGridIncidentList(gridIncidentList); |
| | | |
| | | //查询小区列表 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId); |
| | | if(!villageStatisticsList.isEmpty()){ |
| | | villageStatisticsList.forEach(village -> { |
| | | CivilVillageStatisticsVO villageStatisticsVO = this.baseMapper.getCivilScreenVillageStatistics(village.getVillageId()); |
| | | if(villageStatisticsVO != null){ |
| | | BeanUtils.copyProperties(villageStatisticsVO,village); |
| | | } |
| | | }); |
| | | } |
| | | statisticsVO.setVillageStatisticsList(villageStatisticsList); |
| | | |
| | | //查询统计人口数据 |
| | | ComMngPopulationTotalVO populationTotalVO = populationDAO.getPopulationTotalByAdmin(communityId); |
| | | statisticsVO.setPopulationTotalVO(populationTotalVO); |
| | | |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 民生大屏统计接口 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R getScreenCivil(Long communityId){ |
| | | public R getScreenCivil(Long communityId) { |
| | | //创建统计返回参数 |
| | | CivilStatisticsVO civilStatisticsVO = new CivilStatisticsVO(); |
| | | |
| | |
| | | IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO(); |
| | | otherSpecialVO.setTitle("其他"); |
| | | otherSpecialVO.setSum(0); |
| | | if(!userTagList.isEmpty()){ |
| | | if (!userTagList.isEmpty()) { |
| | | userTagList.forEach(userTag -> { |
| | | if(userTag != null){ |
| | | if(userTag.getSysFlag().equals(0)){ |
| | | if (userTag != null) { |
| | | if (userTag.getSysFlag().equals(0)) { |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | otherSpecialVO.setSum(otherSpecialVO.getSum() + count); |
| | | }else{ |
| | | if(StringUtils.isNotEmpty(userTag.getTagName())){ |
| | | if(userTag.getTagName().equals("特扶家庭")){ |
| | | } else { |
| | | if (StringUtils.isNotEmpty(userTag.getTagName())) { |
| | | if (userTag.getTagName().equals("特扶家庭")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(22); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("低保户")){ |
| | | } else if (userTag.getTagName().equals("低保户")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(94); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("低收入人群")){ |
| | | } else if (userTag.getTagName().equals("低收入人群")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(2); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | }else if(userTag.getTagName().equals("退役军人")){ |
| | | } else if (userTag.getTagName().equals("退役军人")) { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | specialStatisticsVO.setSum(264); |
| | |
| | | //计算特殊人群总数 |
| | | specialStatisticsVOList.add(otherSpecialVO); |
| | | Integer specialNum = 0; |
| | | if(!specialStatisticsVOList.isEmpty()){ |
| | | for (IndexSpecialStatisticsVO special:specialStatisticsVOList) { |
| | | if (!specialStatisticsVOList.isEmpty()) { |
| | | for (IndexSpecialStatisticsVO special : specialStatisticsVOList) { |
| | | specialNum += special.getSum(); |
| | | } |
| | | } |
| | |
| | | |
| | | //计算环比上月增长率 |
| | | BigDecimal rate = BigDecimal.ZERO; |
| | | CivilPopulationStatisticsVO populationStatisticsVO = this.baseMapper.getCivilScreenPopulation(communityId,DateUtils.getFirstDayOfMonth()); |
| | | if(populationStatisticsVO != null){ |
| | | if(populationStatisticsVO.getToMonthSpecialTotal().equals(0)){ |
| | | CivilPopulationStatisticsVO populationStatisticsVO = this.baseMapper.getCivilScreenPopulation(communityId, DateUtils.getFirstDayOfMonth()); |
| | | if (populationStatisticsVO != null) { |
| | | if (populationStatisticsVO.getToMonthSpecialTotal().equals(0)) { |
| | | rate = BigDecimal.valueOf(100); |
| | | }else{ |
| | | rate = BigDecimal.valueOf(populationStatisticsVO.getSpecialTotal() - populationStatisticsVO.getToMonthSpecialTotal()).divide(BigDecimal.valueOf(populationStatisticsVO.getToMonthSpecialTotal()),3,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } else { |
| | | rate = BigDecimal.valueOf(populationStatisticsVO.getSpecialTotal() - populationStatisticsVO.getToMonthSpecialTotal()).divide(BigDecimal.valueOf(populationStatisticsVO.getToMonthSpecialTotal()), 3, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | } |
| | | civilStatisticsVO.setRate(rate); |
| | |
| | | civilStatisticsVO.setVillageStatisticsList(villageStatisticsList); |
| | | |
| | | return R.ok(civilStatisticsVO); |
| | | } |
| | | |
| | | @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("根据身份证查询业务-加密证件信息出错"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | comActPopulationScreenVO.setUsedCommunityNum(count == null ? 0 : count); |
| | | |
| | | //统计性别 |
| | | Map<String,Long> sexMap = populationDAO.countBySex(communityId); |
| | | 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); |
| | | int manPoint = (int) (((double) comActPopulationScreenVO.getManNum() / (double) comActPopulationScreenVO.getTotalNum()) * 100); |
| | | comActPopulationScreenVO.setManPoint(manPoint); |
| | | comActPopulationScreenVO.setWomanPoint(100 - manPoint); |
| | | |
| | | //统计年龄结构 |
| | | setAgeGroup(comActPopulationScreenVO,communityId); |
| | | setAgeGroup(comActPopulationScreenVO, communityId); |
| | | //统计学历 |
| | | setCultureGroup(comActPopulationScreenVO,communityId); |
| | | |
| | | //查询网格数据 |
| | | List<EventGridStatisticsVO> gridStatisticsList = this.baseMapper.getEventScreenGridData(communityId); |
| | | comActPopulationScreenVO.setGridStatisticsList(gridStatisticsList); |
| | | |
| | | //查询小区列表 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId); |
| | | comActPopulationScreenVO.setVillageStatisticsList(villageStatisticsList); |
| | | setCultureGroup(comActPopulationScreenVO, communityId); |
| | | |
| | | return R.ok(comActPopulationScreenVO); |
| | | } |
| | | |
| | | |
| | | private void setCultureGroup(ComActPopulationScreenVO comActPopulationScreenVO, Long communityId) { |
| | | Map<String,Long> cultureMap = populationDAO.countByCulture(communityId); |
| | | Map<String, Long> cultureMap = populationDAO.countByCulture(communityId); |
| | | List<ComActPopulationCultureVO> cultureGroup = new ArrayList<>(); |
| | | ComActPopulationCultureVO xx = new ComActPopulationCultureVO(); |
| | | xx.setLevel(PopulCultureLevelEnum.XX.getName()); |
| | |
| | | comActPopulationScreenVO.setCultureGroup(cultureGroup); |
| | | } |
| | | |
| | | private void setAgeGroup(ComActPopulationScreenVO comActPopulationScreenVO,Long communityId) { |
| | | Map<String,Long> ageMap = populationDAO.countByAge(communityId); |
| | | private void setAgeGroup(ComActPopulationScreenVO comActPopulationScreenVO, Long communityId) { |
| | | Map<String, Long> ageMap = populationDAO.countByAge(communityId); |
| | | List<ComMngPopulationAgeVO> ageList = new ArrayList<>(); |
| | | ComMngPopulationAgeVO ageVO16 = new ComMngPopulationAgeVO(); |
| | | ageVO16.setGroup("0-16岁"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getScreenGirds(Long communityId){ |
| | | public R getScreenGirds(Long communityId) { |
| | | return R.ok(this.baseMapper.getEventScreenGridData(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R getScreenEventDetail(BigScreenEventDetailDTO eventDetailDTO){ |
| | | public R getScreenEventDetail(BigScreenEventDetailDTO eventDetailDTO) { |
| | | EventNewStatisticsVO statisticsVO = new EventNewStatisticsVO(); |
| | | if(eventDetailDTO.getType().equals(7)){//随手拍详情 |
| | | if (eventDetailDTO.getType().equals(7)) {//随手拍详情 |
| | | statisticsVO = this.baseMapper.getEventScreenSSPDateil(eventDetailDTO.getEventId()); |
| | | if(statisticsVO != null && StringUtils.isNotEmpty(statisticsVO.getPhotoPathList())){ |
| | | if (statisticsVO != null && StringUtils.isNotEmpty(statisticsVO.getPhotoPathList())) { |
| | | statisticsVO.setDangerLevel("0"); |
| | | statisticsVO.setMajor(false); |
| | | statisticsVO.setUrgent(false); |
| | | if(statisticsVO.getEventDealStatus().equals(2)){ |
| | | if (statisticsVO.getEventDealStatus().equals(2)) { |
| | | statisticsVO.setEventDealStatus(4); |
| | | } |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | String [] pics = statisticsVO.getPhotoPathList().split(","); |
| | | if(pics.length > 0){ |
| | | String[] pics = statisticsVO.getPhotoPathList().split(","); |
| | | if (pics.length > 0) { |
| | | for (int i = 0; i < pics.length; i++) { |
| | | EventResourceVO resourceVO = new EventResourceVO(); |
| | | resourceVO.setType(1); |
| | |
| | | } |
| | | statisticsVO.setPics(picList); |
| | | } |
| | | }else{//事件详情 |
| | | } else {//事件详情 |
| | | statisticsVO = this.baseMapper.getEventScreenEventDetail(eventDetailDTO.getEventId()); |
| | | if(statisticsVO != null){ |
| | | if (statisticsVO != null) { |
| | | //查询事件资源文件 |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | |
| | | |
| | | //查询事件流转记录 |
| | | List<EventTransferRecordVO> transferRecordList = this.baseMapper.getEventScreenEventTransList(eventDetailDTO.getEventId()); |
| | | if(!transferRecordList.isEmpty()){ |
| | | transferRecordList.forEach(transfer -> { |
| | | if(transfer.getFromType().equals(EventTransferRecordVO.fromType.wgy)){ |
| | | //查询上级网格信息 |
| | | EventTransferRecordDetailVO transferRecordDetailVO = this.baseMapper.getEventScreenEventTransDetail(transfer.getEventId()); |
| | | transfer.setSuperiorRelationship(transferRecordDetailVO.getStreetName() + "-" |
| | | + transferRecordDetailVO.getCommunityName() + "-" + transferRecordDetailVO.getGridName()); |
| | | }else if(transfer.getFromType().equals(EventTransferRecordVO.fromType.sq)){ |
| | | //查询上级社区信息 |
| | | EventTransferRecordDetailVO transferRecordDetailVO = this.baseMapper.getEventScreenEventTransDetailByCommunityId(transfer.getFromId()); |
| | | transfer.setSuperiorRelationship(transferRecordDetailVO.getStreetName() + "-" |
| | | + transferRecordDetailVO.getCommunityName()); |
| | | } |
| | | }); |
| | | } |
| | | statisticsVO.setTransferRecordList(transferRecordList); |
| | | } |
| | | } |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new)); |
| | | @Override |
| | | public R pagePopulationListApp(PagePopulationListDTO populationListDTO){ |
| | | IPage<PopulationListVO> pagePopulationList = this.baseMapper.pagePopulationListApp(new Page(populationListDTO.getPageNum(),populationListDTO.getPageSize()),populationListDTO); |
| | | if(!pagePopulationList.getRecords().isEmpty()){ |
| | | pagePopulationList.getRecords().forEach(population -> { |
| | | population.setAge(IdcardUtil.getAgeByIdCard(population.getCardNo())); |
| | | }); |
| | | } |
| | | return R.ok(pagePopulationList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R getPopulationDetailApp(Long populationId){ |
| | | PopulationDetailVO detail = this.baseMapper.getPopulationDetailApp(populationId); |
| | | if(detail != null){ |
| | | detail.setAge(IdcardUtil.getAgeByIdCard(detail.getCardNo())); |
| | | if(StringUtils.isNotEmpty(detail.getCultureLevel())){ |
| | | detail.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(Integer.parseInt(detail.getCultureLevel()))); |
| | | } |
| | | if(StringUtils.isNotEmpty(detail.getMarriage())){ |
| | | detail.setMarriage(PopulMarriageEnum.getCnDescByName(Integer.parseInt(detail.getMarriage()))); |
| | | } |
| | | } |
| | | return R.ok(detail); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R getPopulationRepairByApp(){ |
| | | List<ComMngPopulationDO> populationDOList = this.baseMapper.selectList(new QueryWrapper<ComMngPopulationDO>()); |
| | | if(!populationDOList.isEmpty()){ |
| | | populationDOList.forEach(population -> { |
| | | this.baseMapper.updateById(population); |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | |
| | | if (comActDO == null || comActDO.getStreetId() == null) { |
| | | return R.fail("社区没有绑定街道,请绑定后操作!"); |
| | | } |
| | | comMngVillageDO.setVillageId(Snowflake.getId()); |
| | | comMngVillageDO.setStreetId(comActDO.getStreetId()); |
| | | comMngVillageDO.setUpdateAt(new Date()); |
| | | int insert = comActVillageDAO.insert(comMngVillageDO); |
| | |
| | | |
| | | 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | |
| | | 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.model.dos.ComActDynDO; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.apache.commons.net.ntp.TimeStamp; |
| | | 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; |
| | |
| | | private static final Integer pageSize = 200; |
| | | |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | |
| | | @Resource |
| | | private ComActDynDAO comActDynDAO; |
| | | @Resource |
| | | private ComActMicroWishDAO comActMicroWishDAO; |
| | | |
| | | @Resource |
| | | private ComActActivityDAO actActivityDAO; |
| | | |
| | | @Resource |
| | | private ComActDiscussDAO comActDiscussDAO; |
| | | |
| | | @Resource |
| | | private ComPbDynDAO comPbDynDAO; |
| | | |
| | | @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) { |
| | |
| | | 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); |
| | | BigDecimal rt = num.divide(days,1, RoundingMode.HALF_UP); |
| | | comActWorkScreenVO.setEveryDayNum(rt.toString()); |
| | | return R.ok(comActWorkScreenVO); |
| | | } |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | @Override |
| | | public R dynamicWork(Long communityId){ |
| | | ComDynamicWorkScreenVO workScreenVO = new ComDynamicWorkScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = comActDynDAO.countByCommunityId(communityId,date); |
| | | if(!countMap.isEmpty()){ |
| | | workScreenVO.setTotalNum(countMap.get("dynTotal")== null ? 0L : Long.valueOf(countMap.get("dynTotal").toString())); |
| | | workScreenVO.setCurrentNum(countMap.get("currentNum")== null ? 0L : Long.valueOf(countMap.get("currentNum").toString())); |
| | | } |
| | | |
| | | //计算平均每天动态 |
| | | DateScreenVO countAvg = comActDynDAO.countByAvgCommunityId(communityId); |
| | | if(countAvg != null){ |
| | | int day = DateUtils.differentDays(countAvg.getStartTime(),countAvg.getEndTime()); |
| | | if(day > 0){ |
| | | workScreenVO.setCurrentAvgNum(workScreenVO.getTotalNum().intValue()/day); |
| | | } |
| | | } |
| | | |
| | | //查询最新的10条社区动态 |
| | | List<String> dynList = new ArrayList<>(); |
| | | List<ComActDynDO> actDynDOList = comActDynDAO.selectList(new QueryWrapper<ComActDynDO>().lambda().eq(ComActDynDO::getCommunityId,communityId).orderByDesc(ComActDynDO::getCreateAt).last("limit 10")); |
| | | if(!actDynDOList.isEmpty()){ |
| | | actDynDOList.forEach(actDyn -> { |
| | | dynList.add(actDyn.getTitle()); |
| | | }); |
| | | } |
| | | workScreenVO.setDynList(dynList); |
| | | |
| | | //统计近半年数据 |
| | | List<DynamicWorkVO> list = new ArrayList<>(); |
| | | for(DynamicWorkVO dynamicWorkVO: listHalfYearByDyn()){ |
| | | DynamicWorkVO result = comActDynDAO.countByTime(dynamicWorkVO.getStart(),dynamicWorkVO.getEnd(),communityId); |
| | | result.setMonth(dynamicWorkVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | workScreenVO.setList(list); |
| | | |
| | | return R.ok(workScreenVO); |
| | | } |
| | | |
| | | private List<DynamicWorkVO> listHalfYearByDyn() { |
| | | List<DynamicWorkVO> dateList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | 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); |
| | | DynamicWorkVO dynamicWorkVO = new DynamicWorkVO(); |
| | | dynamicWorkVO.setMonth(monthStr[m]+"月上旬"); |
| | | dynamicWorkVO.setStart(month+ "-01 00:00:00"); |
| | | dynamicWorkVO.setEnd(month+ "-"+half+" 23:59:58"); |
| | | dateList.add(dynamicWorkVO); |
| | | DynamicWorkVO dynamicWorkVO1 = new DynamicWorkVO(); |
| | | dynamicWorkVO1.setMonth(monthStr[m]+"月下旬"); |
| | | dynamicWorkVO1.setStart(month+ "-"+half+" 23:59:58"); |
| | | dynamicWorkVO1.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(dynamicWorkVO1); |
| | | } |
| | | return dateList; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.SysConfMapper; |
| | | import com.panzhihua.service_community.model.dos.SysConfDO; |
| | | import com.panzhihua.service_community.service.SysConfService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-23 10:41:36 |
| | | * @describe 系统配置表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SysConfServiceImpl extends ServiceImpl<SysConfMapper, SysConfDO> implements SysConfService { |
| | | |
| | | } |
| | |
| | | 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"); |
| | | } |
| | | |
| | | } |
| | |
| | | return eventService.getScreenEventList(eventListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 工作大屏-事件播报数据统计 |
| | | * @param communityId 社区id |
| | | * @return 事件播报数据统计 |
| | | */ |
| | | @GetMapping("/work/event") |
| | | public R eventWork(@RequestParam("communityId")Long communityId) { |
| | | return eventService.eventWork(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | @Resource |
| | | 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 |
| | |
| | | R reportDirect(@RequestBody CommonEventDirectReportDTO commonEventDirectReportDTO){ |
| | | return eventService.reportDirect(commonEventDirectReportDTO); |
| | | } |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | @PostMapping("/special/population/list") |
| | | public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){ |
| | | return eventService.specialPopulationList(specialPopulationDTO); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO; |
| | | import com.panzhihua.service_grid.service.EventVisitingTasksService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | private EventVisitingTasksService eventVisitingTasksService; |
| | | |
| | | /** |
| | | * 新增重点人群走访记录 |
| | | * @param eventVisitingTasksAddDTO |
| | | * @return 新增结果 |
| | | * 统计走访任务 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(@RequestBody EventVisitingTasksAddDTO eventVisitingTasksAddDTO){ |
| | | return eventVisitingTasksService.add(eventVisitingTasksAddDTO); |
| | | }; |
| | | @GetMapping("/count") |
| | | R count(@RequestParam("communityId") Long communityId){ |
| | | return eventVisitingTasksService.count(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 修改重点人群走访记录 |
| | |
| | | @PostMapping("/edit") |
| | | R edit(@RequestBody EventVisitingTasksEditDTO eventVisitingTasksEditDTO){ |
| | | return eventVisitingTasksService.edit(eventVisitingTasksEditDTO); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 分页查找重点人群走访记录 |
| | |
| | | @PostMapping("/page") |
| | | R<IPage<EventVisitingTasksVO>> query(@RequestBody PageEventVisitingTasksDTO pageEventVisitingTasksDTO){ |
| | | return eventVisitingTasksService.query(pageEventVisitingTasksDTO); |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 删除重点人群走访记录 |
| | | * @param EventVisitingTasksDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | @PostMapping("/delete") |
| | | R delete(@RequestBody EventVisitingTasksDeleteDTO EventVisitingTasksDeleteDTO){ |
| | | return eventVisitingTasksService.delete(EventVisitingTasksDeleteDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 查询重点人群走访记录详细信息 |
| | |
| | | @PostMapping("/{id}") |
| | | R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(@PathVariable("id") Long id){ |
| | | return eventVisitingTasksService.eventVisitingTasksDetails(id); |
| | | }; |
| | | } |
| | | /** |
| | | * 删除走访任务 |
| | | * @param ids |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/delete") |
| | | R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId){ |
| | | return eventVisitingTasksService.delete(ids,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 需走访人员列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/visitorList") |
| | | R visitorList(@RequestBody EventVisitListQuery query){ |
| | | |
| | | return eventVisitingTasksService.visitorList(query); |
| | | } |
| | | |
| | | /** |
| | | * 新增走访任务 |
| | | * @param ids |
| | | * @param communityId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(@RequestParam("ids") String ids,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId){ |
| | | return eventVisitingTasksService.add(ids,communityId,userId); |
| | | } |
| | | |
| | | /** |
| | | * 走访记录 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | R list(@RequestBody EventTasksQuery query){ |
| | | |
| | | return eventVisitingTasksService.list(query); |
| | | } |
| | | |
| | | /** |
| | | * 走访任务列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/taskList") |
| | | R taskList(@RequestBody EventTasksQuery query){ |
| | | |
| | | return eventVisitingTasksService.taskList(query); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/exportTaskList") |
| | | List<EventVisitingTasksVO> exportTaskList(@RequestBody EventTasksQuery query){ |
| | | return eventVisitingTasksService.exportTaskList(query); |
| | | } |
| | | |
| | | /** |
| | | * app走访详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | R detail(@PathVariable("id") Long id) throws Exception { |
| | | return eventVisitingTasksService.detail(id); |
| | | } |
| | | |
| | | /** |
| | | * 撤销走访 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancel/{id}") |
| | | R cancel(@PathVariable("id") Long id){ |
| | | return eventVisitingTasksService.cancel(id); |
| | | } |
| | | |
| | | /** |
| | | * 恢复 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/reset/{id}") |
| | | R reset(@PathVariable("id") Long id){ |
| | | return eventVisitingTasksService.reset(id); |
| | | } |
| | | |
| | | /** |
| | | * 开始走访 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/start") |
| | | R start(@RequestParam("id")Long id,@RequestParam("userId")Long userId){ |
| | | return eventVisitingTasksService.start(id,userId); |
| | | } |
| | | |
| | | /** |
| | | * 完成走访记录 |
| | | * @param taskCompleteDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/complete") |
| | | R complete(@RequestBody EventVisitCompleteDTO taskCompleteDTO){ |
| | | return eventVisitingTasksService.complete(taskCompleteDTO); |
| | | } |
| | | } |
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); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventListVO; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.screen.DateScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.EventDetailWorkVO; |
| | | import com.panzhihua.common.model.vos.screen.EventTypeWorkVO; |
| | | import com.panzhihua.common.model.vos.screen.EventWorkVO; |
| | | import com.panzhihua.service_grid.model.dos.EventDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | IPage<EventListVO> getScreenEventList(Page page, @Param("eventListDTO") ScreenEventListDTO eventListDTO); |
| | | |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | IPage<EventSpecialPopulationVO> specialPopulationList(Page page, @Param("specialPopulationDTO") PageEventSpecialPopulationDTO specialPopulationDTO); |
| | | |
| | | Map<String,Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | DateScreenVO countByAvgCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | List<EventDetailWorkVO> getWorkScreenEventList(@Param("communityId") Long communityId); |
| | | |
| | | EventWorkVO countByTime(@Param("start")String start, @Param("end")String end, @Param("communityId")Long communityId); |
| | | |
| | | EventTypeWorkVO getComplete(@Param("communityId") Long communityId); |
| | | |
| | | EventTypeWorkVO getNoComplete(@Param("communityId") Long communityId); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * DAO |
| | | * |
| | |
| | | */ |
| | | IPage<EventResourceVO> findByPage(Page page, @Param("pageEventResourceDTO")PageEventResourceDTO pageEventResourceDTO); |
| | | |
| | | List<String> findListByRefId(@Param("id")Long id,@Param("classification")Integer classification,@Param("type")Integer type); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.grid.EventSpecialPopulationDetailsVO; |
| | | import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-22 15:37:01 |
| | | * @describe 事件-特殊人群上报人口关联表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface EventSpecialCrowdRecordMapper extends BaseMapper<EventSpecialCrowdRecordDO> { |
| | | |
| | | /** |
| | | * 根据事件id查询特殊人群人口数据 |
| | | * @param eventId 事件id |
| | | * @return 上报人群信息列表 |
| | | */ |
| | | List<EventSpecialPopulationDetailsVO> getSpecialPopulationIds(@Param("eventId")Long eventId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.visit.AppVisitTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitListVO; |
| | | import com.panzhihua.service_grid.model.dos.EventVisitingTasksDO; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * DAO |
| | |
| | | @Mapper |
| | | public interface EventVisitingTasksMapper extends BaseMapper<EventVisitingTasksDO> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param pageEventVisitingTasksDTO |
| | | * @return |
| | | */ |
| | | IPage<EventVisitingTasksVO> findByPage(Page page, @Param("pageEventVisitingTasksDTO")PageEventVisitingTasksDTO pageEventVisitingTasksDTO); |
| | | /** |
| | | * 统计待走访、已完成、已撤销的任务 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | Map<String, Long> count(@Param("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 后台查询走访记录 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<EventVisitingTasksVO> findListByPage(Page page, @Param("query")EventTasksQuery query); |
| | | |
| | | /** |
| | | * 查询走访记录,任务 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<AppVisitTasksVO> list(Page page, @Param("query") EventTasksQuery query); |
| | | |
| | | /** |
| | | * 需走访人员列表 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<EventVisitListVO> visitorList(Page page, @Param("query") EventVisitListQuery query); |
| | | |
| | | /** |
| | | * 后台根据社区id查询网格员 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | Map<String, Object> findUserByCommunityId(@Param("communityId")Long communityId, @Param("type")int type); |
| | | |
| | | /** |
| | | * 根据id查询实有人口 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Map<String, Object> findPopulationById(Long id); |
| | | |
| | | /** |
| | | * 统计未完成的走访任务 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Integer countNoneComplete(Long id); |
| | | |
| | | Integer updateEventStatus(@Param("id")Long id,@Param("status") Integer status); |
| | | |
| | | /** |
| | | * 完成走访 |
| | | * @param taskCompleteDTO |
| | | * @return |
| | | */ |
| | | Integer complete(EventVisitCompleteDTO taskCompleteDTO); |
| | | |
| | | Integer start(EventVisitingTasksDO start); |
| | | |
| | | Integer cancel(@Param("id")Long id,@Param("status") Integer status); |
| | | |
| | | Map<String, Object> findUserById(Long userId); |
| | | |
| | | String getLabel(Long id); |
| | | } |
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; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-22 15:37:01 |
| | | * @describe 事件-特殊人群上报人口关联表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("event_special_crowd_record") |
| | | public class EventSpecialCrowdRecordDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 事件id |
| | | */ |
| | | private Long eventId; |
| | | |
| | | /** |
| | | * 实有人口id |
| | | */ |
| | | private Long populationId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EventSpecialCrowdRecordDO{" + |
| | | "id=" + id + |
| | | ", eventId=" + eventId + |
| | | ", populationId=" + populationId + |
| | | ", createAt=" + createAt + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 是否异常行为 列: exception |
| | | */ |
| | | private Boolean exception; |
| | | private Integer exception; |
| | | /** |
| | | * 走访内容根据重点人员类型输入项不同,录入全部的表单内容数据 列: table_content_json |
| | | */ |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 地址备注 |
| | | */ |
| | | private String addressRemark; |
| | | /** |
| | | * 家庭联系电话 |
| | | */ |
| | | private String familyPhone; |
| | | |
| | | /** |
| | | * 家庭来源 |
| | | */ |
| | | private String familySource; |
| | | |
| | | /** |
| | | * 访问后的填写的地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 访问后的经纬度 |
| | | */ |
| | | private String latLng; |
| | | |
| | | /** |
| | | * 本地或外地:1本地2外地 |
| | | */ |
| | | private Integer outOrLocal; |
| | | |
| | | |
| | | } |
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 getScreenEventList(ScreenEventListDTO eventListDTO); |
| | | |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO); |
| | | /** |
| | | * 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); |
| | | |
| | | R eventWork(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-22 15:37:01 |
| | | * @describe 事件-特殊人群上报人口关联表服务类 |
| | | */ |
| | | public interface EventSpecialCrowdRecordService extends IService<EventSpecialCrowdRecordDO> { |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.IPageVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO; |
| | | import com.panzhihua.service_grid.model.dos.EventVisitingTasksDO; |
| | | |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 重点人群走访记录 service |
| | |
| | | R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(Long id); |
| | | |
| | | |
| | | /** |
| | | * 后台统计走访任务 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R count(Long communityId); |
| | | |
| | | /** |
| | | * 走访任务列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | R taskList(EventTasksQuery query); |
| | | |
| | | /** |
| | | * 删除走访任务 |
| | | * @param ids |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R delete(String ids, Long communityId); |
| | | |
| | | /** |
| | | * 需走访人员列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | R visitorList(EventVisitListQuery query); |
| | | |
| | | /** |
| | | * app查询走访记录 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | R list(EventTasksQuery query); |
| | | |
| | | /** |
| | | * app 走访详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R detail(Long id) throws Exception; |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param ids |
| | | * @param communityId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R add(String ids, Long communityId, Long userId); |
| | | |
| | | List<EventVisitingTasksVO> exportTaskList(EventTasksQuery query); |
| | | |
| | | /** |
| | | * 撤销 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R cancel(Long id); |
| | | |
| | | /** |
| | | * 恢复 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R reset(Long id); |
| | | |
| | | /** |
| | | * 开始 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R start(Long id,Long userId); |
| | | |
| | | /** |
| | | * 完成 |
| | | * @param taskCompleteDTO |
| | | * @return |
| | | */ |
| | | R complete(EventVisitCompleteDTO taskCompleteDTO); |
| | | } |
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); |
| | | } |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | 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.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventListVO; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.ExcelSelectListUtil; |
| | | import com.panzhihua.common.utlis.LngLatUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_grid.dao.*; |
| | | import com.panzhihua.service_grid.model.dos.*; |
| | | import com.panzhihua.service_grid.service.EventGridDataService; |
| | | import com.panzhihua.service_grid.service.EventResourceService; |
| | | import com.panzhihua.service_grid.service.EventService; |
| | | import com.panzhihua.service_grid.service.EventTransferRecordService; |
| | | import com.panzhihua.service_grid.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Resource |
| | | private EventGridMemberRelationMapper eventGridMemberRelationMapper; |
| | | @Resource |
| | | private EventSpecialCrowdRecordService eventSpecialCrowdRecordService; |
| | | @Resource |
| | | private EventSpecialCrowdRecordMapper eventSpecialCrowdRecordMapper; |
| | | @Resource |
| | | private EventGridDataService eventGridDataService; |
| | | @Resource |
| | | private EventResourceMapper eventResourceMapper; |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | |
| | | private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; |
| | | |
| | | /** |
| | | * 分页查找事件 |
| | |
| | | EventGridDataDO eventGridDataDO = eventGridDataMapper.selectById(eventDO.getGridId()); |
| | | if (eventGridDataDO != null) { |
| | | eventDetailsVO.setGridName(eventGridDataDO.getGridName()); |
| | | eventDetailsVO.setCommunityId(eventGridDataDO.getGridCommunityId()); |
| | | } |
| | | |
| | | //查询事件关联附件 |
| | |
| | | eventDetailsVO.setCreator(createUser.get("name") == null ? "" : createUser.get("name").toString()); |
| | | } |
| | | |
| | | //当事件为特殊人群上报时,需要查询事件与人口关联关系 |
| | | if(eventDetailsVO.getEventType().equals(6)){ |
| | | List<EventSpecialPopulationDetailsVO> specialPopulationList = eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId()); |
| | | if(!specialPopulationList.isEmpty()){ |
| | | specialPopulationList.forEach(special -> { |
| | | special.setAge(IdcardUtil.getAgeByIdCard(special.getIdCard())); |
| | | }); |
| | | } |
| | | eventDetailsVO.setPopulationList(specialPopulationList); |
| | | } |
| | | return R.ok(eventDetailsVO); |
| | | } |
| | | return R.fail("事件不存在"); |
| | |
| | | if (eventGridDataDO == null) { |
| | | return R.fail("网格不存在"); |
| | | } |
| | | |
| | | //检查特殊人群上报时参数 |
| | | if(commonEventAddDTO.getEventType().equals(6)){ |
| | | if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){ |
| | | return R.fail("上报人员为空"); |
| | | } |
| | | } |
| | | |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | |
| | | eventDO.setSubmitDate(new Date()); |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | if (eventMapper.insert(eventDO) == 1) { |
| | | |
| | | //如果是特殊人群,则新增特殊人群与事件关系 |
| | | if(commonEventAddDTO.getEventType().equals(6)){ |
| | | List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); |
| | | commonEventAddDTO.getPopulationIds().forEach(populationId -> { |
| | | EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); |
| | | specialCrowdRecordDO.setEventId(eventDO.getId()); |
| | | specialCrowdRecordDO.setPopulationId(populationId); |
| | | specialCrowdRecordDO.setCreateAt(new Date()); |
| | | crowdRecordList.add(specialCrowdRecordDO); |
| | | }); |
| | | //添加特殊人群上报事件与人口关系 |
| | | eventSpecialCrowdRecordService.saveBatch(crowdRecordList); |
| | | } |
| | | |
| | | //添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventAddDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | |
| | | if (eventGridDataDO == null) { |
| | | return R.fail("网格不存在"); |
| | | } |
| | | |
| | | if (commonEventEditDTO.getId() == null) { |
| | | //检查特殊人群上报时参数 |
| | | if(commonEventEditDTO.getEventType().equals(6)){ |
| | | if(commonEventEditDTO.getPopulationIds().isEmpty()){ |
| | | return R.fail("上报人员为空"); |
| | | } |
| | | } |
| | | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(commonEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(commonEventEditDTO.getUserId()); |
| | |
| | | eventDO.setGridMemberTelephone(commonEventEditDTO.getPhone()); |
| | | eventDO.setEventDealStatus(5); |
| | | if (eventMapper.insert(eventDO) > 0) { |
| | | |
| | | //如果是特殊人群,则新增特殊人群与事件关系 |
| | | if(commonEventEditDTO.getEventType().equals(6)){ |
| | | List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); |
| | | commonEventEditDTO.getPopulationIds().forEach(populationId -> { |
| | | EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); |
| | | specialCrowdRecordDO.setEventId(eventDO.getId()); |
| | | specialCrowdRecordDO.setPopulationId(populationId); |
| | | specialCrowdRecordDO.setCreateAt(new Date()); |
| | | crowdRecordList.add(specialCrowdRecordDO); |
| | | }); |
| | | //添加特殊人群上报事件与人口关系 |
| | | eventSpecialCrowdRecordService.saveBatch(crowdRecordList); |
| | | } |
| | | |
| | | //添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | |
| | | * @return 事件列表 |
| | | */ |
| | | @Override |
| | | public R getScreenEventList(ScreenEventListDTO eventListDTO){ |
| | | if( eventListDTO.getEventType() != null && eventListDTO.getEventType().equals(ScreenEventListDTO.eventType.xc)){ |
| | | eventListDTO.setEventCategory(2); |
| | | public R getScreenEventList(ScreenEventListDTO eventListDTO) { |
| | | if (eventListDTO.getEventTypes() != null && !eventListDTO.getEventTypes().isEmpty()) { |
| | | eventListDTO.getEventTypes().forEach(eventType -> { |
| | | if(eventType.equals(ScreenEventListDTO.eventType.xc)){ |
| | | eventListDTO.setEventCategory(null); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(),eventListDTO.getPageSize()),eventListDTO); |
| | | IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(), eventListDTO.getPageSize()), eventListDTO); |
| | | if(!eventPageList.getRecords().isEmpty()){ |
| | | eventPageList.getRecords().forEach(event -> { |
| | | //查询事件关联附件 |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, event.getId()) |
| | | ); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | | eventResourceDOList.forEach(eventResourceDO -> { |
| | | switch (eventResourceDO.getType()) { |
| | | case 1: |
| | | EventResourceVO picEventResourceVO = new EventResourceVO(); |
| | | BeanUtils.copyProperties(eventResourceDO, picEventResourceVO); |
| | | picList.add(picEventResourceVO); |
| | | break; |
| | | case 2: |
| | | EventResourceVO audioResourceVO = new EventResourceVO(); |
| | | BeanUtils.copyProperties(eventResourceDO, audioResourceVO); |
| | | audioList.add(audioResourceVO); |
| | | break; |
| | | case 3: |
| | | EventResourceVO videoResourceVO = new EventResourceVO(); |
| | | BeanUtils.copyProperties(eventResourceDO, videoResourceVO); |
| | | videoList.add(videoResourceVO); |
| | | break; |
| | | } |
| | | }); |
| | | event.setAudios(audioList); |
| | | event.setPics(picList); |
| | | event.setVideos(videoList); |
| | | }); |
| | | } |
| | | return R.ok(eventPageList); |
| | | } |
| | | |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | @Override |
| | | public R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO) { |
| | | IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList(new Page(specialPopulationDTO.getPageNum(), specialPopulationDTO.getPageSize()), specialPopulationDTO); |
| | | if(!specialPopulationVOIPage.getRecords().isEmpty()){ |
| | | specialPopulationVOIPage.getRecords().forEach(specialPopulation -> { |
| | | specialPopulation.setAge(IdcardUtil.getAgeByIdCard(specialPopulation.getIdCard())); |
| | | }); |
| | | } |
| | | return R.ok(specialPopulationVOIPage); |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | |
| | | public R eventWork(Long communityId){ |
| | | EventWorkScreenVO workScreenVO = new EventWorkScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = this.eventMapper.countByCommunityId(communityId,date); |
| | | if(!countMap.isEmpty()){ |
| | | workScreenVO.setResolvedNum(countMap.get("resolvedNum")== null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString())); |
| | | workScreenVO.setPendingNum(countMap.get("pendingNum")== null ? 0L : Long.valueOf(countMap.get("pendingNum").toString())); |
| | | workScreenVO.setPropagandaNum(countMap.get("propagandaNum")== null ? 0L : Long.valueOf(countMap.get("propagandaNum").toString())); |
| | | workScreenVO.setCurrentNum(countMap.get("currentNum")== null ? 0L : Long.valueOf(countMap.get("currentNum").toString())); |
| | | } |
| | | |
| | | //计算处理时间消耗的时间 |
| | | DateScreenVO countAvg = this.eventMapper.countByAvgCommunityId(communityId); |
| | | if(countAvg != null){ |
| | | int second = (int) (countAvg.getStartTime().getTime() - countAvg.getEndTime().getTime())/1000; |
| | | if(second > 0){ |
| | | second = second/workScreenVO.getResolvedNum().intValue(); |
| | | workScreenVO.setAvgCost(second); |
| | | } |
| | | } |
| | | //查询最新事件轮播列表 |
| | | List<EventDetailWorkVO> eventList = this.eventMapper.getWorkScreenEventList(communityId); |
| | | if(!eventList.isEmpty()){ |
| | | workScreenVO.setEventList(eventList); |
| | | } |
| | | |
| | | //统计近半年数据 |
| | | List<EventWorkVO> list = new ArrayList<>(); |
| | | for(EventWorkVO eventWorkVO: listHalfYearByDyn()){ |
| | | EventWorkVO result = this.eventMapper.countByTime(eventWorkVO.getStart(),eventWorkVO.getEnd(),communityId); |
| | | result.setMonth(eventWorkVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | workScreenVO.setList(list); |
| | | |
| | | //查询完成事件统计 |
| | | EventTypeWorkVO complete = this.eventMapper.getComplete(communityId); |
| | | if(complete != null){ |
| | | workScreenVO.setComplete(complete); |
| | | } |
| | | //查询未完成事件统计 |
| | | EventTypeWorkVO noComplete = this.eventMapper.getNoComplete(communityId); |
| | | if(complete != null){ |
| | | workScreenVO.setNoComplete(noComplete); |
| | | } |
| | | return R.ok(workScreenVO); |
| | | } |
| | | |
| | | private List<EventWorkVO> listHalfYearByDyn() { |
| | | List<EventWorkVO> dateList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | 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 = 11; |
| | | // } |
| | | // m--; |
| | | int day = DateUtil.dayOfMonth(endDay); |
| | | int half = day/2; |
| | | String month = DateUtil.format(date,moth_format_str); |
| | | EventWorkVO eventWorkVO = new EventWorkVO(); |
| | | eventWorkVO.setMonth(monthStr[m]+"月上旬"); |
| | | eventWorkVO.setStart(month+ "-01 00:00:00"); |
| | | eventWorkVO.setEnd(month+ "-"+half+" 23:59:58"); |
| | | dateList.add(eventWorkVO); |
| | | EventWorkVO eventWorkVO1 = new EventWorkVO(); |
| | | eventWorkVO1.setMonth(monthStr[m]+"月下旬"); |
| | | eventWorkVO1.setStart(month+ "-"+half+" 23:59:58"); |
| | | eventWorkVO1.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(eventWorkVO1); |
| | | } |
| | | return dateList; |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | EventServiceImpl service = new EventServiceImpl(); |
| | | List<EventWorkVO> list = service.listHalfYearByDyn(); |
| | | System.out.println(list); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_grid.dao.EventSpecialCrowdRecordMapper; |
| | | import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; |
| | | import com.panzhihua.service_grid.service.EventSpecialCrowdRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-22 15:37:01 |
| | | * @describe 事件-特殊人群上报人口关联表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class EventSpecialCrowdRecordServiceImpl extends ServiceImpl<EventSpecialCrowdRecordMapper, EventSpecialCrowdRecordDO> implements EventSpecialCrowdRecordService { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.enums.EventTasksStatusEnum; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventVisitingTasksEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventVisitingTasksVO; |
| | | import com.panzhihua.common.model.vos.visit.*; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_grid.dao.*; |
| | | import com.panzhihua.service_grid.model.dos.*; |
| | | import com.panzhihua.service_grid.service.EventVisitingTasksService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | |
| | | @Resource |
| | | private EventVisitingTasksMapper eventVisitingTasksMapper; |
| | | |
| | | @Resource |
| | | private EventResourceMapper eventResourceMapper; |
| | | |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | /** |
| | | * 新增重点人群走访记录 |
| | | * @param eventVisitingTasksAddDTO |
| | |
| | | if(pageEventVisitingTasksDTO.getPageSize()!=null) { |
| | | page.setSize(pageEventVisitingTasksDTO.getPageSize()); |
| | | } |
| | | return R.ok(eventVisitingTasksMapper.findByPage(page, pageEventVisitingTasksDTO)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(eventVisitingTasksDO!=null) { |
| | | EventVisitingTasksDetailsVO eventVisitingTasksDetailsVO = new EventVisitingTasksDetailsVO(); |
| | | BeanUtils.copyProperties(eventVisitingTasksDO, eventVisitingTasksDetailsVO); |
| | | eventVisitingTasksDetailsVO.setImgList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,1)); |
| | | eventVisitingTasksDetailsVO.setVosList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,2)); |
| | | eventVisitingTasksDetailsVO.setVideoList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,3)); |
| | | return R.ok(eventVisitingTasksDetailsVO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R count(Long communityId) { |
| | | |
| | | Map<String,Long> countMap = eventVisitingTasksMapper.count(communityId); |
| | | EventVisitCountVO eventVisitCountVO = new EventVisitCountVO(); |
| | | eventVisitCountVO.setVisit(countMap.get("visit")); |
| | | eventVisitCountVO.setVisited(countMap.get("visited")); |
| | | eventVisitCountVO.setCanceled(countMap.get("canceled")); |
| | | return R.ok(eventVisitCountVO); |
| | | } |
| | | |
| | | @Override |
| | | public R taskList(EventTasksQuery query) { |
| | | |
| | | IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(),query.getPageSize()),query); |
| | | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public R delete(String ids, Long communityId) { |
| | | String[] idarr = ids.split(","); |
| | | for(String id:idarr){ |
| | | if(StringUtils.isEmpty(id)){ |
| | | continue; |
| | | } |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectOne(new QueryWrapper<EventVisitingTasksDO>().eq("id",Long.valueOf(id)).eq("grid_member_community",communityId)); |
| | | if(eventVisitingTasksDO == null){ |
| | | throw new RuntimeException("无权限"); |
| | | } |
| | | eventVisitingTasksMapper.deleteById(Long.valueOf(id)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R visitorList(EventVisitListQuery query) { |
| | | IPage<EventVisitListVO> page = eventVisitingTasksMapper.visitorList(new Page(query.getPageNum(),query.getPageSize()),query); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Override |
| | | public R list(EventTasksQuery query) { |
| | | IPage<AppVisitTasksVO> page = eventVisitingTasksMapper.list(new Page(query.getPageNum(),query.getPageSize()),query); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Override |
| | | public R detail(Long id) throws Exception { |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id); |
| | | if(eventVisitingTasksDO!=null) { |
| | | EventVisitingTasksDetailsVO eventVisitingTasksDetailsVO = new EventVisitingTasksDetailsVO(); |
| | | BeanUtils.copyProperties(eventVisitingTasksDO, eventVisitingTasksDetailsVO); |
| | | eventVisitingTasksDetailsVO.setVisiterTele(AESUtil.decrypt128(eventVisitingTasksDO.getVisiterTele(), aesKey)); |
| | | eventVisitingTasksDetailsVO.setTableContentJson(JSONObject.parseObject(eventVisitingTasksDO.getTableContentJson())); |
| | | return R.ok(eventVisitingTasksDetailsVO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R add(String ids, Long communityId, Long userId) { |
| | | Map<String,Object> map = eventVisitingTasksMapper.findUserByCommunityId(communityId,6); |
| | | if(CollectionUtils.isEmpty(map)){ |
| | | return R.fail("网格员不存在"); |
| | | } |
| | | String[] id = ids.split(","); |
| | | for(String idstr:id){ |
| | | if(StringUtils.isEmpty(idstr)){ |
| | | continue; |
| | | } |
| | | addVisitingTask(Long.valueOf(idstr),map,communityId,userId); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public List<EventVisitingTasksVO> exportTaskList(EventTasksQuery query) { |
| | | IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(),query.getPageSize()),query); |
| | | |
| | | return page.getRecords(); |
| | | } |
| | | |
| | | |
| | | |
| | | private void addVisitingTask(Long id, Map<String, Object> gridMap,Long communityId,Long userId) { |
| | | |
| | | Integer count = eventVisitingTasksMapper.countNoneComplete(id); |
| | | if(count > 0){ |
| | | return; |
| | | } |
| | | Map<String,Object> map = eventVisitingTasksMapper.findPopulationById(id); |
| | | if(CollectionUtils.isEmpty(map)){ |
| | | return ; |
| | | } |
| | | EventVisitingTasksDO visitingTasksDO = new EventVisitingTasksDO(); |
| | | // visitingTasksDO.setGridMemberStreet(Long.valueOf(gridMap.get("street_id").toString())); |
| | | // visitingTasksDO.setGridMemberCommunity(communityId); |
| | | // visitingTasksDO.setGridMember(Long.valueOf(gridMap.get("user_id").toString())); |
| | | // visitingTasksDO.setGridMemberName(gridMap.get("name").toString()); |
| | | // visitingTasksDO.setGridMenberTele(gridMap.get("phone") ==null?"":gridMap.get("phone").toString()); |
| | | visitingTasksDO.setVisiterId(Long.valueOf(map.get("id").toString())); |
| | | visitingTasksDO.setVisiterName(map.get("name").toString()); |
| | | visitingTasksDO.setVisiterSex(Integer.valueOf(map.get("sex").toString())); |
| | | visitingTasksDO.setVisiterTele(map.get("phone") == null?"":map.get("phone").toString()); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(map.get("address")).append(map.get("road")).append(map.get("door_no")).append(map.get("floor")).append("栋").append(map.get("unit_no")).append("单元").append(map.get("house_no")).append("号"); |
| | | visitingTasksDO.setVisiterAddress(sb.toString()); |
| | | visitingTasksDO.setVisiterType(0); |
| | | visitingTasksDO.setActOpara(0); |
| | | if(map.get("lat") != null && map.get("lng") != null){ |
| | | visitingTasksDO.setHappentLatLng(map.get("lat")+"-"+map.get("lng")); |
| | | } |
| | | visitingTasksDO.setEventStatus(EventTasksStatusEnum.DZF.getCode()); |
| | | visitingTasksDO.setReporting(0); |
| | | visitingTasksDO.setInvalid(false); |
| | | visitingTasksDO.setUrgent(false); |
| | | visitingTasksDO.setUrgentDell(false); |
| | | visitingTasksDO.setCreateBy(userId); |
| | | visitingTasksDO.setOutOrLocal(map.get("out_or_local") == null?null:Integer.valueOf(map.get("out_or_local").toString())); |
| | | |
| | | if(map.get("label") != null){ |
| | | List<String> option = getOption(map.get("label").toString()); |
| | | if(!CollectionUtils.isEmpty(option)){ |
| | | JSONObject json = new JSONObject(); |
| | | json.put("option",option); |
| | | visitingTasksDO.setTableContentJson(json.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | eventVisitingTasksMapper.insert(visitingTasksDO); |
| | | } |
| | | |
| | | private List<String> getOption(String label) { |
| | | List<String> option = new ArrayList<>(); |
| | | if(!Objects.isNull(label)) { |
| | | if (label.contains("精神障碍")) { |
| | | option.add("精神障碍异常1"); |
| | | option.add("精神障碍异常2"); |
| | | option.add("精神障碍异常3"); |
| | | option.add("精神障碍异常4"); |
| | | |
| | | } else if (label.contains("吸毒")) { |
| | | option.add("疑似复吸"); |
| | | option.add("失联"); |
| | | option.add("复吸"); |
| | | option.add("空挂户"); |
| | | } else if (label.contains("刑满释放")) { |
| | | option.add("刑满释放异常1"); |
| | | option.add("刑满释放异常2"); |
| | | option.add("刑满释放异常3"); |
| | | option.add("刑满释放异常4"); |
| | | } else if (label.contains("社区矫正")) { |
| | | option.add("社区矫正异常1"); |
| | | option.add("社区矫正异常2"); |
| | | option.add("社区矫正异常3"); |
| | | option.add("社区矫正异常4"); |
| | | } |
| | | } |
| | | return option; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R cancel(Long id) { |
| | | |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id); |
| | | if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()){ |
| | | return R.fail("当前状态不可撤销"); |
| | | } |
| | | int rt = eventVisitingTasksMapper.cancel(id,EventTasksStatusEnum.YCX.getCode()); |
| | | if(rt > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R reset(Long id) { |
| | | |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id); |
| | | if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.YCX.getCode()){ |
| | | return R.fail("当前状态不可恢复"); |
| | | } |
| | | int rt = eventVisitingTasksMapper.updateEventStatus(id,EventTasksStatusEnum.DZF.getCode()); |
| | | if(rt > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public synchronized R start(Long id,Long userId) { |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id); |
| | | if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()){ |
| | | return R.fail("当前状态不可开始走访"); |
| | | } |
| | | Map<String,Object> map = eventVisitingTasksMapper.findUserById(userId); |
| | | EventVisitingTasksDO start = new EventVisitingTasksDO(); |
| | | start.setId(id); |
| | | start.setGridMemberStreet(Long.valueOf(map.get("street_id").toString())); |
| | | start.setGridMemberCommunity(Long.valueOf(map.get("community_id").toString())); |
| | | start.setGridMember(Long.valueOf(map.get("user_id").toString())); |
| | | start.setGridMemberName(map.get("name").toString()); |
| | | start.setGridMenberTele(map.get("phone") ==null?"":map.get("phone").toString()); |
| | | start.setEventStatus(EventTasksStatusEnum.JXZ.getCode()); |
| | | int rt = eventVisitingTasksMapper.start(start); |
| | | if(rt > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R complete(EventVisitCompleteDTO taskCompleteDTO) { |
| | | EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(taskCompleteDTO.getId()); |
| | | if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.JXZ.getCode()){ |
| | | return R.fail("当前状态不可完成走访"); |
| | | } |
| | | if(taskCompleteDTO.getException().intValue() == 0){ |
| | | taskCompleteDTO.setEventStatus(EventTasksStatusEnum.ZJJJ.getCode()); |
| | | }else{ |
| | | taskCompleteDTO.setEventStatus(EventTasksStatusEnum.YC.getCode()); |
| | | } |
| | | |
| | | JSONObject json = JSONObject.parseObject(eventVisitingTasksDO.getTableContentJson()); |
| | | json.put("check",taskCompleteDTO.getOption()); |
| | | taskCompleteDTO.setOption(json.toJSONString()); |
| | | |
| | | if(!CollectionUtils.isEmpty(taskCompleteDTO.getImgList())){ |
| | | taskCompleteDTO.getImgList().forEach(e->{ |
| | | createResource(eventVisitingTasksDO.getId(),eventVisitingTasksDO.getDellUserId(),2,1,e); |
| | | }); |
| | | } |
| | | if(!CollectionUtils.isEmpty(taskCompleteDTO.getVosList())){ |
| | | taskCompleteDTO.getVosList().forEach(e->{ |
| | | createResource(eventVisitingTasksDO.getId(),eventVisitingTasksDO.getDellUserId(),2,2,e); |
| | | }); |
| | | } |
| | | if(!CollectionUtils.isEmpty(taskCompleteDTO.getVideoList())){ |
| | | taskCompleteDTO.getVosList().forEach(e->{ |
| | | createResource(eventVisitingTasksDO.getId(),eventVisitingTasksDO.getDellUserId(),2,3,e); |
| | | }); |
| | | } |
| | | |
| | | int rt = eventVisitingTasksMapper.complete(taskCompleteDTO); |
| | | if(rt > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | private void createResource(Long id, Long dellUserId, int classification, int type,String url) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setRefId(id); |
| | | eventResourceDO.setClassification(classification); |
| | | eventResourceDO.setType(type); |
| | | eventResourceDO.setCreateBy(dellUserId); |
| | | eventResourceDO.setUrl(url); |
| | | eventResourceMapper.insert(eventResourceDO); |
| | | } |
| | | |
| | | } |
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; |
| | | } |
| | | } |
| | |
| | | <if test="pageEventDTO.eventDes!=null"> |
| | | AND event_des = #{pageEventDTO.eventDes} |
| | | </if> |
| | | <if test="pageEventDTO.eventClazz!=null"> |
| | | AND event_clazz like concat(#{pageEventDTO.eventClazz},'%') |
| | | </if> |
| | | <if test="pageEventDTO.propagandaObject!=null"> |
| | | AND propaganda_object = #{pageEventDTO.propagandaObject} |
| | | </if> |
| | |
| | | and e.create_at <![CDATA[<=]]> #{eventListDTO.endTime} |
| | | </if> |
| | | |
| | | <if test='eventListDTO.gridId != null'> |
| | | and e.grid_id = #{eventListDTO.gridId} |
| | | <if test='eventListDTO.gridIds != null and eventListDTO.gridIds.size > 0'> |
| | | and e.grid_id in |
| | | <foreach collection='eventListDTO.gridIds' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test='eventListDTO.eventCategory != null'> |
| | | and e.event_category = #{eventListDTO.eventCategory} |
| | | </if> |
| | | |
| | | <if test='eventListDTO.eventType != null'> |
| | | and e.event_type = #{eventListDTO.eventType} |
| | | <if test='eventListDTO.eventTypes != null and eventListDTO.eventTypes.size > 0'> |
| | | and e.event_type in |
| | | <foreach collection='eventListDTO.eventTypes' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test='eventListDTO.eventDealStatus != null'> |
| | |
| | | order by e.create_at desc |
| | | </select> |
| | | |
| | | <select id="specialPopulationList" resultType="com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.PageEventSpecialPopulationDTO"> |
| | | SELECT |
| | | cmp.id, |
| | | cmp.`name`, |
| | | cmp.card_no as idCard, |
| | | cmp.label, |
| | | cmp.sex, |
| | | cmp.phone, |
| | | cmp.address, |
| | | cmp.political_outlook |
| | | FROM |
| | | com_mng_population AS cmp |
| | | <where> |
| | | and cmp.label IS NOT NULL |
| | | <if test='specialPopulationDTO.communityId != null'> |
| | | and cmp.act_id = #{specialPopulationDTO.communityId} |
| | | </if> |
| | | <if test="specialPopulationDTO.keyWord!=null and specialPopulationDTO.keyWord!= """> |
| | | AND (cmp.name like concat(#{specialPopulationDTO.keyWord},'%') or cmp.card_no_str like concat(#{specialPopulationDTO.keyWord},'%')) |
| | | </if> |
| | | </where> |
| | | ORDER BY |
| | | cmp.create_at DESC |
| | | </select> |
| | | |
| | | <select id="countByCommunityId" resultType="Map"> |
| | | SELECT |
| | | count( e.id ) AS resolvedNum, |
| | | ( |
| | | SELECT |
| | | count( e1.id ) |
| | | FROM |
| | | `event` AS e1 |
| | | LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id |
| | | WHERE |
| | | egd1.grid_community_id = #{communityId} |
| | | AND e1.event_category = 1 |
| | | AND e1.event_process_status = 1 |
| | | AND e1.event_status |
| | | AND e1.event_deal_status = 1 |
| | | ) AS pendingNum, |
| | | ( |
| | | SELECT |
| | | count( e2.id ) |
| | | FROM |
| | | `event` AS e2 |
| | | LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id |
| | | WHERE |
| | | egd2.grid_community_id = #{communityId} |
| | | AND e2.event_category = 2 |
| | | AND e2.event_status = 2 |
| | | ) AS propagandaNum, |
| | | ( |
| | | SELECT |
| | | count( e3.id ) |
| | | FROM |
| | | `event` AS e3 |
| | | LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id |
| | | WHERE |
| | | e3.event_status = 2 |
| | | AND e3.create_at LIKE CONCAT(#{nowDate},'%')) as currentNum |
| | | |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE |
| | | egd.grid_community_id = #{communityId} |
| | | AND e.event_category = 1 |
| | | AND e.event_process_status = 2 |
| | | AND e.event_deal_status = 4 |
| | | </select> |
| | | |
| | | <select id="countByAvgCommunityId" resultType="com.panzhihua.common.model.vos.screen.DateScreenVO"> |
| | | SELECT |
| | | e.create_at AS startTime,( |
| | | SELECT |
| | | e1.create_at |
| | | FROM |
| | | `event` AS e1 |
| | | LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id |
| | | WHERE |
| | | egd1.grid_community_id = #{communityId} |
| | | AND e1.event_process_status = 2 |
| | | ORDER BY |
| | | e1.create_at DESC |
| | | LIMIT 1 |
| | | ) AS endTime |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE |
| | | egd.grid_community_id = #{communityId} |
| | | AND e.event_process_status = 2 |
| | | ORDER BY |
| | | e.create_at ASC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getWorkScreenEventList" resultType="com.panzhihua.common.model.vos.screen.EventDetailWorkVO"> |
| | | SELECT |
| | | e.id, |
| | | su.nick_name AS userName, |
| | | su.image_url, |
| | | e.create_at, |
| | | e.event_type, |
| | | e.event_process_status, |
| | | e.event_deal_status, |
| | | e.major, |
| | | e.red_card, |
| | | e.yellow_card, |
| | | e.urgent, |
| | | e.danger_level, |
| | | e.event_des, |
| | | e.happen_address, |
| | | e.happent_address, |
| | | e.happent_lat_lng |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | LEFT JOIN sys_user AS su ON su.user_id = e.grid_member_id |
| | | WHERE |
| | | egd.grid_community_id = #{communityId} |
| | | AND e.event_status = 2 |
| | | ORDER BY |
| | | e.create_at DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | <select id="countByTime" resultType="com.panzhihua.common.model.vos.screen.EventWorkVO"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | COUNT( e.id ) |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE |
| | | egd.grid_community_id = #{communityId} and e.event_status = 2 AND e.create_at <![CDATA[<=]]> #{end}) AS eventTotal, |
| | | ( |
| | | SELECT |
| | | COUNT( e1.id ) |
| | | FROM |
| | | `event` AS e1 |
| | | LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id |
| | | WHERE |
| | | egd1.grid_community_id = #{communityId} and e1.event_status = 2 AND #{start} <![CDATA[<=]]> e1.create_at AND e1.create_at <![CDATA[<=]]> #{end}) AS eventAdd, |
| | | ( |
| | | SELECT |
| | | COUNT( e2.id ) |
| | | FROM |
| | | `event` AS e2 |
| | | LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id |
| | | WHERE |
| | | egd2.grid_community_id = #{communityId} and e2.event_process_status = 2 AND #{start} <![CDATA[<=]]> e2.create_at AND e2.create_at <![CDATA[<=]]> #{end}) AS eventSolve |
| | | FROM |
| | | DUAL |
| | | </select> |
| | | |
| | | <select id="getComplete" resultType="com.panzhihua.common.model.vos.screen.EventTypeWorkVO"> |
| | | SELECT |
| | | count( e.id ) AS zaTotal,( |
| | | SELECT |
| | | count( e1.id ) |
| | | FROM |
| | | `event` AS e1 |
| | | LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id |
| | | WHERE |
| | | e1.event_category = 1 |
| | | AND e1.event_process_status = 2 |
| | | AND e1.event_type = 2 |
| | | AND egd1.grid_community_id = #{communityId} |
| | | ) AS ggTotal,( |
| | | SELECT |
| | | count( e2.id ) |
| | | FROM |
| | | `event` AS e2 |
| | | LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id |
| | | WHERE |
| | | e2.event_category = 1 |
| | | AND e2.event_process_status = 2 |
| | | AND e2.event_type = 3 |
| | | AND egd2.grid_community_id = #{communityId} |
| | | ) AS mdTotal,( |
| | | SELECT |
| | | count( e3.id ) |
| | | FROM |
| | | `event` AS e3 |
| | | LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id |
| | | WHERE |
| | | e3.event_category = 1 |
| | | AND e3.event_process_status = 2 |
| | | AND e3.event_type = 4 |
| | | AND egd3.grid_community_id = #{communityId} |
| | | ) AS bwdTotal,( |
| | | SELECT |
| | | count( e4.id ) |
| | | FROM |
| | | `event` AS e4 |
| | | LEFT JOIN event_grid_data AS egd4 ON egd4.id = e4.grid_id |
| | | WHERE |
| | | e4.event_category = 1 |
| | | AND e4.event_process_status = 2 |
| | | AND e4.event_type = 5 |
| | | AND egd4.grid_community_id = #{communityId} |
| | | ) AS tfTotal,( |
| | | SELECT |
| | | count( e5.id ) |
| | | FROM |
| | | `event` AS e5 |
| | | LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id |
| | | WHERE |
| | | e5.event_category = 1 |
| | | AND e5.event_process_status = 2 |
| | | AND e5.event_type = 6 |
| | | AND egd5.grid_community_id = #{communityId} |
| | | ) AS tsTotal, |
| | | (select count(id) from com_act_easy_photo as caep where community_id = #{communityId} and handle_status = 2) as sspTotal |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE |
| | | e.event_category = 1 |
| | | AND e.event_process_status = 2 |
| | | AND e.event_type = 1 |
| | | AND egd.grid_community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getNoComplete" resultType="com.panzhihua.common.model.vos.screen.EventTypeWorkVO"> |
| | | SELECT |
| | | count( e.id ) AS zaTotal,( |
| | | SELECT |
| | | count( e1.id ) |
| | | FROM |
| | | `event` AS e1 |
| | | LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id |
| | | WHERE |
| | | e1.event_category = 1 |
| | | AND e1.event_process_status = 1 |
| | | AND e1.event_status = 2 |
| | | AND e1.event_type = 2 |
| | | AND egd1.grid_community_id = #{communityId} |
| | | ) AS ggTotal,( |
| | | SELECT |
| | | count( e2.id ) |
| | | FROM |
| | | `event` AS e2 |
| | | LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id |
| | | WHERE |
| | | e2.event_category = 1 |
| | | AND e2.event_process_status = 1 |
| | | AND e2.event_status = 2 |
| | | AND e2.event_type = 3 |
| | | AND egd2.grid_community_id = #{communityId} |
| | | ) AS mdTotal,( |
| | | SELECT |
| | | count( e3.id ) |
| | | FROM |
| | | `event` AS e3 |
| | | LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id |
| | | WHERE |
| | | e3.event_category = 1 |
| | | AND e3.event_process_status = 1 |
| | | AND e3.event_status = 2 |
| | | AND e3.event_type = 4 |
| | | AND egd3.grid_community_id = #{communityId} |
| | | ) AS bwdTotal,( |
| | | SELECT |
| | | count( e4.id ) |
| | | FROM |
| | | `event` AS e4 |
| | | LEFT JOIN event_grid_data AS egd4 ON egd4.id = e4.grid_id |
| | | WHERE |
| | | e4.event_category = 1 |
| | | AND e4.event_process_status = 1 |
| | | AND e4.event_status = 2 |
| | | AND e4.event_type = 5 |
| | | AND egd4.grid_community_id = #{communityId} |
| | | ) AS tfTotal,( |
| | | SELECT |
| | | count( e5.id ) |
| | | FROM |
| | | `event` AS e5 |
| | | LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id |
| | | WHERE |
| | | e5.event_category = 1 |
| | | AND e5.event_process_status = 1 |
| | | AND e5.event_status = 2 |
| | | AND e5.event_type = 6 |
| | | AND egd5.grid_community_id = #{communityId} |
| | | ) AS tsTotal, |
| | | (select count(id) from com_act_easy_photo as caep where community_id = #{communityId} and handle_status = 1) as sspTotal |
| | | FROM |
| | | `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE |
| | | e.event_category = 1 |
| | | AND e.event_process_status = 1 |
| | | AND e.event_status = 2 |
| | | AND e.event_type = 1 |
| | | AND egd.grid_community_id = #{communityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findListByRefId" resultType="com.panzhihua.common.model.vos.grid.EventResourceVO"> |
| | | SELECT url FROM event_resource |
| | | where ref_id = #{id} and classification = #{classification} and type = #{type} order by id desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_grid.dao.EventSpecialCrowdRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="event_id" property="eventId" /> |
| | | <result column="population_id" property="populationId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, event_id, population_id, create_at |
| | | </sql> |
| | | |
| | | <select id="getSpecialPopulationIds" resultType="com.panzhihua.common.model.vos.grid.EventSpecialPopulationDetailsVO" parameterType="Long"> |
| | | SELECT |
| | | escr.id, |
| | | cmp.`name`, |
| | | cmp.phone, |
| | | cmp.card_no AS idCard, |
| | | cmp.label, |
| | | cmp.address, |
| | | cmp.nation, |
| | | cmp.political_outlook |
| | | FROM |
| | | event_special_crowd_record AS escr |
| | | LEFT JOIN com_mng_population AS cmp ON cmp.id = escr.population_id |
| | | WHERE |
| | | escr.event_id = #{eventId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ]]> |
| | | </sql> |
| | | |
| | | <select id="count" parameterType="java.lang.Long" resultType="java.util.Map"> |
| | | select count(id) as visit, |
| | | (select count(id) from event_visiting_tasks where grid_member_community = #{communityId} and event_status = 3) as visited, |
| | | (select count(id) from event_visiting_tasks where grid_member_community = #{communityId} and event_status = 6) as canceled |
| | | from event_visiting_tasks WHERE grid_member_community = #{communityId} and event_status = 1 |
| | | </select> |
| | | |
| | | <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventVisitingTasksVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO"> |
| | | SELECT <include refid="columns" /> |
| | | FROM event_visiting_tasks |
| | | <where> |
| | | <if test="pageEventVisitingTasksDTO.id!=null"> |
| | | AND id = #{pageEventVisitingTasksDTO.id} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberStreet!=null"> |
| | | AND grid_member_street = #{pageEventVisitingTasksDTO.gridMemberStreet} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberCommunity!=null"> |
| | | AND grid_member_community = #{pageEventVisitingTasksDTO.gridMemberCommunity} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMember!=null"> |
| | | AND grid_member = #{pageEventVisitingTasksDTO.gridMember} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberName!=null"> |
| | | AND grid_member_name = #{pageEventVisitingTasksDTO.gridMemberName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMenberTele!=null"> |
| | | AND grid_menber_tele = #{pageEventVisitingTasksDTO.gridMenberTele} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterId!=null"> |
| | | AND visiter_id = #{pageEventVisitingTasksDTO.visiterId} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterName!=null"> |
| | | AND visiter_name = #{pageEventVisitingTasksDTO.visiterName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterSex!=null"> |
| | | AND visiter_sex = #{pageEventVisitingTasksDTO.visiterSex} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterTele!=null"> |
| | | AND visiter_tele = #{pageEventVisitingTasksDTO.visiterTele} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterAddress!=null"> |
| | | AND visiter_address = #{pageEventVisitingTasksDTO.visiterAddress} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterType!=null"> |
| | | AND visiter_type = #{pageEventVisitingTasksDTO.visiterType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventTitle!=null"> |
| | | AND event_title = #{pageEventVisitingTasksDTO.eventTitle} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventType!=null"> |
| | | AND event_type = #{pageEventVisitingTasksDTO.eventType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventDes!=null"> |
| | | AND event_des = #{pageEventVisitingTasksDTO.eventDes} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.actOpara!=null"> |
| | | AND act_opara = #{pageEventVisitingTasksDTO.actOpara} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happenTimeBegin!=null"> |
| | | AND happen_time >= #{pageEventVisitingTasksDTO.happenTimeBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happenTimeEnd!=null"> |
| | | AND happen_time <= #{pageEventVisitingTasksDTO.happenTimeEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happentAddress!=null"> |
| | | AND happent_address = #{pageEventVisitingTasksDTO.happentAddress} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happentLatLng!=null"> |
| | | AND happent_lat_lng = #{pageEventVisitingTasksDTO.happentLatLng} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventStatus!=null"> |
| | | AND event_status = #{pageEventVisitingTasksDTO.eventStatus} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.reporting!=null"> |
| | | AND reporting = #{pageEventVisitingTasksDTO.reporting} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellType!=null"> |
| | | AND dell_type = #{pageEventVisitingTasksDTO.dellType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellUserId!=null"> |
| | | AND dell_user_id = #{pageEventVisitingTasksDTO.dellUserId} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellUserName!=null"> |
| | | AND dell_user_name = #{pageEventVisitingTasksDTO.dellUserName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDateBegin!=null"> |
| | | AND dell_date >= #{pageEventVisitingTasksDTO.dellDateBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDateEnd!=null"> |
| | | AND dell_date <= #{pageEventVisitingTasksDTO.dellDateEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDesc!=null"> |
| | | AND dell_desc = #{pageEventVisitingTasksDTO.dellDesc} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.invalid!=null"> |
| | | AND invalid = #{pageEventVisitingTasksDTO.invalid} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.urgent!=null"> |
| | | AND urgent = #{pageEventVisitingTasksDTO.urgent} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.urgentDell!=null"> |
| | | AND urgent_dell = #{pageEventVisitingTasksDTO.urgentDell} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.submitDateBegin!=null"> |
| | | AND submit_date >= #{pageEventVisitingTasksDTO.submitDateBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.submitDateEnd!=null"> |
| | | AND submit_date <= #{pageEventVisitingTasksDTO.submitDateEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.exception!=null"> |
| | | AND exception = #{pageEventVisitingTasksDTO.exception} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.tableContentJson!=null"> |
| | | AND table_content_json = #{pageEventVisitingTasksDTO.tableContentJson} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createBy!=null"> |
| | | AND create_by = #{pageEventVisitingTasksDTO.createBy} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createAtBegin!=null"> |
| | | AND create_at >= #{pageEventVisitingTasksDTO.createAtBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createAtEnd!=null"> |
| | | AND create_at <= #{pageEventVisitingTasksDTO.createAtEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateBy!=null"> |
| | | AND update_by = #{pageEventVisitingTasksDTO.updateBy} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateAtBegin!=null"> |
| | | AND update_at >= #{pageEventVisitingTasksDTO.updateAtBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateAtEnd!=null"> |
| | | AND update_at <= #{pageEventVisitingTasksDTO.updateAtEnd} |
| | | </if> |
| | | </where> |
| | | <if test="pageEventVisitingTasksDTO.sortColumns!=null"> |
| | | ORDER BY ${pageEventVisitingTasksDTO.sortColumns} ${pageEventVisitingTasksDTO.sortType} |
| | | <select id="findListByPage" parameterType="com.panzhihua.common.model.query.visit.EventTasksQuery" resultType="com.panzhihua.common.model.vos.visit.EventVisitingTasksVO"> |
| | | select vt.id,vt.create_at,vt.create_by,vt.visiter_id,vt.visiter_name,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.event_status, |
| | | vt.event_status,p.card_no_str,p.label,u.name as creator |
| | | from event_visiting_tasks vt left join com_mng_population p on vt.visiter_id = p.id |
| | | left join sys_user u on vt.create_by = u.user_id |
| | | where vt.grid_member_community = #{query.communityId} |
| | | <if test="query.status != null and query.status != ''"> |
| | | and vt.event_status = #{query.status} |
| | | </if> |
| | | </select> |
| | | <if test="query.tag != null and query.tag != ''"> |
| | | p.label like concat('%',#{query.tag},'%') |
| | | </if> |
| | | <if test="query.isExp != null and query.isExp != ''"> |
| | | and vt.event_status = 7 |
| | | </if> |
| | | <if test="query.keyWord != null and query.keyWord != ''"> |
| | | and( |
| | | p.card_no_str like concat('%',#{query.keyWord},'%') or |
| | | vt.visiter_address like concat('%',#{query.keyWord},'%') |
| | | ) |
| | | </if> |
| | | order by vt.id desc |
| | | </select> |
| | | |
| | | <select id="list" parameterType="com.panzhihua.common.model.query.visit.EventTasksQuery" resultType="com.panzhihua.common.model.vos.visit.AppVisitTasksVO"> |
| | | SELECT vt.id,vt.visiter_name,vt.grid_member,vt.grid_member_name,vt.visiter_name,vt.visiter_tele,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.event_status,vt.visiter_address,vt.happent_lat_lng, |
| | | p.card_no_str,p.name,REPLACE(p.label,',','#') |
| | | FROM event_visiting_tasks vt LEFT JOIN com_mng_population p ON vt.visiter_id = p.id WHERE 1=1 |
| | | <if test = "query.visiterId !=null"> |
| | | and vt.visiter_id = #{query.visiterId} |
| | | </if> |
| | | <if test = "query.communityId !=null"> |
| | | and vt.grid_member_community = #{query.communityId} |
| | | </if> |
| | | <if test = "query.status != null and query.status == 1"> |
| | | and (vt.event_status = 3 or vt.event_status = 7) |
| | | </if> |
| | | <if test = "query.status != null and query.status == 2"> |
| | | and (vt.event_status = 1 or vt.event_status = 2) |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="visitorList" parameterType="com.panzhihua.common.model.query.visit.EventVisitListQuery" resultType="com.panzhihua.common.model.vos.visit.EventVisitListVO"> |
| | | SELECT p.id,p.name,p.card_no_str,p.label, TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,p.sex,p.political_outlook,p.phone,p.census_register,phu.relation, |
| | | MAX(vt.id),vt.create_at |
| | | FROM com_mng_population p LEFT JOIN com_mng_population_house_user phu ON p.id = phu.popul_id |
| | | left join event_visiting_tasks vt ON p.id = vt.visiter_id |
| | | where 1=1 |
| | | <if test="sex != null"> |
| | | and p.sex = #{query.sex} |
| | | </if> |
| | | <if test="political != null"> |
| | | and p.political_outlook = #{query.political} |
| | | </if> |
| | | <if test="houseHolder != null"> |
| | | and phu.relation = #{query.houseHolder} |
| | | </if> |
| | | <if test="tag != null"> |
| | | and p.label like concat('%',#{query.tag},'%') |
| | | </if> |
| | | <if test="keyWord != null"> |
| | | and (p.card_no_str like concat(#{query.keyWord},'%') or |
| | | p.name like concat(#{query.keyWord},'%')) |
| | | </if> |
| | | GROUP BY p.id |
| | | </select> |
| | | |
| | | <select id="findUserByCommunityId" resultType="java.util.Map"> |
| | | SELECT u.user_id,u.name,u.phone,a.street_id FROM sys_user u |
| | | LEFT JOIN com_act a ON u.community_id = a.community_id |
| | | WHERE u.community_id = #{communityId} and u.type = #{type} limit 1 |
| | | </select> |
| | | |
| | | <select id="findUserByCommunityId" resultType="java.util.Map"> |
| | | SELECT u.user_id,u.name,u.phone,u.community_id,a.street_id, FROM sys_user u |
| | | LEFT JOIN com_act a ON u.community_id = a.community_id |
| | | WHERE u.id = #{id} |
| | | </select> |
| | | |
| | | <select id="findPopulationById" resultType="java.util.Map"> |
| | | SELECT p.id,p.name,p.sex,p.phone,p.road,p.door_no,p.floor,p.unit_no,p.house_no,v.address,v.lng,v.lat,p.label,p.out_or_local FROM com_mng_population p |
| | | LEFT JOIN com_mng_village v ON p.village_id = v.village_id WHERE p.id = #{id} |
| | | </select> |
| | | |
| | | <select id="countNoneComplete" resultType="java.lang.Integer"> |
| | | SELECT count(id) from event_visiting_tasks where visiter_id = #{id} and (event_status = 1 or event_status = 2 or event_status = 4) |
| | | </select> |
| | | |
| | | <update id="updateEventStatus"> |
| | | update event_visiting_tasks set event_status = #{status} where id = #{id} |
| | | </update> |
| | | |
| | | <update id="start"> |
| | | update event_visiting_tasks set event_status = #{eventStatus}, |
| | | grid_member_street = #{gridMemberStreet},grid_member_community=#{gridMemberCommunity},grid_member=#{gridMember},grid_member_name=#{gridMemberName},grid_menber_tele=#{gridMenberTele} |
| | | dell_user_id = #{gridMember} ,dell_user_name =#{gridMemberName}, dell_type = 1,dell_date = NOW() where id = #{id} |
| | | </update> |
| | | |
| | | <update id="cancel"> |
| | | update event_visiting_tasks set event_status = #{status},cancel_time = NOW() where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | <update id="complete" parameterType="com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO"> |
| | | update event_visiting_tasks set event_status = #{eventStatus},address = #{address},address_remark=#{addressRemark}, |
| | | family_phone =#{familyPhone},family_source = #{familySource},lat_lng=#{latLng},dell_desc = #{dellDesc},table_content_json = #{option} |
| | | exception = #{exception},submit_date = NOW() |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <select id="getLabel" parameterType="java.lang.Long" resultType="java.lang.String"> |
| | | select label from com_mng_population where id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
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; |
| | | } |
| | | |
| | | } |