Merge branch 'test' into 'master'
Test
See merge request root/zhihuishequ!170
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | <!--minio文件存储--> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | <version>6.0.8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
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); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveDetailVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationDetailVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation("详情") |
| | | @ApiOperation(value = "详情",response = ComActReserveDetailVO.class) |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("recordId") Long recordId,@RequestParam("isBack") Integer isBack){ |
| | | return communityService.reserveDetail(id,this.getUserId(),recordId,isBack); |
| | |
| | | * @param pageUserReserveDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation("我的预约/登记") |
| | | @ApiOperation(value = "我的预约/登记",response = ComActReserveAppletsVO.class) |
| | | @PostMapping("/userReserveList") |
| | | public R userReserveList(@RequestBody PageUserReserveDTO pageUserReserveDTO){ |
| | | pageUserReserveDTO.setUserId(this.getUserId()); |
| | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @ApiOperation("预约详情操作记录") |
| | | @ApiOperation(value = "预约详情操作记录",response = ComOperationDetailVO.class) |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | comActReserveOperationRecordDO.setUserId(this.getUserId()); |
| | | return communityService.reserveOperation(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | @ApiOperation("预约登记列表") |
| | | @ApiOperation(value = "预约登记列表",response = ComActReserveIndexVo.class) |
| | | @GetMapping("/list") |
| | | public R list(@RequestParam("communityId") Long communityId){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.applets.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | public static void main(String[] args) { |
| | | // int nextInt = RandomUtils.nextInt(99999, 1000000); |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "发送验证码") |
| | | @PostMapping(value = "smscode") |
| | | public R smscode(@RequestBody UserPhoneVO userPhoneVO) { |
| | |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailActivity(id, userId); |
| | | return communityService.detailActivity(id, userId,null,null); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class) |
| | |
| | | signactivityVO.setUserId(userId); |
| | | R r = communityService.signActivity(signactivityVO); |
| | | if (R.isOk(r) && signactivityVO.getType().intValue() == 1) { |
| | | R r2 = communityService.detailActivity(activityId, userId); |
| | | R r2 = communityService.detailActivity(activityId, userId,null,null); |
| | | ComActActivityVO comActActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | }else{ |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","2"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","1"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | }else{ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
New file |
| | |
| | | package com.panzhihua.applets.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio存储信息配置 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Data |
| | | @ConfigurationProperties(prefix = "minio") |
| | | public class MinioConfig { |
| | | |
| | | private String host; |
| | | |
| | | private String accessKey; |
| | | |
| | | private String secretKey; |
| | | |
| | | private String url; |
| | | |
| | | private String bucket; |
| | | |
| | | private String aliasName; |
| | | |
| | | private String aliasPCName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.minio.ObjectStat; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio工具类 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Component |
| | | @EnableConfigurationProperties(MinioConfig.class) |
| | | public class MinioUtil { |
| | | |
| | | @Resource |
| | | private MinioConfig minioProperties; |
| | | |
| | | public static byte[] toByteArray(InputStream input) throws IOException { |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[4096]; |
| | | int n = 0; |
| | | while (-1 != (n = input.read(buffer))) { |
| | | output.write(buffer, 0, n); |
| | | } |
| | | return output.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 文件上传 |
| | | * |
| | | * @param file |
| | | * 要上传的文件 |
| | | * @return |
| | | */ |
| | | public String upload(MultipartFile file, String name) { |
| | | if (null != file) { |
| | | try { |
| | | UUID uuid = UUID.randomUUID(); |
| | | StringBuilder s = new StringBuilder(); |
| | | s.append(uuid.toString().replace("-", "")).append("/"); |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | // bucket 不存在,创建 |
| | | if (!minioClient.bucketExists(minioProperties.getBucket())) { |
| | | minioClient.makeBucket(minioProperties.getBucket()); |
| | | } |
| | | // 得到文件流 |
| | | InputStream input = file.getInputStream(); |
| | | // 文件名 |
| | | // String fileName = uuid + "/images." + FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String fileName = s.append(name).toString(); |
| | | String contentType = file.getContentType(); |
| | | minioClient.putObject(minioProperties.getBucket(), fileName, input, contentType); |
| | | StringBuilder fileUrl = new StringBuilder(minioProperties.getUrl()); |
| | | String url = fileUrl.append(fileName).toString(); |
| | | return url; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public void download(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | ObjectStat stat = minioClient.statObject(minioProperties.getBucket(), fileName); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | response.setContentType(stat.contentType()); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
| | | IOUtils.copy(inputStream, response.getOutputStream()); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public byte[] getBytes(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | byte[] bytes = new byte[0]; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | bytes = toByteArray(inputStream); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return bytes; |
| | | } |
| | | } |
| | |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | max-file-size: 200MB |
| | | max-request-size: 200MB |
| | | |
| | | server: |
| | | max-http-header-size: 10MB |
| | |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--minio文件存储--> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | <version>6.0.8</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.applets_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | @ApiOperation("新增广告") |
| | | @PostMapping("advertisement") |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "删除广告") |
| | | @DeleteMapping("advertisement") |
| | | public R deleteAdvertisement(@RequestParam("id") Long id) { |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.applets_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | @Value("${excel.convenientUrl}") |
| | | private String excelConvenientUrl = "http://panzhihua.nhys.cdnhxx.com/web/bianminfuwudaoru.xlsx"; |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/upload/files", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入便民服务") |
| | | @PostMapping(value = "/serve/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
New file |
| | |
| | | package com.panzhihua.applets_backstage.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio存储信息配置 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Data |
| | | @ConfigurationProperties(prefix = "minio") |
| | | public class MinioConfig { |
| | | |
| | | private String host; |
| | | |
| | | private String accessKey; |
| | | |
| | | private String secretKey; |
| | | |
| | | private String url; |
| | | |
| | | private String bucket; |
| | | |
| | | private String aliasName; |
| | | |
| | | private String aliasPCName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets_backstage.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.minio.ObjectStat; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio工具类 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Component |
| | | @EnableConfigurationProperties(MinioConfig.class) |
| | | public class MinioUtil { |
| | | |
| | | @Resource |
| | | private MinioConfig minioProperties; |
| | | |
| | | public static byte[] toByteArray(InputStream input) throws IOException { |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[4096]; |
| | | int n = 0; |
| | | while (-1 != (n = input.read(buffer))) { |
| | | output.write(buffer, 0, n); |
| | | } |
| | | return output.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 文件上传 |
| | | * |
| | | * @param file |
| | | * 要上传的文件 |
| | | * @return |
| | | */ |
| | | public String upload(MultipartFile file, String name) { |
| | | if (null != file) { |
| | | try { |
| | | UUID uuid = UUID.randomUUID(); |
| | | StringBuilder s = new StringBuilder(); |
| | | s.append(uuid.toString().replace("-", "")).append("/"); |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | // bucket 不存在,创建 |
| | | if (!minioClient.bucketExists(minioProperties.getBucket())) { |
| | | minioClient.makeBucket(minioProperties.getBucket()); |
| | | } |
| | | // 得到文件流 |
| | | InputStream input = file.getInputStream(); |
| | | // 文件名 |
| | | // String fileName = uuid + "/images." + FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String fileName = s.append(name).toString(); |
| | | String contentType = file.getContentType(); |
| | | minioClient.putObject(minioProperties.getBucket(), fileName, input, contentType); |
| | | StringBuilder fileUrl = new StringBuilder(minioProperties.getUrl()); |
| | | String url = fileUrl.append(fileName).toString(); |
| | | return url; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public void download(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | ObjectStat stat = minioClient.statObject(minioProperties.getBucket(), fileName); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | response.setContentType(stat.contentType()); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
| | | IOUtils.copy(inputStream, response.getOutputStream()); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public byte[] getBytes(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | byte[] bytes = new byte[0]; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | bytes = toByteArray(inputStream); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return bytes; |
| | | } |
| | | } |
| | |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | max-file-size: 200MB |
| | | max-request-size: 200MB |
| | | |
| | | eureka: |
| | | client: |
| | |
| | | * 获取token |
| | | */ |
| | | public static final String GRID_GET_TOKEN_URL = |
| | | "http://171.217.92.33:53303/aaToken?username=#username&password=#password"; |
| | | "/aaToken?username=#username&password=#password"; |
| | | /** |
| | | * 提交事件登记(自处) |
| | | */ |
| | | public static final String GRID_REGIST_EVENT_URL = "http://171.217.92.33:53303/businessData/registEventInfo"; |
| | | public static final String GRID_REGIST_EVENT_URL = "/businessData/registEventInfo"; |
| | | /** |
| | | * 上传附件,仅上传文件流,服务器根据文件名自行匹配 |
| | | */ |
| | | public static final String GRID_EVENT_FILE_UPLOAD_URL = "http://171.217.92.33:53303/businessData/upload"; |
| | | public static final String GRID_EVENT_FILE_UPLOAD_URL = "/businessData/upload"; |
| | | /** |
| | | * 事件类型获取 |
| | | */ |
| | | public static final String GRID_EVENT_CATEGORY_URL = "http://171.217.92.33:53303/businessData/getEventType"; |
| | | public static final String GRID_EVENT_CATEGORY_URL = "/businessData/getEventType"; |
| | | /** |
| | | * 事件查询接口 |
| | | */ |
| | | public static final String GRID_EVENT_INFO_URL = "http://171.217.92.33:53303/businessData/getEventListInfo"; |
| | | public static final String GRID_EVENT_INFO_URL = "/businessData/getEventListInfo"; |
| | | /** |
| | | * 获取指定APP登记事件详情信息 |
| | | */ |
| | | public static final String GRID_EVENT_INFO_DETAIL_URL = "http://171.217.92.33:53303/businessData/getEventDetails"; |
| | | public static final String GRID_EVENT_INFO_DETAIL_URL = "/businessData/getEventDetails"; |
| | | /** |
| | | * 获取指定事件信息 |
| | | */ |
| | | public static final String GRID_APP_EVENT_INFO_DETAIL_URL = |
| | | "http://171.217.92.33:53303/businessData/getAppointEventInfo"; |
| | | "/businessData/getAppointEventInfo"; |
| | | /** |
| | | * 通过AREAID获取辖区网格树 |
| | | */ |
| | | public static final String GRID_GET_EVENT_INFO_AREA_ID_URL = |
| | | "http://171.217.92.33:53303/area/getAreaGridTreeByAreaId"; |
| | | "/area/getAreaGridTreeByAreaId"; |
| | | /** |
| | | * 通过AREAID获取辖区网格数据列表 |
| | | */ |
| | | public static final String GRID_GET_GRID_DATA_AREA_ID_URL = |
| | | "http://171.217.92.33:53303/gridDefined/getGridInfoByAreaId"; |
| | | "/gridDefined/getGridInfoByAreaId"; |
| | | /** |
| | | * 获取所有或者根据姓名和工号查询,分页 |
| | | */ |
| | | public static final String GRID_GET_GETALL_SEARCH_PAGE_URL = |
| | | "http://171.217.92.33:53303/gridOperator/getAllOrSearchByPage?areaId=jhRxqEQp"; |
| | | "/gridOperator/getAllOrSearchByPage?areaId=jhRxqEQp"; |
| | | /** |
| | | * 流动人口 走访记录列表 |
| | | */ |
| | | public static final String VISIT_RECORD_FLOW_PERSON_PAGE_URL = |
| | | "http://171.217.92.33:53303/businessData/getFPVisitRecordByPageApp"; |
| | | "/businessData/getFPVisitRecordByPageApp"; |
| | | |
| | | /** |
| | | * 下面的接口全部都是走访任务接口 |
| | |
| | | * 流动人口 走访详情(民警带领下工作或者自己走访) |
| | | */ |
| | | public static final String VISIT_RECORD_FLOW_PERSON_DETAIL_URL = |
| | | "http://171.217.92.33:53303/businessData/getFPVisitRecordDetailByIdApp"; |
| | | "/businessData/getFPVisitRecordDetailByIdApp"; |
| | | /** |
| | | * 流动人口 添加走访记录 (民警带领下工作或者自己走访) |
| | | */ |
| | | public static final String VISIT_RECORD_FLOW_PERSON_SAVE_URL = |
| | | "http://171.217.92.33:53303/businessData/saveFpVisitRecordAppDock"; |
| | | "/businessData/saveFpVisitRecordAppDock"; |
| | | /** |
| | | * 重点人员 日常管理 走访记录列表 |
| | | */ |
| | | public static final String VISIT_RECORD_KEY_PERSON_PAGE_URL = |
| | | "http://171.217.92.33:53303/businessData/getKeyPersonVisitRecordByPageApp"; |
| | | "/businessData/getKeyPersonVisitRecordByPageApp"; |
| | | /** |
| | | * 重点人员 日常管理 走访详情 |
| | | */ |
| | | public static final String VISIT_RECORD_KEY_PERSON_DETAIL_URL = |
| | | "http://171.217.92.33:53303/businessData/getKeyPersonVisitRecordDetailByIdApp"; |
| | | "/businessData/getKeyPersonVisitRecordDetailByIdApp"; |
| | | /** |
| | | * 重点人员 日常管理 添加走访记录 |
| | | */ |
| | | public static final String VISIT_RECORD_KEY_PERSON_SAVE_REMOTE_URL = |
| | | "http://171.217.92.33:53303/businessData/saveKeyPersonVisitRecordAppDock"; |
| | | "/businessData/saveKeyPersonVisitRecordAppDock"; |
| | | |
| | | private LcApiConstants() { |
| | | throw new IllegalStateException("Utility class"); |
| | |
| | | |
| | | 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 |
| | | */ |
| | |
| | | |
| | | /** text/xml */ |
| | | public static final String TEXT_XML = "text/xml"; |
| | | |
| | | /** 内江服务进出记录查询接口 */ |
| | | public static final String NEIJIANG_URL = "https://mzj.scnjdx.gov.cn/proxy/comActCameraRecord/queryAll"; |
| | | |
| | | /** 测试服务报警记录查询接口 */ |
| | | public static final String CALL_THE_POLICE_URL = "http://test.panzhihua.nhys.cdnhxx.com/api/communitybackstage/comPropertyAlarm/queryAll/noToken"; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | private List<ComActActEvaluateVO> comActActEvaluateVOList; |
| | | |
| | | @ApiModelProperty("活动评价总数") |
| | | private Integer evaluateAmount; |
| | | private Long evaluateAmount; |
| | | |
| | | @ApiModelProperty("活动评分星级平均数") |
| | | private Double evaluateLevel; |
| | |
| | | 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 { |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @author lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记信息 |
| | | */ |
| | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date publishTime; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | /** |
| | |
| | | * 操作记录 |
| | | */ |
| | | private List<ComOperationListVO> operationList; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Integer isBoutique; |
| | | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("最后回复时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date replyAt; |
| | | |
| | | @ApiModelProperty("邻里圈评论列表") |
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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.redis; |
| | | |
| | | import java.time.Duration; |
| | | |
| | | import org.springframework.cache.CacheManager; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.cache.RedisCacheConfiguration; |
| | | import org.springframework.data.redis.cache.RedisCacheManager; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
| | | import org.springframework.data.redis.serializer.RedisSerializationContext; |
| | | import org.springframework.data.redis.serializer.RedisSerializer; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.PropertyAccessor; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 缓存配置类 |
| | | * |
| | | * @author manailin Date 2021-08-27 15:30 |
| | | **/ |
| | | @Configuration |
| | | public class CacheConfig { |
| | | |
| | | private Duration timeToLive = Duration.ofHours(1); |
| | | |
| | | @Bean |
| | | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
| | | RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>(); |
| | | redisTemplate.setConnectionFactory(redisConnectionFactory); |
| | | |
| | | // 使用Jackson2JsonRedisSerialize 替换默认序列化 |
| | | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
| | | objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); |
| | | |
| | | jackson2JsonRedisSerializer.setObjectMapper(objectMapper); |
| | | |
| | | // 设置value的序列化规则和 key的序列化规则 |
| | | redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); |
| | | redisTemplate.setKeySerializer(new StringRedisSerializer()); |
| | | redisTemplate.afterPropertiesSet(); |
| | | return redisTemplate; |
| | | } |
| | | |
| | | @Bean |
| | | public CacheManager cacheManager(RedisConnectionFactory factory) { |
| | | RedisSerializer<String> redisSerializer = new StringRedisSerializer(); |
| | | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); |
| | | |
| | | // 解决查询缓存转换异常的问题 |
| | | ObjectMapper om = new ObjectMapper(); |
| | | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
| | | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); |
| | | jackson2JsonRedisSerializer.setObjectMapper(om); |
| | | |
| | | // 配置序列化(解决乱码的问题) |
| | | RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(timeToLive) |
| | | .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) |
| | | .serializeValuesWith( |
| | | RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer)) |
| | | .disableCachingNullValues(); |
| | | RedisCacheManager cacheManager = RedisCacheManager.builder(factory).cacheDefaults(config).build(); |
| | | |
| | | return cacheManager; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.redis; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.*; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 攀枝花智慧社区项目 |
| | | * <p> |
| | | * redis 操作工具类 |
| | | * <p> |
| | | * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. |
| | | * <p> |
| | | * Company: 成都呐喊信息技术有限公司 |
| | | * <p> |
| | | * |
| | | * @author manailin |
| | | * @since 2021/8/27 8:58 |
| | | */ |
| | | @Component |
| | | public class RedisUtils { |
| | | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 写入缓存 |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public boolean set(final String key, Object value) { |
| | | boolean result = false; |
| | | try { |
| | | ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); |
| | | operations.set(key, value); |
| | | result = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 写入缓存设置时效时间 |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public boolean set(final String key, Object value, Long expireTime) { |
| | | boolean result = false; |
| | | try { |
| | | ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); |
| | | operations.set(key, value); |
| | | redisTemplate.expire(key, expireTime, TimeUnit.SECONDS); |
| | | result = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除对应的value |
| | | * |
| | | * @param keys |
| | | */ |
| | | public void remove(final String... keys) { |
| | | for (String key : keys) { |
| | | remove(key); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量删除对应的value (带事务,业务代码中用到事务,则需用此方法) |
| | | * |
| | | * @param keys |
| | | */ |
| | | public void removeTransactional(final String... keys) { |
| | | for (String key : keys) { |
| | | removeTransactional(key); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量删除key |
| | | * |
| | | * @param pattern |
| | | */ |
| | | public void removePattern(final String pattern) { |
| | | Set<Serializable> keys = redisTemplate.keys(pattern); |
| | | if (keys.size() > 0) { |
| | | redisTemplate.delete(keys); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除对应的value |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(final String key) { |
| | | if (exists(key)) { |
| | | redisTemplate.delete(key); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断缓存中是否有对应的value |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public boolean exists(final String key) { |
| | | return redisTemplate.hasKey(key); |
| | | } |
| | | |
| | | /** |
| | | * 读取缓存 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public Object get(final String key) { |
| | | ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); |
| | | return operations.get(key); |
| | | } |
| | | |
| | | /** |
| | | * 哈希 添加 |
| | | * |
| | | * @param key |
| | | * @param hashKey |
| | | * @param value |
| | | */ |
| | | public void hmSet(String key, Object hashKey, Object value) { |
| | | HashOperations<String, Object, Object> hash = redisTemplate.opsForHash(); |
| | | hash.put(key, hashKey, value); |
| | | } |
| | | |
| | | /** |
| | | * 哈希获取数据 |
| | | * |
| | | * @param key |
| | | * @param hashKey |
| | | * @return |
| | | */ |
| | | public Object hmGet(String key, Object hashKey) { |
| | | HashOperations<String, Object, Object> hash = redisTemplate.opsForHash(); |
| | | return hash.get(key, hashKey); |
| | | } |
| | | |
| | | /** |
| | | * 列表添加 |
| | | * |
| | | * @param k |
| | | * @param v |
| | | */ |
| | | public void lPush(String k, Object v) { |
| | | ListOperations<String, Object> list = redisTemplate.opsForList(); |
| | | list.rightPush(k, v); |
| | | } |
| | | |
| | | /** |
| | | * 列表获取 |
| | | * |
| | | * @param k |
| | | * @param l |
| | | * @param l1 |
| | | * @return |
| | | */ |
| | | public List<Object> lRange(String k, long l, long l1) { |
| | | ListOperations<String, Object> list = redisTemplate.opsForList(); |
| | | return list.range(k, l, l1); |
| | | } |
| | | |
| | | /** |
| | | * 集合添加 |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public void add(String key, Object value) { |
| | | SetOperations<String, Object> set = redisTemplate.opsForSet(); |
| | | set.add(key, value); |
| | | } |
| | | |
| | | /** |
| | | * 集合获取 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public Set<Object> setMembers(String key) { |
| | | SetOperations<String, Object> set = redisTemplate.opsForSet(); |
| | | return set.members(key); |
| | | } |
| | | |
| | | /** |
| | | * 有序集合添加 |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param scoure |
| | | */ |
| | | public void zAdd(String key, Object value, double scoure) { |
| | | ZSetOperations<String, Object> zset = redisTemplate.opsForZSet(); |
| | | zset.add(key, value, scoure); |
| | | } |
| | | |
| | | /** |
| | | * 有序集合获取 |
| | | * |
| | | * @param key |
| | | * @param scoure |
| | | * @param scoure1 |
| | | * @return |
| | | */ |
| | | public Set<Object> rangeByScore(String key, double scoure, double scoure1) { |
| | | ZSetOperations<String, Object> zset = redisTemplate.opsForZSet(); |
| | | return zset.rangeByScore(key, scoure, scoure1); |
| | | } |
| | | |
| | | /** |
| | | * 加锁 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public boolean tryLock(String key) { |
| | | try { |
| | | long currTime = System.currentTimeMillis(); |
| | | // 加锁成功 |
| | | return redisTemplate.opsForValue().setIfAbsent(key, currTime); |
| | | } finally { |
| | | redisTemplate.expire(key, 5, TimeUnit.SECONDS); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | R detailActivity(@RequestParam("id") Long id, @RequestParam(value = "userId", required = false) Long userId); |
| | | R detailActivity(@RequestParam("id") Long id, @RequestParam(value = "userId", required = false) Long userId,@RequestParam(value = "pageNum", required = false) Long pageNum,@RequestParam(value = "pageSize", required = false) Long pageSize); |
| | | |
| | | /** |
| | | * 分页活动报名名单 |
| | |
| | | @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); |
| | | } |
| | |
| | | package com.panzhihua.community_backstage; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.cloud.client.SpringCloudApplication; |
| | | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
| | | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
| | |
| | | |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | @EnableCaching |
| | | @EnableSwagger2 |
| | | @SpringCloudApplication |
| | | @EnableCircuitBreaker |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.HttpConstant; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.utlis.HttpClientUtil; |
| | | import com.panzhihua.common.utlis.HttpUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | } |
| | | return userService.getGridsMemberList(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "民生大屏出入记录接口@lyq") |
| | | @GetMapping("/event/inAndOut/record") |
| | | public R inAndOutRecord(@RequestParam("pageNum") Long pageNum,@RequestParam("pageSize") Long pageSize,@RequestParam("areaId") Long areaId) { |
| | | if (pageNum == null || pageNum == null || areaId == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | String param = "page=" + pageNum + "&size=" + pageSize + "&areaId=" + areaId; |
| | | String resultJson = HttpUtils.sendGet(HttpConstant.NEIJIANG_URL ,param); |
| | | JSONObject result = JSON.parseObject(resultJson); |
| | | return R.ok(result.getString("data")); |
| | | } |
| | | |
| | | @ApiOperation(value = "民生大屏报警记录接口@lyq") |
| | | @PostMapping("/event/callThePolice/record") |
| | | public R callThePoliceRecord(@RequestBody CommonPage commonPage) { |
| | | if (commonPage == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | String resultJson = HttpClientUtil.sendPostByJson(HttpConstant.CALL_THE_POLICE_URL,JSON.toJSONString(commonPage),0,null,null); |
| | | JSONObject result = JSON.parseObject(resultJson); |
| | | return R.ok(result.getString("data")); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
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 |
| | |
| | | if (R.isOk(r)) { |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | R r3 = this.detailActivity(id); |
| | | R r3 = this.detailActivity(id,null,null); |
| | | if (R.isOk(r3)) { |
| | | Object data = r3.getData(); |
| | | ComActActivityVO comActActivityVO = |
| | |
| | | |
| | | @ApiOperation(value = "活动详情", response = ComActActivityVO.class) |
| | | @GetMapping("detailactivity") |
| | | public R detailActivity(@RequestParam("id") Long id) { |
| | | public R detailActivity(@RequestParam("id") Long id,@RequestParam(value = "pageNum", required = false) Long pageNum,@RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | Long userId = this.getUserId(); |
| | | return communityService.detailActivity(id, userId); |
| | | return communityService.detailActivity(id, userId,pageNum,pageSize); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询活动报名名单集合") |
| | |
| | | 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 javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @GetMapping("listpartyorganization") |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "批量新增党员导入excel") |
| | | @PostMapping(value = "downloadtemplate", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | |
| | | 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>(); |
| | |
| | | if(isOk.getData() != null){ |
| | | return isOk; |
| | | }else{ |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","2"); |
| | | isOk.setData("2"); |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","1"); |
| | | isOk.setData("1"); |
| | | return isOk; |
| | | } |
| | | } |
| | |
| | | @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()); |
| | | } |
| | | // 得到文件流 |
| | |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 100MB |
| | | max-request-size: 100MB |
| | | max-file-size: 200MB |
| | | max-request-size: 200MB |
| | | |
| | | eureka: |
| | | client: |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--minio文件存储--> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | <version>6.0.8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.grid_app.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | private String url; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | @ApiOperation(value = "上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "批量上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploads", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile[] files, HttpServletRequest request) throws IOException { |
| | | public R uploads(@RequestParam MultipartFile[] files, HttpServletRequest request) throws IOException { |
| | | // 微信图片内容校验 |
| | | // WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService().getSecCheckService(); |
| | | String property = System.getProperty("user.dir"); |
| | |
| | | return R.ok(urlList); |
| | | } |
| | | |
| | | @ApiOperation(value = "新批量文件上传接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R ossUploads(@RequestParam MultipartFile[] files, HttpServletRequest request) { |
| | | try { |
| | | List<String> urlList = new ArrayList<>(); |
| | | for (MultipartFile file : files) { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | urlList.add(imageUrl); |
| | | } |
| | | return R.ok(urlList); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getConf/noToken") |
| | | @ApiOperation(value = "根据code查询系统配置") |
| | | public R getConf(@RequestParam("code") String code) { |
New file |
| | |
| | | package com.panzhihua.grid_app.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio存储信息配置 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Data |
| | | @ConfigurationProperties(prefix = "minio") |
| | | public class MinioConfig { |
| | | |
| | | private String host; |
| | | |
| | | private String accessKey; |
| | | |
| | | private String secretKey; |
| | | |
| | | private String url; |
| | | |
| | | private String bucket; |
| | | |
| | | private String aliasName; |
| | | |
| | | private String aliasPCName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_app.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.minio.ObjectStat; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio工具类 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Component |
| | | @EnableConfigurationProperties(MinioConfig.class) |
| | | public class MinioUtil { |
| | | |
| | | @Resource |
| | | private MinioConfig minioProperties; |
| | | |
| | | public static byte[] toByteArray(InputStream input) throws IOException { |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[4096]; |
| | | int n = 0; |
| | | while (-1 != (n = input.read(buffer))) { |
| | | output.write(buffer, 0, n); |
| | | } |
| | | return output.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 文件上传 |
| | | * |
| | | * @param file |
| | | * 要上传的文件 |
| | | * @return |
| | | */ |
| | | public String upload(MultipartFile file, String name) { |
| | | if (null != file) { |
| | | try { |
| | | UUID uuid = UUID.randomUUID(); |
| | | StringBuilder s = new StringBuilder(); |
| | | s.append(uuid.toString().replace("-", "")).append("/"); |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | // bucket 不存在,创建 |
| | | if (!minioClient.bucketExists(minioProperties.getBucket())) { |
| | | minioClient.makeBucket(minioProperties.getBucket()); |
| | | } |
| | | // 得到文件流 |
| | | InputStream input = file.getInputStream(); |
| | | // 文件名 |
| | | // String fileName = uuid + "/images." + FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String fileName = s.append(name).toString(); |
| | | String contentType = file.getContentType(); |
| | | minioClient.putObject(minioProperties.getBucket(), fileName, input, contentType); |
| | | StringBuilder fileUrl = new StringBuilder(minioProperties.getUrl()); |
| | | String url = fileUrl.append(fileName).toString(); |
| | | return url; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public void download(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | ObjectStat stat = minioClient.statObject(minioProperties.getBucket(), fileName); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | response.setContentType(stat.contentType()); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
| | | IOUtils.copy(inputStream, response.getOutputStream()); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public byte[] getBytes(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | byte[] bytes = new byte[0]; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | bytes = toByteArray(inputStream); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return bytes; |
| | | } |
| | | } |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--minio文件存储--> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | <version>6.0.8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.grid_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | |
| | | @ApiOperation(value = "上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_backstage.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio存储信息配置 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Data |
| | | @ConfigurationProperties(prefix = "minio") |
| | | public class MinioConfig { |
| | | |
| | | private String host; |
| | | |
| | | private String accessKey; |
| | | |
| | | private String secretKey; |
| | | |
| | | private String url; |
| | | |
| | | private String bucket; |
| | | |
| | | private String aliasName; |
| | | |
| | | private String aliasPCName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.grid_backstage.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.minio.ObjectStat; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * program 攀枝花智慧社区项目 description minio工具类 |
| | | * |
| | | * @author manailin Date 2021-08-19 15:30 |
| | | **/ |
| | | @Component |
| | | @EnableConfigurationProperties(MinioConfig.class) |
| | | public class MinioUtil { |
| | | |
| | | @Resource |
| | | private MinioConfig minioProperties; |
| | | |
| | | public static byte[] toByteArray(InputStream input) throws IOException { |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[4096]; |
| | | int n = 0; |
| | | while (-1 != (n = input.read(buffer))) { |
| | | output.write(buffer, 0, n); |
| | | } |
| | | return output.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * 文件上传 |
| | | * |
| | | * @param file |
| | | * 要上传的文件 |
| | | * @return |
| | | */ |
| | | public String upload(MultipartFile file, String name) { |
| | | if (null != file) { |
| | | try { |
| | | UUID uuid = UUID.randomUUID(); |
| | | StringBuilder s = new StringBuilder(); |
| | | s.append(uuid.toString().replace("-", "")).append("/"); |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | // bucket 不存在,创建 |
| | | if (!minioClient.bucketExists(minioProperties.getBucket())) { |
| | | minioClient.makeBucket(minioProperties.getBucket()); |
| | | } |
| | | // 得到文件流 |
| | | InputStream input = file.getInputStream(); |
| | | // 文件名 |
| | | // String fileName = uuid + "/images." + FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String fileName = s.append(name).toString(); |
| | | String contentType = file.getContentType(); |
| | | minioClient.putObject(minioProperties.getBucket(), fileName, input, contentType); |
| | | StringBuilder fileUrl = new StringBuilder(minioProperties.getUrl()); |
| | | String url = fileUrl.append(fileName).toString(); |
| | | return url; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public void download(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | ObjectStat stat = minioClient.statObject(minioProperties.getBucket(), fileName); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | response.setContentType(stat.contentType()); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
| | | IOUtils.copy(inputStream, response.getOutputStream()); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 文件下载 |
| | | * |
| | | * @param response |
| | | * @param url |
| | | */ |
| | | public byte[] getBytes(HttpServletResponse response, String url) { |
| | | // 从链接中得到文件名 |
| | | String replace = url.replace(minioProperties.getBucket() + "/", "#"); |
| | | String fileName = replace.split("#")[1]; |
| | | InputStream inputStream; |
| | | byte[] bytes = new byte[0]; |
| | | try { |
| | | MinioClient minioClient = new MinioClient(minioProperties.getHost(), minioProperties.getAccessKey(), |
| | | minioProperties.getSecretKey()); |
| | | inputStream = minioClient.getObject(minioProperties.getBucket(), fileName); |
| | | bytes = toByteArray(inputStream); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return bytes; |
| | | } |
| | | } |
| | |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | max-file-size: 200MB |
| | | max-request-size: 200MB |
| | | |
| | | eureka: |
| | | client: |
| | |
| | | <module>service_grid</module> |
| | | <!--网格治理-对接浪潮的市平台综治接口--> |
| | | <module>service_api</module> |
| | | <!--物业service--> |
| | | <module>service_property</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class LcApiServiceImpl implements LcApiService { |
| | | |
| | | @Value("${langchao.url}") |
| | | private String host; |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | |
| | | } else { |
| | | // 如果第一次请求浪潮的token请求,请求完成后,保存对于的token到数据库中。便于12小时内重复调用 |
| | | HttpRequest request = HttpUtil.createPost( |
| | | host + |
| | | LcApiConstants.GRID_GET_TOKEN_URL.replace("#username", name).replace("#password", password)); |
| | | HttpResponse result = request.execute(); |
| | | ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | |
| | | |
| | | @Override |
| | | public String getAllEventTypeList() { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_EVENT_CATEGORY_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_EVENT_CATEGORY_URL); |
| | | request.auth(getAuthToken()); |
| | | HttpResponse result = request.execute(); |
| | | return result.body(); |
| | |
| | | |
| | | @Override |
| | | public String submitEventRegister(EventInfo eventInfo) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_REGIST_EVENT_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_REGIST_EVENT_URL); |
| | | request.auth(getAuthToken()); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | |
| | | |
| | | @Override |
| | | public R submitEventOrVisitRecordRelationFile(EventFile eventFile) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_EVENT_FILE_UPLOAD_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_EVENT_FILE_UPLOAD_URL); |
| | | request.auth(getAuthToken()); |
| | | try { |
| | | HttpURLConnection httpUrl = (HttpURLConnection)new URL(eventFile.getFiles()).openConnection(); |
| | |
| | | |
| | | @Override |
| | | public String getEventInfoById(String eventId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_APP_EVENT_INFO_DETAIL_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_APP_EVENT_INFO_DETAIL_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("eventId", eventId); |
| | | HttpResponse result = request.execute(); |
| | |
| | | |
| | | @Override |
| | | public List<LcGridData> getGridTreeByAreaId(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_GET_EVENT_INFO_AREA_ID_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_GET_EVENT_INFO_AREA_ID_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | request.form("level", 4); |
| | |
| | | |
| | | @Override |
| | | public List<LcGridData> getGridDataListByAreaId(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_GET_GRID_DATA_AREA_ID_URL); |
| | | log.info("浪潮请求url"); |
| | | log.info(host + LcApiConstants.GRID_GET_GRID_DATA_AREA_ID_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.GRID_GET_GRID_DATA_AREA_ID_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | HttpResponse result = request.execute(); |
| | |
| | | @Override |
| | | public List<GridMemberPageListDTO> getGridMemberListByAreaIdOrName(String areaId, String param, Long pageNum, |
| | | Long pageSize) { |
| | | HttpRequest request = HttpUtil.createGet(LcApiConstants.GRID_GET_GETALL_SEARCH_PAGE_URL); |
| | | HttpRequest request = HttpUtil.createGet(host + LcApiConstants.GRID_GET_GETALL_SEARCH_PAGE_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | request.form("limit", pageSize); |
| | |
| | | |
| | | @Override |
| | | public String getFlowPersonVisitRecordDetailById(String recordId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.VISIT_RECORD_FLOW_PERSON_DETAIL_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.VISIT_RECORD_FLOW_PERSON_DETAIL_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("id", recordId); |
| | | HttpResponse result = request.execute(); |
| | |
| | | public String getFlowPersonVisitRecordPage(LcKeyPersonVisitRecordQueryDTO personVisitRecordQueryDTO, |
| | | Long loginUserId) { |
| | | HttpResponse result = getHttpResponse(personVisitRecordQueryDTO, loginUserId, |
| | | host + |
| | | LcApiConstants.VISIT_RECORD_FLOW_PERSON_PAGE_URL, "flowPeopleId"); |
| | | return result.body(); |
| | | } |
| | | |
| | | @Override |
| | | public String uploadFlowPersonVisitRecord(LcFlowPersonVisitRecordDTO lcFlowPersonVisitRecordDTO) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.VISIT_RECORD_FLOW_PERSON_SAVE_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.VISIT_RECORD_FLOW_PERSON_SAVE_URL); |
| | | request.auth(getAuthToken()); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | |
| | | |
| | | @Override |
| | | public String uploadKeyPersonVisitRecord(LcKeyPersonVisitRecordDTO lcKeyPersonVisitRecordDTO) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.VISIT_RECORD_KEY_PERSON_SAVE_REMOTE_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.VISIT_RECORD_KEY_PERSON_SAVE_REMOTE_URL); |
| | | request.auth(getAuthToken()); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | |
| | | |
| | | @Override |
| | | public String getKeyPersonVisitRecordDetailById(String recordId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.VISIT_RECORD_KEY_PERSON_DETAIL_URL); |
| | | HttpRequest request = HttpUtil.createPost(host + LcApiConstants.VISIT_RECORD_KEY_PERSON_DETAIL_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("id", recordId); |
| | | HttpResponse result = request.execute(); |
| | |
| | | public String getKeyPersonVisitRecordPage(LcKeyPersonVisitRecordQueryDTO personVisitRecordQueryDTO, |
| | | Long loginUserId) { |
| | | HttpResponse result = getHttpResponse(personVisitRecordQueryDTO, loginUserId, |
| | | host + |
| | | LcApiConstants.VISIT_RECORD_KEY_PERSON_PAGE_URL, "keyPersonId"); |
| | | return result.body(); |
| | | } |
| | |
| | | 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 javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | private ComEldersAuthElderlyService comEldersAuthElderlyService; |
| | | @Resource |
| | | private ComActMicroWishOperationRecordService wishOperationRecordService; |
| | | @Resource |
| | | private ComActActEvaluateDAO comActActEvaluateDAO; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | public R detailActivity(@RequestParam("id") Long id, |
| | | @RequestParam(value = "userId", required = false) Long userId) { |
| | | @RequestParam(value = "userId", required = false) Long userId, |
| | | @RequestParam(value = "pageNum",defaultValue = "1", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize",defaultValue = "10", required = false) Long pageSize) { |
| | | ComActActivityVO comActActivityVO = comActActivityService.inforActivity(id, userId); |
| | | if (ObjectUtils.isEmpty(comActActivityVO)) { |
| | | return R.fail("活动不存在"); |
| | |
| | | comActActivityVO.setComActActPrizeVOList(comActActPrizeVOS); |
| | | } |
| | | //活动评价 |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateService |
| | | .list(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, id)); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | List<ComActActEvaluateVO> comActActEvaluateVOList = new ArrayList<>(); |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | | BeanUtils.copyProperties(comActActEvaluateDO, comActActEvaluateVO); |
| | | comActActEvaluateVOList.add(comActActEvaluateVO); |
| | | }); |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluateVOList); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluateDOList.size()); |
| | | //当前用户对活动的评分 |
| | | Optional.ofNullable(userId).ifPresent(currentUserId -> { |
| | | Optional<ComActActEvaluateDO> optional = comActActEvaluateDOList.stream() |
| | | .filter(comActActEvaluateDO -> comActActEvaluateDO.getUserId().equals(currentUserId)).findFirst(); |
| | | if (optional.isPresent()) { |
| | | comActActivityVO.setMyRating(optional.get().getStarLevel()); |
| | | } |
| | | }); |
| | | IPage<ComActActEvaluateVO> comActActEvaluatePage = comActActEvaluateDAO.getEvaluateListPage(new Page(pageNum,pageSize),id); |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluatePage.getRecords()); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluatePage.getTotal()); |
| | | //当前用户对活动的评分 |
| | | ComActActEvaluateVO userActEvaluateVO = comActActEvaluateDAO.getEvaluateListByUserId(id,userId); |
| | | if(userActEvaluateVO != null){ |
| | | comActActivityVO.setMyRating(userActEvaluateVO.getStarLevel()); |
| | | } |
| | | fillActivitySignList(id, comActActivityVO); |
| | | comActActivityVO.setIntegral(0); |
| | |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | List<ComActActEvaluateExcelVO> getEvaluateLists(@Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * 分页查询活动评价列表 |
| | | * @param page 分页参数 |
| | | * @param activityId 活动id |
| | | * @return 活动评价列表 |
| | | */ |
| | | IPage<ComActActEvaluateVO> getEvaluateListPage(Page page, @Param("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 查询某活动的用户评价 |
| | | * @param activityId 活动id |
| | | * @param userId 用户id |
| | | * @return 用户评价记录 |
| | | */ |
| | | ComActActEvaluateVO getEvaluateListByUserId(@Param("activityId") Long activityId,@Param("userId") Long userId); |
| | | |
| | | } |
| | |
| | | + "</foreach> " + "</script>") |
| | | int updateIdBatch(@Param("longs") List<Long> longs); |
| | | |
| | | @Update("update com_act_activity set `status`=2 where `status`=1 and TIMESTAMPDIFF(MINUTE,SYSDATE(),publish_at)<=0") |
| | | @Update("update com_act_activity set `status`=3 where `status`=1 and TIMESTAMPDIFF(MINUTE,SYSDATE(),publish_at)<=0") |
| | | int updateStatusToNotBegin(); |
| | | |
| | | @Update("update com_act_activity set `status`=3 where `status`=2 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_begin)<=0") |
| | | int updateStatusToBeginSign(); |
| | | |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | |
| | | @Select("<script> " + "select t.* from ( " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | |
| | | IPage<ComActActivityVO> pageActivityCommunityBack(Page page, |
| | | @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0") |
| | | List<Long> getActivityEndIds(); |
| | | |
| | | @Update("update com_act_activity set `status`=4 where `status`=3 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | |
| | | "count(DISTINCT c.id)commentNum, " + |
| | | "u.image_url, " + |
| | | "p.happen_addr, " + |
| | | "p.addr_remark, " + |
| | | "su.`name` handler_name, " + |
| | | "p.`status`, " + |
| | | "p.`is_hide`, " + |
| | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | IPage<ComEldersAuthRecordForCommunityVO> selectCommunityEldersRecordByPage(Page page, |
| | | @Param("pageEldersAuthRecordDTO") PageEldersAuthRecordDTO pageEldersAuthRecordDTO); |
| | | |
| | | Map<String,String> getEldersAuthStatistics(@Param("communityId") Long communityId); |
| | | /** |
| | | * 根据社区id查询当前社区有多少人未认证和认证 |
| | | * @param communityId 社区id |
| | | * @return 前社区有多少人未认证和认证 |
| | | */ |
| | | Map<String,Object> getEldersAuthStatistics(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询社区上月所有视频认证记录 |
| | | * @param communityId 社区id |
| | | * @return 上月所有视频认证记录 |
| | | */ |
| | | List<ComEldersAuthHistoryVO> getEldersAuthRecords(@Param("communityId") Long communityId); |
| | | |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | private Date publishAt; |
| | | |
| | | /** |
| | | * 互动结束时间 |
| | | * 活动结束时间 |
| | | */ |
| | | private Date endAt; |
| | | |
| | |
| | | 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 |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActEvaluateService; |
| | |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private ComActActRegistDAO comActActRegistDAO; |
| | | /** |
| | | * 社区活动评价 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public R activityEvaluate(ComActActEvaluateVO comActActEvaluateVO) { |
| | | ComActActEvaluateDO currentUserEvaluateForThisActivity = this.baseMapper.selectOne(new QueryWrapper<ComActActEvaluateDO>().lambda() |
| | | .eq(ComActActEvaluateDO::getActivityId, comActActEvaluateVO.getActivityId()) |
| | | .eq(ComActActEvaluateDO::getUserId, comActActEvaluateVO.getUserId())); |
| | | Long activityId = comActActEvaluateVO.getActivityId(); |
| | | Long userId = comActActEvaluateVO.getUserId(); |
| | | if (isNull(activityId)) { |
| | | return R.fail("参数有误"); |
| | | } |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | Date beginAt = comActActivityDO.getBeginAt(); |
| | | Date nowDate = new Date(); |
| | | Integer isQrCode = comActActivityDO.getIsQrCode(); |
| | | if (nonNull(isQrCode) && isQrCode.equals(1)) { |
| | | //需要签到类型 |
| | | int registCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, activityId)); |
| | | if (registCount <= 0) { |
| | | //未签到,不能评价 |
| | | return R.fail("未签到,不能评价"); |
| | | } |
| | | } else { |
| | | if (nowDate.before(beginAt)) { |
| | | return R.fail("活动还未开始,暂不支持评价"); |
| | | } |
| | | } |
| | | ComActActEvaluateDO currentUserEvaluateForThisActivity = this.baseMapper.selectOne(new QueryWrapper<ComActActEvaluateDO>() |
| | | .lambda().eq(ComActActEvaluateDO::getActivityId, activityId).eq(ComActActEvaluateDO::getUserId, userId)); |
| | | if (Objects.nonNull(currentUserEvaluateForThisActivity)) { |
| | | return R.fail("该用户已评论过了,请勿重复评论"); |
| | | } |
| | |
| | | List<ComActActivityDO> comActActivityDOS = comActActivityDAO.selectList(new QueryWrapper<ComActActivityDO>().lambda() |
| | | .eq(ComActActivityDO::getStatus, 5) |
| | | .eq(ComActActivityDO::getIsDefaultPraise, 0) |
| | | .le(ComActActivityDO::getEndAt, DateUtils.addDays(new Date(), 7))); |
| | | .le(ComActActivityDO::getEndAt, DateUtils.addDays(new Date(), -7))); |
| | | //获取报名记录 |
| | | if (!ObjectUtils.isEmpty(comActActivityDOS)) { |
| | | List<Long> activityIds = comActActivityDOS.stream().map(ComActActivityDO::getId).collect(Collectors.toList()); |
| | |
| | | comActActEvaluateDO.setUserId(comActActSignDO.getUserId()); |
| | | comActActEvaluateDO.setCreateAt(new Date()); |
| | | comActActEvaluateDO.setStarLevel(5); |
| | | comActActEvaluateDO.setEvaluateContent("系统默认好评!"); |
| | | return comActActEvaluateDO; |
| | | }).collect(Collectors.toList()); |
| | | boolean result = this.saveBatch(comActActEvaluateDOList); |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPictureVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityActivitiesVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityGovernanceTrendsVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActPictureDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | if (status.intValue() == 2) {// 点击‘保存并发布’ 按钮 |
| | | // 报名结束时间大于当前时间则设置为“进行中” |
| | | if (comActActivityVO.getSignUpEnd() != null && now.getTime() < comActActivityVO.getSignUpEnd().getTime()) { |
| | | comActActivityDO.setStatus(4); |
| | | comActActivityDO.setStatus(3); |
| | | } |
| | | } |
| | | |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivity(page, comActActivityVO); |
| | | List<ComActActivityVO> records = iPage.getRecords(); |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActActivityVO1 -> { |
| | | Integer status = comActActivityVO1.getStatus(); |
| | | if (status.intValue() == 3) { |
| | | comActActivityVO1.setStatus(4); |
| | | } |
| | | }); |
| | | } |
| | | // List<ComActActivityVO> records = iPage.getRecords(); |
| | | // if (!ObjectUtils.isEmpty(records)) { |
| | | // records.forEach(comActActivityVO1 -> { |
| | | // Integer status = comActActivityVO1.getStatus(); |
| | | // if (status.intValue() == 3) { |
| | | // comActActivityVO1.setStatus(4); |
| | | // } |
| | | // }); |
| | | // } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R releaseActivity(ComActActivityVO comActActivityVO) { |
| | | ComActActivityDO comActActivityDO = new ComActActivityDO(); |
| | | comActActivityDO.setId(comActActivityVO.getId()); |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(comActActivityVO.getId()); |
| | | comActActivityDO.setPublishAt(comActActivityVO.getPublishAt()); |
| | | comActActivityDO.setStatus(comActActivityVO.getStatus()); |
| | | comActActivityDO.setStatus(3); |
| | | if (comActActivityVO.getPublishAt().after(comActActivityDO.getSignUpEnd())) { |
| | | comActActivityVO.setStatus(4); |
| | | } |
| | | 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(); |
| | | } |
| | | |
| | | /** |
| | |
| | | int num = comActActivityDAO.updateStatusToNotBegin(); |
| | | log.info("定时任务--修改社区活动发布状态活动数量【{}】", num); |
| | | // 修改报名状态 变为报名中 |
| | | int num1 = comActActivityDAO.updateStatusToBeginSign(); |
| | | log.info("定时任务--修改社区活动报名状态活动数量【{}】", num1); |
| | | // int num1 = comActActivityDAO.updateStatusToBeginSign(); |
| | | // log.info("定时任务--修改社区活动报名状态活动数量【{}】", num1); |
| | | int num3 = comActActivityDAO.updateStatusToBeginAfterSingEnd(); |
| | | log.info("定时任务--报名结束修改社区活动进行状态活动数量【{}】", num3); |
| | | // 查询已经结束的活动,需要计算积分 |
| | | List<Long> activityEndIds = comActActivityDAO.getActivityEndIds(); |
| | | // 修改进行状态 变为进行中或者已结束 |
| | | int num2 = comActActivityDAO.updateStatusToBeginActiveOrEnd(); |
| | | log.info("定时任务--修改社区活动进行状态活动数量【{}】", num2); |
| | | int num3 = comActActivityDAO.updateStatusToBeginAfterSingEnd(); |
| | | log.info("定时任务--报名结束修改社区活动进行状态活动数量【{}】", num3); |
| | | return R.ok(activityEndIds); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public R activitySignIn(ComActActRegistVO comActActRegistVO) { |
| | | Long activityId = comActActRegistVO.getActivityId(); |
| | | Long userId = comActActRegistVO.getUserId(); |
| | | if (isNull(activityId)) { |
| | | return R.fail("签到所属活动id不能为空!"); |
| | | } |
| | |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在!"); |
| | | } |
| | | Long userId = comActActRegistVO.getUserId(); |
| | | String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | |
| | | Date beginAt = comActActivityDO.getBeginAt(); |
| | | Date endAt = comActActivityDO.getEndAt(); |
| | | Date nowDate = new Date(); |
| | | if (nowDate.before(beginAt) || nowDate.after(endAt)) { |
| | | return R.fail("不在活动时间范围内"); |
| | | } |
| | | |
| | | int signCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | |
| | | if (signCount > 0) { |
| | | return R.fail("请勿重复签到"); |
| | | } |
| | | |
| | | // String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | // if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | // return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | // } |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(new Date()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0) { |
| | | ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | opsForValue.set(activitySignInKey, "", 1800L, TimeUnit.SECONDS); |
| | | // ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | // opsForValue.set(activitySignInKey, "", 1800L, TimeUnit.SECONDS); |
| | | return R.ok(); |
| | | } |
| | | return R.ok(); |
| | | return R.fail("网络错误,请重试"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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) { |
| | |
| | | |
| | | actList.forEach(act -> { |
| | | //查询社区老人认证统计信息,并存储到数据库中 |
| | | Map<String,String> resultMap = this.baseMapper.getEldersAuthStatistics(act.getCommunityId()); |
| | | Map<String,Object> resultMap = this.baseMapper.getEldersAuthStatistics(act.getCommunityId()); |
| | | 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"))); |
| | | authStatisticsDO.setNoAuthSum(Integer.parseInt(resultMap.get("noCount"))); |
| | | authStatisticsDO.setAuthSum(Integer.parseInt(resultMap.get("yesCount"))); |
| | | authStatisticsDO.setSum(Integer.parseInt(resultMap.get("oldCount").toString())); |
| | | authStatisticsDO.setNoAuthSum(Integer.parseInt(resultMap.get("noCount").toString())); |
| | | authStatisticsDO.setAuthSum(Integer.parseInt(resultMap.get("yesCount").toString())); |
| | | comEldersAuthStatisticsMapper.insert(authStatisticsDO); |
| | | } |
| | | }); |
| | |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | WHEN caae.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | | LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id AND caae.user_id = caas.user_id |
| | | LEFT JOIN sys_user su ON caae.user_id = su.user_id |
| | | where caae.activity_id = #{comActActEvaluateVO.activityId} |
| | | <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> |
| | |
| | | <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> |
| | | AND su.`name` = #{comActActEvaluateVO.name} |
| | | </if> |
| | | <if test="comActActEvaluateVO.starLevel != null"> |
| | | <if test="comActActEvaluateVO.starLevel != null and comActActEvaluateVO.starLevel != 0"> |
| | | AND caae.star_level = #{comActActEvaluateVO.starLevel} |
| | | </if> |
| | | <if test="comActActEvaluateVO.createAt != null"> |
| | |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | WHEN caae.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | | LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caae.user_id = su.user_id |
| | | where caae.activity_id = #{comActActEvaluateVO.activityId} |
| | | <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> |
| | |
| | | <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> |
| | | AND su.`name` = #{comActActEvaluateVO.name} |
| | | </if> |
| | | <if test="comActActEvaluateVO.starLevel != null"> |
| | | <if test="comActActEvaluateVO.starLevel != null and comActActEvaluateVO.starLevel != 0"> |
| | | AND caae.star_level = #{comActActEvaluateVO.starLevel} |
| | | </if> |
| | | <if test="comActActEvaluateVO.createAt != null"> |
| | |
| | | </if> |
| | | order by caae.create_at desc |
| | | </select> |
| | | |
| | | <select id="getEvaluateListPage" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | | SELECT |
| | | caae.*,su.`name`,su.nick_name,su.image_url |
| | | FROM |
| | | com_act_act_evaluate AS caae |
| | | LEFT JOIN sys_user AS su ON su.user_id = caae.user_id |
| | | where caae.activity_id = #{activityId} |
| | | order by caae.create_at desc |
| | | </select> |
| | | |
| | | <select id="getEvaluateListByUserId" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | | SELECT |
| | | caae.*,su.`name`,su.nick_name,su.image_url |
| | | FROM |
| | | com_act_act_evaluate AS caae |
| | | LEFT JOIN sys_user AS su ON su.user_id = caae.user_id |
| | | where caae.activity_id = #{activityId} and caae.user_id = #{userId} |
| | | order by caae.create_at desc |
| | | limit 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | WHEN caar.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.tags != null and comActActRegistVO.tags !=''"> |
| | | AND su.tags like ('%', #{comActActRegistVO.tags}, '%') |
| | | AND su.tags like concat ('%', #{comActActRegistVO.tags}, '%') |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | WHEN caar.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | |
| | | 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> |
| | |
| | | FROM |
| | | com_act AS ca |
| | | WHERE |
| | | community_id = 2 |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getEldersAuthRecords" resultType="com.panzhihua.common.model.vos.elders.ComEldersAuthHistoryVO"> |
| | |
| | | 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; |
| | | 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(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> |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @param comMngUserTagDTO |
| | | * @return |
| | | */ |
| | | @Select("<script> " + " SELECT " + " t.* " + "FROM " + " com_mng_user_tag t " + "WHERE " |
| | | + " community_id IN ( 0, #{comMngUserTagDTO.communityId} ) " |
| | | + "<if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName.trim() != ""'>" |
| | | + " and t.tag_name like concat('%',#{comMngUserTagDTO.tagName},'%') \n" + " </if> " + "ORDER BY " |
| | | + " t.sys_flag DESC" + "</script> ") |
| | | IPage<ComMngTagVO> pageSpecialInputUserTags(Page page, |
| | | @Param(value = "comMngUserTagDTO") ComMngUserTagDTO comMngUserTagDTO); |
| | | |
| | |
| | | * @param comMngTagVO |
| | | * @return |
| | | */ |
| | | @Select("<script> " + " SELECT " + " t.* " + "FROM " + " com_mng_user_tag t " + "WHERE " |
| | | + " community_id = #{comMngTagVO.communityId} " |
| | | + "<if test='comMngTagVO.tagName != null and comMngTagVO.tagName.trim() != ""'>" |
| | | + " and t.tag_name = #{comMngTagVO.tagName} " + " </if> " + "</script> ") |
| | | ComMngUserTagDO getSpecialInputUserTagsByVO(@Param(value = "comMngTagVO") ComMngTagVO comMngTagVO); |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface RoleDAO extends BaseMapper<SysRoleDO> { |
| | | @Select("select r.* from sys_user_role u join sys_role r on u.role_id=r.role_id where u.user_id=#{userId}") |
| | | |
| | | List<SysRoleDO> selectByUserId(Long userId); |
| | | |
| | | @Select("select r.role_key role,m.component url from sys_role r join sys_role_menu rm on r.role_id=rm.role_id join sys_menu m on rm.menu_id=m.menu_id WHERE m.component is not null ") |
| | | |
| | | List<MenuVO> selectAllMenuUrl(); |
| | | |
| | | @Select("select r.role_key from sys_user_role ur join sys_role r on ur.role_id = r.role_id where ur.user_id=#{username}") |
| | | |
| | | List<String> selectRoles(String username); |
| | | |
| | | @Select("") |
| | | |
| | | Long selectMaxRole(Long communityId); |
| | | |
| | | @Select("delete from sys_role where role_key =#{roleKey}") |
| | | |
| | | void deleteByRoleKey(@RequestParam("roleKey") String roleKey); |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface SysOperLogDAO extends BaseMapper<SysOperLogDO> { |
| | | @Select("select * from sys_oper_log where community_id=#{sysOperLogVO.communityId} order by oper_time desc ") |
| | | |
| | | IPage<SysOperLogVO> pageOperLog(Page page, @Param("sysOperLogVO") SysOperLogVO sysOperLogVO); |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface SysUserFeedbackDAO extends BaseMapper<SysUserFeedbackDO> { |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | |
| | | @Select("<script> " + "select \n" + "u.name,\n" + "u.nick_name,\n" + "f.id,\n" + "u.phone,\n" + "f.create_at,\n" |
| | | + "f.content,\n" + "f.photo_path,\n" + "c.name communityName\n" + "from sys_user_feedback f\n" |
| | | + "left join sys_user u on f.user_id=u.user_id\n" + "left join com_act c on u.community_id=c.community_id\n" |
| | | + "<where>" + "<if test='pageFeedBackDTO.phone != null and pageFeedBackDTO.phone.trim() != ""'>" |
| | | + "and u.phone like concat('%',#{pageFeedBackDTO.phone},'%') \n" + " </if> " |
| | | + "<if test='pageFeedBackDTO.name != null and pageFeedBackDTO.name.trim() != ""'>" |
| | | + "and u.name like concat('%',#{pageFeedBackDTO.name},'%') \n" + " </if> " |
| | | + "<if test='pageFeedBackDTO.nickName != null and pageFeedBackDTO.nickName.trim() != ""'>" |
| | | + "and u.nick_name like concat('%',#{pageFeedBackDTO.nickName},'%') \n" + " </if> " + "</where> " |
| | | + "order by f.create_at desc\n" + "</script>") |
| | | IPage<SysUserFeedbackVO> pageFeedback(Page page, @Param("pageFeedBackDTO") PageFeedBackDTO pageFeedBackDTO); |
| | | |
| | | @Select("select \n" + "u.name,\n" + "u.nick_name,\n" + "f.id,\n" + "f.content,\n" + "f.photo_path,\n" + "u.phone,\n" |
| | | + "f.create_at,\n" + "c.name communityName\n" + "from sys_user_feedback f\n" |
| | | + "join sys_user u on f.user_id=u.user_id\n" + "join com_act c on u.community_id=c.community_id\n" |
| | | + "where f.id=#{id}\n") |
| | | |
| | | SysUserFeedbackVO detailFeedback(Long id); |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface SysUserInputDAO extends BaseMapper<SysUserInputDO> { |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName}") |
| | | |
| | | ComMngStructAreaVO selectByAreaName(String areaName); |
| | | |
| | | @Select("SELECT " |
| | | + "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName, " |
| | | + "h.house_code " + "FROM " + " com_mng_struct_area a " |
| | | + " join com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5 " + "WHERE " |
| | | + " a.area_name = #{areaName}") |
| | | |
| | | List<ComMngStructHouseVO> selectHouserByareaName(String areaName); |
| | | |
| | | @Select("SELECT " + "p.name, " + "p.id, " + "if(p.is_rent=1,'合租','家人')relationship, " + "p.id_card, " + "p.phone, " |
| | | + "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age, " |
| | | + "p.create_at " + "FROM " + " sys_user_input p " + "WHERE " + " p.door_number = #{doorNumber} " |
| | | + " AND p.id !=#{userId}") |
| | | |
| | | List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId") Long userId); |
| | | |
| | | @Select("<script> " + "SELECT " + " t.id, " + " t.`name`, " + "CASE " + " IF " + " ( " |
| | | + " length( t.id_card ) = 18, " + " cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % 2, " + " IF " |
| | | + " ( " + " length( t.id_card ) = 15, " + " cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, " |
| | | + " 3 " + " ) " + " ) " + " WHEN 1 THEN " + " 1 " + " WHEN 0 THEN " + " 2 ELSE 0 " |
| | | + " END AS sex, " + " t.phone, " + " YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, " |
| | | + " t1.area_name as areaName, " + " t.political_outlook politicalOutlook, " + " CONCAT( " + " IF " |
| | | + " ( t.soldier = 1, '军人,', '' ), " + " IF " + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " |
| | | + " ( t.lowIncome_people = 1, '低收入,', '' ), " + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " |
| | | + " ( t.key_personnel = 1, '重点人员,', '' ) " + " ) tags, " + " t.create_at as createAt " + "FROM " |
| | | + " sys_user_input t " + " LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id " + "WHERE " |
| | | + " t.community_id = #{pageInputUserDTO.communityId}" |
| | | + "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>" |
| | | + " and t.`name` like concat(#{pageInputUserDTO.name},'%') " + " </if> " |
| | | + "<if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>" |
| | | + " and t.phone like concat(#{pageInputUserDTO.phone},'%') " + " </if> " |
| | | + "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>" |
| | | + "AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') " + " </if> " + " group by t.id_card " |
| | | + "</script>") |
| | | |
| | | IPage<InputUserInfoVO> pageInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); |
| | | |
| | | @Select("select a.id,a.community_id,a.area_name,address_detail from com_mng_struct_area a where a.community_id=#{communityId}") |
| | | |
| | | List<ComMngStructAreaVO> selectComMngStructArea(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + "SELECT * FROM ( " + " SELECT " + " t.id, " + " t.`name`, " + "CASE " + " IF " + " ( " |
| | | + " length( t.id_card ) = 18, " + " cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % 2, " + " IF " |
| | | + " ( " + " length( t.id_card ) = 15, " + " cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, " |
| | | + " 3 " + " ) " + " ) " + " WHEN 1 THEN " + " 1 " + " WHEN 0 THEN " + " 2 ELSE 0 " |
| | | + " END AS sex, " + " t.phone, " + " YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, " |
| | | + " t1.area_name as areaName, " + " t.political_outlook politicalOutlook, " + " CONCAT( " + " IF " |
| | | + " ( t.soldier = 1, '军人,', '' ), " + " IF " + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " |
| | | + " ( t.lowIncome_people = 1, '低收入,', '' ), " + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " |
| | | + " ( t.key_personnel = 1, '重点人员,', '' ), " + " IFNULL(t.tags,'') " + " ) tags, " |
| | | + " t2.house_name as address, " + " t.create_at as createAt " + "FROM " + " sys_user_input t " |
| | | + " LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id " |
| | | + " LEFT JOIN com_mng_struct_house t2 ON t.house_code = t2.house_code " + "WHERE " |
| | | + " t.community_id = #{pageInputUserDTO.communityId}" + " AND " |
| | | + "(t.soldier=1 OR t.lowIncome_households=1 OR t.lowIncome_people=1 or t.old_people=1 OR t.special_service_family=1 OR t.key_personnel=1 OR (t.tags IS NOT NULL AND TRIM(t.tags)!=''))" |
| | | + "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>" |
| | | + " and t.`name` like concat(#{pageInputUserDTO.name},'%') " + " </if> " |
| | | + "<if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>" |
| | | + " and t.phone like concat(#{pageInputUserDTO.phone},'%') " + " </if> " |
| | | + "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>" |
| | | + "AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') " + " </if> " + " group by t.id_card " |
| | | + " ) tt WHERE 1=1 " |
| | | + "<if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags.trim() != ""'>" |
| | | + " and tt.tags like concat('%',#{pageInputUserDTO.tags},'%') " + " </if> " + "</script>") |
| | | |
| | | IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); |
| | | |
| | | @Select("" + "SELECT " + " t1.house_code houseCode, " + " t1.house_name houseName, " + " t1.square, " + " t1.state " |
| | | + "FROM " + " sys_user_input t " + " LEFT JOIN com_mng_struct_house t1 ON t.house_code = t1.house_code " |
| | | + " WHERE" + " t.id_card = #{idCard}") |
| | | |
| | | List<ComMngStructHouseVO> selectUserHouseList(@Param("idCard") String idCard); |
| | | |
| | | @Select("<script> " + "SELECT " + "u.id 'order', " + "c.`area_name` areaName, " + "u.door_number doorNumber, " |
| | | + "if(u.is_rent=1,'租住','自主')isRent, " + "u.name, " + "u.nation, " |
| | | + "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, " |
| | | + "if(u.marital_status=1,'已婚','未婚')maritalStatus, " + "u.phone, " + "u.education, " + "u.id_card, " |
| | | + "u.company, " + "u.residence, " + "if(u.is_panzhiHua=1,'是','否') isPanZhiHua, " + "u.situation, " |
| | | + "if(is_contact=1,'是','否') isContact, " + "if(u.major=1,'是','否') major, " + "if(u.soldier=1,'是','否') soldier, " |
| | | + "if(u.disability=1,'是','否') disability, " + "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, " |
| | | + "if(u.lowIncome_people=1,'是','否') lowIncomePeople, " + "if(u.old_people=1,'是','否') oldPeople, " |
| | | + "if(u.special_service_family=1,'是','否') specialServiceFamily, " |
| | | + "if(u.key_personnel=1,'是','否') keyPersonnel, " + "u.tags " + "FROM " + " sys_user_input u " |
| | | + " where u.community_id=#{exportUserDTO.communityId} " |
| | | + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" |
| | | + " JOIN com_mng_struct_area c ON u.area_id = c.id " + " </if> " |
| | | + "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" |
| | | + "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id " + " </if> " |
| | | + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" |
| | | + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') " + " </if> " |
| | | + "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" |
| | | + "AND u.phone like concat(#{exportUserDTO.phone},'%') " + " </if> " |
| | | + "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" |
| | | + " and u.`name` like concat(#{exportUserDTO.name},'%') " + " </if> " + "</script>") |
| | | |
| | | List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); |
| | | |
| | | @Select("<script> " + "SELECT " + "u.id 'order', " + "c.`area_name` areaName, " + "u.door_number doorNumber, " |
| | | + "if(u.is_rent=1,'租住','自主')isRent, " + "u.name, " + "u.nation, " |
| | | + "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, " |
| | | + "if(u.marital_status=1,'已婚','未婚')maritalStatus, " + "u.phone, " + "u.education, " + "u.id_card, " |
| | | + "u.company, " + "u.residence, " + "if(u.is_panzhiHua=1,'是','否') isPanZhiHua, " + "u.situation, " |
| | | + "if(is_contact=1,'是','否') isContact, " + "if(u.major=1,'是','否') major, " + "if(u.soldier=1,'是','否') soldier, " |
| | | + "if(u.disability=1,'是','否') disability, " + "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, " |
| | | + "if(u.lowIncome_people=1,'是','否') lowIncomePeople, " + "if(u.old_people=1,'是','否') oldPeople, " |
| | | + "if(u.special_service_family=1,'是','否') specialServiceFamily, " |
| | | + "if(u.key_personnel=1,'是','否') keyPersonnel, " + "u.tags " + "FROM " + " sys_user_input u " |
| | | + " JOIN com_mng_struct_area c ON u.area_id = c.id " |
| | | + " where u.community_id=#{exportSpecialUserDTO.communityId} " |
| | | + "<if test='exportSpecialUserDTO.areaName != null and exportSpecialUserDTO.areaName.trim() != ""'>" |
| | | + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') " + " </if> " |
| | | + "<if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>" |
| | | + " and u.`name` like concat(#{exportSpecialUserDTO.name},'%') " + " </if> " |
| | | + "<if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>" |
| | | + " and u.`name` like concat(#{exportSpecialUserDTO.name},'%') " + " </if> " |
| | | + "<if test='exportSpecialUserDTO.tags != null and exportSpecialUserDTO.tags.trim() != ""'>" |
| | | + " CONCAT( " + " IF " + " ( t.soldier = 1, '军人,', '' ), " + " IF " |
| | | + " ( t.lowIncome_households = 1, '低保户,', '' ), " + " IF " + " ( t.lowIncome_people = 1, '低收入,', '' ), " |
| | | + " IF " + " ( t.old_people = 1, '特服家庭,', '' ), " + " IF " + " ( t.key_personnel = 1, '重点人员,', '' ), " |
| | | + " IFNULL(t.tags,'') " + " ) like concat(#{exportSpecialUserDTO.tags},'%')" + " </if> " + "</script>") |
| | | |
| | | List<EexcelUserDTO> specialUserExport(@Param("exportSpecialUserDTO") ExportSpecialUserDTO exportSpecialUserDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_user.dao; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.user.NoticeUnReadVO; |
| | |
| | | @Mapper |
| | | public interface SysUserNoticeDAO extends BaseMapper<SysUserNoticeDO> { |
| | | |
| | | @Select("SELECT \n" + "COUNT(case WHEN type=1 then id else null end )activityUnread,\n" |
| | | + "COUNT(case WHEN type=2 then id else null end )serviceUnread,\n" |
| | | + "COUNT(case WHEN type=3 then id else null end )systemUnread,\n" |
| | | + "COUNT(case WHEN type=4 then id else null end )scoreUnread\n" + "FROM\n" + "sys_user_notice \n" + "WHERE\n" |
| | | + "user_id =#{userId} and `status`=0") |
| | | |
| | | NoticeUnReadVO noticeUnreadNum(Long userId); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface UserDao extends BaseMapper<SysUserDO> { |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | |
| | | @Select("<script> " + "SELECT\n" + "u.user_id,\n" + "u.face_url,\n" + "u.nick_name,\n" + "u.`name`,\n" |
| | | + "u.phone,\n" + "u.id_card,\n" + "u.face_state,\n" + "c.area_name communityName,\n" + "u.create_at \n" |
| | | + "FROM\n" + "sys_user u\n" + "JOIN com_mng_struct_area c ON u.area_id = c.id \n" |
| | | + "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" |
| | | + "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + " </if> " |
| | | + " where u.face_state is not null and u.type=1 and u.community_id=#{loginUserInfoVO.communityId} " |
| | | + "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" |
| | | + "and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + " </if> " |
| | | + "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" |
| | | + "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + " </if> " |
| | | + " order by u.face_state asc,u.create_at asc " + "</script>") |
| | | |
| | | IPage<LoginUserInfoVO> pageUserFace(Page page, @Param("loginUserInfoVO") LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | // @Select("<script> " + |
| | | // "SELECT\n" + |
| | | // "u.user_id,\n" + |
| | | // "u.`name`,\n" + |
| | | // "u.`sex`,\n" + |
| | | // "u.nick_name,\n" + |
| | | // "u.phone,\n" + |
| | | // "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n"+ |
| | | // "1 isRegister,\n"+ |
| | | // "v.political_face political_outlook,\n"+ |
| | | // "u.id_card,\n" + |
| | | // "u.job,\n" + |
| | | // "c.area_name communityName,\n" + |
| | | // "u.tags,\n" + |
| | | // "u.create_at \n" + |
| | | // "FROM\n" + |
| | | // "sys_user u\n" + |
| | | // "left join com_mng_volunteer_mng v on u.phone=v.phone \n"+ |
| | | // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | // " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == ""'>" + |
| | | // "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | // "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + |
| | | // " </if> " + |
| | | // " where u.community_id=#{loginUserInfoVO.communityId} and u.type=1 " + |
| | | // "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" + |
| | | // " and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" + |
| | | // "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + |
| | | // " </if> " + |
| | | // " order by u.user_id desc " + |
| | | // "</script>") |
| | | |
| | | IPage<AppletUserInfoVO> pageUser(Page page, @Param("loginUserInfoVO") AppletUserInfoVO userInfoVO); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "u.user_id,\n" + "u.account,\n" + "u.`name`,\n" + "u.`password`,\n" |
| | | + "u.phone,\n" + "e.role_name,\n" + "e.role_id ,\n" + "u.`status`,\n" + "u.create_at,\n" |
| | | + "u.last_login_time \n" + "FROM\n" + "sys_user u\n" + "JOIN sys_user_role r ON u.user_id = r.user_id\n" |
| | | + "JOIN sys_role e ON r.role_id = e.role_id \n" |
| | | + "<if test='administratorsUserVO.roleId != null and administratorsUserVO.roleId!=0'>" |
| | | + " and e.role_id=#{administratorsUserVO.roleId}" + " </if> " + " <where>" |
| | | + "<if test='administratorsUserVO.communityId != null '>" |
| | | + "AND u.community_id = #{administratorsUserVO.communityId} \n" + " </if> " |
| | | + "<if test='administratorsUserVO.name != null and administratorsUserVO.name.trim() != ""'>" |
| | | + "AND u.name like concat (#{administratorsUserVO.name},'%') \n" + " </if> " |
| | | + "<if test='administratorsUserVO.phone != null and administratorsUserVO.phone.trim() != ""'>" |
| | | + "AND u.phone like concat(#{administratorsUserVO.phone},'%') " + " </if> " |
| | | + "<if test='administratorsUserVO.account != null and administratorsUserVO.account.trim() != ""'>" |
| | | + "AND u.account like concat(#{administratorsUserVO.account},'%') " + " </if> " + " </where>" + "</script>") |
| | | |
| | | 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" |
| | | + "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" |
| | | + "<if test='pageUserAppletsBackstageDTO.phone != null and pageUserAppletsBackstageDTO.phone.trim() != ""'>" |
| | | + "and u.phone=#{pageUserAppletsBackstageDTO.phone}\n" + " </if> " |
| | | + "<if test='pageUserAppletsBackstageDTO.communityId != null and pageUserAppletsBackstageDTO.communityId != 0'>" |
| | | + "and u.community_id=#{pageUserAppletsBackstageDTO.communityId}\n" + " </if> " |
| | | + "<if test='pageUserAppletsBackstageDTO.status != null and pageUserAppletsBackstageDTO.status != 0'>" |
| | | + "and u.status=#{pageUserAppletsBackstageDTO.status}\n" + " </if> " |
| | | + "<if test='pageUserAppletsBackstageDTO.createAtBegin != null '>" |
| | | + "and u.create_at between #{pageUserAppletsBackstageDTO.createAtBegin} and #{pageUserAppletsBackstageDTO.createAtEnd}\n" |
| | | + " </if> " + "<if test='pageUserAppletsBackstageDTO.lastLoginTimeBegin != null '>" |
| | | + "and u.last_login_time between #{pageUserAppletsBackstageDTO.lastLoginTimeBegin} and #{pageUserAppletsBackstageDTO.lastLoginTimeEnd}\n" |
| | | + " </if> " + "order by u.create_at desc \n" + "</script>") |
| | | |
| | | IPage<SysUserVO> pageUserAppletsBackstage(Page page, |
| | | @Param("pageUserAppletsBackstageDTO") PageUserAppletsBackstageDTO pageUserAppletsBackstageDTO); |
| | | |
| | | @Update("update sys_user set nick_name=null ,community_id=null,area_id=null where user_id=#{userId}") |
| | | |
| | | int deleteUserTest(Long userId); |
| | | |
| | | @Select("<script> " + "select * from \n" + "sys_user_notice \n" + "where \n" + "user_id=#{pageDTO.userId} \n" |
| | | + "<if test='pageDTO.type != null and pageDTO.type != 0'>" + "and type=#{pageDTO.type}\n" + " </if> " |
| | | + "order by create_at desc\n" + "</script>") |
| | | |
| | | IPage<SysUserNoticeVO> pageNotice(Page page, @Param("pageDTO") PageDTO pageDTO); |
| | | |
| | | @Select("SELECT \n" + "COUNT(user_id)allUser,\n" |
| | | + "COUNT(case WHEN DATE_FORMAT(create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser,\n" |
| | | + "COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser,\n" |
| | | + "(SELECT count(user_id) FROM sys_user WHERE type = 1 AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser\n" |
| | | + "FROM\n" + "sys_user\n" + "where type=1 and community_id is not null") |
| | | |
| | | IndexDataKanbanVO selectIndexDataKanban(); |
| | | |
| | | @Select("select t.* from (\n" + "SELECT \n" + "a.`name`,\n" + "COUNT(u.user_id)num\n" + "FROM\n" + "com_act a\n" |
| | | + "LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1\n" |
| | | + "GROUP BY a.community_id)t ORDER BY t.num desc ") |
| | | |
| | | List<DataKanbanDTO> selectCommunityUserOrder(); |
| | | |
| | | @Select("SELECT\n" + "\tCOUNT( a.id ) num \n" + "FROM\n" + "\tcom_act_activity a \n" + "WHERE\n" |
| | | + "\tDATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT(\n" + "\t\ta.create_at,\n" + "\t'%Y-%m-%d')\n" + "\t") |
| | | |
| | | DataKanbanDTO selectCommunityActiveUserOrder(Date date1); |
| | | |
| | | @Select("SELECT \n" + "COUNT(DISTINCT u.user_id)allUser,\n" |
| | | + "(select COUNT(m.id) from com_mng_volunteer_mng m where m.community_id=#{communityId} and m.`state`=2)volunteerUser,\n" |
| | | + " (select count(id) from com_pb_member cpm where cpm.audit_result = 1 and cpm.community_id = #{communityId}) partymemberUser,\n" |
| | | + "COUNT(h.id)house\n" + "FROM\n" + "sys_user u\n" + "JOIN com_act c ON u.community_id = c.community_id \n" |
| | | + "LEFT JOIN com_mng_struct_house_user h on u.user_id=h.user_id\n" + "WHERE\n" |
| | | + "u.community_id =#{communityId} and u.type=1") |
| | | |
| | | IndexDataVO indexDataCommunityBackstage(Long communityId); |
| | | |
| | | @Update("UPDATE sys_user u \n" + "SET u.continuous_landing_days =\n" + "IF\n" + "(\n" |
| | | + "DATE_FORMAT( u.last_login_time, '%m-%d-%Y' )= DATE_FORMAT( SYSDATE(), '%m-%d-%Y' ),\n" |
| | | + "u.continuous_landing_days + 1,\n" + "0)") |
| | | |
| | | int timedTaskContinuousLandingDays(); |
| | | |
| | | @Select("select id,create_at,state,name,phone,photo_path,political_face,reject_reson,apply_reson,address,age,job,integral,community_id,submit_user_id " |
| | | + " from com_mng_volunteer_mng where phone=#{phone} order by create_at desc limit 1") |
| | | |
| | | ComMngVolunteerMngVO selectVolunteerMngByPhone(String phone); |
| | | |
| | | @Update("update sys_user set face_state=null where user_id=#{userId}") |
| | | |
| | | int updateFaceState(Long userId); |
| | | |
| | | @Select("select name from com_act where community_id=#{communityId}") |
| | | |
| | | ComActVO selectCommunity(Long communityId); |
| | | |
| | | @Select("select COUNT(a.id) from com_mng_struct_area a where a.area_name=#{areaName}") |
| | | |
| | | Integer selectCountArea(String areaName); |
| | | |
| | | @Select("SELECT\n" + "\tCOUNT(h.id)\n" + "FROM\n" + "\tcom_mng_struct_area a \n" |
| | | + "\tLEFT JOIN com_mng_struct_house h on h.parent_code=a.area_code\n" + "WHERE\n" |
| | | + "\ta.area_name = #{areaName}") |
| | | |
| | | Integer selectCountHouse(String areaName); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "u.user_id 'order',\n" + "h.house_name doorNumber,\n" |
| | | + "if(h.state=2,'租住','自主')isRent,\n" + "u.`name`,\n" + "'汉' nation,\n" |
| | | + "if(u.is_partymember=1,'党员','群众')politicalOutlook,\n" + "'未知' maritalStatus,\n" + "u.phone,\n" |
| | | + "'未知' education,\n" + "u.id_card,\n" + "'未知' company,\n" + "'未知' residence,\n" + "'未知' isPanZhiHua,\n" |
| | | + "'未知' situation,\n" + "'未知' isContact,\n" + "'未知' major,\n" + "'未知' soldier,\n" + "'未知' disability,\n" |
| | | + "'未知' lowIncomeHouseholds,\n" + "'未知' lowIncomePeople,\n" + "'未知' oldPeople,\n" |
| | | + "'未知' specialServiceFamily,\n" + "'未知' keyPersonnel\n" + "FROM\n" + "sys_user u\n" |
| | | + "left join com_mng_struct_house_user hu on hu.user_id=u.user_id\n" |
| | | + "left join com_mng_struct_house h on hu.house_code=h.house_code\n" |
| | | + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" |
| | | + " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + " </if> " |
| | | + "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" |
| | | + "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + " </if> " |
| | | + "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" |
| | | + "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') \n" + " </if> " |
| | | + " where u.community_id=#{exportUserDTO.communityId} and u.type=1 " |
| | | + "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" |
| | | + " and u.`name` like concat(#{exportUserDTO.name},'%') \n" + " </if> " |
| | | + "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" |
| | | + "AND u.phone like concat(#{exportUserDTO.phone},'%') " + " </if> " + " group by u.user_id " + "</script>") |
| | | |
| | | List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); |
| | | |
| | | @Select("SELECT\n" + "\t COUNT(a.id)\n" + "FROM\n" + "\t com_pb_member_role a \n" + "WHERE\n" |
| | | + "\t a.phone = #{phone} and community_id=#{userCommunityId} ") |
| | | |
| | | Integer selectCountMemberRole(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); |
| | | |
| | | @Select("SELECT\n" + "\t COUNT(a.id)\n" + "FROM\n" + "\t com_pb_service_team a \n" + "WHERE\n" |
| | | + "\t a.phone = #{phone} and community_id=#{userCommunityId} ") |
| | | |
| | | Integer selectCountTeam(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); |
| | | |
| | | @Update("update com_pb_member_role u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone}") |
| | | |
| | | void updateMemberRole(@Param("newphone") String newphone, @Param("oldphone") String oldphone); |
| | | |
| | | @Update("update com_pb_service_team u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone}") |
| | | |
| | | void updateServiceTeam(@Param("newphone") String newphone, @Param("oldphone") String oldphone); |
| | | |
| | | @Select("SELECT\n" + "\t COUNT(ur.role_id) \n" + "FROM\n" |
| | | + "\t sys_user u LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id \n" |
| | | + "\t LEFT JOIN sys_role r ON ur.role_id = r.role_id \n" |
| | | + "WHERE ur.role_id IS NOT NULL AND u.phone = #{phone} and r.community_id=#{userCommunityId} ") |
| | | |
| | | Integer selectCountSysUser(@Param("phone") String phone, @Param("userCommunityId") Long userCommunityId); |
| | | |
| | | @Select("update com_shop_store set sys_user_id = #{sysUserId} where phone = #{phone}") |
| | | |
| | | void updateStoreByPhone(@Param("phone") String phone, @Param("sysUserId") Long sysUserId); |
| | | |
| | | @Select("delete from com_shop_store where delete_status = 1 and phone = #{phone}") |
| | | |
| | | void deleteStoreByPhoneAndStatus(@RequestParam("phone") String phone); |
| | | |
| | | @Select("update sys_user set" + " card_photo_front = #{userArchivesVO.cardPhotoFront} \n" |
| | | + ", card_photo_back = #{userArchivesVO.cardPhotoBack} \n" + ",family_book = #{userArchivesVO.familyBook} \n" |
| | | + ",job = #{userArchivesVO.job} \n" + " where user_id = #{userArchivesVO.userId}") |
| | | |
| | | void updateUserArchives(@Param("userArchivesVO") UpdateUserArchivesVO userArchivesVO); |
| | | |
| | | @Select("update com_pb_member set user_id = #{userId} where audit_result = 1 and id_card = #{idCard}") |
| | | |
| | | void updateComPbMemberUserId(@Param("idCard") String idCard, @Param("userId") Long userId); |
| | | |
| | | @Select("select id from com_pb_member where audit_result = 1 and id_card = #{idCard}") |
| | | |
| | | Long getPartyBuildingByIdCard(@Param("idCard") String idCard); |
| | | |
| | | @Select("<script>" + "select su.user_id,su.image_url,su.nick_name,su.account,su.phone,su.work_status,su.`status`" |
| | | + ",ca.name as communityName,su.work_start_time,su.work_end_time from sys_user su" |
| | | + " left join com_act as ca on ca.community_id = su.community_id" + " where su.type = 6 " |
| | | + "<if test='memberRelationDTO.status != null'>" + "AND su.status = #{memberRelationDTO.status} " + " </if> " |
| | | + "<if test='memberRelationDTO.gridCommunityId != null'>" |
| | | + "AND ca.community_id = #{memberRelationDTO.gridCommunityId} " + " </if> " |
| | | + "<if test='memberRelationDTO.gridStreetId != null'>" + "AND ca.street_id = #{memberRelationDTO.gridStreetId} " |
| | | + " </if> " + "<if test='memberRelationDTO.workStatus != null'>" |
| | | + "AND su.work_status = #{memberRelationDTO.workStatus} " + " </if> " |
| | | + "<if test='memberRelationDTO.keyWord != null and memberRelationDTO.keyWord != ""'>" |
| | | + "and (su.nick_name like concat(#{memberRelationDTO.keyWord},'%') OR su.user_id = #{memberRelationDTO.keyWord} OR su.account like concat(#{memberRelationDTO.keyWord},'%') OR su.phone like concat(#{memberRelationDTO.keyWord},'%'))" |
| | | + " </if> " + " order by su.create_at desc" + "</script>") |
| | | |
| | | IPage<GridMemberVO> getGridMemberList(Page page, |
| | | @Param("memberRelationDTO") PageEventGridMemberRelationDTO memberRelationDTO); |
| | | |
| | | @Select("<script>" + "update sys_user" + " set status = #{gridMemberEditDTO.status}" + " where user_id in " |
| | | + "<foreach item=\"item\" collection=\"gridMemberEditDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" |
| | | + "#{item}\n" + "</foreach>\n" + "</script>") |
| | | |
| | | void gridMemberEditStatus(@Param("gridMemberEditDTO") EventGridMemberEditStatusDTO gridMemberEditDTO); |
| | | |
| | | @Select("<script>" + "update sys_user" + " set password = #{gridMemberDTO.password}" + " where user_id in " |
| | | + "<foreach item=\"item\" collection=\"gridMemberDTO.ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" |
| | | + "#{item}\n" + "</foreach>\n" + "</script>") |
| | | |
| | | void passResetUser(@Param("gridMemberDTO") EventGridMemberPassResetDTO gridMemberDTO); |
| | | |
| | | @Update("update lc_compare_code_member set local_grid_member_id = #{userId},grid_member_name = #{userName} where id = #{lcMemberId}") |
| | | |
| | | void addLcMember(@Param("lcMemberId") Long lcMemberId, @Param("userId") Long userId, |
| | | @Param("userName") String userName); |
| | | |
| | | @Delete("delete from lc_compare_code_member where local_grid_member_id = #{gridMemberId}") |
| | | |
| | | void delLcMember(@Param("gridMemberId") Long gridMemberId); |
| | | |
| | | @Select("select id,village_id,act_id from com_mng_building where id = #{buildingId}") |
| | | |
| | | Map<String, Long> getBuilding(@Param("buildingId") Long buildingId); |
| | | |
| | | @Delete("delete from event_grid_member_building_relation where grid_member_id = #{gridMemberId}") |
| | | |
| | | void delGridMemberRelation(@Param("gridMemberId") Long gridMemberId); |
| | | |
| | | @Select("select lc_grid_member_id,lc_grid_member_name,lc_bind_user_id from lc_compare_code_member where local_grid_member_id = #{gridMemberId}") |
| | | |
| | | Map<String, String> getLcMemberId(@Param("gridMemberId") Long gridMemberId); |
| | | |
| | | @Select("select count(id) from event_grid_member_relation where grid_member_id = #{userId}") |
| | | |
| | | Integer getGridIsOk(@Param("userId") Long userId); |
| | | |
| | | @Select("select user_id,nick_name,phone from sys_user where type = 6 and community_id = #{communityId} limit 3") |
| | | List<EventGridMemberVO> getGridsMemberList(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script>" + "select id as managerId,`name` from com_pb_service_team where community_id = #{communityId}" |
| | | + "<if test='param != null and param != ""'>" + "AND `name` like concat(#{param},'%') " + " </if> " |
| | | + "</script>") |
| | | |
| | | List<ComPbServiceTeamWishVO> getServiceTeamList(@Param("param") String param, |
| | | @Param("communityId") Long communityId); |
| | | |
| | | @Select("select user_id,`name` from sys_user as su where type = 3 and community_id = #{communityId}") |
| | | |
| | | List<SysUserVO> getUserListByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | int putUserTag(@Param("sysUserDO") SysUserDO sysUserDO); |
| | | |
| | | } |
| | |
| | | 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()); |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (StringUtils.isNotEmpty(loginUserInfoVO.getTags()) && !"无".equals(loginUserInfoVO.getTags())) { |
| | | sysUserDO.setTags(loginUserInfoVO.getTags()); |
| | | } |
| | | int update = userDao.putUserTag(sysUserDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | | } |
| | |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO |
| | | .selectList(null); |
| | | if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { |
| | | list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) |
| | | .collect(Collectors.toList()); |
| | | for (ComMngUserTagDO comMngUserTagDO : comMngUserTagDOS) { |
| | | if (!list.contains(comMngUserTagDO.getTagName())) { |
| | | list.add(comMngUserTagDO.getTagName()); |
| | | } |
| | | } |
| | | // list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) |
| | | // .collect(Collectors.toList()); |
| | | } |
| | | return R.ok(list); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.panzhihua.service_user.dao.ComMngFamilyInfoDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="relationship" column="relationship"/> |
| | | <result property="name" column="name"/> |
| | | <result property="idCard" column="id_card"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="age" column="age"/> |
| | | <result property="health" column="health"/> |
| | | <result property="job" column="job"/> |
| | | <result property="cardPhotoFront" column="card_photo_front"/> |
| | | <result property="cardPhotoBack" column="card_photo_back"/> |
| | | <result property="familyBook" column="family_book"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`user_id`,`relationship`,`name`,`id_card`,`phone`,`age`,`health`,`job`,`card_photo_front`,`card_photo_back`,`family_book`,`create_at`,`update_at` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.ComMngStructHouseDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngStructHouseDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="houseCode" column="house_code"/> |
| | | <result property="createAt" column="create_at"/> |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`user_id`,`house_code`,`create_at`,`area_code`,`identity` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.ComMngUserTagDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.ComMngUserTagDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="tagName" column="tag_name"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="sysFlag" column="sys_flag"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`tag_name`,`community_id`,`create_at`,`sys_flag` |
| | | </sql> |
| | | |
| | | |
| | | <select id="getSpecialInputUserTagsByVO" resultType="com.panzhihua.service_user.model.dos.ComMngUserTagDO"> |
| | | SELECT t.* FROM com_mng_user_tag t WHERE community_id = #{comMngTagVO.communityId} |
| | | <if test='comMngTagVO.tagName != null and comMngTagVO.tagName.trim() != ""'> |
| | | and t.tag_name =#{comMngTagVO.tagName} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="pageSpecialInputUserTags" resultType="com.panzhihua.common.model.vos.user.ComMngTagVO"> |
| | | SELECT t.* FROM com_mng_user_tag t WHERE community_id IN ( 0, #{comMngUserTagDTO.communityId} ) |
| | | <if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName.trim() != ""'> |
| | | and t.tag_name like concat('%',#{comMngUserTagDTO.tagName},'%') |
| | | </if> |
| | | ORDER BY t.sys_flag 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_user.dao.EventGridMemberBuildingRelationMapper"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="gridMemberId" column="grid_member_id"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="villageId" column="village_id"/> |
| | | <result property="buildingId" column="building_id"/> |
| | | <result property="createAt" column="create_at"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`grid_member_id`,`community_id`,`village_id`,`building_id`,`create_at` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.LcCompareMemberCodeMapper"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.LcCompareCodeMemberDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="localGridMemberId" column="local_grid_member_id"/> |
| | | <result property="gridMemberName" column="grid_member_name"/> |
| | | <result property="lcGridMemberId" column="lc_grid_member_id"/> |
| | | <result property="lcGridMemberName" column="lc_grid_member_name"/> |
| | | <result property="lcBindUserId" column="lc_bind_user_id"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`local_grid_member_id`,`grid_member_name`,`lc_grid_member_id`,`lc_grid_member_name`,`lc_bind_user_id`,`create_at`,`update_at` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.RoleDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysRoleDO"> |
| | | <id property="roleId" column="role_id"/> |
| | | <result property="roleName" column="role_name"/> |
| | | <result property="roleKey" column="role_key"/> |
| | | <result property="roleSort" column="role_sort"/> |
| | | <result property="dataScope" column="data_scope"/> |
| | | <result property="menuCheckStrictly" column="menu_check_strictly"/> |
| | | <result property="deptCheckStrictly" column="dept_check_strictly"/> |
| | | <result property="status" column="status"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="communityId" column="community_id"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `role_id`,`role_name`,`role_key`,`role_sort`,`data_scope`,`menu_check_strictly`,`dept_check_strictly`,`status`,`create_by`,`create_at`,`update_by`,`update_at`,`remark`,`community_id` |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectAllMenuUrl" resultType="com.panzhihua.common.model.vos.MenuVO"> |
| | | select r.role_key role,m.component url from sys_role r join sys_role_menu rm on r.role_id=rm.role_id join sys_menu m on rm.menu_id=m.menu_id WHERE m.component is not null |
| | | </select> |
| | | |
| | | <select id="selectRoles" resultType="java.lang.String"> |
| | | select r.role_key from sys_user_role ur join sys_role r on ur.role_id = r.role_id where ur.user_id=#{username} |
| | | </select> |
| | | |
| | | <select id="selectByUserId" resultType="com.panzhihua.service_user.model.dos.SysRoleDO"> |
| | | select r.* from sys_user_role u join sys_role r on u.role_id=r.role_id where u.user_id=#{userId} |
| | | </select> |
| | | |
| | | <select id="selectMaxRole" resultType="java.lang.Long"> |
| | | |
| | | </select> |
| | | |
| | | <delete id="deleteByRoleKey"> |
| | | delete from sys_role where role_key =#{roleKey} |
| | | </delete> |
| | | |
| | | |
| | | </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_user.dao.SysMenuDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysMenuDO"> |
| | | <id property="menuId" column="menu_id"/> |
| | | <result property="menuName" column="menu_name"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="path" column="path"/> |
| | | <result property="component" column="component"/> |
| | | <result property="isFrame" column="is_frame"/> |
| | | <result property="isCache" column="is_cache"/> |
| | | <result property="menuType" column="menu_type"/> |
| | | <result property="visible" column="visible"/> |
| | | <result property="status" column="status"/> |
| | | <result property="perms" column="perms"/> |
| | | <result property="icon" column="icon"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="communityId" column="community_id"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `menu_id`,`menu_name`,`parent_id`,`order_num`,`path`,`component`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_at`,`update_by`,`update_at`,`remark`,`community_id` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.SysOperLogDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysOperLogDO"> |
| | | <id property="operId" column="oper_id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="businessType" column="business_type"/> |
| | | <result property="method" column="method"/> |
| | | <result property="requestMethod" column="request_method"/> |
| | | <result property="operatorType" column="operator_type"/> |
| | | <result property="operName" column="oper_name"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="operUrl" column="oper_url"/> |
| | | <result property="operIp" column="oper_ip"/> |
| | | <result property="operLocation" column="oper_location"/> |
| | | <result property="operParam" column="oper_param"/> |
| | | <result property="jsonResult" column="json_result"/> |
| | | <result property="status" column="status"/> |
| | | <result property="errorMsg" column="error_msg"/> |
| | | <result property="operTime" column="oper_time"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="account" column="account"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `oper_id`,`title`,`business_type`,`method`,`request_method`,`operator_type`,`oper_name`,`dept_name`,`oper_url`,`oper_ip`,`oper_location`,`oper_param`,`json_result`,`status`,`error_msg`,`oper_time`,`community_id`,`account` |
| | | </sql> |
| | | |
| | | |
| | | <select id="pageOperLog" resultType="com.panzhihua.common.model.vos.user.SysOperLogVO"> |
| | | select * from sys_oper_log where community_id=#{sysOperLogVO.communityId} order by oper_time 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_user.dao.SysRoleMenuDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysRoleMenuDO"> |
| | | <id property="roleId" column="role_id"/> |
| | | <result property="menuId" column="menu_id"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `role_id`,`menu_id` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.SysUserAgreementDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserAgreementDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="content" column="content"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="name" column="name"/> |
| | | <result property="communityId" column="community_id"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`type`,`content`,`create_at`,`update_at`,`name`,`community_id` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.SysUserFeedbackDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserFeedbackDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="content" column="content"/> |
| | | <result property="photoPath" column="photo_path"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="areaId" column="area_id"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="status" column="status"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`content`,`photo_path`,`create_at`,`update_at`,`user_id`,`area_id`,`community_id`,`status` |
| | | </sql> |
| | | |
| | | |
| | | <select id="detailFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO"> |
| | | select |
| | | u.name, |
| | | u.nick_name, |
| | | f.id, |
| | | f.content, |
| | | f.photo_path, |
| | | u.phone, |
| | | f.create_at, |
| | | c.name communityName |
| | | from sys_user_feedback f |
| | | join sys_user u on f.user_id=u.user_id |
| | | join com_act c on u.community_id=c.community_id |
| | | where f.id=#{id} |
| | | |
| | | </select> |
| | | |
| | | <select id="pageFeedback" resultType="com.panzhihua.common.model.vos.user.SysUserFeedbackVO"> |
| | | select |
| | | u.name, |
| | | u.nick_name, |
| | | f.id, |
| | | u.phone, |
| | | f.create_at, |
| | | f.content, |
| | | f.photo_path, |
| | | c.name communityName |
| | | from sys_user_feedback f |
| | | left join sys_user u on f.user_id=u.user_id |
| | | left join com_act c on u.community_id=c.community_id |
| | | <where> |
| | | <if test='pageFeedBackDTO.phone != null and pageFeedBackDTO.phone.trim() != ""'> |
| | | and u.phone like concat('%',#{pageFeedBackDTO.phone},'%') |
| | | </if> |
| | | <if test='pageFeedBackDTO.name != null and pageFeedBackDTO.name.trim() != ""'> |
| | | and u.name like concat('%',#{pageFeedBackDTO.name},'%') |
| | | </if> |
| | | <if test='pageFeedBackDTO.nickName != null and pageFeedBackDTO.nickName.trim() != ""'> |
| | | and u.nick_name like concat('%',#{pageFeedBackDTO.nickName},'%') |
| | | </if> |
| | | </where> |
| | | order by f.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_user.dao.SysUserInputDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserInputDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="doorNumber" column="door_number"/> |
| | | <result property="isRent" column="is_rent"/> |
| | | <result property="name" column="name"/> |
| | | <result property="nation" column="nation"/> |
| | | <result property="politicalOutlook" column="political_outlook"/> |
| | | <result property="maritalStatus" column="marital_status"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="education" column="education"/> |
| | | <result property="idCard" column="id_card"/> |
| | | <result property="company" column="company"/> |
| | | <result property="residence" column="residence"/> |
| | | <result property="isPanzhihua" column="is_panzhiHua"/> |
| | | <result property="situation" column="situation"/> |
| | | <result property="isContact" column="is_contact"/> |
| | | <result property="major" column="major"/> |
| | | <result property="soldier" column="soldier"/> |
| | | <result property="lowincomeHouseholds" column="lowIncome_households"/> |
| | | <result property="lowincomePeople" column="lowIncome_people"/> |
| | | <result property="oldPeople" column="old_people"/> |
| | | <result property="specialServiceFamily" column="special_service_family"/> |
| | | <result property="keyPersonnel" column="key_personnel"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="areaId" column="area_id"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="houseCode" column="house_code"/> |
| | | <result property="disability" column="disability"/> |
| | | <result property="tags" column="tags"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`door_number`,`is_rent`,`name`,`nation`,`political_outlook`,`marital_status`,`phone`,`education`,`id_card`,`company`,`residence`,`is_panzhiHua`,`situation`,`is_contact`,`major`,`soldier`,`lowIncome_households`,`lowIncome_people`,`old_people`,`special_service_family`,`key_personnel`,`community_id`,`area_id`,`create_at`,`update_at`,`house_code`,`disability`,`tags` |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectUserHouseList" resultType="com.panzhihua.common.model.vos.community.ComMngStructHouseVO"> |
| | | SELECT t1.house_code houseCode, t1.house_name houseName, t1.square, t1.state FROM sys_user_input t LEFT JOIN com_mng_struct_house t1 ON t.house_code = t1.house_code WHERE t.id_card = #{idCard} |
| | | </select> |
| | | |
| | | <select id="selectHouserByareaName" resultType="com.panzhihua.common.model.vos.community.ComMngStructHouseVO"> |
| | | SELECT REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName, h.house_code FROM com_mng_struct_area a join com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5 WHERE a.area_name = #{areaName} |
| | | </select> |
| | | |
| | | <select id="selectComMngStructArea" resultType="com.panzhihua.common.model.vos.community.ComMngStructAreaVO"> |
| | | select a.id,a.community_id,a.area_name,address_detail from com_mng_struct_area a where a.community_id=#{communityId} |
| | | </select> |
| | | |
| | | <select id="specialUserExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> |
| | | SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, |
| | | u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, |
| | | if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, |
| | | if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, |
| | | if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, |
| | | if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, |
| | | if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u JOIN com_mng_struct_area c ON u.area_id |
| | | = c.id where u.community_id=#{exportSpecialUserDTO.communityId} |
| | | <if |
| | | test='exportSpecialUserDTO.areaName != null and exportSpecialUserDTO.areaName.trim() != ""'> |
| | | AND |
| | | c.`area_name` like concat(#{exportUserDTO.areaName},'%') |
| | | </if> |
| | | <if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>and u.`name` |
| | | like concat(#{exportSpecialUserDTO.name},'%') |
| | | </if> |
| | | <if test='exportSpecialUserDTO.name != null and exportSpecialUserDTO.name.trim() != ""'>and u.`name` |
| | | like concat(#{exportSpecialUserDTO.name},'%') |
| | | </if> |
| | | <if test='exportSpecialUserDTO.tags != null and exportSpecialUserDTO.tags.trim() != ""'>CONCAT( IF ( |
| | | t.soldier = 1, '军人,', '' ), IF ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, |
| | | '低收入,', '' ), IF ( t.old_people = 1, '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), |
| | | IFNULL(t.tags,'') ) like concat(#{exportSpecialUserDTO.tags},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> |
| | | SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, |
| | | u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, |
| | | if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, |
| | | if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, |
| | | if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, |
| | | if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, |
| | | if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u where |
| | | u.community_id=#{exportUserDTO.communityId} |
| | | <if |
| | | test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>JOIN |
| | | com_mng_struct_area c ON u.area_id = c.id |
| | | </if> |
| | | <if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>LEFT JOIN |
| | | com_mng_struct_area c ON u.area_id = c.id |
| | | </if> |
| | | <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>AND c.`area_name` |
| | | like concat(#{exportUserDTO.areaName},'%') |
| | | </if> |
| | | <if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>AND u.phone like |
| | | concat(#{exportUserDTO.phone},'%') |
| | | </if> |
| | | <if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>and u.`name` like |
| | | concat(#{exportUserDTO.name},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="pageInputUser" resultType="com.panzhihua.common.model.vos.user.InputUserInfoVO"> |
| | | SELECT t.id, t.`name`, CASE IF ( length( t.id_card ) = 18, cast( substring( t.id_card, 17, 1 ) AS UNSIGNED ) % |
| | | 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) WHEN 1 THEN 1 |
| | | WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, |
| | | t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF ( |
| | | t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ) ) tags, t.create_at as createAt FROM sys_user_input t |
| | | LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id WHERE t.community_id = #{pageInputUserDTO.communityId} |
| | | <if |
| | | test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'>and t.`name` like |
| | | concat(#{pageInputUserDTO.name},'%') |
| | | </if> |
| | | <if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>and t.phone like |
| | | concat(#{pageInputUserDTO.phone},'%') |
| | | </if> |
| | | <if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>AND |
| | | t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') |
| | | </if> |
| | | group by t.id_card |
| | | </select> |
| | | |
| | | <select id="specialInputUser" resultType="com.panzhihua.common.model.vos.user.InputUserInfoVO"> |
| | | SELECT * FROM ( SELECT t.id, t.`name`, CASE IF ( length( t.id_card ) = 18, cast( substring( t.id_card, 17, 1 ) |
| | | AS UNSIGNED ) % 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) |
| | | WHEN 1 THEN 1 WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) |
| | | age, t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF |
| | | ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), IFNULL(t.tags,'') ) tags, t2.house_name as address, |
| | | t.create_at as createAt FROM sys_user_input t LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id LEFT JOIN |
| | | com_mng_struct_house t2 ON t.house_code = t2.house_code WHERE t.community_id = #{pageInputUserDTO.communityId} |
| | | AND (t.soldier=1 OR t.lowIncome_households=1 OR t.lowIncome_people=1 or t.old_people=1 OR |
| | | t.special_service_family=1 OR t.key_personnel=1 OR |
| | | (t.tags IS NOT NULL AND TRIM(t.tags)!='')) |
| | | <if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'> |
| | | and t.`name` like concat(#{pageInputUserDTO.name},'%') |
| | | </if> |
| | | <if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'> |
| | | and t.phone like concat(#{pageInputUserDTO.phone},'%') |
| | | </if> |
| | | <if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'> |
| | | AND t1.`area_name` like concat(#{pageInputUserDTO.areaName},'%') |
| | | </if> |
| | | group by t.id_card ) tt WHERE 1=1 |
| | | <if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags.trim() != ""'> |
| | | and tt.tags like concat('%',#{pageInputUserDTO.tags},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectListFamily" resultType="com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO"> |
| | | SELECT p.name, p.id, if(p.is_rent=1,'合租','家人')relationship, p.id_card, p.phone, year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age, p.create_at FROM sys_user_input p WHERE p.door_number = #{doorNumber} AND p.id !=#{userId} |
| | | </select> |
| | | |
| | | <select id="selectByAreaName" resultType="com.panzhihua.common.model.vos.community.ComMngStructAreaVO"> |
| | | select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName} |
| | | </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_user.dao.SysUserNoticeDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserNoticeDO"> |
| | | <id property="id" column="id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="title" column="title"/> |
| | | <result property="businessType" column="business_type"/> |
| | | <result property="businessTitle" column="business_title"/> |
| | | <result property="businessContent" column="business_content"/> |
| | | <result property="businessTime" column="business_time"/> |
| | | <result property="businessStatus" column="business_status"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="status" column="status"/> |
| | | <result property="businessId" column="business_id"/> |
| | | <result property="activityType" column="activity_type"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`user_id`,`type`,`title`,`business_type`,`business_title`,`business_content`,`business_time`,`business_status`,`create_at`,`update_at`,`status`,`business_id`,`activity_type` |
| | | </sql> |
| | | |
| | | |
| | | <select id="noticeUnreadNum" resultType="com.panzhihua.common.model.vos.user.NoticeUnReadVO"> |
| | | SELECT |
| | | COUNT(case WHEN type=1 then id else null end )activityUnread, |
| | | COUNT(case WHEN type=2 then id else null end )serviceUnread, |
| | | COUNT(case WHEN type=3 then id else null end )systemUnread, |
| | | COUNT(case WHEN type=4 then id else null end )scoreUnread |
| | | FROM |
| | | sys_user_notice |
| | | WHERE |
| | | user_id =#{userId} and `status`=0 |
| | | </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_user.dao.SysUserRoleDAO"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserRoleDO"> |
| | | <id property="userId" column="user_id"/> |
| | | <result property="roleId" column="role_id"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `user_id`,`role_id` |
| | | </sql> |
| | | |
| | | |
| | | </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_user.dao.UserDao"> |
| | | <resultMap id="baseResult" type="com.panzhihua.service_user.model.dos.SysUserDO"> |
| | | <id property="userId" column="user_id"/> |
| | | <result property="account" column="account"/> |
| | | <result property="password" column="password"/> |
| | | <result property="openid" column="openid"/> |
| | | <result property="sessionKey" column="session_key"/> |
| | | <result property="unionid" column="unionid"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="nickName" column="nick_name"/> |
| | | <result property="name" column="name"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="sex" column="sex"/> |
| | | <result property="idCard" column="id_card"/> |
| | | <result property="birthday" column="birthday"/> |
| | | <result property="imageUrl" column="image_url"/> |
| | | <result property="type" column="type"/> |
| | | <result property="job" column="job"/> |
| | | <result property="isVolunteer" column="is_volunteer"/> |
| | | <result property="isPartymember" column="is_partymember"/> |
| | | <result property="status" column="status"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="lastLoginTime" column="last_login_time"/> |
| | | <result property="tags" column="tags"/> |
| | | <result property="familyId" column="family_id"/> |
| | | <result property="faceUrl" column="face_url"/> |
| | | <result property="faceState" column="face_state"/> |
| | | <result property="rejectReson" column="reject_reson"/> |
| | | <result property="areaId" column="area_id"/> |
| | | <result property="cardPhotoFront" column="card_photo_front"/> |
| | | <result property="cardPhotoBack" column="card_photo_back"/> |
| | | <result property="familyBook" column="family_book"/> |
| | | <result property="continuousLandingDays" column="continuous_landing_days"/> |
| | | <result property="isTips" column="is_tips"/> |
| | | <result property="workStatus" column="work_status"/> |
| | | <result property="workStartTime" column="work_start_time"/> |
| | | <result property="workEndTime" column="work_end_time"/> |
| | | <result property="bigAgeTips" column="big_age_tips"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `user_id`,`account`,`password`,`openid`,`session_key`,`unionid`,`phone`,`nick_name`,`name`,`community_id`,`sex`,`id_card`,`birthday`,`image_url`,`type`,`job`,`is_volunteer`,`is_partymember`,`status`,`create_at`,`last_login_time`,`tags`,`family_id`,`face_url`,`face_state`,`reject_reson`,`area_id`,`card_photo_front`,`card_photo_back`,`family_book`,`continuous_landing_days`,`is_tips`,`work_status`,`work_start_time`,`work_end_time`,`big_age_tips` |
| | | </sql> |
| | | |
| | | |
| | | <select id="indexDataCommunityBackstage" resultType="com.panzhihua.common.model.vos.IndexDataVO"> |
| | | SELECT |
| | | COUNT(DISTINCT u.user_id)allUser, |
| | | (select COUNT(m.id) from com_mng_volunteer_mng m where m.community_id=#{communityId} and m.`state`=2)volunteerUser, |
| | | (select count(id) from com_pb_member cpm where cpm.audit_result = 1 and cpm.community_id = #{communityId}) partymemberUser, |
| | | COUNT(h.id)house |
| | | FROM |
| | | sys_user u |
| | | JOIN com_act c ON u.community_id = c.community_id |
| | | LEFT JOIN com_mng_struct_house_user h on u.user_id=h.user_id |
| | | WHERE u.community_id =#{communityId} and u.type=1 |
| | | </select> |
| | | |
| | | <update id="timedTaskContinuousLandingDays"> |
| | | UPDATE sys_user u |
| | | SET u.continuous_landing_days = |
| | | IF |
| | | ( |
| | | DATE_FORMAT( u.last_login_time, '%m-%d-%Y' )= DATE_FORMAT( SYSDATE(), '%m-%d-%Y' ), |
| | | u.continuous_landing_days + 1, |
| | | 0) |
| | | </update> |
| | | |
| | | <select id="selectVolunteerMngByPhone" resultType="com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO"> |
| | | select id,create_at,state,name,phone,photo_path,political_face,reject_reson,apply_reson,address,age,job,integral,community_id,submit_user_id from com_mng_volunteer_mng where phone=#{phone} order by create_at desc limit 1 |
| | | </select> |
| | | |
| | | <select id="selectCountMemberRole" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(a.id) |
| | | FROM |
| | | com_pb_member_role a |
| | | WHERE |
| | | a.phone = #{phone} and community_id=#{userCommunityId} |
| | | </select> |
| | | |
| | | <select id="pageUserAppletsBackstage" resultType="com.panzhihua.common.model.vos.user.SysUserVO"> |
| | | select |
| | | u.user_id, |
| | | u.phone, |
| | | u.nick_name, |
| | | u.name, |
| | | u.tags, |
| | | a.name communityName, |
| | | u.status, |
| | | u.create_at, |
| | | u.last_login_time |
| | | from sys_user u |
| | | left join com_act a on u.community_id=a.community_id |
| | | where |
| | | u.type=1 and u.community_id is not null |
| | | <if test='pageUserAppletsBackstageDTO.phone != null and pageUserAppletsBackstageDTO.phone.trim() != ""'> |
| | | and u.phone=#{pageUserAppletsBackstageDTO.phone} |
| | | </if> |
| | | <if test='pageUserAppletsBackstageDTO.communityId != null and pageUserAppletsBackstageDTO.communityId != 0'>and |
| | | u.community_id=#{pageUserAppletsBackstageDTO.communityId} |
| | | </if> |
| | | <if test='pageUserAppletsBackstageDTO.status != null and pageUserAppletsBackstageDTO.status != 0'>and |
| | | u.status=#{pageUserAppletsBackstageDTO.status} |
| | | </if> |
| | | <if test='pageUserAppletsBackstageDTO.createAtBegin != null '>and u.create_at between |
| | | #{pageUserAppletsBackstageDTO.createAtBegin} and #{pageUserAppletsBackstageDTO.createAtEnd} |
| | | </if> |
| | | <if test='pageUserAppletsBackstageDTO.lastLoginTimeBegin != null '>and u.last_login_time between |
| | | #{pageUserAppletsBackstageDTO.lastLoginTimeBegin} and #{pageUserAppletsBackstageDTO.lastLoginTimeEnd} |
| | | </if> |
| | | order by u.create_at desc |
| | | |
| | | </select> |
| | | |
| | | <select id="selectIndexDataKanban" resultType="com.panzhihua.common.model.vos.IndexDataKanbanVO"> |
| | | SELECT |
| | | COUNT(user_id)allUser, |
| | | COUNT(case WHEN DATE_FORMAT(create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser, |
| | | COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser, |
| | | (SELECT count(user_id) FROM sys_user WHERE type = 1 AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser |
| | | FROM |
| | | sys_user |
| | | where type=1 and community_id is not null |
| | | </select> |
| | | |
| | | <select id="selectCommunityUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | select t.* from ( |
| | | SELECT |
| | | a.`name`, |
| | | COUNT(u.user_id)num |
| | | FROM |
| | | com_act a |
| | | LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 |
| | | GROUP BY a.community_id)t ORDER BY t.num desc |
| | | </select> |
| | | |
| | | <select id="pageUserBackstage" resultType="com.panzhihua.common.model.vos.user.AdministratorsUserVO"> |
| | | SELECT |
| | | u.user_id, |
| | | u.account, |
| | | u.`name`, |
| | | u.`password`, |
| | | u.phone, |
| | | e.role_name, |
| | | e.role_id , |
| | | u.`status`, |
| | | u.create_at, |
| | | u.last_login_time |
| | | FROM |
| | | sys_user u |
| | | JOIN sys_user_role r ON u.user_id = r.user_id |
| | | JOIN sys_role e ON r.role_id = e.role_id |
| | | <if test='administratorsUserVO.roleId != null and administratorsUserVO.roleId!=0'>and |
| | | e.role_id=#{administratorsUserVO.roleId} |
| | | </if> |
| | | <where> |
| | | <if test='administratorsUserVO.communityId != null '>AND u.community_id = |
| | | #{administratorsUserVO.communityId} |
| | | </if> |
| | | <if test='administratorsUserVO.name != null and administratorsUserVO.name.trim() != ""'>AND u.name |
| | | like concat (#{administratorsUserVO.name},'%') |
| | | </if> |
| | | <if test='administratorsUserVO.phone != null and administratorsUserVO.phone.trim() != ""'>AND |
| | | u.phone like concat(#{administratorsUserVO.phone},'%') |
| | | </if> |
| | | <if test='administratorsUserVO.account != null and administratorsUserVO.account.trim() != ""'>AND |
| | | u.account like concat(#{administratorsUserVO.account},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectCommunityActiveUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | SELECT |
| | | COUNT( a.id ) num |
| | | FROM |
| | | com_act_activity a |
| | | WHERE |
| | | DATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT( a.create_at,'%Y-%m-%d') |
| | | </select> |
| | | |
| | | <update id="gridMemberEditStatus"> |
| | | update sys_user set status = #{gridMemberEditDTO.status} where user_id in |
| | | <foreach item="item" collection="gridMemberEditDTO.ids" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </update> |
| | | |
| | | <select id="getGridMemberList" resultType="com.panzhihua.common.model.vos.grid.GridMemberVO"> |
| | | select su.user_id,su.image_url,su.nick_name,su.account,su.phone,su.work_status,su.`status`,ca.name as |
| | | communityName,su.work_start_time,su.work_end_time from sys_user su left join com_act as ca on ca.community_id = |
| | | su.community_id where su.type = 6 |
| | | <if test='memberRelationDTO.status != null'>AND su.status = |
| | | #{memberRelationDTO.status} |
| | | </if> |
| | | <if test='memberRelationDTO.gridCommunityId != null'>AND ca.community_id = |
| | | #{memberRelationDTO.gridCommunityId} |
| | | </if> |
| | | <if test='memberRelationDTO.gridStreetId != null'>AND ca.street_id = #{memberRelationDTO.gridStreetId}</if> |
| | | <if test='memberRelationDTO.workStatus != null'>AND su.work_status = #{memberRelationDTO.workStatus}</if> |
| | | <if test='memberRelationDTO.keyWord != null and memberRelationDTO.keyWord != ""'>and (su.nick_name |
| | | like concat(#{memberRelationDTO.keyWord},'%') OR su.user_id = #{memberRelationDTO.keyWord} OR su.account |
| | | like concat(#{memberRelationDTO.keyWord},'%') OR su.phone like concat(#{memberRelationDTO.keyWord},'%')) |
| | | </if> |
| | | order by su.create_at desc |
| | | </select> |
| | | |
| | | <update id="updateServiceTeam"> |
| | | update com_pb_service_team u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone} |
| | | </update> |
| | | |
| | | <delete id="deleteStoreByPhoneAndStatus"> |
| | | delete from com_shop_store where delete_status = 1 and phone = #{phone} |
| | | </delete> |
| | | |
| | | <select id="getPartyBuildingByIdCard" resultType="java.lang.Long"> |
| | | select id from com_pb_member where audit_result = 1 and id_card = #{idCard} |
| | | </select> |
| | | |
| | | <select id="getGridsMemberList" |
| | | resultType="com.panzhihua.common.model.vos.community.screen.event.EventGridMemberVO"> |
| | | select user_id,nick_name,phone from sys_user where type = 6 and community_id = #{communityId} limit 3 |
| | | </select> |
| | | |
| | | <update id="updateUserArchives"> |
| | | update sys_user set card_photo_front = #{userArchivesVO.cardPhotoFront} |
| | | , card_photo_back = #{userArchivesVO.cardPhotoBack} |
| | | ,family_book = #{userArchivesVO.familyBook} |
| | | ,job = #{userArchivesVO.job} |
| | | where user_id = #{userArchivesVO.userId} |
| | | </update> |
| | | |
| | | <select id="selectCountSysUser" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(ur.role_id) |
| | | FROM |
| | | sys_user u LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id |
| | | LEFT JOIN sys_role r ON ur.role_id = r.role_id |
| | | WHERE ur.role_id IS NOT NULL AND u.phone = #{phone} and r.community_id=#{userCommunityId} |
| | | </select> |
| | | |
| | | <delete id="delGridMemberRelation"> |
| | | delete from event_grid_member_building_relation where grid_member_id = #{gridMemberId} |
| | | </delete> |
| | | |
| | | <update id="updateStoreByPhone"> |
| | | update com_shop_store set sys_user_id = #{sysUserId} where phone = #{phone} |
| | | </update> |
| | | |
| | | <update id="updateComPbMemberUserId"> |
| | | update com_pb_member set user_id = #{userId} where audit_result = 1 and id_card = #{idCard} |
| | | </update> |
| | | |
| | | <select id="getServiceTeamList" resultType="com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamWishVO"> |
| | | select id as managerId,`name` from com_pb_service_team where community_id = #{communityId} |
| | | <if test='param != null and param != ""'>AND `name` like concat(#{param},'%')</if> |
| | | </select> |
| | | |
| | | <select id="getUserListByCommunityId" resultType="com.panzhihua.common.model.vos.user.SysUserVO"> |
| | | select user_id,`name` from sys_user as su where type = 3 and community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="pageUserFace" resultType="com.panzhihua.common.model.vos.LoginUserInfoVO"> |
| | | SELECT |
| | | u.user_id, |
| | | u.face_url, |
| | | u.nick_name, |
| | | u.`name`, |
| | | u.phone, |
| | | u.id_card, |
| | | u.face_state, |
| | | c.area_name communityName, |
| | | u.create_at |
| | | FROM |
| | | sys_user u |
| | | JOIN com_mng_struct_area c ON u.area_id = c.id |
| | | <if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'> |
| | | AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') |
| | | </if> |
| | | where u.face_state is not null and u.type=1 and u.community_id=#{loginUserInfoVO.communityId} |
| | | <if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'> |
| | | and u.`name` like concat(#{loginUserInfoVO.name},'%') |
| | | </if> |
| | | <if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'> |
| | | AND u.phone like concat(#{loginUserInfoVO.phone},'%') |
| | | </if> |
| | | order by u.face_state asc,u.create_at asc |
| | | </select> |
| | | |
| | | <update id="putUserTag"> |
| | | update sys_user set tags = #{sysUserDO.tags} where user_id = #{sysUserDO.userId} |
| | | </update> |
| | | |
| | | <update id="updateMemberRole"> |
| | | update com_pb_member_role u set u.phone=#{newphone},is_reg=1 where u.phone=#{oldphone} |
| | | </update> |
| | | |
| | | <select id="selectCountTeam" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(a.id) |
| | | FROM |
| | | com_pb_service_team a |
| | | WHERE |
| | | a.phone = #{phone} and community_id=#{userCommunityId} |
| | | </select> |
| | | |
| | | <select id="selectExport" resultType="com.panzhihua.common.model.dtos.user.EexcelUserDTO"> |
| | | SELECT |
| | | u.user_id 'order', |
| | | h.house_name doorNumber, |
| | | if(h.state=2,'租住','自主')isRent, |
| | | u.`name`, |
| | | '汉' nation, |
| | | if(u.is_partymember=1,'党员','群众')politicalOutlook, |
| | | '未知' maritalStatus, |
| | | u.phone, |
| | | '未知' education, |
| | | u.id_card, |
| | | '未知' company, |
| | | '未知' residence, |
| | | '未知' isPanZhiHua, |
| | | '未知' situation, |
| | | '未知' isContact, |
| | | '未知' major, |
| | | '未知' soldier, |
| | | '未知' disability, |
| | | '未知' lowIncomeHouseholds, |
| | | '未知' lowIncomePeople, |
| | | '未知' oldPeople, |
| | | '未知' specialServiceFamily, |
| | | '未知' keyPersonnel |
| | | FROM |
| | | sys_user u |
| | | left join com_mng_struct_house_user hu on hu.user_id=u.user_id |
| | | left join com_mng_struct_house h on hu.house_code=h.house_code |
| | | <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>JOIN |
| | | com_mng_struct_area c ON u.area_id = c.id |
| | | </if> |
| | | <if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>LEFT JOIN |
| | | com_mng_struct_area c ON u.area_id = c.id |
| | | </if> |
| | | <if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>AND c.`area_name` |
| | | like concat(#{exportUserDTO.areaName},'%') |
| | | </if> |
| | | where u.community_id=#{exportUserDTO.communityId} and u.type=1 |
| | | <if |
| | | test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>and u.`name` like |
| | | concat(#{exportUserDTO.name},'%') |
| | | </if> |
| | | <if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>AND u.phone like |
| | | concat(#{exportUserDTO.phone},'%') |
| | | </if> |
| | | group by u.user_id |
| | | </select> |
| | | |
| | | <select id="pageNotice" resultType="com.panzhihua.common.model.vos.user.SysUserNoticeVO"> |
| | | select * from |
| | | sys_user_notice |
| | | where |
| | | user_id=#{pageDTO.userId} |
| | | <if test='pageDTO.type != null and pageDTO.type != 0'>and type=#{pageDTO.type} |
| | | </if> |
| | | order by create_at desc |
| | | |
| | | </select> |
| | | |
| | | <select id="selectCountHouse" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(h.id) |
| | | FROM |
| | | com_mng_struct_area a |
| | | LEFT JOIN com_mng_struct_house h on h.parent_code=a.area_code |
| | | WHERE |
| | | a.area_name = #{areaName} |
| | | </select> |
| | | |
| | | <update id="passResetUser"> |
| | | update sys_user set password = #{gridMemberDTO.password} where user_id in |
| | | <foreach item="item" collection="gridMemberDTO.ids" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </update> |
| | | |
| | | <update id="deleteUserTest"> |
| | | update sys_user set nick_name=null ,community_id=null,area_id=null where user_id=#{userId} |
| | | </update> |
| | | |
| | | <select id="selectCountArea" resultType="java.lang.Integer"> |
| | | select COUNT(a.id) from com_mng_struct_area a where a.area_name=#{areaName} |
| | | </select> |
| | | |
| | | <update id="addLcMember"> |
| | | update lc_compare_code_member set local_grid_member_id = #{userId},grid_member_name = #{userName} where id = #{lcMemberId} |
| | | </update> |
| | | |
| | | <update id="updateFaceState"> |
| | | update sys_user set face_state=null where user_id=#{userId} |
| | | </update> |
| | | |
| | | <select id="selectCommunity" resultType="com.panzhihua.common.model.vos.community.ComActVO"> |
| | | select name from com_act where community_id=#{communityId} |
| | | </select> |
| | | |
| | | <delete id="delLcMember"> |
| | | delete from lc_compare_code_member where local_grid_member_id = #{gridMemberId} |
| | | </delete> |
| | | |
| | | <select id="getBuilding" resultType="java.util.Map"> |
| | | select id,village_id,act_id from com_mng_building where id = #{buildingId} |
| | | </select> |
| | | |
| | | <select id="getLcMemberId" resultType="java.util.Map"> |
| | | select lc_grid_member_id,lc_grid_member_name,lc_bind_user_id from lc_compare_code_member where local_grid_member_id = #{gridMemberId} |
| | | </select> |
| | | |
| | | <select id="getGridIsOk" resultType="java.lang.Integer"> |
| | | select count(id) from event_grid_member_relation where grid_member_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.panzhihua.service_user.dao; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_user.ServiceUserApplication; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 应用模块名称 |
| | | * <p> |
| | | * 代码描述 |
| | | * <p> |
| | | * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. |
| | | * <p> |
| | | * Company: 成都呐喊信息技术有限公司 |
| | | * <p> |
| | | * |
| | | * @author manailin |
| | | * @since 2021/9/13 10:27 |
| | | */ |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceUserApplication.class) |
| | | class UserDaoTest { |
| | | |
| | | @Resource |
| | | private UserDao userDao; |
| | | |
| | | @Test |
| | | void pageUserBackstage() { |
| | | Page page = new Page(1, 20); |
| | | AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); |
| | | administratorsUserVO.setName("班长"); |
| | | IPage<AdministratorsUserVO> result = userDao.pageUserBackstage(page, administratorsUserVO); |
| | | String pretty = JSONArray.toJSONString(result, SerializerFeature.PrettyFormat, |
| | | SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | noLoginUrl.add("/api/applets/community/pagedynamic"); |
| | | noLoginUrl.add("/api/applets/community/pageactivity"); |
| | | noLoginUrl.add("/api/applets/community/listactivitysign"); |
| | | noLoginUrl.add("/api/applets/common/uploadimages"); |
| | | noLoginUrl.add("/api/applets/workguide/pageworkguide"); |
| | | noLoginUrl.add("/api/applets/workguide/detailworkguide"); |
| | | noLoginUrl.add("/api/applets/workguide/list"); |
| | |
| | | noLoginUrl.add("/api/applets/community/pagevolunteer"); |
| | | noLoginUrl.add("/api/applets/community/volunteer"); |
| | | noLoginUrl.add("/api/applets/community/evaluate/page"); |
| | | |
| | | if (noLoginUrl.contains(requestURI)) { |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |