| | |
| | | @GetMapping("detaildynamic") |
| | | @ApiImplicitParam(name ="id",value = "社区动态主键",required = true) |
| | | public R detailDynamic(@RequestParam("id") Long id){ |
| | | Long userId = this.getUserId(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = null; |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | R r = communityService.detailDynamic(id); |
| | | if (R.isOk(r)) { |
| | | //增加浏览记录 |
| | | R r1 = communityService.addDynamicUser(id, userId); |
| | | Object data = r.getData(); |
| | | ComActDynVO comActDynVO=JSONObject.parseObject(JSONObject.toJSONString(data),ComActDynVO.class); |
| | | if (R.isOk(r1)) { |
| | | comActDynVO.setIsAdd(1); |
| | | }else{ |
| | | comActDynVO.setIsAdd(0); |
| | | if(userId != null){ |
| | | //增加浏览记录 |
| | | R r1 = communityService.addDynamicUser(id, userId); |
| | | if (R.isOk(r1)) { |
| | | comActDynVO.setIsAdd(1); |
| | | }else{ |
| | | comActDynVO.setIsAdd(0); |
| | | } |
| | | } |
| | | return R.ok(comActDynVO); |
| | | } |
| | |
| | | return loginUserInfoVO; |
| | | } |
| | | |
| | | @SneakyThrows |
| | | public LoginUserInfoVO getLoginUserInfoSureNoLogin() { |
| | | HttpServletRequest request = this.getRequest(); |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | return null; |
| | | // throw new UnAuthenticationException("获取登录人信息失败"); |
| | | } |
| | | // log.info("userInfo【{}】",userInfo); |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | // log.info("bytes【{}】",bytes); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | // log.info("decrypt【{}】",decrypt); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | return loginUserInfoVO; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | byte[] bytes = AES.parseHexStr2Byte("5730CB290AD203B32D2FA4347CD54A50A684E16D2C7A4544CF352D54D8A763BA6652C323B13BEEE682A5095B8BCC76842225A914253CE84AFB6B58A9D1BE30A7992786E151A933FDEC6EBDCD1928CA68927047770F296F7541268149B34FDFCEF1340CF2266A041484744CB45B216EE8B4D96E243098F9CB3F661ACA7AF356C422BFE9A009FA478DF606A71DA7DBD776527E5120C3F13281BA8FC5587BACD5E403EE069762B5CF060BFA3CF4FD3417F5653CC178D2CA117284D85F442C0FAB076DB6F6D873B5363FAB93EBA9284CC87A5E97243EF4DC73F1ADA57BD9E9AAB2E4972AC3A4615B2DF6F9062BC04428D1B84B6C892A306F191B1D9DDBBB201D2767CE928020489AFC6BCFDC8A74F8C95080F74B4EC64AD1A6354B17A156B95AA9467C7461BD3C3F15F8F65BD7F3272184435D77003738B5B942EEA9603CFF249764718732595EC44DE4ED1BB763F9C88BAFACF5540E689FE84A4702E31D3D1D05BAC25C10F8E0C3948C777478537397BCB67D37066385DFCBDE3F4A53D6BA14481DBCB07E8452ACD2790A76669A9DE6D7080C8CFD9FB774035FCC3AC1C436581144969B7150318024A2E893FE926654E002097EB4735E49F3A9698A405969888A7D88A55A0FA60318C4A1E2D243BEE6D438"); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 事件状态 |
| | | * |
| | | * @author lyq |
| | | */ |
| | | @Getter |
| | | public enum EventStatusEnum |
| | | { |
| | | DCL(1, "待处理"), |
| | | YJJ(2, "已解决"), |
| | | DYZ(3, "待验证"), |
| | | CGX(4, "草稿箱"), |
| | | YCX(5, "已撤销"), |
| | | YC(6, "异常"), |
| | | WZ(9, "未知"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | EventStatusEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (EventStatusEnum item : EventStatusEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return WZ.getCode(); |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (EventStatusEnum item : EventStatusEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "未知"; |
| | | } |
| | | |
| | | } |
| | |
| | | @Pattern(regexp = "asc|desc|ASC|DESC") |
| | | private String sortType="desc"; |
| | | |
| | | @ApiModelProperty(value = "街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty(value = "门牌号") |
| | | private String houseNum; |
| | | |
| | | @ApiModelProperty(value = "小区组") |
| | | private String groupAt; |
| | | |
| | | @ApiModelProperty(value = "小区地址") |
| | | private String address; |
| | | |
| | | public String getSortColumns(){ |
| | | // String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); |
| | | return sortAttr; |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | |
| | | @ApiModelProperty(value = "网格员id", hidden = false, example = "") |
| | | private Long gridMemberId; |
| | | |
| | | @ApiModelProperty(value = "市平台网格员关联id") |
| | | private Long lcMemberId; |
| | | |
| | | @ApiModelProperty(value = "楼栋id集合") |
| | | private List<Long> buildingIds; |
| | | |
| | | } |
| | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "网格员id", hidden = false, example = "") |
| | | private Long gridMemberId; |
| | | |
| | | @ApiModelProperty(value = "市平台网格员关联id") |
| | | private Long lcMemberId; |
| | | |
| | | @ApiModelProperty(value = "楼栋id集合") |
| | | private List<Long> buildingIds; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "人口id集合") |
| | | private List<Long> populationIds; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "社区id", hidden = true, example = "1") |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 居民关联房屋-请求参数 |
| | | * |
| | | * @author lyq |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("居民关联房屋-请求参数") |
| | | public class ComMngPopulationRelationHouseDTO { |
| | | |
| | | @ApiModelProperty(value = "居民id集合",required = true) |
| | | private List<Long> populationId; |
| | | |
| | | @ApiModelProperty(value = "房屋id",required = true) |
| | | private Long houseId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | |
| | | /** |
| | | * 居民列表筛选下级-请求参数 |
| | | * |
| | | * @author lyq |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("居民列表筛选下级-请求参数") |
| | | public class ComMngPopulationSubordinateDTO { |
| | | |
| | | @ApiModelProperty(value = "1.楼栋 2.单元 3.门牌号",required = true) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "小区id",required = true) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty(value = "房屋id") |
| | | private Long houseId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 小区列表导出-请求参数 |
| | | * |
| | | * @author lyq |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("小区列表-请求参数") |
| | | public class ComMngVillageListExportAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "小区名称") |
| | | private String name; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "社区id", hidden = true, example = "1") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "排序字段, 默认 创建时间:createAt(在住居民数:userSum,楼栋数:buildSum,总户数:houseNum,户籍人口:registerNum)", example = "createAt") |
| | | private String sortAttr="createAt"; |
| | | |
| | | @ApiModelProperty(value = "排序方式: asc/desc(默认)", example = "desc") |
| | | @Pattern(regexp = "asc|desc|ASC|DESC") |
| | | private String sortType="desc"; |
| | | |
| | | @ApiModelProperty(value = "街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty(value = "门牌号") |
| | | private String houseNum; |
| | | |
| | | @ApiModelProperty(value = "小区组") |
| | | private String groupAt; |
| | | |
| | | @ApiModelProperty(value = "小区地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "小区id集合") |
| | | private List<Long> villageIds; |
| | | |
| | | public String getSortColumns(){ |
| | | // String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); |
| | | return sortAttr; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 添加网格员级联请求参数 |
| | | * |
| | | * @author lyq |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("添加网格员级联请求参数") |
| | | public class EventGridMemberCascadeAddDTO { |
| | | |
| | | @ApiModelProperty(value = "类型(1.社区 2.小区 3.楼栋)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "上级id") |
| | | private Long superiorId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 分页查询表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询人员列表请求参数") |
| | | public class PageComMngVillagePopulationDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "小区id",required = true) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "人员标签") |
| | | private String label; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 查询人员房屋列表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询人员房屋列表请求参数") |
| | | public class PageComMngVillagePopulationHouseDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "居民id",required = true) |
| | | private Long populationId; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | public class ComMngVillageBuildingHouseDetailVO { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class ComMngVillageBuildingHouseVO { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("户室号") |
| | |
| | | package com.panzhihua.common.model.vos.grid; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class ComMngVillageBuildingVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty(value = "房屋人口关联id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long housePopulationId; |
| | | |
| | | } |
| | |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("关联实有房屋(0.否 1.是)") |
| | | private String isHouse; |
| | | private Long isHouse; |
| | | |
| | | @ApiModelProperty(value = "走访状态(1待走访2已走访3待验证5已撤销)") |
| | | private Integer eventStatus; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("居民管理关联房屋小区列表返回参数") |
| | | public class ComMngPopulationVillageVO { |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("小区名字") |
| | | private String name; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("级联菜单返回参数") |
| | | public class ComMngSubordinateVO { |
| | | |
| | | /** |
| | | * 房屋id |
| | | */ |
| | | @ApiModelProperty("房屋id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long houseId; |
| | | |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | | @ApiModelProperty("楼排号") |
| | | private String floor; |
| | | |
| | | /** |
| | | *单元号 |
| | | */ |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | /** |
| | | *户室(房间号) |
| | | */ |
| | | @ApiModelProperty("户室(房间号)") |
| | | private String houseNo; |
| | | |
| | | /** |
| | | *公共显示字段 |
| | | */ |
| | | @ApiModelProperty("公共显示字段") |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("小区管理-居民房屋返回参数") |
| | | public class ComMngVillagePopulationHouseListVO { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | | private String villageName; |
| | | |
| | | @ApiModelProperty("小区地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | | private String floor; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("户室号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | private Integer relation; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("小区管理-居民列表返回参数") |
| | | @EncryptDecryptClass |
| | | public class ComMngVillagePopulationListVO { |
| | | |
| | | @ApiModelProperty("居民id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("人员标签") |
| | | private String label; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("小区列表统计返回参数") |
| | | public class ComMngVillageStatisticsVO { |
| | | |
| | | /** |
| | | * 小区数量 |
| | | */ |
| | | @ApiModelProperty("小区数量") |
| | | private Integer villageNum = 0; |
| | | |
| | | /** |
| | | * 楼栋数量 |
| | | */ |
| | | @ApiModelProperty("楼栋数量") |
| | | private Integer floorNum = 0; |
| | | |
| | | /** |
| | | * 总户数 |
| | | */ |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum = 0; |
| | | |
| | | /** |
| | | * 居住人数 |
| | | */ |
| | | @ApiModelProperty("居住人数") |
| | | private Integer userNum = 0; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台-添加网格员级联返回参数") |
| | | public class GridMemberCascadeVO { |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台-市平台网格员列表返回参数") |
| | | public class GridMemberLcListVO { |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | @ApiModelProperty(value = "市平台网格员id") |
| | | private String lcGridMemberId; |
| | | @ApiModelProperty(value = "市平台网格员名称") |
| | | private String lcGridMemberName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 综治后台-居民导出 |
| | | * @author: lyq |
| | | * @date: 2021/7/1 13:56 |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | public class ComMngPopulationExportExcelVO implements Serializable { |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名" ,index = 0) |
| | | private String userName; |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ExcelProperty(value = "身份证号" ,index = 1) |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | @ExcelProperty(value = "年龄" ,index = 2) |
| | | private Integer age; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | @ExcelProperty(value = "性别" ,index = 3) |
| | | private String sex = "暂无"; |
| | | /** |
| | | * 现居住地址 |
| | | */ |
| | | @ExcelProperty(value = "现居住地址" ,index = 4) |
| | | private String address; |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ExcelProperty(value = "政治面貌" ,index = 5) |
| | | private String politicalOutlook = "暂无"; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ExcelProperty(value = "联系方式" ,index = 6) |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | /** |
| | | * 户籍地址 |
| | | */ |
| | | @ExcelProperty(value = "户籍地址" ,index = 7) |
| | | private String censusRegister; |
| | | /** |
| | | * 是否关联实有房屋 |
| | | */ |
| | | @ExcelProperty(value = "关联实有房屋",index = 8) |
| | | private String isHouse = "暂无"; |
| | | /** |
| | | * 人员标签 |
| | | */ |
| | | @ExcelProperty(value = "人员标签" ,index = 9) |
| | | private String label; |
| | | /** |
| | | * 最后一次走访时间 |
| | | */ |
| | | @ExcelProperty(value = "最后一次走访时间",index = 10) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | /** |
| | | * 最近一次走访状态 |
| | | */ |
| | | @ExcelProperty(value = "最近一次走访状态",index = 11) |
| | | private String eventStatus = "暂无"; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.grid.admin.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 小区列表Excel导出 |
| | | */ |
| | | @Data |
| | | @ApiModel("小区列表Excel导出") |
| | | @EncryptDecryptClass |
| | | public class ComMngVillageExportExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "小区名字" ,index = 0) |
| | | private String userName; |
| | | |
| | | @ExcelProperty(value = "街路巷" ,index = 1) |
| | | private String alley; |
| | | |
| | | @ExcelProperty(value = "门牌号" ,index = 2) |
| | | private String doorNum; |
| | | |
| | | @ExcelProperty(value = "小区地址" ,index = 3) |
| | | private String address; |
| | | |
| | | @ExcelProperty(value = "小区楼栋数" ,index = 4) |
| | | private Integer buildSum; |
| | | |
| | | @ExcelProperty(value = "小区户数" ,index = 5) |
| | | private Integer houseNum; |
| | | |
| | | @ExcelProperty(value = "小区居民人数" ,index = 6) |
| | | private Integer userSum; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.*; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | |
| | | R getGridPopulationStatistics(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 综治后台-居民导出 |
| | | * 综治后台-居民导出查询居民数据 |
| | | * @param populationExportDTO 请求参数 |
| | | * @return 导出结果 |
| | | */ |
| | | @PostMapping("/population/grid/export") |
| | | R getGridPopulationExport(@RequestBody ComMngPopulationExportDTO populationExportDTO); |
| | | |
| | | /** |
| | | * 综治后台-居民管理小区列表 |
| | | * @param name 小区名字 |
| | | * @return 小区列表 |
| | | */ |
| | | @GetMapping("/population/village/relation") |
| | | R relationVillage(@RequestParam("name") String name); |
| | | |
| | | /** |
| | | * 综治后台-居民管理-级联列表 |
| | | * @param subordinateDTO 请求参数 |
| | | * @return 级联列表 |
| | | */ |
| | | @PostMapping("/population/subordinate") |
| | | R subordinate(@RequestBody ComMngPopulationSubordinateDTO subordinateDTO); |
| | | |
| | | /** |
| | | * 综治后台-居民关联房屋 |
| | | * @param relationHouseDTO 请求参数 |
| | | * @return 关联结果 |
| | | */ |
| | | @PostMapping("/population/relation/house") |
| | | R populationRelationHouse(@RequestBody ComMngPopulationRelationHouseDTO relationHouseDTO); |
| | | |
| | | /** |
| | | * 综治后台-批量删除小区 |
| | | * @param villageIds 小区id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/village/admin/del") |
| | | R delGridVillage(@RequestBody List<Long> villageIds); |
| | | |
| | | /** |
| | | * 综治后台-小区内居民列表 |
| | | * @param villagePopulationDTO 请求参数 |
| | | * @return 居民列表 |
| | | */ |
| | | @PostMapping("/village/admin/population/list") |
| | | R getVillagePopulationAdmin(@RequestBody PageComMngVillagePopulationDTO villagePopulationDTO); |
| | | |
| | | /** |
| | | * 综治后台-居民下房屋列表 |
| | | * @param villagePopulationHouseDTO 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | @PostMapping("/village/admin/population/house/list") |
| | | R getVillagePopulationHouseAdmin(@RequestBody PageComMngVillagePopulationHouseDTO villagePopulationHouseDTO); |
| | | |
| | | /** |
| | | * 综治后台-小区统计 |
| | | * @return 小区统计结果 |
| | | */ |
| | | @GetMapping("/village/admin/statistics") |
| | | R getGridVillageStatistics(); |
| | | |
| | | /** |
| | | * 综治后台-小区列表导出 |
| | | * @param villageListAppDTO 请求参数 |
| | | * @return 小区列表 |
| | | */ |
| | | @PostMapping("/village/admin/export") |
| | | R getGridVillageListExport(@RequestBody ComMngVillageListExportAdminDTO villageListAppDTO); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.IdDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | | import com.panzhihua.common.model.query.visit.EventTasksQuery; |
| | | import com.panzhihua.common.model.query.visit.EventVisitListQuery; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/complete") |
| | | R complete(@RequestBody EventVisitCompleteDTO taskCompleteDTO); |
| | | |
| | | /** |
| | | * 查询市平台网格员列表 |
| | | * @return 市平台网格员列表 |
| | | */ |
| | | @GetMapping("/eventgridmemberrelation/lc/list") |
| | | R gridMemberLcList(); |
| | | |
| | | /** |
| | | * 综治后台-添加网格员级联列表 |
| | | * @param memberCascadeAddDTO 请求参数 |
| | | * @return 级联列表 |
| | | */ |
| | | @PostMapping("/eventgridmemberrelation/cascade/list") |
| | | R gridMemberCascadeList(@RequestBody EventGridMemberCascadeAddDTO memberCascadeAddDTO); |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberLcListVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | |
| | | return userService.gridMemberEditStatus(gridMemberEditDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询市平台网格员列表",response = GridMemberLcListVO.class) |
| | | @GetMapping("/member/lc/list") |
| | | public R gridMemberLcList(){ |
| | | return gridService.gridMemberLcList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加网格员时级联列表",response = GridMemberCascadeVO.class) |
| | | @PostMapping("/member/cascade/list") |
| | | public R gridMemberCascadeList(@RequestBody EventGridMemberCascadeAddDTO memberCascadeAddDTO){ |
| | | return gridService.gridMemberCascadeList(memberCascadeAddDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.panzhihua.grid_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationRelationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ExcelShopOrderDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationExcelVo; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.PopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.excel.ComMngPopulationExportExcelVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | |
| | | @ApiOperation(value = "居民列表@lyq",response = ComMngPopulationListVO.class) |
| | | @PostMapping("/list") |
| | |
| | | return communityService.getGridPopulationStatistics(0L); |
| | | } |
| | | |
| | | @ApiOperation(value = "居民导出@lyq",response = PopulationStatisticsVO.class) |
| | | @GetMapping("/export") |
| | | @ApiOperation(value = "居民导出@lyq") |
| | | @PostMapping("/export") |
| | | public R export(@RequestBody ComMngPopulationExportDTO populationExportDTO){ |
| | | return communityService.getGridPopulationExport(populationExportDTO); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "居民数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<ComMngPopulationExportExcelVO> populList = JSON.parseArray(JSON.toJSONString(communityService.getGridPopulationExport(populationExportDTO).getData()), ComMngPopulationExportExcelVO.class); |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExportExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("实有人口导出数据").build(); |
| | | excelWriter.write(populList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "小区列表@lyq",response = ComMngPopulationVillageVO.class) |
| | | @GetMapping("/relation/village") |
| | | public R relationVillage(@RequestParam("name") String name){ |
| | | return communityService.relationVillage(name); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据上级名称查询下级列表@lyq") |
| | | @PostMapping("/subordinate") |
| | | public R subordinate(@RequestBody ComMngPopulationSubordinateDTO subordinateDTO){ |
| | | return communityService.subordinate(subordinateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "居民关联房屋@lyq") |
| | | @PostMapping("/relation/house") |
| | | public R populationRelationHouse(@RequestBody ComMngPopulationRelationHouseDTO relationHouseDTO){ |
| | | return communityService.populationRelationHouse(relationHouseDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillagePopulationHouseListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillagePopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.excel.ComMngPopulationExportExcelVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.excel.ComMngVillageExportExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"小区模块"}) |
| | | @RestController |
| | | @RequestMapping("/village/") |
| | | public class VillageApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | |
| | | @ApiOperation(value = "小区列表@lyq",response = ComMngPopulationListVO.class) |
| | | @PostMapping("/list") |
| | | public R list(@RequestBody ComMngVillageListAppDTO villageListAppDTO){ |
| | | return communityService.getGridVillageList(villageListAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "小区楼栋列表@lyq",response = ComMngVillageBuildingVO.class) |
| | | @PostMapping("/building/list") |
| | | public R buildingList(@RequestParam("villageId")Long villageId){ |
| | | return communityService.getGridVillageBuildingList(villageId); |
| | | } |
| | | |
| | | @ApiOperation(value = "小区楼栋下房屋列表@lyq",response = ComMngVillageBuildingHouseVO.class) |
| | | @PostMapping("/building/house/list") |
| | | public R buildingHouseList(@RequestBody PageComMngVillageBuildHouseAppDTO buildHouseAppDTO){ |
| | | return communityService.getGridVillageBuildingHouseList(buildHouseAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋详情@lyq",response = ComMngVillageBuildingHouseDetailVO.class) |
| | | @PostMapping("/building/house/detail") |
| | | public R buildingHouseDetail(@RequestParam("houseId")Long houseId){ |
| | | return communityService.getGridVillageBuildingHouseDetail(houseId); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋添加人员") |
| | | @PostMapping("/building/house/add/population") |
| | | public R addBuildingHousePopulation(@RequestBody AddComMngHousePopulationDTO housePopulationDTO){ |
| | | return communityService.addBuildingHousePopulation(housePopulationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋删除人员") |
| | | @PostMapping("/building/house/del/population") |
| | | public R delBuildingHousePopulation(@RequestBody DelComMngHousePopulationDTO housePopulationDTO){ |
| | | return communityService.delBuildingHousePopulation(housePopulationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询人口列表", response = EventSpecialPopulationVO.class) |
| | | @PostMapping("/building/house/population/list") |
| | | public R getBuildingHousePopulationList(@RequestBody PageComMngPopulationDTO populationDTO){ |
| | | return communityService.getBuildingHousePopulationList(populationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除小区@lyq") |
| | | @PostMapping("/del") |
| | | public R del(@RequestBody List<Long> villageIds){ |
| | | return communityService.delGridVillage(villageIds); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看小区居民列表@lyq",response = ComMngVillagePopulationListVO.class) |
| | | @PostMapping("/population/list") |
| | | public R populationList(@RequestBody PageComMngVillagePopulationDTO villagePopulationDTO){ |
| | | return communityService.getVillagePopulationAdmin(villagePopulationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看居民房屋列表@lyq",response = ComMngVillagePopulationHouseListVO.class) |
| | | @PostMapping("/population/house/list") |
| | | public R populationHouseList(@RequestBody PageComMngVillagePopulationHouseDTO villagePopulationHouseDTO){ |
| | | return communityService.getVillagePopulationHouseAdmin(villagePopulationHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "小区统计@lyq",response = ComMngVillageStatisticsVO.class) |
| | | @GetMapping("/statistics") |
| | | public R statistics(){ |
| | | return communityService.getGridVillageStatistics(); |
| | | } |
| | | |
| | | @ApiOperation(value = "小区列表导出@lyq") |
| | | @PostMapping("/export") |
| | | public R export(@RequestBody ComMngVillageListExportAdminDTO villageListAppDTO){ |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "小区数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<ComMngVillageExportExcelVO> populList = JSON.parseArray(JSON.toJSONString(communityService.getGridVillageListExport(villageListAppDTO).getData()), ComMngVillageExportExcelVO.class); |
| | | excelWriter = EasyExcel.write(fileName, ComMngVillageExportExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("小区导出数据").build(); |
| | | excelWriter.write(populList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | |
| | | return comMngPopulationHouseUserService.delBuildingHousePopulation(housePopulationDTO); |
| | | } |
| | | |
| | | @PostMapping("/village/admin/del") |
| | | public R delGridVillage(@RequestBody List<Long> villageIds) { |
| | | return comMngVillageService.delGridVillage(villageIds); |
| | | } |
| | | |
| | | @PostMapping("/village/admin/population/list") |
| | | public R getVillagePopulationAdmin(@RequestBody PageComMngVillagePopulationDTO villagePopulationDTO) { |
| | | return comMngPopulationService.getVillagePopulationAdmin(villagePopulationDTO); |
| | | } |
| | | |
| | | @PostMapping("/village/admin/population/house/list") |
| | | public R getVillagePopulationHouseAdmin(@RequestBody PageComMngVillagePopulationHouseDTO villagePopulationHouseDTO) { |
| | | return comMngPopulationHouseUserService.getVillagePopulationHouseAdmin(villagePopulationHouseDTO); |
| | | } |
| | | |
| | | @GetMapping("/village/admin/statistics") |
| | | public R getGridVillageStatistics() { |
| | | return comMngVillageService.getGridVillageStatistics(); |
| | | } |
| | | |
| | | @PostMapping("/village/admin/export") |
| | | public R getGridPopulationAdminListExport(@RequestBody ComMngVillageListExportAdminDTO villageListAppDTO) { |
| | | return comMngVillageService.getGridVillageListExport(villageListAppDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationRelationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseService; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Resource |
| | | private ComMngPopulationService comMngPopulationService; |
| | | @Resource |
| | | private ComMngPopulationHouseService comMngPopulationHouseService; |
| | | |
| | | /** |
| | | * 获取人口数据信息 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 综治后台-居民导出 |
| | | * 综治后台-居民导出查询居民数据 |
| | | * @param populationExportDTO 请求参数 |
| | | * @return 导出结果 |
| | | */ |
| | |
| | | return comMngPopulationService.getGridPopulationExport(populationExportDTO); |
| | | } |
| | | |
| | | /** |
| | | * 综治后台-居民管理小区列表 |
| | | * @param name 小区名字 |
| | | * @return 小区列表 |
| | | */ |
| | | @GetMapping("/village/relation") |
| | | public R relationVillage(@RequestParam("name") String name) { |
| | | return comMngPopulationService.relationVillage(name); |
| | | } |
| | | |
| | | @PostMapping("/subordinate") |
| | | public R subordinate(@RequestBody ComMngPopulationSubordinateDTO subordinateDTO) { |
| | | return comMngPopulationHouseService.subordinate(subordinateDTO); |
| | | } |
| | | |
| | | @PostMapping("/relation/house") |
| | | public R populationRelationHouse(@RequestBody ComMngPopulationRelationHouseDTO relationHouseDTO) { |
| | | return comMngPopulationHouseService.populationRelationHouse(relationHouseDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.PageComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.excel.ComMngVillageExportExcelVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND out_or_local = 1 ) AS registerNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND is_rent = 2 ) AS rentNum " + |
| | | "FROM " + |
| | | " com_mng_village AS cmv where cmv.community_id = #{villageListAppDTO.communityId} " + |
| | | " com_mng_village AS cmv where 1=1 " + |
| | | "<if test='villageListAppDTO.communityId != null'>" + |
| | | " and cmv.community_id = #{villageListAppDTO.communityId} "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.address != null and villageListAppDTO.address != ""'>" + |
| | | " and cmv.address like concat(#{villageListAppDTO.address},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.alley != null and villageListAppDTO.alley != ""'>" + |
| | | " and cmv.alley like concat(#{villageListAppDTO.alley},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.houseNum != null and villageListAppDTO.houseNum != ""'>" + |
| | | " and cmv.house_num like concat(#{villageListAppDTO.houseNum},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.groupAt != null and villageListAppDTO.groupAt != ""'>" + |
| | | " and cmv.group_at like concat(#{villageListAppDTO.groupAt},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.name != null and villageListAppDTO.name != ""'>" + |
| | | " and cmv.name like concat(#{villageListAppDTO.name},'%')"+ |
| | | " and cmv.name like concat(#{villageListAppDTO.name},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.sortColumns!=null'>" + |
| | | " ORDER BY ${villageListAppDTO.sortColumns} ${villageListAppDTO.sortType} " + |
| | | " </if>" + |
| | | " </script>") |
| | | IPage<PageComMngVillageVO> getGridVillageList(Page page, @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " alley, " + |
| | | " house_num as doorNum, " + |
| | | " `name` AS userName, " + |
| | | " build_sum, " + |
| | | " address, " + |
| | | " create_at as createAt, " + |
| | | " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id ) AS userSum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population_house WHERE village_id = cmv.village_id ) AS houseNum " + |
| | | "FROM " + |
| | | " com_mng_village AS cmv where 1=1 " + |
| | | "<if test='villageListAppDTO.communityId != null'>" + |
| | | " and cmv.community_id = #{villageListAppDTO.communityId} "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.villageIds != null and villageListAppDTO.villageIds.size > 0'>" + |
| | | " and cmv.village_id in "+ |
| | | "<foreach item='item' collection='villageListAppDTO.villageIds' separator=',' open='(' close=')' index=''> " + |
| | | "#{item}" + |
| | | "</foreach>" + |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.address != null and villageListAppDTO.address != ""'>" + |
| | | " and cmv.address like concat(#{villageListAppDTO.address},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.alley != null and villageListAppDTO.alley != ""'>" + |
| | | " and cmv.alley like concat(#{villageListAppDTO.alley},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.houseNum != null and villageListAppDTO.houseNum != ""'>" + |
| | | " and cmv.house_num like concat(#{villageListAppDTO.houseNum},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.groupAt != null and villageListAppDTO.groupAt != ""'>" + |
| | | " and cmv.group_at like concat(#{villageListAppDTO.groupAt},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.name != null and villageListAppDTO.name != ""'>" + |
| | | " and cmv.name like concat(#{villageListAppDTO.name},'%') "+ |
| | | " </if> " + |
| | | "<if test='villageListAppDTO.sortColumns!=null'>" + |
| | | " ORDER BY ${villageListAppDTO.sortColumns} ${villageListAppDTO.sortType} " + |
| | | " </if>" + |
| | | " </script>") |
| | | List<ComMngVillageExportExcelVO> getGridVillageLists(@Param("villageListAppDTO") ComMngVillageListExportAdminDTO villageListAppDTO); |
| | | |
| | | @Select("SELECT DISTINCT " + |
| | | " village_id," + |
| | |
| | | "WHERE " + |
| | | " village_id = #{villageId}") |
| | | List<ComMngVillageBuildingVO> getGridVillageBuildingList(@Param("villageId") Long villageId); |
| | | |
| | | @Select("<script> " + |
| | | " select count(village_id) from com_mng_population_house where village_id in " + |
| | | "<foreach item='item' collection='villageIds' separator=',' open='(' close=')' index=''> " + |
| | | "#{item} " + |
| | | "</foreach>" + |
| | | "</script>") |
| | | Integer getVillageHouseCount(@Param("villageIds") List<Long> villageIds); |
| | | |
| | | @Select("SELECT " + |
| | | " count( village_id ) AS villageNum, " + |
| | | " ( SELECT count( village_id ) FROM ( SELECT DISTINCT village_id, floor FROM com_mng_population_house ) AS floor ) AS floorNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population_house ) AS houseNum, " + |
| | | " ( SELECT count( id ) FROM com_mng_population ) AS userNum " + |
| | | "FROM " + |
| | | " com_mng_village") |
| | | ComMngVillageStatisticsVO getGridVillageStatistics(); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | |
| | | import com.panzhihua.common.model.vos.grid.PopulationDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillagePopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.PopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.model.vos.community.PageComActMessageVO; |
| | |
| | | " </script>") |
| | | PopulationStatisticsVO getGridPopulationStatistics(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " * " + |
| | | "FROM " + |
| | | " ( " + |
| | | " SELECT " + |
| | | " cmp.id, " + |
| | | " cmp.`name` AS userName, " + |
| | | " cmp.label, " + |
| | | " cmp.card_no, " + |
| | | " cmp.card_no_str, " + |
| | | " cmp.sex, " + |
| | | " cmp.address, " + |
| | | " cmp.political_outlook, " + |
| | | " cmp.census_register, " + |
| | | " cmp.house_id, " + |
| | | " cmp.phone, " + |
| | | " IFNULL(cmp.house_id,0) as isHouse, " + |
| | | " ( SELECT event_status FROM event_visiting_tasks WHERE event_status in (1,2,3,5) AND visiter_id = cmp.id ORDER BY create_at DESC LIMIT 1 ) AS eventStatus, " + |
| | | " ( SELECT create_at FROM event_visiting_tasks WHERE event_status in (1,2,3,5) AND visiter_id = cmp.id ORDER BY create_at DESC LIMIT 1 ) AS createAt " + |
| | | " FROM " + |
| | | " com_mng_population AS cmp where 1=1 " + |
| | | "<if test='populationExportDTO.keyWord != null and populationExportDTO.keyWord != ""'>" + |
| | | "AND (cmp.name like concat (#{populationExportDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationExportDTO.keyWord},'%') or cmp.address like concat (#{populationExportDTO.keyWord},'%')) " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.label != null and populationExportDTO.label != ""'>" + |
| | | "AND cmp.label like concat ('%',#{populationExportDTO.label},'%') " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.sex != null'>" + |
| | | "AND cmp.sex = #{populationExportDTO.sex} " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.isHouse != null and populationExportDTO.isHouse == 1'>" + |
| | | "AND cmp.house_id is not null " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.populationIds != null and populationExportDTO.populationIds.size > 0'>" + |
| | | "AND cmp.id in " + |
| | | "<foreach item='item' collection='populationExportDTO.populationIds' separator=',' open='(' close=')' index=''>" + |
| | | "#{item}" + |
| | | "</foreach>" + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.isHouse != null and populationExportDTO.isHouse == 2'>" + |
| | | "AND cmp.house_id is null " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.communityId != null'>" + |
| | | "AND cmp.act_id = #{populationExportDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='populationExportDTO.politicalOutlook != null'>" + |
| | | "AND cmp.political_outlook = #{populationExportDTO.politicalOutlook} " + |
| | | " </if> " + |
| | | " ) as population where 1=1 " + |
| | | "<if test='populationExportDTO.eventStatus != null'>" + |
| | | "AND population.eventStatus = #{populationExportDTO.eventStatus} " + |
| | | " </if> " + |
| | | " </script>") |
| | | List<ComMngPopulationListVO> getGridPopulationAdminLists(@Param("populationExportDTO") ComMngPopulationExportDTO populationExportDTO); |
| | | |
| | | @Select("<script> " + |
| | | " select id,`name`,card_no,label from com_mng_population where 1=1 " + |
| | | "<if test='villagePopulationDTO.villageId != null'>" + |
| | | " and village_id = #{villagePopulationDTO.villageId} " + |
| | | " </if> " + |
| | | "<if test='villagePopulationDTO.keyWord != null'>" + |
| | | " AND (name like concat (#{villagePopulationDTO.keyWord},'%') or card_no_str like concat (#{villagePopulationDTO.keyWord},'%')) " + |
| | | " </if> " + |
| | | "<if test='villagePopulationDTO.label != null and villagePopulationDTO.label != ""'>" + |
| | | " AND label like concat ('%',#{villagePopulationDTO.label},'%') " + |
| | | " </if> " + |
| | | " </script>") |
| | | IPage<ComMngVillagePopulationListVO> getVillagePopulationAdmin(Page page,@Param("villagePopulationDTO") PageComMngVillagePopulationDTO villagePopulationDTO); |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngSubordinateVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | " </script>") |
| | | List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId,@Param("relation") Integer relation,@Param("relationId") Integer relationId); |
| | | |
| | | @Select("select id as houseId,floor from com_mng_population_house where village_id = #{villageId} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByFloors(@Param("villageId") Long villageId); |
| | | |
| | | @Select("select id as houseId,unit_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByUnitNos(@Param("villageId") Long villageId,@Param("floor") String floor); |
| | | |
| | | @Select("select id as houseId,house_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unitNo} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByHouseNos(@Param("villageId") Long villageId,@Param("floor") String floor,@Param("unitNo") String unitNo); |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillagePopulationHouseListVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Select("update com_mng_population_house_user set relation_id = null where id = #{id}") |
| | | Integer delBuildingHousePopulationRelationId(@Param("id") Long id); |
| | | |
| | | @Select("SELECT " + |
| | | " cmv.`name` AS villageName, " + |
| | | " cmph.id, " + |
| | | " cmv.address, " + |
| | | " cmph.floor, " + |
| | | " cmph.unit_no, " + |
| | | " cmph.house_no " + |
| | | "FROM " + |
| | | " com_mng_population_house_user AS cmphu " + |
| | | " LEFT JOIN com_mng_population_house AS cmph ON cmph.id = cmphu.house_id " + |
| | | " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id " + |
| | | "WHERE " + |
| | | " cmphu.popul_id = #{villagePopulationDTO.populationId}") |
| | | IPage<ComMngVillagePopulationHouseListVO> getVillagePopulationHouseAdmin(Page page, @Param("villagePopulationDTO") PageComMngVillagePopulationHouseDTO villagePopulationDTO); |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationRelationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | |
| | |
| | | */ |
| | | R getGridVillageBuildingHouseDetail(Long houseId); |
| | | |
| | | R subordinate(ComMngPopulationSubordinateDTO subordinateDTO); |
| | | |
| | | R populationRelationHouse(ComMngPopulationRelationHouseDTO relationHouseDTO); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | |
| | |
| | | */ |
| | | R delBuildingHousePopulation(DelComMngHousePopulationDTO housePopulationDTO); |
| | | |
| | | R getVillagePopulationHouseAdmin(PageComMngVillagePopulationHouseDTO villagePopulationDTO); |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | |
| | | R getGridPopulationStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 综治后台-居民导出 |
| | | * 综治后台-居民导出查询居民数据 |
| | | * @param populationExportDTO 请求参数 |
| | | * @return 导出结果 |
| | | */ |
| | | R getGridPopulationExport(ComMngPopulationExportDTO populationExportDTO); |
| | | |
| | | /** |
| | | * 综治后台-居民管理小区列表 |
| | | * @param name 小区名字 |
| | | * @return 小区列表 |
| | | */ |
| | | R relationVillage(String name); |
| | | |
| | | R getVillagePopulationAdmin(PageComMngVillagePopulationDTO villagePopulationDTO); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | |
| | | */ |
| | | R getGridVillageBuildingList(Long villageId); |
| | | |
| | | R delGridVillage(List<Long> villageIds); |
| | | |
| | | R getGridVillageStatistics(); |
| | | |
| | | R getGridVillageListExport(ComMngVillageListExportAdminDTO villageListAppDTO); |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationRelationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngCascadeHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationHouseDetailAdminVO; |
| | |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngSubordinateVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseDAO; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Function; |
| | | import java.util.function.Predicate; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | |
| | | private ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComActVillageDAO comActVillageDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | |
| | | /** |
| | | * 查询房屋级联菜单 |
| | |
| | | return R.ok(buildingHouseDetailVO); |
| | | } |
| | | |
| | | private static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) { |
| | | Map<Object, Boolean> seen = new ConcurrentHashMap<>(); |
| | | return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; |
| | | } |
| | | |
| | | @Override |
| | | public R subordinate(ComMngPopulationSubordinateDTO subordinateDTO){ |
| | | |
| | | List<ComMngSubordinateVO> subordinateList = new ArrayList<>(); |
| | | |
| | | ComMngPopulationHouseDO houseDO = null; |
| | | if(subordinateDTO.getHouseId() != null){ |
| | | houseDO = this.baseMapper.selectById(subordinateDTO.getHouseId()); |
| | | } |
| | | |
| | | switch (subordinateDTO.getType()){ |
| | | case 1: |
| | | subordinateList = this.baseMapper.getHouseLevelByFloors(subordinateDTO.getVillageId()); |
| | | // subordinateList = subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getFloor()))), ArrayList::new)); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getFloor)).collect(Collectors.toList()); |
| | | subordinateList.forEach(cascade -> { |
| | | if(cascade.getFloor().contains("栋")){ |
| | | cascade.setName(cascade.getFloor()); |
| | | }else{ |
| | | cascade.setName(cascade.getFloor() + "栋"); |
| | | } |
| | | }); |
| | | break; |
| | | case 2: |
| | | if(houseDO != null){ |
| | | subordinateList = this.baseMapper.getHouseLevelByUnitNos(houseDO.getVillageId(),houseDO.getFloor()); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getUnitNo)).collect(Collectors.toList()); |
| | | // subordinateList = subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getUnitNo()))), ArrayList::new)); |
| | | subordinateList.forEach(cascade -> { |
| | | if(cascade.getUnitNo().contains("单元")){ |
| | | cascade.setName(cascade.getUnitNo()); |
| | | }else{ |
| | | cascade.setName(cascade.getUnitNo() + "单元"); |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 3: |
| | | if(houseDO != null) { |
| | | subordinateList = this.baseMapper.getHouseLevelByHouseNos(houseDO.getVillageId(), houseDO.getFloor(), houseDO.getUnitNo()); |
| | | subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getHouseNo)).collect(Collectors.toList()); |
| | | // subordinateList = subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getHouseNo()))), ArrayList::new)); |
| | | subordinateList.forEach(cascade -> { |
| | | cascade.setName(cascade.getHouseNo()); |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return R.ok(subordinateList); |
| | | } |
| | | |
| | | public R populationRelationHouse(ComMngPopulationRelationHouseDTO relationHouseDTO){ |
| | | |
| | | if(relationHouseDTO.getPopulationId().isEmpty()){ |
| | | return R.fail("请选择居民"); |
| | | } |
| | | |
| | | //查询房屋信息 |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(relationHouseDTO.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("未查到房屋信息"); |
| | | } |
| | | |
| | | relationHouseDTO.getPopulationId().forEach(population -> { |
| | | //修改人口信息 |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | populationDO.setId(population); |
| | | populationDO.setHouseId(houseDO.getId()); |
| | | populationDO.setRoad(houseDO.getAlley()); |
| | | populationDO.setDoorNo(houseDO.getHouseNum()); |
| | | populationDO.setFloor(houseDO.getFloor()); |
| | | populationDO.setUnitNo(houseDO.getUnitNo()); |
| | | populationDO.setHouseNo(houseDO.getHouseNo()); |
| | | comMngPopulationDAO.updateById(populationDO); |
| | | |
| | | //添加房屋关系 |
| | | ComMngPopulationHouseUserDO houseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>() |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getPopulId,population).eq(ComMngPopulationHouseUserDO::getHouseId,relationHouseDTO.getHouseId())); |
| | | if(houseUserDO == null){ |
| | | houseUserDO = new ComMngPopulationHouseUserDO(); |
| | | houseUserDO.setId(Snowflake.getId()); |
| | | houseUserDO.setHouseId(relationHouseDTO.getHouseId()); |
| | | houseUserDO.setPopulId(population); |
| | | houseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zizhu); |
| | | comMngPopulationHouseUserDAO.insert(houseUserDO); |
| | | }else{ |
| | | houseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zizhu); |
| | | comMngPopulationHouseUserDAO.updateById(houseUserDO); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R getVillagePopulationHouseAdmin(PageComMngVillagePopulationHouseDTO villagePopulationDTO){ |
| | | return R.ok(this.baseMapper.getVillagePopulationHouseAdmin(new Page(villagePopulationDTO.getPageNum(),villagePopulationDTO.getPageSize()),villagePopulationDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.base.Joiner; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulCultureLevelEnum; |
| | | import com.panzhihua.common.enums.PopulHouseUseEnum; |
| | | import com.panzhihua.common.enums.PopulIsOksEnum; |
| | | import com.panzhihua.common.enums.PopulMarriageEnum; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngSubordinateVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.excel.ComMngPopulationExportExcelVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO; |
| | |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import com.panzhihua.service_community.service.ComMngVillageService; |
| | | import com.panzhihua.service_community.service.EventResourceService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 综治后台-居民导出 |
| | | * 综治后台-居民导出查询居民数据 |
| | | * @param populationExportDTO 请求参数 |
| | | * @return 导出结果 |
| | | */ |
| | | @Override |
| | | public R getGridPopulationExport(ComMngPopulationExportDTO populationExportDTO){ |
| | | //结果集 |
| | | List<ComMngPopulationExportExcelVO> resultPopulationList = new ArrayList<>(); |
| | | //查询人口信息 |
| | | List<ComMngPopulationListVO> populationListVOList = this.baseMapper.getGridPopulationAdminLists(populationExportDTO); |
| | | if(!populationListVOList.isEmpty()){ |
| | | populationListVOList.forEach(population -> { |
| | | ComMngPopulationExportExcelVO populationExportExcelVO = new ComMngPopulationExportExcelVO(); |
| | | BeanUtils.copyProperties(population,populationExportExcelVO); |
| | | if(population.getSex() != null){ |
| | | populationExportExcelVO.setSex(PopulSexEnum.getCnDescByName(population.getSex())); |
| | | } |
| | | if(population.getPoliticalOutlook() != null){ |
| | | populationExportExcelVO.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(population.getPoliticalOutlook())); |
| | | } |
| | | if(population.getIsHouse() != null){ |
| | | if(!population.getIsHouse().equals(0L)){ |
| | | populationExportExcelVO.setIsHouse("是"); |
| | | }else{ |
| | | populationExportExcelVO.setIsHouse("否"); |
| | | } |
| | | } |
| | | if(population.getEventStatus() != null){ |
| | | populationExportExcelVO.setEventStatus(EventStatusEnum.getCnDescByName(population.getEventStatus())); |
| | | } |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(population.getCardNo()); |
| | | populationExportExcelVO.setAge(age); |
| | | }catch (Exception e){ |
| | | log.error("当前人口身份证获取年龄失败,实有人口id:" + population.getId()); |
| | | } |
| | | resultPopulationList.add(populationExportExcelVO); |
| | | }); |
| | | } |
| | | return R.ok(resultPopulationList); |
| | | } |
| | | |
| | | return R.ok(); |
| | | /** |
| | | * 综治后台-居民管理小区列表 |
| | | * @param name 小区名字 |
| | | * @return 小区列表 |
| | | */ |
| | | @Override |
| | | public R relationVillage(String name){ |
| | | List<ComMngPopulationVillageVO> populationVillageList = new ArrayList<>(); |
| | | QueryWrapper<ComMngVillageDO> villageQuery = new QueryWrapper<>(); |
| | | if(StringUtils.isNotEmpty(name)){ |
| | | villageQuery.lambda().like(ComMngVillageDO::getName,name); |
| | | } |
| | | |
| | | List<ComMngVillageDO> villageList = comActVillageDAO.selectList(villageQuery); |
| | | if(!villageList.isEmpty()){ |
| | | villageList.forEach(village -> { |
| | | ComMngPopulationVillageVO populationVillageVO = new ComMngPopulationVillageVO(); |
| | | BeanUtils.copyProperties(village,populationVillageVO); |
| | | populationVillageList.add(populationVillageVO); |
| | | }); |
| | | } |
| | | return R.ok(populationVillageList); |
| | | } |
| | | |
| | | @Override |
| | | public R getVillagePopulationAdmin(PageComMngVillagePopulationDTO villagePopulationDTO){ |
| | | return R.ok(this.baseMapper.getVillagePopulationAdmin(new Page(villagePopulationDTO.getPageNum(),villagePopulationDTO.getPageSize()),villagePopulationDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillageStatisticsVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | |
| | | return R.ok(villageBuildingList); |
| | | } |
| | | |
| | | @Override |
| | | public R delGridVillage(List<Long> villageIds){ |
| | | |
| | | if(villageIds.isEmpty()){ |
| | | return R.fail("请选择需要删除的小区"); |
| | | } |
| | | //查询需要删除的小区下面是否绑定的有房屋 |
| | | Integer count = this.baseMapper.getVillageHouseCount(villageIds); |
| | | if(count > 0){ |
| | | return R.fail("您选择的小区已被引用,无法删除"); |
| | | } |
| | | if(this.baseMapper.deleteBatchIds(villageIds) > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R getGridVillageStatistics(){ |
| | | return R.ok(this.baseMapper.getGridVillageStatistics()); |
| | | } |
| | | |
| | | @Override |
| | | public R getGridVillageListExport(ComMngVillageListExportAdminDTO villageListAppDTO){ |
| | | return R.ok(this.baseMapper.getGridVillageLists(villageListAppDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberRelationDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | |
| | | private EventGridMemberRelationService eventGridMemberRelationService; |
| | | |
| | | /** |
| | | * 新增网格和网格员的关联关系 |
| | | * @param eventGridMemberAddDTO |
| | | * @return 新增结果 |
| | | * 查询市平台网格员列表 |
| | | * @return 市平台网格员列表 |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(@RequestBody EventGridMemberAddDTO eventGridMemberAddDTO){ |
| | | return eventGridMemberRelationService.add(eventGridMemberAddDTO); |
| | | }; |
| | | @GetMapping("/lc/list") |
| | | public R lcList(){ |
| | | return eventGridMemberRelationService.lcList(); |
| | | } |
| | | |
| | | /** |
| | | * 修改网格和网格员的关联关系 |
| | | * @param eventGridMemberEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/edit") |
| | | R edit(@RequestBody EventGridMemberEditDTO eventGridMemberEditDTO){ |
| | | return eventGridMemberRelationService.edit(eventGridMemberEditDTO); |
| | | }; |
| | | @PostMapping("/cascade/list") |
| | | public R gridMemberCascadeList(@RequestBody EventGridMemberCascadeAddDTO memberCascadeAddDTO){ |
| | | return eventGridMemberRelationService.gridMemberCascadeList(memberCascadeAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找网格和网格员的关联关系 |
| | | * @param pageEventGridMemberRelationDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | R<IPage<EventGridMemberRelationVO>> query(@RequestBody PageEventGridMemberRelationDTO pageEventGridMemberRelationDTO){ |
| | | return eventGridMemberRelationService.query(pageEventGridMemberRelationDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 删除网格和网格员的关联关系 |
| | | * @param EventGridMemberRelationDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | @PostMapping("/delete") |
| | | R delete(@RequestBody EventGridMemberRelationDeleteDTO EventGridMemberRelationDeleteDTO){ |
| | | return eventGridMemberRelationService.delete(EventGridMemberRelationDeleteDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 查询网格和网格员的关联关系详细信息 |
| | | * @param id 网格和网格员的关联关系 id |
| | | * @return 查找结果 |
| | | */ |
| | | @PostMapping("/{id}") |
| | | R<EventGridMemberRelationDetailsVO> eventGridMemberRelationDetails(@PathVariable("id") Long id){ |
| | | return eventGridMemberRelationService.eventGridMemberRelationDetails(id); |
| | | }; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.vos.grid.EventMapGridVO; |
| | | import com.panzhihua.common.model.vos.grid.EventStatisticsMemberAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberLcListVO; |
| | | import com.panzhihua.service_grid.model.dos.EventGridMemberRelationDO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | */ |
| | | IPage<EventStatisticsMemberAdminVO> gridMemberStatistics(Page page, @Param("statisticsAdminDTO") MemberStatisticsAdminDTO statisticsAdminDTO); |
| | | |
| | | /** |
| | | * 查询市平台网格员列表 |
| | | * @return 市平台网格员列表 |
| | | */ |
| | | List<GridMemberLcListVO> getGridMemberLcList(); |
| | | |
| | | List<GridMemberCascadeVO> getGridMemberCascade(@Param("type") Integer type,@Param("id") Long id); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | |
| | | */ |
| | | R getMapGridListByApp(Long userId); |
| | | |
| | | /** |
| | | * 查询市平台网格员列表 |
| | | * @return 市平台网格员列表 |
| | | */ |
| | | R lcList(); |
| | | |
| | | R gridMemberCascadeList(EventGridMemberCascadeAddDTO memberCascadeAddDTO); |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_grid.dao.*; |
| | | import com.panzhihua.service_grid.model.dos.*; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | return R.ok(this.baseMapper.getMapGridListByApp(userId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询市平台网格员列表 |
| | | * @return 市平台网格员列表 |
| | | */ |
| | | @Override |
| | | public R lcList(){ |
| | | return R.ok(this.baseMapper.getGridMemberLcList()); |
| | | } |
| | | |
| | | @Override |
| | | public R gridMemberCascadeList(EventGridMemberCascadeAddDTO memberCascadeAddDTO){ |
| | | if(memberCascadeAddDTO.getType() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return R.ok(this.baseMapper.getGridMemberCascade(memberCascadeAddDTO.getType(),memberCascadeAddDTO.getSuperiorId())); |
| | | } |
| | | |
| | | } |
| | |
| | | ORDER BY su.create_at desc |
| | | </select> |
| | | |
| | | <select id="getGridMemberLcList" resultType="com.panzhihua.common.model.vos.grid.admin.GridMemberLcListVO"> |
| | | select id,lc_grid_member_id,lc_grid_member_name from lc_compare_code_member |
| | | </select> |
| | | |
| | | <select id="getGridMemberCascade" resultType="com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO"> |
| | | <if test="type != null and type == 1"> |
| | | select community_id as id,`name` from com_act where state = 0 |
| | | </if> |
| | | <if test="type != null and type == 2"> |
| | | select village_id as id,`name` from com_mng_village where community_id = #{id} |
| | | </if> |
| | | <if test="type != null and type == 3"> |
| | | select id,`name` from com_mng_building where village_id = #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.panzhihua.service_user.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-02 15:45:40 |
| | | * @describe 网格员与楼栋关联表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface EventGridMemberBuildingRelationMapper extends BaseMapper<EventGridMemberBuildingRelationDO> { |
| | | |
| | | } |
| | |
| | | "</script>") |
| | | void passResetUser(@Param("gridMemberDTO") EventGridMemberPassResetDTO gridMemberDTO); |
| | | |
| | | // @Update("update lc_compare_code_member set local_grid_member_id = #{userId},grid_member_name = #{userName} where id = #{lcMemberId}") |
| | | // void addLcMember(@Param("lcMemberId") Long lcMemberId,@Param("userId") Long userId,@Param("userName") Long userName); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-02 15:45:40 |
| | | * @describe 网格员与楼栋关联表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("event_grid_member_building_relation") |
| | | public class EventGridMemberBuildingRelationDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 网格员id |
| | | */ |
| | | private Long gridMemberId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | private Long villageId; |
| | | |
| | | /** |
| | | * 楼栋id |
| | | */ |
| | | private Long buildingId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EventGridMemberBuildingRelationDO{" + |
| | | "id=" + id + |
| | | ", gridMemberId=" + gridMemberId + |
| | | ", communityId=" + communityId + |
| | | ", villageId=" + villageId + |
| | | ", buildingId=" + buildingId + |
| | | ", createAt=" + createAt + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-02 15:45:40 |
| | | * @describe 网格员与楼栋关联表服务类 |
| | | */ |
| | | public interface EventGridMemberBuildingRelationService extends IService<EventGridMemberBuildingRelationDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper; |
| | | import com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO; |
| | | import com.panzhihua.service_user.service.EventGridMemberBuildingRelationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-02 15:45:40 |
| | | * @describe 网格员与楼栋关联表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class EventGridMemberBuildingRelationServiceImpl extends ServiceImpl<EventGridMemberBuildingRelationMapper, EventGridMemberBuildingRelationDO> implements EventGridMemberBuildingRelationService { |
| | | |
| | | } |
| | |
| | | menuRoleVO.setRoleId(roleId); |
| | | this.putMenuRole(menuRoleVO); |
| | | |
| | | //关联市平台网格员 |
| | | // if(eventGridMemberAddDTO.getLcMemberId() != null){ |
| | | // |
| | | // } |
| | | |
| | | //参数校验 |
| | | SysUserDO oldUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType,6) |
| | | .eq(SysUserDO::getNickName,eventGridMemberAddDTO.getNickName())); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="grid_member_id" property="gridMemberId" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="village_id" property="villageId" /> |
| | | <result column="building_id" property="buildingId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, grid_member_id, community_id, village_id, building_id, create_at |
| | | </sql> |
| | | |
| | | </mapper> |