607 lines
23 KiB
Java
607 lines
23 KiB
Java
package com.rzyc.controller;
|
|
|
|
import com.common.utils.*;
|
|
import com.common.utils.model.MultiResult;
|
|
import com.common.utils.model.Pager;
|
|
import com.common.utils.model.SingleResult;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.rzyc.bean.StorageData;
|
|
import com.rzyc.bean.bigdata.*;
|
|
import com.rzyc.bean.bigdata.check.EntSpread;
|
|
import com.rzyc.bean.bigdata.check.OrgCheck;
|
|
import com.rzyc.bean.bigdata.check.OrgDangerInfo;
|
|
import com.rzyc.bean.bigdata.check.OrgEntRiskNum;
|
|
import com.rzyc.bean.bigdata.check.*;
|
|
import com.rzyc.bean.bigdata.dto.ControlCheckDto;
|
|
import com.rzyc.bean.bigdata.dto.StorageDto;
|
|
import com.rzyc.bean.bigdata.user.PerformInfo;
|
|
import com.rzyc.bean.bigdata.user.UnitList;
|
|
import com.rzyc.enums.AreaOrgType;
|
|
import com.rzyc.enums.DelState;
|
|
import com.rzyc.enums.MemberType;
|
|
import com.rzyc.enums.RiskLevel;
|
|
import com.rzyc.model.Storage;
|
|
import com.rzyc.model.ent.SysEnterprise;
|
|
import com.rzyc.model.user.SysUser;
|
|
import io.swagger.annotations.*;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.validation.Valid;
|
|
import java.util.*;
|
|
|
|
@Api(tags = "大屏")
|
|
@Controller
|
|
@CrossOrigin("*")
|
|
@RequestMapping("/bigdata")
|
|
public class BigdataController extends com.rzyc.controller.BaseController {
|
|
|
|
@ApiOperation(value = "仓库列表", notes = "仓库列表")
|
|
@GetMapping("/storageList")
|
|
@ResponseBody
|
|
public MultiResult<Storage> storageList(StorageDto storageDto)throws Exception{
|
|
MultiResult<Storage> result = new MultiResult<>();
|
|
String nameHouse = TypeConversion.getCondition(storageDto.getName());
|
|
List<Storage> storages = storageMapper.findByLon(nameHouse,storageDto.getRiskLevel(),storageDto.getStreetCode());
|
|
if(null != storages && storages.size() > 0){
|
|
result.setData(storages);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "仓库统计数据", notes = "仓库统计数据")
|
|
@GetMapping("/storageData")
|
|
@ResponseBody
|
|
public SingleResult<StorageData> storageData(StorageDto storageDto)throws Exception{
|
|
SingleResult<StorageData> result = new SingleResult<>();
|
|
String nameHouse = TypeConversion.getCondition(storageDto.getName());
|
|
Integer total = storageMapper.countByRiskLevel("",nameHouse,storageDto.getStreetCode());
|
|
Integer redlevel = storageMapper.countByRiskLevel(RiskLevel.RED.getLevel()+"",nameHouse,storageDto.getStreetCode());
|
|
Integer orangelevel = storageMapper.countByRiskLevel(RiskLevel.ORANGE.getLevel()+"",nameHouse,storageDto.getStreetCode());
|
|
Integer yellowlevel = storageMapper.countByRiskLevel(RiskLevel.YELLOW.getLevel()+"",nameHouse,storageDto.getStreetCode());
|
|
Integer bluelevel = storageMapper.countByRiskLevel(RiskLevel.BLUE.getLevel()+"",nameHouse,storageDto.getStreetCode());
|
|
StorageData storageData = new StorageData();
|
|
storageData.setTotal(total);
|
|
storageData.setRedlevel(redlevel);
|
|
storageData.setOrangelevel(orangelevel);
|
|
storageData.setYellowlevel(yellowlevel);
|
|
storageData.setBluelevel(bluelevel);
|
|
|
|
result.setData(storageData);
|
|
return result;
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "周检查情况", notes = "周检查情况")
|
|
@GetMapping("/weekCheckInfo")
|
|
@ApiImplicitParam(name = "orgCode",value = "街道id 不传为街道检查信息 传为街道下社区检查信息")
|
|
@ResponseBody
|
|
public MultiResult<WeekCheckInfo> weekCheckInfo(String orgCode)throws Exception{
|
|
MultiResult<WeekCheckInfo> result = new MultiResult<>();
|
|
String parentId = constantsConfigure.getSuperiorOrgCode();
|
|
if(StringUtils.isNotBlank(orgCode)){
|
|
parentId = orgCode;
|
|
}
|
|
List<WeekCheckInfo> checkInfos = bookEntCheckMapper.weekCheckInfo(parentId);
|
|
result.setData(checkInfos);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "责任网格区、镇街领导列表", notes = "责任网格区、镇街领导列表")
|
|
@GetMapping("/leaderUser")
|
|
@ResponseBody
|
|
public MultiResult<DutyNet> leaderUser()throws Exception{
|
|
MultiResult<DutyNet> result = new MultiResult<>();
|
|
List<Integer> memberTypes = new ArrayList<>();
|
|
memberTypes.add(MemberType.DISTRICT_LEADER.getType());
|
|
List<DutyNet> dutyNets = new LinkedList<>();
|
|
List<DutyNet> topNets = sysUserMapper.leaderUser(memberTypes);
|
|
List<DutyNet> streetNets = sysUserMapper.streetCharger(constantsConfigure.getSuperiorOrgCode());
|
|
dutyNets.addAll(topNets);
|
|
dutyNets.addAll(streetNets);
|
|
if(null != dutyNets && dutyNets.size() > 0){
|
|
for (DutyNet dutyNet : dutyNets){
|
|
//领导列表
|
|
dutyNet.setType(1);
|
|
}
|
|
}
|
|
result.setData(dutyNets);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "责任网格街道列表", notes = "责任网格街道列表")
|
|
@GetMapping("/streetList/{targetId}")
|
|
@ResponseBody
|
|
public MultiResult<DutyNet> streetList(@PathVariable String targetId)throws Exception{
|
|
MultiResult<DutyNet> result = new MultiResult<>();
|
|
String streetCode = targetId;
|
|
SysUser sysUser = sysUserMapper.selectByPrimaryKey(targetId);
|
|
if(null != sysUser){
|
|
streetCode = sysUser.getOrgcode();
|
|
}
|
|
List<DutyNet> dutyNets = new ArrayList<>();
|
|
|
|
if(null != sysUser){
|
|
dutyNets = bookEntCheckMapper.streetCheckList(streetCode,MemberType.TOWN_JUST.getType());
|
|
}else{
|
|
dutyNets = bookEntCheckMapper.streetCheck(streetCode,MemberType.TOWN_JUST.getType());
|
|
}
|
|
|
|
for (DutyNet dutyNet : dutyNets){
|
|
|
|
//计算覆盖率
|
|
Double rate = 0.0;
|
|
if(dutyNet.getTotalEnt() > 0){
|
|
rate = Arith.div(dutyNet.getCheckEnt(),dutyNet.getTotalEnt(),2);
|
|
}
|
|
rate = rate * 100;
|
|
rate = TypeConversion.decimalFormat(rate,2);
|
|
dutyNet.setCheckRate(rate);
|
|
|
|
//街道列表
|
|
dutyNet.setType(2);
|
|
}
|
|
|
|
result.setData(dutyNets);
|
|
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "责任网格社区列表", notes = "责任网格社区列表")
|
|
@GetMapping("/communityList/{targetId}")
|
|
@ResponseBody
|
|
public MultiResult<DutyNet> communityList(@PathVariable String targetId)throws Exception{
|
|
MultiResult<DutyNet> result = new MultiResult<>();
|
|
List<DutyNet> dutyNets = bookEntCheckMapper.streetCheckList(targetId,MemberType.COMMUNITY_LEADER.getType());
|
|
for (DutyNet dutyNet : dutyNets){
|
|
|
|
//计算覆盖率
|
|
Double rate = 0.0;
|
|
if(dutyNet.getTotalEnt() > 0){
|
|
rate = Arith.div(dutyNet.getCheckEnt(),dutyNet.getTotalEnt(),2);
|
|
}
|
|
rate = rate * 100;
|
|
rate = TypeConversion.decimalFormat(rate,2);
|
|
dutyNet.setCheckRate(rate);
|
|
|
|
//社区列表
|
|
dutyNet.setType(3);
|
|
}
|
|
|
|
result.setData(dutyNets);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "应急信息", notes = "应急信息")
|
|
@GetMapping("/emergencyInfo")
|
|
@ResponseBody
|
|
public SingleResult<EmergencyInfo> emergencyInfo()throws Exception{
|
|
SingleResult<EmergencyInfo> result = new SingleResult<>();
|
|
EmergencyInfo emergencyInfo = new EmergencyInfo();
|
|
|
|
//应急队伍数
|
|
Long teamNum = othTeamMapper.counOthTeam("%%","");
|
|
emergencyInfo.setTeamNum(teamNum.intValue());
|
|
|
|
//应急专家
|
|
Long expertNum = othExpertMapper.countExpertPage("%%","");
|
|
emergencyInfo.setExpertNum(expertNum.intValue());
|
|
|
|
//应急预案
|
|
Long planNum = othPlanMapper.counTOthPlan("%%","","","");
|
|
emergencyInfo.setPlanNum(planNum.intValue());
|
|
|
|
//避难场所
|
|
Integer placeNum = othRefugeMapper.countAll();
|
|
emergencyInfo.setPlaceNum(placeNum);
|
|
|
|
//应急仓库
|
|
Integer warehouseNum = otheWareHouseMapper.countByDelState(DelState.NOT_DEL.getState());
|
|
emergencyInfo.setWarehouseNum(warehouseNum);
|
|
|
|
|
|
result.setData(emergencyInfo);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "监督检查信息", notes = "监督检查信息")
|
|
@GetMapping("/controlCheck/{type}")
|
|
@ApiImplicitParam(name = "type",value = "类型 1、行业部门 2、产业功能区 3、镇街")
|
|
@ResponseBody
|
|
public SingleResult<ControlCheck> controlCheck(@PathVariable Integer type)throws Exception{
|
|
SingleResult<ControlCheck> result = new SingleResult<>();
|
|
|
|
ControlCheck controlCheck = new ControlCheck();
|
|
|
|
if(1 == type){
|
|
//行业部门
|
|
controlCheck = unitCheck();
|
|
}else if(2 == type){
|
|
//园区
|
|
controlCheck = areaCheck(AreaOrgType.PARK.getType());
|
|
}else if(3 == type){
|
|
//镇街
|
|
controlCheck = areaCheck(AreaOrgType.AREA.getType());
|
|
}
|
|
|
|
result.setData(controlCheck);
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* 行业部门监督检查情况
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public ControlCheck unitCheck()throws Exception{
|
|
|
|
ControlCheck controlCheck = new ControlCheck();
|
|
//企业总数
|
|
Integer entNum = sysEnterpriseMapper.countAll("");
|
|
|
|
//检查企业总数
|
|
Integer checkEntNum = sysEnterpriseMapper.unitCheckNum(constantsConfigure.getUnitId(),null);
|
|
//红色企业
|
|
Integer redNum = sysEnterpriseMapper.unitCheckNum(constantsConfigure.getUnitId(),RiskLevel.RED.getLevel());
|
|
//橙色企业
|
|
Integer orangeNum = sysEnterpriseMapper.unitCheckNum(constantsConfigure.getUnitId(),RiskLevel.RED.getLevel());
|
|
//黄色企业
|
|
Integer yellowNum = sysEnterpriseMapper.unitCheckNum(constantsConfigure.getUnitId(),RiskLevel.RED.getLevel());
|
|
//蓝色企业
|
|
Integer blueNum = checkEntNum - redNum - orangeNum - yellowNum;
|
|
|
|
controlCheck.setEntNum(entNum);
|
|
controlCheck.setCheckEntNum(checkEntNum);
|
|
controlCheck.setBlueNum(blueNum);
|
|
controlCheck.setRedNum(redNum);
|
|
controlCheck.setOrangeNum(orangeNum);
|
|
controlCheck.setYellowNum(yellowNum);
|
|
|
|
//检查覆盖率
|
|
Double rate = Arith.div(checkEntNum,entNum,2);
|
|
rate = rate * 100;
|
|
rate = TypeConversion.decimalFormat(rate,2);
|
|
controlCheck.setCheckRate(rate);
|
|
|
|
//隐患数量
|
|
Integer dangerNum = bookEntHTMapper.unitDangerNum(constantsConfigure.getUnitId());
|
|
controlCheck.setDangerNum(dangerNum);
|
|
return controlCheck;
|
|
}
|
|
|
|
/**
|
|
* 属地监督检查情况
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public ControlCheck areaCheck(Integer orgType)throws Exception{
|
|
|
|
ControlCheck controlCheck = new ControlCheck();
|
|
//企业总数
|
|
Integer entNum = sysEnterpriseMapper.countAll("");
|
|
|
|
//检查企业总数
|
|
Integer checkEntNum = sysEnterpriseMapper.areaCheckNum(orgType,null);
|
|
//红色企业
|
|
Integer redNum = sysEnterpriseMapper.areaCheckNum(orgType,RiskLevel.RED.getLevel());
|
|
//橙色企业
|
|
Integer orangeNum = sysEnterpriseMapper.areaCheckNum(orgType,RiskLevel.ORANGE.getLevel());
|
|
//黄色企业
|
|
Integer yellowNum = sysEnterpriseMapper.areaCheckNum(orgType,RiskLevel.YELLOW.getLevel());
|
|
//蓝色企业
|
|
Integer blueNum = checkEntNum - redNum - orangeNum - yellowNum;
|
|
|
|
controlCheck.setEntNum(entNum);
|
|
controlCheck.setCheckEntNum(checkEntNum);
|
|
controlCheck.setBlueNum(blueNum);
|
|
controlCheck.setRedNum(redNum);
|
|
controlCheck.setOrangeNum(orangeNum);
|
|
controlCheck.setYellowNum(yellowNum);
|
|
|
|
//检查覆盖率
|
|
Double rate = Arith.div(checkEntNum,entNum,2);
|
|
rate = rate * 100;
|
|
rate = TypeConversion.decimalFormat(rate,2);
|
|
controlCheck.setCheckRate(rate);
|
|
|
|
//隐患数量
|
|
Integer dangerNum = bookEntHTMapper.areaDangerNum(orgType);
|
|
controlCheck.setDangerNum(dangerNum);
|
|
return controlCheck;
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "地图街道信息", notes = "地图街道信息")
|
|
@GetMapping("/streetInfo")
|
|
@ResponseBody
|
|
public MultiResult<StreetInfo> streetInfo()throws Exception{
|
|
MultiResult<StreetInfo> result = new MultiResult<>();
|
|
List<StreetInfo> streetInfos = sysEnterpriseMapper.streetInfo(constantsConfigure.getSuperiorOrgCode());
|
|
result.setData(streetInfos);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "清单履职信息", notes = "地图街道信息")
|
|
@GetMapping("/performList/{type}")
|
|
@ApiImplicitParam(name = "type",value = "类型 1、行业部门 2、产业功能区 3、镇街")
|
|
@ResponseBody
|
|
public MultiResult<UnitList> performList(@PathVariable Integer type)throws Exception{
|
|
MultiResult<UnitList> result = new MultiResult<>();
|
|
String year = Calendar.getInstance().get(Calendar.YEAR)+"";
|
|
List<UnitList> unitLists = new ArrayList<>();
|
|
|
|
if(1 == type){
|
|
//行业部门
|
|
unitLists = listPerformMapper.unitPerformInfo(constantsConfigure.getUnitId(),year);
|
|
}else if(2 == type){
|
|
//园区
|
|
unitLists = listPerformMapper.areaPerformInfo(constantsConfigure.getAreaUnitId(),year,AreaOrgType.PARK.getType());
|
|
}else if(3 == type){
|
|
//镇街
|
|
unitLists = listPerformMapper.areaPerformInfo(constantsConfigure.getAreaUnitId(),year,AreaOrgType.AREA.getType());
|
|
}
|
|
//处理清单履职信息
|
|
handleUnitLists(unitLists);
|
|
|
|
result.setData(unitLists);
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* 处理清单履职信息
|
|
* @param unitLists
|
|
* @throws Exception
|
|
*/
|
|
protected void handleUnitLists(List<UnitList> unitLists)throws Exception{
|
|
for (UnitList unitList : unitLists){
|
|
|
|
//总数
|
|
Integer totalNum = 0;
|
|
//完成数
|
|
Integer completeNum = 0;
|
|
|
|
|
|
List<PerformInfo> performInfos = unitList.getPerformInfos();
|
|
if (null != performInfos && performInfos.size() > 0) {
|
|
for (PerformInfo performInfo : performInfos){
|
|
|
|
//频率
|
|
Integer frequency = performInfo.getFrequency();
|
|
if(null == frequency ){
|
|
if(StringUtils.isNotBlank(performInfo.getListFactorId())){
|
|
frequency = 1;
|
|
}else{
|
|
frequency = 0;
|
|
}
|
|
}
|
|
|
|
//指标
|
|
Integer checkStandard = performInfo.getCheckStandard();
|
|
if(null == checkStandard){
|
|
if(StringUtils.isNotBlank(performInfo.getListFactorId())){
|
|
checkStandard = 1;
|
|
}else{
|
|
checkStandard = 0;
|
|
}
|
|
}
|
|
//单个清单目标数
|
|
Integer facotrTotal = frequency * checkStandard;
|
|
|
|
//完成数超过目标数 完成数等于目标数
|
|
Integer detailNum = performInfo.getDetailNum();
|
|
if(detailNum > facotrTotal){
|
|
detailNum = facotrTotal;
|
|
}
|
|
totalNum += facotrTotal;
|
|
completeNum += detailNum;
|
|
}
|
|
}
|
|
|
|
unitList.setPerformInfos(new ArrayList<>());
|
|
|
|
unitList.setCompleteNum(completeNum);
|
|
unitList.setTotalNum(totalNum);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "三方检查", notes = "三方检查")
|
|
@GetMapping("/orgCheck")
|
|
@ApiImplicitParam(name = "orgCode",value = "地区id 点击街道之后传街道id")
|
|
@ResponseBody
|
|
public SingleResult<OrgCheck> orgCheck(String orgCode)throws Exception{
|
|
SingleResult<OrgCheck> result = new SingleResult<>();
|
|
|
|
OrgCheck orgCheck = new OrgCheck();
|
|
|
|
//企业总数
|
|
Integer entNum = sysEnterpriseMapper.countAll(orgCode);
|
|
orgCheck.setEntNum(entNum);
|
|
|
|
//已检查企业
|
|
Integer checkEntNum = sysEnterpriseMapper.checkedNum(orgCode);
|
|
orgCheck.setCheckEntNum(checkEntNum);
|
|
|
|
//未检查企业
|
|
Integer notCheckEntNum = sysEnterpriseMapper.notCheckNum(orgCode);
|
|
orgCheck.setNotCheckEntNum(notCheckEntNum);
|
|
|
|
//机构服务企业风险分布
|
|
EntSpread orgNum = new EntSpread();
|
|
OrgEntRiskNum orgEntNum = sysEnterpriseMapper.orgEntNum(orgCode);
|
|
if(null != orgEntNum.getEntTotal()){
|
|
orgEntNum.setEntTotal(0);
|
|
}
|
|
if(null != orgEntNum.getYellowNum()){
|
|
orgEntNum.setYellowNum(0);
|
|
}
|
|
if(null != orgEntNum.getOrangeNum()){
|
|
orgEntNum.setOrangeNum(0);
|
|
}
|
|
if(null != orgEntNum.getRedNum()){
|
|
orgEntNum.setRedNum(0);
|
|
}
|
|
Integer blueNum = orgEntNum.getEntTotal() - orgEntNum.getYellowNum() - orgEntNum.getOrangeNum() - orgEntNum.getRedNum();
|
|
orgEntNum.setBlueNum(blueNum);
|
|
orgNum.setEntTotal(orgEntNum.getEntTotal());
|
|
orgNum.setEntRiskNum(orgEntNum);
|
|
orgCheck.setOrgNum(orgNum);
|
|
|
|
//无机构服务企业风险分布
|
|
EntSpread notOrgNum = new EntSpread();
|
|
OrgEntRiskNum notOrgEntNum = sysEnterpriseMapper.notOrgEntNum(orgCode);
|
|
blueNum = notOrgEntNum.getEntTotal() - notOrgEntNum.getYellowNum() - notOrgEntNum.getOrangeNum() - notOrgEntNum.getRedNum();
|
|
notOrgEntNum.setBlueNum(blueNum);
|
|
notOrgNum.setEntTotal(notOrgEntNum.getEntTotal());
|
|
notOrgNum.setEntRiskNum(notOrgEntNum);
|
|
orgCheck.setNotOrgNum(notOrgNum);
|
|
|
|
|
|
result.setData(orgCheck);
|
|
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "三方检查隐患", notes = "三方检查隐患")
|
|
@GetMapping("/orgDangerInfo")
|
|
@ApiImplicitParam(name = "orgCode",value = "地区id 点击街道之后传街道id")
|
|
@ResponseBody
|
|
public SingleResult<OrgDangerInfo> orgDangerInfo(String orgCode)throws Exception{
|
|
SingleResult<OrgDangerInfo> result = new SingleResult<>();
|
|
OrgDangerInfo orgDangerInfo = orgDangerMapper.orgDangerInfo(orgCode);
|
|
result.setData(orgDangerInfo);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "风险研判", notes = "风险研判")
|
|
@GetMapping("/riskJudge")
|
|
@ApiImplicitParam(name = "orgCode",value = "地区id 点击街道之后传街道id")
|
|
@ResponseBody
|
|
public SingleResult<RiskJudge> riskJudge(String orgCode)throws Exception{
|
|
SingleResult<RiskJudge> result = new SingleResult<>();
|
|
RiskJudge riskJudge = new RiskJudge();
|
|
|
|
//风险较大镇
|
|
List<String> topRiskStreet = sysOrgMapper.topRiskStreet();
|
|
riskJudge.setTopRiskStreet(topRiskStreet);
|
|
|
|
//风险较大行业
|
|
List<IndustryRisk> industryRisks = sysEnterpriseMapper.industryRisk(orgCode);
|
|
riskJudge.setIndustryRisks(industryRisks);
|
|
|
|
result.setData(riskJudge);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "监督检查-企业管控分析", notes = "监督检查-企业管控分析")
|
|
@GetMapping("/controlCheckEnt")
|
|
@ResponseBody
|
|
public SingleResult<Pager<SysEnterprise>> controlCheckEnt(@Valid ControlCheckDto controlCheckDto)throws Exception{
|
|
SingleResult<Pager<SysEnterprise>> result = new SingleResult<>();
|
|
Pager<SysEnterprise> pager = new Pager<>();
|
|
PageHelper.startPage(controlCheckDto.getPage(), controlCheckDto.getPageSize());
|
|
Page<SysEnterprise> page = (Page<SysEnterprise>)sysEnterpriseMapper.entPage(controlCheckDto.getOrgCode());
|
|
getDatePage(pager,page);
|
|
result.setData(pager);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "监督检查-事故趋势分析", notes = "监督检查-企业管控分析")
|
|
@GetMapping("/controlCheckAccident")
|
|
@ApiImplicitParam(name = "orgCode",value = "地区id")
|
|
@ResponseBody
|
|
public MultiResult<AccidentNum> controlCheckAccident(String orgCode)throws Exception{
|
|
MultiResult<AccidentNum> result = new MultiResult<>();
|
|
String year = Calendar.getInstance().get(Calendar.YEAR)+"";
|
|
year = "2020";
|
|
year = TypeConversion.getCondition(year);
|
|
List<AccidentNum> accidentNums = accidentMapper.accidentNum(year,orgCode);
|
|
result.setData(accidentNums);
|
|
return result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 街道监督检查情况
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public ControlCheck srteetCheck(String streetCode)throws Exception{
|
|
|
|
ControlCheck controlCheck = new ControlCheck();
|
|
//企业总数
|
|
Integer entNum = sysEnterpriseMapper.countAll(streetCode);
|
|
|
|
//检查企业总数
|
|
Integer checkEntNum = sysEnterpriseMapper.streetCheckNum(streetCode,null);
|
|
//红色企业
|
|
Integer redNum = sysEnterpriseMapper.streetCheckNum(streetCode,RiskLevel.RED.getLevel());
|
|
//橙色企业
|
|
Integer orangeNum = sysEnterpriseMapper.streetCheckNum(streetCode,RiskLevel.ORANGE.getLevel());
|
|
//黄色企业
|
|
Integer yellowNum = sysEnterpriseMapper.streetCheckNum(streetCode,RiskLevel.YELLOW.getLevel());
|
|
//蓝色企业
|
|
Integer blueNum = checkEntNum - redNum - orangeNum - yellowNum;
|
|
|
|
controlCheck.setEntNum(entNum);
|
|
controlCheck.setCheckEntNum(checkEntNum);
|
|
controlCheck.setBlueNum(blueNum);
|
|
controlCheck.setRedNum(redNum);
|
|
controlCheck.setOrangeNum(orangeNum);
|
|
controlCheck.setYellowNum(yellowNum);
|
|
|
|
|
|
//检查覆盖率
|
|
Double rate = 0.0;
|
|
if(entNum > 0){
|
|
rate = Arith.div(checkEntNum,entNum,2);
|
|
}
|
|
rate = rate * 100;
|
|
rate = TypeConversion.decimalFormat(rate,2);
|
|
controlCheck.setCheckRate(rate);
|
|
|
|
//隐患数量
|
|
Integer dangerNum = bookEntHTMapper.streetDangerNum(streetCode);
|
|
controlCheck.setDangerNum(dangerNum);
|
|
return controlCheck;
|
|
}
|
|
|
|
@ApiOperation(value = "街道监督检查信息", notes = "街道监督检查信息")
|
|
@GetMapping("/controlCheckStreet/{orgCode}")
|
|
@ApiImplicitParam(name = "orgCode",value = "街道id",required = true)
|
|
@ResponseBody
|
|
public SingleResult<ControlCheck> controlCheckStreet(@PathVariable String orgCode)throws Exception{
|
|
SingleResult<ControlCheck> result = new SingleResult<>();
|
|
ControlCheck controlCheck = srteetCheck(orgCode);
|
|
result.setData(controlCheck);
|
|
return result;
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "清单履职-街道履职", notes = "清单履职-街道履职")
|
|
@GetMapping("/performListStreet/{orgCode}")
|
|
@ResponseBody
|
|
public MultiResult<UnitList> performListStreet(@PathVariable String orgCode)throws Exception{
|
|
MultiResult<UnitList> result = new MultiResult<>();
|
|
String year = Calendar.getInstance().get(Calendar.YEAR)+"";
|
|
List<UnitList> unitLists = listPerformMapper.streetPerformInfo(orgCode,year);
|
|
//处理清单履职信息
|
|
handleUnitLists(unitLists);
|
|
result.setData(unitLists);
|
|
return result;
|
|
}
|
|
|
|
@ApiOperation(value = "街道企业列表", notes = "街道企业列表")
|
|
@GetMapping("/srteetEntList/{orgCode}")
|
|
@ApiImplicitParam(name = "orgCode",value = "地区id 默认传甘孜的地区id",required = true)
|
|
@ResponseBody
|
|
public MultiResult<StreetEntInfo> srteetEntList(@PathVariable String orgCode)throws Exception{
|
|
MultiResult<StreetEntInfo> result = new MultiResult<>();
|
|
List<StreetEntInfo> streetEnts = sysEnterpriseMapper.streetEntList(orgCode);
|
|
result.setData(streetEnts);
|
|
return result;
|
|
}
|
|
|
|
}
|