|
@@ -10,7 +10,10 @@ import com.ruoyi.system.service.IPropertyRepairService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import static com.ruoyi.common.constant.Constants.*;
|
|
|
|
|
@@ -132,4 +135,28 @@ public class PropertyRepairServiceImpl implements IPropertyRepairService
|
|
|
{
|
|
|
return propertyRepairMapper.deletePropertyRepairByRepairId(repairId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult statisticsQx() {
|
|
|
+ List<Map<String,Object>> mapList = new ArrayList<>();
|
|
|
+ List<String> weekDays = DateUtils.getPreviousSevenDays(DateUtils.YYYY_MM_DD);
|
|
|
+ String starTime = weekDays.get(0);
|
|
|
+ String endTime = weekDays.get(weekDays.size()-1);
|
|
|
+ //查询两个日期内的保修数据
|
|
|
+ List<PropertyRepair> propertyRepairs = propertyRepairMapper.selectPropertyRepairListByTime(starTime, endTime);
|
|
|
+ for (int i = 0; i < weekDays.size(); i++) {
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("time",weekDays.get(i));
|
|
|
+ int num = 0;
|
|
|
+ for (PropertyRepair propertyRepair : propertyRepairs) {
|
|
|
+ String day = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, propertyRepair.getRepairTime());
|
|
|
+ if(day.equals(weekDays.get(i))){
|
|
|
+ num++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("num",num);
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(mapList);
|
|
|
+ }
|
|
|
}
|