Commit e7147c93 authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' into develop_dl_plan6

parents fa2a4d4b b195e904
......@@ -113,7 +113,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setType(maintenanceCompany.getType().toUpperCase());
maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()) {
if (!maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
}
return maintenanceCompany;
......@@ -148,7 +148,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setParentId(parentId);
maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()) {
if (!maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
}
return maintenanceCompany;
......@@ -182,7 +182,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setParentId(parentId);
maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()) {
if (!maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
}
return maintenanceCompany;
......
......@@ -308,9 +308,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List<FormValue> formValue = new ArrayList<FormValue>();
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text",
alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
if(alertFormValue.getFieldCode().equals("flightNumber")){
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text",
alertFormValue.getFieldValueCode(), alertFormValue.getBlock());
formValue.add(value);
}else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text",
alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
}
}
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
......
......@@ -105,7 +105,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
QueryWrapper<PowerTransferCompanyResources> powerTransferCompanyResourcesQueryWrapper = new QueryWrapper<>();
powerTransferCompanyResourcesQueryWrapper.eq("resources_id", resourceId);
powerTransferCompanyResourcesQueryWrapper.eq("status", status);
powerTransferCompanyResourcesQueryWrapper.eq("is_deleted", 0);
powerTransferCompanyResourcesQueryWrapper.eq("is_delete", 0);
return powerTransferCompanyResourcesMapper.selectCount(powerTransferCompanyResourcesQueryWrapper);
}
}
......@@ -81,7 +81,7 @@ public class UserCarServiceImpl extends BaseService<AircraftDto, UserCar, UserCa
if (userCar == null) {
return 0;
}
return companyResourcesService.getCarExecutingCountById(userCar.getRecUserId(), "executing");
return companyResourcesService.getCarExecutingCountById(userCar.getCarId().toString(), "executing");
//bug 6065 首页报错,接口selectOne 一个资源对应多条数据。
// PowerTransferCompanyResources resource = companyResourcesService.getResourceById(userCar.getCarId().toString());
// if (resource == null) {
......
......@@ -44,8 +44,10 @@ import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.CompletionException;
import java.util.function.Function;
......@@ -239,6 +241,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
/**
* startTime > stopTime 且 startTime 与 stopTime相差1小时内返回true
* @param startTime
* @param stopTime
* @return
*/
public static boolean getTimeDifference(LocalTime startTime, LocalTime stopTime) {
int startSecond = startTime.getHour() * 3600 + startTime.getMinute() * 60 + startTime.getSecond();
int stopSecond = stopTime.getHour() * 3600 + stopTime.getMinute() * 60 + stopTime.getSecond();
BigDecimal bigDecimal = BigDecimal.valueOf((float) (startSecond - stopSecond) / 3600).setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal bigDecimal1 = new BigDecimal(1).setScale(3, BigDecimal.ROUND_HALF_UP);
return bigDecimal.compareTo(bigDecimal1) <= 0 && bigDecimal.compareTo(new BigDecimal(0)) >= 0;
}
/**
* 自动任务执行
*/
@Override
......@@ -257,6 +273,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log.info(strDate + " " + " 暂无待生成执行数据的计划");
return;
}
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
List<Plan> planListTwo = new ArrayList<>();
//将日期格式化
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
LocalTime nowTime = LocalTime.parse(simpleDateFormat.format(new Date()));
for (Plan plan : planList) {
LocalTime dayTime = LocalTime.parse(plan.getDayTime());
// LocalTime plusHoursTime = dayTime.plusHours(1);
if (getTimeDifference(nowTime, dayTime)) {
planListTwo.add(plan);
}
}
if (planListTwo == null || planListTwo.size() <= 0) {
log.info(strDate + " " + " 暂无待生成执行数据的计划 (更改后,只执行进行中的数据)");
return;
}
planList = planListTwo;
//2.循环遍历执行
HashMap<String, Object> paramMap = new HashMap<String, Object>();
for (Plan plan : planList) {
......
......@@ -165,6 +165,8 @@
m.maintenance_expiration_time,
m.fire_facility_code,
m.owner_unit_name,
m.maintenance_company_name,
m.maintenance_cycle,
m.create_date
FROM
mt_maintenance_resource_data m
......
......@@ -116,6 +116,6 @@ mybatis.interceptor.enabled = false
fire-rescue=1432549862557130753
#阿里云实时语音识别参数
speech-config.access-key-id=LTAI5t7mGN6dYoCwMdKiLTgt
speech-config.access-key-secret=0LYdEnvKzQxBg0lpIahDp5rzB2r4Dp
speech-config.app-key=EG5fJBBIqkNMj6bM
\ No newline at end of file
speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n
speech-config.app-key=FC84bGUpbNFrexoL
\ No newline at end of file
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