|
|
|
@ -1047,23 +1047,29 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> queryUnionByHour(String enterpriseNumber) { |
|
|
|
public List<Map<String, Object>> queryUnionByHour(String enterpriseNumber, String checkCss) { |
|
|
|
// 定义时间格式
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
DateTimeFormatter time_formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
// 定义时间格式
|
|
|
|
DateTimeFormatter date_formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
|
|
|
// 获取当前时间
|
|
|
|
LocalDateTime now_tmp = LocalDateTime.now(); |
|
|
|
// 获取当前时间前一个小时的时间
|
|
|
|
LocalDateTime oneHourAgo_tmp = now_tmp.minusHours(1); |
|
|
|
// 格式化时间
|
|
|
|
String now = now_tmp.format(formatter); |
|
|
|
String oneHourAgo = oneHourAgo_tmp.format(formatter); |
|
|
|
|
|
|
|
// 查询符合要求的数据
|
|
|
|
// 正常登记为一个小时范围, 补录为为单天
|
|
|
|
EnforcementRegistration er = new EnforcementRegistration(); |
|
|
|
er.setEnterpriseNumber(enterpriseNumber); |
|
|
|
er.setBeginTime(oneHourAgo); |
|
|
|
er.setEndTime(now); |
|
|
|
if ("3".equals(checkCss)) { |
|
|
|
String now = now_tmp.format(date_formatter); |
|
|
|
er.setCheckCss(now); |
|
|
|
} else { |
|
|
|
// 获取当前时间前一个小时的时间
|
|
|
|
LocalDateTime oneHourAgo_tmp = now_tmp.minusHours(1); |
|
|
|
// 格式化时间
|
|
|
|
String now = now_tmp.format(time_formatter); |
|
|
|
String oneHourAgo = oneHourAgo_tmp.format(time_formatter); |
|
|
|
er.setBeginTime(oneHourAgo); |
|
|
|
er.setEndTime(now); |
|
|
|
} |
|
|
|
|
|
|
|
// 可能会出现 同一时间 多组人, 多组联合执法 , 所以新增的时候还是需要生成联合执法id ,
|
|
|
|
List<EnforcementRegistration> enforcementRegistrations = enforcementRegistrationMapper.selectEnforcementRegistrationByUnion(er); |
|
|
|
|