|
@@ -1,12 +1,16 @@
|
|
|
package com.bizmatics.mhfire.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.api.R;
|
|
|
+import com.bizmatics.mhfire.persistence.mapper.ReportComplaintMapper;
|
|
|
import com.bizmatics.mhfire.service.ReportComplaintService;
|
|
|
import com.bizmatics.mhfire.service.vo.ReportComplaintVO;
|
|
|
import com.bizmatics.mhfire.service.vo.ReportStatisticsVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author yq
|
|
@@ -14,17 +18,34 @@ import java.util.Date;
|
|
|
*/
|
|
|
@Service
|
|
|
public class ReportComplaintServiceImpl implements ReportComplaintService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ReportComplaintMapper reportComplaintMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public ReportStatisticsVO getReportStatistics(Date startTime, Date endTime) {
|
|
|
ReportStatisticsVO reportStatisticsVo = new ReportStatisticsVO();
|
|
|
- //TODO 从其他平台获取
|
|
|
+ Integer count = reportComplaintMapper.selectCount(null, null, null, null, null);
|
|
|
+ reportStatisticsVo.setComplaintNumber(count);
|
|
|
+ reportStatisticsVo.setConcludeNumber(
|
|
|
+ reportComplaintMapper.selectCount(null,null,null,"已归档",null));
|
|
|
+ reportStatisticsVo.setCheckNumber(
|
|
|
+ reportComplaintMapper.selectCount(null,null,null,"已办结",null));
|
|
|
+ Integer satisfactionRateNumber = reportComplaintMapper.selectCount(null, null, null, null, "3");
|
|
|
+ reportStatisticsVo.setSatisfactionRate(satisfactionRateNumber/count.doubleValue());
|
|
|
return reportStatisticsVo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ReportComplaintVO getReportComplaint(Date startTime, Date endTime) {
|
|
|
- ReportComplaintVO reportComplaintVo = new ReportComplaintVO();
|
|
|
- //TODO 从其他平台获取
|
|
|
- return reportComplaintVo;
|
|
|
+ public List<ReportComplaintVO> getReportComplaint(Date startTime, Date endTime) {
|
|
|
+ List<ReportComplaintVO> list = new ArrayList<>();
|
|
|
+ List<String> strings = reportComplaintMapper.selectType();
|
|
|
+ strings.forEach(type -> {
|
|
|
+ ReportComplaintVO reportComplaintVo = new ReportComplaintVO();
|
|
|
+ reportComplaintVo.setType(type);
|
|
|
+ reportComplaintVo.setNumber(reportComplaintMapper.selectCount(null,null,type,null,null));
|
|
|
+ list.add(reportComplaintVo);
|
|
|
+ });
|
|
|
+ return list;
|
|
|
}
|
|
|
}
|