Merge branch 'property' into test
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("propertyRepair") |
| | | @Api(tags = "物业报修api") |
| | | public class ComPropertyRepairApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("小程序列表接口") |
| | | @PostMapping("/queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.propertyService.comPropertyRepairSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 小程序添加报修 |
| | | * @param comPropertyRepairVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("小程序添加报修") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | comPropertyRepairVO.setCreateTime(DateUtil.date()); |
| | | comPropertyRepairVO.setCreateBy(this.getUserId()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dcl); |
| | | return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("小程序修改报修") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | if(comPropertyRepairVO!=null&& StringUtils.isNotEmpty(comPropertyRepairVO.getFeedbackContent())){ |
| | | comPropertyRepairVO.setFeedbackBy(this.getUserId()); |
| | | comPropertyRepairVO.setFeedbackTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dpj); |
| | | } |
| | | if(comPropertyRepairVO!=null&&StringUtils.isNotEmpty(comPropertyRepairVO.getReplyContent())){ |
| | | comPropertyRepairVO.setReplyTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.yjs); |
| | | } |
| | | return this.propertyService.comPropertyRepairUpdate(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @GetMapping("/{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.propertyService.comPropertyRepairSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除接口") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyRepairDelete(id); |
| | | } |
| | | |
| | | } |
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; |
| | | } |
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.service.property; |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmSettingVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 物业接口 |
| | | */ |
| | | @FeignClient(name = "property") |
| | | public interface PropertyService { |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comPropertyRepair/queryAll") |
| | | R comPropertyRepairSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyRepair/{id}") |
| | | R comPropertyRepairSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyRepair 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyRepair") |
| | | R comPropertyRepairInsert(@RequestBody ComPropertyRepairVO comPropertyRepair); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepair 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyRepair/update") |
| | | R comPropertyRepairUpdate(@RequestBody ComPropertyRepairVO comPropertyRepair); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyRepair/del") |
| | | R comPropertyRepairDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询报警列表 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | @PostMapping("/comPropertyAlarm/queryAll") |
| | | R comPropertyAlarmSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyAlarm/{id}") |
| | | R comPropertyAlarmSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarm 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarm") |
| | | R comPropertyAlarmInsert(@RequestBody ComPropertyAlarmVO comPropertyAlarm); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyAlarm 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarm/update") |
| | | R comPropertyAlarmUpdate(@RequestBody ComPropertyAlarmVO comPropertyAlarm); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyAlarm/del") |
| | | R comPropertyAlarmDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment/queryAll") |
| | | R comPropertyEquipmentSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyEquipment/{id}") |
| | | R comPropertyEquipmentSelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment") |
| | | R comPropertyEquipmentInsert(@RequestBody ComPropertyEquipmentVO comPropertyEquipment); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyEquipment 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comPropertyEquipment/update") |
| | | R comPropertyEquipmentUpdate(@RequestBody ComPropertyEquipmentVO comPropertyEquipment); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comPropertyEquipment/del") |
| | | R comPropertyEquipmentDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyAlarmSettingVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comPropertyAlarmSetting") |
| | | R comPropertyAlarmSettingInsert(@RequestBody ComPropertyAlarmSettingVO comPropertyAlarmSettingVO); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param communityId 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comPropertyAlarmSetting") |
| | | R comPropertyAlarmSettingSelectOne(@RequestParam("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("comPropertyAlarm") |
| | | @Api(tags = "物业报警api") |
| | | public class ComPropertyAlarmApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComPropertyAlarmVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | <module>service_grid</module> |
| | | <!--网格治理-对接浪潮的市平台综治接口--> |
| | | <module>service_api</module> |
| | | <!--物业service--> |
| | | <module>service_property</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
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.ServiceCommunityApplication</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 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); |
| | | } |
| | | |
| | | } |
| | | 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> |