Commit df258108 authored by tianyiming's avatar tianyiming

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 9622e363 b647104c
...@@ -62,6 +62,7 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -62,6 +62,7 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
public Object gwmcDataDictionary(String type) throws Exception { public Object gwmcDataDictionary(String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type); queryWrapper.eq("type", type);
queryWrapper.eq("is_delete", false);
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) { if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
......
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
public interface IAlertDispatchStatisticsService { public interface IAlertDispatchStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertDispatchStatistics> getList(String date); List<AlertDispatchStatistics> getList(String date);
} }
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
public interface IAlertMaintenanceUnitStatisticsService { public interface IAlertMaintenanceUnitStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertMaintenanceUnitStatistics> getList(String date); List<AlertMaintenanceUnitStatistics> getList(String date);
......
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
public interface IAlertPlaceStatisticsService { public interface IAlertPlaceStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertPlaceStatistics> placeList(String date); List<AlertPlaceStatistics> placeList(String date);
} }
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
public interface IAlertRescueStatisticsService { public interface IAlertRescueStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertRescueStatistics> getList(String date); List<AlertRescueStatistics> getList(String date);
} }
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
public interface IAlertStatisticsService { public interface IAlertStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertStatistics> getList(String date) throws ParseException; List<AlertStatistics> getList(String date) throws ParseException;
} }
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
*/ */
public interface IAlertUseUnitStatisticsService { public interface IAlertUseUnitStatisticsService {
void statisticalGeneration(); void statisticalGeneration(String type);
List<AlertUseUnitStatistics> getList(String date); List<AlertUseUnitStatistics> getList(String date);
} }
...@@ -55,8 +55,8 @@ public class StatisticsController extends BaseController { ...@@ -55,8 +55,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalGeneration") @GetMapping(value = "/statisticalGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalGeneration() { public ResponseModel<Object> statisticalGeneration(@RequestParam(value = "type", required = false) String type) {
alertStatisticsService.statisticalGeneration(); alertStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
...@@ -106,8 +106,8 @@ public class StatisticsController extends BaseController { ...@@ -106,8 +106,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/rescueStatisticalGeneration") @GetMapping(value = "/rescueStatisticalGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> rescueStatisticalGeneration() { public ResponseModel<Object> rescueStatisticalGeneration(@RequestParam(value = "type", required = false) String type) {
alertRescueStatisticsService.statisticalGeneration(); alertRescueStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
...@@ -156,8 +156,8 @@ public class StatisticsController extends BaseController { ...@@ -156,8 +156,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalPlaceGeneration") @GetMapping(value = "/statisticalPlaceGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalPlaceGeneration() { public ResponseModel<Object> statisticalPlaceGeneration(@RequestParam(value = "type", required = false) String type) {
alertPlaceStatisticsService.statisticalGeneration(); alertPlaceStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
...@@ -205,8 +205,8 @@ public class StatisticsController extends BaseController { ...@@ -205,8 +205,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalUseUnitGeneration") @GetMapping(value = "/statisticalUseUnitGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalUseUnitGeneration() { public ResponseModel<Object> statisticalUseUnitGeneration(@RequestParam(value = "type", required = false) String type) {
alertUseUnitStatisticsService.statisticalGeneration(); alertUseUnitStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
...@@ -254,8 +254,8 @@ public class StatisticsController extends BaseController { ...@@ -254,8 +254,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalMaintenanceUnitGeneration") @GetMapping(value = "/statisticalMaintenanceUnitGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalMaintenanceUnitGeneration() { public ResponseModel<Object> statisticalMaintenanceUnitGeneration(@RequestParam(value = "type", required = false) String type) {
alertMaintenanceUnitStatisticsService.statisticalGeneration(); alertMaintenanceUnitStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
...@@ -302,8 +302,8 @@ public class StatisticsController extends BaseController { ...@@ -302,8 +302,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalDispatchGeneration") @GetMapping(value = "/statisticalDispatchGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据") @ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalDispatchGeneration() { public ResponseModel<Object> statisticalDispatchGeneration(@RequestParam(value = "type", required = false) String type) {
alertDispatchStatisticsService.statisticalGeneration(); alertDispatchStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
......
...@@ -31,14 +31,21 @@ public class AlertDispatchStatisticsServiceImpl extends BaseService<AlertDispatc ...@@ -31,14 +31,21 @@ public class AlertDispatchStatisticsServiceImpl extends BaseService<AlertDispatc
@Autowired @Autowired
private AlertStatisticsServiceImpl alertStatisticsService; private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertDispatchStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertDispatchStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask() {
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)) {
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -33,16 +33,23 @@ public class AlertMaintenanceUnitStatisticsServiceImpl extends BaseService<Alert ...@@ -33,16 +33,23 @@ public class AlertMaintenanceUnitStatisticsServiceImpl extends BaseService<Alert
@Autowired @Autowired
private AlertStatisticsServiceImpl alertStatisticsService; private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertMaintenanceUnitStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertMaintenanceUnitStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask(){
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
DecimalFormat decimalFormat = new DecimalFormat("0.00"); DecimalFormat decimalFormat = new DecimalFormat("0.00");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
ArrayList<AlertMaintenanceUnitStatistics> list = new ArrayList<>(); ArrayList<AlertMaintenanceUnitStatistics> list = new ArrayList<>();
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -27,15 +27,21 @@ import java.util.*; ...@@ -27,15 +27,21 @@ import java.util.*;
public class AlertPlaceStatisticsServiceImpl extends BaseService<AlertPlaceStatisticsDto, AlertPlaceStatistics, AlertPlaceStatisticsMapper> implements IAlertPlaceStatisticsService { public class AlertPlaceStatisticsServiceImpl extends BaseService<AlertPlaceStatisticsDto, AlertPlaceStatistics, AlertPlaceStatisticsMapper> implements IAlertPlaceStatisticsService {
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertPlaceStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertPlaceStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask(){
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
DecimalFormat decimalFormat = new DecimalFormat("0.00"); DecimalFormat decimalFormat = new DecimalFormat("0.00");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -32,14 +32,19 @@ public class AlertRescueStatisticsServiceImpl extends BaseService<AlertRescueSta ...@@ -32,14 +32,19 @@ public class AlertRescueStatisticsServiceImpl extends BaseService<AlertRescueSta
@Autowired @Autowired
private AlertStatisticsServiceImpl alertStatisticsService; private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertRescueStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertRescueStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask(){
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -31,15 +31,20 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto, ...@@ -31,15 +31,20 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask(){
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -27,15 +27,20 @@ import java.util.*; ...@@ -27,15 +27,20 @@ import java.util.*;
@Service @Service
public class AlertUseUnitStatisticsServiceImpl extends BaseService<AlertUseUnitStatisticsDto, AlertUseUnitStatistics, AlertUseUnitStatisticsMapper> implements IAlertUseUnitStatisticsService { public class AlertUseUnitStatisticsServiceImpl extends BaseService<AlertUseUnitStatisticsDto, AlertUseUnitStatistics, AlertUseUnitStatisticsMapper> implements IAlertUseUnitStatisticsService {
@Override
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@SchedulerLock(name = "AlertUseUnitStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M") @SchedulerLock(name = "AlertUseUnitStatisticsServiceImpl", lockAtMostFor = "PT10M", lockAtLeastFor = "PT10M")
public void statisticalGeneration() { public void statisticalGenerationTask(){
statisticalGeneration(null);
}
@Override
public void statisticalGeneration(String type) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); cal.setTime(new Date());
cal.add(Calendar.MONTH, -1); if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime(); Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
...@@ -520,7 +520,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String, ...@@ -520,7 +520,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
if (!CollectionUtils.isEmpty(userDetailsDtoList)) { if (!CollectionUtils.isEmpty(userDetailsDtoList)) {
Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream(). Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream().
filter(obj -> obj.getEquipCategoryCode().contains(deviceType) && obj.getUnitTypeCode().contains(unitType)) filter(obj -> obj.getEquipCategoryCode().contains(deviceType) && obj.getUnitTypeCode().contains(unitType))
.collect(Collectors.groupingBy(UserDetailsDto::getUnitOrgCode)); .collect(Collectors.groupingBy(UserDetailsDto::getUnitCode));
for (HashMap<String, Object> stringObjectHashMap : timeList) { for (HashMap<String, Object> stringObjectHashMap : timeList) {
HashMap<String, Object> tempMap = new HashMap<>(); HashMap<String, Object> tempMap = new HashMap<>();
Object strBeginTime = stringObjectHashMap.get("BEGIN_TIME"); Object strBeginTime = stringObjectHashMap.get("BEGIN_TIME");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment