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
public Object gwmcDataDictionary(String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.eq("is_delete", false);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
......
......@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IAlertDispatchStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertDispatchStatistics> getList(String date);
}
......@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IAlertMaintenanceUnitStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertMaintenanceUnitStatistics> getList(String date);
......
......@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IAlertPlaceStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertPlaceStatistics> placeList(String date);
}
......@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IAlertRescueStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertRescueStatistics> getList(String date);
}
......@@ -8,7 +8,7 @@ import java.util.List;
public interface IAlertStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertStatistics> getList(String date) throws ParseException;
}
......@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface IAlertUseUnitStatisticsService {
void statisticalGeneration();
void statisticalGeneration(String type);
List<AlertUseUnitStatistics> getList(String date);
}
......@@ -55,8 +55,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalGeneration() {
alertStatisticsService.statisticalGeneration();
public ResponseModel<Object> statisticalGeneration(@RequestParam(value = "type", required = false) String type) {
alertStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......@@ -106,8 +106,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/rescueStatisticalGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> rescueStatisticalGeneration() {
alertRescueStatisticsService.statisticalGeneration();
public ResponseModel<Object> rescueStatisticalGeneration(@RequestParam(value = "type", required = false) String type) {
alertRescueStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......@@ -156,8 +156,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalPlaceGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalPlaceGeneration() {
alertPlaceStatisticsService.statisticalGeneration();
public ResponseModel<Object> statisticalPlaceGeneration(@RequestParam(value = "type", required = false) String type) {
alertPlaceStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......@@ -205,8 +205,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalUseUnitGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalUseUnitGeneration() {
alertUseUnitStatisticsService.statisticalGeneration();
public ResponseModel<Object> statisticalUseUnitGeneration(@RequestParam(value = "type", required = false) String type) {
alertUseUnitStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......@@ -254,8 +254,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalMaintenanceUnitGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalMaintenanceUnitGeneration() {
alertMaintenanceUnitStatisticsService.statisticalGeneration();
public ResponseModel<Object> statisticalMaintenanceUnitGeneration(@RequestParam(value = "type", required = false) String type) {
alertMaintenanceUnitStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......@@ -302,8 +302,8 @@ public class StatisticsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalDispatchGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalDispatchGeneration() {
alertDispatchStatisticsService.statisticalGeneration();
public ResponseModel<Object> statisticalDispatchGeneration(@RequestParam(value = "type", required = false) String type) {
alertDispatchStatisticsService.statisticalGeneration(type);
return ResponseHelper.buildResponse("success");
}
......
......@@ -31,14 +31,21 @@ public class AlertDispatchStatisticsServiceImpl extends BaseService<AlertDispatc
@Autowired
private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)) {
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
......@@ -33,16 +33,23 @@ public class AlertMaintenanceUnitStatisticsServiceImpl extends BaseService<Alert
@Autowired
private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
ArrayList<AlertMaintenanceUnitStatistics> list = new ArrayList<>();
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
......@@ -27,15 +27,21 @@ import java.util.*;
public class AlertPlaceStatisticsServiceImpl extends BaseService<AlertPlaceStatisticsDto, AlertPlaceStatistics, AlertPlaceStatisticsMapper> implements IAlertPlaceStatisticsService {
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
DecimalFormat decimalFormat = new DecimalFormat("0.00");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
......@@ -32,14 +32,19 @@ public class AlertRescueStatisticsServiceImpl extends BaseService<AlertRescueSta
@Autowired
private AlertStatisticsServiceImpl alertStatisticsService;
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
......@@ -31,15 +31,20 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
@Autowired
RedisUtils redisUtils;
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
......
......@@ -27,15 +27,20 @@ import java.util.*;
@Service
public class AlertUseUnitStatisticsServiceImpl extends BaseService<AlertUseUnitStatisticsDto, AlertUseUnitStatistics, AlertUseUnitStatisticsMapper> implements IAlertUseUnitStatisticsService {
@Override
@Scheduled(cron = "0 0 0 1 * ?")
@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");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (ObjectUtils.isEmpty(type)){
cal.add(Calendar.MONTH, -1);
}
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
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,
if (!CollectionUtils.isEmpty(userDetailsDtoList)) {
Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream().
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) {
HashMap<String, Object> tempMap = new HashMap<>();
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