Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into shequhuodong
Conflicts:
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActRegistVO.java
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActSignMapper.xml
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | if (StringUtils.isNotEmpty(oneData.get(15))) { |
| | | vo.setCensusRegister(oneData.get(15).trim()); |
| | | } |
| | | if (StringUtils.isEmpty(oneData.get(16))) { |
| | | Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(16)); |
| | | if (isOk.equals(-1)) { |
| | | index++; |
| | | ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); |
| | | setMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的学历有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setCultureLevel(isOk); |
| | | if (StringUtils.isNotEmpty(oneData.get(16))) { |
| | | // Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(16)); |
| | | // if (isOk.equals(-1)) { |
| | | // index++; |
| | | // ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); |
| | | // setMistake(oneData, mistake); |
| | | // mistake.setMistake("您填写的学历有误"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | vo.setCultureLevel(oneData.get(16).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(17))) { |
| | | vo.setCorrectPersonCode(oneData.get(17).trim()); |
| | |
| | | vo.setCustodyPerson(oneData.get(18).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(19))) { |
| | | Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(19)); |
| | | if (isOk.equals(-1)) { |
| | | index++; |
| | | ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); |
| | | setMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的与监护人关系有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setCustodyRelation(isOk); |
| | | // Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(19)); |
| | | // if (isOk.equals(-1)) { |
| | | // index++; |
| | | // ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); |
| | | // setMistake(oneData, mistake); |
| | | // mistake.setMistake("您填写的与监护人关系有误"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | vo.setCustodyRelation(oneData.get(19).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(20))) { |
| | | vo.setCustodyCardNo(oneData.get(20).trim()); |
| | |
| | | vo.setMainRelatives(oneData.get(17).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(18))) { |
| | | Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(18)); |
| | | if (isOk.equals(-1)) { |
| | | index++; |
| | | ComMngPopulationRehabilitationMistakeExcelVO mistake = |
| | | new ComMngPopulationRehabilitationMistakeExcelVO(); |
| | | setRehabilitationMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的与人员关系有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setPatientRelation(isOk); |
| | | // Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(18)); |
| | | // if (isOk.equals(-1)) { |
| | | // index++; |
| | | // ComMngPopulationRehabilitationMistakeExcelVO mistake = |
| | | // new ComMngPopulationRehabilitationMistakeExcelVO(); |
| | | // setRehabilitationMistake(oneData, mistake); |
| | | // mistake.setMistake("您填写的与人员关系有误"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | vo.setPatientRelation(oneData.get(18).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(19))) { |
| | | vo.setRehabReasonAndType(oneData.get(19).trim()); |
| | |
| | | vo.setPhoto(oneData.get(6)); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(7))) { |
| | | Integer isOk = PopulRegiterNatureEnum.getCodeByName(oneData.get(7).trim()); |
| | | if (isOk.equals(-1)) { |
| | | index++; |
| | | ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); |
| | | setVeteransMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的户籍性质有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setRegiterNature(isOk); |
| | | // Integer isOk = PopulRegiterNatureEnum.getCodeByName(oneData.get(7).trim()); |
| | | // if (isOk.equals(-1)) { |
| | | // index++; |
| | | // ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); |
| | | // setVeteransMistake(oneData, mistake); |
| | | // mistake.setMistake("您填写的户籍性质有误"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | vo.setRegiterNature(oneData.get(7).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(8))) { |
| | | vo.setCensusRegister(oneData.get(8).trim()); |
| | |
| | | index++; |
| | | ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); |
| | | setVeteransMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的婚姻关系·有误"); |
| | | mistake.setMistake("您填写的婚姻关系有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | |
| | | private String nickName; |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | @ApiModelProperty("人群标签") |
| | | private String tags; |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("报名时间") |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActRegistExcelVO 社区活动签到表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动签到内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActRegistExcelVO { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份", index = 2) |
| | | private String identity; |
| | | |
| | | @ExcelProperty(value = "电话", index = 4) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "签到时间", index = 0) |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "人群标签", index = 3) |
| | | private String tags; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: SignInActivityVO 活动签到 |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 活动签到 |
| | | * @author: hans |
| | | * @date: 2021/08/25 14:10 |
| | | * title: ComActActEvaluateDO 社区活动签到表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动签到内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("活动签到") |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActRegistVO { |
| | | |
| | | @ApiModelProperty("活动签到主键") |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "以什么身份报名活动 1 志愿者 0 普通居民", example = "1", required = true) |
| | | @Min(value = 0, groups = {AddGroup.class}, message = "报名身份不能为空") |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty(value = "活动主键", required = true) |
| | | @Min(value = 1, groups = {AddGroup.class}, message = "活动主键不能为空") |
| | | |
| | | @ApiModelProperty("所属活动id") |
| | | private Long activityId; |
| | | @ApiModelProperty(value = "当前登录用户id", hidden = true) |
| | | |
| | | @ApiModelProperty("用户id, 和用户信息表的相关id关联") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | |
| | | @ApiModelProperty("人群标签") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("人员头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "列表人员类型 1 普通居民 2 志愿者", hidden = true) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("用户openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActSignExcelVO 社区活动报名名单 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动报名名单 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActSignExcelVO { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份", index = 2) |
| | | private String identity; |
| | | |
| | | @ExcelProperty(value = "电话", index = 4) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "报名时间", index = 0) |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "人群标签", index = 3) |
| | | private String tags; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 社区活动数据统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("社区活动数据统计返回参数") |
| | | public class ComActActivityStatisticsVO { |
| | | |
| | | /** |
| | | * 应报名总人数 |
| | | */ |
| | | @ApiModelProperty("应报名总人数") |
| | | private Integer signTotal; |
| | | /** |
| | | * 应报名总人数Str |
| | | */ |
| | | @ApiModelProperty("应报名总人数Str") |
| | | private String signTotalStr; |
| | | /** |
| | | * 实际报名总人数 |
| | | */ |
| | | @ApiModelProperty("实际报名总人数") |
| | | private Integer reallySignTotal; |
| | | /** |
| | | * 未报名报名总人数 |
| | | */ |
| | | @ApiModelProperty("未报名报名总人数") |
| | | private Integer noSignTotal; |
| | | /** |
| | | * 未报名报名总人数Str |
| | | */ |
| | | @ApiModelProperty("未报名报名总人数Str") |
| | | private String noSignTotalStr; |
| | | /** |
| | | * 报名总人数百分比 |
| | | */ |
| | | @ApiModelProperty("报名总人数百分比") |
| | | private String signPersent; |
| | | /** |
| | | * 应签到总人数 |
| | | */ |
| | | @ApiModelProperty("应签到总人数") |
| | | private Integer registTotal; |
| | | |
| | | /** |
| | | * 实际签到总人数 |
| | | */ |
| | | @ApiModelProperty("实际签到总人数") |
| | | private Integer reallyRegistTotal; |
| | | |
| | | /** |
| | | * 未签到总人数 |
| | | */ |
| | | @ApiModelProperty("未签到总人数") |
| | | private Integer noRegistTotal; |
| | | |
| | | /** |
| | | * 签到总人数百分比 |
| | | */ |
| | | @ApiModelProperty("签到总人数百分比") |
| | | private String registPersent; |
| | | |
| | | /** |
| | | * 应评价总人数 |
| | | */ |
| | | @ApiModelProperty("应评价总人数") |
| | | private Integer evaluateTotal; |
| | | |
| | | /** |
| | | * 实际评价总人数 |
| | | */ |
| | | @ApiModelProperty("实际评价总人数") |
| | | private Integer reallyEvaluateTotal; |
| | | |
| | | /** |
| | | * 未评价总人数 |
| | | */ |
| | | @ApiModelProperty("未评价总人数") |
| | | private Integer noEvaluateTotal; |
| | | |
| | | /** |
| | | * 评价人数百分比 |
| | | */ |
| | | @ApiModelProperty("评价人数百分比") |
| | | private String evaluatePersent; |
| | | } |
| | |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty("学历") |
| | | private Integer cultureLevel; |
| | | private String cultureLevel; |
| | | |
| | | /** |
| | | * 社区矫正人员编号 |
| | |
| | | * 与监护人关系 |
| | | */ |
| | | @ApiModelProperty("与监护人关系") |
| | | private Integer custodyRelation; |
| | | private String custodyRelation; |
| | | |
| | | /** |
| | | * 监护人公民身份号码 |
| | |
| | | private String censusRegister; |
| | | |
| | | @ExcelProperty(value = "学历", index = 16) |
| | | private Integer cultureLevel; |
| | | private String cultureLevel; |
| | | |
| | | @ExcelProperty(value = "社区矫正人员编号", index = 17) |
| | | private String correctPersonCode; |
| | |
| | | private String custodyPerson; |
| | | |
| | | @ExcelProperty(value = "与监护人关系", index = 19) |
| | | private Integer custodyRelation; |
| | | private String custodyRelation; |
| | | |
| | | @ExcelProperty(value = "监护人公民身份号码", index = 20) |
| | | private String custodyCardNo; |
| | |
| | | private String mainRelatives; |
| | | |
| | | @ExcelProperty(value = "与人员关系", index = 18) |
| | | private Integer patientRelation; |
| | | private String patientRelation; |
| | | |
| | | @ExcelProperty(value = "列管原因及类型", index = 19) |
| | | private String rehabReasonAndType; |
| | |
| | | @ExcelProperty(value = "照片", index = 6) |
| | | private String photo; |
| | | |
| | | @ExcelProperty(value = "户籍性质(1.城镇户口 2.农村户口)", index = 7) |
| | | private Integer regiterNature; |
| | | @ExcelProperty(value = "户籍性质", index = 7) |
| | | private String regiterNature; |
| | | |
| | | @ExcelProperty(value = "户口所在地", index = 8) |
| | | private String censusRegister; |
| | |
| | | * 与人员关系 |
| | | */ |
| | | @ApiModelProperty("与人员关系") |
| | | private Integer patientRelation; |
| | | private String patientRelation; |
| | | |
| | | /** |
| | | * 列管原因及类型 |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | |
| | | private String dangerType; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ExcelProperty(value = "状态", index = 3) |
| | | private String status; |
| | | |
| | | /** |
| | | * 风险等级 |
| | | */ |
| | | @ExcelProperty(value = "风险等级", index = 3) |
| | | @ExcelProperty(value = "风险等级", index = 4) |
| | | private String dangerLevel; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ExcelProperty(value = "巡查人员", index = 4) |
| | | private String personName; |
| | | @ExcelProperty(value = "巡查人员", index = 5) |
| | | private String ppersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 5) |
| | | private String personPhone; |
| | | @ExcelProperty(value = "联系电话", index = 6) |
| | | private String ppersonPhone; |
| | | |
| | | /** |
| | | * 填报时间 |
| | | */ |
| | | @ExcelProperty(value = "填报时间", index = 7) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注", index = 6) |
| | | @ExcelProperty(value = "备注", index = 8) |
| | | private String remark; |
| | | |
| | | /** |
| | | * 整改人员 |
| | | */ |
| | | @ExcelProperty(value = "整改人员", index = 9) |
| | | private String dpersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 10) |
| | | private String dpersonPhone; |
| | | |
| | | /** |
| | | * 整改时间 |
| | | */ |
| | | @ExcelProperty(value = "整改时间", index = 11) |
| | | private Date rectifyTime; |
| | | |
| | | } |
| | |
| | | private String photo; |
| | | |
| | | /** |
| | | * 户籍性质(1.城镇户口 2.农村户口) |
| | | * 户籍性质 |
| | | */ |
| | | @ApiModelProperty("户籍性质(1.城镇户口 2.农村户口)") |
| | | private Integer regiterNature; |
| | | @ApiModelProperty("户籍性质") |
| | | private String regiterNature; |
| | | |
| | | /** |
| | | * 入伍时间 |
| | |
| | | R listActivitySign(@RequestBody ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/sign/getList") |
| | | R getSignLists(@RequestBody ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/evaluate/page") |
| | | R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description getEvaluateListsByIds 批量查询活动评价 |
| | | * @param ids ids |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/evaluate/getList") |
| | | R getEvaluateListsByIds(@RequestBody List<Long> ids); |
| | | R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/regist/page") |
| | | R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("/activity/regist/getList") |
| | | R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | @GetMapping("/activity/statistics") |
| | | R activityStatistics(@RequestParam("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 活动报名名单 |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.io.*; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | public class FileUtil { |
| | | |
| | |
| | | public static File readUserHomeFile(String pathName) { |
| | | return new File(System.getProperty("user.home") + File.separator + pathName); |
| | | } |
| | | |
| | | /** |
| | | * 压缩文件 |
| | | * |
| | | * @param sourceFilePath 源文件路径 |
| | | * @param zipFilePath 压缩后文件存储路径 |
| | | * @param zipFilename 压缩文件名 |
| | | */ |
| | | public static void compressToZip(String sourceFilePath, String zipFilePath, String zipFilename) { |
| | | File sourceFile = new File(sourceFilePath); |
| | | File zipPath = new File(zipFilePath); |
| | | if (!zipPath.exists()) { |
| | | zipPath.mkdirs(); |
| | | } |
| | | File zipFile = new File(zipPath + File.separator + zipFilename); |
| | | try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) { |
| | | writeZip(sourceFile, "", zos); |
| | | //文件压缩完成后,删除被压缩文件 |
| | | boolean flag = deleteDir(sourceFile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage(), e.getCause()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 遍历所有文件,压缩 |
| | | * |
| | | * @param file 源文件目录 |
| | | * @param parentPath 压缩文件目录 |
| | | * @param zos 文件流 |
| | | */ |
| | | private static void writeZip(File file, String parentPath, ZipOutputStream zos) { |
| | | if (file.isDirectory()) { |
| | | //目录 |
| | | parentPath += file.getName() + File.separator; |
| | | File[] files = file.listFiles(); |
| | | for (File f : files) { |
| | | writeZip(f, parentPath, zos); |
| | | } |
| | | } else { |
| | | //文件 |
| | | try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) { |
| | | //指定zip文件夹 |
| | | ZipEntry zipEntry = new ZipEntry(parentPath + file.getName()); |
| | | zos.putNextEntry(zipEntry); |
| | | int len; |
| | | byte[] buffer = new byte[1024 * 10]; |
| | | while ((len = bis.read(buffer, 0, buffer.length)) != -1) { |
| | | zos.write(buffer, 0, len); |
| | | zos.flush(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage(), e.getCause()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件夹 |
| | | * |
| | | * @param dir |
| | | * @return |
| | | */ |
| | | |
| | | } |
| | | private static boolean deleteDir (File dir){ |
| | | if (dir.isDirectory()) { |
| | | String[] children = dir.list(); |
| | | for (int i = 0; i < children.length; i++) { |
| | | boolean success = deleteDir(new File(dir, children[i])); |
| | | if (!success) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | //删除空文件夹 |
| | | return dir.delete(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.awt.BasicStroke; |
| | | import java.awt.Graphics; |
| | | import java.awt.Graphics2D; |
| | | import java.awt.Image; |
| | | import java.awt.Shape; |
| | | import java.awt.geom.RoundRectangle2D; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.util.Hashtable; |
| | | import java.util.Random; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.BinaryBitmap; |
| | | import com.google.zxing.DecodeHintType; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatReader; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.Result; |
| | | import com.google.zxing.client.j2se.BufferedImageLuminanceSource; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.common.HybridBinarizer; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | |
| | | public class QRCodeUtils { |
| | | private static final String CHARSET = "utf-8"; |
| | | private static final String FORMAT_NAME = "JPG"; |
| | | // 二维码尺寸 |
| | | private static final int QRCODE_SIZE = 300; |
| | | // LOGO宽度 |
| | | private static final int WIDTH = 60; |
| | | // LOGO高度 |
| | | private static final int HEIGHT = 60; |
| | | |
| | | private static BufferedImage createImage(String content, String imgPath, |
| | | boolean needCompress) throws Exception { |
| | | Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>(); |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); |
| | | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, |
| | | BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints); |
| | | int width = bitMatrix.getWidth(); |
| | | int height = bitMatrix.getHeight(); |
| | | BufferedImage image = new BufferedImage(width, height, |
| | | BufferedImage.TYPE_INT_RGB); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 |
| | | : 0xFFFFFFFF); |
| | | } |
| | | } |
| | | if (imgPath == null || "".equals(imgPath)) { |
| | | return image; |
| | | } |
| | | // 插入图片 |
| | | QRCodeUtils.insertImage(image, imgPath, needCompress); |
| | | return image; |
| | | } |
| | | |
| | | /** |
| | | * 插入LOGO |
| | | * |
| | | * @param source |
| | | * 二维码图片 |
| | | * @param imgPath |
| | | * LOGO图片地址 |
| | | * @param needCompress |
| | | * 是否压缩 |
| | | * @throws Exception |
| | | */ |
| | | private static void insertImage(BufferedImage source, String imgPath, |
| | | boolean needCompress) throws Exception { |
| | | File file = new File(imgPath); |
| | | if (!file.exists()) { |
| | | System.err.println(""+imgPath+" 该文件不存在!"); |
| | | return; |
| | | } |
| | | Image src = ImageIO.read(new File(imgPath)); |
| | | int width = src.getWidth(null); |
| | | int height = src.getHeight(null); |
| | | if (needCompress) { // 压缩LOGO |
| | | if (width > WIDTH) { |
| | | width = WIDTH; |
| | | } |
| | | if (height > HEIGHT) { |
| | | height = HEIGHT; |
| | | } |
| | | Image image = src.getScaledInstance(width, height, |
| | | Image.SCALE_SMOOTH); |
| | | BufferedImage tag = new BufferedImage(width, height, |
| | | BufferedImage.TYPE_INT_RGB); |
| | | Graphics g = tag.getGraphics(); |
| | | g.drawImage(image, 0, 0, null); // 绘制缩小后的图 |
| | | g.dispose(); |
| | | src = image; |
| | | } |
| | | // 插入LOGO |
| | | Graphics2D graph = source.createGraphics(); |
| | | int x = (QRCODE_SIZE - width) / 2; |
| | | int y = (QRCODE_SIZE - height) / 2; |
| | | graph.drawImage(src, x, y, width, height, null); |
| | | Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6); |
| | | graph.setStroke(new BasicStroke(3f)); |
| | | graph.draw(shape); |
| | | graph.dispose(); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param destPath |
| | | * 存放目录 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static String encode(String content, String imgPath, String destPath, |
| | | boolean needCompress) throws Exception { |
| | | BufferedImage image = QRCodeUtils.createImage(content, imgPath, |
| | | needCompress); |
| | | mkdirs(destPath); |
| | | String file = Snowflake.getId() + ".jpg"; |
| | | ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file)); |
| | | return file; |
| | | } |
| | | |
| | | /** |
| | | * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) |
| | | * @date 2013-12-11 上午10:16:36 |
| | | * @param destPath 存放目录 |
| | | */ |
| | | public static void mkdirs(String destPath) { |
| | | File file =new File(destPath); |
| | | //当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) |
| | | if (!file.exists() && !file.isDirectory()) { |
| | | file.mkdirs(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String imgPath, String destPath) |
| | | throws Exception { |
| | | QRCodeUtils.encode(content, imgPath, destPath, false); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String destPath, |
| | | boolean needCompress) throws Exception { |
| | | QRCodeUtils.encode(content, null, destPath, needCompress); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String destPath) throws Exception { |
| | | QRCodeUtils.encode(content, null, destPath, false); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param output |
| | | * 输出流 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String imgPath, |
| | | OutputStream output, boolean needCompress) throws Exception { |
| | | BufferedImage image = QRCodeUtils.createImage(content, imgPath, |
| | | needCompress); |
| | | ImageIO.write(image, FORMAT_NAME, output); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param output |
| | | * 输出流 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, OutputStream output) |
| | | throws Exception { |
| | | QRCodeUtils.encode(content, null, output, false); |
| | | } |
| | | |
| | | /** |
| | | * 解析二维码 |
| | | * |
| | | * @param file |
| | | * 二维码图片 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decode(File file) throws Exception { |
| | | BufferedImage image; |
| | | image = ImageIO.read(file); |
| | | if (image == null) { |
| | | return null; |
| | | } |
| | | BufferedImageLuminanceSource source = new BufferedImageLuminanceSource( |
| | | image); |
| | | BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); |
| | | Result result; |
| | | Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(); |
| | | hints.put(DecodeHintType.CHARACTER_SET, CHARSET); |
| | | result = new MultiFormatReader().decode(bitmap, hints); |
| | | String resultStr = result.getText(); |
| | | return resultStr; |
| | | } |
| | | |
| | | /** |
| | | * 解析二维码 |
| | | * |
| | | * @param path |
| | | * 二维码图片地址 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decode(String path) throws Exception { |
| | | return QRCodeUtils.decode(new File(path)); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.jcraft.jsch.SftpException; |
| | | import com.panzhihua.common.utlis.*; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.utlis.HttpUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | |
| | | import freemarker.template.Configuration; |
| | |
| | | */ |
| | | @ApiOperation(value = "导出台账-隐患报告") |
| | | @PostMapping("/danger/export") |
| | | public R exportComMngCar(@RequestBody List<Long> dangerReportIds) { |
| | | public R exportDangerReportBook(@RequestBody List<Long> dangerReportIds) { |
| | | String url = excelUrl; |
| | | String name = "隐患报告台账导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | |
| | | @PostMapping("/export/safetyWorkRecord") |
| | | public R exportSafetyWorkRecord(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwSafetyWorkRecordVO comSwSafetyWorkRecordVO = JSONObject.parseObject( |
| | | JSONObject.toJSONString(communityService.detailSafetyWorkRecord(id, communityId).getData()), |
| | | ComSwSafetyWorkRecordVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "安全工作记录_" + comSwSafetyWorkRecordVO.getId() + ".doc"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | File file0=new File("d:/safetyWork/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | File file = new File(sourceFile + name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("安全工作记录.ftl", "utf-8"); |
| | |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | // inputStream = new FileInputStream(file); |
| | | // sftp.uploadMore(ftpUrl, name, inputStream); |
| | | // sftp.logout(); |
| | | // inputStream.close(); |
| | | // String absolutePath = file.getAbsolutePath(); |
| | | // boolean delete = file.delete(); |
| | | // log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | FileUtil.compressToZip(sourceFile,zipFile,"安全工作记录.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "安全工作记录_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"安全工作记录.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载巡查记录报告") |
| | | @PostMapping("/export/patrolRecord") |
| | | public R exportPatrolRecord(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwPatrolRecordVO comSwPatrolRecordVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(communityService.detailPatrolRecord(id).getData()), |
| | | ComSwPatrolRecordVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "巡查记录_" + comSwPatrolRecordVO.getId() + ".doc"; |
| | | |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | File file0=new File("d:/patrolRecord/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | File file = new File(sourceFile + name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("巡查记录.ftl", "utf-8"); |
| | |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | // inputStream = new FileInputStream(file); |
| | | // sftp.uploadMore(ftpUrl, name, inputStream); |
| | | // sftp.logout(); |
| | | // inputStream.close(); |
| | | // String absolutePath = file.getAbsolutePath(); |
| | | // boolean delete = file.delete(); |
| | | // log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | FileUtil.compressToZip(sourceFile,zipFile,"巡查记录.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "巡查记录_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"巡查记录.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载隐患报告") |
| | | @PostMapping("/export/DangerReport") |
| | | public R exportDangerReport(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwDangerReportVO comSwDangerReportVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(communityService.detailDangerReport(id).getData()), |
| | | ComSwDangerReportVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "隐患报告_" + comSwDangerReportVO.getId() + ".doc"; |
| | | |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | File file0=new File("d:/dangerReport/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("/mnt/data/web/")); |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/dangerReport/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | File file = new File(sourceFile+name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("隐患报告.ftl", "utf-8"); |
| | |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | // inputStream = new FileInputStream(file); |
| | | // sftp.uploadMore(ftpUrl, name, inputStream); |
| | | // sftp.logout(); |
| | | // inputStream.close(); |
| | | // String absolutePath = file.getAbsolutePath(); |
| | | // boolean delete = file.delete(); |
| | | // log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | FileUtil.compressToZip(sourceFile,zipFile,"隐患报告.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "隐患报告_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"隐患报告.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling() { |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.vos.LiveVO; |
| | | import com.panzhihua.common.model.vos.WeatherVO; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.Version; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动评价") |
| | | @ApiOperation(value = "excel导出-活动报名名单") |
| | | @PostMapping("sign/export") |
| | | public R activityExportSign(@RequestBody ActivitySignVO activitySignVO) { |
| | | String name = "活动报名名单导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getSignLists(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActSignExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActSignExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComActActSignExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动报名名单导出数据").build(); |
| | | excelWriter.write(excelVOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class) |
| | | @PostMapping("evaluate/page") |
| | | public R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | if (ObjectUtils.isEmpty(comActActEvaluateVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.pageActivityRegists(comActActEvaluateVO); |
| | | return communityService.pageActivityEvaluates(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出-活动评价") |
| | | @PostMapping("evaluate/export") |
| | | public R activityExportEvaluate(@RequestBody List<Long> Ids) { |
| | | public R activityExportEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | String name = "活动评价导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getEvaluateListsByIds(Ids); |
| | | R r = communityService.getEvaluateLists(comActActEvaluateVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActEvaluateExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActEvaluateExcelVO.class); |
| | |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动签到记录", response = ComActActRegistVO.class) |
| | | @PostMapping("regist/page") |
| | | public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | if (ObjectUtils.isEmpty(comActActRegistVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.pageActivityRegists(comActActRegistVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出-活动签到") |
| | | @PostMapping("regist/export") |
| | | public R activityExportRegist(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | String name = "活动签到导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getRegistLists(comActActRegistVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActRegistExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActRegistExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComActActRegistExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动签到导出数据").build(); |
| | | excelWriter.write(excelVOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动数据统计", response = ComActActivityStatisticsVO.class) |
| | | @GetMapping("statistics") |
| | | public R activityStatistics(@RequestParam("activityId") Long activityId){ |
| | | return communityService.activityStatistics(activityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动签到二维码下载") |
| | | @GetMapping("qrCode/export") |
| | | public R activityRegistQRCodeExport(@RequestParam("activityId") Long activityId){ |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "社区活动签到二维码_" + activityId + ".doc"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | File file0=new File("d:/comActivity/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "社区活动二维码.ftl", "d:/comActivity/file/社区活动二维码.ftl"); |
| | | try { |
| | | String text = String.valueOf(activityId); |
| | | String destPath = "d:/comActivity/file/"; |
| | | String downFile = QRCodeUtils.encode(text, null, destPath, false); |
| | | dataMap.put("imgStr", getImageStr("d:/comActivity/file/" + downFile)); |
| | | Configuration configuration = new Configuration(new Version("2.3.0")); |
| | | |
| | | configuration.setDefaultEncoding("utf-8"); |
| | | /** |
| | | * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 |
| | | */ |
| | | // 指定路径的第一种方式(根据某个类的相对路径指定) |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/comActivity/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("社区活动二维码.ftl", "utf-8"); |
| | | Writer out = new BufferedWriter( |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "新增社区动态") |
| | |
| | | } |
| | | return communityService.easyPhotoNoHandleList(loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | public String getImageStr(String fileName) { |
| | | String imgFile = fileName; |
| | | InputStream in = null; |
| | | byte[] data = null; |
| | | try { |
| | | in = new FileInputStream(imgFile); |
| | | data = new byte[in.available()]; |
| | | in.read(data); |
| | | in.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | BASE64Encoder encoder = new BASE64Encoder(); |
| | | return encoder.encode(data); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/sign/getList") |
| | | public R getSignLists(@RequestBody ActivitySignVO activitySignVO){ |
| | | return comActActivityService.getSignLists(activitySignVO); |
| | | } |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/evaluate/page") |
| | | public R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return comActActivityService.pageActivityRegists(comActActEvaluateVO); |
| | | public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return comActActivityService.pageActivityEvaluates(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * description getEvaluateListsByIds 批量查询活动评价 |
| | | * @param ids ids |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/evaluate/getList") |
| | | public R getEvaluateListsByIds(@RequestBody List<Long> ids){ |
| | | return comActActivityService.getEvaluateListsByIds(ids); |
| | | @PostMapping("activity/evaluate/getList") |
| | | public R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO){ |
| | | return comActActivityService.getEvaluateLists(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/regist/page") |
| | | public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | return comActActivityService.pageActivityRegists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("activity/regist/getList") |
| | | public R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | return comActActivityService.getRegistLists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | @GetMapping("activity/statistics") |
| | | public R activityStatistics(@RequestParam("activityId") Long activityId){ |
| | | return comActActivityService.activityStatistics(activityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Mapper |
| | | public interface ComActActEvaluateDAO extends BaseMapper<ComActActEvaluateDO> { |
| | | |
| | | IPage<ComActActEvaluateVO> pageActivityRegists(Page page, @Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | IPage<ComActActEvaluateVO> pageActivityEvaluates(Page page, @Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | List<ComActActEvaluateExcelVO> getEvaluateListsByIds(@Param("ids") List<Long> ids); |
| | | List<ComActActEvaluateExcelVO> getEvaluateLists(@Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: ComActActRegistDAO 社区》活动》活动签到表mapper类 |
| | |
| | | @Mapper |
| | | public interface ComActActRegistDAO extends BaseMapper<ComActActRegistDO> { |
| | | |
| | | |
| | | IPage<ComActActRegistVO> pageActivityRegists(Page page, @Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | |
| | | List<ComActActRegistExcelVO> getRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActSignExcelVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | // 居民 党员 志愿者 1 2 3 |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " |
| | | + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | + "u.phone, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "JOIN sys_user u ON a.user_id = u.user_id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" |
| | | + "AND u.phone = #{activitySignVO.phone} " + " </if> " |
| | | + "<if test='activitySignVO.tags != null and activitySignVO.tags != ""'>" |
| | | + "AND u.tags like concat('%',#{activitySignVO.tags},'%') " + " </if> " |
| | | + "<if test='activitySignVO.name != null and activitySignVO.name != ""'>" |
| | | + "AND u.`name` = #{activitySignVO.name} " + " </if> " |
| | | + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'>" |
| | |
| | | + "AND a.is_volunteer=#{activitySignVO.type}-1 " + " </if> " + " order by a.create_at desc " + "</script>") |
| | | List<ActivitySignVO> listActivitySigns(@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | List<ComActActSignExcelVO> getSignLists (@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | @Select("<script> " + "SELECT " + " caas.user_id, " + " su.NAME, " + "CASE " + " WHEN su.is_volunteer = 1 THEN " |
| | | + " '志愿者' ELSE '居民' " + " END identity, " + " su.phone, " + " caas.create_at " + "FROM " |
| | | + " com_act_act_sign AS caas " |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | + " su.is_volunteer = 1 " + " AND activity_id = #{activityId} ") |
| | | ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); |
| | | |
| | | ComActActivityStatisticsVO activityStatistics (@Param("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 查询置于顶部的进行中活动 |
| | | * @param communityId 社区id |
| | |
| | | @Mapper |
| | | public interface ComMngPopulationCommunityTagsDAO extends BaseMapper<ComMngPopulationCommunityTagsDO> { |
| | | |
| | | void updateAll( |
| | | @Param("populationCommunityTagsList") List<ComMngPopulationCommunityTagsDO> populationCommunityTagsList); |
| | | void updateAll(@Param("comMngPopulationCommunityTagsDOS") List<ComMngPopulationCommunityTagsDO> comMngPopulationCommunityTagsDOS); |
| | | |
| | | } |
| | |
| | | + " from com_mng_population_community_tags as cmpct where community_id = #{communityId}") |
| | | ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select count(id) as populationTotal," |
| | | + "IFNULL((select count(id) from com_mng_population_house where community_id = cmp.act_id),0) as houseTotal, " |
| | | + "IFNULL((select count(id) from com_mng_real_company where community_id = cmp.act_id),0) as companyTotal, " |
| | | + "IFNULL((select count(village_id) from com_mng_village where community_id = cmp.act_id),0) as villageTotal " |
| | | + " com_mng_population_community_tags as cmpct " + " where community_id = = #{communityId}") |
| | | @Select("select count(id) as populationTotal," + |
| | | "IFNULL((select count(id) from com_mng_population_house where community_id = cmpct.community_id),0) as houseTotal, " + |
| | | "IFNULL((select count(id) from com_mng_real_company where community_id = cmpct.community_id),0) as companyTotal, " + |
| | | "IFNULL((select count(village_id) from com_mng_village where community_id = cmpct.community_id),0) as villageTotal " + |
| | | " from com_mng_population_community_tags AS cmpct " + |
| | | " where cmpct.community_id = #{communityId}") |
| | | IndexBasicsStatisticsVO getScreenIndexByBasics(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " IFNULL( NULL, 1 ) AS type, " + " count( cmpct.id ) AS sum " + "FROM " |
| | | + " com_mng_population_community_tags as cmpct " |
| | | + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 1 " |
| | | + " AND cmpct.community_id = #{communityId} UNION ALL " + "SELECT " + " IFNULL( NULL, 2 ) AS type, " |
| | | + " count( id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " |
| | | + " count( cmpct.id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " |
| | | + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 2 " |
| | | + " AND cmpct.community_id = #{communityId}") |
| | | List<IndexPopulationSexStatisticsVO> getScreenIndexByPopulationSex(@Param("communityId") Long communityId); |
| | |
| | | List<ComMngUserTagVO> getUserTagListByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " count( id ) " + "FROM " + " com_mng_population_community_tags " + "WHERE " |
| | | + " label like concat('%',#{label},'%')") |
| | | Integer getSpecialStatisticsByLabel(@Param("label") String label); |
| | | + " community_id = #{communityId} and label like concat('%',#{label},'%')") |
| | | Integer getSpecialStatisticsByLabel(@Param("label") String label,@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + "SELECT " + " count( egd.id ) AS gridTotal, " |
| | | + " ( SELECT count( user_id ) FROM sys_user WHERE community_id = egd.grid_community_id AND type = 6 ) AS gridMemberTotal, " |
| | |
| | | + " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " + " </if> " |
| | | + "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'>" |
| | | + " AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " + " </if> " + "), 0 ) AS eventSSPTotal, " |
| | | + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status = 2 AND community_id = #{screenEventDTO.communityId} " |
| | | + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND status = 4 AND community_id = #{screenEventDTO.communityId} " |
| | | + "<if test='screenEventDTO.startTime != null and screenEventDTO.startTime != ""'>" |
| | | + " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " + " </if> " |
| | | + "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'>" |
| | |
| | | @Select("SELECT " + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) as aa where aa.age<= 16) as age16," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," |
| | | + "(SELECT COUNT(aa.age) FROM " |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") |
| | | + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") |
| | | Map<String, Long> indexCountByAge(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT " + " id, " + " su.nick_name AS userName, " + " su.image_url, " + " caep.create_at, " |
| | |
| | | + " id = #{populationId}") |
| | | PopulationDetailVO getPopulationDetailApp(@Param("populationId") Long populationId); |
| | | |
| | | @Select("<script> " + "SELECT " + " * " + "FROM " + " ( " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " |
| | | @Select("<script> " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " |
| | | + " cmpct.label, " + " cmp.card_no, " + " cmp.card_no_str, " + " cmp.sex, " + " cmp.address, " |
| | | + " cmp.political_outlook, " + " cmp.census_register, " + " cmp.house_id, " + " cmp.phone, " |
| | | + " IFNULL(cmp.house_id,0) as isHouse, " |
| | |
| | | + "AND cmp.house_id is null " + " </if> " + "<if test='populationListDTO.communityId != null'>" |
| | | + "AND cmpct.community_id = #{populationListDTO.communityId} " + " </if> " |
| | | + "<if test='populationListDTO.politicalOutlook != null'>" |
| | | + "AND cmp.political_outlook = #{populationListDTO.politicalOutlook} " + " </if> " |
| | | + " ) as population where 1=1 " + "<if test='populationListDTO.eventStatus != null'>" |
| | | + "AND population.eventStatus = #{populationListDTO.eventStatus} " + " </if> " + " </script>") |
| | | + "AND cmp.political_outlook = #{populationListDTO.politicalOutlook} " + " </if> " + " </script>") |
| | | IPage<ComMngPopulationListVO> getGridPopulationAdminList(Page page, |
| | | @Param("populationListDTO") ComMngPopulationListDTO populationListDTO); |
| | | |
| | |
| | | @Param("populationDTO") PageComMngPopulationDTO populationDTO); |
| | | |
| | | @Select("<script> " + "SELECT " + " count( id ) AS localNum, " |
| | | + " ( SELECT count( cmpct.id ) FROM com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id WHERE cmp.out_or_local = 2 " |
| | | + "<if test='communityId != null and communityId != 0'>" + " AND cmpct.community_id = #{communityId} " |
| | | + " </if> " + " ) AS flowNum, " |
| | | + " ( SELECT count( cmpct.id ) FROM com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id WHERE cmpct.label IS NOT NULL " |
| | | + "<if test='communityId != null and communityId != 0'>" + " AND cmpct.community_id = #{communityId} " |
| | | + " </if> " + " ) AS specialNum " + "FROM " |
| | | + " com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id " |
| | | + "WHERE " + " cmp.out_or_local = 1 " + "<if test='communityId != null and communityId != 0'>" |
| | | + " AND cmpct.community_id = #{communityId} " + " </if> " + " </script>") |
| | | + " ( SELECT count( cmp.id ) FROM com_mng_population as cmp WHERE cmp.out_or_local = 2 " |
| | | + " ) AS flowNum, " |
| | | + " ( SELECT count( cmpct.id ) FROM com_mng_population as cmp left join com_mng_population_community_tags AS cmpct on cmp.id = cmpct.population_id WHERE cmpct.label IS NOT NULL " |
| | | + " ) AS specialNum " + "FROM " |
| | | + " com_mng_population as cmp " |
| | | + "WHERE " + " cmp.out_or_local = 1 " + " </script>") |
| | | PopulationStatisticsVO getGridPopulationStatistics(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + "SELECT " + " * " + "FROM " + " ( " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " |
| | | @Select("<script> " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " |
| | | + " cmpct.label, " + " cmp.card_no, " + " cmp.card_no_str, " + " cmp.sex, " + " cmp.address, " |
| | | + " cmp.political_outlook, " + " cmp.census_register, " + " cmp.house_id, " + " cmp.phone, " |
| | | + " IFNULL(cmp.house_id,0) as isHouse, " |
| | |
| | | + "AND cmp.house_id is null " + " </if> " + "<if test='populationExportDTO.communityId != null'>" |
| | | + "AND cmpct.community_id = #{populationExportDTO.communityId} " + " </if> " |
| | | + "<if test='populationExportDTO.politicalOutlook != null'>" |
| | | + "AND cmp.political_outlook = #{populationExportDTO.politicalOutlook} " + " </if> " |
| | | + " ) as population where 1=1 " + "<if test='populationExportDTO.eventStatus != null'>" |
| | | + "AND population.eventStatus = #{populationExportDTO.eventStatus} " + " </if> " + " </script>") |
| | | + "AND cmp.political_outlook = #{populationExportDTO.politicalOutlook} " + " </if> " + " </script>") |
| | | List<ComMngPopulationListVO> |
| | | getGridPopulationAdminLists(@Param("populationExportDTO") ComMngPopulationExportDTO populationExportDTO); |
| | | |
| | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | private Integer cultureLevel; |
| | | private String cultureLevel; |
| | | |
| | | /** |
| | | * 社区矫正人员编号 |
| | |
| | | /** |
| | | * 与监护人关系 |
| | | */ |
| | | private Integer custodyRelation; |
| | | private String custodyRelation; |
| | | |
| | | /** |
| | | * 监护人公民身份号码 |
| | |
| | | /** |
| | | * 与人员关系 |
| | | */ |
| | | private Integer patientRelation; |
| | | private String patientRelation; |
| | | |
| | | /** |
| | | * 列管原因及类型 |
| | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | @TableId(value = "id",type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | private String photo; |
| | | |
| | | /** |
| | | * 户籍性质(1.城镇户口 2.农村户口) |
| | | * 户籍性质 |
| | | */ |
| | | private Integer regiterNature; |
| | | private String regiterNature; |
| | | |
| | | /** |
| | | * 入伍时间 |
| | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | R listActivitySigns(ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R getSignLists(ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R pageActivityRegists(ComActActEvaluateVO comActActEvaluateVO); |
| | | R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description getEvaluateListsByIds 批量查询活动评价 |
| | | * @param ids ids |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R getEvaluateListsByIds(List<Long> ids); |
| | | R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R pageActivityRegists(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | R getRegistLists(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | R activityStatistics(Long activityId); |
| | | |
| | | /** |
| | | * 分页展示我的所有活动 时间倒序排列 |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | @Resource |
| | | private ComActActEvaluateDAO comActActEvaluateDAO; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private ComActActRegistDAO comActActRegistDAO; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R pageActivityRegists(ComActActEvaluateVO comActActEvaluateVO) { |
| | | public R getSignLists(ActivitySignVO activitySignVO) { |
| | | return R.ok(comActActSignDAO.getSignLists(activitySignVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO) { |
| | | IPage<ComActActEvaluateVO> comActActEvaluateVOIPage = comActActEvaluateDAO |
| | | .pageActivityRegists(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); |
| | | .pageActivityEvaluates(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); |
| | | return R.ok(comActActEvaluateVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R getEvaluateListsByIds(List<Long> ids) { |
| | | return R.ok(comActActEvaluateDAO.getEvaluateListsByIds(ids)); |
| | | public R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO) { |
| | | return R.ok(comActActEvaluateDAO.getEvaluateLists(comActActEvaluateVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R pageActivityRegists(ComActActRegistVO comActActRegistVO) { |
| | | IPage<ComActActRegistVO> comActActRegistVOIPage = comActActRegistDAO.pageActivityRegists(new Page(comActActRegistVO.getPageNum(), comActActRegistVO.getPageSize()), comActActRegistVO); |
| | | return R.ok(comActActRegistVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R getRegistLists(ComActActRegistVO comActActRegistVO) { |
| | | return R.ok(comActActRegistDAO.getRegistLists(comActActRegistVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R activityStatistics(Long activityId) { |
| | | ComActActivityStatisticsVO comActActivityStatisticsVO = comActActivityDAO.activityStatistics(activityId); |
| | | if (comActActivityStatisticsVO != null) { |
| | | if (comActActivityStatisticsVO.getSignTotal().equals(0)){ |
| | | comActActivityStatisticsVO.setSignTotalStr("不限"); |
| | | comActActivityStatisticsVO.setNoSignTotalStr(""); |
| | | comActActivityStatisticsVO.setSignPersent(""); |
| | | }else { |
| | | comActActivityStatisticsVO.setSignTotalStr(String.valueOf(comActActivityStatisticsVO.getSignTotal())); |
| | | comActActivityStatisticsVO.setNoSignTotalStr(String.valueOf(Integer.valueOf(comActActivityStatisticsVO.getSignTotalStr()) - comActActivityStatisticsVO.getReallySignTotal())); |
| | | comActActivityStatisticsVO.setSignPersent(getPersent(comActActivityStatisticsVO.getReallySignTotal(),comActActivityStatisticsVO.getSignTotal())); |
| | | } |
| | | comActActivityStatisticsVO.setRegistPersent(getPersent(comActActivityStatisticsVO.getReallyRegistTotal(),comActActivityStatisticsVO.getRegistTotal())); |
| | | comActActivityStatisticsVO.setEvaluatePersent(getPersent(comActActivityStatisticsVO.getReallyEvaluateTotal(),comActActivityStatisticsVO.getEvaluateTotal())); |
| | | } |
| | | return R.ok(comActActivityStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private String getPersent(int x, int y){ |
| | | if (y == 0) { |
| | | return ""; |
| | | } |
| | | if (x == 0) { |
| | | return "0.00%"; |
| | | } |
| | | double d1 = x * 1.0; |
| | | double d2 = y * 1.0; |
| | | DecimalFormat decimalFormat = new DecimalFormat("##.00%"); |
| | | return decimalFormat.format(d1 / d2); |
| | | } |
| | | |
| | | /** |
| | | * 用户签到 |
| | | * |
| | |
| | | .collect(Collectors.toList()); |
| | | if (!ObjectUtils.isEmpty(collect)) { |
| | | String userName = collect.get(0).getUserName(); |
| | | String userNickName = collect.get(0).getUserNickName(); |
| | | comActDiscussCommentVO1.setUserNameBack(userName); |
| | | comActDiscussCommentVO1.setUserNickNameBack(userNickName); |
| | | } |
| | | List<ComActDiscussCommentVO> collect1 = records.stream() |
| | | .filter(comActDiscussCommentVO2 -> comActDiscussCommentVO2.getId().equals(parentId)) |
| | |
| | | cmActEasyPhotoDO.setTransferTime(nowDate); |
| | | } else { |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | if (StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setDrugMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setCorrectMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setMajorMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setCultMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setRehabilitationMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setKeyMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setSentenceMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setVeteransMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setDisabilityMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | populationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | populationDO.setCreateBy(userId); |
| | | savePopulationCommunityList.add(cpopulationCommunityTagsDO); |
| | | } |
| | | } else { |
| | | // 实有人口存在于当前社区,则更新 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | |
| | | setLowSecurityMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在于该社区,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | } |
| | | log.info("查询实有人口存在社区信息完成"); |
| | | } |
| | |
| | | } |
| | | if (!updatePopulationCommunityList.isEmpty()) { |
| | | log.info("执行数据库更新人口社区关系"); |
| | | comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); |
| | | comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); |
| | | log.info("数据库更新人口社区关系完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | |
| | | userTagList.forEach(userTag -> { |
| | | if (userTag != null) { |
| | | if (userTag.getSysFlag().equals(0)) { |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | otherSpecialVO.setSum(otherSpecialVO.getSum() + count); |
| | | } else { |
| | | if (StringUtils.isNotEmpty(userTag.getTagName())) { |
| | |
| | | } else { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | specialStatisticsVO.setSum(count); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | } |
| | |
| | | userTagList.forEach(userTag -> { |
| | | if (userTag != null) { |
| | | if (userTag.getSysFlag().equals(0)) { |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | otherSpecialVO.setSum(otherSpecialVO.getSum() + count); |
| | | } else { |
| | | if (StringUtils.isNotEmpty(userTag.getTagName())) { |
| | |
| | | } else { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | specialStatisticsVO.setSum(count); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | } |
| | |
| | | userTagList.forEach(userTag -> { |
| | | if (userTag != null) { |
| | | if (userTag.getSysFlag().equals(0)) { |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | otherSpecialVO.setSum(otherSpecialVO.getSum() + count); |
| | | } else { |
| | | if (StringUtils.isNotEmpty(userTag.getTagName())) { |
| | |
| | | } else { |
| | | IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); |
| | | specialStatisticsVO.setTitle(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); |
| | | Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); |
| | | specialStatisticsVO.setSum(count); |
| | | specialStatisticsVOList.add(specialStatisticsVO); |
| | | } |
| | |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | | mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); |
| | | mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); |
| | | // mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); |
| | | // mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage())); |
| | | mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal())); |
| | | mvo.setIsCorrectGroup(PopulHouseUseEnum.getCnDescByName(vo.getIsCorrectGroup())); |
| | |
| | | private void setMajorMistake(ComMngPopulationMajorMistakeExcelVO mvo, ComMngPopulationMajorExcelVO vo) { |
| | | // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); |
| | | // mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); |
| | | // mvo.setRelation(PopulRelationEnum.getCnDescByName(vo.getRelation())); |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | |
| | | ComMngPopulationRehabilitationExcelVO vo) { |
| | | // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | | // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | | mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); |
| | |
| | | } |
| | | |
| | | private void setVeteransMistake(ComMngPopulationVeteransMistakeExcelVO mvo, ComMngPopulationVeteransExcelVO vo) { |
| | | mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); |
| | | // mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); |
| | | mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | |
| | | @Override |
| | | public R exportDangerReport(List<Long> dangerReportIds) { |
| | | List<ComSwDangerReportExcelVO> list = comSwDangerReportDAO.exportDangerReport(dangerReportIds); |
| | | // list.forEach(comSwDangerReportExcelVO -> { |
| | | // List<String> patrolUserIds = Arrays.asList(comSwDangerReportExcelVO.getPatrolPerson().split(",")); |
| | | // List<String> patrolPhones = new ArrayList<>(); |
| | | // for (String userId : patrolUserIds) { |
| | | // LoginUserInfoVO loginUserInfoVO = userService.getUserInfoByUserId(userId).getData(); |
| | | // patrolPhones.add(loginUserInfoVO.getPhone()); |
| | | // } |
| | | // comSwDangerReportExcelVO.setPatrolPersonPhone(StringUtils.join(patrolPhones,",")); |
| | | // }); |
| | | list.forEach(comSwDangerReportExcelVO -> { |
| | | // 整改人员id查询整改人员的名字和电话 |
| | | StringBuilder dangerNameString = new StringBuilder(); |
| | | StringBuilder dangerPhoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportExcelVO.getDpersonName())) { |
| | | String[] dangerIds = comSwDangerReportExcelVO.getDpersonName().split(","); |
| | | for (int i = 0; i < dangerIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | dangerNameString.append(","); |
| | | dangerPhoneString.append(","); |
| | | } |
| | | dangerNameString.append(person.get("name")); |
| | | dangerPhoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwDangerReportExcelVO.setDpersonName(dangerNameString.toString()); |
| | | comSwDangerReportExcelVO.setDpersonPhone(dangerPhoneString.toString()); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | BeanUtils.copyProperties(comSwPatrolRecordAddDTO, comSwPatrolRecordDO); |
| | | Long patrolRecordId = Snowflake.getId(); |
| | | comSwPatrolRecordDO.setId(patrolRecordId); |
| | | comSwPatrolRecordDO.setPatrolTime(new Date()); |
| | | // comSwPatrolRecordDO.setPatrolTime(new Date()); |
| | | comSwPatrolRecordDO.setSuccessionTime( |
| | | DateUtils.stringToDate(comSwPatrolRecordAddDTO.getSuccessionTime(), DateUtils.yyyyMMdd_format)); |
| | | StringBuilder nameString = new StringBuilder(); |
| | |
| | | id, activity_id, user_id, create_at, is_volunteer, star_level, evaluate_content, photo |
| | | </sql> |
| | | |
| | | <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | | <select id="pageActivityEvaluates" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | | SELECT |
| | | caae.id, |
| | | caae.activity_id, |
| | |
| | | order by caae.create_at desc |
| | | </select> |
| | | |
| | | <select id="getEvaluateListsByIds" resultType="java.util.List"> |
| | | <select id="getEvaluateLists" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO"> |
| | | SELECT |
| | | caae.create_at, |
| | | caae.star_level, |
| | |
| | | com_act_act_evaluate caae |
| | | LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caae.user_id = su.user_id |
| | | where caae.id in |
| | | <foreach collection="ids" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | where caae.activity_id = #{comActActEvaluateVO.activityId} |
| | | <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> |
| | | AND su.phone = #{comActActEvaluateVO.phone} |
| | | </if> |
| | | <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> |
| | | AND su.`name` = #{comActActEvaluateVO.name} |
| | | </if> |
| | | <if test="comActActEvaluateVO.starLevel != null"> |
| | | AND caae.star_level = #{comActActEvaluateVO.starLevel} |
| | | </if> |
| | | <if test="comActActEvaluateVO.createAt != null"> |
| | | AND caae.create_at = #{comActActEvaluateVO.createAt} |
| | | </if> |
| | | order by caae.create_at desc |
| | | </select> |
| | | </mapper> |
| | |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | </sql> |
| | | |
| | | <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> |
| | | SELECT |
| | | caar.id, |
| | | caar.activity_id, |
| | | caar.create_at, |
| | | su.user_id, |
| | | su.`name`, |
| | | su.nick_name, |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caar.is_volunteer, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | | AND su.phone = #{comActActRegistVO.phone} |
| | | </if> |
| | | <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | |
| | | <select id="getRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> |
| | | SELECT |
| | | caar.create_at, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | | AND su.phone = #{comActActRegistVO.phone} |
| | | </if> |
| | | <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | </sql> |
| | | |
| | | <select id="getSignLists" resultType="com.panzhihua.common.model.vos.community.ComActActSignExcelVO"> |
| | | SELECT |
| | | caas.create_at, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_sign caas |
| | | LEFT JOIN sys_user su ON caas.user_id = su.user_id |
| | | where caas.activity_id = #{activitySignVO.activityId} |
| | | <if test="activitySignVO.phone != null and activitySignVO.phone !=''"> |
| | | AND su.phone = #{activitySignVO.phone} |
| | | </if> |
| | | <if test="activitySignVO.name != null and activitySignVO.name !=''"> |
| | | AND su.`name` = #{activitySignVO.name} |
| | | </if> |
| | | <if test="activitySignVO.createAt != null and activitySignVO.createAt !=''"> |
| | | AND caas.create_at = #{activitySignVO.createAt} |
| | | </if> |
| | | <if test="activitySignVO.tags != null and activitySignVO.tags !=''"> |
| | | AND su.tags like concat('%', #{activitySignVO.tags}, '%') |
| | | </if> |
| | | order by caas.create_at desc |
| | | <select id="selectNeedEvaluateSignRecords" resultMap="BaseResultMap"> |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.is_volunteer |
| | | FROM `com_act_act_sign` s |
| | |
| | | <result column="prize_remark" property="prizeRemark" /> |
| | | <result column="reward_desc" property="rewardDesc" /> |
| | | <result column="content" property="content" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="cancel_reason" property="cancelReason" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="is_default_praise" property="isDefaultPraise" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, |
| | | aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, |
| | | contact_phone, is_regist, is_top, prize_remark, reward_desc, content, create_at, cancel_reason, community_id, is_default_praise |
| | | id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, contact_phone, is_regist, is_top, prize_remark, reward_desc, content, community_id, create_at, cancel_reason |
| | | </sql> |
| | | |
| | | <select id="activityStatistics" resultType="com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO"> |
| | | SELECT IFNULL(volunteer_max,0) + IFNULL(participant_max,0) as signTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as reallySignTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as registTotal |
| | | ,(SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId}) as reallyRegistTotal |
| | | ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId})) as noRegistTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as evaluateTotal |
| | | ,(SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId}) as reallyEvaluateTotal |
| | | ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId})) as noEvaluateTotal |
| | | FROM com_act_activity where id = #{activityId} |
| | | </select> |
| | | <select id="getIndexTopActivityList" resultMap="BaseResultMap"> |
| | | SELECT * FROM `com_act_activity` |
| | | WHERE community_id = #{communityId} and is_top = 1 and end_at >= now() and begin_at <= now() |
| | |
| | | <if test='comActEasyPhotoVO.isReportUrban != null' > |
| | | AND p.`is_report_urban` = #{comActEasyPhotoVO.isReportUrban} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.classifyId != null' > |
| | | AND p.`classify_id` = #{comActEasyPhotoVO.classifyId} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.urbanStatus != null' > |
| | | AND p.`urban_status` = #{comActEasyPhotoVO.urbanStatus} |
| | | </if> |
| | |
| | | id, population_id, community_id, label, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | <update id="updateAll" parameterType="java.util.List"> |
| | | <foreach collection="comMngPopulationCommunityTagsDOS" item="item" index="index" separator=";"> |
| | | update com_mng_population_community_tags |
| | | <set> |
| | | <if test="item.label != null"> |
| | | `label` = #{item.label}, |
| | | </if> |
| | | <if test="item.updateBy != null"> |
| | | `update_by` = #{item.updateBy}, |
| | | </if> |
| | | `update_at` = NOW() |
| | | </set> |
| | | WHERE `id` = #{item.id} |
| | | </foreach> |
| | | ; |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="exportDangerReport" resultType="com.panzhihua.common.model.vos.community.ComSwDangerReportExcelVO" parameterType="java.util.List"> |
| | | SELECT |
| | | cspr.person_name AS personName, |
| | | cspr.person_phone AS personPhone, |
| | | cspr.person_name AS ppersonName, |
| | | cspr.person_phone AS ppersonPhone, |
| | | cspr.address, |
| | | csdr.remark, |
| | | csdr.dager_description AS dagerDescription, |
| | | csdr.danger_type AS dangerType, |
| | | csdr.danger_level AS dangerLevel |
| | | case csdr.danger_type |
| | | when '1' then '火灾隐患' |
| | | when '2' then '汛情隐患' |
| | | when '3' then '疫情隐患' |
| | | end |
| | | AS dangerType, |
| | | case csdr.status |
| | | when '1' then '待处理' |
| | | when '2' then '待整改' |
| | | when '3' then '已整改' |
| | | end |
| | | AS status, |
| | | case csdr.danger_level |
| | | when '1' then '红色预警' |
| | | when '2' then '橙色预警' |
| | | when '3' then '黄色预警' |
| | | when '4' then '蓝色预警' |
| | | end |
| | | AS dangerLevel, |
| | | cspr.create_at AS createAt, |
| | | csdr.rectify_person AS dpersonName, |
| | | csdr.rectify_time AS rectifyTime |
| | | FROM |
| | | com_sw_danger_report as csdr |
| | | left join com_sw_patrol_record_report as csprr on csprr.report_id = csdr.id |