Commit 127a9e77 by wqc

大屏法律监督

parent 7b830c6f
...@@ -136,7 +136,11 @@ public class BigScreenController { ...@@ -136,7 +136,11 @@ public class BigScreenController {
return ResultVo.success(bigScreenService.getZhiBiaoData(diqu,type)); return ResultVo.success(bigScreenService.getZhiBiaoData(diqu,type));
} }
@ApiOperation("法律监督")
@GetMapping(value = "/getJianDuData")
public ResultVo getJianDuData(@RequestParam String diqu,String type) {
return ResultVo.success(bigScreenService.getJianDuData(diqu,type));
}
......
...@@ -60,6 +60,13 @@ public class DataCollectFileController { ...@@ -60,6 +60,13 @@ public class DataCollectFileController {
return ResultVo.success(dataCollectFileService.importBacxToDb(file)); return ResultVo.success(dataCollectFileService.importBacxToDb(file));
} }
@ApiOperation("导入法律监督表")
@PostMapping(value = "/importFljdToDb")
public ResultVo importFljdToDb(MultipartFile file) {
AssertUtils.isTrue(file != null && file.getSize() > 0, "请选择文件");
return ResultVo.success(dataCollectFileService.importFljdToDb(file));
}
@ApiOperation("执行文件汇聚") @ApiOperation("执行文件汇聚")
@PostMapping(value = "/execute") @PostMapping(value = "/execute")
public ResultVo executeDb(@RequestParam("dataCollectSettingId") Integer dataCollectSettingId, @RequestParam("collectType") Integer collectType, MultipartFile file) { public ResultVo executeDb(@RequestParam("dataCollectSettingId") Integer dataCollectSettingId, @RequestParam("collectType") Integer collectType, MultipartFile file) {
......
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "fljd_data")
@Builder
public class FljdData {
/**
* id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 单位
*/
private String unit;
/**
* 监督数据
*/
private String controlData;
/**
* 数据类型
*/
private String dataType;
/**
* createTime
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
}
package com.zq.datacollect.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.Ajzlzypjzbdy;
import com.zq.datacollect.entity.FljdData;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@DS("hjk")
public interface FljdDataMapper extends BaseMapper<FljdData> {
@Select("SELECT data_type as dataType FROM fljd_data")
List<Object> selectDataType();
}
...@@ -7,6 +7,7 @@ import com.zq.datacollect.entity.QueryDb; ...@@ -7,6 +7,7 @@ import com.zq.datacollect.entity.QueryDb;
import com.zq.datacollect.holder.DatabaseHolder; import com.zq.datacollect.holder.DatabaseHolder;
import com.zq.datacollect.mapper.BananChengxiaoMapper; import com.zq.datacollect.mapper.BananChengxiaoMapper;
import com.zq.datacollect.mapper.DataCollectMapper; import com.zq.datacollect.mapper.DataCollectMapper;
import com.zq.datacollect.mapper.FljdDataMapper;
import com.zq.datacollect.mapper.QueryDbMapper; import com.zq.datacollect.mapper.QueryDbMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -31,6 +32,8 @@ public class BigScreenService { ...@@ -31,6 +32,8 @@ public class BigScreenService {
private QueryDbMapper queryDbMapper; private QueryDbMapper queryDbMapper;
@Resource @Resource
private BananChengxiaoMapper bananChengxiaoMapper; private BananChengxiaoMapper bananChengxiaoMapper;
@Resource
private FljdDataMapper fljdDataMapper;
public Object getModelTypeCount() { public Object getModelTypeCount() {
...@@ -350,4 +353,24 @@ public class BigScreenService { ...@@ -350,4 +353,24 @@ public class BigScreenService {
} }
return mapList; return mapList;
} }
public Object getJianDuData(String diqu, String type) {
List<DataCollectSetting> collectList = getCollectList();
Integer toDbId = null;
for (DataCollectSetting list : collectList) {
toDbId = list.getToDbId();
}
JdbcTemplate jdbcTemplate = DatabaseHolder.getJdbcTemplate(toDbId);
List<Map<String, Object>> mapList =null;
if (diqu==null||diqu.equals("")) {
mapList=jdbcTemplate.queryForList("SELECT unit,control_data as controlData,data_type as dataType FROM fljd_data WHERE data_type LIKE CONCAT('%','" + type + "','%')");
}else if(type==null||type.equals("")){
mapList = jdbcTemplate.queryForList("SELECT 单位 as unit,1刑事立案监督 as xslajd,2侦查活动监督 as zchdjd,3审判活动监督 as spzxhdjd,4刑事执行活动违法监督 as xszxhdwfjd,5职务犯罪立案 as zwfzla,6民事裁判监督案件 as mscpjdaj,7民事审判监督案件 as msspjdaj,8民事执行监督案件 as mszxjdaj,9行政裁判监督 as xzcpjd,10行政审判监督 as xzspjd,11行政执行活动监督 as xzzxhdjd,12公益诉讼诉前检察 as gyssqjc,13四大检察监督合计 as sdjcjdhj,14办案总数 as bazs,15监督类案件占比 as jdlajzb,16刑检监督合计 as xjjdhj, 17刑检办案总数 as xjbazs,18刑检监督比重 as xjjdbz,19民事监督合计 as msjdhj,20民事办案总数 as msbazs,21民事监督占比 as msjdhj,22行政监督合计 as xzjdhj,23行政办案总数 as xzbazs,24行政监督占比 as xzjdzb,25民事行政依职权 as msxzyzq,26民行案件总数 as mxajzs,27民行依职职占比 as mxyzzzb,28公益办案总数 as gybazs,29公益监督占比 as gyjdzb FROM fljdsj WHERE 单位 LIKE CONCAT('%','" + diqu + "','%')");
}else{
mapList=jdbcTemplate.queryForList("SELECT unit,control_data as controlData,data_type as dataType FROM fljd_data WHERE unit LIKE CONCAT('%','" + diqu + "','%') AND data_type LIKE CONCAT('%','" + type + "','%')");
}
return mapList;
}
} }
...@@ -22,4 +22,6 @@ public interface DataCollectFileService { ...@@ -22,4 +22,6 @@ public interface DataCollectFileService {
Object importExcelToDb(MultipartFile file); Object importExcelToDb(MultipartFile file);
Object importBacxToDb(MultipartFile file); Object importBacxToDb(MultipartFile file);
Object importFljdToDb(MultipartFile file);
} }
...@@ -49,6 +49,9 @@ public class DataCollectFileServiceImpl extends ServiceImpl<DataCollectSettingFi ...@@ -49,6 +49,9 @@ public class DataCollectFileServiceImpl extends ServiceImpl<DataCollectSettingFi
@Resource @Resource
private ProxyTypeMapper proxyTypeMapper; private ProxyTypeMapper proxyTypeMapper;
@Resource
private FljdDataMapper fljdDataMapper;
@Override @Override
public DataCollectSettingFile get(Integer dataCollectSettingId) { public DataCollectSettingFile get(Integer dataCollectSettingId) {
return lambdaQuery().eq(DataCollectSettingFile::getDataCollectSettingId, dataCollectSettingId).one(); return lambdaQuery().eq(DataCollectSettingFile::getDataCollectSettingId, dataCollectSettingId).one();
...@@ -224,4 +227,58 @@ public class DataCollectFileServiceImpl extends ServiceImpl<DataCollectSettingFi ...@@ -224,4 +227,58 @@ public class DataCollectFileServiceImpl extends ServiceImpl<DataCollectSettingFi
return "导入成功"; return "导入成功";
} }
@Override
public Object importFljdToDb(MultipartFile file) {
List<FljdData> list = fljdDataMapper.selectList(Wrappers.lambdaQuery(FljdData.builder().build()));
if (list != null && list.size() > 0) {
for (FljdData one : list) {
fljdDataMapper.deleteById(one.getId());
}
}
ExcelReader reader;
try {
reader = ExcelUtil.getReader(file.getInputStream());
} catch (IOException e) {
e.printStackTrace();
throw new BusinessException("文件解析失败");
}
List<List<Object>> readList = reader.read(2, 16);
List<Object> titleRow = reader.readRow(15);
int end = 0;
String pre = "";
List<String> rateList = new ArrayList<>();
for (Object o : titleRow) {
String str = Convert.toStr(o);
String content = str.trim();
if ("单位".equals(content)) {
end++;
continue;
}
if (StrUtil.isBlank(pre) || !pre.equals(content)) {
pre = content;
rateList.add(pre);
}
end++;
}
List<Object> dataType =reader.readRow(1);
for (List<Object> objectList : readList) {
String city = Convert.toStr(CollUtil.get(objectList, 0), "");
int index = 1;
int k=1;
for (int i = 0; i < rateList.size(); i++) {
String typeName = Convert.toStr(CollUtil.get(dataType, k++), "");
FljdData fljdData = new FljdData();
fljdData.setUnit(city);
fljdData.setControlData(Convert.toStr(CollUtil.get(objectList, index++)));
fljdData.setDataType(typeName);
fljdData.setCreateTime(DateUtil.date());
fljdDataMapper.insert(fljdData);
}
}
return "导入库成功";
}
} }
...@@ -99,7 +99,7 @@ public class MetaDataCategoryController { ...@@ -99,7 +99,7 @@ public class MetaDataCategoryController {
public ResultVo add(@RequestBody MetaDataCategory metaDataCategory) { public ResultVo add(@RequestBody MetaDataCategory metaDataCategory) {
AssertUtils.notNull(metaDataCategory.getCategoryName(), "缺少类别目录名称"); AssertUtils.notNull(metaDataCategory.getCategoryName(), "缺少类别目录名称");
AssertUtils.notNull(metaDataCategory.getStandardLevel(), "缺少类别目录级别"); AssertUtils.notNull(metaDataCategory.getStandardLevel(), "缺少类别目录级别");
AssertUtils.notNull(metaDataCategory.getCategoryCode(), "缺少类别目录编码"); // AssertUtils.notNull(metaDataCategory.getCategoryCode(), "缺少类别目录编码");
// 根据CategoryCode查询是否存在记录 // 根据CategoryCode查询是否存在记录
MetaDataCategory parent = metaDataCategoryService.getOne(new LambdaQueryWrapper<MetaDataCategory>() MetaDataCategory parent = metaDataCategoryService.getOne(new LambdaQueryWrapper<MetaDataCategory>()
.eq(MetaDataCategory::getId, metaDataCategory.getCategoryCode())); .eq(MetaDataCategory::getId, metaDataCategory.getCategoryCode()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment