|
|
|
|
@ -18,11 +18,13 @@ import com.biutag.supervision.pojo.entity.NegativeBlame;
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.poi.ss.formula.functions.Intercept; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.IllegalFormatCodePointException; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -33,6 +35,8 @@ import java.util.stream.Collectors;
|
|
|
|
|
*/ |
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
|
|
|
|
|
public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> { |
|
|
|
|
|
|
|
|
|
private final NegativeMapper negativeMapper; |
|
|
|
|
@ -49,37 +53,29 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
*/ |
|
|
|
|
public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) { |
|
|
|
|
|
|
|
|
|
// 通报问题数
|
|
|
|
|
Long supervisionNotifyTotal = negativeMapper.selectSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue()); |
|
|
|
|
RankVoSupTwo res = negativeMapper.getTemp(beginTime, endTime); |
|
|
|
|
if (res == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 通报问题数
|
|
|
|
|
String supervisionNotifyTotal = res.getProblemNumber(); |
|
|
|
|
log.info("通报问题数:{}", res.getProblemNumber()); |
|
|
|
|
// 整改中
|
|
|
|
|
Long supervisionNotifyChangingTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue(), "0"); |
|
|
|
|
|
|
|
|
|
String supervisionNotifyChangingTotal = res.getRectifingNumber(); |
|
|
|
|
log.info("整改中:{}", res.getRectifingNumber()); |
|
|
|
|
// 已整改
|
|
|
|
|
Long supervisionNotifyChangedTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue(), "1"); |
|
|
|
|
|
|
|
|
|
String supervisionNotifyChangedTotal = res.getRectifedNumber(); |
|
|
|
|
log.info("已整改:{}", res.getRectifedNumber()); |
|
|
|
|
// 涉及单位数
|
|
|
|
|
Long supervisionNotifyOrgTotal = negativeMapper.selectRelationOrgCount(beginTime, endTime, "1"); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 涉及人数 |
|
|
|
|
* 1、查出在 negative中的id集合 |
|
|
|
|
* 2、查出集合在blame中的涉及人数 |
|
|
|
|
*/ |
|
|
|
|
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); |
|
|
|
|
totalWrapper.eq("type", "personal"); |
|
|
|
|
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); |
|
|
|
|
} |
|
|
|
|
// 整改率
|
|
|
|
|
Integer correctionRate = supervisionNotifyTotal != 0 ? (int) ((supervisionNotifyChangedTotal * 1.0 / supervisionNotifyTotal) * 100) : 0; |
|
|
|
|
String supervisionNotifyOrgTotal = res.getDepartNumber(); |
|
|
|
|
log.info("涉及单位数:{}", res.getDepartNumber()); |
|
|
|
|
// 涉及人数
|
|
|
|
|
String supervisionNotifyPreTotal = res.getPersonNumber(); |
|
|
|
|
log.info("涉及人数:{}", res.getPersonNumber()); |
|
|
|
|
String correctionRate = res.getRectifyRate(); |
|
|
|
|
log.info("整改率:{}", res.getRectifyRate()); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal) |
|
|
|
|
.fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal) |
|
|
|
|
@ -127,10 +123,10 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
for (RankVoSupTwo one : rankVoRes) { |
|
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
|
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()); |
|
|
|
|
rankVo.setValue(one.getRectifyRate()); |
|
|
|
|
rankVo.setRate(one.getRectifyRate()); |
|
|
|
|
rankVo.setNumerator(one.getRectifedNumber()); |
|
|
|
|
rankVo.setDenominator(one.getProblemNumber()); |
|
|
|
|
res.add(rankVo); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
@ -161,11 +157,16 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
|
|
|
|
|
public List<RankVo> getYellowBet(Date beginTime, Date endTime) { |
|
|
|
|
List<RankVoSupTwo> res = negativeMapper.getYellowBet(beginTime, endTime); |
|
|
|
|
|
|
|
|
|
List<RankVo> resv = new ArrayList<>(); |
|
|
|
|
if (res == null) { |
|
|
|
|
return resv; |
|
|
|
|
} |
|
|
|
|
for (RankVoSupTwo re : res) { |
|
|
|
|
log.info("名字===========" + re.getName() + "驼峰===============" + re.getProblemNumber() + "非驼峰" + re.getProblemNumber()); |
|
|
|
|
RankVo rankVo = new RankVo(); |
|
|
|
|
rankVo.setLabel(re.getName()); |
|
|
|
|
rankVo.setValue(Double.parseDouble(re.getProblem_number())); |
|
|
|
|
rankVo.setValue(re.getProblemNumber()); |
|
|
|
|
resv.add(rankVo); |
|
|
|
|
} |
|
|
|
|
return resv; |
|
|
|
|
@ -175,36 +176,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
|
|
|
|
|
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 new RankVoSup("0", "0", "0", "0", "0", "0"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|