Merge remote-tracking branch 'origin/test' into test
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; |
| | | } |
| | | } |
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; |
| | | } |
| | |
| | | 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("街路巷") |
| | |
| | | @ApiModelProperty("每天完成") |
| | | private String everyDayNum; |
| | | |
| | | @ApiModelProperty("总完成度") |
| | | private Integer totalCompletedPoint; |
| | | @ApiModelProperty("完成总数") |
| | | private Integer totalCompleted; |
| | | |
| | | @ApiModelProperty("未完成总数") |
| | | private Integer totalNoneCompleted; |
| | | |
| | | @ApiModelProperty("已完成") |
| | | private List<ActWorkCountVO> completetPoint; |
| | | private List<PieElementVO> completetList; |
| | | |
| | | @ApiModelProperty("未完成") |
| | | private List<ActWorkCountVO> nonePoint; |
| | | 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 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; |
| | | } |
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 = "是否异常行为") |
| | | 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; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | private Integer nationCode; |
| | | |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @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.*; |
| | | |
| | |
| | | */ |
| | | @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 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{ |
| | |
| | | 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; |
| | |
| | | |
| | | @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 |
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); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActNeighborCircleScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.PieElementVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | @Select("<script> \n"+ |
| | | "SELECT\n" + |
| | | "nc.*,\n" + |
| | | "u.`nick_name` AS releaseName,u.`type` as userType,u.image_url\n" + |
| | | "u.`nick_name` AS releaseName,u.image_url,u.`type` as userType\n" + |
| | | ",u.name as communityName\n" + |
| | | "FROM\n" + |
| | | "com_act_neighbor_circle nc\n" + |
| | |
| | | " </if> " + |
| | | "<if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '>" + |
| | | "and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} \n" + |
| | | " </if> " + |
| | | "<if test='neighborCircleAdminDTO.status != null '>" + |
| | | "and nc.status = #{neighborCircleAdminDTO.status} " + |
| | | " </if> " + |
| | | "</where>"+ |
| | | "order by " + |
| | |
| | | " where reply.comment_id = #{commentId} and reply.status = 1") |
| | | IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); |
| | | |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and(status = 2 or status = 3) ORDER BY create_at DESC limit #{pageSize}") |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and status = 2 ORDER BY create_at DESC limit #{pageSize}") |
| | | List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," + |
| | | " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND (status = 2 OR status = 3) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") |
| | | " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2 AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) ") |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 ") |
| | | Map<String, Object> sumScreenNum(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 order by create_at desc limit #{pageSize}") |
| | | List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = #{communityId} AND STATUS = 6 " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = #{communityId} " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND STATUS = 2 " + |
| | | "UNION ALL " + |
| | | "SELECT 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); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2) " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = #{communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = #{communityId} " + |
| | | "UNION ALL " + |
| | | "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND STATUS = 1 " + |
| | | "UNION ALL " + |
| | | "SELECT 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); |
| | | |
| | | @Select(" SELECT AVG(b.t)AS avgTime " + |
| | | " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + |
| | | " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + |
| | | " )AS b ") |
| | | Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); |
| | | } |
| | |
| | | "(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); |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R workCount(Long communityId); |
| | | |
| | | R dynamicWork(Long communityId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComStreetDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.model.dos.ComStreetDO; |
| | | import com.panzhihua.service_community.service.ComActService; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | if (integer > 0) { |
| | | return R.fail("社区已经存在"); |
| | | } |
| | | comActDO.setCommunityId(Snowflake.getId()); |
| | | BeanUtils.copyProperties(comActVO, comActDO); |
| | | int insert = comActDAO.insert(comActDO); |
| | | if (insert > 0) { |
| | |
| | | |
| | | 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.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.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.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; |
| | | |
| | |
| | | return R.ok(comActEasyPhotoScreenVO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private List<EasyPhotoPointVO> getList(Map<String, Long> dealMap) { |
| | | Set<Map.Entry<String,Long>> entrySet = dealMap.entrySet(); |
| | | |
| | |
| | | @Override |
| | | public R workCount(Long communityId) { |
| | | ComActWorkScreenVO comActWorkScreenVO = new ComActWorkScreenVO(); |
| | | comActWorkScreenVO.setAvgTime("1小时"); |
| | | comActWorkScreenVO.setTotalCompletedPoint(70); |
| | | comActWorkScreenVO.setEveryDayNum("0.3"); |
| | | List<ActWorkCountVO> completetPoint = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto = new ActWorkCountVO(); |
| | | easyPhoto.setName("随手拍"); |
| | | easyPhoto.setNum(10); |
| | | completetPoint.add(easyPhoto); |
| | | ActWorkCountVO wish = new ActWorkCountVO(); |
| | | wish.setName("微心愿"); |
| | | wish.setNum(23); |
| | | completetPoint.add(wish); |
| | | ActWorkCountVO discuss = new ActWorkCountVO(); |
| | | discuss.setName("一起议"); |
| | | discuss.setNum(33); |
| | | completetPoint.add(discuss); |
| | | ActWorkCountVO neighbor = new ActWorkCountVO(); |
| | | neighbor.setName("邻里圈"); |
| | | neighbor.setNum(43); |
| | | completetPoint.add(neighbor); |
| | | ActWorkCountVO pbWork = new ActWorkCountVO(); |
| | | pbWork.setName("党建工作"); |
| | | pbWork.setNum(13); |
| | | completetPoint.add(pbWork); |
| | | ActWorkCountVO activity = new ActWorkCountVO(); |
| | | activity.setName("社区活动"); |
| | | activity.setNum(63); |
| | | completetPoint.add(activity); |
| | | comActWorkScreenVO.setCompletetPoint(completetPoint); |
| | | //已完成 |
| | | comActWorkScreenVO.setCompletetList(comActNeighborCircleDAO.countAllCompletedWorkByCommunityId(communityId)); |
| | | |
| | | List<ActWorkCountVO> completetPoint2 = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto2 = new ActWorkCountVO(); |
| | | easyPhoto2.setName("随手拍"); |
| | | easyPhoto2.setNum(10); |
| | | completetPoint2.add(easyPhoto2); |
| | | ActWorkCountVO wish2 = new ActWorkCountVO(); |
| | | wish2.setName("微心愿"); |
| | | wish2.setNum(23); |
| | | completetPoint2.add(wish2); |
| | | ActWorkCountVO discuss2 = new ActWorkCountVO(); |
| | | discuss2.setName("一起议"); |
| | | discuss2.setNum(33); |
| | | completetPoint2.add(discuss2); |
| | | ActWorkCountVO neighbor2 = new ActWorkCountVO(); |
| | | neighbor2.setName("邻里圈"); |
| | | neighbor2.setNum(43); |
| | | completetPoint2.add(neighbor2); |
| | | ActWorkCountVO pbWork2 = new ActWorkCountVO(); |
| | | pbWork2.setName("党建工作"); |
| | | pbWork2.setNum(13); |
| | | completetPoint2.add(pbWork2); |
| | | ActWorkCountVO activity2 = new ActWorkCountVO(); |
| | | activity2.setName("社区活动"); |
| | | activity2.setNum(63); |
| | | completetPoint2.add(activity2); |
| | | comActWorkScreenVO.setNonePoint(completetPoint2); |
| | | //未完成 |
| | | comActWorkScreenVO.setNoneList(comActNeighborCircleDAO.countAllNoneCompletedWorkByCommunityId(communityId)); |
| | | comActWorkScreenVO.setTotalCompleted(comActWorkScreenVO.getCompletetList().stream().mapToInt(PieElementVO::getNum).sum()); |
| | | comActWorkScreenVO.setTotalNoneCompleted(comActWorkScreenVO.getNoneList().stream().mapToInt(PieElementVO::getNum).sum()); |
| | | |
| | | //统计平均耗时、平均每天完成个数 |
| | | Map<String,Object> avgMap = comActNeighborCircleDAO.countAvgByCommunityId(communityId); |
| | | comActWorkScreenVO.setAvgTime(avgMap.get("avgTime") == null?"0h":convertTimeStr(Double.valueOf(avgMap.get("avgTime").toString()).intValue())); |
| | | |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | BigDecimal days = new BigDecimal(DateUtil.betweenDay(comActDO.getCreateAt(),new Date(),false)); |
| | | BigDecimal num = new BigDecimal(comActWorkScreenVO.getTotalCompleted()); |
| | | BigDecimal rt = num.divide(days,1, RoundingMode.HALF_UP); |
| | | comActWorkScreenVO.setEveryDayNum(rt.toString()); |
| | | 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; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return eventService.getScreenEventList(eventListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 工作大屏-事件播报数据统计 |
| | | * @param communityId 社区id |
| | | * @return 事件播报数据统计 |
| | | */ |
| | | @GetMapping("/work/event") |
| | | public R eventWork(@RequestParam("communityId")Long communityId) { |
| | | return eventService.eventWork(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | 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) throws Exception { |
| | | 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) throws Exception { |
| | | |
| | | return eventVisitingTasksService.taskList(query); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/exportTaskList") |
| | | List<EventVisitingTasksVO> exportTaskList(@RequestBody EventTasksQuery query) throws Exception { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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<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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | /** |
| | | * 是否异常行为 列: 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; |
| | | |
| | | |
| | | } |
| | |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | Boolean updateLcUploadFlag(Long id); |
| | | |
| | | R eventWork(Long communityId); |
| | | } |
| | |
| | | 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) throws Exception; |
| | | |
| | | /** |
| | | * 删除走访任务 |
| | | * @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) throws Exception; |
| | | |
| | | List<EventVisitingTasksVO> exportTaskList(EventTasksQuery query) throws Exception; |
| | | |
| | | /** |
| | | * 撤销 |
| | | * @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); |
| | | } |
| | |
| | | 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.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; |
| | |
| | | private EventGridDataService eventGridDataService; |
| | | @Resource |
| | | private EventResourceMapper eventResourceMapper; |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | |
| | | private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; |
| | | |
| | | /** |
| | | * 分页查找事件 |
| | |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.enums.PopulPoliticalOutlookEnum; |
| | | 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 javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | 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) throws Exception{ |
| | | |
| | | IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(),query.getPageSize()),query); |
| | | for(EventVisitingTasksVO eventVisitingTasksVO:page.getRecords()){ |
| | | if(eventVisitingTasksVO.getNationCode() != null){ |
| | | eventVisitingTasksVO.setNation(PopulPoliticalOutlookEnum.getCnDescByName(eventVisitingTasksVO.getNationCode())); |
| | | } |
| | | if(eventVisitingTasksVO.getVisiterTele() != null){ |
| | | |
| | | } |
| | | eventVisitingTasksVO.setVisiterTele(AESUtil.decrypt128(eventVisitingTasksVO.getVisiterTele(), aesKey)); |
| | | } |
| | | page.getRecords().forEach(e->{ |
| | | |
| | | }); |
| | | 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) throws Exception { |
| | | 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) throws Exception { |
| | | 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) throws Exception{ |
| | | |
| | | 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())); |
| | | if(map.get("phone") != null){ |
| | | visitingTasksDO.setVisiterTele(AESUtil.decrypt128(map.get("phone").toString(),aesKey)); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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> |
| | |
| | | ]]> |
| | | </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.visiter_tele,vt.visiter_sex,vt.visiter_address,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.event_status, |
| | | TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,p.card_no_str,p.label,u.name as creator,p.nation_code |
| | | 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 p.act_id = #{query.communityId} |
| | | <if test = "query.status == 1"> |
| | | and (vt.event_status = 3 or vt.event_status = 7) |
| | | </if> |
| | | </select> |
| | | <if test = "query.status == 2"> |
| | | and (vt.event_status = 1 or vt.event_status = 2) |
| | | </if> |
| | | <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 == 1"> |
| | | and (vt.event_status = 3 or vt.event_status = 7) |
| | | </if> |
| | | <if test = "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> |