|
@@ -209,7 +209,41 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
|
|
|
+ //基础数据
|
|
|
IPage<EntryNumDTO> entryNumDTOIPage = baseMapper.entryGroupByEntryInnerPage(filterPageVO);
|
|
|
+ String hospitalId = filterPageVO.getHospitalId();
|
|
|
+ //缺陷总数
|
|
|
+ Integer sumInteget = baseMapper.entryGroupByEntrySum(filterPageVO.getHospitalId(),filterPageVO.getIsPlacefile(),
|
|
|
+ filterPageVO.getStartDate(),filterPageVO.getEndDate());
|
|
|
+ float nsum = 0;
|
|
|
+ Set<Long> ids = new HashSet<Long>();
|
|
|
+ List<EntryNumDTO> records = entryNumDTOIPage.getRecords();
|
|
|
+ if(CollectionUtils.isEmpty(records)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ for (EntryNumDTO record : records) {
|
|
|
+ ids.add(record.getId());
|
|
|
+ int num = record.getNum().intValue();
|
|
|
+ if(sumInteget!=null && sumInteget!=0 ){
|
|
|
+ int sum = sumInteget.intValue();
|
|
|
+ nsum =(float) num/sum;
|
|
|
+ }
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
+ String percent = df.format(nsum*100);
|
|
|
+ record.setPercentStr(percent+"%");
|
|
|
+ record.setTotleNum(sumInteget);
|
|
|
+ }
|
|
|
+ //缺陷分值
|
|
|
+ String isPlacefile = filterPageVO.getIsPlacefile();
|
|
|
+ List<EntryNumDTO> entryScore = new ArrayList<>();
|
|
|
+ entryScore = baseMapper.entryGroupByEntryScore(hospitalId,isPlacefile, ids);
|
|
|
+ for (EntryNumDTO record : records) {
|
|
|
+ for (EntryNumDTO entryNumDTO : entryScore) {
|
|
|
+ if(record.getId().equals(entryNumDTO.getId())){
|
|
|
+ record.setScore(entryNumDTO.getScore());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return entryNumDTOIPage;
|
|
|
}
|
|
|
|