liuqingkun 3 years ago
commit 56575915c2
  1. 12
      src/main/java/org/springblade/modules/business/controller/ReportController.java
  2. 18
      src/main/java/org/springblade/modules/business/excel/AppealExcel.java
  3. 4
      src/main/java/org/springblade/modules/business/mapper/AppealMapper.java
  4. 36
      src/main/java/org/springblade/modules/business/mapper/AppealMapper.xml
  5. 2
      src/main/java/org/springblade/modules/business/service/ILargeScreenService.java
  6. 14
      src/main/java/org/springblade/modules/business/service/impl/LargeScreenServiceImpl.java

@ -28,8 +28,10 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.TenantDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.modules.business.excel.AppealExcel;
import org.springblade.modules.business.service.ILargeScreenService;
import org.springblade.modules.business.vo.AppealListVO;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.excel.UserImporter;
import org.springframework.web.bind.annotation.GetMapping;
@ -38,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
@ -146,4 +149,13 @@ public class ReportController extends BladeController {
largeScreenService.importAppeal(excels);
return R.success("操作成功");
}
/**
* 导出
*/
@GetMapping("/exportAppeal")
public void exportAppeal(HttpServletResponse response, String appealStatus, String startTime, String endTime, String appealType, String windowId, String username) {
List<AppealExcel> appealExcels = largeScreenService.exportAppeal(appealStatus, startTime, endTime, appealType, windowId, username);
ExcelUtil.export(response, "纠纷数据" + DateUtil.time(), "纠纷数据表", appealExcels, AppealExcel.class);
}
}

@ -1,14 +1,12 @@
package org.springblade.modules.business.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@ColumnWidth(25)
@ -26,8 +24,8 @@ public class AppealExcel implements Serializable {
@ExcelProperty("上报时间")
private String firstRegTime;
// @ExcelProperty("事件来源")
// private String disputeName;
@ExcelProperty("事件来源")
private String sjly;
@ExcelProperty("事件等级")
private String disputeLevel;
@ -35,11 +33,11 @@ public class AppealExcel implements Serializable {
@ExcelProperty("所属镇街")
private String streetId;
// @ExcelProperty("地点")
// private String disputeName;
@ExcelProperty("地点")
private String dd;
// @ExcelProperty("坐标")
// private String disputeName;
@ExcelProperty("坐标")
private String zb;
@ExcelProperty("矛盾 纠纷详情")
private String problemDesc;
@ -47,8 +45,8 @@ public class AppealExcel implements Serializable {
@ExcelProperty("状态")
private String status;
// @ExcelProperty("调解员")
// private String disputeName;
@ExcelProperty("调解员")
private String tjy;
@ExcelProperty("所属部门")
private String handleDept;

@ -18,6 +18,9 @@ package org.springblade.modules.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.business.entity.Appeal;
import org.springblade.modules.business.excel.AppealExcel;
import java.util.List;
/**
* Mapper 接口
@ -27,4 +30,5 @@ import org.springblade.modules.business.entity.Appeal;
public interface AppealMapper extends BaseMapper<Appeal> {
List<AppealExcel> exportAppeal(String appealStatus, String startTime, String endTime, String appealType, String windowId, String username);
}

@ -2,4 +2,40 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.business.mapper.AppealMapper">
<select id="exportAppeal" resultType="org.springblade.modules.business.excel.AppealExcel">
SELECT
if(a.dispute_id is null, a.dispute_name, biz.dict_value) as disputeName,
b.username,
a.first_reg_time as firstRegTime,
CASE a.dispute_level when 0 then '简单' when 1 then '一般' when 2 then '重大' when 3 then '疑难' else '' end
disputeLevel,
if(a.street_id is null, '', biz.dict_value) as streetId,
a.problem_desc as problemDesc,
CASE a.status when 0 then '待处理' when 1 then '正在处理' when 2 then '达成协议' when 3 then '调解成功' else '' end status,
if(a.handle_dept is null, '', u.name) as handleDept
FROM mp_appeal a
LEFT JOIN mp_appeal_visitor b ON a.id = b.appeal_id
LEFT JOIN blade_dict_biz biz ON a.dispute_id = biz.id
LEFT JOIN blade_user u ON a.handle_dept = u.id
WHERE a.source_type = 0 and b.sort = 1
<if test="appealStatus != null and appealStatus != ''">
and a.status = #{appealStatus}
</if>
<if test="startTime != null and startTime != ''">
and a.first_reg_time &gt; #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and a.first_reg_time &lt; #{endTime}
</if>
<if test="appealType != null and appealType != ''">
and a.dispute_id = #{appealType}
</if>
<if test="windowId != null and windowId != ''">
and a.handle_dept = #{windowId}
</if>
<if test="username != null and username != ''">
and b.username like concat(concat('%', #{username}), '%')
</if>
ORDER BY a.first_reg_time DESC
</select>
</mapper>

@ -55,4 +55,6 @@ public interface ILargeScreenService {
IPage<Appeal> getImmediateList(String streetId, IPage<Appeal> page);
void importAppeal(List<AppealExcel> excels);
List<AppealExcel> exportAppeal(String appealStatus, String startTime, String endTime, String appealType, String windowId, String username);
}

@ -23,12 +23,14 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.common.cache.DictBizCache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.common.enums.DictBizEnum;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.business.entity.Appeal;
import org.springblade.modules.business.entity.AppealVisitor;
import org.springblade.modules.business.entity.DataEntity;
import org.springblade.modules.business.excel.AppealExcel;
import org.springblade.modules.business.mapper.AppealMapper;
import org.springblade.modules.business.service.IAppealService;
import org.springblade.modules.business.service.IAppealVisitorService;
import org.springblade.modules.business.service.ILargeScreenService;
@ -62,6 +64,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
private final IAppealService appealService;
private final AppealMapper appealMapper;
private final IAppealVisitorService appealVisitorService;
private final IUserService userService;
@ -348,7 +352,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
}
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void importAppeal(List<AppealExcel> excels) {
if (CollectionUtils.isNotEmpty(excels)) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -419,7 +423,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
appeal.setSkipGrant(0);
// 数据来源 0:系统添加, 1:数据导入
appeal.setSourceType(1);
appeal.setSourceType(BusinessConstant.SOURCE_TYPE_IMPORT);
// 上访人员
if (StringUtils.isNotBlank(excel.getUsername())) {
@ -437,6 +441,12 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
}
}
@Override
public List<AppealExcel> exportAppeal(String appealStatus, String startTime, String endTime, String appealType, String windowId, String username) {
List<AppealExcel> excels = appealMapper.exportAppeal(appealStatus, startTime, endTime, appealType, windowId, username);
return excels;
}
@Override
public Map<String, List<DataEntity>> getAppealHot() {
Map<String, List<DataEntity>> map = new HashMap();

Loading…
Cancel
Save