| | |
| | | /* |
| | | * 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.log.logger.BladeLogger; |
| | | 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.jackson.JsonUtil; |
| | | 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; |
| | | |
| | | /** |
| | | * 矛盾纠纷记录表 控制器 |
| | |
| | | public class DisputeRecordController { |
| | | |
| | | private final IDisputeRecordService disputeRecordService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 矛盾纠纷记录表 详情 |
| | |
| | | return R.data(disputeRecordService.getDetail(disputeRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 导入矛盾纠纷记录表 |
| | | */ |
| | | @PostMapping("import-disputeRecord") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "批量导入矛盾纠纷记录", notes = "传入excel") |
| | | public R importDisputeRecord(MultipartFile file, Integer isCovered) { |
| | | bladeLogger.info("批量导入矛盾纠纷记录", JsonUtil.toJson(isCovered)); |
| | | String result = disputeRecordService.importDisputeRecord(ExcelUtil.read(file, DisputeRecordExcel.class),isCovered==1); |
| | | return R.data(200, result, null); |
| | | } |
| | | |
| | | /** |
| | | * 导出矛盾纠纷记录表 |
| | | */ |
| | | @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.setGenderOne("男"); |
| | | disputeRecordExcel.setPhoneOne("131****1234"); |
| | | disputeRecordExcel.setIdCardOne("360728*********0000"); |
| | | disputeRecordExcel.setNameTwo("李四"); |
| | | disputeRecordExcel.setGenderTwo("女"); |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * e呼即办数据临时转换到矛盾纠纷 |
| | | */ |
| | | @GetMapping("/eCallToDis") |
| | | @ApiOperationSupport(order = 13) |
| | | public void eCallToDis() { |
| | | disputeRecordService.eCallToDis(); |
| | | } |
| | | |
| | | } |