|
|
|
|
@ -16,11 +16,9 @@ import com.biutag.supervision.pojo.entity.DataSupervisionNotify;
|
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.GobalMapIconVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.RankVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.SuperviseMapIconVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.apache.poi.ss.formula.functions.Intercept; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
@ -62,6 +60,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
|
|
|
|
|
// 涉及单位数
|
|
|
|
|
Long supervisionNotifyOrgTotal = negativeMapper.selectRelationOrgCount(beginTime, endTime, "1"); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 涉及人数 |
|
|
|
|
* 1、查出在 negative中的id集合 |
|
|
|
|
@ -80,7 +79,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); |
|
|
|
|
} |
|
|
|
|
// 整改率
|
|
|
|
|
double correctionRate = supervisionNotifyTotal != 0 ? (supervisionNotifyChangedTotal * 1.0 / supervisionNotifyTotal) * 100 : 0; |
|
|
|
|
Integer correctionRate = supervisionNotifyTotal != 0 ? (int) ((supervisionNotifyChangedTotal * 1.0 / supervisionNotifyTotal) * 100) : 0; |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal) |
|
|
|
|
.fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal) |
|
|
|
|
@ -123,40 +122,22 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { |
|
|
|
|
List<RankVo> rankVoRes = new ArrayList<>(); |
|
|
|
|
// 所有分局部门
|
|
|
|
|
List<SupDepart> departs = supDepartMapper.selectDepartsByGroupType(groupType); |
|
|
|
|
for (SupDepart depart : departs) { |
|
|
|
|
List<RankVoSupTwo> rankVoRes = negativeMapper.getChangedRateRank(beginTime, endTime); |
|
|
|
|
List<RankVo> res = new ArrayList<>(); |
|
|
|
|
for (RankVoSupTwo one : rankVoRes) { |
|
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
|
rankVo.setLabel(depart.getShortName()); |
|
|
|
|
rankVo.setDepartId(depart.getId()); |
|
|
|
|
rankVoRes.add(rankVo); |
|
|
|
|
} |
|
|
|
|
for (RankVo rankVoRe : rankVoRes) { |
|
|
|
|
String departId = rankVoRe.getDepartId(); |
|
|
|
|
Long changed = negativeMapper.getChangedCountByGroupType(beginTime, endTime, departId); |
|
|
|
|
Long totalPro = negativeMapper.getCountByGroupType(beginTime, endTime, departId); |
|
|
|
|
totalPro = totalPro == null ? 0L : totalPro; |
|
|
|
|
changed = changed == null ? 0L : changed; |
|
|
|
|
rankVoRe.setDenominator(totalPro.toString()); |
|
|
|
|
rankVoRe.setNumerator(changed.toString()); |
|
|
|
|
Double rate = totalPro != 0 ? (changed * 1.0 / totalPro) * 100 : 0; |
|
|
|
|
int intRate = (int) Math.ceil(rate); |
|
|
|
|
rankVoRe.setRate((double) intRate); |
|
|
|
|
rankVoRe.setDenominator(totalPro.toString()); |
|
|
|
|
rankVoRe.setNumerator(changed.toString()); |
|
|
|
|
rankVoRe.setRate(rate); |
|
|
|
|
rankVoRe.setValue(rate); |
|
|
|
|
rankVo.setLabel(one.getName()); |
|
|
|
|
rankVo.setValue(Double.parseDouble(one.getRectify_rate())); |
|
|
|
|
rankVo.setRate(Double.parseDouble(one.getRectify_rate())); |
|
|
|
|
rankVo.setNumerator(one.getRectifed_number()); |
|
|
|
|
rankVo.setDenominator(one.getRectifed_number()); |
|
|
|
|
res.add(rankVo); |
|
|
|
|
} |
|
|
|
|
// 使用 Stream API 进行排序
|
|
|
|
|
rankVoRes = rankVoRes.stream().sorted((o1, o2) -> o2.getRate().compareTo(o1.getRate())).collect(Collectors.toList()); |
|
|
|
|
// 排序
|
|
|
|
|
return rankVoRes; |
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) { |
|
|
|
|
List<EchartsVo> echartsVos = new ArrayList<>(); |
|
|
|
|
echartsVos = negativeMapper.getProblemTypes(beginTime, endTime); |
|
|
|
|
List<EchartsVo> echartsVos = negativeMapper.getProblemTypes(beginTime, endTime); |
|
|
|
|
return echartsVos; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -166,7 +147,6 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
return echartsVos; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 包括现场督察和专项 |
|
|
|
|
* |
|
|
|
|
@ -175,51 +155,58 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) { |
|
|
|
|
List<SuperviseMapIconVo> res = new ArrayList<>(); |
|
|
|
|
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3); |
|
|
|
|
for (SupDepart supDepart : supDeparts) { |
|
|
|
|
SuperviseMapIconVo SuperviseMapIconVo = new SuperviseMapIconVo(); |
|
|
|
|
SuperviseMapIconVo.setName(supDepart.getShortName()); |
|
|
|
|
SuperviseMapIconVo.setDepartId(supDepart.getId()); |
|
|
|
|
res.add(SuperviseMapIconVo); |
|
|
|
|
} |
|
|
|
|
for (SuperviseMapIconVo re : res) { |
|
|
|
|
String departId = re.getDepartId(); |
|
|
|
|
Long changed = negativeMapper.getNotifyChanged(beginTime, endTime, departId); |
|
|
|
|
Long changing = negativeMapper.getNotifyChanging(beginTime, endTime, departId); |
|
|
|
|
Long totalPro = changed + changing; |
|
|
|
|
Long relationOrg = negativeMapper.getRelationOrgCountByDepartId(departId); |
|
|
|
|
QueryWrapper<Negative> preQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue()); |
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(preQueryWrapper); |
|
|
|
|
Long supervisionNotifyPreTotal = 0L; |
|
|
|
|
for (Negative negative : negatives) { |
|
|
|
|
String id = negative.getId(); |
|
|
|
|
QueryWrapper<NegativeBlame> totalWrapper = new QueryWrapper<>(); |
|
|
|
|
totalWrapper.eq("negativeId", id); |
|
|
|
|
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); |
|
|
|
|
} |
|
|
|
|
List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime); |
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<RankVo> getYellowBet(Date beginTime, Date endTime) { |
|
|
|
|
List<RankVoSupTwo> res = negativeMapper.getYellowBet(beginTime, endTime); |
|
|
|
|
List<RankVo> resv = new ArrayList<>(); |
|
|
|
|
for (RankVoSupTwo re : res) { |
|
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
|
rankVo.setLabel(re.getName()); |
|
|
|
|
rankVo.setValue(Double.parseDouble(re.getProblem_number())); |
|
|
|
|
resv.add(rankVo); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
return resv; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 涉及人数 |
|
|
|
|
* 1、查出在 negative中的id集合 |
|
|
|
|
* 2、查出集合在blame中的涉及人数 |
|
|
|
|
*/ |
|
|
|
|
/*QueryWrapper<Negative> preQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue()); |
|
|
|
|
public RankVoSup getSuperversionRank(Date beginTime, Date endTime) { |
|
|
|
|
RankVoSup res = negativeMapper.getSuperversionRank(beginTime, endTime); |
|
|
|
|
if (res == null) { |
|
|
|
|
res=new RankVoSup(); |
|
|
|
|
res.setRectify_rate("0"); |
|
|
|
|
res.setProblem_number("0"); |
|
|
|
|
res.setRectifing_number("0"); |
|
|
|
|
res.setDepart_number("0"); |
|
|
|
|
res.setPerson_number("0"); |
|
|
|
|
res.setRectifed_number("0"); |
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
if (res.getProblem_number() == null) { |
|
|
|
|
res.setRectifed_number("0"); |
|
|
|
|
} |
|
|
|
|
if (res.getRectifing_number() == null) { |
|
|
|
|
res.setRectifing_number("0"); |
|
|
|
|
} |
|
|
|
|
if (res.getDepart_number() == null) { |
|
|
|
|
res.setDepart_number("0"); |
|
|
|
|
} |
|
|
|
|
if (res.getRectify_rate() == null) { |
|
|
|
|
res.setRectify_rate("0"); |
|
|
|
|
} |
|
|
|
|
if (res.getRectifed_number() == null) { |
|
|
|
|
res.setRectifed_number("0"); |
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(preQueryWrapper); |
|
|
|
|
Long supervisionNotifyPreTotal = 0L; |
|
|
|
|
for (Negative negative : negatives) { |
|
|
|
|
String id = negative.getId(); |
|
|
|
|
QueryWrapper<NegativeBlame> totalWrapper = new QueryWrapper<>(); |
|
|
|
|
totalWrapper.eq("negativeId", id); |
|
|
|
|
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
if (res.getProblem_number() == null) { |
|
|
|
|
res.setProblem_number("0"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|