|
@@ -196,7 +196,7 @@ public class WorkOrderStatisticsController {
|
|
|
public AjaxMessage<Map<String, Object>> distributionStatistics(
|
|
|
@ApiParam(value = "统计类型:0-按月统计,1-按年统计,2-自定义统计", required = true) @RequestParam(required = true) int type,
|
|
|
@ApiParam(value = "统计时间:月格式(yyyy-MM),年格式(yyyy),自定义统计时间开始日期", required = true) @RequestParam(required = true) String startDate,
|
|
|
- @ApiParam(value = "统计时间:年月统计不用传入此参数,自定义统计截至日期", required = false) @RequestParam(required = false) String endDate) {
|
|
|
+ @ApiParam(value = "统计时间:年月统计不用传入此参数,自定义统计截至日期", required = false) @RequestParam(required = false) String endDate) throws ParseException {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
//根据用户编号,获取用户的权限
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
@@ -208,14 +208,17 @@ public class WorkOrderStatisticsController {
|
|
|
workOrderManageDto.setPermissonType(loginUser.getPermissonType());
|
|
|
if (type == 0) {
|
|
|
startDate = String.format("%s-01", startDate);
|
|
|
- workOrderManageDto.setStartDate(startDate);
|
|
|
+ endDate = subMonth(startDate, 1);
|
|
|
+
|
|
|
} else if (type == 1) {
|
|
|
startDate = String.format("%s-01-01", startDate);
|
|
|
- workOrderManageDto.setStartDate(startDate);
|
|
|
+ endDate = subYear(startDate, 1);
|
|
|
} else if (type == 2) {
|
|
|
- workOrderManageDto.setStartDate(startDate);
|
|
|
- workOrderManageDto.setEndDate(endDate);
|
|
|
+ startDate = String.format("%s-01", startDate);
|
|
|
+ endDate = String.format("%s-01", endDate);
|
|
|
}
|
|
|
+ workOrderManageDto.setStartDate(startDate);
|
|
|
+ workOrderManageDto.setEndDate(endDate);
|
|
|
result.put("上报类型", CalculatePercentage(workOrderManageService.reportStatistics(workOrderManageDto)));
|
|
|
result.put("工单状态", CalculatePercentage(workOrderManageService.orderStatusStatistics(workOrderManageDto)));
|
|
|
result.put("工单类型", CalculatePercentage(workOrderManageService.orderTypeStatistics(workOrderManageDto)));
|