Merge remote-tracking branch 'origin/test' into test
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("propertyRepair") |
| | | @Api(tags = "物业报修api") |
| | | public class ComPropertyRepairApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("小程序列表接口") |
| | | @PostMapping("/queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.propertyService.comPropertyRepairSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 小程序添加报修 |
| | | * @param comPropertyRepairVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("小程序添加报修") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | comPropertyRepairVO.setCreateTime(DateUtil.date()); |
| | | comPropertyRepairVO.setCreateBy(this.getUserId()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dcl); |
| | | return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("小程序修改报修") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | if(comPropertyRepairVO!=null&& StringUtils.isNotEmpty(comPropertyRepairVO.getFeedbackContent())){ |
| | | comPropertyRepairVO.setFeedbackBy(this.getUserId()); |
| | | comPropertyRepairVO.setFeedbackTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dpj); |
| | | } |
| | | if(comPropertyRepairVO!=null&&StringUtils.isNotEmpty(comPropertyRepairVO.getReplyContent())){ |
| | | comPropertyRepairVO.setReplyTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.yjs); |
| | | } |
| | | return this.propertyService.comPropertyRepairUpdate(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @GetMapping("/{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.propertyService.comPropertyRepairSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除接口") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyRepairDelete(id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public static final String ELDER_RECORD_ERROR_LIST = "ELDER_RECORD_ERROR_LIST_"; |
| | | |
| | | public static final String PENSION_RECORD_ERROR_LIST = "PENSION_RECORD_ERROR_LIST_"; |
| | | |
| | | /** |
| | | * 高德地图获取天气url |
| | | */ |
| | |
| | | private void setElderAuthMistake(Map<Integer, String> map, ComElderAuthRecordImportMistakeExcelVO vo) { |
| | | vo.setName(map.get(0)); |
| | | vo.setIdCard(map.get(1)); |
| | | vo.setPhone(map.get(3)); |
| | | vo.setNowAddress(map.get(2)); |
| | | vo.setPhone(map.get(2)); |
| | | vo.setNowAddress(map.get(3)); |
| | | vo.setAuthDate(map.get(4)); |
| | | vo.setIsAlive(map.get(5)); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.constants.BcDictionaryConstants; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.enums.PopulHouseUseEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordImportExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordImportMistakeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordImportExcelListen |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老线下认证导入监听 |
| | | * @author: txb |
| | | * @date: 2021/09/08 09:16 |
| | | */ |
| | | @Slf4j |
| | | public class ComPensionAuthRecordImportExcelListen extends AnalysisEventListener<Map<Integer, String>> { |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 5000; |
| | | private static int headSize = 0; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | private CommunityService communityService; |
| | | private Long communityId; |
| | | private Long userId; |
| | | private Map<Integer, String> headData; |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | public ComPensionAuthRecordImportExcelListen(CommunityService communityService, Long communityId, Long userId, |
| | | StringRedisTemplate stringRedisTemplate) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | this.userId = userId; |
| | | this.stringRedisTemplate = stringRedisTemplate; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(Map<Integer, String> data, AnalysisContext context) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | saveData(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里会一行行的返回头 |
| | | * |
| | | * @param headMap |
| | | * @param context |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | headSize = headMap.size(); |
| | | headData = headMap; |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | saveData(); |
| | | log.info("所有数据解析完成!"); |
| | | } |
| | | |
| | | /** |
| | | * 不是固定的列只能手动处理 |
| | | */ |
| | | private void saveData() { |
| | | R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); |
| | | log.info("开始导入线下认证居民数据"); |
| | | log.info("表格总数据:" + list.size()); |
| | | if (list.size() == 0) { |
| | | throw new ServiceException("100", "导入数据为空!"); |
| | | } |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String key = Constants.PENSION_RECORD_ERROR_LIST; |
| | | |
| | | Map<String, String> dictMap = dictionaryR.getData().stream() |
| | | .collect(Collectors.toMap(BcDictionaryVO::getDictName, BcDictionaryVO::getDictValue)); |
| | | // Map<String,Integer> dictMap = new HashMap<>(); |
| | | // for(BcDictionaryVO vo : dictionaryR.getData()){ |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | int index = 2; |
| | | try { |
| | | String[] parsePatterns = new String[] {"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", |
| | | "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"}; |
| | | ArrayList<ComPensionAuthRecordImportExcelVO> voList = Lists.newArrayList(); |
| | | // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | ArrayList<ComPensionAuthRecordImportMistakeExcelVO> mistakes = Lists.newArrayList(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComPensionAuthRecordImportExcelVO vo = new ComPensionAuthRecordImportExcelVO(); |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | index++; |
| | | setPensionAuthMistake(oneData, mistake); |
| | | mistake.setMistake("名字不可为空,请填写姓名"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if (StringUtils.isEmpty(oneData.get(1))) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | index++; |
| | | setPensionAuthMistake(oneData, mistake); |
| | | mistake.setMistake("身份证号不可为空,请填写身份证"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | |
| | | // 判断身份证号码位数 |
| | | if (oneData.get(1).length() != 18) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | index++; |
| | | setPensionAuthMistake(oneData, mistake); |
| | | mistake.setMistake("身份证号位数有误,请检查身份证号码是否正确"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setIdCard(oneData.get(1).toUpperCase()); |
| | | // 根据身份证号码解析年龄以及性别 |
| | | // 获取用户生日 |
| | | String birthday = vo.getIdCard().substring(6, 14); |
| | | if (StringUtils.isNotEmpty(birthday)) { |
| | | String year = birthday.substring(0, 4); |
| | | String month = birthday.substring(4, 6); |
| | | String day = birthday.substring(6, 8); |
| | | vo.setBirthday(year + "-" + month + "-" + day); |
| | | } |
| | | // //设置用户年龄 |
| | | // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | // 获取用户性别 |
| | | int sex = Integer.parseInt(vo.getIdCard().substring(16, 17)); |
| | | if (sex % 2 == 1) { |
| | | vo.setSex(PopulSexEnum.nan.getCode()); |
| | | } else { |
| | | vo.setSex(PopulSexEnum.nv.getCode()); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(oneData.get(2))) { |
| | | vo.setPhone(oneData.get(2)); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(3))) { |
| | | vo.setNowAddress(oneData.get(3)); |
| | | } |
| | | if (StringUtils.isEmpty(oneData.get(4))) { |
| | | index++; |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | setPensionAuthMistake(oneData, mistake); |
| | | mistake.setMistake("认证时间不可为空"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setAuthDate(DateUtil.parse(oneData.get(4).trim(), parsePatterns)); |
| | | if (StringUtils.isNotEmpty(oneData.get(5))) { |
| | | Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(5)); |
| | | if (isOk.equals(-1)) { |
| | | index++; |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | setPensionAuthMistake(oneData, mistake); |
| | | mistake.setMistake("您填写的健在(是/否)有误"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | vo.setIsAlive(isOk); |
| | | } else { |
| | | vo.setIsAlive(PopulHouseUseEnum.getCodeByName("否")); |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | log.info("开始进入业务层处理逻辑"); |
| | | R r = communityService.listSavePensionAuthRecordExcelVO(voList, communityId, userId); |
| | | log.info("业务层处理逻辑完成"); |
| | | if (!R.isOk(r)) { |
| | | log.info("业务层处理成功"); |
| | | List<ComPensionAuthRecordImportMistakeExcelVO> list = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPensionAuthRecordImportMistakeExcelVO.class); |
| | | // String errMsg = r.getMsg(); |
| | | // List<ComMngPopulationImportErrorVO> errorList = |
| | | // JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); |
| | | // if(!errorList.isEmpty()){ |
| | | // populationImportErrorVOList.addAll(errorList); |
| | | // } |
| | | mistakes.addAll(list); |
| | | log.info("将错误数据存入redis中"); |
| | | valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); |
| | | log.info("将错误数据存入redis中成功"); |
| | | throw new ServiceException("500", key); |
| | | } else { |
| | | log.info("业务层处理逻辑失败"); |
| | | if (!mistakes.isEmpty()) { |
| | | log.info("业务层处理逻辑失败,将错误数据缓存到redis中"); |
| | | valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); |
| | | log.info("业务层处理逻辑失败,将错误数据缓存到redis中成功"); |
| | | throw new ServiceException("500", key); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | log.info("处理数据时失败"); |
| | | e.printStackTrace(); |
| | | // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行"); |
| | | // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | log.error("数据格式有误,第" + index + "行"); |
| | | throw new ServiceException("500", "导入失败111"); |
| | | } |
| | | } |
| | | |
| | | private void setPensionAuthMistake(Map<Integer, String> map, ComPensionAuthRecordImportMistakeExcelVO vo) { |
| | | vo.setName(map.get(0)); |
| | | vo.setIdCard(map.get(1)); |
| | | vo.setPhone(map.get(2)); |
| | | vo.setNowAddress(map.get(3)); |
| | | vo.setAuthDate(map.get(4)); |
| | | vo.setIsAlive(map.get(5)); |
| | | } |
| | | } |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty("房屋信息请求参数") |
| | | private List<ComMngPopulationHouseEditDTO> houseEditDTOList; |
| | | |
| | | @ApiModelProperty("吸毒信息") |
| | | private ComDrugPopulationVO comDrugPopulationVO; |
| | | |
| | | @ApiModelProperty("社区矫正信息") |
| | | private ComCorrectPopulationVO comCorrectPopulationVO; |
| | | |
| | | @ApiModelProperty("精神障碍信息") |
| | | private ComMajorPopulationVO comMajorPopulationVO; |
| | | |
| | | @ApiModelProperty("邪教信息") |
| | | private ComCultPopulationVO comCultPopulationVO; |
| | | |
| | | @ApiModelProperty("刑释信息") |
| | | private ComRehabilitationPopulationVO comRehabilitationPopulationVO; |
| | | |
| | | @ApiModelProperty("上访信息") |
| | | private ComKeyPopulationVO comKeyPopulationVO; |
| | | |
| | | @ApiModelProperty("退役军人信息") |
| | | private ComVeteransPopulationVO comVeteransPopulationVO; |
| | | |
| | | @ApiModelProperty("残疾人信息") |
| | | private ComDisabilityPopulationVO comDisabilityPopulationVO; |
| | | |
| | | @ApiModelProperty("低保户信息") |
| | | private ComLowSecurityPopulationVO comLowSecurityPopulationVO; |
| | | |
| | | @ApiModelProperty("高龄老人信息") |
| | | private ComElderAuthElderliesVO comElderAuthElderliesVO; |
| | | |
| | | @ApiModelProperty("养老人员信息") |
| | | private ComPensionAuthPensionerVO comPensionAuthPensionerVO; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @title: ComSwDangerReportEditDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 编辑隐患报告DTO |
| | | * @author: txb |
| | | * @date: 2021/09/08 16:16 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("编辑隐患报告DTO") |
| | | public class ComSwDangerReportEditDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 隐患报告id |
| | | */ |
| | | @ApiModelProperty("隐患报告id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 巡查时间 |
| | | */ |
| | | @ApiModelProperty("巡查时间") |
| | | private String patrolTime; |
| | | |
| | | /** |
| | | * (取字典表国家标准编码)巡查类型(1.防火巡查2.防汛巡查3.防疫巡查) |
| | | */ |
| | | @ApiModelProperty("巡查类型(1.防火巡查2.防汛巡查3.防疫巡查),多条以逗号隔开") |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 巡查领导 |
| | | */ |
| | | @ApiModelProperty("巡查领导") |
| | | private String patrolLeader; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ApiModelProperty("巡查人员id") |
| | | private String patrolPerson; |
| | | |
| | | /** |
| | | * 巡查地址 |
| | | */ |
| | | @ApiModelProperty("巡查地址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 巡查记录 |
| | | */ |
| | | @ApiModelProperty("巡查记录") |
| | | private String recordContent; |
| | | |
| | | /** |
| | | * 发现记录 |
| | | */ |
| | | @ApiModelProperty("发现记录") |
| | | private String findRecord; |
| | | |
| | | /** |
| | | * 记录照片 |
| | | */ |
| | | @ApiModelProperty("记录照片") |
| | | private String recordPhoto; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 接班领导 |
| | | */ |
| | | @ApiModelProperty("接班领导") |
| | | private String successionLeader; |
| | | |
| | | /** |
| | | * 接班人员 |
| | | */ |
| | | @ApiModelProperty("接班人员") |
| | | private String successionPerson; |
| | | |
| | | /** |
| | | * 接班时间 |
| | | */ |
| | | @ApiModelProperty("接班时间") |
| | | private String successionTime; |
| | | |
| | | /** |
| | | * 是否存在隐患(1是 、0否) |
| | | */ |
| | | @ApiModelProperty("是否存在隐患(1是 、0否)") |
| | | private Integer isHiddenDanger; |
| | | |
| | | /** |
| | | * 隐患名称 |
| | | */ |
| | | @ApiModelProperty("隐患名称") |
| | | private String dangerName; |
| | | |
| | | @ApiModelProperty("原隐患名称") |
| | | private String dagerName; |
| | | |
| | | /** |
| | | * 排查时间 |
| | | */ |
| | | @ApiModelProperty("排查时间") |
| | | private String checkTime; |
| | | |
| | | /** |
| | | * 主体部门、单位或个人全称 |
| | | */ |
| | | @ApiModelProperty("主体部门、单位或个人全称") |
| | | private String unitName; |
| | | |
| | | /** |
| | | * 隐患简述 |
| | | */ |
| | | @ApiModelProperty("隐患简述") |
| | | private String dangerDescription; |
| | | |
| | | @ApiModelProperty("原隐患简述") |
| | | private String dagerDescription; |
| | | |
| | | /** |
| | | * 是否立即整改(1是 、0否) |
| | | */ |
| | | @ApiModelProperty("是否立即整改(1是 、0否)") |
| | | private Integer isRectifyImmediately; |
| | | |
| | | /** |
| | | * 社区处理建议 |
| | | */ |
| | | @ApiModelProperty("社区处理建议") |
| | | private String communitySuggestion; |
| | | |
| | | /** |
| | | * 街道安全人员管理建议 |
| | | */ |
| | | @ApiModelProperty("街道安全人员管理建议") |
| | | private String streetSuggestion; |
| | | |
| | | /** |
| | | * 承办记录 |
| | | */ |
| | | @ApiModelProperty("承办记录") |
| | | private String undertakeRecord; |
| | | |
| | | /** |
| | | * 领导意见 |
| | | */ |
| | | @ApiModelProperty("领导意见") |
| | | private String leaderSuggestion; |
| | | |
| | | /** |
| | | * 风险等级(1.红色预警 2.橙色预警 3.黄色预警 4.蓝色预警) |
| | | */ |
| | | @ApiModelProperty("风险等级(1.红色预警 2.橙色预警 3.黄色预警 4.蓝色预警)") |
| | | private String dangerLevel; |
| | | |
| | | /** |
| | | * 指派人员 |
| | | */ |
| | | @ApiModelProperty("指派人员") |
| | | private String assignPerson; |
| | | |
| | | /** |
| | | * 采取措施 |
| | | */ |
| | | @ApiModelProperty("采取措施") |
| | | private String takeSteps; |
| | | |
| | | /** |
| | | * 采取措施照片 |
| | | */ |
| | | @ApiModelProperty("采取措施照片") |
| | | private String stepsPhoto; |
| | | |
| | | /** |
| | | * 整改人员 |
| | | */ |
| | | @ApiModelProperty("整改人员id") |
| | | private String rectifyPerson; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty("修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | | public interface patrolType { |
| | | int huo = 1; |
| | | int xun = 2; |
| | | int yi = 3; |
| | | } |
| | | |
| | | /** |
| | | * 是否 |
| | | */ |
| | | public interface isOk { |
| | | int yes = 1; |
| | | int no = 0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @title: ComSwPatrolRecordEditDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 编辑巡查记录DTO |
| | | * @author: txb |
| | | * @date: 2021/09/08 16:16 |
| | | */ |
| | | @Data |
| | | @ApiModel("编辑巡查记录DTO") |
| | | public class ComSwPatrolRecordEditDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 巡查记录id |
| | | */ |
| | | @ApiModelProperty("巡查记录id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 巡查时间 |
| | | */ |
| | | @ApiModelProperty("巡查时间") |
| | | private String patrolTime; |
| | | |
| | | /** |
| | | * (取字典表国家标准编码)巡查类型(1.防火巡查2.防汛巡查3.防疫巡查) |
| | | */ |
| | | @ApiModelProperty("巡查类型(1.防火巡查2.防汛巡查3.防疫巡查),多条以逗号隔开") |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 巡查领导 |
| | | */ |
| | | @ApiModelProperty("巡查领导id") |
| | | private String patrolLeader; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ApiModelProperty("巡查人员id") |
| | | private String patrolPerson; |
| | | |
| | | /** |
| | | * 巡查地址 |
| | | */ |
| | | @ApiModelProperty("巡查地址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 巡查记录 |
| | | */ |
| | | @ApiModelProperty("巡查记录") |
| | | private String recordContent; |
| | | |
| | | /** |
| | | * 发现记录 |
| | | */ |
| | | @ApiModelProperty("发现记录") |
| | | private String findRecord; |
| | | |
| | | /** |
| | | * 记录照片 |
| | | */ |
| | | @ApiModelProperty("记录照片") |
| | | private String recordPhoto; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 接班领导 |
| | | */ |
| | | @ApiModelProperty("接班领导") |
| | | private String successionLeader; |
| | | |
| | | /** |
| | | * 接班人员 |
| | | */ |
| | | @ApiModelProperty("接班人员") |
| | | private String successionPerson; |
| | | |
| | | /** |
| | | * 接班时间 |
| | | */ |
| | | @ApiModelProperty("接班时间") |
| | | private String successionTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty("修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | | public interface patrolType { |
| | | int huo = 1; |
| | | int xun = 2; |
| | | int yi = 3; |
| | | } |
| | | |
| | | /** |
| | | * 是否 |
| | | */ |
| | | public interface isOk { |
| | | int yes = 1; |
| | | int no = 0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @title: ComSwSafetyWorkEditDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 安全工作记录DTO |
| | | * @author: txb |
| | | * @date: 2021/09/08 16:16 |
| | | */ |
| | | @Data |
| | | @ApiModel("安全工作记录DTO") |
| | | public class ComSwSafetyWorkEditDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 安全工作记录id |
| | | */ |
| | | @ApiModelProperty("安全工作记录id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 巡查时间 |
| | | */ |
| | | @ApiModelProperty("巡查时间") |
| | | private String patrolTime; |
| | | |
| | | /** |
| | | * (取字典表国家标准编码)巡查类型(1.防火巡查2.防汛巡查3.防疫巡查) |
| | | */ |
| | | @ApiModelProperty("巡查类型(1.防火巡查2.防汛巡查3.防疫巡查),多条以逗号隔开") |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 巡查领导 |
| | | */ |
| | | @ApiModelProperty("巡查领导id") |
| | | private String patrolLeader; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ApiModelProperty("巡查人员id") |
| | | private String patrolPerson; |
| | | |
| | | /** |
| | | * 巡查地址 |
| | | */ |
| | | @ApiModelProperty("巡查地址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 巡查记录 |
| | | */ |
| | | @ApiModelProperty("巡查记录") |
| | | private String recordContent; |
| | | |
| | | /** |
| | | * 发现记录 |
| | | */ |
| | | @ApiModelProperty("发现记录") |
| | | private String findRecord; |
| | | |
| | | /** |
| | | * 记录照片 |
| | | */ |
| | | @ApiModelProperty("记录照片") |
| | | private String recordPhoto; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 接班领导 |
| | | */ |
| | | @ApiModelProperty("接班领导") |
| | | private String successionLeader; |
| | | |
| | | /** |
| | | * 接班人员 |
| | | */ |
| | | @ApiModelProperty("接班人员") |
| | | private String successionPerson; |
| | | |
| | | /** |
| | | * 接班时间 |
| | | */ |
| | | @ApiModelProperty("接班时间") |
| | | private String successionTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty("修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | | public interface patrolType { |
| | | int huo = 1; |
| | | int xun = 2; |
| | | int yi = 3; |
| | | } |
| | | |
| | | /** |
| | | * 是否 |
| | | */ |
| | | public interface isOk { |
| | | int yes = 1; |
| | | int no = 0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.property; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class CommonPage { |
| | | @ApiModelProperty("页数") |
| | | private Integer page; |
| | | @ApiModelProperty("条数") |
| | | private Integer size; |
| | | @ApiModelProperty("名称条件") |
| | | private String name; |
| | | @ApiModelProperty("状态") |
| | | private Integer status; |
| | | @ApiModelProperty("用户姓名") |
| | | private String username; |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("地址参数") |
| | | private String address; |
| | | @ApiModelProperty("创建开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date beginTime; |
| | | @ApiModelProperty("创建结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | @ApiModelProperty("系统用户姓名") |
| | | private Date systemName; |
| | | @ApiModelProperty("用户Id") |
| | | private Long userId; |
| | | @ApiModelProperty("参数id") |
| | | private Long paramId; |
| | | @ApiModelProperty("类型") |
| | | private Integer type; |
| | | @ApiModelProperty("状态开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date statusBeginTime; |
| | | @ApiModelProperty("状态结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date statusEndTime; |
| | | @ApiModelProperty("编号") |
| | | private String serialNo; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | |
| | | private String sex; |
| | | |
| | | @ExcelProperty(value = "年龄", index = 5) |
| | | private String age; |
| | | private Integer age; |
| | | |
| | | @ExcelProperty(value = "出生日期", index = 6) |
| | | private String birthday; |
| | |
| | | private String authPeriod; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 11) |
| | | private String authDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date authDate; |
| | | |
| | | @ExcelProperty(value = "标记", index = 12) |
| | | private String mark; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ComElderAuthRecordStatisticExcleVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 高龄认证记录统计 |
| | | * @author: hans |
| | | * @date: 2021/09/01 16:16 |
| | | */ |
| | | @Data |
| | | @ApiModel("高龄认证记录统计") |
| | | @EncryptDecryptClass |
| | | public class ComElderAuthRecordStatisticExcleVO { |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 0) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "认证姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 2) |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "性别", index = 3) |
| | | private String sex; |
| | | |
| | | @ExcelProperty(value = "年龄", index = 4) |
| | | private Integer age; |
| | | |
| | | @ExcelProperty(value = "出生日期", index = 6) |
| | | private String birthday; |
| | | |
| | | @ExcelProperty(value = "人员类别", index = 5) |
| | | private String personnelCategory; |
| | | |
| | | @ExcelProperty(value = "现居住地址", index = 7) |
| | | private String address; |
| | | |
| | | @ExcelProperty(value = "健在", index = 8) |
| | | private String isAlive; |
| | | |
| | | @ExcelProperty(value = "认证期数", index = 9) |
| | | private String authPeriod; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 10) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date authDate; |
| | | |
| | | @ExcelProperty(value = "标记", index = 11) |
| | | private String mark; |
| | | |
| | | @ExcelProperty(value = "认证状态", index = 12) |
| | | private String authStatus; |
| | | } |
| | |
| | | private String authVideo; |
| | | |
| | | @ApiModelProperty(value = "审核人员id") |
| | | private Long approver; |
| | | private Long approverId; |
| | | |
| | | @ApiModelProperty(value = "审核人员姓名") |
| | | private String approverName; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordExcleVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老认证记录 |
| | | * @author: txb |
| | | * @date: 2021/09/07 16:16 |
| | | */ |
| | | @Data |
| | | @ApiModel("养老认证记录") |
| | | @EncryptDecryptClass |
| | | public class ComPensionAuthRecordExcleVO { |
| | | |
| | | @ExcelProperty(value = "提交用户", index = 0) |
| | | private String submitUserName; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 1) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "认证姓名", index = 2) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "认证身份证号", index = 3) |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "现居住地址", index = 4) |
| | | private String address; |
| | | |
| | | @ExcelProperty(value = "健在", index = 5) |
| | | private String isAlive; |
| | | |
| | | @ExcelProperty(value = "认证期数", index = 6) |
| | | private String authPeriod; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 7) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date authDate; |
| | | |
| | | @ExcelProperty(value = "认证方式", index = 8) |
| | | private String authMethod; |
| | | |
| | | @ExcelProperty(value = "标记", index = 9) |
| | | private String mark; |
| | | |
| | | @ExcelProperty(value = "审核状态", index = 10) |
| | | private String approvalStatus; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordImportExcelVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老线下认证导入 |
| | | * @author: txb |
| | | * @date: 2021/09/08 09:16 |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | public class ComPensionAuthRecordImportExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "认证姓名", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "认证身份证号码", index = 1) |
| | | @EncryptDecryptField |
| | | private String IdCard; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 2) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "现居住地址", index = 3) |
| | | private String nowAddress; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 4) |
| | | private Date authDate; |
| | | |
| | | @ExcelProperty(value = "健在(是/否)", index = 5) |
| | | private Integer isAlive; |
| | | |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | private Integer age; |
| | | |
| | | /** |
| | | * 性别(1.男 2.女) |
| | | */ |
| | | private Integer sex; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | | */ |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordImportMistakeExcelVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老线下认证导入错误记录 |
| | | * @author: txb |
| | | * @date: 2021/09/08 09:16 |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | public class ComPensionAuthRecordImportMistakeExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "认证姓名", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "认证身份证号码", index = 1) |
| | | @EncryptDecryptField |
| | | private String IdCard; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 2) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "现居住地址", index = 3) |
| | | private String nowAddress; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 4) |
| | | private String authDate; |
| | | |
| | | @ExcelProperty(value = "健在(是/否)", index = 5) |
| | | private String isAlive; |
| | | |
| | | @ExcelProperty(value = "错误信息", index = 6) |
| | | private String mistake; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordStatisticExcleVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老认证记录统计 |
| | | * @author: txb |
| | | * @date: 2021/09/08 16:16 |
| | | */ |
| | | @Data |
| | | @ApiModel("养老认证记录统计") |
| | | @EncryptDecryptClass |
| | | public class ComPensionAuthRecordStatisticExcleVO { |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 0) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "认证姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 2) |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "现居住地址", index = 3) |
| | | private String address; |
| | | |
| | | @ExcelProperty(value = "健在", index = 4) |
| | | private String isAlive; |
| | | |
| | | @ExcelProperty(value = "认证期数", index = 5) |
| | | private String authPeriod; |
| | | |
| | | @ExcelProperty(value = "认证时间", index = 6) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date authDate; |
| | | |
| | | @ExcelProperty(value = "认证方式", index = 7) |
| | | private String authMethod; |
| | | |
| | | @ExcelProperty(value = "标记", index = 8) |
| | | private String mark; |
| | | |
| | | @ExcelProperty(value = "认证状态", index = 9) |
| | | private String authStatus; |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "提交用户") |
| | | private Long submitUserId; |
| | | |
| | | @ApiModelProperty(value = "提交用户姓名") |
| | | private String submitUserName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "身份证号") |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "性别(1.男 2.女 3.其他)") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "出生日期") |
| | | private String birthday; |
| | | |
| | | @ApiModelProperty(value = "人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上)") |
| | | private Integer personnelCategory; |
| | | |
| | | @ApiModelProperty(value = "是否高龄老人登记(1.是 0.否)") |
| | | private Integer isRegister; |
| | | |
| | | @ApiModelProperty(value = "是否健在(1.是 0.否)") |
| | | private Integer isAlive; |
| | | |
| | | @ApiModelProperty(value = "居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "认证视频url") |
| | | private String authVideo; |
| | | |
| | | @ApiModelProperty(value = "审核人员") |
| | | private String approver; |
| | | @ApiModelProperty(value = "审核人员id") |
| | | private String approverId; |
| | | |
| | | @ApiModelProperty(value = "审核状态(1.待审核 2.驳回 3.通过)") |
| | | private Integer approvalStatus; |
| | |
| | | private String rejectReason; |
| | | |
| | | @ApiModelProperty(value = "认证状态") |
| | | private Boolean authStatus; |
| | | private Integer authStatus; |
| | | |
| | | @ApiModelProperty(value = "认证时间") |
| | | private Date authDate; |
| | |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 巡查领导id |
| | | */ |
| | | @ApiModelProperty("巡查领导id") |
| | | private String patrolLeader; |
| | | |
| | | /** |
| | | * 巡查领导名字 |
| | | */ |
| | | @ApiModelProperty("巡查领导名字") |
| | | private String patrolLeaderName; |
| | | |
| | | /** |
| | | * 巡查人员,多个以逗号隔开 |
| | | */ |
| | | @ApiModelProperty("巡查人员id,多个以逗号隔开") |
| | |
| | | private String remark; |
| | | |
| | | /** |
| | | * 是否存在隐患(1是 、0否) |
| | | */ |
| | | @ApiModelProperty("是否存在隐患(1是 、0否)") |
| | | private Integer isHiddenDanger; |
| | | |
| | | /** |
| | | * 隐患名称 |
| | | */ |
| | | @ApiModelProperty("隐患名称") |
| | |
| | | */ |
| | | @ApiModelProperty("风险等级(1.红色预警 2.橙色预警 3.黄色预警 4.蓝色预警)") |
| | | private String dangerLevel; |
| | | |
| | | /** |
| | | * 是否立即整改(1是 、0否) |
| | | */ |
| | | @ApiModelProperty("是否立即整改(1是 、0否)") |
| | | private Integer isRectifyImmediately; |
| | | |
| | | /** |
| | | * 采取措施 |
| | |
| | | private String patrolName; |
| | | |
| | | /** |
| | | * 接班领导id |
| | | */ |
| | | @ApiModelProperty("接班领导id") |
| | | private String successionLeader; |
| | | |
| | | /** |
| | | * 接班领导名字 |
| | | */ |
| | | @ApiModelProperty("接班领导名字") |
| | | private String successionLeaderName; |
| | | |
| | | /** |
| | | * 接班人员id |
| | | */ |
| | | @ApiModelProperty("接班人员id") |
| | | private String successionPerson; |
| | | |
| | | /** |
| | | * 接班人员名字 |
| | | */ |
| | | @ApiModelProperty("接班人员名字") |
| | | private String successionPersonName; |
| | | |
| | | /** |
| | | * 接班时间 |
| | | */ |
| | | @ApiModelProperty("接班时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date successionTime; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | | public interface patrolType { |
| | |
| | | private String patrolType; |
| | | |
| | | /** |
| | | * 巡查领导id |
| | | */ |
| | | @ApiModelProperty("巡查领导id") |
| | | private String patrolLeader; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ApiModelProperty("巡查人员") |
| | |
| | | private String personName; |
| | | |
| | | /** |
| | | * 接班领导id |
| | | */ |
| | | @ApiModelProperty("接班领导id") |
| | | private String successionLeader; |
| | | |
| | | /** |
| | | * 接班领导名字 |
| | | */ |
| | | @ApiModelProperty("接班领导名字") |
| | | private String successionLeaderName; |
| | | |
| | | /** |
| | | * 接班人员id |
| | | */ |
| | | @ApiModelProperty("接班人员id") |
| | | private String successionPerson; |
| | | |
| | | /** |
| | | * 接班人员名字 |
| | | */ |
| | | @ApiModelProperty("接班人员名字") |
| | | private String successionPersonName; |
| | | |
| | | /** |
| | | * 接班时间 |
| | | */ |
| | | @ApiModelProperty("接班时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date successionTime; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | | public interface patrolType { |
New file |
| | |
| | | package com.panzhihua.common.model.vos.property; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("详情") |
| | | public class ComPropertyAlarmDetailVO { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.property; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class ComPropertyAlarmSettingVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 触发间隔 |
| | | */ |
| | | @ApiModelProperty(value = "触发间隔") |
| | | private Integer triggerTime; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.property; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("") |
| | | public class ComPropertyAlarmVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设备号 |
| | | */ |
| | | @ApiModelProperty(value = "设备号") |
| | | private String serialNo; |
| | | |
| | | /** |
| | | * 报警类型 1一键报警 2长时间无应答报警 |
| | | */ |
| | | @ApiModelProperty(value = "报警类型 1一键报警 2长时间无应答报警") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | /** |
| | | * 位置信息 |
| | | */ |
| | | @ApiModelProperty(value = "位置信息") |
| | | private String position; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | *居民姓名 |
| | | */ |
| | | @ApiModelProperty("居民姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 报警处理状态 0待处理 1已办结 |
| | | */ |
| | | @ApiModelProperty("处理状态") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 处理人 |
| | | */ |
| | | @ApiModelProperty("处理人") |
| | | private String solveName; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private Date solveTime; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String solveContent; |
| | | |
| | | /** |
| | | * 处理人id |
| | | */ |
| | | @ApiModelProperty("处理人id") |
| | | private Long solveId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 处理图片 |
| | | */ |
| | | @ApiModelProperty("处理图片") |
| | | private String solveUrl; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.property; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("设备实体") |
| | | public class ComPropertyEquipmentVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | @ApiModelProperty(value = "设备编号") |
| | | private String serialNo; |
| | | |
| | | /** |
| | | * 报警位置 |
| | | */ |
| | | @ApiModelProperty(value = "报警位置") |
| | | private String position; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 居民名称 |
| | | */ |
| | | @ApiModelProperty(value = "居民名称") |
| | | private String username; |
| | | |
| | | /** |
| | | * 设备类型 |
| | | */ |
| | | @ApiModelProperty(value = "设备类型 1红外报警 2一键报警 ") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.property; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class ComPropertyRepairVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 报修内容 |
| | | */ |
| | | @ApiModelProperty(value = "报修内容") |
| | | private String repairContent; |
| | | |
| | | /** |
| | | * 报修人 |
| | | */ |
| | | @ApiModelProperty(value = "报修人") |
| | | private String repairName; |
| | | |
| | | /** |
| | | * 报修手机 |
| | | */ |
| | | @ApiModelProperty(value = "报修手机") |
| | | private String repairPhone; |
| | | |
| | | /** |
| | | * 报修位置 |
| | | */ |
| | | @ApiModelProperty(value = "报修位置") |
| | | private String repairPosition; |
| | | |
| | | /** |
| | | * 状态 0 待处理 1待评价 2已结束 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0 待处理 1待评价 2已结束") |
| | | private Integer repairStatus; |
| | | |
| | | /** |
| | | * 报修时间 |
| | | */ |
| | | @ApiModelProperty(value = "报修时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 报修图片url |
| | | */ |
| | | @ApiModelProperty(value = "报修图片url") |
| | | private String repairUrl; |
| | | |
| | | /** |
| | | * 评价内容 |
| | | */ |
| | | @ApiModelProperty(value = "评价内容") |
| | | private String replyContent; |
| | | |
| | | /** |
| | | * 评价图片url |
| | | */ |
| | | @ApiModelProperty(value = "评价图片url") |
| | | private String replyUrl; |
| | | |
| | | /** |
| | | * 评价时间 |
| | | */ |
| | | @ApiModelProperty(value = "评价时间") |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 报修人id |
| | | */ |
| | | @ApiModelProperty(value = "报修人id") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 反馈人id |
| | | */ |
| | | @ApiModelProperty(value = "反馈人id") |
| | | private Long feedbackBy; |
| | | |
| | | /** |
| | | * 反馈内容 |
| | | */ |
| | | @ApiModelProperty(value = "反馈内容") |
| | | private String feedbackContent; |
| | | |
| | | /** |
| | | * 反馈图片 |
| | | */ |
| | | @ApiModelProperty(value = "反馈图片") |
| | | private String feedbackUrl; |
| | | |
| | | /** |
| | | * 反馈时间 |
| | | */ |
| | | @ApiModelProperty(value = "反馈时间") |
| | | private Date feedbackTime; |
| | | |
| | | /** |
| | | * 评价星级 |
| | | */ |
| | | @ApiModelProperty(value = "评价星级") |
| | | private Integer replyScore; |
| | | |
| | | /** |
| | | * 物业id |
| | | */ |
| | | @ApiModelProperty(value = "物业id") |
| | | private Integer propertyId; |
| | | /** |
| | | * 反馈人 |
| | | */ |
| | | @ApiModelProperty(value = "反馈人名称") |
| | | private String feedback; |
| | | |
| | | /** |
| | | * 状态 0 待处理 1待评价 2已结束 |
| | | */ |
| | | public interface status{ |
| | | int dcl=0; |
| | | int dpj=1; |
| | | int yjs=2; |
| | | } |
| | | } |
| | |
| | | @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId); |
| | | |
| | | /** |
| | | * 批量导入养老线下认证记录 listSavePensionAuthRecordExcelVO 批量导入养老线下认证记录 |
| | | * @param list 养老线下认证记录数据 |
| | | * @param communityId 社区id |
| | | * @param userId 登录人id |
| | | * @return R 导入结果 |
| | | * @author txb |
| | | * @date 2021/9/01 15:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/underLine/import") |
| | | R listSavePensionAuthRecordExcelVO(@RequestBody List<ComPensionAuthRecordImportExcelVO> list, |
| | | @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId); |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * |
| | | * @param list |
| | |
| | | * @return 实有人口详细信息 |
| | | */ |
| | | @PostMapping("/common/data/population/detail") |
| | | R<ComMngPopulationVO> detailPopulation(@RequestParam(value = "populationId") Long populationId); |
| | | R<ComMngPopulationVO> detailPopulation(@RequestParam(value = "populationId") Long populationId, @RequestParam(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 根据id查询实有人口电子档案信息 |
| | |
| | | R getElderAuthRecordsByIds(@RequestBody List<Long> ids); |
| | | |
| | | /** |
| | | * 导出高龄认证记录 exportElderAuthRecordsStatistic 导出高龄认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/elders/authRecords/statistic/export") |
| | | R exportElderAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 分页查询养老金人员认证记录 pagePensionAuthRecords 分页查询养老金人员认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 14:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/page") |
| | | R pagePensionAuthRecords(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 根据养老认证记录id查询详情 detailPensionAuthRecords 根据养老认证记录id查询详情 |
| | | * @param authRecordId 养老认证记录id |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @GetMapping("/elders/pensionAuthRecords/detail") |
| | | R detailPensionAuthRecords(@RequestParam(value = "authRecordId") Long authRecordId); |
| | | |
| | | /** |
| | | * 养老认证审核 examinePensionAuthRecords 养老认证审核 |
| | | * @param comPensionAuthRecordVO 养老认证审核参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/examine") |
| | | R examinePensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO); |
| | | |
| | | /** |
| | | * 养老认证标记 signPensionAuthRecords 养老认证标记 |
| | | * @param comPensionAuthRecordVO 养老认证标记参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/sign") |
| | | R signPensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO); |
| | | |
| | | /** |
| | | * 根据养老认证记录id批量查询 getPensionAuthRecordsByIds 根据养老认证记录id批量查询 |
| | | * @param ids 养老认证记录id集合 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/getList") |
| | | R getPensionAuthRecordsByIds(@RequestBody List<Long> ids); |
| | | |
| | | /** |
| | | * 导出养老认证记录 exportPensionAuthRecordsStatistic 导出养老认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/statistic/export") |
| | | R exportPensionAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 小程序-查询疫苗分类列表 |
| | | * |
| | | * @return 疫苗分类列表 |
| | |
| | | R addPatrolRecord(@RequestBody ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO); |
| | | |
| | | /** |
| | | * 编辑巡查记录 editPatrolRecord 编辑巡查记录 |
| | | * @param comSwPatrolRecordEditDTO 编辑巡查记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/patrolRecord/edit") |
| | | R editPatrolRecord(@RequestBody ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO); |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId |
| | |
| | | */ |
| | | @PostMapping("/patrolRecord/safetyWorkRecord/page") |
| | | R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO); |
| | | |
| | | /** |
| | | * 编辑安全工作记录 editSafetyWork 编辑安全工作记录 |
| | | * @param comSwSafetyWorkEditDTO 编辑安全工作记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/patrolRecord/safetyWorkRecord/edit") |
| | | R editSafetyWork(@RequestBody ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO); |
| | | |
| | | /** |
| | | * 根据安全工作记录id查询详情 |
| | |
| | | */ |
| | | @PostMapping("/patrolRecord/dangerReport/page") |
| | | R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO); |
| | | |
| | | /** |
| | | * 编辑隐患报告 editDangerReport 编辑隐患报告 |
| | | * @param comSwDangerReportEditDTO 编辑隐患报告参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/patrolRecord/dangerReport/edit") |
| | | R editDangerReport(@RequestBody ComSwDangerReportEditDTO comSwDangerReportEditDTO); |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | |
| | | R timedTaskEldersAuthRecordJobHandler(); |
| | | |
| | | /** |
| | | * 定时任务每月1号0点统计高龄老人本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("/elders/authRecords/statistics") |
| | | R timedTaskElderAuthStatisticsJobHandler(); |
| | | |
| | | /** |
| | | * 定时任务每年3月1号0点统计养老认证本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("/elders/pensionAuthRecords/statistics") |
| | | R timedTaskPensionAuthStatisticsJobHandler(); |
| | | |
| | | /** |
| | | * 办事指南列表-按分类查询 |
| | | * @param pageActWorkGuideDTO 请求参数 |
| | | * @return 办事指南分类列表 |
New file |
| | |
| | | package com.panzhihua.common.service.property; |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmSettingVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 物业接口 |
| | | */ |
| | | @FeignClient(name = "property") |
| | | public interface PropertyService { |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comPropertyRepair/queryAll") |
| | | R comPropertyRepairSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyRepair/{id}") |
| | | R comPropertyRepairSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyRepair 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyRepair") |
| | | R comPropertyRepairInsert(@RequestBody ComPropertyRepairVO comPropertyRepair); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepair 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyRepair/update") |
| | | R comPropertyRepairUpdate(@RequestBody ComPropertyRepairVO comPropertyRepair); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyRepair/del") |
| | | R comPropertyRepairDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询报警列表 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | @PostMapping("/comPropertyAlarm/queryAll") |
| | | R comPropertyAlarmSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyAlarm/{id}") |
| | | R comPropertyAlarmSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarm 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarm") |
| | | R comPropertyAlarmInsert(@RequestBody ComPropertyAlarmVO comPropertyAlarm); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyAlarm 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarm/update") |
| | | R comPropertyAlarmUpdate(@RequestBody ComPropertyAlarmVO comPropertyAlarm); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyAlarm/del") |
| | | R comPropertyAlarmDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment/queryAll") |
| | | R comPropertyEquipmentSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyEquipment/{id}") |
| | | R comPropertyEquipmentSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment") |
| | | R comPropertyEquipmentInsert(@RequestBody ComPropertyEquipmentVO comPropertyEquipment); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment/update") |
| | | R comPropertyEquipmentUpdate(@RequestBody ComPropertyEquipmentVO comPropertyEquipment); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyEquipment/del") |
| | | R comPropertyEquipmentDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmSettingVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarmSetting") |
| | | R comPropertyAlarmSettingInsert(@RequestBody ComPropertyAlarmSettingVO comPropertyAlarmSettingVO); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param communityId 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyAlarmSetting") |
| | | R comPropertyAlarmSettingSelectOne(@RequestParam("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("comPropertyAlarm") |
| | | @Api(tags = "物业报警api") |
| | | public class ComPropertyAlarmApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComPropertyAlarmVO.class) |
| | | @PostMapping("queryAll/noToken") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(2L); |
| | | return propertyService.comPropertyAlarmSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "详情",response = ComPropertyAlarmVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return propertyService.comPropertyAlarmSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) { |
| | | comPropertyAlarmVO.setCommunityId(this.getCommunityId()); |
| | | return propertyService.comPropertyAlarmInsert(comPropertyAlarmVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyAlarmVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) { |
| | | comPropertyAlarmVO.setSolveId(this.getUserId()); |
| | | comPropertyAlarmVO.setSolveTime(DateUtil.date()); |
| | | return propertyService.comPropertyAlarmUpdate(comPropertyAlarmVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return propertyService.comPropertyAlarmDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmSettingVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("comPropertyAlarmSetting") |
| | | @Api(tags = "物业报警设置api") |
| | | public class ComPropertyAlarmSettingApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("查询设置") |
| | | @GetMapping |
| | | public R selectOne() { |
| | | return this.propertyService.comPropertyAlarmSettingSelectOne(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmSettingVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增或修改设置") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyAlarmSettingVO comPropertyAlarmSettingVO) { |
| | | comPropertyAlarmSettingVO.setCommunityId(this.getCommunityId()); |
| | | return this.propertyService.comPropertyAlarmSettingInsert(comPropertyAlarmSettingVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("comPropertyEquipment") |
| | | @Api(tags = "物业设备api") |
| | | public class ComPropertyEquipmentApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComPropertyEquipmentVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return propertyService.comPropertyEquipmentSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "详情",response = ComPropertyEquipmentVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return propertyService.comPropertyEquipmentSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | comPropertyEquipmentVO.setCommunityId(this.getCommunityId()); |
| | | comPropertyEquipmentVO.setCreateTime(DateUtil.date()); |
| | | return propertyService.comPropertyEquipmentInsert(comPropertyEquipmentVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | return propertyService.comPropertyEquipmentUpdate(comPropertyEquipmentVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return propertyService.comPropertyEquipmentDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("propertyRepair") |
| | | @Api(tags = "物业报修api") |
| | | public class ComPropertyRepairApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "后台列表接口",response = ComPropertyRepairVO.class) |
| | | @PostMapping("/queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.propertyService.comPropertyRepairSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 后台添加报修 |
| | | * @param comPropertyRepairVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("后台添加报修") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | comPropertyRepairVO.setCreateTime(DateUtil.date()); |
| | | comPropertyRepairVO.setCreateBy(this.getUserId()); |
| | | return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 后台审核接口 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("审核接口") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | if(comPropertyRepairVO!=null&& StringUtils.isNotEmpty(comPropertyRepairVO.getFeedbackContent())){ |
| | | comPropertyRepairVO.setFeedbackBy(this.getUserId()); |
| | | comPropertyRepairVO.setFeedbackTime(DateUtil.date()); |
| | | } |
| | | if(comPropertyRepairVO!=null&&StringUtils.isNotEmpty(comPropertyRepairVO.getReplyContent())){ |
| | | comPropertyRepairVO.setReplyTime(DateUtil.date()); |
| | | } |
| | | return this.propertyService.comPropertyRepairUpdate(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除接口") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyRepairDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @GetMapping("/{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.propertyService.comPropertyRepairSelectOne(id); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.utlis.*; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 编辑巡查记录 editPatrolRecord 编辑巡查记录 |
| | | * @param comSwPatrolRecordEditDTO 编辑巡查记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/editPatrolRecord") |
| | | @ApiOperation(value = "编辑巡查记录") |
| | | public R editPatrolRecord(@RequestBody ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | comSwPatrolRecordEditDTO.setUpdateBy(userId); |
| | | return communityService.editPatrolRecord(comSwPatrolRecordEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId |
| | |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | return communityService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑安全工作记录 editSafetyWork 编辑安全工作记录 |
| | | * @param comSwSafetyWorkEditDTO 编辑安全工作记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/editSafetyWorkRecord") |
| | | @ApiOperation(value = "编辑安全工作记录") |
| | | public R editSafetyWork(@RequestBody ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | comSwSafetyWorkEditDTO.setUpdateBy(userId); |
| | | return communityService.editSafetyWork(comSwSafetyWorkEditDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 编辑隐患报告 editDangerReport 编辑隐患报告 |
| | | * @param comSwDangerReportEditDTO 编辑隐患报告参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/editDangerReport") |
| | | @ApiOperation(value = "编辑隐患报告") |
| | | public R editDangerReport(@RequestBody ComSwDangerReportEditDTO comSwDangerReportEditDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | comSwDangerReportEditDTO.setUpdateBy(userId); |
| | | return communityService.editDangerReport(comSwDangerReportEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | | * |
| | | * @param dangerReportId |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | |
| | | @PostMapping(value = "/minio/upload/file", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R minipuploadImage(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | log.info("开始上传文件" + DateUtils.getCurrentDateStr_MS()); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | log.info("上传文件结束" + DateUtils.getCurrentDateStr_MS()); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.listen.ComElderAuthRecordImportExcelListen; |
| | | import com.panzhihua.common.listen.ComMngPopulationDrugExcelListen; |
| | | import com.panzhihua.common.listen.ComPensionAuthRecordImportExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | |
| | | if (R.isOk(r)) { |
| | | list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComElderAuthRecordExcleVO.class); |
| | | } |
| | | excelWriter = EasyExcel.write(fileName, ComElderAuthRecordVO.class) |
| | | excelWriter = EasyExcel.write(fileName, ComElderAuthRecordExcleVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("高龄认证导出数据").build(); |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "高龄认证-下载模板-线下认证居民导入") |
| | | @ApiOperation(value = "高龄认证统计-下载模板-线下认证居民导入") |
| | | @GetMapping("/authRecords/uderLine/export") |
| | | public R exportUnderLineElderAuthRecords() { |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "线下认证居民导入模板.xlsx"; |
| | | String name = "高龄线下认证居民导入模板.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | |
| | | try { |
| | | List<List<String>> list = new ArrayList<>(); |
| | | list = headDataFilling(); |
| | | EasyExcel.write(fileName).head(list).sheet("线下认证居民导入模板").doWrite(null); |
| | | EasyExcel.write(fileName).head(list).sheet("高龄线下认证居民导入模板").doWrite(null); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "高龄认证-excel导入线下认证居民") |
| | | @ApiOperation(value = "高龄认证统计-excel导入线下认证居民") |
| | | @PostMapping(value = "/authRecords/uderLine/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R importDrug(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | public R importUnderLineElderAuthRecords(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // 获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "高龄认证统计-导出高龄认证统计") |
| | | @PostMapping(value = "/authRecords/statistic/export") |
| | | public R exportElderAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | pageElderAuthRecordsDTO.setCommunityId(communityId); |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "高龄认证统计导出数据" + nowDate + ".xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | R r = communityService.exportElderAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | List<ComElderAuthRecordStatisticExcleVO> list = new ArrayList<>(); |
| | | if (R.isOk(r)) { |
| | | list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComElderAuthRecordStatisticExcleVO.class); |
| | | } |
| | | excelWriter = EasyExcel.write(fileName, ComElderAuthRecordStatisticExcleVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("高龄认证统计导出数据").build(); |
| | | excelWriter.write(list, 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(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页查询养老金人员认证记录 pagePensionAuthRecords 分页查询养老金人员认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 14:03 |
| | | */ |
| | | @ApiOperation(value = "养老认证-分页查询养老金人员认证记录", response = ComPensionAuthRecordVO.class) |
| | | @PostMapping("/pensionAuthRecords/page") |
| | | public R pagePensionAuthRecords(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | pageElderAuthRecordsDTO.setCommunityId(communityId); |
| | | return communityService.pagePensionAuthRecords(pageElderAuthRecordsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据养老认证记录id查询详情 detailPensionAuthRecords 根据养老认证记录id查询详情 |
| | | * @param authRecordId 养老认证记录id |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @ApiOperation(value = "养老认证-根据养老认证记录id查询详情", response = ComPensionAuthRecordVO.class) |
| | | @GetMapping("/pensionAuthRecords/detail") |
| | | public R detailPensionAuthRecords(@RequestParam(value = "authRecordId") Long authRecordId) { |
| | | return communityService.detailPensionAuthRecords(authRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 养老认证审核 examinePensionAuthRecords 养老认证审核 |
| | | * @param comPensionAuthRecordVO 养老认证审核参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @ApiOperation(value = "养老认证-养老认证审核") |
| | | @PostMapping("/pensionAuthRecords/examine") |
| | | public R examinePensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | return communityService.examinePensionAuthRecords(comPensionAuthRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 养老认证标记 signPensionAuthRecords 养老认证标记 |
| | | * @param comPensionAuthRecordVO 养老认证标记参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @ApiOperation(value = "养老认证-养老认证标记") |
| | | @PostMapping("/pensionAuthRecords/sign") |
| | | public R signPensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | return communityService.signPensionAuthRecords(comPensionAuthRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 养老认证导出 exportPensionAuthRecords 养老认证导出 |
| | | * @param ids 养老认证记录id集合 |
| | | * @return R 导出结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @ApiOperation(value = "养老认证-养老认证导出") |
| | | @PostMapping("/pensionAuthRecords/export") |
| | | public R exportPensionAuthRecords(@RequestBody List<Long> ids) { |
| | | // List<ComMngPopulationMistakeExcelVO> list = JSON.parseArray(mistakes,ComMngPopulationMistakeExcelVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "养老认证导出数据" + nowDate + ".xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | R r = communityService.getPensionAuthRecordsByIds(ids); |
| | | List<ComPensionAuthRecordExcleVO> list = new ArrayList<>(); |
| | | if (R.isOk(r)) { |
| | | list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPensionAuthRecordExcleVO.class); |
| | | } |
| | | excelWriter = EasyExcel.write(fileName, ComPensionAuthRecordExcleVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("养老认证导出数据").build(); |
| | | excelWriter.write(list, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "养老认证统计-下载模板-线下认证居民导入") |
| | | @GetMapping("/pensionAuthRecords/uderLine/export") |
| | | public R exportUnderLinePensionAuthRecords() { |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "养老线下认证居民导入模板.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<List<String>> list = new ArrayList<>(); |
| | | list = headDataFilling(); |
| | | EasyExcel.write(fileName).head(list).sheet("养老线下认证居民导入模板").doWrite(null); |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "养老认证统计-excel导入线下认证居民") |
| | | @PostMapping(value = "/pensionAuthRecords/uderLine/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R importUnderLinePensionAuthRecords(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // 获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | ComPensionAuthRecordImportExcelListen comPensionAuthRecordImportExcelListen = new ComPensionAuthRecordImportExcelListen( |
| | | communityService, this.getCommunityId(), this.getLoginUserInfo().getUserId(), stringRedisTemplate); |
| | | EasyExcel.read(inputStream, null, comPensionAuthRecordImportExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "养老认证统计-导出养老认证统计") |
| | | @PostMapping(value = "/pensionAuthRecords/statistic/export") |
| | | public R exportPensionAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | pageElderAuthRecordsDTO.setCommunityId(communityId); |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "养老认证统计导出数据" + nowDate + ".xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | R r = communityService.exportPensionAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | List<ComPensionAuthRecordStatisticExcleVO> list = new ArrayList<>(); |
| | | if (R.isOk(r)) { |
| | | list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPensionAuthRecordStatisticExcleVO.class); |
| | | } |
| | | excelWriter = EasyExcel.write(fileName, ComPensionAuthRecordStatisticExcleVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("养老认证统计导出数据").build(); |
| | | excelWriter.write(list, 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(); |
| | | } |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling() { |
| | | List<List<String>> list = new ArrayList<List<String>>(); |
| | | List<String> head0 = new ArrayList<String>(); |
| | |
| | | @ApiOperation(value = "实有人口详情", response = ComMngPopulationVO.class) |
| | | @PostMapping("/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.detailPopulation(populationId); |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.detailPopulation(populationId, communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有人口电子档案", response = UserElectronicFileVO.class) |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.minio.ObjectStat; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio工具类 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | @EnableConfigurationProperties(MinioConfig.class) |
| | | public class MinioUtil { |
| | |
| | | UUID uuid = UUID.randomUUID(); |
| | | StringBuilder s = new StringBuilder(); |
| | | s.append(uuid.toString().replace("-", "")).append("/"); |
| | | log.info("开始连接minio服务器" + DateUtils.getCurrentDateStr_MS()); |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | log.info("结束连接minio服务器" + DateUtils.getCurrentDateStr_MS()); |
| | | // bucket 不存在,创建 |
| | | if (!minioClient.bucketExists(minioProperties.getBucket())) { |
| | | log.info("bucket 不存在,创建"); |
| | | minioClient.makeBucket(minioProperties.getBucket()); |
| | | } |
| | | // 得到文件流 |
| | |
| | | <module>service_grid</module> |
| | | <!--网格治理-对接浪潮的市平台综治接口--> |
| | | <module>service_api</module> |
| | | <!--物业service--> |
| | | <module>service_property</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | |
| | | String lcGrid = gridService.getLcGridIdByLocal(lcEventVisitingTasksListDTO.getGridId()); |
| | | String lcGridUserId = |
| | | gridService.getLcUserIdByLocalUserId(lcEventVisitingTasksListDTO.getGridMember().toString()); |
| | | R populationDetail = communityService.detailPopulation(lcEventVisitingTasksListDTO.getVisiterId()); |
| | | R populationDetail = communityService.detailPopulation(lcEventVisitingTasksListDTO.getVisiterId(), null); |
| | | ComMngPopulationVO comMngPopulationVO = (ComMngPopulationVO)populationDetail.getData(); |
| | | BcDictionaryItemVO diction = communityService.getByCode(DictionItemConstants.LC_CULTURE_LEVEL, |
| | | comMngPopulationVO.getCultureLevel().toString()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 编辑巡查记录 editPatrolRecord 编辑巡查记录 |
| | | * @param comSwPatrolRecordEditDTO 编辑巡查记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R editPatrolRecord(@RequestBody ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO) { |
| | | return comSwPatrolRecordService.editPatrolRecord(comSwPatrolRecordEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId |
| | |
| | | @PostMapping("/safetyWorkRecord/page") |
| | | public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | return comSwSafetyWorkRecordService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑安全工作记录 editSafetyWork 编辑安全工作记录 |
| | | * @param comSwSafetyWorkEditDTO 编辑安全工作记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/safetyWorkRecord/edit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R editSafetyWork(@RequestBody ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO) { |
| | | return comSwSafetyWorkRecordService.editSafetyWork(comSwSafetyWorkEditDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 编辑隐患报告 editDangerReport 编辑隐患报告 |
| | | * @param comSwDangerReportEditDTO 编辑隐患报告参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | @PostMapping("/dangerReport/edit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R editDangerReport(@RequestBody ComSwDangerReportEditDTO comSwDangerReportEditDTO) { |
| | | return comSwDangerReportService.editDangerReport(comSwDangerReportEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | | * |
| | | * @param dangerReportId |
| | |
| | | * @return 实有人口详情查询结果 |
| | | */ |
| | | @PostMapping("/population/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return comMngPopulationService.detailPopulation(populationId); |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId, @RequestParam(value = "communityId") Long communityId) { |
| | | return comMngPopulationService.detailPopulation(populationId, communityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.model.dos.ComEldersAuthElderlyDO; |
| | | import com.panzhihua.service_community.service.ComElderAuthRecordsService; |
| | | import com.panzhihua.service_community.service.ComEldersAuthElderlyService; |
| | | import com.panzhihua.service_community.service.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComEldersAuthElderlyDetailsVO; |
| | | import com.panzhihua.common.model.vos.elders.ComElderAuthUserDetailVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.model.dos.ComEldersAuthUserDO; |
| | | import com.panzhihua.service_community.model.dos.EldersAuthDO; |
| | | import com.panzhihua.service_community.service.ComEldersAuthUserService; |
| | | import com.panzhihua.service_community.service.EldersAuthService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | private ComEldersAuthElderlyService comEldersAuthElderlyService; |
| | | @Resource |
| | | private ComElderAuthRecordsService comElderAuthRecordsService; |
| | | @Resource |
| | | private ComPensionAuthRecordService comPensionAuthRecordService; |
| | | |
| | | @PostMapping("/getAuth") |
| | | public R getAuth(@RequestParam("authUserId") Long authUserId) { |
| | |
| | | return comElderAuthRecordsService.getElderAuthRecordsByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 批量导入高龄老人线下认证记录 listSaveElderAuthRecordExcelVO 批量导入高龄老人线下认证记录 |
| | | * @param list 高龄老人线下认证记录数据 |
| | | * @param communityId 社区id |
| | | * @param userId 登录人id |
| | | * @return R 导入结果 |
| | | * @author txb |
| | | * @date 2021/9/01 15:03 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @PostMapping("/authRecords/underLine/import") |
| | | public R listSaveElderAuthRecordExcelVO(@RequestBody List<ComElderAuthRecordImportExcelVO> list, |
| | | @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){ |
| | | return comElderAuthRecordsService.listSaveElderAuthRecordExcelVO(list, communityId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 导出高龄认证记录 exportElderAuthRecordsStatistic 导出高龄认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/authRecords/statistic/export") |
| | | public R exportElderAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO){ |
| | | return comElderAuthRecordsService.exportElderAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询养老金人员认证记录 pagePensionAuthRecords 分页查询养老金人员认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 14:03 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/page") |
| | | public R pagePensionAuthRecords(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | return comPensionAuthRecordService.pagePensionAuthRecords(pageElderAuthRecordsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据养老认证记录id查询详情 detailPensionAuthRecords 根据养老认证记录id查询详情 |
| | | * @param authRecordId 养老认证记录id |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @GetMapping("/pensionAuthRecords/detail") |
| | | public R detailPensionAuthRecords(@RequestParam(value = "authRecordId") Long authRecordId) { |
| | | return comPensionAuthRecordService.detailPensionAuthRecords(authRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 养老认证审核 examinePensionAuthRecords 养老认证审核 |
| | | * @param comPensionAuthRecordVO 养老认证审核参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/examine") |
| | | public R examinePensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | return comPensionAuthRecordService.examinePensionAuthRecords(comPensionAuthRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 养老认证标记 signPensionAuthRecords 养老认证标记 |
| | | * @param comPensionAuthRecordVO 养老认证标记参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/sign") |
| | | public R signPensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | return comPensionAuthRecordService.signPensionAuthRecords(comPensionAuthRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据养老认证记录id批量查询 getPensionAuthRecordsByIds 根据养老认证记录id批量查询 |
| | | * @param ids 养老认证记录id集合 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/getList") |
| | | public R getPensionAuthRecordsByIds(@RequestBody List<Long> ids){ |
| | | return comPensionAuthRecordService.getPensionAuthRecordsByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 批量导入养老线下认证记录 listSavePensionAuthRecordExcelVO 批量导入养老线下认证记录 |
| | | * @param list 养老线下认证记录数据 |
| | | * @param communityId 社区id |
| | | * @param userId 登录人id |
| | | * @return R 导入结果 |
| | | * @author txb |
| | | * @date 2021/9/08 10:03 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @PostMapping("/pensionAuthRecords/underLine/import") |
| | | R listSavePensionAuthRecordExcelVO(@RequestBody List<ComPensionAuthRecordImportExcelVO> list, |
| | | @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){ |
| | | return comPensionAuthRecordService.listSavePensionAuthRecordExcelVO(list, communityId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 导出养老认证记录 exportPensionAuthRecordsStatistic 导出养老认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/statistic/export") |
| | | public R exportPensionAuthRecordsStatistic(@RequestBody PageElderAuthRecordsDTO pageElderAuthRecordsDTO){ |
| | | return comPensionAuthRecordService.exportPensionAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务每月1号0点统计高龄老人本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("/authRecords/statistics") |
| | | public R timedTaskElderAuthStatisticsJobHandler(){ |
| | | return comElderAuthRecordsService.timedTaskElderAuthStatisticsJobHandler(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务每年3月1号0点统计养老认证本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("/pensionAuthRecords/statistics") |
| | | R timedTaskPensionAuthStatisticsJobHandler(){ |
| | | return comPensionAuthRecordService.timedTaskPensionAuthStatisticsJobHandler(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | List<Long> getActivityEndIds(); |
| | | |
| | | @Update("update com_act_activity set `status`=4 where `status`=3 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | @Update("update com_act_activity set `status`=5 where `status`=3 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginAfterSingEnd(); |
| | | |
| | | @Select("select GROUP_CONCAT(t.x1,',',t.x2,',',t.x3,',',t.x4) from ( " + "SELECT " |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthElderliesDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * title: ComElderAuthElderliesDAO 社区政务》高龄老人认证》高龄老人表mapper类 |
| | |
| | | @Mapper |
| | | public interface ComElderAuthElderliesDAO extends BaseMapper<ComElderAuthElderliesDO> { |
| | | |
| | | int haveElderAuthElderliesAmount(@Param("communityId") Long communityId, @Param("authPeriod") String authPeriod); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordExcleVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordStatisticExcleVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | List<ComElderAuthRecordExcleVO> getElderAuthRecordsByIds(@Param("ids") List<Long> ids); |
| | | |
| | | void updateAll(@Param("comElderAuthRecordsDOS") List<ComElderAuthRecordsDO> comElderAuthRecordsDOS); |
| | | |
| | | List<ComElderAuthRecordStatisticExcleVO> exportElderAuthRecordsStatistic(@Param("pageElderAuthRecordsDTO") PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthPensionerDO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthPensionerDAO |
| | |
| | | */ |
| | | @Mapper |
| | | public interface ComPensionAuthPensionerDAO extends BaseMapper<ComPensionAuthPensionerDO> { |
| | | |
| | | int havePensionAuthPensionerAmount(@Param("communityId") Long communityId, @Param("authPeriod") String authPeriod); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthRecordDO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordDAO |
| | |
| | | */ |
| | | @Mapper |
| | | public interface ComPensionAuthRecordDAO extends BaseMapper<ComPensionAuthRecordDO> { |
| | | IPage<ComPensionAuthRecordVO> pagePensionAuthRecords(Page page, |
| | | @Param("pageElderAuthRecordsDTO") PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | ComPensionAuthRecordVO detailPensionAuthRecords(@Param("authRecordId") Long authRecordId); |
| | | |
| | | List<ComPensionAuthRecordExcleVO> getPensionAuthRecordsByIds(@Param("ids") List<Long> ids); |
| | | |
| | | void updateAll(@Param("comPensionAuthRecordDOS") List<ComPensionAuthRecordDO> comPensionAuthRecordDOS); |
| | | |
| | | List<ComPensionAuthRecordStatisticExcleVO> exportPensionAuthRecordsStatistic(@Param("pageElderAuthRecordsDTO") PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthStatisticsDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthStatisticsDAO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老认证统计表mapper |
| | | * @author: txb |
| | | * @date: 2021/09/07 17:28 |
| | | */ |
| | | @Mapper |
| | | public interface ComPensionAuthStatisticsDAO extends BaseMapper<ComPensionAuthStatisticsDO> { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | @Data |
| | | @TableName("com_elder_auth_elderlies") |
| | | @EncryptDecryptClass |
| | | public class ComElderAuthElderliesDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 审核人员 |
| | | */ |
| | | private String approver; |
| | | private Long approverId; |
| | | |
| | | /** |
| | | * 审核状态(1.待审核 2.驳回 3.通过) |
| | |
| | | /** |
| | | * 认证状态(1.已认证 0.未认证) |
| | | */ |
| | | private Boolean authStatus; |
| | | private Integer authStatus; |
| | | |
| | | /** |
| | | * 认证时间 |
| | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComElderAuthRecordsDO{" + |
| | | "id=" + id + |
| | | ", elderliesId=" + elderliesId + |
| | | ", authPeriod=" + authPeriod + |
| | | ", submitUserId=" + submitUserId + |
| | | ", authVideo=" + authVideo + |
| | | ", approver=" + approver + |
| | | ", approvalStatus=" + approvalStatus + |
| | | ", approvalDate=" + approvalDate + |
| | | ", mark=" + mark + |
| | | ", rejectReason=" + rejectReason + |
| | | ", authStatus=" + authStatus + |
| | | ", authDate=" + authDate + |
| | | ", createAt=" + createAt + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | @TableName("com_pension_auth_pensioners") |
| | | @EncryptDecryptClass |
| | | public class ComPensionAuthPensionerDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @EncryptDecryptField |
| | | private String idCard; |
| | | /** |
| | | * 性别 |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | |
| | | /** |
| | | *审核人员 |
| | | */ |
| | | private String approver; |
| | | private Long approverId; |
| | | /** |
| | | *审核状态(1.待审核 2.驳回 3.通过) |
| | | */ |
| | |
| | | /** |
| | | *创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | /** |
| | | *更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComPensionAuthRecordDO{" + |
| | | "id=" + id + |
| | | ", pensionerId=" + pensionerId + |
| | | ", submitUserId=" + submitUserId + |
| | | ", authPeriod='" + authPeriod + '\'' + |
| | | ", authVideo='" + authVideo + '\'' + |
| | | ", approver='" + approver + '\'' + |
| | | ", approvalStatus=" + approvalStatus + |
| | | ", approvalDate=" + approvalDate + |
| | | ", mark='" + mark + '\'' + |
| | | ", rejectReason='" + rejectReason + '\'' + |
| | | ", authStatus=" + authStatus + |
| | | ", authDate=" + authDate + |
| | | ", communityId=" + communityId + |
| | | ", createAt=" + createAt + |
| | | ", updateAt=" + updateAt + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthStatisticsDO 社区政务》养老认证》认证统计表 |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 社区政务》养老认证》认证统计表 |
| | | * @author: txb |
| | | * @date: 2021/09/07 16:31 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_pension_auth_statistics") |
| | | public class ComPensionAuthStatisticsDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 年份 |
| | | */ |
| | | private Integer year; |
| | | |
| | | /** |
| | | * 月份 |
| | | */ |
| | | private Integer month; |
| | | |
| | | /** |
| | | * 总人数 |
| | | */ |
| | | private Integer sum; |
| | | |
| | | /** |
| | | * 认证人数 |
| | | */ |
| | | private Integer authSum; |
| | | |
| | | /** |
| | | * 未认证人数 |
| | | */ |
| | | private Integer noAuthSum; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComPensionAuthStatisticsDO{" + |
| | | "id=" + id + |
| | | ", year=" + year + |
| | | ", month=" + month + |
| | | ", sum=" + sum + |
| | | ", authSum=" + authSum + |
| | | ", noAuthSum=" + noAuthSum + |
| | | ", createAt=" + createAt + |
| | | ", communityId=" + communityId + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordImportExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | */ |
| | | R getElderAuthRecordsByIds(@RequestBody List<Long> ids); |
| | | |
| | | /** |
| | | * 批量导入高龄老人线下认证记录 listSaveElderAuthRecordExcelVO 批量导入高龄老人线下认证记录 |
| | | * @param list 高龄老人线下认证记录数据 |
| | | * @param communityId 社区id |
| | | * @param userId 登录人id |
| | | * @return R 导入结果 |
| | | * @author txb |
| | | * @date 2021/9/01 15:03 |
| | | */ |
| | | R listSaveElderAuthRecordExcelVO(List<ComElderAuthRecordImportExcelVO> list, Long communityId, Long userId); |
| | | |
| | | /** |
| | | * 导出高龄认证记录 exportElderAuthRecordsStatistic 导出高龄认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | R exportElderAuthRecordsStatistic(PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 定时任务每月1号0点统计高龄老人本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | R timedTaskElderAuthStatisticsJobHandler(); |
| | | } |
| | |
| | | * 实有人口id |
| | | * @return 实有人口详情 |
| | | */ |
| | | R detailPopulation(Long populationId); |
| | | R detailPopulation(Long populationId, Long communityId); |
| | | |
| | | /** |
| | | * 分页查询实有人口 |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordImportExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordVO; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthRecordDO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordService |
| | |
| | | */ |
| | | public interface ComPensionAuthRecordService extends IService<ComPensionAuthRecordDO> { |
| | | |
| | | /** |
| | | * 分页查询养老金人员认证记录 pagePensionAuthRecords 分页查询养老金人员认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 14:03 |
| | | */ |
| | | R pagePensionAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 根据养老认证记录id查询详情 detailPensionAuthRecords 根据养老认证记录id查询详情 |
| | | * @param authRecordId 养老认证记录id |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | R detailPensionAuthRecords(Long authRecordId); |
| | | |
| | | /** |
| | | * 养老认证审核 examinePensionAuthRecords 养老认证审核 |
| | | * @param comPensionAuthRecordVO 养老认证审核参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/07 11:03 |
| | | */ |
| | | R examinePensionAuthRecords(ComPensionAuthRecordVO comPensionAuthRecordVO); |
| | | |
| | | /** |
| | | * 养老认证标记 signPensionAuthRecords 养老认证标记 |
| | | * @param comPensionAuthRecordVO 养老认证标记参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | R signPensionAuthRecords(ComPensionAuthRecordVO comPensionAuthRecordVO); |
| | | |
| | | /** |
| | | * 根据养老认证记录id批量查询 getPensionAuthRecordsByIds 根据养老认证记录id批量查询 |
| | | * @param ids 养老认证记录id集合 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | R getPensionAuthRecordsByIds(List<Long> ids); |
| | | |
| | | /** |
| | | * 批量导入养老线下认证记录 listSavePensionAuthRecordExcelVO 批量导入养老线下认证记录 |
| | | * @param list 养老线下认证记录数据 |
| | | * @param communityId 社区id |
| | | * @param userId 登录人id |
| | | * @return R 导入结果 |
| | | * @author txb |
| | | * @date 2021/9/08 10:03 |
| | | */ |
| | | R listSavePensionAuthRecordExcelVO(List<ComPensionAuthRecordImportExcelVO> list, Long communityId, Long userId); |
| | | |
| | | /** |
| | | * 导出养老认证记录 exportPensionAuthRecordsStatistic 导出养老认证记录 |
| | | * @param pageElderAuthRecordsDTO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/9/02 11:03 |
| | | */ |
| | | R exportPensionAuthRecordsStatistic(PageElderAuthRecordsDTO pageElderAuthRecordsDTO); |
| | | |
| | | /** |
| | | * 定时任务每年3月1号0点统计养老认证本期应该认证总人数 |
| | | * @return 执行结果 |
| | | */ |
| | | R timedTaskPensionAuthStatisticsJobHandler(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthStatisticsDO; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthStatisticsService |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老认证统计服务类 |
| | | * @author: txb |
| | | * @date: 2021/09/07 17:33 |
| | | */ |
| | | public interface ComPensionAuthStatisticsService extends IService<ComPensionAuthStatisticsDO> { |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportHandleDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportRectifyDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComSwDangerReportDO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @auther txb |
| | |
| | | R pageDangerReport(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO); |
| | | |
| | | /** |
| | | * 编辑隐患报告 editDangerReport 编辑隐患报告 |
| | | * @param comSwDangerReportEditDTO 编辑隐患报告参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | R editDangerReport(ComSwDangerReportEditDTO comSwDangerReportEditDTO); |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | | * |
| | | * @param dangerReportId |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComSwPatrolRecordDO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @auther txb |
| | |
| | | R addPatrolRecord(ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO); |
| | | |
| | | /** |
| | | * 编辑巡查记录 editPatrolRecord 编辑巡查记录 |
| | | * @param comSwPatrolRecordEditDTO 编辑巡查记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | R editPatrolRecord(ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO); |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwSafetyWorkEditDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComSwSafetyWorkRecordDO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @auther txb |
| | |
| | | R pageSafetyWorkRecord(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO); |
| | | |
| | | /** |
| | | * 编辑安全工作记录 editSafetyWork 编辑安全工作记录 |
| | | * @param comSwSafetyWorkEditDTO 编辑安全工作记录参数 |
| | | * @return R 编辑结果 |
| | | * @author txb |
| | | * @date 2021/9/08 17:03 |
| | | */ |
| | | R editSafetyWork(ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO); |
| | | |
| | | /** |
| | | * 根据安全工作记录id查询详情 |
| | | * |
| | | * @param safetyWorkRecordId |
| | |
| | | @Override |
| | | public R releaseActivity(ComActActivityVO comActActivityVO) { |
| | | ComActActivityDO comActActivityDO = new ComActActivityDO(); |
| | | comActActivityDO.setId(comActActivityVO.getId()); |
| | | // comActActivityDO.setId(comActActivityVO.getId()); |
| | | // comActActivityDO.setPublishAt(comActActivityVO.getPublishAt()); |
| | | // comActActivityDO.setStatus(comActActivityVO.getStatus()); |
| | | comActActivityDO = comActActivityDAO.selectById(comActActivityVO.getId()); |
| | | comActActivityDO.setPublishAt(comActActivityVO.getPublishAt()); |
| | | comActActivityDO.setStatus(comActActivityVO.getStatus()); |
| | | if (comActActivityVO.getPublishAt().before(comActActivityDO.getSignUpBegin())) { |
| | | comActActivityVO.setStatus(2); |
| | | } |
| | | if (comActActivityVO.getPublishAt().after(comActActivityDO.getSignUpEnd())) { |
| | | comActActivityVO.setStatus(5); |
| | | } |
| | | if (comActActivityVO.getPublishAt().after(comActActivityDO.getSignUpBegin()) && comActActivityVO.getPublishAt().before(comActActivityDO.getSignUpEnd())) { |
| | | comActActivityVO.setStatus(3); |
| | | } |
| | | int update = comActActivityDAO.updateById(comActActivityDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | |
| | | //审查用户是否有该活动报名权限(是否活动指定参与人群) |
| | | String currentUserTags = loginUserInfoVO.getTags(); |
| | | String attendPeople = actActivityDO.getAattendPeople(); |
| | | if (isNotBlank(attendPeople)) { |
| | | if (isVolunteer.intValue() == 0 && isNotBlank(attendPeople)) { |
| | | if (isBlank(currentUserTags)) { |
| | | return R.fail("您不是指定参与人群!"); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R timedTaskActActivity() { |
| | | List<Long> longs = comActActivityDAO.selectTimedTaskActActivity(); |
| | | if (ObjectUtils.isEmpty(longs)) { |
| | | return R.fail("没有需要取消的社区活动"); |
| | | } |
| | | List<ComActActivityDO> comActActivityDOS = comActActivityDAO.selectBatchIds(longs); |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(comActActivityDOS)) { |
| | | comActActivityDOS.forEach(comActActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | BeanUtils.copyProperties(comActActivityDO, comActActivityVO); |
| | | List<ComActActSignDO> comActActSignDOS = comActActSignDAO.selectList(new QueryWrapper<ComActActSignDO>() |
| | | .lambda().eq(ComActActSignDO::getActivityId, comActActivityDO.getId())); |
| | | if (!ObjectUtils.isEmpty(comActActSignDOS)) { |
| | | List<ActivitySignVO> activitySignVOList = new ArrayList<>(); |
| | | comActActSignDOS.forEach(comActActSignDO -> { |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | BeanUtils.copyProperties(comActActSignDO, activitySignVO); |
| | | activitySignVOList.add(activitySignVO); |
| | | comActActivityVO.setActivitySignVOList(activitySignVOList); |
| | | }); |
| | | } |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | int num = comActActivityDAO.updateIdBatch(longs); |
| | | log.info("定时任务--一共取消社区活动数量【{}】", num); |
| | | } |
| | | return R.ok(comActActivityVOS); |
| | | // List<Long> longs = comActActivityDAO.selectTimedTaskActActivity(); |
| | | // if (ObjectUtils.isEmpty(longs)) { |
| | | // return R.fail("没有需要取消的社区活动"); |
| | | // } |
| | | // List<ComActActivityDO> comActActivityDOS = comActActivityDAO.selectBatchIds(longs); |
| | | // List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | // if (!ObjectUtils.isEmpty(comActActivityDOS)) { |
| | | // comActActivityDOS.forEach(comActActivityDO -> { |
| | | // ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | // BeanUtils.copyProperties(comActActivityDO, comActActivityVO); |
| | | // List<ComActActSignDO> comActActSignDOS = comActActSignDAO.selectList(new QueryWrapper<ComActActSignDO>() |
| | | // .lambda().eq(ComActActSignDO::getActivityId, comActActivityDO.getId())); |
| | | // if (!ObjectUtils.isEmpty(comActActSignDOS)) { |
| | | // List<ActivitySignVO> activitySignVOList = new ArrayList<>(); |
| | | // comActActSignDOS.forEach(comActActSignDO -> { |
| | | // ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | // BeanUtils.copyProperties(comActActSignDO, activitySignVO); |
| | | // activitySignVOList.add(activitySignVO); |
| | | // comActActivityVO.setActivitySignVOList(activitySignVOList); |
| | | // }); |
| | | // } |
| | | // comActActivityVOS.add(comActActivityVO); |
| | | // }); |
| | | // int num = comActActivityDAO.updateIdBatch(longs); |
| | | // log.info("定时任务--一共取消社区活动数量【{}】", num); |
| | | // } |
| | | // return R.ok(comActActivityVOS); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.enums.PopulCultureLevelEnum; |
| | | import com.panzhihua.common.enums.PopulMarriageEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulRelationEnum; |
| | | import com.google.common.base.Joiner; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordExcleVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComElderAuthRecordsDAO; |
| | | import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComElderAuthRecordsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * title: ComElderAuthRecordsServiceImpl 社区政务》高龄老人认证》认证记录表服务实现类 |
| | |
| | | |
| | | @Resource |
| | | private ComElderAuthRecordsDAO comElderAuthRecordsDAO; |
| | | @Resource |
| | | private ComElderAuthElderliesDAO comElderAuthElderliesDAO; |
| | | @Resource |
| | | private ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComElderAuthRecordsService comElderAuthRecordsService; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComEldersAuthStatisticsMapper comEldersAuthStatisticsMapper; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | | @Override |
| | | public R pageElderAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | Page page = new Page<>(); |
| | |
| | | return R.fail("未查询到高龄老人认证记录"); |
| | | } |
| | | BeanUtils.copyProperties(comElderAuthRecordVO, comElderAuthRecordsDO); |
| | | if (comElderAuthRecordVO.getApprovalStatus().equals(3)) { |
| | | comElderAuthRecordsDO.setAuthStatus(1); |
| | | } |
| | | comElderAuthRecordsDO.setApprovalDate(new Date()); |
| | | int nub = comElderAuthRecordsDAO.updateById(comElderAuthRecordsDO); |
| | | if (nub < 1) { |
| | |
| | | @Override |
| | | public R getElderAuthRecordsByIds(List<Long> ids) { |
| | | List<ComElderAuthRecordExcleVO> comElderAuthRecordExcleVOS = comElderAuthRecordsDAO.getElderAuthRecordsByIds(ids); |
| | | if (null != comElderAuthRecordExcleVOS && comElderAuthRecordExcleVOS.size() > 0) { |
| | | comElderAuthRecordExcleVOS.forEach(comElderAuthRecordExcleVO -> { |
| | | if (StringUtils.isNotEmpty(comElderAuthRecordExcleVO.getBirthday())) { |
| | | comElderAuthRecordExcleVO.setAge(AgeUtils.getAgeFromBirthTimes(comElderAuthRecordExcleVO.getBirthday())); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(comElderAuthRecordExcleVOS); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSaveElderAuthRecordExcelVO(List<ComElderAuthRecordImportExcelVO> list, Long communityId, Long userId) { |
| | | // 需要新增的认证记录集合 |
| | | List<ComElderAuthRecordsDO> saveList = new ArrayList<>(); |
| | | // 需要修改的认证记录集合 |
| | | List<ComElderAuthRecordsDO> updateList = new ArrayList<>(); |
| | | log.info("开始处理导入数据"); |
| | | List<ComElderAuthRecordImportMistakeExcelVO> mistakes = new ArrayList<>(); |
| | | try { |
| | | // 查询所有人口数据放入HashMap中 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(null); |
| | | HashMap<String, Object> populationMap = new HashMap<>(); |
| | | populationList.forEach(population -> { |
| | | String key = population.getCardNo(); |
| | | populationMap.put(key, population); |
| | | }); |
| | | |
| | | for (ComElderAuthRecordImportExcelVO vo : list) { |
| | | String cardNoAES = AESUtil.encrypt128(vo.getIdCard(), aesKey); |
| | | // 判断实有人口是否已存在 |
| | | log.info("开始查询实有人口是否已存在"); |
| | | ComMngPopulationDO populationDO = null; |
| | | String populationKey = vo.getIdCard(); |
| | | if (!isOnly(populationKey, populationMap)) { |
| | | // 存在实有人口信息,则查询高龄信息(是否符合认证条件(健在且登记了高龄认证)) |
| | | populationDO = (ComMngPopulationDO)populationMap.get(populationKey); |
| | | ComElderAuthElderliesDO comElderAuthElderliesDO = comElderAuthElderliesDAO.selectOne(new QueryWrapper<ComElderAuthElderliesDO>() |
| | | .lambda().eq(ComElderAuthElderliesDO::getPopulationId, populationDO.getId()).eq(ComElderAuthElderliesDO::getCommunityId, communityId)); |
| | | //不存在高龄信息,需要先导入高龄信息 |
| | | if (null == comElderAuthElderliesDO) { |
| | | ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在,但本社区不存在高龄信息,请先导入高龄人口"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //存在高龄信息,判断是否满足认证条件 |
| | | if (StringUtils.isNotEmpty(vo.getBirthday())) { |
| | | int age = AgeUtils.getAgeFromBirthTimes(vo.getBirthday()); |
| | | if (age < 80 || !comElderAuthElderliesDO.getIsRegister().equals(1) || !comElderAuthElderliesDO.getIsAlive().equals(1)) { |
| | | ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该人口未满80岁,或者不健在,或者未做高龄老人登记"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //满足认证条件,判断是否存在当期认证记录 |
| | | ComElderAuthRecordsDO comElderAuthRecordsDO = null; |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = DateUtils.getYear(nowDate); |
| | | // 获取当前月 |
| | | int month = DateUtils.getMonth(nowDate) + 1; |
| | | String authPeriod = ""; |
| | | if (month < 10) { |
| | | authPeriod = String.valueOf(year) + "0" + String.valueOf(month); |
| | | }else { |
| | | authPeriod = String.valueOf(year) + String.valueOf(month); |
| | | } |
| | | comElderAuthRecordsDO = comElderAuthRecordsDAO.selectOne(new QueryWrapper<ComElderAuthRecordsDO>().lambda(). |
| | | eq(ComElderAuthRecordsDO::getElderliesId, comElderAuthElderliesDO.getId()).eq(ComElderAuthRecordsDO::getAuthPeriod, authPeriod)); |
| | | if (null != comElderAuthRecordsDO) { |
| | | //存在记录且状态为已认证,不能修改 |
| | | if (comElderAuthRecordsDO.getAuthStatus().equals(1)) { |
| | | ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该人口本期已认证,不能修改"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //存在记录,执行修改 |
| | | ComElderAuthRecordsDO comElderAuthRecordsDO1 = |
| | | updateElderAuthRecordsDO(vo, comElderAuthRecordsDO, userId); |
| | | updateList.add(comElderAuthRecordsDO1); |
| | | ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该认证已存在,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | }else { |
| | | // 不存在记录,则新增 |
| | | comElderAuthRecordsDO = saveElderAuthRecordsDO(vo, comElderAuthElderliesDO, authPeriod, userId); |
| | | saveList.add(comElderAuthRecordsDO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 不存在实有人口,则新增 |
| | | ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("不存在该实有人口,请先导入实有人口信息"); |
| | | mistakes.add(mistake); |
| | | } |
| | | log.info("开始查询实有人口是否已存在完成"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("出现错误,错误原因:" + e.getMessage()); |
| | | } |
| | | log.info("处理完成导入数据"); |
| | | |
| | | log.info("开始执行数据库导入"); |
| | | if (!saveList.isEmpty()) { |
| | | log.info("执行数据库导入线下认证记录"); |
| | | comElderAuthRecordsService.saveBatch(saveList); |
| | | log.info("数据库导入线下认证记录完成"); |
| | | } |
| | | if (!updateList.isEmpty()) { |
| | | log.info("执行数据库更新线下认证记录"); |
| | | comElderAuthRecordsDAO.updateAll(updateList); |
| | | log.info("数据库更新线下认证记录完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | | |
| | | if (!mistakes.isEmpty()) { |
| | | log.info("返回错误数据"); |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(mistakes); |
| | | } |
| | | |
| | | @Override |
| | | public R exportElderAuthRecordsStatistic(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | List<ComElderAuthRecordStatisticExcleVO> comElderAuthRecordStatisticExcleVOS = comElderAuthRecordsDAO.exportElderAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | if (null != comElderAuthRecordStatisticExcleVOS && comElderAuthRecordStatisticExcleVOS.size() > 0) { |
| | | comElderAuthRecordStatisticExcleVOS.forEach(comElderAuthRecordStatisticExcleVO -> { |
| | | if (StringUtils.isNotEmpty(comElderAuthRecordStatisticExcleVO.getBirthday())) { |
| | | comElderAuthRecordStatisticExcleVO.setAge(AgeUtils.getAgeFromBirthTimes(comElderAuthRecordStatisticExcleVO.getBirthday())); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(comElderAuthRecordStatisticExcleVOS); |
| | | } |
| | | |
| | | @Override |
| | | public R timedTaskElderAuthStatisticsJobHandler() { |
| | | Date nowDate = new Date(); |
| | | int month = DateUtils.getMonth(nowDate) + 1; |
| | | int year = DateUtils.getYear(nowDate); |
| | | //查询所有启用中社区 |
| | | List<ComActDO> actList = comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getState,0)); |
| | | actList.forEach(act -> { |
| | | //高龄认证统计本期应认证人数 |
| | | ComEldersAuthStatisticsDO comEldersAuthStatisticsDO = new ComEldersAuthStatisticsDO(); |
| | | comEldersAuthStatisticsDO.setCommunityId(act.getCommunityId()); |
| | | comEldersAuthStatisticsDO.setMonth(month); |
| | | comEldersAuthStatisticsDO.setYear(year); |
| | | comEldersAuthStatisticsDO.setCreateAt(nowDate); |
| | | List<ComElderAuthElderliesDO> comElderAuthElderliesDOS = comElderAuthElderliesDAO.selectList(new QueryWrapper<ComElderAuthElderliesDO>().lambda() |
| | | .eq(ComElderAuthElderliesDO::getCommunityId, act.getCommunityId()) |
| | | .eq(ComElderAuthElderliesDO::getIsAlive, 1) |
| | | .eq(ComElderAuthElderliesDO::getIsRegister, 1)); |
| | | if (null != comElderAuthElderliesDOS) { |
| | | comEldersAuthStatisticsDO.setSum(comElderAuthElderliesDOS.size()); |
| | | } |
| | | comEldersAuthStatisticsMapper.insert(comEldersAuthStatisticsDO); |
| | | //上期已认证人数 |
| | | String authPeriod = ""; |
| | | if (month < 10) { |
| | | authPeriod = String.valueOf(year) + 0 + month; |
| | | } else { |
| | | authPeriod = String.valueOf(year) + month; |
| | | } |
| | | int authSum = comElderAuthElderliesDAO.haveElderAuthElderliesAmount(act.getCommunityId(), authPeriod); |
| | | ComEldersAuthStatisticsDO comEldersAuthStatisticsDO1 = comEldersAuthStatisticsMapper.selectOne(new QueryWrapper<ComEldersAuthStatisticsDO>() |
| | | .lambda().eq(ComEldersAuthStatisticsDO::getCommunityId, act.getCommunityId()).eq(ComEldersAuthStatisticsDO::getYear, year) |
| | | .eq(ComEldersAuthStatisticsDO::getMonth, month - 1)); |
| | | comEldersAuthStatisticsDO1.setAuthSum(authSum); |
| | | comEldersAuthStatisticsDO1.setNoAuthSum(comEldersAuthStatisticsDO1.getSum() - comEldersAuthStatisticsDO1.getAuthSum()); |
| | | comEldersAuthStatisticsMapper.updateById(comEldersAuthStatisticsDO1); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private ComElderAuthRecordsDO updateElderAuthRecordsDO(ComElderAuthRecordImportExcelVO vo, ComElderAuthRecordsDO comElderAuthRecordsDO, Long userId) { |
| | | BeanUtils.copyProperties(vo, comElderAuthRecordsDO); |
| | | comElderAuthRecordsDO.setSubmitUserId(userId); |
| | | comElderAuthRecordsDO.setApproverId(userId); |
| | | comElderAuthRecordsDO.setApprovalStatus(3); |
| | | comElderAuthRecordsDO.setApprovalDate(new Date()); |
| | | comElderAuthRecordsDO.setAuthStatus(1); |
| | | return comElderAuthRecordsDO; |
| | | } |
| | | |
| | | private ComElderAuthRecordsDO saveElderAuthRecordsDO(ComElderAuthRecordImportExcelVO vo, ComElderAuthElderliesDO comElderAuthElderliesDO, String authPeriod, Long userId) { |
| | | ComElderAuthRecordsDO comElderAuthRecordsDO = new ComElderAuthRecordsDO(); |
| | | BeanUtils.copyProperties(vo, comElderAuthRecordsDO); |
| | | comElderAuthRecordsDO.setId(Snowflake.getId()); |
| | | comElderAuthRecordsDO.setElderliesId(comElderAuthElderliesDO.getId()); |
| | | comElderAuthRecordsDO.setAuthPeriod(authPeriod); |
| | | comElderAuthRecordsDO.setSubmitUserId(userId); |
| | | comElderAuthRecordsDO.setApproverId(userId); |
| | | comElderAuthRecordsDO.setApprovalStatus(3); |
| | | comElderAuthRecordsDO.setApprovalDate(new Date()); |
| | | comElderAuthRecordsDO.setAuthStatus(1); |
| | | return comElderAuthRecordsDO; |
| | | } |
| | | |
| | | private void setMistake(ComElderAuthRecordImportMistakeExcelVO mvo, |
| | | ComElderAuthRecordImportExcelVO vo) { |
| | | mvo.setIsAlive(PopulHouseUseEnum.getCnDescByName(vo.getIsAlive())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判重方法 |
| | | * |
| | | * @param key |
| | | * 主键 |
| | | * @param hashMap |
| | | * 数据集 |
| | | * @return 存在即为false 不存在则为true |
| | | */ |
| | | private boolean isOnly(String key, HashMap<String, Object> hashMap) { |
| | | return ObjectUtils.isEmpty(hashMap.get(key)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 实有人口Service实现类 |
| | |
| | | private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; |
| | | @Resource |
| | | private ComEldersAuthStatisticsMapper comEldersAuthStatisticsMapper; |
| | | @Resource |
| | | private ComPensionAuthStatisticsDAO comPensionAuthStatisticsDAO; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | |
| | | * @return 实有人口详情 |
| | | */ |
| | | @Override |
| | | public R detailPopulation(Long populationId) { |
| | | public R detailPopulation(Long populationId, Long communityId) { |
| | | ComMngPopulationDO comMngPopulationDO = populationDAO.selectById(populationId); |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail("用户信息不存在"); |
| | |
| | | // 设置特殊群体标签 |
| | | ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = |
| | | comMngPopulationCommunityTagsDAO.selectOne(new QueryWrapper<ComMngPopulationCommunityTagsDO>().lambda() |
| | | .eq(ComMngPopulationCommunityTagsDO::getPopulationId, populationId)); |
| | | .eq(ComMngPopulationCommunityTagsDO::getPopulationId, populationId) |
| | | .eq(ComMngPopulationCommunityTagsDO::getCommunityId, communityId)); |
| | | if (null != comMngPopulationCommunityTagsDO) { |
| | | comMngPopulationVO.setLabel(comMngPopulationCommunityTagsDO.getLabel()); |
| | | } |
| | |
| | | comMngPopulationVO.setCarList(carList); |
| | | } |
| | | |
| | | // 吸毒信息 |
| | | List<ComDrugPopulationVO> comDrugPopulationVOs = new ArrayList<>(); |
| | | List<ComDrugPopulationDO> comDrugPopulationDOs = comDrugPopulationDAO.selectList( |
| | | new QueryWrapper<ComDrugPopulationDO>().lambda().eq(ComDrugPopulationDO::getPopulationId, populationId)); |
| | | if (!comDrugPopulationDOs.isEmpty()) { |
| | | comDrugPopulationDOs.forEach(comDrugPopulationDO -> { |
| | | ComDrugPopulationVO comDrugPopulationVO = new ComDrugPopulationVO(); |
| | | BeanUtils.copyProperties(comDrugPopulationDO, comDrugPopulationVO); |
| | | comDrugPopulationVOs.add(comDrugPopulationVO); |
| | | comMngPopulationVO.setComDrugPopulationVOs(comDrugPopulationVOs); |
| | | }); |
| | | } |
| | | if (communityId != null){ |
| | | // 吸毒信息 |
| | | List<ComDrugPopulationVO> comDrugPopulationVOs = new ArrayList<>(); |
| | | List<ComDrugPopulationDO> comDrugPopulationDOs = comDrugPopulationDAO.selectList( |
| | | new QueryWrapper<ComDrugPopulationDO>().lambda().eq(ComDrugPopulationDO::getPopulationId, populationId) |
| | | .eq(ComDrugPopulationDO::getCommunityId, communityId)); |
| | | if (!comDrugPopulationDOs.isEmpty()) { |
| | | comDrugPopulationDOs.forEach(comDrugPopulationDO -> { |
| | | ComDrugPopulationVO comDrugPopulationVO = new ComDrugPopulationVO(); |
| | | BeanUtils.copyProperties(comDrugPopulationDO, comDrugPopulationVO); |
| | | comDrugPopulationVOs.add(comDrugPopulationVO); |
| | | comMngPopulationVO.setComDrugPopulationVOs(comDrugPopulationVOs); |
| | | }); |
| | | } |
| | | |
| | | // 社区矫正信息 |
| | | List<ComCorrectPopulationVO> comCorrectPopulationVOS = new ArrayList<>(); |
| | | List<ComCorrectPopulationDO> comCorrectPopulationDOS = |
| | | comCorrectPopulationDAO.selectList(new QueryWrapper<ComCorrectPopulationDO>().lambda() |
| | | .eq(ComCorrectPopulationDO::getPopulationId, populationId)); |
| | | if (!comCorrectPopulationDOS.isEmpty()) { |
| | | comCorrectPopulationDOS.forEach(comCorrectPopulationDO -> { |
| | | ComCorrectPopulationVO comCorrectPopulationVO = new ComCorrectPopulationVO(); |
| | | BeanUtils.copyProperties(comCorrectPopulationDO, comCorrectPopulationVO); |
| | | comCorrectPopulationVOS.add(comCorrectPopulationVO); |
| | | comMngPopulationVO.setComCorrectPopulationVOs(comCorrectPopulationVOS); |
| | | }); |
| | | } |
| | | // 社区矫正信息 |
| | | List<ComCorrectPopulationVO> comCorrectPopulationVOS = new ArrayList<>(); |
| | | List<ComCorrectPopulationDO> comCorrectPopulationDOS = |
| | | comCorrectPopulationDAO.selectList(new QueryWrapper<ComCorrectPopulationDO>().lambda() |
| | | .eq(ComCorrectPopulationDO::getPopulationId, populationId) |
| | | .eq(ComCorrectPopulationDO::getCommunityId, communityId)); |
| | | if (!comCorrectPopulationDOS.isEmpty()) { |
| | | comCorrectPopulationDOS.forEach(comCorrectPopulationDO -> { |
| | | ComCorrectPopulationVO comCorrectPopulationVO = new ComCorrectPopulationVO(); |
| | | BeanUtils.copyProperties(comCorrectPopulationDO, comCorrectPopulationVO); |
| | | comCorrectPopulationVOS.add(comCorrectPopulationVO); |
| | | comMngPopulationVO.setComCorrectPopulationVOs(comCorrectPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 精神障碍信息 |
| | | List<ComMajorPopulationVO> comMajorPopulationVOS = new ArrayList<>(); |
| | | List<ComMajorPopulationDO> comMajorPopulationDOs = comMajorPopulationDAO.selectList( |
| | | new QueryWrapper<ComMajorPopulationDO>().lambda().eq(ComMajorPopulationDO::getPopulationId, populationId)); |
| | | if (!comMajorPopulationDOs.isEmpty()) { |
| | | comMajorPopulationDOs.forEach(comMajorPopulationDO -> { |
| | | ComMajorPopulationVO comMajorPopulationVO = new ComMajorPopulationVO(); |
| | | BeanUtils.copyProperties(comMajorPopulationDO, comMajorPopulationVO); |
| | | comMajorPopulationVOS.add(comMajorPopulationVO); |
| | | comMngPopulationVO.setComMajorPopulationVOs(comMajorPopulationVOS); |
| | | }); |
| | | } |
| | | // 精神障碍信息 |
| | | List<ComMajorPopulationVO> comMajorPopulationVOS = new ArrayList<>(); |
| | | List<ComMajorPopulationDO> comMajorPopulationDOs = comMajorPopulationDAO.selectList( |
| | | new QueryWrapper<ComMajorPopulationDO>().lambda().eq(ComMajorPopulationDO::getPopulationId, populationId) |
| | | .eq(ComMajorPopulationDO::getCommunityId, communityId)); |
| | | if (!comMajorPopulationDOs.isEmpty()) { |
| | | comMajorPopulationDOs.forEach(comMajorPopulationDO -> { |
| | | ComMajorPopulationVO comMajorPopulationVO = new ComMajorPopulationVO(); |
| | | BeanUtils.copyProperties(comMajorPopulationDO, comMajorPopulationVO); |
| | | comMajorPopulationVOS.add(comMajorPopulationVO); |
| | | comMngPopulationVO.setComMajorPopulationVOs(comMajorPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 邪教信息 |
| | | List<ComCultPopulationVO> comCultPopulationVOS = new ArrayList<>(); |
| | | List<ComCultPopulationDO> comCultPopulationDOS = comCultPopulationDAO.selectList( |
| | | new QueryWrapper<ComCultPopulationDO>().lambda().eq(ComCultPopulationDO::getPopulationId, populationId)); |
| | | if (!comCultPopulationDOS.isEmpty()) { |
| | | comCultPopulationDOS.forEach(comCultPopulationDO -> { |
| | | ComCultPopulationVO comCultPopulationVO = new ComCultPopulationVO(); |
| | | BeanUtils.copyProperties(comCultPopulationDO, comCultPopulationVO); |
| | | comCultPopulationVOS.add(comCultPopulationVO); |
| | | comMngPopulationVO.setComCultPopulationVOs(comCultPopulationVOS); |
| | | }); |
| | | } |
| | | // 邪教信息 |
| | | List<ComCultPopulationVO> comCultPopulationVOS = new ArrayList<>(); |
| | | List<ComCultPopulationDO> comCultPopulationDOS = comCultPopulationDAO.selectList( |
| | | new QueryWrapper<ComCultPopulationDO>().lambda().eq(ComCultPopulationDO::getPopulationId, populationId) |
| | | .eq(ComCultPopulationDO::getCommunityId, communityId)); |
| | | if (!comCultPopulationDOS.isEmpty()) { |
| | | comCultPopulationDOS.forEach(comCultPopulationDO -> { |
| | | ComCultPopulationVO comCultPopulationVO = new ComCultPopulationVO(); |
| | | BeanUtils.copyProperties(comCultPopulationDO, comCultPopulationVO); |
| | | comCultPopulationVOS.add(comCultPopulationVO); |
| | | comMngPopulationVO.setComCultPopulationVOs(comCultPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 刑释信息 |
| | | List<ComRehabilitationPopulationVO> comRehabilitationPopulationVOS = new ArrayList<>(); |
| | | List<ComRehabilitationPopulationDO> comRehabilitationPopulationDOS = |
| | | comRehabilitationPopulationDAO.selectList(new QueryWrapper<ComRehabilitationPopulationDO>().lambda() |
| | | .eq(ComRehabilitationPopulationDO::getPopulationId, populationId)); |
| | | if (!comRehabilitationPopulationDOS.isEmpty()) { |
| | | comRehabilitationPopulationDOS.forEach(comRehabilitationPopulationDO -> { |
| | | ComRehabilitationPopulationVO comRehabilitationPopulationVO = new ComRehabilitationPopulationVO(); |
| | | BeanUtils.copyProperties(comRehabilitationPopulationDO, comRehabilitationPopulationVO); |
| | | comRehabilitationPopulationVOS.add(comRehabilitationPopulationVO); |
| | | comMngPopulationVO.setComRehabilitationPopulationVOs(comRehabilitationPopulationVOS); |
| | | }); |
| | | } |
| | | // 刑释信息 |
| | | List<ComRehabilitationPopulationVO> comRehabilitationPopulationVOS = new ArrayList<>(); |
| | | List<ComRehabilitationPopulationDO> comRehabilitationPopulationDOS = |
| | | comRehabilitationPopulationDAO.selectList(new QueryWrapper<ComRehabilitationPopulationDO>().lambda() |
| | | .eq(ComRehabilitationPopulationDO::getPopulationId, populationId) |
| | | .eq(ComRehabilitationPopulationDO::getCommunityId, communityId)); |
| | | if (!comRehabilitationPopulationDOS.isEmpty()) { |
| | | comRehabilitationPopulationDOS.forEach(comRehabilitationPopulationDO -> { |
| | | ComRehabilitationPopulationVO comRehabilitationPopulationVO = new ComRehabilitationPopulationVO(); |
| | | BeanUtils.copyProperties(comRehabilitationPopulationDO, comRehabilitationPopulationVO); |
| | | comRehabilitationPopulationVOS.add(comRehabilitationPopulationVO); |
| | | comMngPopulationVO.setComRehabilitationPopulationVOs(comRehabilitationPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 上访信息 |
| | | List<ComKeyPopulationVO> comKeyPopulationVOS = new ArrayList<>(); |
| | | List<ComKeyPopulationDO> comKeyPopulationDOS = comKeyPopulationDAO.selectList( |
| | | new QueryWrapper<ComKeyPopulationDO>().lambda().eq(ComKeyPopulationDO::getPopulationId, populationId)); |
| | | if (!comKeyPopulationDOS.isEmpty()) { |
| | | comKeyPopulationDOS.forEach(comKeyPopulationDO -> { |
| | | ComKeyPopulationVO comKeyPopulationVO = new ComKeyPopulationVO(); |
| | | BeanUtils.copyProperties(comKeyPopulationDO, comKeyPopulationVO); |
| | | comKeyPopulationVOS.add(comKeyPopulationVO); |
| | | comMngPopulationVO.setComKeyPopulationVOs(comKeyPopulationVOS); |
| | | }); |
| | | } |
| | | // 上访信息 |
| | | List<ComKeyPopulationVO> comKeyPopulationVOS = new ArrayList<>(); |
| | | List<ComKeyPopulationDO> comKeyPopulationDOS = comKeyPopulationDAO.selectList( |
| | | new QueryWrapper<ComKeyPopulationDO>().lambda().eq(ComKeyPopulationDO::getPopulationId, populationId) |
| | | .eq(ComKeyPopulationDO::getCommunityId, communityId)); |
| | | if (!comKeyPopulationDOS.isEmpty()) { |
| | | comKeyPopulationDOS.forEach(comKeyPopulationDO -> { |
| | | ComKeyPopulationVO comKeyPopulationVO = new ComKeyPopulationVO(); |
| | | BeanUtils.copyProperties(comKeyPopulationDO, comKeyPopulationVO); |
| | | comKeyPopulationVOS.add(comKeyPopulationVO); |
| | | comMngPopulationVO.setComKeyPopulationVOs(comKeyPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 退役军人信息 |
| | | List<ComVeteransPopulationVO> comVeteransPopulationVOS = new ArrayList<>(); |
| | | List<ComVeteransPopulationDO> comVeteransPopulationDOS = |
| | | comVeteransPopulationDAO.selectList(new QueryWrapper<ComVeteransPopulationDO>().lambda() |
| | | .eq(ComVeteransPopulationDO::getPopulationId, populationId)); |
| | | if (!comVeteransPopulationDOS.isEmpty()) { |
| | | comVeteransPopulationDOS.forEach(comVeteransPopulationDO -> { |
| | | ComVeteransPopulationVO comVeteransPopulationVO = new ComVeteransPopulationVO(); |
| | | BeanUtils.copyProperties(comVeteransPopulationDO, comVeteransPopulationVO); |
| | | comVeteransPopulationVOS.add(comVeteransPopulationVO); |
| | | comMngPopulationVO.setComVeteransPopulationVOs(comVeteransPopulationVOS); |
| | | }); |
| | | } |
| | | // 退役军人信息 |
| | | List<ComVeteransPopulationVO> comVeteransPopulationVOS = new ArrayList<>(); |
| | | List<ComVeteransPopulationDO> comVeteransPopulationDOS = |
| | | comVeteransPopulationDAO.selectList(new QueryWrapper<ComVeteransPopulationDO>().lambda() |
| | | .eq(ComVeteransPopulationDO::getPopulationId, populationId) |
| | | .eq(ComVeteransPopulationDO::getCommunityId, communityId)); |
| | | if (!comVeteransPopulationDOS.isEmpty()) { |
| | | comVeteransPopulationDOS.forEach(comVeteransPopulationDO -> { |
| | | ComVeteransPopulationVO comVeteransPopulationVO = new ComVeteransPopulationVO(); |
| | | BeanUtils.copyProperties(comVeteransPopulationDO, comVeteransPopulationVO); |
| | | comVeteransPopulationVOS.add(comVeteransPopulationVO); |
| | | comMngPopulationVO.setComVeteransPopulationVOs(comVeteransPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 残疾人信息 |
| | | List<ComDisabilityPopulationVO> comDisabilityPopulationVOS = new ArrayList<>(); |
| | | List<ComDisabilityPopulationDO> comDisabilityPopulationDOS = |
| | | comDisabilityPopulationDAO.selectList(new QueryWrapper<ComDisabilityPopulationDO>().lambda() |
| | | .eq(ComDisabilityPopulationDO::getPopulationId, populationId)); |
| | | if (!comDisabilityPopulationDOS.isEmpty()) { |
| | | comDisabilityPopulationDOS.forEach(comDisabilityPopulationDO -> { |
| | | ComDisabilityPopulationVO comDisabilityPopulationVO = new ComDisabilityPopulationVO(); |
| | | BeanUtils.copyProperties(comDisabilityPopulationDO, comDisabilityPopulationVO); |
| | | comDisabilityPopulationVOS.add(comDisabilityPopulationVO); |
| | | comMngPopulationVO.setComDisabilityPopulationVOs(comDisabilityPopulationVOS); |
| | | }); |
| | | } |
| | | // 残疾人信息 |
| | | List<ComDisabilityPopulationVO> comDisabilityPopulationVOS = new ArrayList<>(); |
| | | List<ComDisabilityPopulationDO> comDisabilityPopulationDOS = |
| | | comDisabilityPopulationDAO.selectList(new QueryWrapper<ComDisabilityPopulationDO>().lambda() |
| | | .eq(ComDisabilityPopulationDO::getPopulationId, populationId) |
| | | .eq(ComDisabilityPopulationDO::getCommunityId, communityId)); |
| | | if (!comDisabilityPopulationDOS.isEmpty()) { |
| | | comDisabilityPopulationDOS.forEach(comDisabilityPopulationDO -> { |
| | | ComDisabilityPopulationVO comDisabilityPopulationVO = new ComDisabilityPopulationVO(); |
| | | BeanUtils.copyProperties(comDisabilityPopulationDO, comDisabilityPopulationVO); |
| | | comDisabilityPopulationVOS.add(comDisabilityPopulationVO); |
| | | comMngPopulationVO.setComDisabilityPopulationVOs(comDisabilityPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 低保户信息 |
| | | List<ComLowSecurityPopulationVO> comLowSecurityPopulationVOS = new ArrayList<>(); |
| | | List<ComLowSecurityPopulationDO> comLowSecurityPopulationDOS = |
| | | comLowSecurityPopulationDAO.selectList(new QueryWrapper<ComLowSecurityPopulationDO>().lambda() |
| | | .eq(ComLowSecurityPopulationDO::getPopulationId, populationId)); |
| | | if (!comLowSecurityPopulationDOS.isEmpty()) { |
| | | comLowSecurityPopulationDOS.forEach(comLowSecurityPopulationDO -> { |
| | | ComLowSecurityPopulationVO comLowSecurityPopulationVO = new ComLowSecurityPopulationVO(); |
| | | BeanUtils.copyProperties(comLowSecurityPopulationDO, comLowSecurityPopulationVO); |
| | | comLowSecurityPopulationVOS.add(comLowSecurityPopulationVO); |
| | | comMngPopulationVO.setComLowSecurityPopulationVOs(comLowSecurityPopulationVOS); |
| | | }); |
| | | } |
| | | // 低保户信息 |
| | | List<ComLowSecurityPopulationVO> comLowSecurityPopulationVOS = new ArrayList<>(); |
| | | List<ComLowSecurityPopulationDO> comLowSecurityPopulationDOS = |
| | | comLowSecurityPopulationDAO.selectList(new QueryWrapper<ComLowSecurityPopulationDO>().lambda() |
| | | .eq(ComLowSecurityPopulationDO::getPopulationId, populationId) |
| | | .eq(ComLowSecurityPopulationDO::getCommunityId, communityId)); |
| | | if (!comLowSecurityPopulationDOS.isEmpty()) { |
| | | comLowSecurityPopulationDOS.forEach(comLowSecurityPopulationDO -> { |
| | | ComLowSecurityPopulationVO comLowSecurityPopulationVO = new ComLowSecurityPopulationVO(); |
| | | BeanUtils.copyProperties(comLowSecurityPopulationDO, comLowSecurityPopulationVO); |
| | | comLowSecurityPopulationVOS.add(comLowSecurityPopulationVO); |
| | | comMngPopulationVO.setComLowSecurityPopulationVOs(comLowSecurityPopulationVOS); |
| | | }); |
| | | } |
| | | |
| | | // 高龄老人信息 |
| | | List<ComElderAuthElderliesVO> comElderAuthElderliesVOList = new ArrayList<>(); |
| | | List<ComElderAuthElderliesDO> comElderAuthElderliesDOS = |
| | | comElderAuthElderliesDAO.selectList(new QueryWrapper<ComElderAuthElderliesDO>().lambda() |
| | | .eq(ComElderAuthElderliesDO::getPopulationId, populationId)); |
| | | if (!comElderAuthElderliesDOS.isEmpty()) { |
| | | comElderAuthElderliesDOS.forEach(comElderAuthElderliesDO -> { |
| | | ComElderAuthElderliesVO comElderAuthElderliesVO = new ComElderAuthElderliesVO(); |
| | | BeanUtils.copyProperties(comElderAuthElderliesDO, comElderAuthElderliesVO); |
| | | comElderAuthElderliesVOList.add(comElderAuthElderliesVO); |
| | | comMngPopulationVO.setComElderAuthElderliesVOList(comElderAuthElderliesVOList); |
| | | }); |
| | | } |
| | | // 高龄老人信息 |
| | | List<ComElderAuthElderliesVO> comElderAuthElderliesVOList = new ArrayList<>(); |
| | | List<ComElderAuthElderliesDO> comElderAuthElderliesDOS = |
| | | comElderAuthElderliesDAO.selectList(new QueryWrapper<ComElderAuthElderliesDO>().lambda() |
| | | .eq(ComElderAuthElderliesDO::getPopulationId, populationId) |
| | | .eq(ComElderAuthElderliesDO::getCommunityId, communityId)); |
| | | if (!comElderAuthElderliesDOS.isEmpty()) { |
| | | comElderAuthElderliesDOS.forEach(comElderAuthElderliesDO -> { |
| | | ComElderAuthElderliesVO comElderAuthElderliesVO = new ComElderAuthElderliesVO(); |
| | | BeanUtils.copyProperties(comElderAuthElderliesDO, comElderAuthElderliesVO); |
| | | comElderAuthElderliesVOList.add(comElderAuthElderliesVO); |
| | | comMngPopulationVO.setComElderAuthElderliesVOList(comElderAuthElderliesVOList); |
| | | }); |
| | | } |
| | | |
| | | // 养老人员信息 |
| | | List<ComPensionAuthPensionerVO> comPensionAuthPensionerVOList = new ArrayList<>(); |
| | | List<ComPensionAuthPensionerDO> comPensionAuthPensionerDOS = |
| | | comPensionAuthPensionerDAO.selectList(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() |
| | | .eq(ComPensionAuthPensionerDO::getPopulationId, populationId)); |
| | | if (!comPensionAuthPensionerDOS.isEmpty()) { |
| | | comPensionAuthPensionerDOS.forEach(comPensionAuthPensionerDO -> { |
| | | ComPensionAuthPensionerVO comPensionAuthPensionerVO = new ComPensionAuthPensionerVO(); |
| | | BeanUtils.copyProperties(comPensionAuthPensionerDO, comPensionAuthPensionerVO); |
| | | comPensionAuthPensionerVOList.add(comPensionAuthPensionerVO); |
| | | comMngPopulationVO.setComPensionAuthPensionerVOList(comPensionAuthPensionerVOList); |
| | | }); |
| | | // 养老人员信息 |
| | | List<ComPensionAuthPensionerVO> comPensionAuthPensionerVOList = new ArrayList<>(); |
| | | List<ComPensionAuthPensionerDO> comPensionAuthPensionerDOS = |
| | | comPensionAuthPensionerDAO.selectList(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() |
| | | .eq(ComPensionAuthPensionerDO::getPopulationId, populationId) |
| | | .eq(ComPensionAuthPensionerDO::getCommunityId, communityId)); |
| | | if (!comPensionAuthPensionerDOS.isEmpty()) { |
| | | comPensionAuthPensionerDOS.forEach(comPensionAuthPensionerDO -> { |
| | | ComPensionAuthPensionerVO comPensionAuthPensionerVO = new ComPensionAuthPensionerVO(); |
| | | BeanUtils.copyProperties(comPensionAuthPensionerDO, comPensionAuthPensionerVO); |
| | | comPensionAuthPensionerVOList.add(comPensionAuthPensionerVO); |
| | | comMngPopulationVO.setComPensionAuthPensionerVOList(comPensionAuthPensionerVOList); |
| | | }); |
| | | } |
| | | } |
| | | return R.ok(comMngPopulationVO); |
| | | } |
| | |
| | | |
| | | // 查询当前社区标签列表 |
| | | List<String> labelList = new ArrayList<>(); |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO |
| | | .selectList(null); |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO.selectList(null); |
| | | if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { |
| | | labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) |
| | | .collect(Collectors.toList()); |
| | |
| | | } |
| | | if (!comElderAuthElderliesDO.getIsAlive().equals(1) || !comElderAuthElderliesDO.getIsRegister().equals(1)) { |
| | | if (vo.getIsRegister().equals(1) && vo.getIsAlive().equals(1)) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int year = DateUtils.getYear(nowDate); |
| | | // 获取当前月 |
| | | int month = calendar.get(Calendar.MONTH) + 1; |
| | | int month = DateUtils.getMonth(nowDate) + 1; |
| | | ComEldersAuthStatisticsDO comEldersAuthStatisticsDO = comEldersAuthStatisticsMapper.selectOne(new QueryWrapper<ComEldersAuthStatisticsDO>() |
| | | .lambda().eq(ComEldersAuthStatisticsDO::getCommunityId, communityId).eq(ComEldersAuthStatisticsDO::getYear, year).eq(ComEldersAuthStatisticsDO::getMonth, month)); |
| | | comEldersAuthStatisticsDO.setSum(comEldersAuthStatisticsDO.getSum() + 1); |
| | |
| | | } |
| | | } |
| | | if (vo.getIsRegister().equals(1) && vo.getIsAlive().equals(1)) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int year = DateUtils.getYear(nowDate); |
| | | // 获取当前月 |
| | | int month = calendar.get(Calendar.MONTH) + 1; |
| | | int month = DateUtils.getMonth(nowDate) + 1; |
| | | ComEldersAuthStatisticsDO comEldersAuthStatisticsDO = comEldersAuthStatisticsMapper.selectOne(new QueryWrapper<ComEldersAuthStatisticsDO>() |
| | | .lambda().eq(ComEldersAuthStatisticsDO::getCommunityId, communityId).eq(ComEldersAuthStatisticsDO::getYear, year).eq(ComEldersAuthStatisticsDO::getMonth, month)); |
| | | comEldersAuthStatisticsDO.setSum(comEldersAuthStatisticsDO.getSum() + 1); |
| | |
| | | BeanUtils.copyProperties(vo, populationDO); |
| | | ComPensionAuthPensionerDO comPensionAuthPensionerDO = |
| | | comPensionAuthPensionerDAO.selectOne(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() |
| | | .eq(ComPensionAuthPensionerDO::getPopulationId, populationDO.getId())); |
| | | .eq(ComPensionAuthPensionerDO::getPopulationId, populationDO.getId()) |
| | | .eq(ComPensionAuthPensionerDO::getCommunityId, communityId)); |
| | | // List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> |
| | | // userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | // //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 |
| | |
| | | BeanUtils.copyProperties(vo, comPensionAuthPensionerDO); |
| | | comPensionAuthPensionerDO.setIdCard(cardNoAES); |
| | | comPensionAuthPensionerDO.setAddress(vo.getNowAddress()); |
| | | if (!comPensionAuthPensionerDO.getIsAlive().equals(1) || !comPensionAuthPensionerDO.getIsRegister().equals(1)) { |
| | | if (vo.getIsRegister().equals(1) && vo.getIsAlive().equals(1)) { |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = (DateUtils.getYear(nowDate)); |
| | | ComPensionAuthStatisticsDO comPensionAuthStatisticsDO = comPensionAuthStatisticsDAO.selectOne(new QueryWrapper<ComPensionAuthStatisticsDO>() |
| | | .lambda().eq(ComPensionAuthStatisticsDO::getCommunityId, communityId) |
| | | .eq(ComPensionAuthStatisticsDO::getYear, year)); |
| | | if(null == comPensionAuthStatisticsDO){ |
| | | comPensionAuthStatisticsDO = comPensionAuthStatisticsDAO.selectOne(new QueryWrapper<ComPensionAuthStatisticsDO>() |
| | | .lambda().eq(ComPensionAuthStatisticsDO::getCommunityId, communityId) |
| | | .eq(ComPensionAuthStatisticsDO::getYear, year - 1)); |
| | | } |
| | | comPensionAuthStatisticsDO.setSum(comPensionAuthStatisticsDO.getSum() + 1); |
| | | comPensionAuthStatisticsDAO.updateById(comPensionAuthStatisticsDO); |
| | | } |
| | | } |
| | | comPensionAuthPensionerDAO.updateById(comPensionAuthPensionerDO); |
| | | } else { |
| | | comPensionAuthPensionerDO = new ComPensionAuthPensionerDO(); |
| | |
| | | comPensionAuthPensionerDO.setIdCard(cardNoAES); |
| | | comPensionAuthPensionerDO.setAddress(vo.getNowAddress()); |
| | | comPensionAuthPensionerDAO.insert(comPensionAuthPensionerDO); |
| | | if (vo.getIsRegister().equals(1) && vo.getIsAlive().equals(1)) { |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = (DateUtils.getYear(nowDate)); |
| | | ComPensionAuthStatisticsDO comPensionAuthStatisticsDO = comPensionAuthStatisticsDAO.selectOne(new QueryWrapper<ComPensionAuthStatisticsDO>() |
| | | .lambda().eq(ComPensionAuthStatisticsDO::getCommunityId, communityId) |
| | | .eq(ComPensionAuthStatisticsDO::getYear, year)); |
| | | comPensionAuthStatisticsDO.setSum(comPensionAuthStatisticsDO.getSum() + 1); |
| | | comPensionAuthStatisticsDAO.updateById(comPensionAuthStatisticsDO); |
| | | } |
| | | } |
| | | return populationDO; |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.enums.PopulHouseUseEnum; |
| | | import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComPensionAuthPensionerService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComPensionAuthRecordDAO; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthRecordDO; |
| | | import com.panzhihua.service_community.service.ComPensionAuthRecordService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthRecordServiceImpl |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ComPensionAuthRecordServiceImpl extends ServiceImpl<ComPensionAuthRecordDAO, ComPensionAuthRecordDO> implements ComPensionAuthRecordService { |
| | | @Resource |
| | | private ComPensionAuthRecordDAO comPensionAuthRecordDAO; |
| | | @Resource |
| | | private ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; |
| | | @Resource |
| | | private ComPensionAuthRecordService comPensionAuthRecordService; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComPensionAuthStatisticsDAO comPensionAuthStatisticsDAO; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | | @Override |
| | | public R pagePensionAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = pageElderAuthRecordsDTO.getPageNum(); |
| | | Long pageSize = pageElderAuthRecordsDTO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1L; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10L; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComPensionAuthRecordVO> iPage = comPensionAuthRecordDAO.pagePensionAuthRecords(page, pageElderAuthRecordsDTO); |
| | | if (!iPage.getRecords().isEmpty()) { |
| | | iPage.getRecords().forEach(comPensionAuthRecordVO -> { |
| | | if (StringUtils.isNotEmpty(comPensionAuthRecordVO.getBirthday())) { |
| | | comPensionAuthRecordVO.setAge(AgeUtils.getAgeFromBirthTimes(comPensionAuthRecordVO.getBirthday())); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R detailPensionAuthRecords(Long authRecordId) { |
| | | ComPensionAuthRecordVO comPensionAuthRecordVO = comPensionAuthRecordDAO.detailPensionAuthRecords(authRecordId); |
| | | return R.ok(comPensionAuthRecordVO); |
| | | } |
| | | |
| | | @Override |
| | | public R examinePensionAuthRecords(ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | ComPensionAuthRecordDO comPensionAuthRecordDO = comPensionAuthRecordDAO.selectById(comPensionAuthRecordVO.getId()); |
| | | if (comPensionAuthRecordDO == null) { |
| | | return R.fail("未查询到养老认证记录"); |
| | | } |
| | | BeanUtils.copyProperties(comPensionAuthRecordVO, comPensionAuthRecordDO); |
| | | if (comPensionAuthRecordVO.getApprovalStatus().equals(3)) { |
| | | comPensionAuthRecordDO.setAuthStatus(1); |
| | | } |
| | | comPensionAuthRecordDO.setApprovalDate(new Date()); |
| | | int nub = comPensionAuthRecordDAO.updateById(comPensionAuthRecordDO); |
| | | if (nub < 1) { |
| | | return R.fail("审核失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R signPensionAuthRecords(ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | ComPensionAuthRecordDO comPensionAuthRecordDO = comPensionAuthRecordDAO.selectById(comPensionAuthRecordVO.getId()); |
| | | if (comPensionAuthRecordDO == null) { |
| | | return R.fail("未查询到养老认证记录"); |
| | | } |
| | | BeanUtils.copyProperties(comPensionAuthRecordVO, comPensionAuthRecordDO); |
| | | int nub = comPensionAuthRecordDAO.updateById(comPensionAuthRecordDO); |
| | | if (nub < 1) { |
| | | return R.fail("标记失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R getPensionAuthRecordsByIds(List<Long> ids) { |
| | | List<ComPensionAuthRecordExcleVO> comPensionAuthRecordExcleVOS = comPensionAuthRecordDAO.getPensionAuthRecordsByIds(ids); |
| | | return R.ok(comPensionAuthRecordExcleVOS); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R listSavePensionAuthRecordExcelVO(List<ComPensionAuthRecordImportExcelVO> list, Long communityId, Long userId) { |
| | | // 需要新增的认证记录集合 |
| | | List<ComPensionAuthRecordDO> saveList = new ArrayList<>(); |
| | | // 需要修改的认证记录集合 |
| | | List<ComPensionAuthRecordDO> updateList = new ArrayList<>(); |
| | | log.info("开始处理导入数据"); |
| | | List<ComPensionAuthRecordImportMistakeExcelVO> mistakes = new ArrayList<>(); |
| | | try { |
| | | // 查询所有人口数据放入HashMap中 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(null); |
| | | HashMap<String, Object> populationMap = new HashMap<>(); |
| | | populationList.forEach(population -> { |
| | | String key = population.getCardNo(); |
| | | populationMap.put(key, population); |
| | | }); |
| | | |
| | | for (ComPensionAuthRecordImportExcelVO vo : list) { |
| | | String cardNoAES = AESUtil.encrypt128(vo.getIdCard(), aesKey); |
| | | // 判断实有人口是否已存在 |
| | | log.info("开始查询实有人口是否已存在"); |
| | | ComMngPopulationDO populationDO = null; |
| | | String populationKey = vo.getIdCard(); |
| | | if (!isOnly(populationKey, populationMap)) { |
| | | // 存在实有人口信息,则查询养老信息(是否符合认证条件(健在且登记了养老认证)) |
| | | populationDO = (ComMngPopulationDO)populationMap.get(populationKey); |
| | | ComPensionAuthPensionerDO comPensionAuthPensionerDO = comPensionAuthPensionerDAO.selectOne(new QueryWrapper<ComPensionAuthPensionerDO>() |
| | | .lambda().eq(ComPensionAuthPensionerDO::getPopulationId, populationDO.getId()).eq(ComPensionAuthPensionerDO::getCommunityId, communityId)); |
| | | //不存在养老信息,需要先导入养老信息 |
| | | if (null == comPensionAuthPensionerDO) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该实有人口已存在,但本社区不存在养老信息,请先导入养老人口"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //存在养老信息,判断是否满足认证条件 |
| | | if (!comPensionAuthPensionerDO.getIsRegister().equals(1) || !comPensionAuthPensionerDO.getIsAlive().equals(1)) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该人口不健在,或者未做养老登记"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //满足认证条件,判断是否存在当期认证记录 |
| | | ComPensionAuthRecordDO comPensionAuthRecordDO = null; |
| | | Date nowDate = new Date(); |
| | | // 获取当前年 |
| | | int year = DateUtils.getYear(nowDate); |
| | | String authPeriod = ""; |
| | | if (nowDate.before(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(String.valueOf(year) + "-03-01 00:00:00"))) { |
| | | authPeriod = String.valueOf(year - 1); |
| | | }else { |
| | | authPeriod = String.valueOf(year); |
| | | } |
| | | |
| | | comPensionAuthRecordDO = comPensionAuthRecordDAO.selectOne(new QueryWrapper<ComPensionAuthRecordDO>().lambda(). |
| | | eq(ComPensionAuthRecordDO::getPensionerId, comPensionAuthPensionerDO.getId()).eq(ComPensionAuthRecordDO::getAuthPeriod, authPeriod)); |
| | | if (null != comPensionAuthRecordDO) { |
| | | //存在记录且状态为已认证,不能修改 |
| | | if (comPensionAuthRecordDO.getAuthStatus().equals(1)) { |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该人口本期已认证,不能修改"); |
| | | mistakes.add(mistake); |
| | | }else { |
| | | //存在记录,执行修改 |
| | | ComPensionAuthRecordDO comPensionAuthRecordDO1 = |
| | | updatePensionAuthRecordsDO(vo, comPensionAuthRecordDO, userId); |
| | | updateList.add(comPensionAuthRecordDO1); |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("该认证已存在,执行更新"); |
| | | mistakes.add(mistake); |
| | | } |
| | | }else { |
| | | // 不存在记录,则新增 |
| | | comPensionAuthRecordDO = savePensionAuthRecordsDO(vo, comPensionAuthPensionerDO, authPeriod, userId); |
| | | saveList.add(comPensionAuthRecordDO); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 不存在实有人口,则新增 |
| | | ComPensionAuthRecordImportMistakeExcelVO mistake = new ComPensionAuthRecordImportMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo, mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("不存在该实有人口,请先导入实有人口信息"); |
| | | mistakes.add(mistake); |
| | | } |
| | | log.info("开始查询实有人口是否已存在完成"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("出现错误,错误原因:" + e.getMessage()); |
| | | } |
| | | log.info("处理完成导入数据"); |
| | | |
| | | log.info("开始执行数据库导入"); |
| | | if (!saveList.isEmpty()) { |
| | | log.info("执行数据库导入线下认证记录"); |
| | | comPensionAuthRecordService.saveBatch(saveList); |
| | | log.info("数据库导入线下认证记录完成"); |
| | | } |
| | | if (!updateList.isEmpty()) { |
| | | log.info("执行数据库更新线下认证记录"); |
| | | comPensionAuthRecordDAO.updateAll(updateList); |
| | | log.info("数据库更新线下认证记录完成"); |
| | | } |
| | | log.info("执行数据库导入完成"); |
| | | |
| | | if (!mistakes.isEmpty()) { |
| | | log.info("返回错误数据"); |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(mistakes); |
| | | } |
| | | |
| | | @Override |
| | | public R exportPensionAuthRecordsStatistic(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | | List<ComPensionAuthRecordStatisticExcleVO> comPensionAuthRecordStatisticExcleVOS = comPensionAuthRecordDAO.exportPensionAuthRecordsStatistic(pageElderAuthRecordsDTO); |
| | | return R.ok(comPensionAuthRecordStatisticExcleVOS); |
| | | } |
| | | |
| | | @Override |
| | | public R timedTaskPensionAuthStatisticsJobHandler() { |
| | | Date nowDate = new Date(); |
| | | int month = DateUtils.getMonth(nowDate) + 1; |
| | | int year = DateUtils.getYear(nowDate); |
| | | //查询所有启用中社区 |
| | | List<ComActDO> actList = comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getState,0)); |
| | | actList.forEach(act -> { |
| | | //养老认证统计 |
| | | ComPensionAuthStatisticsDO comPensionAuthStatisticsDO = new ComPensionAuthStatisticsDO(); |
| | | comPensionAuthStatisticsDO.setCommunityId(act.getCommunityId()); |
| | | comPensionAuthStatisticsDO.setMonth(month); |
| | | comPensionAuthStatisticsDO.setYear(year); |
| | | comPensionAuthStatisticsDO.setCreateAt(nowDate); |
| | | //本期应认证人数 |
| | | List<ComPensionAuthPensionerDO> comPensionAuthPensionerDOS = comPensionAuthPensionerDAO.selectList(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() |
| | | .eq(ComPensionAuthPensionerDO::getCommunityId, act.getCommunityId()) |
| | | .eq(ComPensionAuthPensionerDO::getIsAlive, 1) |
| | | .eq(ComPensionAuthPensionerDO::getIsRegister, 1)); |
| | | if (null != comPensionAuthPensionerDOS) { |
| | | comPensionAuthStatisticsDO.setSum(comPensionAuthPensionerDOS.size()); |
| | | } |
| | | comPensionAuthStatisticsDAO.insert(comPensionAuthStatisticsDO); |
| | | //上期已认证人数 |
| | | int authSum = comPensionAuthPensionerDAO.havePensionAuthPensionerAmount(act.getCommunityId(), String.valueOf(year - 1)); |
| | | ComPensionAuthStatisticsDO comPensionAuthStatisticsDO1 = comPensionAuthStatisticsDAO.selectOne(new QueryWrapper<ComPensionAuthStatisticsDO>() |
| | | .lambda().eq(ComPensionAuthStatisticsDO::getCommunityId, act.getCommunityId()).eq(ComPensionAuthStatisticsDO::getYear, year - 1)); |
| | | comPensionAuthStatisticsDO1.setAuthSum(authSum); |
| | | comPensionAuthStatisticsDO1.setNoAuthSum(comPensionAuthStatisticsDO1.getSum() - comPensionAuthStatisticsDO1.getAuthSum()); |
| | | comPensionAuthStatisticsDAO.updateById(comPensionAuthStatisticsDO1); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private ComPensionAuthRecordDO updatePensionAuthRecordsDO(ComPensionAuthRecordImportExcelVO vo, ComPensionAuthRecordDO comPensionAuthRecordsDO, Long userId) { |
| | | BeanUtils.copyProperties(vo, comPensionAuthRecordsDO); |
| | | comPensionAuthRecordsDO.setSubmitUserId(userId); |
| | | comPensionAuthRecordsDO.setApproverId(userId); |
| | | comPensionAuthRecordsDO.setApprovalStatus(3); |
| | | comPensionAuthRecordsDO.setApprovalDate(new Date()); |
| | | comPensionAuthRecordsDO.setAuthStatus(1); |
| | | return comPensionAuthRecordsDO; |
| | | } |
| | | |
| | | private ComPensionAuthRecordDO savePensionAuthRecordsDO(ComPensionAuthRecordImportExcelVO vo, ComPensionAuthPensionerDO comPensionAuthPensionerDO, String authPeriod, Long userId) { |
| | | ComPensionAuthRecordDO comPensionAuthRecordDO = new ComPensionAuthRecordDO(); |
| | | BeanUtils.copyProperties(vo, comPensionAuthRecordDO); |
| | | comPensionAuthRecordDO.setId(Snowflake.getId()); |
| | | comPensionAuthRecordDO.setPensionerId(comPensionAuthPensionerDO.getId()); |
| | | comPensionAuthRecordDO.setAuthPeriod(authPeriod); |
| | | comPensionAuthRecordDO.setSubmitUserId(userId); |
| | | comPensionAuthRecordDO.setApproverId(userId); |
| | | comPensionAuthRecordDO.setApprovalStatus(3); |
| | | comPensionAuthRecordDO.setApprovalDate(new Date()); |
| | | comPensionAuthRecordDO.setAuthStatus(1); |
| | | return comPensionAuthRecordDO; |
| | | } |
| | | |
| | | private void setMistake(ComPensionAuthRecordImportMistakeExcelVO mvo, |
| | | ComPensionAuthRecordImportExcelVO vo) { |
| | | mvo.setIsAlive(PopulHouseUseEnum.getCnDescByName(vo.getIsAlive())); |
| | | } |
| | | |
| | | /** |
| | | * 判重方法 |
| | | * |
| | | * @param key |
| | | * 主键 |
| | | * @param hashMap |
| | | * 数据集 |
| | | * @return 存在即为false 不存在则为true |
| | | */ |
| | | private boolean isOnly(String key, HashMap<String, Object> hashMap) { |
| | | return ObjectUtils.isEmpty(hashMap.get(key)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComPensionAuthStatisticsDAO; |
| | | import com.panzhihua.service_community.model.dos.ComPensionAuthStatisticsDO; |
| | | import com.panzhihua.service_community.service.ComPensionAuthStatisticsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @title: ComPensionAuthStatisticsServiceImpl |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 养老认证统计服务实现类 |
| | | * @author: txb |
| | | * @date: 2021/09/07 17:35 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPensionAuthStatisticsServiceImpl extends ServiceImpl<ComPensionAuthStatisticsDAO, ComPensionAuthStatisticsDO> implements ComPensionAuthStatisticsService { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportEditDTO; |
| | | import com.panzhihua.service_community.model.dos.ComSwSafetyWorkRecordDO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editDangerReport(ComSwDangerReportEditDTO comSwDangerReportEditDTO) { |
| | | ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(comSwDangerReportEditDTO.getId()); |
| | | if (null == comSwDangerReportDO) { |
| | | return R.fail("该隐患报告不存在"); |
| | | } |
| | | BeanUtils.copyProperties(comSwDangerReportEditDTO, comSwDangerReportDO); |
| | | comSwDangerReportDO.setDangerType(comSwDangerReportEditDTO.getPatrolType()); |
| | | ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>() |
| | | .lambda().eq(ComSwPatrolRecordReportDO::getReportId, comSwDangerReportEditDTO.getId())); |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = new ComSwPatrolRecordDO(); |
| | | if (null != comSwPatrolRecordReportDO) { |
| | | comSwPatrolRecordDO = comSwPatrolRecordDAO.selectOne(new QueryWrapper<ComSwPatrolRecordDO>() |
| | | .lambda().eq(ComSwPatrolRecordDO::getId, comSwPatrolRecordReportDO.getPatrolRecordId())); |
| | | Long id = comSwPatrolRecordDO.getId(); |
| | | BeanUtils.copyProperties(comSwDangerReportEditDTO, comSwPatrolRecordDO); |
| | | comSwPatrolRecordDO.setId(id); |
| | | try { |
| | | comSwPatrolRecordDO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwDangerReportEditDTO.getPatrolTime())); |
| | | comSwPatrolRecordDO.setSuccessionTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwDangerReportEditDTO.getSuccessionTime())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 根据传递的巡查人员id查询巡查人员的名字和电话 |
| | | StringBuilder nameString = new StringBuilder(); |
| | | StringBuilder phoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportEditDTO.getPatrolPerson())) { |
| | | String[] personIds = comSwDangerReportEditDTO.getPatrolPerson().split(","); |
| | | for (int i = 0; i < personIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | nameString.append(","); |
| | | phoneString.append(","); |
| | | } |
| | | nameString.append(person.get("name")); |
| | | phoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwPatrolRecordDO.setPersonName(nameString.toString()); |
| | | comSwPatrolRecordDO.setPersonPhone(phoneString.toString()); |
| | | } |
| | | } |
| | | comSwPatrolRecordDAO.updateById(comSwPatrolRecordDO); |
| | | comSwDangerReportDAO.updateById(comSwDangerReportDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R detailDangerReport(Long dangerReportId) { |
| | | ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(dangerReportId); |
| | | if (null == comSwDangerReportDO) { |
| | |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = |
| | | comSwPatrolRecordDAO.selectById(comSwPatrolRecordReportDO.getPatrolRecordId()); |
| | | BeanUtils.copyProperties(comSwPatrolRecordDO, comSwDangerReportVO); |
| | | comSwDangerReportVO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordDO.getPatrolTime())); |
| | | } |
| | | BeanUtils.copyProperties(comSwDangerReportDO, comSwDangerReportVO); |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordEditDTO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editPatrolRecord(ComSwPatrolRecordEditDTO comSwPatrolRecordEditDTO) { |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = comSwPatrolRecordDAO.selectById(comSwPatrolRecordEditDTO.getId()); |
| | | if (null == comSwPatrolRecordDO) { |
| | | return R.fail("改巡查记录不存在"); |
| | | } |
| | | BeanUtils.copyProperties(comSwPatrolRecordEditDTO, comSwPatrolRecordDO); |
| | | try { |
| | | comSwPatrolRecordDO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwPatrolRecordEditDTO.getPatrolTime())); |
| | | comSwPatrolRecordDO.setSuccessionTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwPatrolRecordEditDTO.getSuccessionTime())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 根据传递的巡查人员id查询巡查人员的名字和电话 |
| | | StringBuilder nameString = new StringBuilder(); |
| | | StringBuilder phoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordEditDTO.getPatrolPerson())) { |
| | | String[] personIds = comSwPatrolRecordEditDTO.getPatrolPerson().split(","); |
| | | for (int i = 0; i < personIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | nameString.append(","); |
| | | phoneString.append(","); |
| | | } |
| | | nameString.append(person.get("name")); |
| | | phoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwPatrolRecordDO.setPersonName(nameString.toString()); |
| | | comSwPatrolRecordDO.setPersonPhone(phoneString.toString()); |
| | | } |
| | | ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>() |
| | | .lambda().eq(ComSwPatrolRecordReportDO::getPatrolRecordId, comSwPatrolRecordEditDTO.getId())); |
| | | ComSwSafetyWorkRecordDO comSwSafetyWorkRecordDO = comSwSafetyWorkRecordDAO.selectOne(new QueryWrapper<ComSwSafetyWorkRecordDO>() |
| | | .lambda().eq(ComSwSafetyWorkRecordDO::getId, comSwPatrolRecordReportDO.getReportId())); |
| | | if (null != comSwSafetyWorkRecordDO) { |
| | | Long id = comSwSafetyWorkRecordDO.getId(); |
| | | BeanUtils.copyProperties(comSwPatrolRecordEditDTO, comSwSafetyWorkRecordDO); |
| | | comSwSafetyWorkRecordDO.setId(id); |
| | | comSwSafetyWorkRecordDAO.updateById(comSwSafetyWorkRecordDO); |
| | | }else { |
| | | ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectOne(new QueryWrapper<ComSwDangerReportDO>() |
| | | .lambda().eq(ComSwDangerReportDO::getId, comSwPatrolRecordReportDO.getReportId())); |
| | | Long id = comSwDangerReportDO.getId(); |
| | | BeanUtils.copyProperties(comSwPatrolRecordEditDTO, comSwDangerReportDO); |
| | | comSwDangerReportDO.setId(id); |
| | | comSwDangerReportDAO.updateById(comSwDangerReportDO); |
| | | } |
| | | int update = comSwPatrolRecordDAO.updateById(comSwPatrolRecordDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("编辑失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R detailPatrolRecord(Long patrolRecordId) { |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = comSwPatrolRecordDAO.selectById(patrolRecordId); |
| | | if (null == comSwPatrolRecordDO) { |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwSafetyWorkEditDTO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editSafetyWork(ComSwSafetyWorkEditDTO comSwSafetyWorkEditDTO) { |
| | | ComSwSafetyWorkRecordDO comSwSafetyWorkRecordDO = comSwSafetyWorkRecordDAO.selectById(comSwSafetyWorkEditDTO.getId()); |
| | | if (null == comSwSafetyWorkRecordDO) { |
| | | return R.fail("该安全工作记录不存在"); |
| | | } |
| | | comSwSafetyWorkRecordDO.setRemark(comSwSafetyWorkEditDTO.getRemark()); |
| | | comSwSafetyWorkRecordDO.setUpdateBy(comSwSafetyWorkEditDTO.getUpdateBy()); |
| | | ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>() |
| | | .lambda().eq(ComSwPatrolRecordReportDO::getReportId, comSwSafetyWorkEditDTO.getId())); |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = new ComSwPatrolRecordDO(); |
| | | if (null != comSwPatrolRecordReportDO) { |
| | | comSwPatrolRecordDO = comSwPatrolRecordDAO.selectOne(new QueryWrapper<ComSwPatrolRecordDO>() |
| | | .lambda().eq(ComSwPatrolRecordDO::getId, comSwPatrolRecordReportDO.getPatrolRecordId())); |
| | | Long id = comSwPatrolRecordDO.getId(); |
| | | BeanUtils.copyProperties(comSwSafetyWorkEditDTO, comSwPatrolRecordDO); |
| | | comSwPatrolRecordDO.setId(id); |
| | | try { |
| | | comSwPatrolRecordDO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwSafetyWorkEditDTO.getPatrolTime())); |
| | | comSwPatrolRecordDO.setSuccessionTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwSafetyWorkEditDTO.getSuccessionTime())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 根据传递的巡查人员id查询巡查人员的名字和电话 |
| | | StringBuilder nameString = new StringBuilder(); |
| | | StringBuilder phoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkEditDTO.getPatrolPerson())) { |
| | | String[] personIds = comSwSafetyWorkEditDTO.getPatrolPerson().split(","); |
| | | for (int i = 0; i < personIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | nameString.append(","); |
| | | phoneString.append(","); |
| | | } |
| | | nameString.append(person.get("name")); |
| | | phoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwPatrolRecordDO.setPersonName(nameString.toString()); |
| | | comSwPatrolRecordDO.setPersonPhone(phoneString.toString()); |
| | | } |
| | | } |
| | | comSwPatrolRecordDAO.updateById(comSwPatrolRecordDO); |
| | | comSwSafetyWorkRecordDAO.updateById(comSwSafetyWorkRecordDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R detailSafetyWorkRecord(Long safetyWorkRecordId, Long communityId) { |
| | | ComSwSafetyWorkRecordDO swSafetyWorkRecordDO = comSwSafetyWorkRecordDAO.selectById(safetyWorkRecordId); |
| | | if (null == swSafetyWorkRecordDO) { |
| | |
| | | if(resultMap != null){ |
| | | ComEldersAuthStatisticsDO authStatisticsDO = new ComEldersAuthStatisticsDO(); |
| | | authStatisticsDO.setCommunityId(act.getCommunityId()); |
| | | authStatisticsDO.setMonth(DateUtils.getMonth(nowDate)); |
| | | authStatisticsDO.setMonth(DateUtils.getMonth(nowDate) + 1); |
| | | authStatisticsDO.setYear(DateUtils.getYear(nowDate)); |
| | | authStatisticsDO.setCreateAt(nowDate); |
| | | authStatisticsDO.setSum(Integer.parseInt(resultMap.get("oldCount").toString())); |
| | |
| | | id, population_id, street_id, community_id, phone, name, id_card, sex, age, birthday, personnel_category, is_register, is_alive, address, remark, receive_allowance_begin, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | <select id="haveElderAuthElderliesAmount" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( ceae.id ) |
| | | FROM |
| | | com_elder_auth_elderlies ceae |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND EXISTS ( |
| | | SELECT |
| | | 1 |
| | | FROM |
| | | com_elder_auth_records cear |
| | | WHERE |
| | | ceae.id = cear.elderlies_id |
| | | AND cear.auth_status = 1 |
| | | AND cear.auth_period = #{authPeriod}) |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="auth_period" property="authPeriod" /> |
| | | <result column="submit_user_id" property="submitUserId" /> |
| | | <result column="auth_video" property="authVideo" /> |
| | | <result column="approver" property="approver" /> |
| | | <result column="approver_id" property="approverId" /> |
| | | <result column="approval_status" property="approvalStatus" /> |
| | | <result column="approval_date" property="approvalDate" /> |
| | | <result column="mark" property="mark" /> |
| | |
| | | <if test="pageElderAuthRecordsDTO.authDateEnd != null and pageElderAuthRecordsDTO.authDateEnd != ''"> |
| | | and cear.auth_date before #{pageElderAuthRecordsDTO.authDateEnd} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.approvalStatus != null"> |
| | | <if test="pageElderAuthRecordsDTO.approvalStatus != null and pageElderAuthRecordsDTO.approvalStatus != 0"> |
| | | and cear.approval_status = #{pageElderAuthRecordsDTO.approvalStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authStatus != null"> |
| | | <if test="pageElderAuthRecordsDTO.authStatus != null and pageElderAuthRecordsDTO.authStatus != 0"> |
| | | and cear.auth_status = #{pageElderAuthRecordsDTO.authStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.personnelCategory != null"> |
| | | <if test="pageElderAuthRecordsDTO.personnelCategory != null and pageElderAuthRecordsDTO.personnelCategory != 0"> |
| | | and ceae.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.isAlive != null"> |
| | | <if test="pageElderAuthRecordsDTO.isAlive != null and pageElderAuthRecordsDTO.isAlive != 0"> |
| | | and ceae.is_alive = #{pageElderAuthRecordsDTO.isAlive} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> |
| | |
| | | </foreach> |
| | | order by cear.create_at desc |
| | | </select> |
| | | |
| | | <update id="updateAll" parameterType="java.util.List"> |
| | | <foreach collection="comElderAuthRecordsDOS" item="item" index="index" separator=";"> |
| | | update com_elder_auth_records |
| | | <set> |
| | | <if test="item.id != null"> |
| | | `id` = #{item.id}, |
| | | </if> |
| | | <if test="item.elderliesId != null"> |
| | | `elderlies_id` = #{item.elderliesId}, |
| | | </if> |
| | | <if test="item.authPeriod != null and item.authPeriod != ''"> |
| | | `auth_period` = #{item.authPeriod}, |
| | | </if> |
| | | <if test="item.submitUserId != null"> |
| | | `submit_user_id` = #{item.submitUserId}, |
| | | </if> |
| | | <if test="item.authVideo != null and item.authVideo != ''"> |
| | | `auth_video` = #{item.authVideo}, |
| | | </if> |
| | | <if test="item.address != null and item.address != ''"> |
| | | `address` = #{item.address}, |
| | | </if> |
| | | <if test="item.approverId != null"> |
| | | `approver_id` = #{item.approverId}, |
| | | </if> |
| | | <if test="item.approvalStatus != null"> |
| | | `approval_status` = #{item.approvalStatus}, |
| | | </if> |
| | | <if test="item.approvalDate != null"> |
| | | `approval_date` = #{item.approvalDate}, |
| | | </if> |
| | | <if test="item.mark != null and item.mark != ''"> |
| | | `mark` = #{item.mark}, |
| | | </if> |
| | | <if test="item.rejectReason != null and item.rejectReason != ''"> |
| | | `reject_reason` = #{item.rejectReason}, |
| | | </if> |
| | | <if test="item.authStatus != null"> |
| | | `auth_status` = #{item.authStatus}, |
| | | </if> |
| | | <if test="item.authDate != null"> |
| | | `auth_date` = #{item.authDate}, |
| | | </if> |
| | | `update_at` = NOW() |
| | | </set> |
| | | WHERE `id` = #{item.id} |
| | | </foreach> |
| | | ; |
| | | </update> |
| | | |
| | | <select id="exportElderAuthRecordsStatistic" resultType="com.panzhihua.common.model.vos.community.ComElderAuthRecordStatisticExcleVO"> |
| | | SELECT |
| | | su.`name` submitUserName, |
| | | ceae.phone, |
| | | ceae.`name`, |
| | | ceae.id_card, |
| | | CASE |
| | | ceae.sex |
| | | WHEN 1 THEN |
| | | '男' |
| | | WHEN 2 THEN |
| | | '女' |
| | | WHEN 3 THEN |
| | | '其他' |
| | | END sex, |
| | | ceae.birthday, |
| | | CASE |
| | | ceae.personnel_category |
| | | WHEN 1 THEN |
| | | '80-89周岁' |
| | | WHEN 2 THEN |
| | | '90-99周岁' |
| | | WHEN 3 THEN |
| | | '100周岁(含)以上' |
| | | END personnelCategory, |
| | | ceae.address, |
| | | CASE |
| | | ceae.isAlive |
| | | WHEN 1 THEN |
| | | '是' |
| | | WHEN 0 THEN |
| | | '否' |
| | | END is_alive, |
| | | cear.auth_period, |
| | | cear.auth_date, |
| | | cear.mark, |
| | | CASE |
| | | cear.auth_status |
| | | WHEN 1 THEN |
| | | '已认证' |
| | | WHEN 0 THEN |
| | | '未认证' |
| | | END authStatus |
| | | FROM |
| | | com_elder_auth_records cear |
| | | LEFT JOIN com_elder_auth_elderlies ceae ON cear.elderlies_id = ceae.id |
| | | LEFT JOIN sys_user su ON cear.submit_user_id = su.user_id |
| | | WHERE |
| | | ceae.community_id = #{pageElderAuthRecordsDTO.communityId} |
| | | <if test="pageElderAuthRecordsDTO.authPeriod != null and pageElderAuthRecordsDTO.authPeriod !=''"> |
| | | and cear.auth_period = #{pageElderAuthRecordsDTO.authPeriod} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authStatus != null and pageElderAuthRecordsDTO.authStatus != 0"> |
| | | and cear.auth_status = #{pageElderAuthRecordsDTO.authStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.personnelCategory != null and pageElderAuthRecordsDTO.personnelCategory != 0"> |
| | | and ceae.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.isAlive != null and pageElderAuthRecordsDTO.isAlive != 0"> |
| | | and ceae.is_alive = #{pageElderAuthRecordsDTO.isAlive} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> |
| | | and (ceae.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') |
| | | or cear.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) |
| | | </if> |
| | | order by cear.create_at desc |
| | | </select> |
| | | </mapper> |
| | |
| | | id, population_id, street_id, community_id, phone, name, id_card, sex, age, birthday, personnel_category, is_register, is_alive, address, remark, receive_allowance_begin, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | <select id="havePensionAuthPensionerAmount" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( cpap.id ) |
| | | FROM |
| | | com_pension_auth_pensioners cpap |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND EXISTS ( |
| | | SELECT |
| | | 1 |
| | | FROM |
| | | com_pension_auth_records cpar |
| | | WHERE |
| | | cpap.id = cpar.pensioner_id |
| | | AND cpar.auth_status = 1 |
| | | AND cpar.auth_period = #{authPeriod}) |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="auth_period" property="authPeriod" /> |
| | | <result column="submit_user_id" property="submitUserId" /> |
| | | <result column="auth_video" property="authVideo" /> |
| | | <result column="approver" property="approver" /> |
| | | <result column="approver_id" property="approverId" /> |
| | | <result column="approval_status" property="approvalStatus" /> |
| | | <result column="approval_date" property="approvalDate" /> |
| | | <result column="mark" property="mark" /> |
| | |
| | | id, pensioner_id, auth_period, submit_user_id, auth_video, approver, approval_status, approval_date, mark, reject_reason, auth_status, auth_date, create_at, update_at |
| | | </sql> |
| | | |
| | | <select id="pagePensionAuthRecords" resultType="com.panzhihua.common.model.vos.community.ComPensionAuthRecordVO"> |
| | | SELECT |
| | | su.`name` submitUserName, |
| | | cpap.phone, |
| | | cpap.`name`, |
| | | cpap.id_card, |
| | | cpap.sex, |
| | | cpap.birthday, |
| | | cpap.personnel_category, |
| | | cpap.address, |
| | | cpap.is_alive, |
| | | cpar.auth_period, |
| | | cpar.auth_date, |
| | | cpar.mark, |
| | | cpar.approval_status, |
| | | cpar.auth_status |
| | | FROM |
| | | com_pension_auth_records cpar |
| | | LEFT JOIN com_pension_auth_pensioners cpap ON cpar.pensioner_id = cpap.id |
| | | LEFT JOIN sys_user su ON cpar.submit_user_id = su.user_id |
| | | WHERE |
| | | cpap.community_id = #{pageElderAuthRecordsDTO.communityId} |
| | | <if test="pageElderAuthRecordsDTO.authPeriod != null and pageElderAuthRecordsDTO.authPeriod !=''"> |
| | | and cpar.auth_period = #{pageElderAuthRecordsDTO.authPeriod} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authDateBegin != null and pageElderAuthRecordsDTO.authDateBegin != ''"> |
| | | and cpar.auth_date after #{pageElderAuthRecordsDTO.authDateBegin} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authDateEnd != null and pageElderAuthRecordsDTO.authDateEnd != ''"> |
| | | and cpar.auth_date before #{pageElderAuthRecordsDTO.authDateEnd} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.approvalStatus != null and pageElderAuthRecordsDTO.approvalStatus != 0"> |
| | | and cpar.approval_status = #{pageElderAuthRecordsDTO.approvalStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authStatus != null and pageElderAuthRecordsDTO.authStatus != 0"> |
| | | and cpar.auth_status = #{pageElderAuthRecordsDTO.authStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.personnelCategory != null and pageElderAuthRecordsDTO.personnelCategory != 0"> |
| | | and cpap.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.isAlive != null and pageElderAuthRecordsDTO.isAlive != 0"> |
| | | and cpap.is_alive = #{pageElderAuthRecordsDTO.isAlive} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> |
| | | and (cpap.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') |
| | | or cpar.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) |
| | | </if> |
| | | order by cpar.create_at desc |
| | | </select> |
| | | |
| | | <select id="detailPensionAuthRecords" resultType="com.panzhihua.common.model.vos.community.ComPensionAuthRecordVO"> |
| | | SELECT |
| | | su.`name` submitUserName, |
| | | cpap.phone, |
| | | cpap.`name`, |
| | | cpap.id_card, |
| | | cpap.sex, |
| | | cpap.birthday, |
| | | cpap.personnel_category, |
| | | cpap.address, |
| | | cpap.is_alive, |
| | | cpar.auth_period, |
| | | cpar.auth_date, |
| | | cpar.mark, |
| | | cpar.auth_video, |
| | | cpar.approval_status, |
| | | su1.`name` as approverName, |
| | | cpar.approval_date |
| | | FROM |
| | | com_pension_auth_records cpar |
| | | LEFT JOIN com_pension_auth_pensioners cpap ON cpar.pensioner_id = cpap.id |
| | | LEFT JOIN sys_user su ON cpar.submit_user_id = su.user_id |
| | | LEFT JOIN sys_user su1 ON ccparear.approver_id = su1.user_id |
| | | WHERE |
| | | cpar.id = #{authRecordId} |
| | | </select> |
| | | |
| | | <select id="getPensionAuthRecordsByIds" resultType="com.panzhihua.common.model.vos.community.ComPensionAuthRecordExcleVO"> |
| | | SELECT |
| | | su.`name` submitUserName, |
| | | cpap.phone, |
| | | cpap.`name`, |
| | | cpap.id_card, |
| | | CASE |
| | | cpap.sex |
| | | WHEN 1 THEN |
| | | '男' |
| | | WHEN 2 THEN |
| | | '女' |
| | | WHEN 3 THEN |
| | | '其他' |
| | | END sex, |
| | | cpap.birthday, |
| | | CASE |
| | | cpap.personnel_category |
| | | WHEN 1 THEN |
| | | '80-89周岁' |
| | | WHEN 2 THEN |
| | | '90-99周岁' |
| | | WHEN 3 THEN |
| | | '100周岁(含)以上' |
| | | END personnelCategory, |
| | | cpap.address, |
| | | CASE |
| | | cpap.isAlive |
| | | WHEN 1 THEN |
| | | '是' |
| | | WHEN 0 THEN |
| | | '否' |
| | | END is_alive, |
| | | cpar.auth_period, |
| | | cpar.auth_date, |
| | | cpar.mark, |
| | | CASE |
| | | cpar.approval_status |
| | | WHEN 1 THEN |
| | | '待审核' |
| | | WHEN 2 THEN |
| | | '驳回' |
| | | WHEN 3 THEN |
| | | '通过' |
| | | END approvalStatus |
| | | FROM |
| | | com_pension_auth_records cpar |
| | | LEFT JOIN com_pension_auth_pensioners cpap ON cpar.pensioner_id = cpap.id |
| | | LEFT JOIN sys_user su ON cpar.submit_user_id = su.user_id |
| | | WHERE |
| | | cpar.id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")" > |
| | | #{id} |
| | | </foreach> |
| | | order by cpar.create_at desc |
| | | </select> |
| | | |
| | | <update id="updateAll" parameterType="java.util.List"> |
| | | <foreach collection="comPensionAuthRecordDOS" item="item" index="index" separator=";"> |
| | | update com_pension_auth_records |
| | | <set> |
| | | <if test="item.id != null"> |
| | | `id` = #{item.id}, |
| | | </if> |
| | | <if test="item.pensionerId != null"> |
| | | `pensioner_id` = #{item.pensionerId}, |
| | | </if> |
| | | <if test="item.authPeriod != null and item.authPeriod != ''"> |
| | | `auth_period` = #{item.authPeriod}, |
| | | </if> |
| | | <if test="item.submitUserId != null"> |
| | | `submit_user_id` = #{item.submitUserId}, |
| | | </if> |
| | | <if test="item.authVideo != null and item.authVideo != ''"> |
| | | `auth_video` = #{item.authVideo}, |
| | | </if> |
| | | <if test="item.address != null and item.address != ''"> |
| | | `address` = #{item.address}, |
| | | </if> |
| | | <if test="item.approverId != null"> |
| | | `approver_id` = #{item.approverId}, |
| | | </if> |
| | | <if test="item.approvalStatus != null"> |
| | | `approval_status` = #{item.approvalStatus}, |
| | | </if> |
| | | <if test="item.approvalDate != null"> |
| | | `approval_date` = #{item.approvalDate}, |
| | | </if> |
| | | <if test="item.mark != null and item.mark != ''"> |
| | | `mark` = #{item.mark}, |
| | | </if> |
| | | <if test="item.rejectReason != null and item.rejectReason != ''"> |
| | | `reject_reason` = #{item.rejectReason}, |
| | | </if> |
| | | <if test="item.authStatus != null"> |
| | | `auth_status` = #{item.authStatus}, |
| | | </if> |
| | | <if test="item.authDate != null"> |
| | | `auth_date` = #{item.authDate}, |
| | | </if> |
| | | `update_at` = NOW() |
| | | </set> |
| | | WHERE `id` = #{item.id} |
| | | </foreach> |
| | | ; |
| | | </update> |
| | | |
| | | <select id="exportPensionAuthRecordsStatistic" resultType="com.panzhihua.common.model.vos.community.ComPensionAuthRecordStatisticExcleVO"> |
| | | SELECT |
| | | su.`name` submitUserName, |
| | | cpap.phone, |
| | | cpap.`name`, |
| | | cpap.id_card, |
| | | CASE |
| | | cpap.sex |
| | | WHEN 1 THEN |
| | | '男' |
| | | WHEN 2 THEN |
| | | '女' |
| | | WHEN 3 THEN |
| | | '其他' |
| | | END sex, |
| | | cpap.birthday, |
| | | CASE |
| | | cpap.personnel_category |
| | | WHEN 1 THEN |
| | | '80-89周岁' |
| | | WHEN 2 THEN |
| | | '90-99周岁' |
| | | WHEN 3 THEN |
| | | '100周岁(含)以上' |
| | | END personnelCategory, |
| | | cpap.address, |
| | | CASE |
| | | cpap.isAlive |
| | | WHEN 1 THEN |
| | | '是' |
| | | WHEN 0 THEN |
| | | '否' |
| | | END is_alive, |
| | | cpar.auth_period, |
| | | cpar.auth_date, |
| | | cpar.mark, |
| | | CASE |
| | | cpar.auth_status |
| | | WHEN 1 THEN |
| | | '已认证' |
| | | WHEN 0 THEN |
| | | '未认证' |
| | | END authStatus |
| | | FROM |
| | | com_pension_auth_records cpar |
| | | LEFT JOIN com_pension_auth_pensioners cpap ON cpar.pensioner_id = cpap.id |
| | | LEFT JOIN sys_user su ON cpar.submit_user_id = su.user_id |
| | | WHERE |
| | | cpap.community_id = #{pageElderAuthRecordsDTO.communityId} |
| | | <if test="pageElderAuthRecordsDTO.authPeriod != null and pageElderAuthRecordsDTO.authPeriod !=''"> |
| | | and cpar.auth_period = #{pageElderAuthRecordsDTO.authPeriod} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authStatus != null and pageElderAuthRecordsDTO.authStatus != 0"> |
| | | and cpar.auth_status = #{pageElderAuthRecordsDTO.authStatus} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.personnelCategory != null and pageElderAuthRecordsDTO.personnelCategory != 0"> |
| | | and cpap.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.isAlive != null and pageElderAuthRecordsDTO.isAlive != 0"> |
| | | and cpap.is_alive = #{pageElderAuthRecordsDTO.isAlive} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> |
| | | and (cpap.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') |
| | | or cpar.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) |
| | | </if> |
| | | order by cpar.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComPensionAuthStatisticsDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComPensionAuthStatisticsDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="year" property="year" /> |
| | | <result column="month" property="month" /> |
| | | <result column="sum" property="sum" /> |
| | | <result column="auth_sum" property="authSum" /> |
| | | <result column="no_auth_sum" property="noAuthSum" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="community_id" property="communityId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, year, month, sum, auth_sum, no_auth_sum, create_at, community_id |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | package com.panzhihua.service_community; |
| | | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Slf4j |
| | | @SpringBootTest |
| | |
| | | log.info("test"); |
| | | } |
| | | |
| | | @Test |
| | | void test() { |
| | | log.info(String.valueOf(DateUtils.getYear(new Date()))); |
| | | log.info(String.valueOf(DateUtils.getMonth(new Date()))); |
| | | log.info(String.valueOf(DateUtils.getYear(new Date())) + 0 + DateUtils.getMonth(new Date())); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>zhihuishequ</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>service_property</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>service_property</name> |
| | | <description>物业</description> |
| | | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-config</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.netflix.hystrix</groupId> |
| | | <artifactId>hystrix-javanica</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-integration</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.netty</groupId> |
| | | <artifactId>netty-all</artifactId> |
| | | <version>4.1.36.Final</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-lang</groupId> |
| | | <artifactId>commons-lang</artifactId> |
| | | <version>2.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-amqp</artifactId> |
| | | </dependency> |
| | | <!--添加监控依赖包--> |
| | | <dependency> |
| | | <groupId>io.micrometer</groupId> |
| | | <artifactId>micrometer-registry-prometheus</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.panzhihua.service_property.ServicePropertyApplication</mainClass> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>docker-maven-plugin</artifactId> |
| | | <version>1.2.0</version> |
| | | <configuration> |
| | | <imageName>registry.cn-chengdu.aliyuncs.com/panzhihua/service_property:v1</imageName> |
| | | <serverId></serverId> |
| | | <baseImage>java</baseImage> |
| | | <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint> |
| | | <resources> |
| | | <resource> |
| | | <targetPath>/</targetPath> |
| | | <directory>${project.build.directory}</directory> |
| | | <include>${project.build.finalName}.jar</include> |
| | | </resource> |
| | | </resources> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>spring-milestones</id> |
| | | <name>Spring Milestones</name> |
| | | <url>https://repo.spring.io/milestone</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.panzhihua.service_property; |
| | | |
| | | import com.panzhihua.service_property.netty.NettyServer; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.SpringCloudApplication; |
| | | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
| | | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.net.InetSocketAddress; |
| | | |
| | | @SpringCloudApplication |
| | | @EnableFeignClients(basePackages = {"com.panzhihua.common.service"}) |
| | | @EnableEurekaClient |
| | | @EnableCircuitBreaker |
| | | @ComponentScan({"com.panzhihua.service_property", "com.panzhihua.common"}) |
| | | @SpringBootApplication |
| | | public class ServicePropertyApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ServicePropertyApplication.class, args); |
| | | new NettyServer().start(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.api; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | import com.panzhihua.service_property.service.ComPropertyAlarmService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyAlarm)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:50 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comPropertyAlarm") |
| | | public class ComPropertyAlarmApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComPropertyAlarmService comPropertyAlarmService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comPropertyAlarmService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.comPropertyAlarmService.selectDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) { |
| | | ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm(); |
| | | BeanUtils.copyProperties(comPropertyAlarmVO,comPropertyAlarm); |
| | | comPropertyAlarm.setCreateTime(DateUtil.date()); |
| | | return R.ok(this.comPropertyAlarmService.save(comPropertyAlarm)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyAlarmVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) { |
| | | ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm(); |
| | | BeanUtils.copyProperties(comPropertyAlarmVO,comPropertyAlarm); |
| | | return R.ok(this.comPropertyAlarmService.updateById(comPropertyAlarm)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comPropertyAlarmService.removeById(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.api; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmSettingVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarmSetting; |
| | | import com.panzhihua.service_property.service.ComPropertyAlarmSettingService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyAlarmSetting)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-09 09:46:51 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comPropertyAlarmSetting") |
| | | public class ComPropertyAlarmSettingApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComPropertyAlarmSettingService comPropertyAlarmSettingService; |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param communityId 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping |
| | | public R selectOne(@RequestParam("communityId") Long communityId) { |
| | | return this.comPropertyAlarmSettingService.getByCommunityId(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmSettingVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyAlarmSettingVO comPropertyAlarmSettingVO) { |
| | | ComPropertyAlarmSetting comPropertyAlarmSetting=new ComPropertyAlarmSetting(); |
| | | BeanUtils.copyProperties(comPropertyAlarmSettingVO,comPropertyAlarmSetting); |
| | | comPropertyAlarmSetting.setCreateTime(DateUtil.date()); |
| | | return R.ok(this.comPropertyAlarmSettingService.insert(comPropertyAlarmSetting)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import com.panzhihua.service_property.service.ComPropertyEquipmentService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyEquipment)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:33 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comPropertyEquipment") |
| | | public class ComPropertyEquipmentApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComPropertyEquipmentService comPropertyEquipmentService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comPropertyEquipmentService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return R.ok(this.comPropertyEquipmentService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | ComPropertyEquipment comPropertyEquipment=new ComPropertyEquipment(); |
| | | BeanUtils.copyProperties(comPropertyEquipmentVO,comPropertyEquipment); |
| | | return this.comPropertyEquipmentService.insert(comPropertyEquipment); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyEquipmentVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyEquipmentVO comPropertyEquipmentVO) { |
| | | ComPropertyEquipment comPropertyEquipment=new ComPropertyEquipment(); |
| | | BeanUtils.copyProperties(comPropertyEquipmentVO,comPropertyEquipment); |
| | | return R.ok(this.comPropertyEquipmentService.updateById(comPropertyEquipment)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comPropertyEquipmentService.removeById(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyRepair; |
| | | import com.panzhihua.service_property.service.ComPropertyRepairService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (ComPropertyRepair)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-02 10:12:12 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comPropertyRepair") |
| | | public class ComPropertyRepairApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComPropertyRepairService comPropertyRepairService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comPropertyRepairService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.comPropertyRepairService.selectDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | ComPropertyRepair comPropertyRepair=new ComPropertyRepair(); |
| | | if(comPropertyRepairVO!=null){ |
| | | BeanUtils.copyProperties(comPropertyRepairVO,comPropertyRepair); |
| | | } |
| | | return R.ok(this.comPropertyRepairService.save(comPropertyRepair)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | ComPropertyRepair comPropertyRepair=new ComPropertyRepair(); |
| | | if(comPropertyRepairVO!=null){ |
| | | BeanUtils.copyProperties(comPropertyRepairVO,comPropertyRepair); |
| | | } |
| | | return R.ok(this.comPropertyRepairService.updateById(comPropertyRepair)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comPropertyRepairService.removeById(id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 分页 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 16:26 |
| | | **/ |
| | | @Configuration |
| | | public class MybatisPlusConfig { |
| | | |
| | | /** |
| | | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除) |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | @Bean |
| | | public ConfigurationCustomizer configurationCustomizer() { |
| | | return configuration -> configuration.setUseDeprecatedExecutor(false); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.config; |
| | | |
| | | import org.springframework.amqp.core.*; |
| | | import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; |
| | | import org.springframework.amqp.support.converter.MessageConverter; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Configuration |
| | | public class RabbitmqConfig { |
| | | |
| | | |
| | | public static final String DELAYED_QUEUE="delayed.queue"; |
| | | public static final String DELAYED_ROUTING_KEY="delayed.key"; |
| | | public static final String DELAYED_EXCHANGE="delayed.exchange"; |
| | | |
| | | |
| | | |
| | | @Bean |
| | | public Queue delayedQueue(){ |
| | | return new Queue(DELAYED_QUEUE,true,false,false,null); |
| | | } |
| | | |
| | | @Bean |
| | | public Exchange delayedExchange(){ |
| | | Map<String, Object> arguments = new HashMap<>(); |
| | | arguments.put("x-delayed-type", ExchangeTypes.DIRECT); |
| | | return new CustomExchange(DELAYED_EXCHANGE,"x-delayed-message",true,false,arguments); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding delayedBinding(){ |
| | | return BindingBuilder.bind(delayedQueue()).to(delayedExchange()).with(DELAYED_ROUTING_KEY).noargs(); |
| | | } |
| | | |
| | | public Queue directQueue() { |
| | | // durable:是否持久化,默认是false,持久化队列:会被存储在磁盘上,当消息代理重启时仍然存在,暂存队列:当前连接有效 |
| | | // exclusive:默认也是false,只能被当前创建的连接使用,而且当连接关闭后队列即被删除。此参考优先级高于durable |
| | | // autoDelete:是否自动删除,当没有生产者或者消费者使用此队列,该队列会自动删除。 |
| | | // return new Queue("TestDirectQueue",true,true,false); |
| | | |
| | | //一般设置一下队列的持久化就好,其余两个就是默认false |
| | | return new Queue("directQueue",true); |
| | | } |
| | | |
| | | //Direct交换机 起名:TestDirectExchange |
| | | @Bean |
| | | DirectExchange directExchange() { |
| | | // return new DirectExchange("TestDirectExchange",true,true); |
| | | return new DirectExchange("directExchange",true,false); |
| | | } |
| | | |
| | | //绑定 将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting |
| | | @Bean |
| | | Binding bindingDirect() { |
| | | return BindingBuilder.bind(directQueue()).to(directExchange()).with("directRouting"); |
| | | } |
| | | |
| | | |
| | | public Queue pushQueue() { |
| | | // durable:是否持久化,默认是false,持久化队列:会被存储在磁盘上,当消息代理重启时仍然存在,暂存队列:当前连接有效 |
| | | // exclusive:默认也是false,只能被当前创建的连接使用,而且当连接关闭后队列即被删除。此参考优先级高于durable |
| | | // autoDelete:是否自动删除,当没有生产者或者消费者使用此队列,该队列会自动删除。 |
| | | // return new Queue("TestDirectQueue",true,true,false); |
| | | |
| | | //一般设置一下队列的持久化就好,其余两个就是默认false |
| | | return new Queue("pushQueue",true); |
| | | } |
| | | |
| | | //Direct交换机 起名:TestDirectExchange |
| | | @Bean |
| | | DirectExchange pushExchange() { |
| | | // return new DirectExchange("TestDirectExchange",true,true); |
| | | return new DirectExchange("PUSH_Exchange",true,false); |
| | | } |
| | | |
| | | //绑定 将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting |
| | | @Bean |
| | | Binding bindingPush() { |
| | | return BindingBuilder.bind(directQueue()).to(directExchange()).with("PUSH_ROUTING"); |
| | | } |
| | | |
| | | |
| | | |
| | | @Bean |
| | | DirectExchange lonelyDirectExchange() { |
| | | return new DirectExchange("lonelyDirectExchange"); |
| | | } |
| | | |
| | | @Bean |
| | | public MessageConverter messageConverter(){ |
| | | return new Jackson2JsonMessageConverter(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_property.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * (ComPropertyAlarm)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:49 |
| | | */ |
| | | @Mapper |
| | | public interface ComPropertyAlarmDao extends BaseMapper<ComPropertyAlarm> { |
| | | IPage<ComPropertyAlarmVO> selectList(Page page, @Param("commonPage") CommonPage commonPage); |
| | | ComPropertyAlarmVO selectById(Integer id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarmSetting; |
| | | |
| | | /** |
| | | * (ComPropertyAlarmSetting)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-09 09:46:50 |
| | | */ |
| | | @Mapper |
| | | public interface ComPropertyAlarmSettingDao extends BaseMapper<ComPropertyAlarmSetting> { |
| | | ComPropertyAlarmSetting getByCommunityId(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * (ComPropertyEquipment)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:32 |
| | | */ |
| | | @Mapper |
| | | public interface ComPropertyEquipmentDao extends BaseMapper<ComPropertyEquipment> { |
| | | IPage<ComPropertyEquipment> pageList(Page page, @Param("commonPage") CommonPage commonPage); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_property.entity.ComPropertyRepair; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyRepair)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-02 10:12:09 |
| | | */ |
| | | @Mapper |
| | | public interface ComPropertyRepairDao extends BaseMapper<ComPropertyRepair> { |
| | | IPage<ComPropertyRepairVO> pageList(Page page, @Param("commonPage") CommonPage commonPage); |
| | | ComPropertyRepairVO selectDetail(Integer id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (ComPropertyAlarm)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:49 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class ComPropertyAlarm implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -79284364749441136L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设备号 |
| | | */ |
| | | @ApiModelProperty(value = "设备号") |
| | | private String serialNo; |
| | | |
| | | /** |
| | | * 报警类型 1一键报警 2长时间无应答报警 |
| | | */ |
| | | @ApiModelProperty(value = "报警类型 1一键报警 2长时间无应答报警") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | *居民姓名 |
| | | */ |
| | | @ApiModelProperty("居民姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 报警处理状态 0待处理 1已办结 |
| | | */ |
| | | @ApiModelProperty("处理状态") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 处理人id |
| | | */ |
| | | @ApiModelProperty("处理人id") |
| | | private Long solveId; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private Date solveTime; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String solveContent; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 处理图片 |
| | | */ |
| | | @ApiModelProperty("处理图片") |
| | | private String solveUrl; |
| | | /** |
| | | * 报警类型 1一键报警 2长时间无应答报警 |
| | | */ |
| | | public interface type{ |
| | | int one=1; |
| | | int time=2; |
| | | } |
| | | /** |
| | | * 报警处理状态 0待处理 1已办结 |
| | | */ |
| | | public interface status{ |
| | | int dcl=0; |
| | | int ybj=1; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (ComPropertyAlarmSetting)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-09 09:46:49 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class ComPropertyAlarmSetting implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 793830057265779177L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 触发间隔 |
| | | */ |
| | | @ApiModelProperty(value = "触发间隔") |
| | | private Integer triggerTime; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (ComPropertyEquipment)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:31 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class ComPropertyEquipment implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -71395005704296906L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | @ApiModelProperty(value = "设备编号") |
| | | private String serialNo; |
| | | |
| | | /** |
| | | * 报警位置 |
| | | */ |
| | | @ApiModelProperty(value = "报警位置") |
| | | private String position; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 居民名称 |
| | | */ |
| | | @ApiModelProperty(value = "居民名称") |
| | | private String username; |
| | | |
| | | /** |
| | | * 设备类型 设备类型 1红外报警 2一键报警 |
| | | */ |
| | | @ApiModelProperty("设备类型 设备类型 1红外报警 2一键报警") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (ComPropertyRepair)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-02 10:12:07 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class ComPropertyRepair implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 360932817327433044L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 报修内容 |
| | | */ |
| | | @ApiModelProperty(value = "报修内容") |
| | | private String repairContent; |
| | | |
| | | /** |
| | | * 报修人 |
| | | */ |
| | | @ApiModelProperty(value = "报修人") |
| | | private String repairName; |
| | | |
| | | /** |
| | | * 报修手机 |
| | | */ |
| | | @ApiModelProperty(value = "报修手机") |
| | | private String repairPhone; |
| | | |
| | | /** |
| | | * 报修位置 |
| | | */ |
| | | @ApiModelProperty(value = "报修位置") |
| | | private String repairPosition; |
| | | |
| | | /** |
| | | * 状态 0 待处理 1待评价 2已结束 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0 待处理 1待评价 2已结束") |
| | | private Integer repairStatus; |
| | | |
| | | /** |
| | | * 报修时间 |
| | | */ |
| | | @ApiModelProperty(value = "报修时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 报修图片url |
| | | */ |
| | | @ApiModelProperty(value = "报修图片url") |
| | | private String repairUrl; |
| | | |
| | | /** |
| | | * 评价内容 |
| | | */ |
| | | @ApiModelProperty(value = "评价内容") |
| | | private String replyContent; |
| | | |
| | | /** |
| | | * 评价图片url |
| | | */ |
| | | @ApiModelProperty(value = "评价图片url") |
| | | private String replyUrl; |
| | | |
| | | /** |
| | | * 评价时间 |
| | | */ |
| | | @ApiModelProperty(value = "评价时间") |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 报修人id |
| | | */ |
| | | @ApiModelProperty(value = "报修人id") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 反馈人id |
| | | */ |
| | | @ApiModelProperty(value = "反馈人id") |
| | | private Long feedbackBy; |
| | | |
| | | /** |
| | | * 反馈内容 |
| | | */ |
| | | @ApiModelProperty(value = "反馈内容") |
| | | private String feedbackContent; |
| | | |
| | | /** |
| | | * 反馈图片 |
| | | */ |
| | | @ApiModelProperty(value = "反馈图片") |
| | | private String feedbackUrl; |
| | | |
| | | /** |
| | | * 反馈时间 |
| | | */ |
| | | @ApiModelProperty(value = "反馈时间") |
| | | private Date feedbackTime; |
| | | |
| | | /** |
| | | * 评价星级 |
| | | */ |
| | | @ApiModelProperty(value = "评价星级") |
| | | private Integer replyScore; |
| | | |
| | | /** |
| | | * 物业id |
| | | */ |
| | | @ApiModelProperty(value = "物业id") |
| | | private Integer propertyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.message; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmDao; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class AlarmMessage { |
| | | |
| | | private final static String DELAY_QUEUE="delayed.queue"; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private ComPropertyAlarmDao comPropertyAlarmDao; |
| | | |
| | | @RabbitListener(queues=DELAY_QUEUE) |
| | | public void delayAlarm(ComPropertyEquipment comPropertyEquipment){ |
| | | log.info("消息队列开始消费"); |
| | | if(!stringRedisTemplate.hasKey(comPropertyEquipment.getSerialNo())){ |
| | | ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm(); |
| | | comPropertyAlarm.setCreateTime(DateUtil.date()); |
| | | comPropertyAlarm.setSerialNo(comPropertyEquipment.getSerialNo()); |
| | | comPropertyAlarm.setType(ComPropertyAlarm.type.one); |
| | | comPropertyAlarm.setCommunityId(comPropertyEquipment.getCommunityId()); |
| | | comPropertyAlarm.setName(comPropertyEquipment.getUsername()); |
| | | comPropertyAlarm.setStatus(ComPropertyAlarm.status.dcl); |
| | | comPropertyAlarmDao.insert(comPropertyAlarm); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.netty; |
| | | |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.netty.handler.codec.ByteToMessageDecoder; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class MyDecoder extends ByteToMessageDecoder { |
| | | |
| | | @Override |
| | | protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { |
| | | String HEXES = "0123456789ABCDEF"; |
| | | byte[] req = new byte[msg.readableBytes()]; |
| | | msg.readBytes(req); |
| | | final StringBuilder hex = new StringBuilder(2 * req.length); |
| | | |
| | | for (int i = 0; i < req.length; i++) { |
| | | byte b = req[i]; |
| | | hex.append(HEXES.charAt((b & 0xF0) >> 4)) |
| | | .append(HEXES.charAt((b & 0x0F))); |
| | | } |
| | | out.add(hex.toString()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.netty; |
| | | |
| | | import io.netty.bootstrap.ServerBootstrap; |
| | | import io.netty.channel.ChannelFuture; |
| | | import io.netty.channel.ChannelOption; |
| | | import io.netty.channel.EventLoopGroup; |
| | | import io.netty.channel.nio.NioEventLoopGroup; |
| | | import io.netty.channel.socket.nio.NioServerSocketChannel; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.net.InetSocketAddress; |
| | | |
| | | @Slf4j |
| | | public class NettyServer { |
| | | private static final Integer port=20012; |
| | | private static final String host="47.104.148.185"; |
| | | public void start() { |
| | | //new 一个主线程组 |
| | | EventLoopGroup bossGroup = new NioEventLoopGroup(1); |
| | | //new 一个工作线程组 |
| | | EventLoopGroup workGroup = new NioEventLoopGroup(200); |
| | | ServerBootstrap bootstrap = new ServerBootstrap() |
| | | .group(bossGroup, workGroup) |
| | | .channel(NioServerSocketChannel.class) |
| | | .childHandler(new ServerChannelInitializer()) |
| | | //设置队列大小 |
| | | .option(ChannelOption.SO_BACKLOG, 1024) |
| | | // 两小时内没有数据的通信时,TCP会自动发送一个活动探测数据报文 |
| | | .childOption(ChannelOption.SO_KEEPALIVE, true); |
| | | //绑定端口,开始接收进来的连接 |
| | | try { |
| | | ChannelFuture future = bootstrap.bind(host,port).sync(); |
| | | log.info("服务器启动开始监听端口: {}", port); |
| | | future.channel().closeFuture().sync(); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | //关闭主线程组 |
| | | bossGroup.shutdownGracefully(); |
| | | //关闭工作线程组 |
| | | workGroup.shutdownGracefully(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.netty; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmDao; |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao; |
| | | import com.panzhihua.service_property.dao.ComPropertyEquipmentDao; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarmSetting; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import com.panzhihua.service_property.util.MyTools; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.netty.channel.ChannelInboundHandlerAdapter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.time.Duration; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
| | | @Resource |
| | | private ComPropertyAlarmDao comPropertyAlarmDao; |
| | | @Resource |
| | | private ComPropertyAlarmSettingDao comPropertyAlarmSettingDao; |
| | | @Resource |
| | | private ComPropertyEquipmentDao comPropertyEquipmentDao; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | |
| | | private static NettyServerHandler nettyServerHandler; |
| | | |
| | | /** |
| | | * 客户端连接会触发 |
| | | */ |
| | | @Override |
| | | public void channelActive(ChannelHandlerContext ctx) throws Exception { |
| | | log.info("Channel active......"); |
| | | } |
| | | |
| | | /** |
| | | * 客户端发消息会触发 |
| | | */ |
| | | @Override |
| | | public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { |
| | | MyTools myTools = new MyTools(); |
| | | log.info("服务器收到消息: {}", msg.toString()); |
| | | if (msg.toString().startsWith("4A1802")) { |
| | | myTools.writeToClient("404A021823", ctx, "状态包"); |
| | | } |
| | | if (msg.toString().startsWith("4A0C0134")) { |
| | | myTools.writeToClient("404A01" + DateUtils.getDateFormatString(new Date(), "HHmmss") + "23", ctx, "心跳包"); |
| | | } |
| | | if (msg.toString().startsWith("4A1803")) { |
| | | String serial = msg.toString().substring(14, 24); |
| | | myTools.writeToClient("404A03" + msg.toString().substring(msg.toString().length() - 2) + "23", ctx, "事件包"); |
| | | // ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm(); |
| | | // comPropertyAlarm.setCreateTime(DateUtil.date()); |
| | | // comPropertyAlarm.setSerialNo(serial); |
| | | // comPropertyAlarm.setType(ComPropertyAlarm.type.one); |
| | | // nettyServerHandler.comPropertyAlarmDao.insert(comPropertyAlarm); |
| | | if (msg.toString().startsWith("4A18031")) { |
| | | //正式处理 |
| | | // delayAlarm(serial); |
| | | //展会处理 |
| | | ComPropertyAlarm comPropertyAlarm = new ComPropertyAlarm(); |
| | | comPropertyAlarm.setCreateTime(DateUtil.date()); |
| | | comPropertyAlarm.setSerialNo(serial); |
| | | comPropertyAlarm.setType(ComPropertyAlarm.type.one); |
| | | nettyServerHandler.comPropertyAlarmDao.insert(comPropertyAlarm); |
| | | } |
| | | |
| | | } |
| | | ctx.flush(); |
| | | } |
| | | |
| | | /** |
| | | * 发生异常触发 |
| | | */ |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | cause.printStackTrace(); |
| | | ctx.close(); |
| | | } |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | nettyServerHandler = this; |
| | | nettyServerHandler.comPropertyAlarmDao = this.comPropertyAlarmDao; |
| | | nettyServerHandler.stringRedisTemplate = this.stringRedisTemplate; |
| | | nettyServerHandler.rabbitTemplate = this.rabbitTemplate; |
| | | } |
| | | |
| | | //报警事件包延迟处理方法 |
| | | private void delayAlarm(String serial) { |
| | | int duration = 0; |
| | | if (StringUtils.isNotEmpty(serial)) { |
| | | |
| | | ComPropertyEquipment comPropertyEquipment = new ComPropertyEquipment(); |
| | | if (nettyServerHandler.stringRedisTemplate.hasKey(serial)) { |
| | | comPropertyEquipment = JSONObject.parseObject(nettyServerHandler.stringRedisTemplate.boundValueOps(serial).get(), ComPropertyEquipment.class); |
| | | duration = getDuration(Objects.requireNonNull(comPropertyEquipment)); |
| | | nettyServerHandler.stringRedisTemplate.boundValueOps(serial).set(JSONObject.toJSONString(comPropertyEquipment), Duration.ofHours(duration)); |
| | | } else { |
| | | comPropertyEquipment = nettyServerHandler.comPropertyEquipmentDao.selectOne(new QueryWrapper<ComPropertyEquipment>().eq("serial_no", serial)); |
| | | duration = getDuration(comPropertyEquipment); |
| | | nettyServerHandler.stringRedisTemplate.boundValueOps(serial).set(JSONObject.toJSONString(comPropertyEquipment)); |
| | | } |
| | | int finalDuration = duration; |
| | | nettyServerHandler.rabbitTemplate.convertAndSend("delayed.exchange", "delayed.key", comPropertyEquipment, message -> { |
| | | message.getMessageProperties().setHeader("x-delay", finalDuration * 1000 * 3601); |
| | | return message; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | private int getDuration(ComPropertyEquipment comPropertyEquipment) { |
| | | int duration; |
| | | if (nettyServerHandler.stringRedisTemplate.hasKey(comPropertyEquipment.getCommunityId().toString())) { |
| | | duration = Integer.parseInt(nettyServerHandler.stringRedisTemplate.boundValueOps(comPropertyEquipment.getCommunityId().toString()).get()); |
| | | } else { |
| | | ComPropertyAlarmSetting comPropertyAlarmSetting = nettyServerHandler.comPropertyAlarmSettingDao.getByCommunityId(comPropertyEquipment.getCommunityId()); |
| | | duration = comPropertyAlarmSetting.getTriggerTime(); |
| | | nettyServerHandler.stringRedisTemplate.boundValueOps(comPropertyEquipment.getCommunityId().toString()).set(comPropertyAlarmSetting.getTriggerTime().toString()); |
| | | } |
| | | return duration; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.netty; |
| | | |
| | | import io.netty.channel.ChannelInitializer; |
| | | import io.netty.channel.socket.SocketChannel; |
| | | import io.netty.handler.codec.string.StringDecoder; |
| | | import io.netty.handler.codec.string.StringEncoder; |
| | | import io.netty.util.CharsetUtil; |
| | | |
| | | public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> { |
| | | @Override |
| | | protected void initChannel(SocketChannel socketChannel) throws Exception { |
| | | //添加编解码 |
| | | //socketChannel.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.UTF_8)); |
| | | socketChannel.pipeline().addLast(new MyDecoder()); |
| | | socketChannel.pipeline().addLast("encoder", new StringEncoder(CharsetUtil.UTF_8)); |
| | | socketChannel.pipeline().addLast(new NettyServerHandler()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | |
| | | /** |
| | | * (ComPropertyAlarm)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:49 |
| | | */ |
| | | public interface ComPropertyAlarmService extends IService<ComPropertyAlarm> { |
| | | /** |
| | | * 多条件查询报警列表 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | |
| | | /** |
| | | * 查询报警详情 |
| | | */ |
| | | R selectDetail(Integer id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarmSetting; |
| | | |
| | | /** |
| | | * (ComPropertyAlarmSetting)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-09 09:46:50 |
| | | */ |
| | | public interface ComPropertyAlarmSettingService extends IService<ComPropertyAlarmSetting> { |
| | | R pageList(CommonPage commonPage); |
| | | R getByCommunityId(Long communityId); |
| | | R insert(ComPropertyAlarmSetting comPropertyAlarmSetting); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | |
| | | /** |
| | | * (ComPropertyEquipment)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:32 |
| | | */ |
| | | public interface ComPropertyEquipmentService extends IService<ComPropertyEquipment> { |
| | | R pageList(CommonPage commonPage); |
| | | R insert(ComPropertyEquipment comPropertyEquipment); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyRepair; |
| | | |
| | | /** |
| | | * (ComPropertyRepair)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-02 10:12:10 |
| | | */ |
| | | public interface ComPropertyRepairService extends IService<ComPropertyRepair> { |
| | | /** |
| | | * 多条件查询维修列表 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | |
| | | /** |
| | | * 详情查询 |
| | | */ |
| | | R selectDetail(Integer id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarm; |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmDao; |
| | | import com.panzhihua.service_property.service.ComPropertyAlarmService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (ComPropertyAlarm)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:50 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPropertyAlarmServiceImpl extends ServiceImpl<ComPropertyAlarmDao, ComPropertyAlarm> implements ComPropertyAlarmService { |
| | | @Resource |
| | | private ComPropertyAlarmDao comPropertyAlarmDao; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | IPage<ComPropertyAlarmVO> page=comPropertyAlarmDao.selectList(new Page(commonPage.getPage(), commonPage.getSize()),commonPage); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Override |
| | | public R selectDetail(Integer id) { |
| | | return R.ok(comPropertyAlarmDao.selectById(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyAlarmSetting; |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao; |
| | | import com.panzhihua.service_property.service.ComPropertyAlarmSettingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (ComPropertyAlarmSetting)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-09 09:46:50 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPropertyAlarmSettingServiceImpl extends ServiceImpl<ComPropertyAlarmSettingDao, ComPropertyAlarmSetting> implements ComPropertyAlarmSettingService { |
| | | @Resource |
| | | private ComPropertyAlarmSettingDao comPropertyAlarmSettingDao; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R getByCommunityId(Long communityId) { |
| | | return R.ok(comPropertyAlarmSettingDao.getByCommunityId(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R insert(ComPropertyAlarmSetting comPropertyAlarmSetting) { |
| | | boolean result=this.saveOrUpdate(comPropertyAlarmSetting); |
| | | if(result){ |
| | | if(stringRedisTemplate.hasKey(comPropertyAlarmSetting.getCommunityId().toString())){ |
| | | stringRedisTemplate.boundValueOps(comPropertyAlarmSetting.getCommunityId().toString()).set(comPropertyAlarmSetting.getTriggerTime().toString()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | return R.fail(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_property.entity.ComPropertyEquipment; |
| | | import com.panzhihua.service_property.dao.ComPropertyEquipmentDao; |
| | | import com.panzhihua.service_property.service.ComPropertyEquipmentService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyEquipment)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-07 13:29:32 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPropertyEquipmentServiceImpl extends ServiceImpl<ComPropertyEquipmentDao, ComPropertyEquipment> implements ComPropertyEquipmentService { |
| | | @Resource |
| | | private ComPropertyEquipmentDao comPropertyEquipmentDao; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | IPage<ComPropertyEquipment> page=comPropertyEquipmentDao.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Override |
| | | public R insert(ComPropertyEquipment comPropertyEquipment) { |
| | | if(comPropertyEquipment!=null){ |
| | | List<ComPropertyEquipment> comPropertyEquipmentList=comPropertyEquipmentDao.selectList(new QueryWrapper<ComPropertyEquipment>().eq("serial_no",comPropertyEquipment.getSerialNo())); |
| | | if(comPropertyEquipmentList.isEmpty()){ |
| | | return R.ok(this.save(comPropertyEquipment)); |
| | | } |
| | | return R.fail("设备编号不能重复"); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.service_property.entity.ComPropertyRepair; |
| | | import com.panzhihua.service_property.dao.ComPropertyRepairDao; |
| | | import com.panzhihua.service_property.service.ComPropertyRepairService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComPropertyRepair)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-02 10:12:11 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPropertyRepairServiceImpl extends ServiceImpl<ComPropertyRepairDao, ComPropertyRepair> implements ComPropertyRepairService { |
| | | @Resource |
| | | private ComPropertyRepairDao comPropertyRepairDao; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | IPage<ComPropertyRepairVO> list=comPropertyRepairDao.pageList(new Page(commonPage.getPage(), commonPage.getSize()),commonPage); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @Override |
| | | public R selectDetail(Integer id) { |
| | | return R.ok(comPropertyRepairDao.selectDetail(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_property.util; |
| | | |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.ChannelFuture; |
| | | import io.netty.channel.ChannelFutureListener; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class MyTools { |
| | | |
| | | //十六进制字符转十进制 |
| | | public int covert(String content){ |
| | | int number=0; |
| | | String [] HighLetter = {"A","B","C","D","E","F"}; |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | for(int i = 0;i <= 9;i++){ |
| | | map.put(i+"",i); |
| | | } |
| | | for(int j= 10;j<HighLetter.length+10;j++){ |
| | | map.put(HighLetter[j-10],j); |
| | | } |
| | | String[]str = new String[content.length()]; |
| | | for(int i = 0; i < str.length; i++){ |
| | | str[i] = content.substring(i,i+1); |
| | | } |
| | | for(int i = 0; i < str.length; i++){ |
| | | number += map.get(str[i])*Math.pow(16,str.length-1-i); |
| | | } |
| | | return number; |
| | | } |
| | | |
| | | public byte[] hexString2Bytes(String src) { |
| | | int l = src.length() / 2; |
| | | byte[] ret = new byte[l]; |
| | | for (int i = 0; i < l; i++) { |
| | | ret[i] = (byte) Integer |
| | | .valueOf(src.substring(i * 2, i * 2 + 2), 16).byteValue(); |
| | | } |
| | | return ret; |
| | | } |
| | | |
| | | public void writeToClient(final String receiveStr, ChannelHandlerContext channel, final String mark) { |
| | | try { |
| | | ByteBuf bufff = Unpooled.buffer();//netty需要用ByteBuf传输 |
| | | bufff.writeBytes(hexString2Bytes(receiveStr));//对接需要16进制 |
| | | channel.writeAndFlush(bufff).addListener(new ChannelFutureListener() { |
| | | @Override |
| | | public void operationComplete(ChannelFuture future) throws Exception { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if(!StringUtils.isEmpty(mark)){ |
| | | sb.append("【").append(mark).append("】"); |
| | | } |
| | | if (future.isSuccess()) { |
| | | System.out.println(sb+"回写成功"+receiveStr); |
| | | |
| | | } else { |
| | | System.out.println(sb+"回写失败"+receiveStr); |
| | | } |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | System.out.println("调用通用writeToClient()异常"+e.getMessage()); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | spring: |
| | | application: |
| | | name: property |
| | | cloud: |
| | | config: |
| | | discovery: |
| | | enabled: true |
| | | service-id: config # 注册中心的服务名 |
| | | profile: ${ENV:dev} # 指定配置文件的环境 |
| | | uri: http://${CONFIG_URL:localhost}:8193/ |
| | | profiles: |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: |
| | | defaultZone: http://${EUREKA_URL:localhost}:8192/eureka |
| | | |
| | | #实体加密、解密、字段脱敏拦截设置 |
| | | domain: |
| | | decrypt: true |
| | | encrypt: true |
| | | aesKey: Ryo7M3n8loC5 |
| | | sensitive: true |
| | | |
| | | management: |
| | | endpoints: |
| | | web: |
| | | exposure: |
| | | include: '*' |
| | | |
| | | endpoint: |
| | | health: |
| | | show-details: always |
| | | |
| | | metrics: |
| | | tags: |
| | | application: property |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration debug="false"> |
| | | <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> |
| | | <springProfile name="dev"> |
| | | <property name="LOG_HOME" value="F:/log" /> |
| | | </springProfile> |
| | | <springProfile name="test"> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | </springProfile> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | <!-- 控制台输出 --> |
| | | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | </appender> |
| | | <!-- 按照每天生成日志文件 --> |
| | | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!--日志文件输出的文件名--> |
| | | <FileNamePattern>${LOG_HOME}/service_property.log.%d{yyyy-MM-dd}.log</FileNamePattern> |
| | | <!--日志文件保留天数--> |
| | | <MaxHistory>30</MaxHistory> |
| | | </rollingPolicy> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | <!--日志文件最大的大小--> |
| | | <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
| | | <MaxFileSize>10MB</MaxFileSize> |
| | | </triggeringPolicy> |
| | | </appender> |
| | | |
| | | <!--myibatis log configure--> |
| | | <logger name="com.apache.ibatis" level="TRACE"/> |
| | | <logger name="java.sql.Connection" level="DEBUG"/> |
| | | <logger name="java.sql.Statement" level="DEBUG"/> |
| | | <logger name="java.sql.PreparedStatement" level="DEBUG"/> |
| | | <logger name="com.panzhihua.service_property" level="DEBUG"/> |
| | | |
| | | <!-- 日志输出级别 --> |
| | | <root level="DEBUG"> |
| | | <appender-ref ref="STDOUT" /> |
| | | </root> |
| | | <root level="INFO"> |
| | | <appender-ref ref="STDOUT" /> |
| | | <appender-ref ref="FILE" /> |
| | | </root> |
| | | </configuration> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_property.dao.ComPropertyAlarmDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_property.entity.ComPropertyAlarm" id="ComPropertyAlarmBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="serialNo" column="serial_no"/> |
| | | <result property="type" column="type"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="name" column="name"/> |
| | | <result property="status" column="status"/> |
| | | <result property="solveId" column="solve_id"/> |
| | | <result property="solveTime" column="solve_time"/> |
| | | <result property="solveContent" column="solve_content"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="solveUrl" column="solve_url"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectList" resultType="com.panzhihua.common.model.vos.property.ComPropertyAlarmVO"> |
| | | select t.*,t1.position,t2.name as solveName from com_property_Alarm t |
| | | left join com_property_equipment t1 on t.serial_no = t1.serial_no |
| | | left join sys_user t2 on t.solve_id = user_id |
| | | <where> |
| | | 1=1 |
| | | <if test="commonPage.paramId !=null"> |
| | | and t.community_id =#{commonPage.paramId} |
| | | </if> |
| | | <if test="commonPage.type !=null"> |
| | | and t.type =#{commonPage.type} |
| | | </if> |
| | | <if test="commonPage.status !=null"> |
| | | and t.status =#{commonPage.status} |
| | | </if> |
| | | <if test="commonPage.address !=null and commonPage.address !=''"> |
| | | and t1.position like concat(#{commonPage.address},'%') |
| | | </if> |
| | | <if test="commonPage.username !=null and commonPage.username !=''"> |
| | | and t.name like concat(#{commonPage.username},'%') |
| | | </if> |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.create_time >=#{commonPage.beginTime} |
| | | </if> |
| | | <if test="commonPage.statusBeginTime !=null"> |
| | | and t.solve_time >=#{commonPage.statusBeginTime} |
| | | </if> |
| | | <if test="commonPage.endTime !=null"> |
| | | and #{commonPage.endTime} >=t.create_time |
| | | </if> |
| | | <if test="commonPage.statusEndTime !=null"> |
| | | and #{commonPage.statusEndTime} >=t.solve_time |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectById" resultType="com.panzhihua.common.model.vos.property.ComPropertyAlarmVO"> |
| | | select t.*, t1.position, t2.name as solveName |
| | | from com_property_Alarm t |
| | | left join com_property_equipment t1 on t.serial_no = t1.serial_no |
| | | left join sys_user t2 on t.solve_id = user_id |
| | | where t.id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_property.entity.ComPropertyAlarmSetting" |
| | | id="ComPropertyAlarmSettingBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="triggerTime" column="trigger_time"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="getByCommunityId" resultMap="ComPropertyAlarmSettingBaseResultMap"> |
| | | select * from com_property_alarm_setting where community_id =#{community_id} order by create_time desc limit 1 |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_property.dao.ComPropertyEquipmentDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_property.entity.ComPropertyEquipment" id="ComPropertyEquipmentBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="serialNo" column="serial_no"/> |
| | | <result property="position" column="position"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="longitude" column="longitude"/> |
| | | <result property="latitude" column="latitude"/> |
| | | <result property="name" column="name"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="type" column="type"/> |
| | | <result property="username" column="username"/> |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultMap="ComPropertyEquipmentBaseResultMap"> |
| | | select * from com_property_equipment |
| | | <where> |
| | | 1=1 |
| | | <if test="commonPage.type!=null"> |
| | | and type =#{commonPage.type} |
| | | </if> |
| | | <if test="commonPage.name!=null and commonPage.name!=''"> |
| | | and name like concat(#{commonPage.name},'%') |
| | | </if> |
| | | <if test="commonPage.serialNo!=null and commonPage.serialNo!=''"> |
| | | and serial_no like concat(#{commonPage.serialNo},'%') |
| | | </if> |
| | | <if test="commonPage.address!=null and commonPage.address!=''"> |
| | | and position like concat(#{commonPage.address},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_property.dao.ComPropertyRepairDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_property.entity.ComPropertyRepair" id="ComPropertyRepairBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="repairContent" column="repair_content"/> |
| | | <result property="repairName" column="repair_name"/> |
| | | <result property="repairPhone" column="repair_phone"/> |
| | | <result property="repairPosition" column="repair_position"/> |
| | | <result property="repairStatus" column="repair_status"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="repairUrl" column="repair_url"/> |
| | | <result property="replyContent" column="reply_content"/> |
| | | <result property="replyUrl" column="reply_url"/> |
| | | <result property="replyTime" column="reply_time"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="feedbackBy" column="feedback_by"/> |
| | | <result property="feedbackContent" column="feedback_content"/> |
| | | <result property="feedbackUrl" column="feedback_url"/> |
| | | <result property="feedbackTime" column="feedback_time"/> |
| | | <result property="replyScore" column="reply_score"/> |
| | | <result property="propertyId" column="property_id"/> |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.property.ComPropertyRepairVO" parameterType="com.panzhihua.common.model.dtos.property.CommonPage"> |
| | | select t.*,t1.name as feedback from com_property_repair t left join sys_user t1 on t.feedback_by = t1.user_id |
| | | <where> |
| | | 1=1 |
| | | <if test="commonPage.status !=null"> |
| | | and t.repair_status =#{commonPage.status} |
| | | </if> |
| | | <if test="commonPage.username !=null and commonPage.username.trim() !=''"> |
| | | and t.repair_name like concat(#{commonPage.username},'%') |
| | | </if> |
| | | <if test="commonPage.phone !=null and commonPage.phone.trim() !=''"> |
| | | and t.repair_phone like concat(#{commonPage.phone},'%') |
| | | </if> |
| | | <if test="commonPage.address !=null and commonPage.address.trim() !=''"> |
| | | and t.repair_position like concat(#{commonPage.address},'%') |
| | | </if> |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.create_time >=#{commonPage.beginTime} |
| | | </if> |
| | | <if test="commonPage.endTime !=null"> |
| | | and #{commonPage.endTime} >=t.create_time |
| | | </if> |
| | | <if test="commonPage.systemName !=null and commonPage.systemName.trim() !=''"> |
| | | and t1.name like concat(#{commonPage.systemName},'%') |
| | | </if> |
| | | <if test="commonPage.paramId !=null"> |
| | | and t.property_id =#{commonPage.paramId} |
| | | </if> |
| | | <if test="commonPage.userId !=null"> |
| | | and t.create_by =#{commonPage.userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectDetail" resultType="com.panzhihua.common.model.vos.property.ComPropertyRepairVO"> |
| | | select t.*,t1.name as feedback from com_property_repair t left join sys_user t1 on t.feedback_by = t1.user_id where t.id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | IPage<AdministratorsUserVO> pageUserBackstage(Page page, |
| | | @Param("administratorsUserVO") AdministratorsUserVO administratorsUserVO); |
| | | |
| | | @Select("<script> " + "select \n" + "u.user_id,\n" + "u.phone,\n" + "u.nick_name,\n" + "u.name,\n" |
| | | @Select("<script> " + "select \n" + "u.user_id,\n" + "u.phone,\n" + "u.nick_name,\n" + "u.name,\n" + "u.tags,\n" |
| | | + "a.name communityName,\n" + "u.status,\n" + "u.create_at,\n" + "u.last_login_time\n" + "from sys_user u\n" |
| | | + "left join com_act a on u.community_id=a.community_id\n" + " where\n" |
| | | + "u.type=1 and u.community_id is not null \n" |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | // record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone())); |
| | | record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard())); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (record.getIsPartymember().equals(1)) { |
| | | sb.append("党员,"); |
| | | } |
| | | if (record.getIsVolunteer().equals(1)) { |
| | | sb.append("志愿者,"); |
| | | } |
| | | String tag = sb.toString(); |
| | | if (tag.length() > 0) { |
| | | record.setTags(tag.substring(0, tag.length() - 1)); |
| | | } else { |
| | | record.setTags("无"); |
| | | if (StringUtils.isNotEmpty(record.getTags())) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(record.getTags() + ","); |
| | | if (record.getIsPartymember().equals(1)) { |
| | | if (!sb.toString().contains("党员")){ |
| | | sb.append("党员,"); |
| | | } |
| | | } |
| | | if (record.getIsVolunteer().equals(1)) { |
| | | if (!sb.toString().contains("志愿者")) { |
| | | sb.append("志愿者,"); |
| | | } |
| | | } |
| | | String tags = sb.toString(); |
| | | record.setTags(tags.substring(0, tags.length() - 1)); |
| | | }else { |
| | | StringBuffer sb = new StringBuffer(); |
| | | if (record.getIsPartymember().equals(1)) { |
| | | sb.append("党员,"); |
| | | } |
| | | if (record.getIsVolunteer().equals(1)) { |
| | | sb.append("志愿者,"); |
| | | } |
| | | String tags = sb.toString(); |
| | | if (tags.length() > 0) { |
| | | record.setTags(tags.substring(0, tags.length() - 1)); |
| | | } else { |
| | | record.setTags("无"); |
| | | } |
| | | } |
| | | }); |
| | | return R.ok(iPage); |
| | |
| | | public R putUserTag(LoginUserInfoVO loginUserInfoVO) { |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setUserId(loginUserInfoVO.getUserId()); |
| | | sysUserDO.setTags(loginUserInfoVO.getTags()); |
| | | if (StringUtils.isNotEmpty(loginUserInfoVO.getTags()) && !"无".equals(loginUserInfoVO.getTags())) { |
| | | sysUserDO.setTags(loginUserInfoVO.getTags()); |
| | | } |
| | | int update = userDao.putUserTag(sysUserDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | |
| | | log.info("执行结果【{}】", r1.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 定时任务每月1号0点统计高龄老人本期应该认证总人数 |
| | | */ |
| | | @XxlJob("timedTaskElderAuthStatisticsJobHandler") |
| | | public ReturnT<String> timedTaskElderAuthStatisticsJobHandler(String param) { |
| | | log.info("定时任务每月1号0点统计高龄老人本期应该认证总人数"); |
| | | R r = communityService.timedTaskElderAuthStatisticsJobHandler(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 定时任务每年3月1号0点统计养老认证本期应该认证总人数 |
| | | */ |
| | | @XxlJob("timedTaskPensionAuthStatisticsJobHandler") |
| | | public ReturnT<String> timedTaskPensionAuthStatisticsJobHandler(String param) { |
| | | log.info("定时任务每年3月1号0点统计养老认证本期应该认证总人数"); |
| | | R r = communityService.timedTaskPensionAuthStatisticsJobHandler(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |