| | |
| | | <artifactId>hutool-core</artifactId> |
| | | <version>4.0.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.6.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.esotericsoftware</groupId> |
| | | <artifactId>reflectasm</artifactId> |
| | | <version>1.11.9</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-base</artifactId> |
| | | <version>4.1.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.google.guava</groupId> |
| | | <artifactId>guava</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
New file |
| | |
| | | package com.panzhihua.common.constants; |
| | | |
| | | /** 字典表key |
| | | * @author xyh |
| | | * @date 2021/6/11 15:53 |
| | | */ |
| | | public class BcDictionaryConstants { |
| | | |
| | | /** |
| | | * 家庭关系 |
| | | */ |
| | | public static final String FAMILY = "family"; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | public static final String NATION = "nation"; |
| | | |
| | | /** |
| | | * 性别 |
| | | */ |
| | | public static final String SEX = "sex"; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | */ |
| | | public static final String MARRY = "marry"; |
| | | /** |
| | | * 国家 |
| | | */ |
| | | public static final String COUNTRY = "country"; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | public static final String EDUCATION = "education"; |
| | | |
| | | /** |
| | | * 生育史 |
| | | */ |
| | | public static final String CHILDBEARING_HISTORY = "childbearing history"; |
| | | |
| | | /** |
| | | * 职业 |
| | | */ |
| | | public static final String PROFESSION = "profession"; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | public static final String POLITICAL_OUTLOOK = "political_outlook"; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Getter |
| | | public enum KeyPersonLabelEnum |
| | | { |
| | | XD(1, "吸毒人员"), |
| | | ZJ(2, "重精人员"), |
| | | XJ(3, "邪教人员"), |
| | | QT(4, "其他重点人员"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | KeyPersonLabelEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (KeyPersonLabelEnum item : KeyPersonLabelEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (KeyPersonLabelEnum item : KeyPersonLabelEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
| | |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return -1; |
| | | return QT.getCode(); |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | /** 实有房屋使用类型 |
| | | * @author xyh |
| | | * @date 2021/6/11 9:33 |
| | | */ |
| | | public enum PopulHouseUseEnum { |
| | | |
| | | SELF(1,"自住"), |
| | | RENT(2,"租住"), |
| | | ; |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulHouseUseEnum(Integer code,String name){ |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulHouseUseEnum item : PopulHouseUseEnum.values()) { |
| | | if (item.getName().equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulHouseUseEnum item : PopulHouseUseEnum.values()) { |
| | | if (item.getCode().equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | } |
| | |
| | | @Getter |
| | | public enum PopulMarriageEnum |
| | | { |
| | | WH(1, "未婚"), |
| | | YH(2, "已婚"), |
| | | LY(3, "离异"), |
| | | SO(4, "丧偶"), |
| | | FJ(5, "分居"), |
| | | QT(6, "其他"); |
| | | WH(10, "未婚"), |
| | | YH(20, "已婚"), |
| | | CH(21, "初婚"), |
| | | ZH(22, "再婚"), |
| | | FH(23, "复婚"), |
| | | SO(30, "丧偶"), |
| | | LH(40, "离婚"), |
| | | |
| | | FJ(50, "分居"), |
| | | QT(90, "其他"), |
| | | WSM(90, "未说明的婚姻状况"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return -1; |
| | | return THE_MASSES.getCode(); |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @description: 社区楼栋导入监听 |
| | | * @author: xyh |
| | | */ |
| | | @Slf4j |
| | | public class ComMngBuildingExcelListen extends AnalysisEventListener<Map<Integer, String>> { |
| | | private CommunityService communityService; |
| | | |
| | | private GridService gridService; |
| | | |
| | | private Long communityId; |
| | | |
| | | private static int headSize = 0; |
| | | |
| | | private Map<Integer, String> headData; |
| | | |
| | | |
| | | public ComMngBuildingExcelListen(CommunityService communityService, Long communityId) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | private static final int BATCH_COUNT = 5000; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | |
| | | @Override |
| | | public void invoke(Map<Integer, String> data, AnalysisContext context) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | saveData(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param headMap |
| | | * @param context |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | headSize = headMap.size(); |
| | | headData = headMap; |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | saveData(); |
| | | log.info("所有数据解析完成!"); |
| | | } |
| | | |
| | | /** |
| | | * 不是固定的列只能手动处理 |
| | | */ |
| | | private void saveData() { |
| | | try { |
| | | int index = 2; |
| | | ArrayList<ComMngBuildingExcelVO> voList = Lists.newArrayList(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | for (int i = 1; i < list.size(); i++) { |
| | | Map<Integer, String> oneData = list.get(i); |
| | | ComMngBuildingExcelVO vo = new ComMngBuildingExcelVO(); |
| | | vo.setId(Snowflake.getId()); |
| | | vo.setUseType(oneData.get(1)); |
| | | vo.setBuildType(oneData.get(2)); |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(3)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("街路巷不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setAlley(oneData.get(3)); |
| | | } |
| | | |
| | | vo.setVillageName(oneData.get(4)); |
| | | vo.setDoorNo(oneData.get(5)); |
| | | vo.setName(oneData.get(6)); |
| | | try { |
| | | vo.setUnitTotal(oneData.get(7) == null ? 0 : Integer.valueOf(oneData.get(7))); |
| | | } catch (Exception e) { |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(5)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("门牌号不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setDoorNo(oneData.get(5)); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(5)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("楼栋号不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setName(oneData.get(6)); |
| | | } |
| | | |
| | | try { |
| | | vo.setUnitTotal(oneData.get(7) == null ? 0 : Integer.valueOf(oneData.get(7))); |
| | | } catch (Exception e1) { |
| | | vo.setUnitTotal(0); |
| | | } |
| | | try { |
| | | vo.setBuildFloorSum(oneData.get(8) == null ? 0 : Integer.valueOf(oneData.get(8))); |
| | | } catch (Exception e1) { |
| | | vo.setBuildFloorSum(0); |
| | | } |
| | | |
| | | |
| | | try { |
| | | vo.setEveryFloorSum(oneData.get(9) == null ? 0 : Integer.valueOf(oneData.get(9))); |
| | | } catch (Exception e1) { |
| | | vo.setEveryFloorSum(0); |
| | | } |
| | | |
| | | try { |
| | | vo.setBuildUserSum(oneData.get(10) == null ? 0 : Integer.valueOf(oneData.get(10))); |
| | | } catch (Exception e1) { |
| | | vo.setBuildUserSum(0); |
| | | } |
| | | try { |
| | | vo.setElevatorTotal(oneData.get(11) == null ? 0 : Integer.valueOf(oneData.get(11))); |
| | | } catch (Exception e1) { |
| | | vo.setElevatorTotal(0); |
| | | } |
| | | |
| | | vo.setPropertyCompanyName(oneData.get(12)); |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | vo.setBuildDate(sdf.parse(oneData.get(13))); |
| | | } catch (Exception e1) { |
| | | |
| | | } |
| | | vo.setRemark(oneData.get(14)); |
| | | vo.setGridId(oneData.get(15)); |
| | | vo.setGridName(oneData.get(15)); |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | |
| | | R r = communityService.listSaveBuildingExcelVO(voList, communityId); |
| | | if (!R.isOk(r)) { |
| | | String errMsg = r.getMsg(); |
| | | List<ComMngPopulationImportErrorVO> errorList = JSON.parseArray(errMsg, ComMngPopulationImportErrorVO.class); |
| | | if (!errorList.isEmpty()) { |
| | | populationImportErrorVOList.addAll(errorList); |
| | | } |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } else { |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }catch (NumberFormatException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.constants.BcDictionaryConstants; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * 不是固定的列只能手动处理 |
| | | */ |
| | | private void saveData() { |
| | | R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); |
| | | |
| | | Map<String,String> dictMap = dictionaryR.getData().stream().collect(Collectors.toMap(BcDictionaryVO::getDictName,BcDictionaryVO::getDictValue)); |
| | | // Map<String,Integer> dictMap = new HashMap<>(); |
| | | // for(BcDictionaryVO vo : dictionaryR.getData()){ |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationServeExcelVO> voList = Lists.newArrayList(); |
| | |
| | | vo.setName(oneData.get(0)); |
| | | if(StringUtils.isEmpty(oneData.get(1))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"+oneData.get(1)); |
| | | importErrorVO.setErrorMsg("身份证号不可为空,请填写身份证号"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | |
| | | //判断身份证号码位数 |
| | | if(oneData.get(1).length() != 18){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"+oneData.get(1)); |
| | | importErrorVO.setErrorMsg("身份证号位数有误,请检查身份证号码是否正确"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(2))){ |
| | | String nation = oneData.get(2); |
| | | if(!nation.contains("族")){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第3列"); |
| | | importErrorVO.setErrorMsg("您填写的民族格式有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | // String nation = oneData.get(2); |
| | | // if(!nation.contains("族")){ |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第3列"); |
| | | // importErrorVO.setErrorMsg("您填写的民族格式有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | vo.setNation(oneData.get(2)); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(3))){ |
| | | Integer isOk = PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第4列"); |
| | | importErrorVO.setErrorMsg("您填写的政治面貌有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setPoliticalOutlook(isOk); |
| | | vo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3))); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(4))){ |
| | | Integer isOk = PopulIsOkEnum.getCodeByName(oneData.get(4)); |
| | | Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(4)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第5列"); |
| | |
| | | vo.setIsRent(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(5))){ |
| | | Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(5)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第6列"); |
| | | importErrorVO.setErrorMsg("您填写的与户主关系有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | |
| | | String ra = convertRelation(oneData.get(5)); |
| | | |
| | | String relation = dictMap.get(ra); |
| | | if(StringUtils.isEmpty(relation)){ |
| | | vo.setRelationStr(ra); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第6列"); |
| | | // importErrorVO.setErrorMsg("您填写的与户主关系有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | }else{ |
| | | vo.setRelation(Integer.valueOf(relation)); |
| | | } |
| | | vo.setRelation(isOk); |
| | | |
| | | } |
| | | if(StringUtils.isEmpty(oneData.get(6))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | |
| | | } |
| | | vo.setHouseNo(oneData.get(10).trim()); |
| | | if(StringUtils.isNotEmpty(oneData.get(11))){ |
| | | vo.setPhone(oneData.get(11).trim()); |
| | | vo.setBuildPurpose(oneData.get(11).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(12))){ |
| | | vo.setNativePlace(oneData.get(12).trim()); |
| | | vo.setBuildArea(oneData.get(12).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(13))){ |
| | | Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(13)); |
| | | Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(13).trim()); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第14列"); |
| | | importErrorVO.setErrorMsg("您填写的文化程度有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setCultureLevel(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(14))){ |
| | | Integer isOk = PopulMarriageEnum.getCodeByName(oneData.get(14)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第14列"); |
| | | importErrorVO.setErrorMsg("您填写的婚姻状况有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setMarriage(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(15))){ |
| | | vo.setHealthy(oneData.get(15).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(16))){ |
| | | vo.setWorkCompany(oneData.get(16).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(17))){ |
| | | vo.setRemark(oneData.get(17).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(18))){ |
| | | vo.setCensusRegister(oneData.get(18).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(19))){ |
| | | Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(19)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第20列"); |
| | | importErrorVO.setErrorMsg("您填写的外地or本地有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setOutOrLocal(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(20))){ |
| | | Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(20)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第21列"); |
| | | importErrorVO.setErrorMsg("您填写的房屋状态有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | |
| | | } |
| | | vo.setHouseStatus(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(21))){ |
| | | Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(21)); |
| | | if(StringUtils.isNotEmpty(oneData.get(14))){ |
| | | Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim()); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第22列"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第15列"); |
| | | importErrorVO.setErrorMsg("您填写的房屋用途有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setHousePurpose(isOk); |
| | | vo.setHousePurpose(PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim())); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(22))){ |
| | | Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(22)); |
| | | if(StringUtils.isNotEmpty(oneData.get(15))){ |
| | | Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(15)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第23列"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第16列"); |
| | | importErrorVO.setErrorMsg("您填写的管控状态有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setControlStatus(isOk); |
| | | vo.setHouseStatus(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(23))){ |
| | | Integer isOk = PopulIsOksEnum.getCodeByName(oneData.get(23)); |
| | | |
| | | if(StringUtils.isNotEmpty(oneData.get(16))){ |
| | | vo.setPhone(oneData.get(16).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(17))){ |
| | | vo.setNativePlace(oneData.get(17).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(18))){ |
| | | vo.setCultureLevel(PopulCultureLevelEnum.getCodeByName(oneData.get(18))); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(19))){ |
| | | String ma = convertMarriage(oneData.get(19)); |
| | | Integer isOk = PopulMarriageEnum.getCodeByName(ma); |
| | | if(isOk.equals(-1)){ |
| | | vo.setMarriageStr(ma); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第20列"); |
| | | // importErrorVO.setErrorMsg("您填写的婚姻状况有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | }else{ |
| | | vo.setMarriage(isOk); |
| | | } |
| | | |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(20))){ |
| | | vo.setHealthy(oneData.get(20).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(21))){ |
| | | vo.setWorkCompany(oneData.get(21).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(22))){ |
| | | Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(22)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第23列"); |
| | | importErrorVO.setErrorMsg("您填写的是否是居住地有误"); |
| | | importErrorVO.setErrorMsg("您填写的外地or本地有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setIsResidence(isOk); |
| | | vo.setOutOrLocal(isOk); |
| | | } |
| | | for (int i = 24; i < headSize; i++) { |
| | | if(StringUtils.isNotEmpty(oneData.get(23))){ |
| | | vo.setCensusRegister(oneData.get(23).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(24))){ |
| | | vo.setRemark(oneData.get(24).trim()); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(oneData.get(25))){ |
| | | vo.setIdCardPositive(oneData.get(25).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(26))){ |
| | | vo.setIdCardBack(oneData.get(26).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(27))){ |
| | | vo.setHouseHold(oneData.get(27).trim()); |
| | | } |
| | | for (int i = 28; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
| | |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | } |
| | | |
| | | private String convertMarriage(String ma) { |
| | | |
| | | if(Objects.equals("已",ma) || Objects.equals("一",ma)){ |
| | | ma = "已婚"; |
| | | }else if(Objects.equals("未",ma) || Objects.equals("未婚婚",ma)){ |
| | | ma = "未婚"; |
| | | }else if(Objects.equals("初",ma)){ |
| | | ma = "初婚"; |
| | | }else if(Objects.equals("再",ma)){ |
| | | ma = "再婚"; |
| | | }else if(Objects.equals("复",ma)){ |
| | | ma = "复婚"; |
| | | }else if(Objects.equals("丧",ma) || Objects.equals("丧偶偶",ma)){ |
| | | ma = "丧偶"; |
| | | }else if(Objects.equals("离",ma) || Objects.equals("离异",ma) || Objects.equals("离异婚",ma)){ |
| | | ma = "离婚"; |
| | | }else if(Objects.equals("分",ma)){ |
| | | ma = "分居"; |
| | | } |
| | | |
| | | return ma; |
| | | } |
| | | |
| | | private String convertRelation(String ra) { |
| | | if(ra.contains("户主")){ |
| | | ra = "户主"; |
| | | }else if(Objects.equals(ra,"女儿")){ |
| | | ra = "女"; |
| | | }else if(Objects.equals(ra,"儿子") || Objects.equals(ra,"儿")){ |
| | | ra = "子"; |
| | | }else if(Objects.equals(ra,"大女")){ |
| | | ra = "长女"; |
| | | }else if(Objects.equals(ra,"二女") || Objects.equals(ra,"此女")){ |
| | | ra = "次女"; |
| | | }else if(Objects.equals(ra,"二子")){ |
| | | ra = "次子"; |
| | | }else if(Objects.equals(ra,"长男") || ra.contains("长子")){ |
| | | ra = "长子"; |
| | | }else if(Objects.equals(ra,"非亲属") || ra.contains("女友") || ra.contains("女朋友") |
| | | || ra.contains("男友") || ra.contains("男朋友")){ |
| | | ra = "其他"; |
| | | }else if(Objects.equals(ra,"姐")){ |
| | | ra = "姐姐"; |
| | | }else if(Objects.equals(ra,"户主")){ |
| | | ra = "本人"; |
| | | }else if(Objects.equals(ra,"妻子") || Objects.equals(ra,"媳妇")){ |
| | | ra = "妻"; |
| | | }else if(Objects.equals(ra,"哥") || Objects.equals(ra,"哥哥")){ |
| | | ra = "兄"; |
| | | }else if(Objects.equals(ra,"丈夫")){ |
| | | ra = "夫"; |
| | | }else if(Objects.equals(ra,"丈母娘")){ |
| | | ra = "岳母"; |
| | | }else if(Objects.equals(ra,"继子") || Objects.equals(ra,"养子")){ |
| | | ra = "养子或继子"; |
| | | }else if(Objects.equals(ra,"继女") || Objects.equals(ra,"养女")){ |
| | | ra = "养女或继女"; |
| | | }else if(ra.contains("儿媳")||ra.contains("长媳")){ |
| | | ra = "儿媳"; |
| | | }else if(Objects.equals(ra,"三姨") || Objects.equals(ra,"姨姨")){ |
| | | ra = "姨母"; |
| | | }else if(Objects.equals(ra,"二外孙女")){ |
| | | ra = "外孙女"; |
| | | }else if(Objects.equals(ra,"外孙")){ |
| | | ra = "外孙子"; |
| | | }else if(Objects.equals(ra,"侄儿")){ |
| | | ra = "侄子"; |
| | | }else if(ra.contains("表")){ |
| | | ra = "表兄弟、表姐妹"; |
| | | }else if(Objects.equals(ra,"继父") || Objects.equals(ra,"养父")){ |
| | | ra = "继父或养父"; |
| | | }else if(Objects.equals(ra,"父")){ |
| | | ra = "父亲"; |
| | | }else if(Objects.equals(ra,"弟弟")){ |
| | | ra = "弟"; |
| | | }else if(Objects.equals(ra,"孙")){ |
| | | ra = "孙子"; |
| | | }else if(Objects.equals(ra,"孙媳妇") || Objects.equals(ra,"外孙媳妇")){ |
| | | ra = "孙媳妇或外孙媳妇"; |
| | | }else if(Objects.equals(ra,"妹")){ |
| | | ra = "妹妹"; |
| | | }else if(Objects.equals(ra,"祖父母")){ |
| | | ra = "祖父母或外祖父母"; |
| | | }else if(Objects.equals(ra,"姐妹") || Objects.equals(ra,"兄弟")){ |
| | | ra = "兄弟姐妹"; |
| | | }else if(Objects.equals(ra,"其他姐妹") || Objects.equals(ra,"其他兄弟")){ |
| | | ra = "其他兄弟姐妹"; |
| | | }else if(Objects.equals(ra,"奶奶")){ |
| | | ra = "祖母"; |
| | | }else if(Objects.equals(ra,"爷爷")){ |
| | | ra = "祖父"; |
| | | }else if(Objects.equals(ra,"爷爷")){ |
| | | ra = "祖父"; |
| | | }else if(ra.contains("堂")){ |
| | | ra = "堂兄弟、堂姐妹"; |
| | | } |
| | | |
| | | return ra; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | private CommunityService communityService; |
| | | |
| | | private Long communityId; |
| | | private LoginUserInfoVO loginUserInfo ; |
| | | |
| | | public ComMngVillageServeExcelListen(CommunityService communityService, Long communityId) { |
| | | public ComMngVillageServeExcelListen(CommunityService communityService, LoginUserInfoVO loginUserInfo) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | this.loginUserInfo = loginUserInfo; |
| | | } |
| | | |
| | | |
| | |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if (list.size() >= BATCH_COUNT) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | R r = communityService.listSaveVillageServeExcelVO(list, this.communityId); |
| | | list.forEach(villageServe->{ |
| | | villageServe.setVillageId(Snowflake.getId()); |
| | | villageServe.setCreateAt(new Date()); |
| | | }); |
| | | R r = communityService.listSaveVillageServeExcelVO(list, loginUserInfo.getCommunityId()); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | //确保最后遗留的数据保存在数据库中 |
| | | R r = this.communityService.listSaveVillageServeExcelVO(list, this.communityId); |
| | | list.forEach(villageServe->{ |
| | | villageServe.setVillageId(Snowflake.getId()); |
| | | villageServe.setCreateAt(new Date()); |
| | | }); |
| | | R r = this.communityService.listSaveVillageServeExcelVO(list, loginUserInfo.getCommunityId()); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 实有人口DTO |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | public class ComMngPopulationTagCardNoDTO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value="身份证") |
| | | private String cardNo; |
| | | |
| | | /** |
| | | * 标签字符串(多个以,隔开) |
| | | */ |
| | | @ApiModelProperty(value="标签字符串") |
| | | private String label; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Description 重点人员信息 |
| | | * ClassName KeyPersonInfo |
| | | * |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | public class KeyPersonInfoDTO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 街道id |
| | | */ |
| | | private Long streetId; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名(必填项)" ,index = 0) |
| | | private String name; |
| | | /** |
| | | * 性别(取字典表国家编码) |
| | | */ |
| | | private String sex; |
| | | /** |
| | | * 性别名称 |
| | | */ |
| | | @ExcelProperty(value = "性别名称" ,index = 1) |
| | | private String sexName; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @ExcelProperty(value = "身份证号码" ,index = 2) |
| | | private String cardNo; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ExcelProperty(value = "联系方式" ,index = 3) |
| | | private String phone; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ExcelProperty(value = "民族" ,index = 4) |
| | | private String nation; |
| | | /** |
| | | * 户口所在地 |
| | | */ |
| | | @ExcelProperty(value = "户口所在地" ,index = 5) |
| | | private String censusRegister; |
| | | /** |
| | | * 居住地址 |
| | | */ |
| | | @ExcelProperty(value = "居住地址" ,index = 6) |
| | | private String address; |
| | | /** |
| | | * 地址精度纬度信息(逗号隔开) |
| | | */ |
| | | @ExcelProperty(value = "地址精度纬度信息(逗号隔开)" ,index = 7) |
| | | private String visiterAddressLatLng; |
| | | /** |
| | | * 人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员 |
| | | */ |
| | | @ExcelProperty(value = "人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员" ,index = 8) |
| | | private String visiterType; |
| | | /** |
| | | * (法轮功类填写)基本情况 |
| | | */ |
| | | @ExcelProperty(value = "(法轮功类填写)基本情况" ,index = 9) |
| | | private String basicInfo; |
| | | /** |
| | | * 是否有效 |
| | | */ |
| | | @ExcelProperty(value = "是否有效" ,index = 10) |
| | | private Boolean invalid; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注" ,index = 11) |
| | | private String note; |
| | | /** |
| | | * 文化程度(取字典表国家编码)) |
| | | */ |
| | | @ExcelProperty(value = "文化程度" ,index = 12) |
| | | private String cultureLevel; |
| | | /** |
| | | * 经济状态 |
| | | */ |
| | | @ExcelProperty(value = "经济状态" ,index = 13) |
| | | private String economicLevel; |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | /** |
| | | * (精神类人群填写)目前诊断 |
| | | */ |
| | | @ExcelProperty(value = "目前诊断" ,index = 14) |
| | | private String diagnose; |
| | | /** |
| | | * 上报提交时间 |
| | | */ |
| | | private Date submitDate; |
| | | /** |
| | | * (精神类人群填写)监护人名称 |
| | | */ |
| | | @ExcelProperty(value = "监护人名称" ,index = 15) |
| | | private String guardian; |
| | | /** |
| | | * (精神类人群填写)监护人电话 |
| | | */ |
| | | @ExcelProperty(value = "监护人电话" ,index = 16) |
| | | private String guardianPhone; |
| | | /** |
| | | * (精神类人群填写)监护人关系 |
| | | */ |
| | | @ExcelProperty(value = "监护人关系" ,index = 17) |
| | | private String guardianRelation; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | |
| | | private Long actId; |
| | | /** |
| | | * 小区id(实有房屋id) |
| | | */ |
| | | |
| | | private Long villageId; |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/11 16:27 |
| | | */ |
| | | @ApiModel("字典项") |
| | | @Data |
| | | public class BcDictionaryVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "字典项名称") |
| | | private String dictName; |
| | | @ApiModelProperty(value = "字典项值") |
| | | private String dictValue; |
| | | @ApiModelProperty(value = "字典项助记码") |
| | | private String code; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 12:43 |
| | | */ |
| | | @Data |
| | | public class ComMngBuildingExcelVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1719392023800643085L; |
| | | |
| | | private Long id; |
| | | @ExcelProperty(value = "楼房属性", index = 1) |
| | | private String useType; |
| | | @ExcelProperty(value = "建筑类型", index = 2) |
| | | private String buildType; |
| | | |
| | | @ExcelProperty(value = "街路巷", index = 3) |
| | | private String alley; |
| | | |
| | | @ExcelProperty(value = "小区名称", index = 4) |
| | | private String villageName; |
| | | |
| | | @ExcelProperty(value = "门牌号", index = 5) |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "楼栋号/楼栋名称", index = 6) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "单元数", index = 7) |
| | | private Integer unitTotal; |
| | | |
| | | @ExcelProperty(value = "楼层数", index = 8) |
| | | private Integer buildFloorSum; |
| | | |
| | | @ExcelProperty(value = "每层户数", index = 9) |
| | | private Integer everyFloorSum; |
| | | |
| | | @ExcelProperty(value = "总户数", index = 10) |
| | | private Integer buildUserSum; |
| | | |
| | | @ExcelProperty(value = "电梯", index = 11) |
| | | private Integer elevatorTotal; |
| | | |
| | | @ExcelProperty(value = "物业公司名称", index = 12) |
| | | private String propertyCompanyName; |
| | | |
| | | @ExcelProperty(value = "建筑年代", index = 13) |
| | | private Date buildDate; |
| | | |
| | | @ExcelProperty(value = "备注", index = 14) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "网格划分", index = 15) |
| | | private String gridId; |
| | | |
| | | private String gridName; |
| | | } |
| | |
| | | |
| | | @ExcelProperty(value = "与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)", index = 5) |
| | | private Integer relation; |
| | | private String relationStr; |
| | | |
| | | @ExcelProperty(value = "街路巷", index = 6) |
| | | private String road; |
| | | |
| | | @ExcelProperty(value = "门牌号", index = 7) |
| | | @ExcelProperty(value = "小区号", index = 7) |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "楼排号", index = 8) |
| | |
| | | @ExcelProperty(value = "户室(房间号)", index = 10) |
| | | private String houseNo; |
| | | |
| | | @ExcelProperty(value = "联系方式", index = 11) |
| | | private String phone; |
| | | @ExcelProperty(value = "建筑用途", index = 11) |
| | | private String buildPurpose; |
| | | |
| | | @ExcelProperty(value = "籍贯", index = 12) |
| | | private String nativePlace; |
| | | @ExcelProperty(value = "建筑面积", index = 12) |
| | | private String buildArea; |
| | | |
| | | @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 13) |
| | | private Integer cultureLevel; |
| | | |
| | | @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 14) |
| | | private Integer marriage; |
| | | |
| | | @ExcelProperty(value = "健康状况", index = 15) |
| | | private String healthy; |
| | | |
| | | @ExcelProperty(value = "工作单位", index = 16) |
| | | private String workCompany; |
| | | |
| | | @ExcelProperty(value = "备注", index = 17) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "户口所在地", index = 18) |
| | | private String censusRegister; |
| | | |
| | | @ExcelProperty(value = "外地or本地(1.本地 2.外地)", index = 19) |
| | | private Integer outOrLocal; |
| | | |
| | | @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 20) |
| | | @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 13) |
| | | private Integer houseStatus; |
| | | |
| | | @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 21) |
| | | @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 14) |
| | | private Integer housePurpose; |
| | | |
| | | @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 22) |
| | | @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 15) |
| | | private Integer controlStatus; |
| | | |
| | | @ExcelProperty(value = "是否是居住地(1.是 2.否)", index = 23) |
| | | @ExcelProperty(value = "联系方式", index = 16) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "籍贯", index = 17) |
| | | private String nativePlace; |
| | | |
| | | @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 18) |
| | | private Integer cultureLevel; |
| | | |
| | | @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 19) |
| | | private Integer marriage; |
| | | |
| | | private String marriageStr; |
| | | |
| | | @ExcelProperty(value = "健康状况", index = 20) |
| | | private String healthy; |
| | | |
| | | @ExcelProperty(value = "工作单位", index = 21) |
| | | private String workCompany; |
| | | |
| | | @ExcelProperty(value = "外地or本地(1.本地 2.外地)", index = 22) |
| | | private Integer outOrLocal; |
| | | |
| | | @ExcelProperty(value = "户口所在地", index = 23) |
| | | private String censusRegister; |
| | | |
| | | @ExcelProperty(value = "备注", index = 24) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "证件照(人面像)照片", index = 25) |
| | | private String idCardPositive; |
| | | |
| | | @ExcelProperty(value = "证件照(国徽面)照片", index = 26) |
| | | private String idCardBack; |
| | | |
| | | @ExcelProperty(value = "户口本照片", index = 27) |
| | | private String houseHold; |
| | | |
| | | @ExcelProperty(value = "退役军人(是/否)", index = 28) |
| | | private Integer veterans; |
| | | |
| | | @ExcelProperty(value = "残疾人(是/否)", index = 29) |
| | | private Integer disabled; |
| | | |
| | | @ExcelProperty(value = "低保户(是/否)", index = 30) |
| | | private Integer lowIncomeHold; |
| | | |
| | | @ExcelProperty(value = "低收入人员(是/否)", index = 31) |
| | | private Integer lowIncome; |
| | | |
| | | @ExcelProperty(value = "高龄老人(是/否)", index = 32) |
| | | private Integer elder; |
| | | |
| | | @ExcelProperty(value = "特服家庭(是/否)", index = 33) |
| | | private Integer specialFamily; |
| | | |
| | | @ExcelProperty(value = "重点人员(是/否)", index = 34) |
| | | private Integer important; |
| | | |
| | | @ExcelProperty(value = "特殊情况(重大病史/孕)(是/否)", index = 35) |
| | | private Integer specialCase; |
| | | |
| | | private Integer isResidence; |
| | | |
| | | /** |
| | |
| | | @Data |
| | | public class ComMngVillageServeExcelVO implements Serializable { |
| | | /** |
| | | * villageId |
| | | */ |
| | | private Long villageId; |
| | | /** |
| | | * 服务分类 |
| | | */ |
| | | @ExcelProperty(value = "街路巷" ,index = 0) |
| | |
| | | |
| | | @ExcelProperty(value = "小区(组)" ,index = 2) |
| | | private String groupAt; |
| | | /** |
| | | * 小区类型(1.城镇 2.农村 3.未知) |
| | | */ |
| | | @ExcelProperty(value = "小区(组)" ,index = 3) |
| | | private Integer type; |
| | | /**如果是城镇小区填写楼栋数量 */ |
| | | @ExcelProperty(value = "小区(组)" ,index = 4) |
| | | private Integer buildSum; |
| | | /**(城镇)建筑年代*/ |
| | | @ExcelProperty(value = "小区(组)" ,index = 5) |
| | | private Date buildYear; |
| | | /**(城镇)建筑类型*/ |
| | | @ExcelProperty(value = "小区(组)" ,index = 6) |
| | | private Long buildType; |
| | | /**(城镇)是否存在物业公司*/ |
| | | @ExcelProperty(value = "小区(组)" ,index = 7) |
| | | private String property; |
| | | /**(城镇)开发商*/ |
| | | @ExcelProperty(value = "小区(组)" ,index = 8) |
| | | private String developers; |
| | | /**(城镇)小区总共居民数量/这户一共住了几口人*/ |
| | | @ExcelProperty(value = "小区(组)" ,index = 9) |
| | | private Integer userSum; |
| | | private Date createAt; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 18:03 |
| | | */ |
| | | @ApiModel("工作情况汇报详细") |
| | | @Data |
| | | public class ActWorkCountVO { |
| | | |
| | | @ApiModelProperty("名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("数量") |
| | | private Integer num; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 10:17 |
| | | */ |
| | | @ApiModel("轮播信息") |
| | | @Data |
| | | public class CarouselInfoVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -2716493758092750696L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String typeName; |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 11:01 |
| | | */ |
| | | @ApiModel("大屏-人口-社区活动") |
| | | @Data |
| | | public class ComActActivityScreenVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8892577774827785315L; |
| | | |
| | | @ApiModelProperty("微心愿轮播图") |
| | | private List<String> imgs; |
| | | |
| | | @ApiModelProperty("总共发起") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty(value = "本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty(value = "居民活动") |
| | | private Long commonNum; |
| | | |
| | | @ApiModelProperty(value = "居民活动参与人数") |
| | | private Long commonPeopleNum; |
| | | |
| | | @ApiModelProperty(value = "志愿者活动") |
| | | private Long volunteerNum; |
| | | |
| | | @ApiModelProperty(value = "志愿者活动参与人数") |
| | | private Long volunteerPeopleNum; |
| | | |
| | | @ApiModelProperty("活动轮播列表") |
| | | private List<CarouselInfoVO> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 13:16 |
| | | */ |
| | | @ApiModel("大屏-人口-一起议") |
| | | @Data |
| | | public class ComActDiscussScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("总共发起") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty("图文") |
| | | private Long imgNum; |
| | | |
| | | @ApiModelProperty("图文参与人数") |
| | | private Long imgPeopleNum; |
| | | |
| | | @ApiModelProperty("投票") |
| | | private Long voteNum; |
| | | |
| | | @ApiModelProperty("投票参与人数") |
| | | private Long votePeopleNum; |
| | | |
| | | @ApiModelProperty("一起议轮播列表") |
| | | private List<CarouselInfoVO> list; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 16:05 |
| | | */ |
| | | @ApiModel("大屏-人口-随手拍") |
| | | @Data |
| | | public class ComActEasyPhotoScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty("已处理随手拍") |
| | | private List<EasyPhotoPointVO> deal; |
| | | |
| | | @ApiModelProperty("已公示随手拍") |
| | | private List<EasyPhotoPointVO> pub; |
| | | |
| | | @ApiModelProperty("已审核随手拍") |
| | | private List<EasyPhotoPointVO> approved; |
| | | |
| | | @ApiModelProperty("未处理") |
| | | private Long noneDeal; |
| | | |
| | | @ApiModelProperty("公示比例") |
| | | private Long pubPoint; |
| | | |
| | | @ApiModelProperty("平均耗时") |
| | | private Long dealTime; |
| | | |
| | | |
| | | @ApiModelProperty("随手拍线形列表") |
| | | private List<EastPhotoVO> list; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 10:14 |
| | | */ |
| | | @ApiModel("大屏-工作-心愿单") |
| | | @Data |
| | | public class ComActMicroWishScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("微心愿轮播图") |
| | | private List<String> imgs; |
| | | |
| | | @ApiModelProperty(value = "本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty(value = "等待实现") |
| | | private Long willNum; |
| | | |
| | | @ApiModelProperty(value = "累计实现") |
| | | private Long completedNum; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 14:36 |
| | | */ |
| | | @Data |
| | | @ApiModel("大屏-工作-邻里圈") |
| | | public class ComActNeighborCircleScreenVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8407169650740659312L; |
| | | |
| | | @ApiModelProperty(value = "邻里圈图片轮播") |
| | | private List<String> imgs; |
| | | |
| | | @ApiModelProperty(value = "邻里圈轮播列表") |
| | | private List<CarouselInfoVO> list; |
| | | |
| | | @ApiModelProperty(value = "本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty(value = "总发表") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty(value = "点赞量") |
| | | private Long fabulousNum; |
| | | |
| | | @ApiModelProperty(value = "评论量") |
| | | private Long commentNum; |
| | | |
| | | @ApiModelProperty(value = "分享量") |
| | | private Long sharedNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 14:36 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口文化程度统计") |
| | | public class ComActPopulationCultureVO implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "文化程度") |
| | | private String level; |
| | | |
| | | @ApiModelProperty(value = "人口数") |
| | | private Long num; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 14:36 |
| | | */ |
| | | @Data |
| | | @ApiModel("大屏-人口") |
| | | public class ComActPopulationScreenVO implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "总人口数") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty(value = "户籍人口数") |
| | | private Long localNum; |
| | | |
| | | @ApiModelProperty(value = "流动人口数") |
| | | private Long outNum; |
| | | |
| | | @ApiModelProperty(value = "特殊人口数") |
| | | private Long specialNum; |
| | | |
| | | @ApiModelProperty(value = "已使用社区同人口数") |
| | | private Long usedCommunityNum; |
| | | |
| | | @ApiModelProperty(value = "男性数量") |
| | | private Long manNum; |
| | | @ApiModelProperty(value = "男性占比") |
| | | private Integer manPoint; |
| | | |
| | | @ApiModelProperty(value = "女性数量") |
| | | private Long woman; |
| | | @ApiModelProperty(value = "女性占比") |
| | | private Integer womanPoint; |
| | | |
| | | @ApiModelProperty("实有人口年龄结构") |
| | | private List<ComMngPopulationAgeVO> ageGroup; |
| | | |
| | | @ApiModelProperty("实有人口文化程度统计") |
| | | private List<ComActPopulationCultureVO> cultureGroup; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 18:00 |
| | | */ |
| | | @ApiModel("大屏-工作-工作情况汇报") |
| | | @Data |
| | | public class ComActWorkScreenVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 5969567628890256231L; |
| | | |
| | | @ApiModelProperty("平均耗时") |
| | | private String avgTime; |
| | | |
| | | @ApiModelProperty("每天完成") |
| | | private String everyDayNum; |
| | | |
| | | @ApiModelProperty("总完成度") |
| | | private Integer totalCompletedPoint; |
| | | |
| | | @ApiModelProperty("已完成") |
| | | private List<ActWorkCountVO> completetPoint; |
| | | |
| | | @ApiModelProperty("未完成") |
| | | private List<ActWorkCountVO> nonePoint; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 16:42 |
| | | */ |
| | | @Data |
| | | @ApiModel("年龄段结构统计") |
| | | public class ComMngPopulationAgeVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1562369303787355841L; |
| | | |
| | | @ApiModelProperty("年龄段") |
| | | private String group; |
| | | |
| | | @ApiModelProperty("数量") |
| | | private Long num; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 14:38 |
| | | */ |
| | | @ApiModel("大屏-人口-党建工作") |
| | | @Data |
| | | public class ComPbWorkScreenVO implements Serializable { |
| | | |
| | | @ApiModelProperty("总共发起") |
| | | private Long totalNum; |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Long currentNum; |
| | | |
| | | @ApiModelProperty("党建宣传") |
| | | private Long dynNum; |
| | | |
| | | @ApiModelProperty("党员活动") |
| | | private Long activityNum; |
| | | |
| | | @ApiModelProperty("党建工作柱状图列表数据") |
| | | private List<PbWorkVO> list; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("随手拍线型数据") |
| | | public class EastPhotoVO implements Serializable { |
| | | |
| | | @ApiModelProperty("月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("随手拍数量") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty("新增随手拍数量") |
| | | private Long adds; |
| | | |
| | | @ApiModelProperty("处理手拍数量") |
| | | private Long deal; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 16:27 |
| | | */ |
| | | @ApiModel("随手拍线形图") |
| | | @Data |
| | | public class EasyPhotoDataVO { |
| | | |
| | | @ApiModelProperty("月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("随手拍数量") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty("新增随手拍") |
| | | private Long adds; |
| | | |
| | | @ApiModelProperty("处理随手拍") |
| | | private Long deal; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 16:21 |
| | | */ |
| | | @ApiModel("随手拍饼状图") |
| | | @Data |
| | | public class EasyPhotoPointVO { |
| | | |
| | | @ApiModelProperty("类型名") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty("占比") |
| | | private Integer point; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("党建宣传、党员活动") |
| | | public class PbWorkVO implements Serializable { |
| | | |
| | | @ApiModelProperty("月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("党建宣传") |
| | | private Long dyn; |
| | | |
| | | @ApiModelProperty("党员活动") |
| | | private Long activity; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String start; |
| | | @ApiModelProperty(hidden = true) |
| | | private String end; |
| | | } |
| | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("系统预置:1-是 0-否") |
| | | @ApiModelProperty("系统预置:1-是(不可编辑删除) 0-否") |
| | | private Integer sysFlag; |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.*; |
| | | import com.panzhihua.common.model.vos.IPageVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.*; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticAgeGender; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyActivity; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.utlis.ExcelSelectObject; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @PostMapping("/eldersauthelderly/batchSave") |
| | | R listSaveEldersAuthElderlyExcelVO(@RequestBody List<EldersAuthElderlyExcelVO> newVoList,@RequestParam("communityId") Long communityId,@RequestParam("createBy") Long createBy); |
| | | |
| | | /** |
| | | * 批量保存楼栋 |
| | | * @param newVoList |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/building/batchSave") |
| | | R listSaveBuildingExcelVO(@RequestBody List<ComMngBuildingExcelVO> newVoList,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 根据字典key查询字典项 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | @GetMapping("/dictionary/listDictionaryByKey") |
| | | R<List<BcDictionaryVO>> listDictionaryByKey(@RequestParam("key") String key); |
| | | /** |
| | | * 查看高龄老人详情 |
| | | * @param id |
| | |
| | | */ |
| | | @PostMapping("/elders/records/page") |
| | | R pageQueryEldersAuthRecord(@RequestBody PageEldersAuthRecordDTO pageEldersAuthElderlyDTO); |
| | | |
| | | @PostMapping("/key_person/batch/save") |
| | | R saveBatchKeyPerson(@RequestBody List<KeyPersonInfoDTO> list); |
| | | |
| | | @GetMapping("/screen/population/statistic") |
| | | R statistic(@RequestParam("communityId")Long communityId); |
| | | |
| | | /** |
| | | * |
| | |
| | | |
| | | @PostMapping("/elders/getAuthHistoryExport") |
| | | R getAuthHistoryExport(@RequestBody PageEldersAuthHistoryDTO pageEldersAuthElderlyDTO); |
| | | |
| | | @GetMapping("/screen/work/neighborCircle") |
| | | R statisticNeighborCircle(@RequestParam("communityId") Long communityId); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/screen/getScreenCivil") |
| | | R getScreenCivil(@RequestParam("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计邻里圈 |
| | | */ |
| | | @GetMapping("/screen/work/wish") |
| | | R wish(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计社区-活动 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/work/activity") |
| | | R activity(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计一起议 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/work/discuss") |
| | | R discuss(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计党建工作 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/work/pbWork") |
| | | R pbWork(@RequestParam("communityId")Long communityId); |
| | | |
| | | |
| | | /** |
| | | * 大屏统计随手拍 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/work/easyPhoto") |
| | | R easyPhoto(@RequestParam("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计工作情况 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/work/workCount") |
| | | R workCount(@RequestParam("communityId")Long communityId); |
| | | } |
| | |
| | | public static int getAgeFromBirthTime(String birthTimeString) { |
| | | // 先截取到字符串中的年、月、日 |
| | | int selectYear = Integer.parseInt(birthTimeString.substring(0,4)); |
| | | int selectMonth = Integer.parseInt(birthTimeString.substring(5,7)); |
| | | int selectDay = Integer.parseInt(birthTimeString.substring(8)); |
| | | int selectMonth = Integer.parseInt(birthTimeString.substring(4,6)); |
| | | int selectDay = Integer.parseInt(birthTimeString.substring(6,8)); |
| | | // 得到当前时间的年、月、日 |
| | | Calendar cal = Calendar.getInstance(); |
| | | int yearNow = cal.get(Calendar.YEAR); |
| | |
| | | age = age + 1; |
| | | } |
| | | } |
| | | return age; |
| | | return age - 1; |
| | | } |
| | | |
| | | public static int getAgeFromBirthTimes(long birthTimeLong) { |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.esotericsoftware.reflectasm.MethodAccess; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | |
| | | /** |
| | | * 通用情况拷贝 |
| | | * |
| | | * @author tkq |
| | | * @date 14:36 2019/4/10 |
| | | */ |
| | | @Slf4j |
| | | public class CopyUtil { |
| | | private static final Logger logger = LoggerFactory.getLogger(CopyUtil.class); |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | private static Map<Class, MethodAccess> methodMap = new ConcurrentHashMap<>(); |
| | | |
| | | private static Map<String, Integer> methodIndexMap = new ConcurrentHashMap<>(); |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | private static Map<Class, List<String>> fieldMap = new ConcurrentHashMap<>(); |
| | | |
| | | private CopyUtil() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * <p>对数组进行拷贝 </p> |
| | | * |
| | | * @author tkq |
| | | * @date 2018年12月19日 |
| | | */ |
| | | public static <T> List<T> copyList(List<?> desc, Class<T> targetClass) { |
| | | if (desc == null) { |
| | | return new ArrayList<>(); |
| | | } |
| | | if (desc.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | //创建返回对象 |
| | | List<T> targetList = new ArrayList<>(desc.size()); |
| | | for (Object des : desc) { |
| | | if (null != des) { |
| | | try { |
| | | T newInstance = targetClass.newInstance(); |
| | | copyProperties(des, newInstance); |
| | | targetList.add(newInstance); |
| | | } catch (InstantiationException | IllegalAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | | return targetList; |
| | | } |
| | | |
| | | /** |
| | | * <p>对数组进行拷贝 </p> |
| | | * |
| | | * @author manailin |
| | | * @date 2018年12月19日 |
| | | */ |
| | | public static <T> List<T> beanCopyList(List<?> desc, Class<T> targetClass) { |
| | | if (desc == null) { |
| | | return new ArrayList<>(); |
| | | } |
| | | if (desc.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | //创建返回对象 |
| | | List<T> targetList = new ArrayList<>(desc.size()); |
| | | for (Object des : desc) { |
| | | if (null != des) { |
| | | try { |
| | | T newInstance = targetClass.newInstance(); |
| | | BeanUtil.copyProperties(des, newInstance); |
| | | targetList.add(newInstance); |
| | | } catch (InstantiationException | IllegalAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | | return targetList; |
| | | } |
| | | |
| | | /** |
| | | * @Title: |
| | | * @Description: 根据目标对象类型进行拷贝 |
| | | * @author tkq |
| | | * @date:2019/1/2 |
| | | * @Copyright: 2018 All rights reserved. 注意:禁止外泄以及用于其他的商业目 |
| | | */ |
| | | public static <T> T copyPropertiesByClass(Object desc, Class<T> targetClass) { |
| | | if (desc != null) { |
| | | try { |
| | | T newInstance = targetClass.newInstance(); |
| | | copyProperties(desc, newInstance); |
| | | return newInstance; |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 进行复制方法 |
| | | * |
| | | * @param dataSource 源目标对象 |
| | | * @param target 目标对象 |
| | | * @author tkq |
| | | * @date 14:37 2019-11-13 |
| | | */ |
| | | public static void copyProperties(Object dataSource, Object target) { |
| | | if (target == null) { |
| | | return; |
| | | } |
| | | if (dataSource == null) { |
| | | return; |
| | | } |
| | | MethodAccess descMethodAccess = methodMap.get(target.getClass()); |
| | | if (descMethodAccess == null) { |
| | | descMethodAccess = cache(target); |
| | | } |
| | | MethodAccess orgiMethodAccess = methodMap.get(dataSource.getClass()); |
| | | if (orgiMethodAccess == null) { |
| | | orgiMethodAccess = cache(dataSource); |
| | | } |
| | | |
| | | List<String> fieldList = fieldMap.get(dataSource.getClass()); |
| | | for (String field : fieldList) { |
| | | String getKey = dataSource.getClass().getName() + "." + "get" + field; |
| | | String setkey = target.getClass().getName() + "." + "set" + field; |
| | | Integer setIndex = methodIndexMap.get(setkey); |
| | | if (setIndex != null) { |
| | | int getIndex = methodIndexMap.get(getKey); |
| | | // 参数一需要反射的对象 |
| | | // 参数二class.getDeclaredMethods 对应方法的index |
| | | // 参数对三象集合 |
| | | try { |
| | | descMethodAccess.invoke(target, setIndex.intValue(), orgiMethodAccess.invoke(dataSource, getIndex)); |
| | | } catch (Exception e) { |
| | | log.info("field:" + field); |
| | | throw e; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 单例模式 |
| | | * |
| | | * @param object 实体对象 |
| | | * @return MethodAccess |
| | | * @author tkq |
| | | * @date 14:36 2019/4/10 |
| | | */ |
| | | private static MethodAccess cache(Object object) { |
| | | Class<?> name = object.getClass(); |
| | | synchronized (name) { |
| | | MethodAccess methodAccess = MethodAccess.get(name); |
| | | Class<?> className = object.getClass(); |
| | | Set<Field> fields =new HashSet<>(); |
| | | for(;className != Object.class ; className = className.getSuperclass()) { |
| | | fields.addAll(Arrays.asList(className.getDeclaredFields())); |
| | | } |
| | | List<String> fieldList = new ArrayList<>(fields.size()); |
| | | for (Field field : fields) { |
| | | // 是否是私有的,是否是静态的 |
| | | if (Modifier.isPrivate(field.getModifiers()) && !Modifier.isStatic(field.getModifiers())) { |
| | | // 非公共私有变量 |
| | | // 获取属性名称 |
| | | String fieldName = StringUtils.capitalize(field.getName()); |
| | | // 获取get方法的下标 |
| | | int getIndex = methodAccess.getIndex("get" + fieldName); |
| | | // 获取set方法的下标 |
| | | int setIndex = methodAccess.getIndex("set" + fieldName); |
| | | // 将类名get方法名,方法下标注册到map中 |
| | | methodIndexMap.put(object.getClass().getName() + "." + "get" + fieldName, getIndex); |
| | | // 将类名set方法名,方法下标注册到map中 |
| | | methodIndexMap.put(object.getClass().getName() + "." + "set" + fieldName, setIndex); |
| | | // 将属性名称放入集合里 |
| | | fieldList.add(fieldName); |
| | | } |
| | | } |
| | | // 将类名,属性名称注册到map中 |
| | | fieldMap.put(name, fieldList); |
| | | methodMap.put(name, methodAccess); |
| | | return methodAccess; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 复制属性 |
| | | * @param source 源数据 |
| | | * @param targetClass 目标对象类型 |
| | | * @return |
| | | * @author weifei |
| | | * @date 2020/8/20 10:38 |
| | | */ |
| | | public static <T,K> K copyProperties(T source,Class<K> targetClass){ |
| | | if(source == null || targetClass == null){ |
| | | return null; |
| | | } |
| | | //创建对象 |
| | | try { |
| | | K k = targetClass.newInstance(); |
| | | //复制对象 |
| | | BeanUtils.copyProperties(source,k); |
| | | return k; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 复制属性 |
| | | * @param source 源数据 |
| | | * @param targetClass 目标对象类型 |
| | | * @return |
| | | * @author weifei |
| | | * @date 2020/12/16 10:12 |
| | | */ |
| | | public static <T,K> List<K> copyProperties(List<T> source,Class<K> targetClass){ |
| | | if(source == null || targetClass == null){ |
| | | return null; |
| | | } |
| | | List<K> returnValue = new ArrayList<>(); |
| | | try { |
| | | source.forEach(s -> { |
| | | K k = copyProperties(s, targetClass); |
| | | if(k != null){ |
| | | returnValue.add(k); |
| | | } |
| | | }); |
| | | }catch (Exception e){ |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | return returnValue; |
| | | } |
| | | |
| | | /** |
| | | * @description 深度复制对象 |
| | | * @param source 元数据 |
| | | * @param targetClass 目标对象类型 |
| | | * @return |
| | | * @author weifei |
| | | * @date 2021/3/1 14:21 |
| | | */ |
| | | public static <T,K> K deepCopyObject(T source,Class<K> targetClass){ |
| | | if(source == null || targetClass == null){ |
| | | return null; |
| | | } |
| | | return JSONObject.parseObject(JSONObject.toJSONBytes(source),targetClass); |
| | | } |
| | | |
| | | /** |
| | | * @description 深度复制list对象 |
| | | * @param source 元数据 |
| | | * @param targetClass 目标对象类型 |
| | | * @return |
| | | * @author weifei |
| | | * @date 2021/3/1 14:26 |
| | | */ |
| | | public static <T,K> List<K> deepCopyListObject(List<T> source,Class<K> targetClass){ |
| | | if(source == null || targetClass == null){ |
| | | return null; |
| | | } |
| | | return JSONObject.parseArray(JSONObject.toJSONString(source),targetClass); |
| | | } |
| | | } |
| | |
| | | return cal.getTime(); |
| | | } |
| | | |
| | | public static Date getDateM(Date start, int min) { |
| | | Calendar date1 = Calendar.getInstance(); |
| | | date1.setTime(start); |
| | | date1.add(12, min); |
| | | return date1.getTime(); |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import org.apache.poi.hssf.usermodel.DVConstraint; |
| | | import org.apache.poi.hssf.usermodel.HSSFDataValidation; |
| | | import org.apache.poi.ss.usermodel.Name; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | |
| | | public final class ExcelSelectListUtil { |
| | | private ExcelSelectListUtil() { |
| | | throw new IllegalStateException("Utility class"); |
| | | } |
| | | /** |
| | | * firstRow 開始行號 根据此项目,默认为2(下标0开始) |
| | | * lastRow 根据此项目,默认为最大65535 |
| | | * firstCol 区域中第一个单元格的列号 (下标0开始) |
| | | * lastCol 区域中最后一个单元格的列号 |
| | | * strings 下拉内容 |
| | | * */ |
| | | public static void selectList(Workbook workbook, int firstCol, int lastCol, String[] strings){ |
| | | int charLenth = stringArrayLength(strings); |
| | | int arraylLenth=strings.length; |
| | | if(charLenth+arraylLenth>=255){ |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | //解决下拉超过255个字符的问题 |
| | | String hiddenSheet="hidden"+firstCol; |
| | | Sheet category1Hidden = workbook.createSheet(hiddenSheet); |
| | | for (int i = 0, length = strings.length; i < length; i++) { |
| | | // 循环赋值(为了防止下拉框的行数与隐藏域的行数相对应来获取>=选中行数的数组,将隐藏域加到结束行之后) |
| | | category1Hidden.createRow(i).createCell(0).setCellValue(strings[i]); |
| | | } |
| | | Name category1Name = workbook.createName(); |
| | | category1Name.setNameName(hiddenSheet); |
| | | category1Name.setRefersToFormula(hiddenSheet+"!$A$1:$A$" + strings.length); |
| | | // A1:A代表隐藏域创建第?列createCell(?)时。以A1列开始A行数据获取下拉数组 |
| | | // 生成下拉列表 |
| | | // 只对(x,x)单元格有效 |
| | | CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(2, 65535, firstCol, lastCol); |
| | | // 生成下拉框内容 |
| | | DVConstraint dvConstraint = DVConstraint.createFormulaListConstraint(hiddenSheet); |
| | | HSSFDataValidation dataValidation = new HSSFDataValidation(cellRangeAddressList, dvConstraint); |
| | | // 对sheet页生效 |
| | | workbook.setSheetHidden(1,true); |
| | | sheet.addValidationData(dataValidation); |
| | | }else{ |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | // 生成下拉列表 |
| | | // 只对(x,x)单元格有效 |
| | | CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(2, 65535, firstCol, lastCol); |
| | | // 生成下拉框内容 |
| | | DVConstraint dvConstraint = DVConstraint.createExplicitListConstraint(strings); |
| | | HSSFDataValidation dataValidation = new HSSFDataValidation(cellRangeAddressList, dvConstraint); |
| | | // 对sheet页生效 |
| | | sheet.addValidationData(dataValidation); |
| | | } |
| | | } |
| | | |
| | | private static int stringArrayLength(String[] args){ |
| | | int rs=0; |
| | | for( int i=0 ; i<args.length ; i++ ){ |
| | | rs+=args[i].length(); |
| | | } |
| | | return rs; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * description ExcelSelectObject Excel 下拉类别传递对象 |
| | | * |
| | | * @author manailin |
| | | * @date 2019/7/10 10:03 |
| | | */ |
| | | @Data |
| | | public class ExcelSelectObject { |
| | | |
| | | /** |
| | | * firstCol 区域中第一个单元格的列号 (下标0开始) |
| | | */ |
| | | private int firstCol; |
| | | /** |
| | | * lastCol 区域中最后一个单元格的列号 |
| | | */ |
| | | private int lastCol; |
| | | /** |
| | | * strings 下拉内容 |
| | | */ |
| | | private String[] strings; |
| | | |
| | | public ExcelSelectObject(final int firstCol, final int lastCol, final String[] strings) { |
| | | this.firstCol = firstCol; |
| | | this.lastCol = lastCol; |
| | | this.strings = strings; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.ExcelImportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.afterturn.easypoi.excel.entity.ImportParams; |
| | | import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Excel工具类 |
| | | * |
| | | * @author manailin |
| | | * @date 2019/1/6 |
| | | */ |
| | | @Slf4j |
| | | public class ExcelUtil { |
| | | private ExcelUtil() { |
| | | throw new IllegalStateException("Utility class"); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * |
| | | * @param list 数据列表 |
| | | * @param title 标题 |
| | | * @param sheetName sheet名称 |
| | | * @param pojoClass 元素类型 |
| | | * @param fileName 文件名 |
| | | * @param isCreateHeader 是否创建列头 |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName |
| | | , boolean isCreateHeader, HttpServletResponse response) throws IOException { |
| | | ExportParams exportParams = new ExportParams(title, sheetName); |
| | | exportParams.setCreateHeadRows(isCreateHeader); |
| | | defaultExport(list, pojoClass, fileName, response, exportParams); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | * |
| | | * @param list 数据列表 |
| | | * @param title 标题 |
| | | * @param sheetName sheet名称 |
| | | * @param pojoClass 元素类型 |
| | | * @param fileName 文件名 |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName |
| | | , HttpServletResponse response) throws IOException { |
| | | defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName)); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel 带下拉列表的 |
| | | * |
| | | * @param list 数据列表 |
| | | * @param title 标题 |
| | | * @param sheetName sheet名称 |
| | | * @param pojoClass 元素类型 |
| | | * @param fileName 文件名 |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | public static void exportExcelForSelectList(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName |
| | | , List<ExcelSelectObject> selectListObject, HttpServletResponse response) throws IOException { |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, sheetName), pojoClass, list); |
| | | //这里是自己加的 带下拉框的代码 |
| | | selectListObject.forEach(selectList -> |
| | | ExcelSelectListUtil.selectList(workbook, selectList.getFirstCol(), selectList.getLastCol(),selectList.getStrings()) |
| | | ); |
| | | for(int i=2;i<selectListObject.size();i++) { |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | Row row = sheet.createRow(i); |
| | | CellStyle style = workbook.createCellStyle(); |
| | | DataFormat format = workbook.createDataFormat(); |
| | | style.setDataFormat(format.getFormat("@")); |
| | | row.setRowStyle(style); |
| | | } |
| | | if (workbook != null) { |
| | | downLoadExcel(fileName, response, workbook); |
| | | } |
| | | } |
| | | /** |
| | | * 导出 |
| | | * |
| | | * @param list 数据列表(元素是Map) |
| | | * @param fileName 文件名 |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException { |
| | | defaultExport(list, fileName, response); |
| | | } |
| | | |
| | | private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName |
| | | , HttpServletResponse response, ExportParams exportParams) throws IOException { |
| | | Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list); |
| | | if (workbook != null) { |
| | | downLoadExcel(fileName, response, workbook); |
| | | } |
| | | } |
| | | |
| | | private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException { |
| | | Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.XSSF); |
| | | if (workbook != null) { |
| | | downLoadExcel(fileName, response, workbook); |
| | | } |
| | | } |
| | | |
| | | private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException { |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("content-Type", "application/vnd.ms-excel"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
| | | workbook.write(response.getOutputStream()); |
| | | } |
| | | |
| | | public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) { |
| | | if (StringUtils.isBlank(filePath)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | ImportParams params = new ImportParams(); |
| | | params.setTitleRows(titleRows); |
| | | params.setHeadRows(headerRows); |
| | | return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params); |
| | | } |
| | | |
| | | public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws Exception { |
| | | if (file == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | | ImportParams params = new ImportParams(); |
| | | params.setTitleRows(titleRows); |
| | | params.setHeadRows(headerRows); |
| | | return ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 15:29 |
| | | */ |
| | | public class Snowflake { |
| | | public static long getId(){ |
| | | cn.hutool.core.lang.Snowflake snowflake = IdUtil.getSnowflake(1, 1); |
| | | long id = snowflake.nextId(); |
| | | return id; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | public class ValidableList<E> implements List<E> { |
| | | |
| | | @Valid |
| | | private List<E> list = new LinkedList<>(); |
| | | |
| | | @Override |
| | | public int size() { |
| | | return list.size(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isEmpty() { |
| | | return list.isEmpty(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean contains(Object o) { |
| | | return list.contains(o); |
| | | } |
| | | |
| | | @Override |
| | | public Iterator<E> iterator() { |
| | | return list.iterator(); |
| | | } |
| | | |
| | | @Override |
| | | public Object[] toArray() { |
| | | return list.toArray(); |
| | | } |
| | | |
| | | @Override |
| | | public <T> T[] toArray(T[] a) { |
| | | return list.toArray(a); |
| | | } |
| | | |
| | | @Override |
| | | public boolean add(E e) { |
| | | return list.add(e); |
| | | } |
| | | |
| | | @Override |
| | | public boolean remove(Object o) { |
| | | return list.remove(o); |
| | | } |
| | | |
| | | @Override |
| | | public boolean containsAll(Collection<?> c) { |
| | | return list.containsAll(c); |
| | | } |
| | | |
| | | @Override |
| | | public boolean addAll(Collection<? extends E> c) { |
| | | return list.addAll(c); |
| | | } |
| | | |
| | | @Override |
| | | public boolean addAll(int index, Collection<? extends E> c) { |
| | | return list.addAll(index, c); |
| | | } |
| | | |
| | | @Override |
| | | public boolean removeAll(Collection<?> c) { |
| | | return list.removeAll(c); |
| | | } |
| | | |
| | | @Override |
| | | public boolean retainAll(Collection<?> c) { |
| | | return list.retainAll(c); |
| | | } |
| | | |
| | | @Override |
| | | public void clear() { |
| | | list.clear(); |
| | | } |
| | | |
| | | @Override |
| | | public E get(int index) { |
| | | return list.get(index); |
| | | } |
| | | |
| | | @Override |
| | | public E set(int index, E element) { |
| | | return list.set(index, element); |
| | | } |
| | | |
| | | @Override |
| | | public void add(int index, E element) { |
| | | list.add(index, element); |
| | | } |
| | | |
| | | @Override |
| | | public E remove(int index) { |
| | | return list.remove(index); |
| | | } |
| | | |
| | | @Override |
| | | public int indexOf(Object o) { |
| | | return list.indexOf(o); |
| | | } |
| | | |
| | | @Override |
| | | public int lastIndexOf(Object o) { |
| | | return list.lastIndexOf(o); |
| | | } |
| | | |
| | | @Override |
| | | public ListIterator<E> listIterator() { |
| | | return list.listIterator(); |
| | | } |
| | | |
| | | @Override |
| | | public ListIterator<E> listIterator(int index) { |
| | | return list.listIterator(index); |
| | | } |
| | | |
| | | @Override |
| | | public List<E> subList(int fromIndex, int toIndex) { |
| | | return list.subList(fromIndex, toIndex); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComMngBuildingExcelListen; |
| | | import com.panzhihua.common.listen.ComMngPopulationServeExcelListen; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 12:34 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区管理"}) |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | public class BuildingApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "excel导入楼栋信息") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // String fileName = file.getOriginalFilename(); |
| | | // log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | ComMngBuildingExcelListen comMngBuildingExcelListen = new ComMngBuildingExcelListen(communityService, this.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngBuildingExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ExcelSelectObject; |
| | | import com.panzhihua.common.utlis.ExcelUtil; |
| | | import com.panzhihua.community_backstage.biz.KeyPersonBizServiceImpl; |
| | | import com.panzhihua.community_backstage.listen.KeyPersonInfoExcelListen; |
| | | import com.panzhihua.community_backstage.model.dto.KeyPersonExcelExportDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"特殊人群管理API"}) |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class MainMemberApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private KeyPersonBizServiceImpl keyPersonBizService; |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * |
| | | * @param file 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping(value = "mainMember/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R importExcl(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | EasyExcel.read(inputStream, KeyPersonInfoDTO.class, new KeyPersonInfoExcelListen(communityService, loginUserInfo)).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * description exportUser 导出用于导入的模板EXCEL |
| | | * |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "导出用于导入的模板EXCEL", notes = "导出用于导入的模板EXCEL") |
| | | @GetMapping("/export/model") |
| | | public void exportUser(HttpServletResponse response) throws IOException { |
| | | List<ExcelSelectObject> selectListObject = keyPersonBizService.defineExcelModelData(); |
| | | //导出操作 |
| | | ExcelUtil.exportExcelForSelectList(Collections.emptyList(), "特殊人员信息导入模版", "特殊人员信息导入模版", KeyPersonExcelExportDto.class, "特殊人员信息导入模版.xls", selectListObject, response); |
| | | } |
| | | |
| | | } |
| | |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, this.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.screen.ComActNeighborCircleScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 14:30 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"大屏-人口"}) |
| | | @RestController |
| | | @RequestMapping("/screen/population/noToken") |
| | | public class ScreenPopulationApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "人口@xyh",response = ComActPopulationScreenVO.class) |
| | | @GetMapping("/statistic") |
| | | public R statistic(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.statistic(communityId); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 14:30 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"大屏-工作"}) |
| | | @RestController |
| | | @RequestMapping("/screen/work/noToken") |
| | | public class ScreenWorkApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 邻里圈 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "邻里圈@xyh",response = ComActNeighborCircleScreenVO.class) |
| | | @GetMapping("/eighborCircle") |
| | | public R statisticNeighborCircle(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.statisticNeighborCircle(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 微心愿 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "微心愿@xyh",response = ComActMicroWishScreenVO.class) |
| | | @GetMapping("/wish") |
| | | public R wish(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.wish(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区活动 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "社区活动@xyh",response = ComActNeighborCircleScreenVO.class) |
| | | @GetMapping("/activity") |
| | | public R activity(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.activity(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 一起议 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "一起议@xyh",response = ComActDiscussScreenVO.class) |
| | | @GetMapping("/discuss") |
| | | public R discuss(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.discuss(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 党建工作 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "党建工作@xyh",response = ComPbWorkScreenVO.class) |
| | | @GetMapping("/pbWork") |
| | | public R pbWork(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.pbWork(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "随手拍@xyh",response = ComActEasyPhotoScreenVO.class) |
| | | @GetMapping("/easyPhoto") |
| | | public R easyPhoto(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.easyPhoto(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 工作情况 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "工作情况@xyh",response = ComActEasyPhotoScreenVO.class) |
| | | @GetMapping("/workCount") |
| | | public R workCount(@RequestParam("communityId") Long communityId){ |
| | | |
| | | return communityService.workCount(communityId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngVillageServeExcelListen comMngVillageServeExcelListen = new ComMngVillageServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | ComMngVillageServeExcelListen comMngVillageServeExcelListen = new ComMngVillageServeExcelListen(communityService, loginUserInfo); |
| | | EasyExcel.read(inputStream, ComMngVillageServeExcelVO.class, comMngVillageServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
New file |
| | |
| | | package com.panzhihua.community_backstage.biz; |
| | | |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ExcelSelectObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群导入模板处理service |
| | | * |
| | | * @author manailin |
| | | * Date 2021-06-14 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class KeyPersonBizServiceImpl { |
| | | /** |
| | | * 初始化全局处理类 |
| | | */ |
| | | private static final String split = ":"; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | |
| | | /** |
| | | * description exportUser 定义导出特殊人群下拉选项值 |
| | | * |
| | | * @return List<ExcelSelectObject> 下拉选项值 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | public List<ExcelSelectObject> defineExcelModelData() { |
| | | HashMap map = new HashMap(5); |
| | | String[] invalid = {"0", "1"}; |
| | | String[] economicLevel = {"贫困", "非贫困"}; |
| | | List<String> dictNames = Arrays.asList("sex", "family", "education", "nation", "key_person_type"); |
| | | dictNames.forEach(dictName -> { |
| | | List<BcDictionaryVO> dictionaryItem = communityService.listDictionaryByKey(dictName).getData(); |
| | | String[] dataMap = dictionaryItem.stream().map(dictionaryVO -> dictionaryVO.getDictName() + split + dictionaryVO.getDictValue()).distinct().toArray(String[]::new); |
| | | map.put(dictName, dataMap); |
| | | }); |
| | | List<ExcelSelectObject> excelSelectObjectList = new ArrayList<>(); |
| | | excelSelectObjectList.add(new ExcelSelectObject(1, 1, (String[]) map.get("sex"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(4, 4, (String[]) map.get("nation"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(8, 8, (String[]) map.get("key_person_type"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(10, 10, invalid)); |
| | | excelSelectObjectList.add(new ExcelSelectObject(12, 12, (String[]) map.get("education"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(13, 13, economicLevel)); |
| | | excelSelectObjectList.add(new ExcelSelectObject(17, 17, (String[]) map.get("family"))); |
| | | return excelSelectObjectList; |
| | | } |
| | | |
| | | /** |
| | | * 定义导出实有人口下拉选项 值 |
| | | * @return |
| | | */ |
| | | public List<ExcelSelectObject> definePopulationExcelModelData() { |
| | | HashMap map = new HashMap(5); |
| | | |
| | | List<String> dictNames = Arrays.asList("sex", "family", "education", "nation", "key_person_type"); |
| | | dictNames.forEach(dictName -> { |
| | | List<BcDictionaryVO> dictionaryItem = communityService.listDictionaryByKey(dictName).getData(); |
| | | String[] dataMap = dictionaryItem.stream().map(dictionaryVO -> dictionaryVO.getDictName() + split + dictionaryVO.getDictValue()).distinct().toArray(String[]::new); |
| | | map.put(dictName, dataMap); |
| | | }); |
| | | List<ExcelSelectObject> excelSelectObjectList = new ArrayList<>(); |
| | | excelSelectObjectList.add(new ExcelSelectObject(1, 1, (String[]) map.get("sex"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(4, 4, (String[]) map.get("nation"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(8, 8, (String[]) map.get("key_person_type"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(12, 12, (String[]) map.get("education"))); |
| | | excelSelectObjectList.add(new ExcelSelectObject(17, 17, (String[]) map.get("family"))); |
| | | return excelSelectObjectList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.listen; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.exceptions.PartyBuildingMemberException; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群入监听 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | public class KeyPersonInfoExcelListen extends AnalysisEventListener<KeyPersonInfoDTO> { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | private LoginUserInfoVO loginUserInfo; |
| | | |
| | | public KeyPersonInfoExcelListen(CommunityService communityService, LoginUserInfoVO loginUserInfo) { |
| | | this.communityService = communityService; |
| | | this.loginUserInfo = loginUserInfo; |
| | | } |
| | | |
| | | |
| | | private static final int BATCH_COUNT = 5000; |
| | | private List<KeyPersonInfoDTO> list = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void invoke(KeyPersonInfoDTO keyPersonInfoDTO, AnalysisContext analysisContext) { |
| | | list.add(keyPersonInfoDTO); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | list.forEach(keyPersonInfo -> { |
| | | buildKeyPersonInfo(keyPersonInfo); |
| | | }); |
| | | R r = this.communityService.saveBatchKeyPerson(list); |
| | | if (!R.isOk(r)) { |
| | | throw new PartyBuildingMemberException(r.getMsg()); |
| | | } |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | private void buildKeyPersonInfo(KeyPersonInfoDTO keyPersonInfo) { |
| | | if (keyPersonInfo.getSexName() != null) { |
| | | keyPersonInfo.setSex(splitData(keyPersonInfo.getSexName(),1)); |
| | | keyPersonInfo.setSexName(splitData(keyPersonInfo.getSexName(),0)); |
| | | } |
| | | if (keyPersonInfo.getNation() != null) { |
| | | keyPersonInfo.setNation(splitData(keyPersonInfo.getNation(),1)); |
| | | } |
| | | if (keyPersonInfo.getVisiterType() != null) { |
| | | keyPersonInfo.setVisiterType(splitData(keyPersonInfo.getVisiterType(),1)); |
| | | } |
| | | if (keyPersonInfo.getCultureLevel() != null) { |
| | | keyPersonInfo.setCultureLevel(splitData(keyPersonInfo.getCultureLevel(),1)); |
| | | } |
| | | if (keyPersonInfo.getGuardianRelation() != null) { |
| | | keyPersonInfo.setGuardianRelation(splitData(keyPersonInfo.getGuardianRelation(),1)); |
| | | } |
| | | keyPersonInfo.setId(Snowflake.getId()); |
| | | keyPersonInfo.setActId(loginUserInfo.getCommunityId()); |
| | | keyPersonInfo.setCreateBy(loginUserInfo.getUserId()); |
| | | keyPersonInfo.setUpdateBy(loginUserInfo.getUserId()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | list.forEach(keyPersonInfo -> { |
| | | buildKeyPersonInfo(keyPersonInfo); |
| | | }); |
| | | R r = this.communityService.saveBatchKeyPerson(list); |
| | | if (!R.isOk(r)) { |
| | | throw new PartyBuildingMemberException(r.getMsg()); |
| | | } |
| | | } |
| | | |
| | | private String splitData(String key,int position) { |
| | | try { |
| | | if (!key.isEmpty()) { |
| | | return key.split(":")[position]; |
| | | } else { |
| | | return null; |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | throw new ServiceException("导入数据格式错误!", "请不要更改下拉选项的值"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.model.dto; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群导出excel模板对象 |
| | | * |
| | | * @author manailin |
| | | * Date 2021-6-13 15:30 |
| | | **/ |
| | | @Data |
| | | public class KeyPersonExcelExportDto { |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名" ,index = 2) |
| | | @Excel(name = "姓名(必填项)", width = 20, isImportField = "true_st") |
| | | private String name; |
| | | /** |
| | | * 性别名称 |
| | | */ |
| | | @ExcelProperty(value = "性别名称" ,index = 3) |
| | | @Excel(name = "性别名称(必填项)", width = 10, isImportField = "true_st") |
| | | private String sexName; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @ExcelProperty(value = "身份证号码" ,index = 4) |
| | | @Excel(name = "身份证号码(必填项)", width = 30, isImportField = "true_st") |
| | | private String cardNo; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ExcelProperty(value = "联系方式" ,index = 5) |
| | | @Excel(name = "联系方式(必填项)", width = 30, isImportField = "true_st") |
| | | private String phone; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ExcelProperty(value = "民族" ,index = 6) |
| | | @Excel(name = "民族(必填项)", width = 20, isImportField = "true_st") |
| | | private String nation; |
| | | /** |
| | | * 户口所在地 |
| | | */ |
| | | @ExcelProperty(value = "户口所在地" ,index = 7) |
| | | @Excel(name = "户口所在地(必填项)", width = 30, isImportField = "true_st") |
| | | private String censusRegister; |
| | | /** |
| | | * 居住地址 |
| | | */ |
| | | @ExcelProperty(value = "居住地址" ,index = 8) |
| | | @Excel(name = "居住地址(必填项)", width = 30, isImportField = "true_st") |
| | | private String address; |
| | | /** |
| | | * 地址精度纬度信息(逗号隔开) |
| | | */ |
| | | @ExcelProperty(value = "地址精度纬度信息(逗号隔开)" ,index = 9) |
| | | @Excel(name = "地址精度纬度信息(必填项)", width = 30, isImportField = "true_st") |
| | | private String visiterAddressLatLng; |
| | | /** |
| | | * 人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员 |
| | | */ |
| | | @ExcelProperty(value = "人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员" ,index = 10) |
| | | @Excel(name = "人员类型(必填项)", width = 10, isImportField = "true_st") |
| | | private Integer visiterType; |
| | | /** |
| | | * (法轮功类填写)基本情况 |
| | | */ |
| | | @Excel(name = "(法轮功类填写)基本情况(必填项)", width = 30, isImportField = "true_st") |
| | | private String basicInfo; |
| | | /** |
| | | * 是否有效 |
| | | */ |
| | | @ExcelProperty(value = "是否有效" ,index = 11) |
| | | @Excel(name = "是否有效(必填项)1是有效,0是无效", width = 10, isImportField = "true_st") |
| | | private Boolean invalid; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注" ,index = 12) |
| | | @Excel(name = "备注(必填项)", width = 30, isImportField = "true_st") |
| | | private String note; |
| | | /** |
| | | * 文化程度(取字典表国家编码)) |
| | | */ |
| | | @ExcelProperty(value = "文化程度" ,index = 13) |
| | | @Excel(name = "文化程度(必填项)", width = 20, isImportField = "true_st") |
| | | private String cultureLevel; |
| | | /** |
| | | * 经济状态 |
| | | */ |
| | | @ExcelProperty(value = "经济状态" ,index = 14) |
| | | @Excel(name = "经济状态(必填项)", width = 20, isImportField = "true_st") |
| | | private String economicLevel; |
| | | /** |
| | | * (精神类人群填写)目前诊断 |
| | | */ |
| | | @ExcelProperty(value = "目前诊断" ,index = 18) |
| | | @Excel(name = "目前诊断(必填项)", width = 30, isImportField = "true_st") |
| | | private String diagnose; |
| | | /** |
| | | * (精神类人群填写)监护人名称 |
| | | */ |
| | | @ExcelProperty(value = "监护人名称" ,index = 20) |
| | | @Excel(name = "监护人名称(必填项)", width = 30, isImportField = "true_st") |
| | | private String guardian; |
| | | /** |
| | | * (精神类人群填写)监护人电话 |
| | | */ |
| | | @ExcelProperty(value = "监护人电话" ,index = 21) |
| | | @Excel(name = "监护人电话(必填项)", width = 30, isImportField = "true_st") |
| | | private String guardianPhone; |
| | | /** |
| | | * (精神类人群填写)监护人关系 |
| | | */ |
| | | @ExcelProperty(value = "监护人关系" ,index = 22) |
| | | @Excel(name = "监护人关系(必填项)", width = 20, isImportField = "true_st") |
| | | private String guardianRelation; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.service_community.service.ComActBuildingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 13:39 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | public class BuildingApi { |
| | | |
| | | @Resource |
| | | private ComActBuildingService comActBuildingService; |
| | | |
| | | |
| | | @PostMapping("/batchSave") |
| | | R listSaveBuildingExcelVO(@RequestBody List<ComMngBuildingExcelVO> newVoList, @RequestParam("communityId") Long communityId){ |
| | | |
| | | return comActBuildingService.batchSaveBuilding(newVoList,communityId); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据实有人口身份证修改标签列表 |
| | | * |
| | | * @param comMngPopulationTagCardNoDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/cardNo/population/editTag") |
| | | public R editTagPopulationByCardNo(@RequestBody ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO) { |
| | | return comMngPopulationService.editTagPopulationByCardNo(comMngPopulationTagCardNoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * @param Ids 删除id集合 |
| | | * @return 删除结果 |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.BcDictionaryService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** 字典 |
| | | * @author xyh |
| | | * @date 2021/6/11 16:11 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/dictionary") |
| | | public class DictionaryApi { |
| | | |
| | | @Resource |
| | | private BcDictionaryService bcDictionaryService; |
| | | |
| | | /** |
| | | * 根据字典key查询自典项 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | @GetMapping("/listDictionaryByKey") |
| | | R<List<BcDictionaryVO>> listDictionaryByKey(@RequestParam("key")String key){ |
| | | |
| | | return bcDictionaryService.getDictionaryByKey(key); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.CopyUtil; |
| | | import com.panzhihua.common.utlis.ValidableList; |
| | | import com.panzhihua.service_community.model.dos.KeyPersonInfoDO; |
| | | import com.panzhihua.service_community.service.KeyPersonInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class MainMemberApi { |
| | | |
| | | @Resource |
| | | private KeyPersonInfoService keyPersonInfoService; |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * |
| | | * @param list 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("/key_person/batch/save") |
| | | public R BatchSave(@RequestBody @Valid ValidableList<KeyPersonInfoDTO> list, @ApiIgnore BindingResult results) { |
| | | if (results.hasErrors()) { |
| | | return R.fail(results.getFieldError().getDefaultMessage()); |
| | | } |
| | | return keyPersonInfoService.saveBatchKeyPerson(list); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 15:13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/screen/population") |
| | | public class ScreenPopulationApi { |
| | | |
| | | @Resource |
| | | private ComMngPopulationService comMngPopulationService; |
| | | |
| | | /** |
| | | * 大屏人口查询 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/statistic") |
| | | R statistic(@RequestParam("communityId")Long communityId){ |
| | | |
| | | return R.ok(comMngPopulationService.screenStatistic(communityId)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 15:13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/screen/work") |
| | | public class ScreenWorkApi { |
| | | |
| | | @Resource |
| | | private ScreenWorkService screenWorkService; |
| | | |
| | | /** |
| | | * 大屏统计邻里圈 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/neighborCircle") |
| | | R statisticNeighborCircle(@RequestParam("communityId") Long communityId){ |
| | | return screenWorkService.statisticNeighborCircle(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计心愿单 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/wish") |
| | | R wish(@RequestParam("communityId") Long communityId){ |
| | | return screenWorkService.wish(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计社区活动 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/activity") |
| | | R activity(@RequestParam("communityId") Long communityId){ |
| | | return screenWorkService.activity(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计一起议 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/discuss") |
| | | R discuss(@RequestParam("communityId") Long communityId){ |
| | | return screenWorkService.discuss(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计党建工作 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/pbWork") |
| | | R pbWork(@RequestParam("communityId")Long communityId){ |
| | | return screenWorkService.pbWork(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计随手拍 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/easyPhoto") |
| | | R easyPhoto(@RequestParam("communityId")Long communityId){ |
| | | return screenWorkService.easyPhoto(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 大屏统计工作情况 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R workCount(@RequestParam("communityId")Long communityId){ |
| | | return screenWorkService.workCount(communityId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.BcDictionaryItemDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典项 |
| | | * @author xyh |
| | | * @since 2021-06-11 |
| | | */ |
| | | @Mapper |
| | | public interface BcDictionaryItemDAO extends BaseMapper<BcDictionaryItemDO> { |
| | | |
| | | @Select("SELECT d.dict_name,di.dict_value,di.dict_item_name,di.mnemonic_code " + |
| | | "FROM bc_dictionary d INNER JOIN bc_dictionary_item di ON d.id = di.dict_id " + |
| | | "WHERE di.enabled = 1 AND di.delete_flag = 0 AND d.enabled = 1 AND d.delete_flag = 0 " + |
| | | "AND d.dict_key = #{key} ") |
| | | List<BcDictionaryItemDO> getDictionaryByKey(@Param("key") String key); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.CommunityActivitiesVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityGovernanceTrendsVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.PageActivityMembersVO; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | "\t\tDATE_FORMAT( a.create_at, '%Y-%m-%d' )=DATE_FORMAT(#{date},'%Y-%m-%d') \n" + |
| | | "\t\tAND a.community_id =#{communityId}") |
| | | CommunityActivitiesVO selectCommunityActivitiesVO(@Param("communityId") Long communityId, @Param("date")Date date); |
| | | |
| | | @Select("SELECT COUNT(id) AS totalNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%'))AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND volunteer_max = 0)AS commonNum," + |
| | | "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.volunteer_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + |
| | | "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max = 0)AS volunteerNum," + |
| | | "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.community_id=#{communityId} AND a.participant_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5))AS volunteerPeopleNum" + |
| | | " FROM com_act_activity where community_id=#{communityId} AND (status = 3 OR status = 4 OR status = 5)") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + |
| | | "WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) ORDER BY create_at DESC LIMIT #{pageSize}") |
| | | List<CarouselInfoVO> screenActivity(@Param("communityId")Long communityId, @Param("pageSize")Integer pageSize); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.service_community.model.dos.ComActDiscussDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | "d.id =#{id}\n" + |
| | | "GROUP BY d.id") |
| | | ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%'))AS currentNum," + |
| | | "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND TYPE = 1)AS imgNum," + |
| | | "(" + |
| | | "SELECT COUNT(DISTINCT(user_id)) FROM (" + |
| | | " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | | " UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id INNER JOIN com_act_discuss_comment_user u ON c.id = u.disscuss_comment_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | | "UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_option o ON d.id = o.discuss_id INNER JOIN com_act_discuss_option_user u ON o.id = u.discuss_option_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | | " UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + |
| | | ")d " + |
| | | ")AS commonPeopleNum," + |
| | | "(" + |
| | | "SELECT COUNT(DISTINCT(user_id)) FROM (" + |
| | | " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | | " UNION ALL" + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id INNER JOIN com_act_discuss_comment_user u ON c.id = u.disscuss_comment_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | | "UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_option o ON d.id = o.discuss_id INNER JOIN com_act_discuss_option_user u ON o.id = u.discuss_option_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | | " UNION ALL " + |
| | | " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + |
| | | ")d " + |
| | | ")AS volunteerPeopleNum " + |
| | | " FROM com_act_discuss") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId, @Param("date")String date); |
| | | |
| | | @Select(" SELECT discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") |
| | | List<CarouselInfoVO> screenDiscuss(@Param("communityId") Long communityId, @Param("pageSize")Integer pageSize); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.screen.EastPhotoVO; |
| | | import com.panzhihua.common.model.vos.screen.EasyPhotoDataVO; |
| | | import com.panzhihua.common.model.vos.screen.PbWorkVO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | "</script>" |
| | | ) |
| | | IPage<ComActEasyPhotoVO> pageEasyPhotoApplets(Page page, @Param("comActEasyPhotoVO")ComActEasyPhotoVO comActEasyPhotoVO); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.handle_status = 1 AND p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | Map<String, Long> countDeal(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.is_publicity = 1 AND p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | Map<String, Long> countPub(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + |
| | | "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.status = 4 AND p.community_id = #{communityId} " + |
| | | "GROUP BY t.name ") |
| | | Map<String, Long> countApproved(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id) AS noneDeal," + |
| | | "(" + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 AND handle_status = 2)*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND handle_status = 2) " + |
| | | ") AS pubPoint," + |
| | | "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and handle_status = 2 ) AS dealTime " + |
| | | "FROM com_act_easy_photo and community_id = #{communityId}") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id) AS total, " + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ) AS adds, " + |
| | | "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND handle_status = 2 AND #{start} < create_at and create_at < #{end}) AS deal " + |
| | | "FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ") |
| | | EastPhotoVO countByTime(@Param("start")String start, @Param("end")String end, @Param("nowDate")String nowDate, @Param("communityId")Long communityId); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72") |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | @Select("SELECT COUNT(id) AS completedNum," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + |
| | | "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | "FROM com_act_micro_wish WHERE community_id = #{communityId} AND status = 6 ") |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate); |
| | | |
| | | @Select("SELECT photo_path_list FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) ORDER BY create_at DESC limit #{pageSize}") |
| | | List<String> getAllImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActNeighborCircleScreenVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | " where reply.comment_id = #{commentId} and reply.status = 1") |
| | | IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); |
| | | |
| | | } |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and(status = 2 or status = 3) ORDER BY create_at DESC limit #{pageSize}") |
| | | List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," + |
| | | " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND (status = 2 OR status = 3) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + |
| | | " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") |
| | | Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) group by community_id ") |
| | | Map<String, Long> sumScreenNum(Long communityId); |
| | | |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle_comment WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") |
| | | List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 13:47 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngBuildingDAO extends BaseMapper<ComMngBuildingDO> { |
| | | @Select("select street_id,act_id,village_id,name from com_mng_building") |
| | | List<ComMngBuildingDO> findAllBuilding(); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.model.vos.community.PageComActMessageVO; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实有人口Dao |
| | |
| | | public interface ComMngPopulationDAO extends BaseMapper<ComMngPopulationDO> { |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | "cmp.`name`, " + |
| | | "cmp.id, " + |
| | | "cmp.street_id, " + |
| | | "cmp.act_id, " + |
| | | "cmp.village_id, " + |
| | | "cmp.sex, " + |
| | | "cmp.age, " + |
| | | "cmp.card_no, " + |
| | | "cmp.road, " + |
| | | "cmp.door_no, " + |
| | | "cmp.floor, " + |
| | | "cmp.unit_no, " + |
| | | "cmp.house_no, " + |
| | | "cmp.political_outlook, " + |
| | | "cmp.work_company, " + |
| | | "cmp.special_situation, " + |
| | | "cmp.phone, " + |
| | | "cmp.remark, " + |
| | | "cmv.alley, " + |
| | | "cmp.native_place, " + |
| | | "cmp.nation " + |
| | | "FROM " + |
| | | "SELECT\n" + |
| | | "cmp.`name`,\n" + |
| | | "cmp.id,\n" + |
| | | "cmp.street_id,\n" + |
| | | "cmp.act_id,\n" + |
| | | "cmp.village_id,\n" + |
| | | "cmp.sex,\n" + |
| | | "cmp.age,\n" + |
| | | "cmp.card_no,\n" + |
| | | "cmp.road,\n" + |
| | | "cmp.door_no,\n" + |
| | | "cmp.floor,\n" + |
| | | "cmp.unit_no,\n" + |
| | | "cmp.house_no,\n" + |
| | | "cmp.political_outlook,\n" + |
| | | "cmp.work_company,\n" + |
| | | "cmp.special_situation,\n" + |
| | | "cmp.phone,\n" + |
| | | "cmp.remark,\n" + |
| | | "cmv.alley,\n" + |
| | | "cmp.native_place,\n" + |
| | | "cmp.nation \n" + |
| | | "FROM \n" + |
| | | "com_mng_population AS cmp " + |
| | | "LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + |
| | | "<where>" + |
| | |
| | | List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | "cmp.`name`, " + |
| | | "cmp.id, " + |
| | | "cmp.street_id, " + |
| | | "cmp.act_id, " + |
| | | "cmp.village_id, " + |
| | | "cmp.sex, " + |
| | | "cmp.age, " + |
| | | "cmp.card_no, " + |
| | | "cmp.road, " + |
| | | "cmp.door_no, " + |
| | | "cmp.floor, " + |
| | | "cmp.unit_no, " + |
| | | "cmp.house_no, " + |
| | | "cmp.political_outlook, " + |
| | | "cmp.work_company, " + |
| | | "cmp.special_situation, " + |
| | | "cmp.phone, " + |
| | | "cmp.remark, " + |
| | | "cmv.alley, " + |
| | | "cmp.native_place, " + |
| | | "cmp.nation, " + |
| | | "cmp.label, " + |
| | | "cmp.relation, " + |
| | | "cmp.marriage, " + |
| | | "cmp.culture_level, " + |
| | | "cmp.out_or_local, " + |
| | | "cmp.census_register, " + |
| | | "cmp.healthy, " + |
| | | "cmp.birthday, " + |
| | | "cmp.update_at, " + |
| | | "cmp.is_rent " + |
| | | "FROM " + |
| | | "SELECT\n" + |
| | | "cmp.`name`,\n" + |
| | | "cmp.id,\n" + |
| | | "cmp.street_id,\n" + |
| | | "cmp.act_id,\n" + |
| | | "cmp.village_id,\n" + |
| | | "cmp.sex,\n" + |
| | | "cmp.age,\n" + |
| | | "cmp.card_no,\n" + |
| | | "cmp.road,\n" + |
| | | "cmp.door_no,\n" + |
| | | "cmp.floor,\n" + |
| | | "cmp.unit_no,\n" + |
| | | "cmp.house_no,\n" + |
| | | "cmp.political_outlook,\n" + |
| | | "cmp.work_company,\n" + |
| | | "cmp.special_situation,\n" + |
| | | "cmp.phone,\n" + |
| | | "cmp.remark,\n" + |
| | | "cmv.alley,\n" + |
| | | "cmp.native_place,\n" + |
| | | "cmp.nation, \n" + |
| | | "cmp.label, \n" + |
| | | "cmp.relation, \n" + |
| | | "cmp.marriage, \n" + |
| | | "cmp.culture_level, \n" + |
| | | "cmp.out_or_local, \n" + |
| | | "cmp.census_register, \n" + |
| | | "cmp.healthy, \n" + |
| | | "cmp.birthday, \n" + |
| | | "cmp.update_at, \n" + |
| | | "cmp.is_rent \n" + |
| | | "FROM \n" + |
| | | "com_mng_population AS cmp " + |
| | | "LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + |
| | | "<where>" + |
| | |
| | | List<CivilVillageStatisticsVO> getCivilScreenVillageList(@Param("communityId") Long communityId); |
| | | |
| | | |
| | | @Select("SELECT COUNT(id) AS man,(SELECT COUNT(id) FROM com_mng_population WHERE sex = 2 AND act_id = #{communityId}) AS woman FROM com_mng_population WHERE sex = 1 AND act_id = #{communityId}") |
| | | Map<String, Long> countBySex(@Param("communityId") Long communityId); |
| | | |
| | | @Select( |
| | | "SELECT " + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) as aa where aa.age<= 16) as age16," + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 25) AS age25," + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 25 and aa.age<= 35) AS age35," + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," + |
| | | "(SELECT COUNT(aa.age) FROM " + |
| | | "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") |
| | | Map<String, Long> countByAge(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id)AS xx," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 2 AND act_id = #{communityId}) as cz," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 3 AND act_id = #{communityId}) as gz," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 4 AND act_id = #{communityId}) as zz," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 5 AND act_id = #{communityId}) as dz," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 6 AND act_id = #{communityId}) as bk," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 7 AND act_id = #{communityId}) as ss," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 8 AND act_id = #{communityId}) as bs," + |
| | | "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 9 AND act_id = #{communityId}) as qt" + |
| | | " FROM com_mng_population WHERE culture_level = 1 AND act_id = #{communityId}") |
| | | Map<String, Long> countByCulture(@Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT COUNT(p.id) FROM com_mng_population p INNER JOIN sys_user u ON p.card_no = u.id_card where p.act_id = #{communityId}") |
| | | Long countUsedCommunityPopulation(@Param("communityId")Long communityId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.panzhihua.common.model.vos.screen.PbWorkVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/16 14:57 |
| | | */ |
| | | @Mapper |
| | | public interface ComPbDynDAO { |
| | | |
| | | @Select("SELECT COUNT(id) AS activityNum ," + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2) AS dynNum," + |
| | | "(" + |
| | | " (SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 3 or STATUS = 4 or STATUS = 5 ) AND create_at LIKE CONCAT(#{nowDate},'%')) + " + |
| | | " (SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2 AND create_at LIKE CONCAT(#{nowDate},'%'))" + |
| | | " ) AS currentNum " + |
| | | " FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 3 or STATUS = 4 or STATUS = 5 )") |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("nowDate")String nowDate); |
| | | |
| | | @Select("SELECT " + |
| | | "(SELECT COUNT(id) FROM com_pb_activity WHERE community_id = #{communityId} AND (STATUS = 3 or STATUS = 4 or STATUS = 5 ) AND #{start} < create_at AND create_at < #{end}) AS activity," + |
| | | "(SELECT COUNT(id) FROM com_pb_dyn WHERE community_id = #{communityId} AND STATUS = 2 AND #{start} < create_at AND create_at < #{end}) AS dyn" + |
| | | "FROM DUAL") |
| | | PbWorkVO countByTime(@Param("start")String start,@Param("end")String end, @Param("communityId")Long communityId); |
| | | } |
| | |
| | | " AND DATE_FORMAT(ea.CREATE_AT, '%c') = #{pageEldersAuthDTO.month} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.type == 2 '>" + |
| | | "<if test='pageEldersAuthDTO.createAtStart != null'>" + |
| | | " AND ea.create_at <![CDATA[>=]]> #{pageEldersAuthDTO.createAtStart} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.createAtEnd != null'>" + |
| | | " AND ea.create_at <![CDATA[<=]]> #{pageEldersAuthDTO.createAtEnd} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.createAtStart != null'>" + |
| | | " AND ea.create_at <![CDATA[>=]]> #{pageEldersAuthDTO.createAtStart} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.createAtEnd != null'>" + |
| | | " AND ea.create_at <![CDATA[<=]]> #{pageEldersAuthDTO.createAtEnd} " + |
| | | " </if> " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " ORDER BY ea.${pageEldersAuthDTO.sortBy} ${pageEldersAuthDTO.order} " + |
| | |
| | | |
| | | |
| | | @Select("<script> " + |
| | | "SELECT ea.id, ea.create_at, ea.create_by, ea.update_by, ea.update_at, " + |
| | | " ea.AUTH_USER_NAME , ea.ID_CARD, ea.BIRTH_DAY, ea.FAMILY_USER_ID, ea.type, " + |
| | | "SELECT ea.id, ea.create_at, ea.create_by, ea.update_by, ea.update_at," + |
| | | " ea.AUTH_USER_NAME , ea.ID_CARD, ea.BIRTH_DAY, ea.FAMILY_USER_ID, " + |
| | | " ea.DOMICILE, ea.SUMIT_USER_ID, u.phone as submitUserAccount , ea.VIDEO_URL , ea.FAMILY_USER_ID, " + |
| | | " u.name as submitUserName, ea.age \n" + |
| | | " u.name as submitUserName, ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) as age \n" + |
| | | "FROM com_elders_auth ea LEFT JOIN sys_user u ON ea.SUMIT_USER_ID = u.user_id\n" + |
| | | " where ea.id = #{id}" + |
| | | "</script>") |
| | |
| | | " </if> " + |
| | | |
| | | "<if test='pageEldersAuthDTO.ids == null or pageEldersAuthDTO.ids.length==0 '>" + |
| | | "<if test='pageEldersAuthDTO.sumitUserId != null'>" + |
| | | " AND ea.SUMIT_USER_ID = #{pageEldersAuthDTO.sumitUserId} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.idCard != null'>" + |
| | | " AND ea.ID_CARD = #{pageEldersAuthDTO.idCard} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.authUserName != null'>" + |
| | | " AND ea.AUTH_USER_NAME like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.type == 1 '>" + |
| | | " AND DATE_FORMAT(ea.CREATE_AT, '%c') = #{pageEldersAuthDTO.month} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.type == 2 '>" + |
| | | "<if test='pageEldersAuthDTO.createAtStart != null'>" + |
| | | " AND ea.create_at <![CDATA[>=]]> #{pageComShopOrderSearchDTO.createAtStart} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.createAtEnd != null'>" + |
| | | " AND ea.create_at <![CDATA[<=]]> #{pageComShopOrderSearchDTO.createAtEnd} " + |
| | | " </if> " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.sumitUserId != null'>" + |
| | | " AND ea.SUMIT_USER_ID = #{pageEldersAuthDTO.sumitUserId} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.idCard != null'>" + |
| | | " AND ea.ID_CARD = #{pageEldersAuthDTO.idCard} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.authUserName != null'>" + |
| | | " AND ea.AUTH_USER_NAME like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.type == 1 '>" + |
| | | " AND DATE_FORMAT(ea.CREATE_AT, '%c') = #{pageEldersAuthDTO.month} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.type == 2 '>" + |
| | | "<if test='pageEldersAuthDTO.createAtStart != null'>" + |
| | | " AND ea.create_at <![CDATA[>=]]> #{pageComShopOrderSearchDTO.createAtStart} " + |
| | | " </if> " + |
| | | "<if test='pageEldersAuthDTO.createAtEnd != null'>" + |
| | | " AND ea.create_at <![CDATA[<=]]> #{pageComShopOrderSearchDTO.createAtEnd} " + |
| | | " </if> " + |
| | | " </if> " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " ORDER BY ea.${pageEldersAuthDTO.sortBy} ${pageEldersAuthDTO.order} " + |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Mapper |
| | | public interface GridBuildRelationDAO extends BaseMapper<GridBuildRelationDO> { |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPrizeDO; |
| | | import com.panzhihua.service_community.model.dos.KeyPersonInfoDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Mapper |
| | | public interface KeyPersonInfoDAO extends BaseMapper<KeyPersonInfoDO> { |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 字典项表 |
| | | * </p> |
| | | * |
| | | * @author xyh |
| | | * @since 2021-06-11 |
| | | */ |
| | | @Data |
| | | @TableName("bc_dictionary_item") |
| | | public class BcDictionaryItemDO implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = -7900409296242392578L; |
| | | /** |
| | | * 字典项名 |
| | | */ |
| | | private String dictItemName; |
| | | |
| | | /** |
| | | * 字典项值 |
| | | */ |
| | | private String dictValue; |
| | | |
| | | /** |
| | | * 助记码 |
| | | */ |
| | | private String mnemonicCode; |
| | | |
| | | /** |
| | | * 字典id |
| | | */ |
| | | private Long dictId; |
| | | |
| | | /** |
| | | * 启用状态(0:停用,1:启用) |
| | | */ |
| | | private Boolean enabled; |
| | | |
| | | /** |
| | | * 机构id |
| | | */ |
| | | private Long orgPathId; |
| | | |
| | | /** |
| | | * 排序号 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 备注说明 |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createDate; |
| | | |
| | | /** |
| | | * 修改者 |
| | | */ |
| | | private Long modifyUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date modifyDate; |
| | | |
| | | /** |
| | | * 删除标识(0:未删除,1:已删除) |
| | | */ |
| | | private Boolean deleteFlag; |
| | | |
| | | } |
| | |
| | | */ |
| | | private String contactsPhone; |
| | | |
| | | /**社区总人口*/ |
| | | private Integer totalUser; |
| | | /**社区书记-用户ID*/ |
| | | private Long managerId; |
| | | /**社区书记_名称*/ |
| | | private String managerName; |
| | | /**社区介绍*/ |
| | | private String introduce; |
| | | /**层次递归字段(省>市>区县>街道>社区)*/ |
| | | private String path; |
| | | /** |
| | | * 超管账号 |
| | | */ |
New file |
| | |
| | | package com.panzhihua.service_community.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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 楼栋表 |
| | | * </p> |
| | | * |
| | | * @author xyh |
| | | * @since 2021-06-10 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_mng_building") |
| | | public class ComMngBuildingDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 7264872297827113113L; |
| | | |
| | | @TableId(value = "id",type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 街道Id |
| | | */ |
| | | private Long streetId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long actId; |
| | | |
| | | /** |
| | | * 小区ID |
| | | */ |
| | | private Long villageId; |
| | | |
| | | /** |
| | | * 楼栋号 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 楼层数量 |
| | | */ |
| | | private Integer buildFloorSum; |
| | | |
| | | /** |
| | | * 每个楼层有多少户 |
| | | */ |
| | | private Integer everyFloorSum; |
| | | |
| | | /** |
| | | * 栋楼总共有多少户 |
| | | */ |
| | | private Integer buildUserSum; |
| | | |
| | | /** |
| | | * 建筑类型(高层、洋房等) |
| | | */ |
| | | private String buildType; |
| | | |
| | | /** |
| | | * 使用类型 |
| | | */ |
| | | private String useType; |
| | | |
| | | /** |
| | | * 建成时间 |
| | | */ |
| | | private Date buildDate; |
| | | |
| | | /** |
| | | * 单元数 |
| | | */ |
| | | private Integer unitTotal; |
| | | |
| | | /** |
| | | * 电梯数 |
| | | */ |
| | | private Integer elevatorTotal; |
| | | |
| | | /** |
| | | * 楼栋状态(在用、待拆迁等) |
| | | */ |
| | | private Long buildStatus; |
| | | |
| | | /** |
| | | * 层次递归字段(街道>社区>小区>楼栋) |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lng; |
| | | |
| | | /** |
| | | * 维度 |
| | | */ |
| | | private String lat; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | private String gridId; |
| | | } |
| | |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer age; |
| | | // private Integer age; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | |
| | | /** |
| | | * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他) |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer relation; |
| | | // private Integer relation; |
| | | // |
| | | // private String relationStr; |
| | | |
| | |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String houseAddress; |
| | | // private String houseAddress; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | |
| | | /** |
| | | * 居住地房屋id |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long houseId; |
| | | // private Long houseId; |
| | | |
| | | /** |
| | | * 性别(1.男 2.女 3.未知) |
| | |
| | | int wd = 2; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Long villageId; |
| | | |
| | | /** |
| | | * 街道id |
| | | * @return |
| | | */ |
| | | private Long streetId; |
| | | |
| | | /** |
| | | * 层次递归字段(省>市>区县>街道>社区>小区>详细地址) |
| | | */ |
| | | private String path; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComMngPopulationHouseDO{" + |
| | | "id=" + id + |
| | | ", streetId="+streetId+ |
| | | ", address=" + address + |
| | | ", code=" + code + |
| | | ", alley=" + alley + |
| | |
| | | ", isEmpty=" + isEmpty + |
| | | ", constructPurpose=" + constructPurpose + |
| | | ", constructArea=" + constructArea + |
| | | ", path="+path+ |
| | | ", createAt=" + createAt + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 人和房屋关系’ (1.自住2、租住) |
| | | */ |
| | | private Integer relationId; |
| | | |
| | | /** |
| | | * 入住开始时间 |
| | | */ |
| | | private Date startAt; |
| | | |
| | | /** |
| | | * 入住结束时间 |
| | | */ |
| | | private Date endAt; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | /** |
| | | * villageId |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | @TableId(value = "village_id",type = IdType.INPUT) |
| | | private Long villageId; |
| | | /** |
| | | * 街路巷 |
| | |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 小区地址 |
| | | */ |
| | | /**(城镇)小区名字*/ |
| | | private String name; |
| | | /**如果是城镇小区填写楼栋数量 */ |
| | | private Integer buildSum; |
| | | /**(城镇)建筑年代*/ |
| | | private Date buildYear; |
| | | /**(城镇)建筑类型*/ |
| | | private Long buildType; |
| | | /**(城镇)是否存在物业公司*/ |
| | | private String property; |
| | | /**(城镇)开发商*/ |
| | | private String developers; |
| | | /**(城镇)小区总共居民数量/这户一共住了几口人*/ |
| | | private Integer userSum; |
| | | /**图片*/ |
| | | private String villageImages; |
| | | /**地址*/ |
| | | private String address; |
| | | /**层次递归字段(省>市>区县>街道>社区>小区)*/ |
| | | private String path; |
| | | /**经度*/ |
| | | private String lng; |
| | | /**维度*/ |
| | | private String lat; |
| | | |
| | | /** |
| | | * 更新时间 |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Description 网格和建筑或楼栋关联表 |
| | | * ClassName GridBuildRelation |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | @TableName(value = "event_grid_building_relation") |
| | | public class GridBuildRelationDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | /**主键*/ |
| | | @TableId(value = "id",type = IdType.INPUT) |
| | | private Long id; |
| | | /**网格所属街道*/ |
| | | private Long gridStreetId; |
| | | /**网格所属社区ID*/ |
| | | private Long gridCommunityId; |
| | | /**网格ID*/ |
| | | private Long gridId; |
| | | /**网格名称*/ |
| | | private String gridName; |
| | | /**小区类型(1.城镇 2.农村 3.未知)*/ |
| | | private Integer type; |
| | | /**小区表ID*/ |
| | | private Long villageId; |
| | | /**楼栋ID*/ |
| | | private Long buildId; |
| | | private String buildName; |
| | | /**创建人*/ |
| | | private Long createBy; |
| | | /**创建时间*/ |
| | | private Date createAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | 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.util.Date; |
| | | |
| | | /** |
| | | * Description 重点人员信息 |
| | | * ClassName KeyPersonInfo |
| | | * |
| | | * @author manailin |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | @TableName("com_key_person_info") |
| | | public class KeyPersonInfoDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 街道id |
| | | */ |
| | | private Long streetId; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 性别(取字典表国家编码) |
| | | */ |
| | | private String sex; |
| | | /** |
| | | * 性别名称 |
| | | */ |
| | | private String sexName; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | private String nation; |
| | | /** |
| | | * 户口所在地 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String censusRegister; |
| | | /** |
| | | * 居住地址 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String address; |
| | | /** |
| | | * 地址精度纬度信息(逗号隔开) |
| | | */ |
| | | private String visiterAddressLatLng; |
| | | /** |
| | | * 人员类型1吸毒2严重精神障碍3刑释人员4社区矫正人员 |
| | | */ |
| | | private Integer visiterType; |
| | | /** |
| | | * (法轮功类填写)基本情况 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String basicInfo; |
| | | /** |
| | | * 是否有效 |
| | | */ |
| | | private Boolean invalid; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String note; |
| | | /** |
| | | * 文化程度(取字典表国家编码)) |
| | | */ |
| | | private String cultureLevel; |
| | | /** |
| | | * 经济状态 |
| | | */ |
| | | private String economicLevel; |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | /** |
| | | * (精神类人群填写)目前诊断 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String diagnose; |
| | | /** |
| | | * 上报提交时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date submitDate; |
| | | /** |
| | | * (精神类人群填写)监护人名称 |
| | | */ |
| | | private String guardian; |
| | | /** |
| | | * (精神类人群填写)监护人电话 |
| | | */ |
| | | private String guardianPhone; |
| | | /** |
| | | * (精神类人群填写)监护人关系 |
| | | */ |
| | | private String guardianRelation; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date createAt; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | |
| | | private Long actId; |
| | | /** |
| | | * 小区id(实有房屋id) |
| | | */ |
| | | |
| | | private Long villageId; |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.BcDictionaryItemDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/11 16:05 |
| | | */ |
| | | public interface BcDictionaryService extends IService<BcDictionaryItemDO> { |
| | | |
| | | /** |
| | | * 根据字典key 查询字典项 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | R<List<BcDictionaryVO>> getDictionaryByKey(String key); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 13:41 |
| | | */ |
| | | |
| | | public interface ComActBuildingService extends IService<ComMngBuildingDO> { |
| | | |
| | | R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId); |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.EditComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | * |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | |
| | | /** |
| | | * 根据实有人口id修改用户标签 |
| | | * @param populationTagDTO 请求参数 |
| | | * @return 修改结果 |
| | | * |
| | | * @param populationTagDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R editTagPopulation(ComMngPopulationTagDTO populationTagDTO); |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids 实有人口id集合 |
| | | * @return 删除结果 |
| | | * @param Ids 实有人口id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | R deletePopulations(List<Long> Ids); |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | */ |
| | | R getPopulationListByCommunityId(Long communityId); |
| | | |
| | | /** |
| | | * 根据id集合查询实有人口 |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | * |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | */ |
| | | R getPopulationLists(List<Long> Ids); |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * |
| | | * @param populationEditDTO |
| | | * @param communityId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 分页查询特殊群体 |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | * |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | */ |
| | | R specialInputUser(PageInputUserDTO pageInputUserDTO); |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | * |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteSpecialInputUser(Long id); |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | * |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | R electronicArchivesPopulation(Long populationId); |
| | | |
| | |
| | | * @return 统计结果 |
| | | */ |
| | | R getScreenCivil(Long communityId); |
| | | |
| | | /** |
| | | * description 根据身份证信息修改用户标签信息 |
| | | * |
| | | * @param comMngPopulationTagCardNoDTO 查询对象 |
| | | * @return ComMngPopulationDO 实有人口信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | R editTagPopulationByCardNo(ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO); |
| | | |
| | | /** |
| | | * description 根据身份证信息从实有人口表查询对应信息 |
| | | * |
| | | * @param cardNo 身份证号码 |
| | | * @return ComMngPopulationDO 实有人口信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | ComMngPopulationDO getPopulationByCardNo(String cardNo); |
| | | |
| | | /** |
| | | * 大屏统计实有人口 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R screenStatistic(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 网格和小区楼栋和建筑的关系表管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | public interface GridBuildRelationService extends IService<GridBuildRelationDO> { |
| | | |
| | | /** |
| | | * description 批量保存网格和小区楼栋和建筑的关系 |
| | | * |
| | | * @param keyList 网格和小区楼栋和建筑的关系信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | R saveBatchGridBuildRelation(List<GridBuildRelationDO> keyList); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.KeyPersonInfoDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | public interface KeyPersonInfoService extends IService<KeyPersonInfoDO> { |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * |
| | | * @param keyList 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | R saveBatchKeyPerson(List<KeyPersonInfoDTO> keyList); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 15:14 |
| | | */ |
| | | public interface ScreenWorkService { |
| | | |
| | | /** |
| | | * 大屏统计邻里圈 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R statisticNeighborCircle(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计心愿单 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R wish(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计社区活动 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R activity(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计一起议 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R discuss(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计党建工作 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R pbWork(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计随手拍 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R easyPhoto(Long communityId); |
| | | |
| | | /** |
| | | * 大屏统计工作情况 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R workCount(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.BcDictionaryItemDAO; |
| | | import com.panzhihua.service_community.model.dos.BcDictionaryItemDO; |
| | | import com.panzhihua.service_community.service.BcDictionaryService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/11 16:06 |
| | | */ |
| | | @Service |
| | | public class BcDictionaryServiceImpl extends ServiceImpl<BcDictionaryItemDAO, BcDictionaryItemDO> implements BcDictionaryService { |
| | | |
| | | |
| | | @Override |
| | | public R<List<BcDictionaryVO>> getDictionaryByKey(String key) { |
| | | List<BcDictionaryItemDO> list = baseMapper.getDictionaryByKey(key); |
| | | List<BcDictionaryVO> listVO = new ArrayList<>(); |
| | | for (BcDictionaryItemDO dictionaryItemDO:list){ |
| | | BcDictionaryVO bcDictionaryVO = new BcDictionaryVO(); |
| | | bcDictionaryVO.setCode(dictionaryItemDO.getMnemonicCode()); |
| | | bcDictionaryVO.setDictName(dictionaryItemDO.getDictItemName()); |
| | | bcDictionaryVO.setDictValue(dictionaryItemDO.getDictValue()); |
| | | listVO.add(bcDictionaryVO); |
| | | } |
| | | return R.ok(listVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngBuildingDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | import com.panzhihua.service_community.service.ComActBuildingService; |
| | | import com.panzhihua.service_community.service.GridBuildRelationService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/10 13:46 |
| | | */ |
| | | @Service |
| | | public class ComActBuildingServiceImpl extends ServiceImpl<ComMngBuildingDAO, ComMngBuildingDO> implements ComActBuildingService { |
| | | |
| | | @Resource |
| | | private ComActVillageDAO comActVillageDAO; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private GridBuildRelationService gridBuildRelationService; |
| | | |
| | | @Override |
| | | public R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId) { |
| | | ArrayList<ComMngBuildingDO> list = Lists.newArrayList(); |
| | | List<GridBuildRelationDO> keyList = new ArrayList<>(); |
| | | List<ComMngPopulationImportErrorVO> errorList = new ArrayList<>(); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("重复楼栋"); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for(ComMngBuildingExcelVO vo:newVoList){ |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getAlley()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | if(comMngVillageDO == null){ |
| | | continue; |
| | | } |
| | | List<ComMngBuildingDO> buildingDOList = this.baseMapper.selectList(new QueryWrapper<ComMngBuildingDO>().eq("street_id",comMngVillageDO.getStreetId()).eq("act_id",communityId).eq("village_id",comMngVillageDO.getVillageId()).eq("name",vo.getName())); |
| | | if(buildingDOList.size() > 0){ |
| | | sb.append("街路巷:").append(vo.getAlley()).append(",门牌号:").append(vo.getDoorNo()).append(",楼栋号:").append(vo.getName()).append(";"); |
| | | continue; |
| | | } |
| | | ComMngBuildingDO comMngBuildingDO = new ComMngBuildingDO(); |
| | | BeanUtils.copyProperties(vo,comMngBuildingDO); |
| | | comMngBuildingDO.setActId(comMngVillageDO.getCommunityId()); |
| | | comMngBuildingDO.setStreetId(comMngVillageDO.getStreetId()); |
| | | comMngBuildingDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | ComActDO actDO = comActDAO.selectById(comMngVillageDO.getCommunityId()); |
| | | StringBuilder path = new StringBuilder(); |
| | | path.append(vo.getAlley()).append(">").append(actDO.getName()).append(comMngVillageDO.getName()).append(">").append(vo.getName()); |
| | | comMngBuildingDO.setPath(path.toString()); |
| | | comMngBuildingDO.setGridId(vo.getGridId()); |
| | | list.add(comMngBuildingDO); |
| | | GridBuildRelationDO gridBuildRelation = getGridBuildRelationDO(communityId, comMngVillageDO.getStreetId(), vo, comMngBuildingDO); |
| | | keyList.add(gridBuildRelation); |
| | | } |
| | | |
| | | if(list.size()>0){ |
| | | this.saveBatch(list); |
| | | } |
| | | if(sb.length() > 0 && !StringUtils.isEmpty(sb.toString())){ |
| | | errorList.add(importErrorVO); |
| | | return R.fail(JSON.toJSONString(errorList)); |
| | | } |
| | | gridBuildRelationService.saveBatchGridBuildRelation(keyList); |
| | | this.saveBatch(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | | public GridBuildRelationDO getGridBuildRelationDO(Long communityId, Long streetId, ComMngBuildingExcelVO vo, ComMngBuildingDO comMngBuildingDO) { |
| | | GridBuildRelationDO gridBuildRelation = new GridBuildRelationDO(); |
| | | gridBuildRelation.setId(Snowflake.getId()); |
| | | gridBuildRelation.setBuildId(comMngBuildingDO.getId()); |
| | | gridBuildRelation.setBuildName(comMngBuildingDO.getPath()); |
| | | gridBuildRelation.setVillageId(comMngBuildingDO.getVillageId()); |
| | | gridBuildRelation.setGridCommunityId(communityId); |
| | | gridBuildRelation.setGridStreetId(streetId); |
| | | if (vo.getGridId() != null) { |
| | | gridBuildRelation.setGridId(Long.valueOf(vo.getGridId())); |
| | | } |
| | | gridBuildRelation.setGridName(vo.getGridName()); |
| | | gridBuildRelation.setType(1); |
| | | gridBuildRelation.setCreateAt(new Date()); |
| | | return gridBuildRelation; |
| | | } |
| | | } |
| | |
| | | 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.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.service_community.dao.*; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail("用户信息不存在"); |
| | | } |
| | | if(StringUtils.isNotEmpty(comMngPopulationDO.getBirthday())){//计算年龄 |
| | | comMngPopulationDO.setAge(AgeUtils.getAgeFromBirthTimes(comMngPopulationDO.getBirthday())); |
| | | } |
| | | // if(StringUtils.isNotEmpty(comMngPopulationDO.getBirthday())){//计算年龄 |
| | | // comMngPopulationDO.setAge(AgeUtils.getAgeFromBirthTimes(comMngPopulationDO.getBirthday())); |
| | | // } |
| | | |
| | | ComMngPopulationVO comMngPopulationVO = new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(comMngPopulationDO, comMngPopulationVO); |
| | | |
| | | //查询户主关系信息 |
| | | List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByUserId(comMngPopulationDO.getHouseId(),comMngPopulationDO.getId()); |
| | | if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | // List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByUserId(comMngPopulationDO.getHouseId(),comMngPopulationDO.getId()); |
| | | // if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | // comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | // } |
| | | |
| | | //查询当前用户电子档信息 |
| | | if(!StringUtils.isEmpty(comMngPopulationDO.getCardNo())){ |
| | |
| | | //查询该社区的省市区地址 |
| | | AreaAddressVO areaAddressVO = populationDAO.getAreaAddress(comActDO.getProvinceCode(),comActDO.getCityCode(),comActDO.getAreaCode()); |
| | | //查询社区上街道信息 |
| | | String street = ""; |
| | | String streetName = ""; |
| | | if(comActDO.getStreetId() != null){ |
| | | ComStreetDO streetDO = comStreetDAO.selectById(comActDO.getStreetId()); |
| | | if(streetDO != null){ |
| | | street = streetDO.getName(); |
| | | streetName = streetDO.getName(); |
| | | } |
| | | } |
| | | int index = 2; |
| | | StringBuilder areaPath = new StringBuilder(); |
| | | areaPath.append(areaAddressVO.getProvince()).append(">").append(areaAddressVO.getCity()).append(">").append(areaAddressVO.getDistrict()).append(">"); |
| | | //处理实有人口信息 |
| | | List<ComMngPopulationDO> savePopulList = new ArrayList<>(); |
| | | List<ComMngPopulationHouseDO> saveHouseList = new ArrayList<>(); |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | String address = ""; |
| | | //查询街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("查无:" + vo.getRoad() + vo.getDoorNo() + "小区/房租地址,请先新建地址"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第7、8列"); |
| | | importErrorVO.setErrorMsg("街路巷或小区号不存在"); |
| | | importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:"+vo.getDoorNo()); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | // index++; |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | address = areaAddressVO.getProvince() + areaAddressVO.getCity() |
| | | + areaAddressVO.getDistrict() + street + comMngVillageDO.getAlley() + comMngVillageDO.getHouseNum() |
| | | + areaAddressVO.getDistrict() + streetName + comMngVillageDO.getAlley() + comMngVillageDO.getHouseNum() |
| | | + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); |
| | | vo.setAddress(address); |
| | | |
| | |
| | | .eq(ComMngPopulationHouseDO::getFloor,vo.getFloor()).eq(ComMngPopulationHouseDO::getUnitNo,vo.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,vo.getHouseNo())); |
| | | if(populationHouseDO == null){ |
| | | boolean isExits = true; |
| | | if(!saveHouseList.isEmpty()){ |
| | | for (ComMngPopulationHouseDO saveHouse:saveHouseList){ |
| | | if(saveHouse.getVillageId().equals(comMngVillageDO.getVillageId()) |
| | | && saveHouse.getFloor().equals(vo.getFloor()) && saveHouse.getUnitNo().equals(vo.getUnitNo()) |
| | | && saveHouse.getHouseNo().equals(vo.getHouseNo())){ |
| | | populationHouseDO = saveHouse; |
| | | isExits = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(isExits){ |
| | | //查询该房屋未建立,执行建立房屋信息 |
| | | populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationHouseDO.setCommunityId(communityId); |
| | | populationHouseDO.setFloor(vo.getFloor()); |
| | | populationHouseDO.setUnitNo(vo.getUnitNo()); |
| | | populationHouseDO.setHouseNo(vo.getHouseNo()); |
| | | populationHouseDO.setAddress(address); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | } |
| | | if(vo.getHouseStatus() != null){ |
| | | populationHouseDO.setStatus(vo.getHouseStatus()); |
| | | } |
| | | if(vo.getHousePurpose() != null){ |
| | | populationHouseDO.setPurpose(vo.getHousePurpose()); |
| | | } |
| | | if(vo.getControlStatus() != null){ |
| | | populationHouseDO.setControlStatus(vo.getControlStatus()); |
| | | } |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | saveHouseList.add(populationHouseDO); |
| | | } |
| | | //房屋信息不存在建立房屋信息 |
| | | populationHouseDO = savePopulationHouse(vo,comMngVillageDO,communityId,address,areaPath,comActDO.getName()); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | //空户处理完房屋信息,直接返回 |
| | | continue; |
| | | } |
| | | |
| | | String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); |
| | | //判断实有人口是否已存在 |
| | | ComMngPopulationDO populationDO = this.baseMapper.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo,AESUtil.encrypt128(vo.getCardNo(), aesKey)).eq(ComMngPopulationDO::getName,vo.getName())); |
| | | .eq(ComMngPopulationDO::getCardNo,cardNoAES)); |
| | | if(populationDO == null){ |
| | | if(savePopulList.size() > 0){ |
| | | String name = vo.getName(); |
| | | String cardNo = AESUtil.encrypt128(vo.getCardNo(), aesKey); |
| | | if(savePopulList.stream().anyMatch(populDo -> name.equals(populDo.getName()) && cardNo.equals(populDo.getCardNo()))){ |
| | | //实有人口已存在,判断录入的这个房屋信息是否是用户的居住地 |
| | | for (ComMngPopulationDO savePopul:savePopulList) { |
| | | if(savePopul.getName().equals(name) && savePopul.getCardNo().equals(cardNo)){ |
| | | if(vo.getIsResidence() != null && vo.getIsResidence().equals(PopulIsOksEnum.YES.getCode())) { |
| | | savePopul.setRoad(vo.getRoad()); |
| | | savePopul.setDoorNo(vo.getDoorNo()); |
| | | savePopul.setFloor(vo.getFloor()); |
| | | savePopul.setUnitNo(vo.getUnitNo()); |
| | | savePopul.setHouseNo(vo.getHouseNo()); |
| | | savePopul.setHouseAddress(vo.getAddress()); |
| | | savePopul.setHouseId(populationHouseDO.getId()); |
| | | savePopul.setCardNo(cardNo); |
| | | savePopul.setPhone(AESUtil.encrypt128(savePopul.getPhone(), aesKey)); |
| | | this.baseMapper.updateById(savePopul); |
| | | } |
| | | populationDO = savePopul; |
| | | break; |
| | | } |
| | | } |
| | | }else{ |
| | | //不存在实有人口则新增 |
| | | populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | populationDO.setUpdateAt(new Date()); |
| | | this.baseMapper.insert(populationDO); |
| | | savePopulList.add(populationDO); |
| | | index++; |
| | | } |
| | | }else { |
| | | //不存在实有人口则新增 |
| | | populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | populationDO.setUpdateAt(new Date()); |
| | | this.baseMapper.insert(populationDO); |
| | | savePopulList.add(populationDO); |
| | | index++; |
| | | } |
| | | //不存在实有人口,则新增 |
| | | populationDO = savePopulationDO(vo,comActDO,comMngVillageDO,cardNoAES); |
| | | }else { |
| | | //实有人口已存在,判断录入的这个房屋信息是否是用户的居住地 |
| | | if(vo.getIsResidence() != null && vo.getIsResidence().equals(PopulIsOksEnum.YES.getCode())){ |
| | | populationDO.setRoad(vo.getRoad()); |
| | | populationDO.setDoorNo(vo.getDoorNo()); |
| | | populationDO.setFloor(vo.getFloor()); |
| | | populationDO.setUnitNo(vo.getUnitNo()); |
| | | populationDO.setHouseNo(vo.getHouseNo()); |
| | | populationDO.setHouseAddress(address); |
| | | populationDO.setCardNo(AESUtil.encrypt128(populationDO.getCardNo(), aesKey)); |
| | | populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | populationDO.setHouseId(populationHouseDO.getId()); |
| | | this.baseMapper.updateById(populationDO); |
| | | //如果存在人口信息,且是自用房,则更新人口默认的房屋信息 |
| | | if(vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())){ |
| | | populationDO = updatePopulationHouseUse(vo,populationDO,cardNoAES); |
| | | } |
| | | } |
| | | |
| | | //处理实有房屋居住信息 |
| | | //处理实有人口房屋居住信息 |
| | | if(populationDO != null){ |
| | | ComMngPopulationHouseUserDO populationHouseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>() |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getHouseId,populationHouseDO.getId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,populationDO.getId())); |
| | | if(populationHouseUserDO == null){ |
| | | populationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | populationHouseUserDO.setId(Snowflake.getId()); |
| | | populationHouseUserDO.setHouseId(populationHouseDO.getId()); |
| | | populationHouseUserDO.setPopulId(populationDO.getId()); |
| | | populationHouseUserDO.setRelation(populationDO.getRelation()); |
| | | populationHouseUserDO.setRelation(vo.getRelation()); |
| | | populationHouseUserDO.setRelationId(vo.getIsRent()); |
| | | comMngPopulationHouseUserDAO.insert(populationHouseUserDO); |
| | | } |
| | | } |
| | |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | private ComMngPopulationDO updatePopulationHouseUse(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO,String cardNoAES) throws Exception { |
| | | populationDO.setRoad(vo.getRoad()); |
| | | populationDO.setDoorNo(vo.getDoorNo()); |
| | | populationDO.setFloor(vo.getFloor()); |
| | | populationDO.setUnitNo(vo.getUnitNo()); |
| | | populationDO.setHouseNo(vo.getHouseNo()); |
| | | populationDO.setCardNo(cardNoAES); |
| | | populationDO.setCardNoStr(vo.getCardNo()); |
| | | if(StringUtils.isNotEmpty(populationDO.getPhone())){ |
| | | populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | } |
| | | this.baseMapper.updateById(populationDO); |
| | | return populationDO; |
| | | } |
| | | |
| | | private ComMngPopulationDO savePopulationDO(ComMngPopulationServeExcelVO vo, ComActDO comActDO, ComMngVillageDO comMngVillageDO,String cardNoAES) { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | populationDO.setId(Snowflake.getId()); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDO.setCardNo(cardNoAES); |
| | | populationDO.setCardNoStr(vo.getCardNo()); |
| | | populationDO.setUpdateAt(new Date()); |
| | | this.baseMapper.insert(populationDO); |
| | | return populationDO; |
| | | } |
| | | |
| | | private ComMngPopulationHouseDO savePopulationHouse(ComMngPopulationServeExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, String address, StringBuilder areaPath,String actName) { |
| | | //查询该房屋未建立,执行建立房屋信息 |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | | populationHouseDO.setStreetId(comMngVillageDO.getStreetId()); |
| | | populationHouseDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationHouseDO.setAlley(vo.getRoad()); |
| | | populationHouseDO.setHouseNum(vo.getDoorNo()); |
| | | populationHouseDO.setCode(vo.getDoorNo()); |
| | | populationHouseDO.setStatus(vo.getIsRent()); |
| | | populationHouseDO.setCommunityId(communityId); |
| | | populationHouseDO.setFloor(vo.getFloor()); |
| | | populationHouseDO.setUnitNo(vo.getUnitNo()); |
| | | populationHouseDO.setHouseNo(vo.getHouseNo()); |
| | | populationHouseDO.setAddress(address); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | populationHouseDO.setConstructPurpose(vo.getBuildPurpose()); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | housePath.append(populationHouseDO.getAlley()).append(">").append(actName).append(">").append(comMngVillageDO.getName()).append(">").append(address); |
| | | populationHouseDO.setPath(areaPath.toString()+ housePath.toString()); |
| | | try { |
| | | populationHouseDO.setConstructArea(new BigDecimal(vo.getBuildArea())); |
| | | }catch (Exception e){ |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())){ |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | } |
| | | if(vo.getHouseStatus() != null){ |
| | | populationHouseDO.setStatus(vo.getHouseStatus()); |
| | | } |
| | | if(vo.getHousePurpose() != null){ |
| | | populationHouseDO.setPurpose(vo.getHousePurpose()); |
| | | } |
| | | if(vo.getControlStatus() != null){ |
| | | populationHouseDO.setControlStatus(vo.getControlStatus()); |
| | | } |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | return populationHouseDO; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public R editTagPopulationByCardNo(ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO) { |
| | | ComMngPopulationDO comMngPopulationDO = getPopulationByCardNo(comMngPopulationTagCardNoDTO.getCardNo()); |
| | | if (comMngPopulationDO == null) { |
| | | return R.fail("未查询到人口记录"); |
| | | } |
| | | ComMngPopulationDO comMngPopulation = new ComMngPopulationDO(); |
| | | if(comMngPopulationDO.getLabel()!=null) { |
| | | if(!comMngPopulationDO.getLabel().contains(comMngPopulationTagCardNoDTO.getLabel())) { |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel().concat(",").concat(comMngPopulationDO.getLabel())); |
| | | } |
| | | }else{ |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel()); |
| | | } |
| | | comMngPopulation.setCardNo(null); |
| | | comMngPopulation.setId(comMngPopulationDO.getId()); |
| | | int nub = populationDAO.updateById(comMngPopulation); |
| | | if (nub < 1) { |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public ComMngPopulationDO getPopulationByCardNo(String cardNo) { |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(cardNo, aesKey); |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<ComMngPopulationDO>() |
| | | .eq("card_no",aesCardNo) |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询业务-加密证件信息出错"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R screenStatistic(Long communityId) { |
| | | ComActPopulationScreenVO comActPopulationScreenVO = new ComActPopulationScreenVO(); |
| | | ComMngPopulationTotalVO vo = populationDAO.getPopulationTotalByAdmin(communityId); |
| | | comActPopulationScreenVO.setTotalNum(vo.getPopulationTotal() == null ? 0 : vo.getPopulationTotal()); |
| | | comActPopulationScreenVO.setLocalNum(vo.getLocalTotal() == null ? 0 : vo.getLocalTotal().longValue()); |
| | | comActPopulationScreenVO.setOutNum(vo.getOutTotal() == null ? 0 : vo.getOutTotal().longValue()); |
| | | comActPopulationScreenVO.setSpecialNum(vo.getSpecialTotal() == null ? 0 : vo.getSpecialTotal().longValue()); |
| | | //统计已使用社区通人数 |
| | | Long count = populationDAO.countUsedCommunityPopulation(communityId); |
| | | comActPopulationScreenVO.setUsedCommunityNum(count == null ? 0 : count); |
| | | |
| | | //统计性别 |
| | | Map<String,Long> sexMap = populationDAO.countBySex(communityId); |
| | | comActPopulationScreenVO.setWoman(sexMap.get("woman") == null ? 0L : sexMap.get("woman")); |
| | | comActPopulationScreenVO.setManNum(sexMap.get("man") == null ? 0L : sexMap.get("man")); |
| | | int manPoint = (int) (((double)comActPopulationScreenVO.getManNum()/(double)comActPopulationScreenVO.getTotalNum())*100); |
| | | comActPopulationScreenVO.setManPoint(manPoint); |
| | | comActPopulationScreenVO.setWomanPoint(100 - manPoint); |
| | | |
| | | //统计年龄结构 |
| | | setAgeGroup(comActPopulationScreenVO,communityId); |
| | | //统计学历 |
| | | setCultureGroup(comActPopulationScreenVO,communityId); |
| | | |
| | | return R.ok(comActPopulationScreenVO); |
| | | } |
| | | |
| | | |
| | | private void setCultureGroup(ComActPopulationScreenVO comActPopulationScreenVO, Long communityId) { |
| | | Map<String,Long> cultureMap = populationDAO.countByCulture(communityId); |
| | | List<ComActPopulationCultureVO> cultureGroup = new ArrayList<>(); |
| | | ComActPopulationCultureVO xx = new ComActPopulationCultureVO(); |
| | | xx.setLevel(PopulCultureLevelEnum.XX.getName()); |
| | | xx.setNum(cultureMap.get("xx")); |
| | | cultureGroup.add(xx); |
| | | |
| | | ComActPopulationCultureVO cz = new ComActPopulationCultureVO(); |
| | | cz.setLevel(PopulCultureLevelEnum.CZ.getName()); |
| | | cz.setNum(cultureMap.get("cz")); |
| | | cultureGroup.add(cz); |
| | | |
| | | ComActPopulationCultureVO gz = new ComActPopulationCultureVO(); |
| | | gz.setLevel(PopulCultureLevelEnum.GZ.getName()); |
| | | gz.setNum(cultureMap.get("gz")); |
| | | cultureGroup.add(gz); |
| | | |
| | | ComActPopulationCultureVO zz = new ComActPopulationCultureVO(); |
| | | zz.setLevel(PopulCultureLevelEnum.ZZ.getName()); |
| | | zz.setNum(cultureMap.get("zz")); |
| | | cultureGroup.add(zz); |
| | | |
| | | ComActPopulationCultureVO dz = new ComActPopulationCultureVO(); |
| | | dz.setLevel(PopulCultureLevelEnum.DZ.getName()); |
| | | dz.setNum(cultureMap.get("dz")); |
| | | cultureGroup.add(dz); |
| | | |
| | | ComActPopulationCultureVO bk = new ComActPopulationCultureVO(); |
| | | bk.setLevel(PopulCultureLevelEnum.BK.getName()); |
| | | bk.setNum(cultureMap.get("bk")); |
| | | cultureGroup.add(bk); |
| | | |
| | | ComActPopulationCultureVO ss = new ComActPopulationCultureVO(); |
| | | ss.setLevel(PopulCultureLevelEnum.SS.getName()); |
| | | ss.setNum(cultureMap.get("ss")); |
| | | cultureGroup.add(ss); |
| | | |
| | | ComActPopulationCultureVO bs = new ComActPopulationCultureVO(); |
| | | bs.setLevel(PopulCultureLevelEnum.BS.getName()); |
| | | bs.setNum(cultureMap.get("bs")); |
| | | cultureGroup.add(bs); |
| | | |
| | | ComActPopulationCultureVO qt = new ComActPopulationCultureVO(); |
| | | qt.setLevel(PopulCultureLevelEnum.QT.getName()); |
| | | qt.setNum(cultureMap.get("qt")); |
| | | cultureGroup.add(qt); |
| | | |
| | | comActPopulationScreenVO.setCultureGroup(cultureGroup); |
| | | } |
| | | |
| | | private void setAgeGroup(ComActPopulationScreenVO comActPopulationScreenVO,Long communityId) { |
| | | Map<String,Long> ageMap = populationDAO.countByAge(communityId); |
| | | List<ComMngPopulationAgeVO> ageList = new ArrayList<>(); |
| | | ComMngPopulationAgeVO ageVO16 = new ComMngPopulationAgeVO(); |
| | | ageVO16.setGroup("0-16岁"); |
| | | ageVO16.setNum(ageMap.get("age16")); |
| | | ageList.add(ageVO16); |
| | | ComMngPopulationAgeVO ageVO25 = new ComMngPopulationAgeVO(); |
| | | ageVO25.setGroup("16-25岁"); |
| | | ageVO25.setNum(ageMap.get("age25")); |
| | | ageList.add(ageVO25); |
| | | |
| | | ComMngPopulationAgeVO ageVO35 = new ComMngPopulationAgeVO(); |
| | | ageVO35.setGroup("25-35岁"); |
| | | ageVO35.setNum(ageMap.get("age35")); |
| | | ageList.add(ageVO35); |
| | | ComMngPopulationAgeVO ageVO45 = new ComMngPopulationAgeVO(); |
| | | ageVO45.setGroup("35-45岁"); |
| | | ageVO45.setNum(ageMap.get("age45")); |
| | | ageList.add(ageVO45); |
| | | ComMngPopulationAgeVO ageVO55 = new ComMngPopulationAgeVO(); |
| | | ageVO55.setGroup("45-55岁"); |
| | | ageVO55.setNum(ageMap.get("age55")); |
| | | ageList.add(ageVO55); |
| | | ComMngPopulationAgeVO ageVO55over = new ComMngPopulationAgeVO(); |
| | | ageVO55over.setGroup("55岁以上"); |
| | | ageVO55over.setNum(ageMap.get("age55over")); |
| | | ageList.add(ageVO55over); |
| | | comActPopulationScreenVO.setAgeGroup(ageList); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new)); |
| | | } |
| | |
| | | BeanUtils.copyProperties(vo, comMngVillageDO); |
| | | comMngVillageDO.setCommunityId(comActDO.getCommunityId()); |
| | | comMngVillageDO.setStreetId(comActDO.getStreetId()); |
| | | StringBuilder path = new StringBuilder(); |
| | | path.append(vo.getAlley()).append(">").append(vo.getHouseNum()).append(">").append(vo.getGroupAt()); |
| | | comMngVillageDO.setPath(path.toString()); |
| | | comMngVillageDO.setUpdateAt(new Date()); |
| | | comMngVillageDOS.add(comMngVillageDO); |
| | | }); |
| | | this.saveBatch(comMngVillageDOS); |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.GridBuildRelationDAO; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | import com.panzhihua.service_community.service.GridBuildRelationService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Service |
| | | public class GridBuildRelationServiceImpl extends ServiceImpl<GridBuildRelationDAO, GridBuildRelationDO> implements GridBuildRelationService { |
| | | |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * 处理逻辑:同一个人的信息可以被多个社区重复录入 |
| | | * 一个人的信息如果被同一个社区重复导入。以最新的导入数据为准。将之前的数据进行更新操作。 |
| | | * |
| | | * @param keyList 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R saveBatchGridBuildRelation(List<GridBuildRelationDO> keyList) { |
| | | keyList.forEach(keyPersonInfoDTO -> { |
| | | GridBuildRelationDO dbKeyPerson = checkExistFromDb(keyPersonInfoDTO); |
| | | if (dbKeyPerson != null) { |
| | | //已经存在数据,进行数据更新操作 |
| | | GridBuildRelationDO keyPersonInfoDO = new GridBuildRelationDO(); |
| | | BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO); |
| | | keyPersonInfoDO.setId(dbKeyPerson.getId()); |
| | | updateById(keyPersonInfoDO); |
| | | } else { |
| | | GridBuildRelationDO keyPersonInfoDO = new GridBuildRelationDO(); |
| | | BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO); |
| | | save(keyPersonInfoDO); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private GridBuildRelationDO checkExistFromDb(GridBuildRelationDO gridBuildRelationDO) { |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<GridBuildRelationDO>() |
| | | .eq("grid_community_id", gridBuildRelationDO.getGridCommunityId()) |
| | | .eq("grid_id", gridBuildRelationDO.getGridId()) |
| | | .eq("village_id", gridBuildRelationDO.getVillageId()) |
| | | .eq("build_id", gridBuildRelationDO.getBuildId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.enums.KeyPersonLabelEnum; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO; |
| | | import com.panzhihua.common.model.dtos.community.KeyPersonInfoDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.KeyPersonInfoDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import com.panzhihua.service_community.model.dos.KeyPersonInfoDO; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import com.panzhihua.service_community.service.KeyPersonInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 |
| | | * description 特殊人群管理API |
| | | * |
| | | * @author manailin |
| | | * Date 2021-01-22 15:30 |
| | | **/ |
| | | @Service |
| | | public class KeyPersonInfoServiceImpl extends ServiceImpl<KeyPersonInfoDAO, KeyPersonInfoDO> implements KeyPersonInfoService { |
| | | |
| | | @Resource |
| | | private ComMngPopulationService comMngPopulationService; |
| | | |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | /** |
| | | * description 批量保存重点人群人员信息 |
| | | * 处理逻辑:同一个人的信息可以被多个社区重复录入 |
| | | * 一个人的信息如果被同一个社区重复导入。以最新的导入数据为准。将之前的数据进行更新操作。 |
| | | * |
| | | * @param list 重点人群信息 |
| | | * @return R 保存结果 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R saveBatchKeyPerson(List<KeyPersonInfoDTO> list) { |
| | | list.forEach(keyPersonInfoDTO -> { |
| | | KeyPersonInfoDO dbKeyPerson = checkExistFromDb(keyPersonInfoDTO); |
| | | if (dbKeyPerson != null) { |
| | | //已经存在数据,进行数据更新操作 |
| | | KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO(); |
| | | BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO); |
| | | keyPersonInfoDO.setId(dbKeyPerson.getId()); |
| | | ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO = new ComMngPopulationTagCardNoDTO(); |
| | | comMngPopulationTagCardNoDTO.setCardNo(dbKeyPerson.getCardNo()); |
| | | comMngPopulationTagCardNoDTO.setLabel(calculateLabel(dbKeyPerson)); |
| | | comMngPopulationService.editTagPopulationByCardNo(comMngPopulationTagCardNoDTO); |
| | | ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo()); |
| | | if(population !=null){ |
| | | keyPersonInfoDO.setUserId(population.getId()); |
| | | } |
| | | keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType())); |
| | | keyPersonInfoDO.setInvalid(false); |
| | | updateById(keyPersonInfoDO); |
| | | } else { |
| | | KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO(); |
| | | BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO); |
| | | ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo()); |
| | | if(population !=null){ |
| | | keyPersonInfoDO.setUserId(population.getId()); |
| | | } |
| | | keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType())); |
| | | keyPersonInfoDO.setInvalid(false); |
| | | save(keyPersonInfoDO); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private String calculateLabel(KeyPersonInfoDO dbKeyPerson) { |
| | | switch (dbKeyPerson.getVisiterType()) { |
| | | case 1: |
| | | return KeyPersonLabelEnum.XD.getName(); |
| | | case 2: |
| | | return KeyPersonLabelEnum.ZJ.getName(); |
| | | |
| | | case 3: |
| | | return KeyPersonLabelEnum.XJ.getName(); |
| | | |
| | | case 4: |
| | | return KeyPersonLabelEnum.QT.getName(); |
| | | default: |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | private KeyPersonInfoDO checkExistFromDb(KeyPersonInfoDTO keyPersonInfoDTO) { |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(keyPersonInfoDTO.getCardNo(), aesKey); |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<KeyPersonInfoDO>() |
| | | .eq("act_id", keyPersonInfoDTO.getActId()) |
| | | .eq("card_no",aesCardNo) |
| | | .eq("visiter_type", keyPersonInfoDTO.getVisiterType()) |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询特殊人群业务-加密证件信息出错"); |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.service.ScreenWorkService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @author xyh |
| | | * @date 2021/6/15 15:14 |
| | | */ |
| | | @Service |
| | | public class ScreenWorkServiceImpl implements ScreenWorkService { |
| | | |
| | | private static final Integer pageSize = 200; |
| | | |
| | | @Resource |
| | | private ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | |
| | | @Resource |
| | | private ComActMicroWishDAO comActMicroWishDAO; |
| | | |
| | | @Resource |
| | | private ComActActivityDAO actActivityDAO; |
| | | |
| | | @Resource |
| | | private ComActDiscussDAO comActDiscussDAO; |
| | | |
| | | @Resource |
| | | private ComPbDynDAO comPbDynDAO; |
| | | |
| | | @Resource |
| | | private ComActEasyPhotoDAO comActEasyPhotoDAO; |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | |
| | | @Override |
| | | public R statisticNeighborCircle(Long communityId) { |
| | | |
| | | ComActNeighborCircleScreenVO comActNeighborCircleScreenVO = new ComActNeighborCircleScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = comActNeighborCircleDAO.countByCommunityId(communityId,date); |
| | | comActNeighborCircleScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | comActNeighborCircleScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); |
| | | Map<String,Long> sumMap = comActNeighborCircleDAO.sumScreenNum(communityId); |
| | | comActNeighborCircleScreenVO.setFabulousNum(sumMap.get("fabulousNum") == null ? 0L : sumMap.get("fabulousNum")); |
| | | comActNeighborCircleScreenVO.setCommentNum(sumMap.get("commentNum") == null ? 0L : sumMap.get("commentNum")); |
| | | comActNeighborCircleScreenVO.setSharedNum(sumMap.get("forwardNum") == null ? 0L : sumMap.get("forwardNum")); |
| | | //查询最近发布的邻里圈 |
| | | comActNeighborCircleScreenVO.setList(comActNeighborCircleDAO.screenNeighborCircle(communityId,pageSize)); |
| | | //查询最近发布的邻里圈图片 |
| | | comActNeighborCircleScreenVO.setImgs(convertStringList(comActNeighborCircleDAO.screenNeighborCircleImgs(communityId,pageSize))); |
| | | return R.ok(comActNeighborCircleScreenVO); |
| | | } |
| | | |
| | | @Override |
| | | public R wish(Long communityId) { |
| | | ComActMicroWishScreenVO wishScreenVO = new ComActMicroWishScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | //统计本月新增,累计实现,待实现 |
| | | Map<String,Long> countMap = comActMicroWishDAO.countByCommunityId(communityId,date); |
| | | wishScreenVO.setCompletedNum(countMap.get("completedNum") == null ? 0L : countMap.get("completedNum")); |
| | | wishScreenVO.setWillNum(countMap.get("willNum") == null ? 0L : countMap.get("willNum")); |
| | | wishScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | //微心愿轮播图片 |
| | | wishScreenVO.setImgs(convertStringList(comActMicroWishDAO.getAllImgs(communityId,pageSize))); |
| | | return R.ok(wishScreenVO); |
| | | } |
| | | |
| | | |
| | | |
| | | private List<String> convertStringList(List<String> imgList) { |
| | | List<String> imgs = new ArrayList<>(); |
| | | for(String img:imgList){ |
| | | if(StringUtils.isEmpty(img)){ |
| | | continue; |
| | | } |
| | | String[] arrs = img.split(","); |
| | | if(arrs.length > 1){ |
| | | for(String arr: arrs){ |
| | | imgs.add(arr); |
| | | } |
| | | }else{ |
| | | imgs.add(img); |
| | | } |
| | | } |
| | | return imgs; |
| | | } |
| | | |
| | | @Override |
| | | public R activity(Long communityId) { |
| | | ComActActivityScreenVO comActActivityScreenVO = new ComActActivityScreenVO(); |
| | | //统计本月新增、居民活动,志愿者活动 |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = actActivityDAO.countByCommunityId(communityId,date); |
| | | comActActivityScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); |
| | | comActActivityScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | comActActivityScreenVO.setCommonNum(countMap.get("commonNum") == null ? 0L : countMap.get("commonNum")); |
| | | comActActivityScreenVO.setCommonPeopleNum(countMap.get("commonPeopleNum") == null ? 0L : countMap.get("commonPeopleNum")); |
| | | comActActivityScreenVO.setVolunteerNum(countMap.get("volunteerNum") == null ? 0L : countMap.get("volunteerNum")); |
| | | comActActivityScreenVO.setVolunteerPeopleNum(countMap.get("volunteerPeopleNum") == null ? 0L : countMap.get("volunteerPeopleNum")); |
| | | //最近活动 |
| | | comActActivityScreenVO.setList(actActivityDAO.screenActivity(communityId,pageSize)); |
| | | return R.ok(comActActivityScreenVO); |
| | | } |
| | | |
| | | @Override |
| | | public R discuss(Long communityId) { |
| | | ComActDiscussScreenVO discussScreenVO = new ComActDiscussScreenVO(); |
| | | //统计本月新增,总共,图文,投票 |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = comActDiscussDAO.countByCommunityId(communityId,date); |
| | | discussScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | discussScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); |
| | | discussScreenVO.setImgNum(countMap.get("imgNum") == null ? 0L : countMap.get("imgNum")); |
| | | discussScreenVO.setImgPeopleNum(countMap.get("imgPeopleNum") == null ? 0L : countMap.get("imgPeopleNum")); |
| | | discussScreenVO.setVoteNum(discussScreenVO.getTotalNum() - discussScreenVO.getImgNum()); |
| | | discussScreenVO.setVotePeopleNum(countMap.get("votePeopleNum") == null ? 0L : countMap.get("votePeopleNum")); |
| | | discussScreenVO.setList(comActDiscussDAO.screenDiscuss(communityId,pageSize)); |
| | | return R.ok(discussScreenVO); |
| | | } |
| | | |
| | | @Override |
| | | public R pbWork(Long communityId) { |
| | | ComPbWorkScreenVO pbWorkScreenVO = new ComPbWorkScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = comPbDynDAO.countByCommunityId(communityId,date); |
| | | pbWorkScreenVO.setActivityNum(countMap.get("activityNum") == null ? 0L : countMap.get("activityNum")); |
| | | pbWorkScreenVO.setDynNum(countMap.get("dynNum") == null ? 0L : countMap.get("dynNum")); |
| | | pbWorkScreenVO.setTotalNum(pbWorkScreenVO.getActivityNum() + pbWorkScreenVO.getDynNum()); |
| | | pbWorkScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); |
| | | //统计近半年数据 |
| | | List<PbWorkVO> list = new ArrayList<>(); |
| | | for(PbWorkVO workVO: listHalfYear()){ |
| | | PbWorkVO result = comPbDynDAO.countByTime(workVO.getStart(),workVO.getEnd(),communityId); |
| | | result.setMonth(workVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | pbWorkScreenVO.setList(list); |
| | | return R.ok(pbWorkScreenVO); |
| | | } |
| | | |
| | | |
| | | private List<PbWorkVO> listHalfYear() { |
| | | List<PbWorkVO> dateList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for(int i= 6;i>=1;i--){ |
| | | Date date = DateUtils.getDateM(now,i); |
| | | DateTime endDay = DateUtil.endOfMonth(date); |
| | | int m = endDay.month();//月份 |
| | | int day = DateUtil.dayOfMonth(date); |
| | | int half = day/2; |
| | | String month = DateUtil.format(date,moth_format_str); |
| | | PbWorkVO pbWorkVO = new PbWorkVO(); |
| | | pbWorkVO.setMonth(m+"月上旬"); |
| | | pbWorkVO.setStart(month+ "-01 00:00:00"); |
| | | pbWorkVO.setEnd(month+ "-"+half+" 23:59:58"); |
| | | dateList.add(pbWorkVO); |
| | | PbWorkVO pbWorkVO2 = new PbWorkVO(); |
| | | pbWorkVO2.setMonth(m+"月下旬"); |
| | | pbWorkVO2.setStart(month+ "-"+half+" 23:59:58"); |
| | | pbWorkVO2.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(pbWorkVO2); |
| | | } |
| | | return dateList; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R easyPhoto(Long communityId) { |
| | | ComActEasyPhotoScreenVO comActEasyPhotoScreenVO = new ComActEasyPhotoScreenVO(); |
| | | Map<String,Long> dealMap = comActEasyPhotoDAO.countDeal(communityId); |
| | | comActEasyPhotoScreenVO.setDeal(getList(dealMap)); |
| | | Map<String,Long> pubMap = comActEasyPhotoDAO.countPub(communityId); |
| | | comActEasyPhotoScreenVO.setPub(getList(pubMap)); |
| | | Map<String,Long> approvedMap = comActEasyPhotoDAO.countApproved(communityId); |
| | | comActEasyPhotoScreenVO.setApproved(getList(approvedMap)); |
| | | |
| | | Map<String,Long> countMap = comActEasyPhotoDAO.countByCommunityId(communityId); |
| | | comActEasyPhotoScreenVO.setNoneDeal(countMap.get("noneDeal") == null ? 0L : countMap.get("noneDeal")); |
| | | comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0L : countMap.get("pubPoint")); |
| | | comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0L : countMap.get("dealTime")); |
| | | List<EastPhotoVO> list = new ArrayList<>(); |
| | | for(PbWorkVO workVO: listHalfYear()){ |
| | | String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(workVO.getStart()),moth_format_str); |
| | | EastPhotoVO result = comActEasyPhotoDAO.countByTime(workVO.getStart(),workVO.getEnd(),nowDate,communityId); |
| | | result.setMonth(workVO.getMonth()); |
| | | list.add(result); |
| | | } |
| | | comActEasyPhotoScreenVO.setList(list); |
| | | return R.ok(comActEasyPhotoScreenVO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private List<EasyPhotoPointVO> getList(Map<String, Long> dealMap) { |
| | | Set<Map.Entry<String,Long>> entrySet = dealMap.entrySet(); |
| | | |
| | | List<EasyPhotoPointVO> list = new ArrayList<>(); |
| | | for(Map.Entry<String,Long> en:entrySet){ |
| | | EasyPhotoPointVO easyPhotoPointVO = new EasyPhotoPointVO(); |
| | | easyPhotoPointVO.setTypeName(en.getKey()); |
| | | easyPhotoPointVO.setPoint(en.getValue().intValue()); |
| | | list.add(easyPhotoPointVO); |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R workCount(Long communityId) { |
| | | ComActWorkScreenVO comActWorkScreenVO = new ComActWorkScreenVO(); |
| | | comActWorkScreenVO.setAvgTime("1小时"); |
| | | comActWorkScreenVO.setTotalCompletedPoint(70); |
| | | comActWorkScreenVO.setEveryDayNum("0.3"); |
| | | List<ActWorkCountVO> completetPoint = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto = new ActWorkCountVO(); |
| | | easyPhoto.setName("随手拍"); |
| | | easyPhoto.setNum(10); |
| | | completetPoint.add(easyPhoto); |
| | | ActWorkCountVO wish = new ActWorkCountVO(); |
| | | wish.setName("微心愿"); |
| | | wish.setNum(23); |
| | | completetPoint.add(wish); |
| | | ActWorkCountVO discuss = new ActWorkCountVO(); |
| | | discuss.setName("一起议"); |
| | | discuss.setNum(33); |
| | | completetPoint.add(discuss); |
| | | ActWorkCountVO neighbor = new ActWorkCountVO(); |
| | | neighbor.setName("邻里圈"); |
| | | neighbor.setNum(43); |
| | | completetPoint.add(neighbor); |
| | | ActWorkCountVO pbWork = new ActWorkCountVO(); |
| | | pbWork.setName("党建工作"); |
| | | pbWork.setNum(13); |
| | | completetPoint.add(pbWork); |
| | | ActWorkCountVO activity = new ActWorkCountVO(); |
| | | activity.setName("社区活动"); |
| | | activity.setNum(63); |
| | | completetPoint.add(activity); |
| | | comActWorkScreenVO.setCompletetPoint(completetPoint); |
| | | |
| | | List<ActWorkCountVO> completetPoint2 = new ArrayList<>(); |
| | | ActWorkCountVO easyPhoto2 = new ActWorkCountVO(); |
| | | easyPhoto2.setName("随手拍"); |
| | | easyPhoto2.setNum(10); |
| | | completetPoint2.add(easyPhoto2); |
| | | ActWorkCountVO wish2 = new ActWorkCountVO(); |
| | | wish2.setName("微心愿"); |
| | | wish2.setNum(23); |
| | | completetPoint2.add(wish2); |
| | | ActWorkCountVO discuss2 = new ActWorkCountVO(); |
| | | discuss2.setName("一起议"); |
| | | discuss2.setNum(33); |
| | | completetPoint2.add(discuss2); |
| | | ActWorkCountVO neighbor2 = new ActWorkCountVO(); |
| | | neighbor2.setName("邻里圈"); |
| | | neighbor2.setNum(43); |
| | | completetPoint2.add(neighbor2); |
| | | ActWorkCountVO pbWork2 = new ActWorkCountVO(); |
| | | pbWork2.setName("党建工作"); |
| | | pbWork2.setNum(13); |
| | | completetPoint2.add(pbWork2); |
| | | ActWorkCountVO activity2 = new ActWorkCountVO(); |
| | | activity2.setName("社区活动"); |
| | | activity2.setNum(63); |
| | | completetPoint2.add(activity2); |
| | | comActWorkScreenVO.setNonePoint(completetPoint2); |
| | | return R.ok(comActWorkScreenVO); |
| | | } |
| | | |
| | | } |