Commit a30cbf07 authored by 李秀明's avatar 李秀明

稳压泵启停时间拾时区修改

parent 911f9d8c
......@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -40,6 +41,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.context.RequestContext.*;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
@Slf4j
......@@ -49,7 +51,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
@Autowired
SupervisionVideoMapper supervisionVideoMapper;
@Autowired
private IVideoService videoService;
@Autowired
......@@ -344,7 +346,11 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
Map<String, String> map = new HashMap<>();
map.put("id", UUID.randomUUID().toString());
map.put("name", String.valueOf(item.get("name")));
map.put("time", String.valueOf(x.get("time")).substring(0, 19).replace("T", " "));
try {
map.put("time", change(String.valueOf(x.get("time"))));
} catch (ParseException e) {
throw new RuntimeException(e);
}
map.put("value", String.valueOf(x.get(pressurePumpStart)));
finalResList.add(map);
});
......@@ -386,4 +392,17 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
public List<Map<String, Object>> selectAllPressureName(String bizOrgCode) {
return fireFightingSystemMapper.selectAllPressureName(bizOrgCode);
}
private String change(String time) throws ParseException {
Date date1 = null;
try {
String strDate = time.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
date1 = sdf.parse(strDate);
} catch (ParseException e) {
e.printStackTrace();
}
return DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
}
}
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