5 changed files with 210 additions and 49 deletions
@ -0,0 +1,61 @@ |
|||||
|
package com.zdxt.enforcementcode.controller.web.supervision.move; |
||||
|
|
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.DashboardSituationDomainVo; |
||||
|
import com.zdxt.enforcementcode.service.IDashboardSituationTrendAreaService; |
||||
|
import com.zdxt.enforcementcode.service.IDashboardSituationTrendDomainService; |
||||
|
import com.zdxt.enforcementcode.service.IMoveSupervisionService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 移动监督端 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/move/supervision") |
||||
|
public class MoveSupervisionController { |
||||
|
|
||||
|
|
||||
|
private final IMoveSupervisionService moveSupervisionService; |
||||
|
private final IDashboardSituationTrendAreaService dashboardSituationTrendAreaService; |
||||
|
private final IDashboardSituationTrendDomainService situationTrendDomainService; |
||||
|
|
||||
|
/** |
||||
|
* 移动监督端指标 |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/OverviewLawEnforcementMap") |
||||
|
public R<Map<String,Object>> OverviewLawEnforcementMap(){ |
||||
|
return R.ok(moveSupervisionService.OverviewLawEnforcementMap()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 区域-各区风险态势分布 |
||||
|
*/ |
||||
|
@GetMapping("/querySituationTrendAreaList") |
||||
|
public R<List<DashboardSituationAreaVo>> querySituationTrendAreaList(@Validated DashboardTrendStatQueryBo bo) { |
||||
|
List<DashboardSituationAreaVo> list = dashboardSituationTrendAreaService.querySituationTrendAreaList(bo); |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询态势趋势分析-领域统计列表 |
||||
|
*/ |
||||
|
@GetMapping("/querySituationTrendDomainList") |
||||
|
public R<List<DashboardSituationDomainVo>> querySituationTrendDomainList(@Validated DashboardTrendStatQueryBo bo) { |
||||
|
List<DashboardSituationDomainVo> list = situationTrendDomainService.querySituationTrendDomainList(bo); |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
package com.zdxt.enforcementcode.service; |
||||
|
|
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
public interface IMoveSupervisionService { |
||||
|
|
||||
|
|
||||
|
Map<String,Object> OverviewLawEnforcementMap(); |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
package com.zdxt.enforcementcode.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.zdxt.enforcementcode.domain.bean.DashboardOverview; |
||||
|
import com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.DashboardOverviewVo; |
||||
|
import com.zdxt.enforcementcode.mapper.CimDashboardOverviewMapper; |
||||
|
import com.zdxt.enforcementcode.service.IMoveSupervisionService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.math.RoundingMode; |
||||
|
import java.util.*; |
||||
|
|
||||
|
@Service |
||||
|
@RequiredArgsConstructor |
||||
|
public class MoveSupervisionServiceImpl implements IMoveSupervisionService { |
||||
|
|
||||
|
private final CimDashboardOverviewMapper cimDashboardOverviewMapper; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取月时间方法 |
||||
|
* @return |
||||
|
*/ |
||||
|
public CimDashboardOverviewQueryBo getDateTime(){ |
||||
|
CimDashboardOverviewQueryBo bo=new CimDashboardOverviewQueryBo(); |
||||
|
// 获取当前时间的上一个月
|
||||
|
Calendar cal = Calendar.getInstance(); |
||||
|
cal.add(Calendar.MONTH, -1); |
||||
|
long year = cal.get(Calendar.YEAR); |
||||
|
long month = cal.get(Calendar.MONTH) + 1; |
||||
|
Date time = cal.getTime(); |
||||
|
bo.setMonthTime(time); |
||||
|
bo.setYearTime(time); |
||||
|
bo.setMonth( month); |
||||
|
bo.setYear( year); |
||||
|
return bo; |
||||
|
} |
||||
|
@Override |
||||
|
public Map<String, Object> OverviewLawEnforcementMap() { |
||||
|
|
||||
|
Map<String,Object> map=new HashMap<>(); |
||||
|
|
||||
|
//企业总数
|
||||
|
LambdaQueryWrapper<DashboardOverview> queryWrapper = new LambdaQueryWrapper<>(); |
||||
|
queryWrapper.eq(DashboardOverview::getIsDelete, "0"); |
||||
|
queryWrapper.eq(DashboardOverview::getYear, getDateTime().getYear()); |
||||
|
queryWrapper.eq(DashboardOverview::getMonth, getDateTime().getMonth()); |
||||
|
CimDashboardOverviewVo vo=cimDashboardOverviewMapper.selectVoOne(queryWrapper); |
||||
|
|
||||
|
//单独部门执法
|
||||
|
Long ddbmzfCount=cimDashboardOverviewMapper.getSepDeptLawCount(null); |
||||
|
|
||||
|
//联合执法
|
||||
|
Long lhzfsCount= cimDashboardOverviewMapper.getUnionLawCount(null); |
||||
|
|
||||
|
//被执法企业
|
||||
|
Long bzfqyCount= cimDashboardOverviewMapper.getSubLawEntCount(null); |
||||
|
|
||||
|
map.put("data",vo); |
||||
|
map.put("ddzf",ddbmzfCount); |
||||
|
map.put("lhzf",lhzfsCount); |
||||
|
map.put("bzfqy",bzfqyCount); |
||||
|
//入企压减率
|
||||
|
Long xzzfCount = cimDashboardOverviewMapper.getEnfRegistrationCount(null); |
||||
|
if (xzzfCount == null || xzzfCount == 0) { |
||||
|
map.put("rqyjl",BigDecimal.ZERO); |
||||
|
} else { |
||||
|
map.put("rqyjl",BigDecimal.valueOf(xzzfCount - (lhzfsCount + ddbmzfCount)) |
||||
|
.divide(BigDecimal.valueOf(xzzfCount), 4, RoundingMode.HALF_UP)); |
||||
|
} |
||||
|
|
||||
|
// 执法力度
|
||||
|
List<CimDashboardOverviewVo> list=cimDashboardOverviewMapper.getEnfRegistrationType(null); |
||||
|
map.put("zfld",list); |
||||
|
|
||||
|
return map; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue