|
|
|
@ -16,11 +16,9 @@ import com.biutag.supervision.pojo.entity.DataSupervisionNotify; |
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
import com.biutag.supervision.pojo.vo.GobalMapIconVo; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.RankVo; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.SuperviseMapIconVo; |
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import org.apache.poi.ss.formula.functions.Intercept; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
@ -81,7 +79,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio |
|
|
|
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); |
|
|
|
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 jsonObject = new JSONObject(); |
|
|
|
jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal) |
|
|
|
jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal) |
|
|
|
.fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal) |
|
|
|
.fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal) |
|
|
|
@ -124,35 +122,18 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { |
|
|
|
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { |
|
|
|
List<RankVo> rankVoRes = new ArrayList<>(); |
|
|
|
List<RankVoSupTwo> rankVoRes = negativeMapper.getChangedRateRank(beginTime, endTime); |
|
|
|
// 所有分局部门
|
|
|
|
List<RankVo> res = new ArrayList<>(); |
|
|
|
List<SupDepart> departs = supDepartMapper.selectDepartsByGroupType(groupType); |
|
|
|
for (RankVoSupTwo one : rankVoRes) { |
|
|
|
for (SupDepart depart : departs) { |
|
|
|
|
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
rankVo.setLabel(depart.getShortName()); |
|
|
|
rankVo.setLabel(one.getName()); |
|
|
|
rankVo.setDepartId(depart.getId()); |
|
|
|
rankVo.setValue(Double.parseDouble(one.getRectify_rate())); |
|
|
|
rankVoRes.add(rankVo); |
|
|
|
rankVo.setRate(Double.parseDouble(one.getRectify_rate())); |
|
|
|
|
|
|
|
rankVo.setNumerator(one.getRectifed_number()); |
|
|
|
|
|
|
|
rankVo.setDenominator(one.getRectifed_number()); |
|
|
|
|
|
|
|
res.add(rankVo); |
|
|
|
} |
|
|
|
} |
|
|
|
for (RankVo rankVoRe : rankVoRes) { |
|
|
|
return res; |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 使用 Stream API 进行排序
|
|
|
|
|
|
|
|
rankVoRes = rankVoRes.stream().sorted((o1, o2) -> o2.getRate().compareTo(o1.getRate())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 排序
|
|
|
|
|
|
|
|
return rankVoRes; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) { |
|
|
|
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) { |
|
|
|
@ -174,17 +155,58 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) { |
|
|
|
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) { |
|
|
|
List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime); |
|
|
|
List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<RankVo> getYellowBet(Date beginTime, Date endTime) { |
|
|
|
public List<RankVo> getYellowBet(Date beginTime, Date endTime) { |
|
|
|
List<RankVo> res = negativeMapper.getYellowBet(beginTime, endTime); |
|
|
|
List<RankVoSupTwo> res = negativeMapper.getYellowBet(beginTime, endTime); |
|
|
|
return res; |
|
|
|
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 resv; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (res.getProblem_number() == null) { |
|
|
|
|
|
|
|
res.setProblem_number("0"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|