6 files modified
3 files added
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.disputeRecord.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.disputeRecord.excel.DisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.excel.DisputeRecordImporter; |
| | | import org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.disputeRecord.entity.DisputeRecordEntity; |
| | | import org.springblade.modules.disputeRecord.vo.DisputeRecordVO; |
| | | import org.springblade.modules.disputeRecord.wrapper.DisputeRecordWrapper; |
| | | import org.springblade.modules.disputeRecord.service.IDisputeRecordService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 矛盾纠纷记录表 控制器 |
| | |
| | | return R.data(disputeRecordService.getDetail(disputeRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 导入矛盾纠纷记录表 |
| | | */ |
| | | @PostMapping("import-disputeRecord") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "导入矛盾纠纷记录表", notes = "传入excel") |
| | | public R importDisputeRecord(MultipartFile file, Integer isCovered) { |
| | | DisputeRecordImporter disputeRecordImporter = new DisputeRecordImporter(disputeRecordService, 1 == 1); |
| | | ExcelUtil.save(file, disputeRecordImporter, DisputeRecordExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出矛盾纠纷记录表 |
| | | */ |
| | | @GetMapping("export-disputeRecord") |
| | | @ApiOperationSupport(order = 11) |
| | | @ApiOperation(value = "导出矛盾纠纷记录表", notes = "传入disputeRecord") |
| | | public void exportDisputeRecord(DisputeRecordVO disputeRecord, HttpServletResponse response) { |
| | | List<ExportDisputeRecordExcel> list = disputeRecordService.exportDisputeRecordList(disputeRecord); |
| | | ExcelUtil.export(response, "矛盾纠纷记录数据" + DateUtil.time(), "矛盾纠纷记录数据表", list, ExportDisputeRecordExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("/export-template") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | List<DisputeRecordExcel> list = new ArrayList<>(); |
| | | DisputeRecordExcel disputeRecordExcel = new DisputeRecordExcel(); |
| | | disputeRecordExcel.setAddress("江西省上饶市茅家岭街道***社区****"); |
| | | disputeRecordExcel.setLng("117.12241224"); |
| | | disputeRecordExcel.setLat("28.154412451"); |
| | | disputeRecordExcel.setEventTime("2024-01-01 12:00:00"); |
| | | disputeRecordExcel.setNameOne("张三"); |
| | | disputeRecordExcel.setPhoneOne("131****1234"); |
| | | disputeRecordExcel.setIdCardOne("360728*********0000"); |
| | | disputeRecordExcel.setNameTwo("李四"); |
| | | disputeRecordExcel.setPhoneTwo("132****1234"); |
| | | disputeRecordExcel.setIdCardTwo("360728*********0001"); |
| | | disputeRecordExcel.setDisputeType("2"); |
| | | disputeRecordExcel.setDisputeContent("隔壁半夜放音乐太大声"); |
| | | disputeRecordExcel.setInjuryFlag("否"); |
| | | disputeRecordExcel.setInjuryDesc(""); |
| | | disputeRecordExcel.setAlarmNum(3); |
| | | disputeRecordExcel.setSource("1"); |
| | | disputeRecordExcel.setHandleResult("未化解"); |
| | | // 加入集合 |
| | | list.add(disputeRecordExcel); |
| | | // 写入返回 |
| | | ExcelUtil.export(response, "矛盾纠纷记录数据模板", "矛盾纠纷记录数据表", list, DisputeRecordExcel.class); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "事发纬度") |
| | | private String lat; |
| | | |
| | | /** 事发时间 */ |
| | | @ApiModelProperty(value = "事发时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "event_time") |
| | | private Date eventTime; |
| | | /** |
| | | * 纠纷方1姓名 |
| | | */ |
| | |
| | | * 受伤情况描述 |
| | | */ |
| | | @ApiModelProperty(value = "受伤情况描述") |
| | | private Integer injuryDesc; |
| | | private String injuryDesc; |
| | | /** |
| | | * 报警次数 |
| | | */ |
| New file |
| | |
| | | package org.springblade.modules.disputeRecord.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | import org.springblade.common.excel.ExcelDictItemLabel; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * DisputeRecordExcel |
| | | * 矛盾纠纷事件 |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class DisputeRecordExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | /** 事发地址 */ |
| | | @ExcelProperty( "事发地址") |
| | | private String address; |
| | | /** |
| | | * 事发经度 |
| | | */ |
| | | @ExcelProperty( "事发经度") |
| | | private String lng; |
| | | /** |
| | | * 事发纬度 |
| | | */ |
| | | @ExcelProperty( "事发纬度") |
| | | private String lat; |
| | | |
| | | /** |
| | | * 事发时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ExcelProperty( "事发时间") |
| | | private String eventTime; |
| | | |
| | | /** |
| | | * 纠纷方1姓名 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1姓名") |
| | | @ExcelProperty( "纠纷方1姓名") |
| | | private String nameOne; |
| | | /** |
| | | * 纠纷方1电话 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1电话") |
| | | @ExcelProperty( "纠纷方1电话") |
| | | private String phoneOne; |
| | | /** |
| | | * 纠纷方1身份证号码 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1身份证号码") |
| | | @ExcelProperty( "纠纷方1身份证号码") |
| | | private String idCardOne; |
| | | /** |
| | | * 纠纷方2姓名 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2姓名") |
| | | @ExcelProperty( "纠纷方2姓名") |
| | | private String nameTwo; |
| | | /** |
| | | * 纠纷方2电话 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2电话") |
| | | @ExcelProperty( "纠纷方2电话") |
| | | private String phoneTwo; |
| | | /** |
| | | * 纠纷方2身份证号码 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2身份证号码") |
| | | @ExcelProperty( "纠纷方2身份证号码") |
| | | private String idCardTwo; |
| | | |
| | | /** |
| | | * 纠纷类型 业务字典:disputeType |
| | | */ |
| | | @ApiModelProperty(value = "纠纷类型 业务字典:disputeType") |
| | | @ExcelProperty( value = "纠纷类型(家庭婚恋纠纷/邻里纠纷/劳务劳资纠纷/经济纠纷/消防纠纷/医疗纠纷/交通纠纷/其他纠纷)",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "disputeType") |
| | | @ExcelDictItem(type = "disputeType") |
| | | private String disputeType; |
| | | /** |
| | | * 纠纷内容 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷内容") |
| | | @ExcelProperty( "纠纷内容") |
| | | private String disputeContent; |
| | | /** |
| | | * 0:否 1:是 是否受伤 |
| | | */ |
| | | @ApiModelProperty(value = "0:否 1:是 是否受伤 ") |
| | | @ExcelProperty( "是否受伤(是/否)") |
| | | private String injuryFlag; |
| | | /** |
| | | * 受伤情况描述 |
| | | */ |
| | | @ApiModelProperty(value = "受伤情况描述") |
| | | @ExcelProperty( "受伤情况描述") |
| | | private String injuryDesc; |
| | | /** |
| | | * 报警次数 |
| | | */ |
| | | @ApiModelProperty(value = "报警次数") |
| | | @ExcelProperty( "报警次数") |
| | | private Integer alarmNum; |
| | | /** |
| | | * 信息来源:1:群众报警 2:e呼即办推送 3:走访发现 业务字典:disputeSource |
| | | */ |
| | | @ApiModelProperty(value = "信息来源 业务字典:disputeSource") |
| | | @ExcelProperty( value = "信息来源(群众报警/e呼即办推送/走访发现/)",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "disputeSource") |
| | | @ExcelDictItem(type = "disputeSource") |
| | | private String source; |
| | | /** |
| | | * 处理结果 1:已化解 2:未化解 3:移送e呼即办 |
| | | */ |
| | | @ApiModelProperty(value = "处理结果 1:已化解 2:未化解 3:移送e呼即办") |
| | | @ExcelProperty( value = "处理结果(已化解/未化解/移送e呼即办)") |
| | | private String handleResult; |
| | | } |
| | | |
| New file |
| | |
| | | package org.springblade.modules.disputeRecord.excel; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | import org.springblade.modules.disputeRecord.service.IDisputeRecordService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 矛盾纠纷事件数据导入类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class DisputeRecordImporter implements ExcelImporter<DisputeRecordExcel> { |
| | | |
| | | private final IDisputeRecordService disputeRecordService; |
| | | private final Boolean isCovered; |
| | | |
| | | @Override |
| | | public void save(List<DisputeRecordExcel> data) { |
| | | disputeRecordService.importDisputeRecord(data, isCovered); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.disputeRecord.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * DisputeRecordExcel |
| | | * 矛盾纠纷事件 |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class ExportDisputeRecordExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | /** 事发地址 */ |
| | | @ExcelProperty( "事发地址") |
| | | private String address; |
| | | // /** |
| | | // * 事发经度 |
| | | // */ |
| | | // @ExcelProperty( "事发经度") |
| | | // private String lng; |
| | | // /** |
| | | // * 事发纬度 |
| | | // */ |
| | | // @ExcelProperty( "事发纬度") |
| | | // private String lat; |
| | | /** |
| | | * 事发时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ExcelProperty( "事发时间") |
| | | private Date eventTime; |
| | | |
| | | /** |
| | | * 纠纷方1姓名 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1姓名") |
| | | @ExcelProperty( "纠纷方1姓名") |
| | | private String nameOne; |
| | | /** |
| | | * 纠纷方1电话 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1电话") |
| | | @ExcelProperty( "纠纷方1电话") |
| | | private String phoneOne; |
| | | /** |
| | | * 纠纷方1身份证号码 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方1身份证号码") |
| | | @ExcelProperty( "纠纷方1身份证号码") |
| | | private String idCardOne; |
| | | /** |
| | | * 纠纷方2姓名 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2姓名") |
| | | @ExcelProperty( "纠纷方2姓名") |
| | | private String nameTwo; |
| | | /** |
| | | * 纠纷方2电话 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2电话") |
| | | @ExcelProperty( "纠纷方2电话") |
| | | private String phoneTwo; |
| | | /** |
| | | * 纠纷方2身份证号码 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷方2身份证号码") |
| | | @ExcelProperty( "纠纷方2身份证号码") |
| | | private String idCardTwo; |
| | | |
| | | /** |
| | | * 纠纷类型 业务字典:disputeType |
| | | */ |
| | | @ApiModelProperty(value = "纠纷类型 业务字典:disputeType") |
| | | @ExcelProperty( value = "纠纷类型(家庭婚恋纠纷/邻里纠纷/劳务劳资纠纷/经济纠纷/消防纠纷/医疗纠纷/交通纠纷/其他纠纷)",converter = ExcelDictConverter.class) |
| | | @ExcelDictItem(type = "disputeType") |
| | | private String disputeType; |
| | | /** |
| | | * 纠纷内容 |
| | | */ |
| | | @ApiModelProperty(value = "纠纷内容") |
| | | @ExcelProperty( "纠纷内容") |
| | | private String disputeContent; |
| | | /** |
| | | * 0:否 1:是 是否受伤 |
| | | */ |
| | | @ApiModelProperty(value = "0:否 1:是 是否受伤 ") |
| | | @ExcelProperty( "是否受伤(是/否)") |
| | | private String injuryFlag; |
| | | /** |
| | | * 受伤情况描述 |
| | | */ |
| | | @ApiModelProperty(value = "受伤情况描述") |
| | | @ExcelProperty( "受伤情况描述") |
| | | private String injuryDesc; |
| | | /** |
| | | * 报警次数 |
| | | */ |
| | | @ApiModelProperty(value = "报警次数") |
| | | @ExcelProperty( "报警次数") |
| | | private Integer alarmNum; |
| | | /** |
| | | * 信息来源:1:群众报警 2:e呼即办推送 3:走访发现 业务字典:disputeSource |
| | | */ |
| | | @ApiModelProperty(value = "信息来源 业务字典:disputeSource") |
| | | @ExcelProperty( value = "信息来源(群众报警/e呼即办推送/走访发现/)",converter = ExcelDictConverter.class) |
| | | @ExcelDictItem(type = "disputeSource") |
| | | private String source; |
| | | /** |
| | | * 处理结果 1:已化解 2:未化解 3:移送e呼即办 |
| | | */ |
| | | @ApiModelProperty(value = "处理结果 1:已化解 2:未化解 3:移送e呼即办") |
| | | @ExcelProperty( value = "处理结果(已化解/未化解/移送e呼即办)") |
| | | private String handleResult; |
| | | |
| | | |
| | | /** |
| | | * 乡镇名称 |
| | | */ |
| | | @ApiModelProperty(value = "乡镇名称", example = "") |
| | | @ExcelProperty( value = "地区") |
| | | private String townName; |
| | | |
| | | /** |
| | | * 派出所名称 |
| | | */ |
| | | @ApiModelProperty(value = "派出所名称", example = "") |
| | | @ExcelProperty( value = "辖区派出所") |
| | | private String pcsName; |
| | | } |
| | | |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.disputeRecord.entity.DisputeRecordEntity; |
| | | import org.springblade.modules.disputeRecord.excel.DisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.vo.DisputeRecordVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @return |
| | | */ |
| | | DisputeRecordVO getDetail(@Param("disputeRecord") DisputeRecordVO disputeRecord); |
| | | |
| | | /** |
| | | * 导出矛盾纠纷记录表 |
| | | * @param disputeRecord |
| | | * @return |
| | | */ |
| | | List<ExportDisputeRecordExcel> exportDisputeRecordList(@Param("disputeRecord") DisputeRecordVO disputeRecord, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | } |
| | |
| | | and jdr.id_card_two like concat('%',#{disputeRecord.idCardTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.startTime != null and disputeRecord.startTime != ''"> |
| | | and date_format(jdr.create_time,'%Y-%m-%d') >= #{disputeRecord.startTime} |
| | | and date_format(jdr.event_time,'%Y-%m-%d') >= #{disputeRecord.startTime} |
| | | </if> |
| | | <if test="disputeRecord.endTime != null and disputeRecord.endTime != ''"> |
| | | and date_format(jdr.create_time,'%Y-%m-%d') <= #{disputeRecord.endTime} |
| | | and date_format(jdr.event_time,'%Y-%m-%d') <= #{disputeRecord.endTime} |
| | | </if> |
| | | <if test="disputeRecord.searchKey!=null and disputeRecord.searchKey!=''"> |
| | | and CONCAT( |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--导出矛盾纠纷记录表--> |
| | | <select id="exportDisputeRecordList" resultType="org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel"> |
| | | select |
| | | jdr.address, |
| | | jdr.event_time, |
| | | jdr.name_one, |
| | | jdr.phone_one, |
| | | jdr.id_card_one, |
| | | jdr.name_two, |
| | | jdr.phone_two, |
| | | jdr.id_card_two, |
| | | jdr.dispute_type, |
| | | jdr.dispute_content, |
| | | case when jdr.injury_flag=1 then '是' |
| | | when jdr.injury_flag=0 then '否' |
| | | end as injury_flag, |
| | | jdr.injury_desc, |
| | | jdr.alarm_num, |
| | | jdr.source, |
| | | case when jdr.handle_result=1 then '已化解' |
| | | when jdr.handle_result=2 then '未化解' |
| | | when jdr.handle_result=3 then '移送e呼即办' |
| | | end as handle_result, |
| | | br.town_name as townName, |
| | | br.name as communityName, |
| | | jpag.pcs_name pcsName |
| | | from jczz_dispute_record jdr |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jdr.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jdr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jpag.community_code |
| | | where jdr.is_deleted = 0 |
| | | <if test="disputeRecord.disputeType != null"> |
| | | and jdr.dispute_type = #{disputeRecord.disputeType} |
| | | </if> |
| | | <if test="disputeRecord.injuryFlag != null"> |
| | | and jdr.injury_flag = #{disputeRecord.injuryFlag} |
| | | </if> |
| | | <if test="disputeRecord.source != null"> |
| | | and jdr.source = #{disputeRecord.source} |
| | | </if> |
| | | <if test="disputeRecord.townName != null and disputeRecord.townName != ''"> |
| | | and br.town_name like concat('%',#{disputeRecord.townName},'%') |
| | | </if> |
| | | <if test="disputeRecord.communityName != null and disputeRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{disputeRecord.communityName},'%') |
| | | </if> |
| | | <if test="disputeRecord.pcsName != null and disputeRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{disputeRecord.pcsName},'%') |
| | | </if> |
| | | <if test="disputeRecord.address != null and disputeRecord.address != ''"> |
| | | and jdr.address like concat('%',#{disputeRecord.address},'%') |
| | | </if> |
| | | <if test="disputeRecord.disputeContent != null and disputeRecord.disputeContent != ''"> |
| | | and jdr.dispute_content like concat('%',#{disputeRecord.disputeContent},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameOne != null and disputeRecord.nameOne != ''"> |
| | | and jdr.name_one like concat('%',#{disputeRecord.nameOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneOne != null and disputeRecord.phoneOne != ''"> |
| | | and jdr.phone_one like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardOne != null and disputeRecord.idCardOne != ''"> |
| | | and jdr.id_card_one like concat('%',#{disputeRecord.idCardOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameTwo != null and disputeRecord.nameTwo != ''"> |
| | | and jdr.name_two like concat('%',#{disputeRecord.nameTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneTwo != null and disputeRecord.phoneTwo != ''"> |
| | | and jdr.phone_two like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardTwo != null and disputeRecord.idCardTwo != ''"> |
| | | and jdr.id_card_two like concat('%',#{disputeRecord.idCardTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.startTime != null and disputeRecord.startTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') >= #{disputeRecord.startTime} |
| | | </if> |
| | | <if test="disputeRecord.endTime != null and disputeRecord.endTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') <= #{disputeRecord.endTime} |
| | | </if> |
| | | <if test="disputeRecord.searchKey!=null and disputeRecord.searchKey!=''"> |
| | | and CONCAT( |
| | | ifnull(jdr.name_one,''), |
| | | ifnull(jdr.phone_one,''), |
| | | ifnull(jdr.name_two,''), |
| | | ifnull(jdr.phone_two,''), |
| | | ifnull(jdr.address,''), |
| | | ifnull(jdr.dispute_content,'') |
| | | ) like CONCAT ('%', #{disputeRecord.searchKey},'%') |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="disputeRecord.roleName != null and disputeRecord.roleName != ''"> |
| | | <if test="disputeRecord.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jg.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jg.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="disputeRecord.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') or jpag.community_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | order by jdr.id desc,jdr.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.disputeRecord.entity.DisputeRecordEntity; |
| | | import org.springblade.modules.disputeRecord.excel.DisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.vo.DisputeRecordVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 矛盾纠纷记录表 服务类 |
| | |
| | | * @return |
| | | */ |
| | | DisputeRecordVO getDetail(DisputeRecordVO disputeRecord); |
| | | |
| | | /** |
| | | * 矛盾纠纷事件数据导入类 |
| | | * @author Chill |
| | | */ |
| | | void importDisputeRecord(List<DisputeRecordExcel> data, Boolean isCovered); |
| | | |
| | | /** |
| | | * 导出矛盾纠纷记录表 |
| | | * @param disputeRecord |
| | | * @return |
| | | */ |
| | | List<ExportDisputeRecordExcel> exportDisputeRecordList(DisputeRecordVO disputeRecord); |
| | | } |
| | |
| | | package org.springblade.modules.disputeRecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.param.GridSet; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.backblast.entity.BackblastWarnHanRecEntity; |
| | | import org.springblade.modules.disputeRecord.entity.DisputeRecordEntity; |
| | | import org.springblade.modules.disputeRecord.excel.DisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel; |
| | | import org.springblade.modules.disputeRecord.vo.DisputeRecordVO; |
| | | import org.springblade.modules.disputeRecord.mapper.DisputeRecordMapper; |
| | | import org.springblade.modules.disputeRecord.service.IDisputeRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 矛盾纠纷记录表 服务实现类 |
| | |
| | | public DisputeRecordVO getDetail(DisputeRecordVO disputeRecord) { |
| | | return baseMapper.getDetail(disputeRecord); |
| | | } |
| | | |
| | | /** |
| | | * 矛盾纠纷事件数据导入类 |
| | | * @param data |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importDisputeRecord(List<DisputeRecordExcel> data, Boolean isCovered) { |
| | | for (DisputeRecordExcel disputeRecordExcel : data) { |
| | | // 获取转换数据对象 |
| | | DisputeRecordEntity disputeRecordEntity |
| | | = Objects.requireNonNull(BeanUtil.copy(disputeRecordExcel, DisputeRecordEntity.class)); |
| | | //处理经纬度 |
| | | GridSet gridSet |
| | | = new GridSet<>().invoke(DisputeRecordEntity.class, disputeRecordEntity, "lng", "lat", "gridCode", "jwGridCode"); |
| | | //处理需要转换的数据(字典/非字典) |
| | | // 纠纷类型 |
| | | if (!Strings.isBlank(disputeRecordExcel.getDisputeType())) { |
| | | disputeRecordEntity.setDisputeType(Integer.parseInt(disputeRecordExcel.getDisputeType())); |
| | | } |
| | | // 信息来源 |
| | | if (!Strings.isBlank(disputeRecordExcel.getSource())) { |
| | | disputeRecordEntity.setSource(Integer.parseInt(disputeRecordExcel.getSource())); |
| | | } |
| | | // 受伤情况 0:否 1:是 |
| | | if (!Strings.isBlank(disputeRecordExcel.getInjuryFlag())) { |
| | | if (disputeRecordExcel.getInjuryFlag().equals("是")){ |
| | | disputeRecordEntity.setInjuryFlag(1); |
| | | } |
| | | if (disputeRecordExcel.getInjuryFlag().equals("否")){ |
| | | disputeRecordEntity.setInjuryFlag(0); |
| | | } |
| | | } |
| | | // 处理结果 1:已化解 2:未化解 3:移送e呼即办 |
| | | if (!Strings.isBlank(disputeRecordExcel.getHandleResult())) { |
| | | if (disputeRecordExcel.getHandleResult().equals("已化解")) { |
| | | disputeRecordEntity.setHandleResult(1); |
| | | } |
| | | if (disputeRecordExcel.getHandleResult().equals("未化解")) { |
| | | disputeRecordEntity.setHandleResult(2); |
| | | } |
| | | if (disputeRecordExcel.getHandleResult().equals("移送e呼即办")) { |
| | | disputeRecordEntity.setHandleResult(3); |
| | | } |
| | | } |
| | | // 日期处理 |
| | | if (!Strings.isBlank(disputeRecordExcel.getEventTime())) { |
| | | try { |
| | | Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(disputeRecordExcel.getEventTime()); |
| | | disputeRecordEntity.setEventTime(date); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // 判断是否重复 |
| | | QueryWrapper<DisputeRecordEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("address", disputeRecordExcel.getAddress()) |
| | | .eq("event_time", disputeRecordEntity.getEventTime()) |
| | | .eq("is_deleted", 0); |
| | | // 查询 |
| | | List<DisputeRecordEntity> list = list(queryWrapper); |
| | | if (list.size()>0){ |
| | | // 更新 |
| | | disputeRecordEntity.setId(list.get(0).getId()); |
| | | // 更新 |
| | | updateById(disputeRecordEntity); |
| | | }else { |
| | | // 插入 |
| | | save(disputeRecordEntity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出矛盾纠纷记录表 |
| | | * @param disputeRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExportDisputeRecordExcel> exportDisputeRecordList(DisputeRecordVO disputeRecord) { |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(DisputeRecordVO.class, disputeRecord); |
| | | return baseMapper.exportDisputeRecordList( |
| | | disputeRecord, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | } |
| | | } |