2024-09-18
This commit is contained in:
parent
0c98e7ecd9
commit
1008145ee9
Binary file not shown.
|
|
@ -1,12 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper">
|
||||
|
||||
<mapper
|
||||
namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper">
|
||||
|
||||
|
||||
<select id="totalTrack" resultType="map">
|
||||
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat) min_lat from sample_dataset_track where dataset_id=#{dataset_id};
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="totalTrack" resultType="map">
|
||||
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
|
||||
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
|
||||
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
|
||||
</select>
|
||||
|
||||
<select id="listTrack" resultType="map">
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
sample_dataset_track t1,(
|
||||
SELECT
|
||||
min( tsy_id ) tsy_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
track_time,
|
||||
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
|
||||
tsy_id
|
||||
FROM
|
||||
sample_dataset_track k
|
||||
WHERE
|
||||
dataset_id = #{dataset_id}
|
||||
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
|
||||
) s
|
||||
GROUP BY
|
||||
track_minute
|
||||
) t2
|
||||
WHERE
|
||||
t1.tsy_id = t2.tsy_id
|
||||
AND t1.dataset_id = #{dataset_id}
|
||||
ORDER BY
|
||||
t1.track_time
|
||||
</select>
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -20,5 +20,7 @@
|
|||
select max(nav_time) max_time,min(nav_time) min_time,max(nav_lon) max_lon,min(nav_lon) min_lin,max(nav_lat) max_lat,min(nav_lat) min_lat from voyage_navigation where voyage_id=#{voyage_id};
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listNavigation" resultType="map">
|
||||
select * from voyage_navigation where VOYAGE_ID=#{voyage_id} and MOD(MINUTE(NAV_TIME),${ticket_minutes})=0 order by nav_time
|
||||
</select>
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -9,7 +9,8 @@
|
|||
on r.tsy_id = m.voyage_id
|
||||
where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (voyage_name like concat('%',#{query},'%') or voyage_officer like concat('%',#{funding_org},'%') or voyage_officer like concat('%',#{query},'%') or voyage_remark like concat('%',#{query},'%'))
|
||||
and (voyage_name like concat('%',#{query},'%') or voyage_officer like concat('%',#{query},'%')
|
||||
or voyage_officer like concat('%',#{query},'%') or voyage_remark like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
|
|
@ -20,6 +21,15 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="totalVoyage" resultType="map">
|
||||
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(voyage_mileage) mileage_total from voyage_reg where 1=1
|
||||
<if test="start_date != null ">
|
||||
and voyage_start_date >= #{start_date}
|
||||
</if>
|
||||
|
||||
<if test="end_date != null ">
|
||||
and voyage_end_date <= #{end_date}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
720
dsds20240611
720
dsds20240611
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
|||
package cn.tsy.data.idsse.dsds.mapper.sample;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -12,4 +13,7 @@ import cn.tsy.data.idsse.dsds.model.sample.SampleDatasetTrack;
|
|||
public interface SampleDatasetTrackMapper extends IHmeMapper<SampleDatasetTrack> {
|
||||
|
||||
public Map<String,Object> totalTrack(@Param("dataset_id") int dataset_id);
|
||||
|
||||
public List<Map<String,Object>> listTrack(@Param("dataset_id") int dataset_id,@Param("ticket_minutes") int ticket_minutes);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper">
|
||||
|
||||
<mapper
|
||||
namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper">
|
||||
|
||||
|
||||
<select id="totalTrack" resultType="map">
|
||||
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat) min_lat from sample_dataset_track where dataset_id=#{dataset_id};
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="totalTrack" resultType="map">
|
||||
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
|
||||
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
|
||||
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
|
||||
</select>
|
||||
|
||||
<select id="listTrack" resultType="map">
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
sample_dataset_track t1,(
|
||||
SELECT
|
||||
min( tsy_id ) tsy_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
track_time,
|
||||
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
|
||||
tsy_id
|
||||
FROM
|
||||
sample_dataset_track k
|
||||
WHERE
|
||||
dataset_id = #{dataset_id}
|
||||
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
|
||||
) s
|
||||
GROUP BY
|
||||
track_minute
|
||||
) t2
|
||||
WHERE
|
||||
t1.tsy_id = t2.tsy_id
|
||||
AND t1.dataset_id = #{dataset_id}
|
||||
ORDER BY
|
||||
t1.track_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.tsy.data.idsse.dsds.mapper.voyage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -23,4 +24,7 @@ public interface VoyageNavigationMapper extends IHmeMapper<VoyageNavigation> {
|
|||
);
|
||||
|
||||
public Map<String,Object> totalNavigation(@Param("voyage_id") int voyage_id);
|
||||
|
||||
|
||||
public List<Map<String,Object>> listNavigation(@Param("voyage_id") int voyage_id,@Param("ticket_minutes") int ticket_minutes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,5 +20,7 @@
|
|||
select max(nav_time) max_time,min(nav_time) min_time,max(nav_lon) max_lon,min(nav_lon) min_lin,max(nav_lat) max_lat,min(nav_lat) min_lat from voyage_navigation where voyage_id=#{voyage_id};
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listNavigation" resultType="map">
|
||||
select * from voyage_navigation where VOYAGE_ID=#{voyage_id} and MOD(MINUTE(NAV_TIME),${ticket_minutes})=0 order by nav_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
package cn.tsy.data.idsse.dsds.mapper.voyage;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import cn.hme.framework.jdbc.annotation.HmeMapper;
|
||||
|
|
@ -19,4 +23,6 @@ public interface VoyageRegMapper extends IHmeMapper<VoyageReg> {
|
|||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
|
||||
public List<Map<String,Object>> totalVoyage(@Param("start_date") LocalDate start_date,@Param("end_date") LocalDate end_date);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
on r.tsy_id = m.voyage_id
|
||||
where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (voyage_name like concat('%',#{query},'%') or voyage_officer like concat('%',#{funding_org},'%') or voyage_officer like concat('%',#{query},'%') or voyage_remark like concat('%',#{query},'%'))
|
||||
and (voyage_name like concat('%',#{query},'%') or voyage_officer like concat('%',#{query},'%')
|
||||
or voyage_officer like concat('%',#{query},'%') or voyage_remark like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
|
|
@ -20,6 +21,15 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="totalVoyage" resultType="map">
|
||||
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(voyage_mileage) mileage_total from voyage_reg where 1=1
|
||||
<if test="start_date != null ">
|
||||
and voyage_start_date >= #{start_date}
|
||||
</if>
|
||||
|
||||
<if test="end_date != null ">
|
||||
and voyage_end_date <= #{end_date}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -17,7 +17,7 @@ import cn.hme.framework.jdbc.annotation.HmeTable;
|
|||
*/
|
||||
@HmeTable(name = "VOYAGE_REG", key = "TSY_ID")
|
||||
public class VoyageReg extends HmeBean {
|
||||
private static final long serialVersionUID = -7957843595408253477L;
|
||||
private static final long serialVersionUID = 198412630150672208L;
|
||||
private Integer tsy_id;
|
||||
// 航次名称
|
||||
private String voyage_name;
|
||||
|
|
@ -45,6 +45,8 @@ public class VoyageReg extends HmeBean {
|
|||
private String voyage_status;
|
||||
// 状态变更时间
|
||||
private LocalDateTime voyage_status_time;
|
||||
// 航行里程
|
||||
private String voyage_mileage;
|
||||
|
||||
public Integer getTsy_id() {
|
||||
return this.tsy_id;
|
||||
|
|
@ -236,4 +238,17 @@ public class VoyageReg extends HmeBean {
|
|||
this.voyage_status_time = voyage_status_time;
|
||||
}
|
||||
|
||||
/****
|
||||
* 航行里程
|
||||
*/
|
||||
public String getVoyage_mileage() {
|
||||
return this.voyage_mileage;
|
||||
}
|
||||
|
||||
/****
|
||||
* 航行里程
|
||||
*/
|
||||
public void setVoyage_mileage(String voyage_mileage) {
|
||||
this.voyage_mileage = voyage_mileage;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,11 +9,13 @@ import cn.hme.framework.helper.date.LocalDateHelper;
|
|||
public class DSDSMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String value = "13.019202999999999";
|
||||
// 2024-05-14 09:48:00
|
||||
LocalDateTime date =LocalDateHelper.parseDate("1900-01-01").atStartOfDay();
|
||||
System.out.println(LocalDateHelper.format(LocalDateHelper.toLocalDateTime(DateUtil.getJavaDate(45428.941666666702))));
|
||||
;
|
||||
// String value = "13.019202999999999";
|
||||
// // 2024-05-14 09:48:00
|
||||
// LocalDateTime date =LocalDateHelper.parseDate("1900-01-01").atStartOfDay();
|
||||
// System.out.println(LocalDateHelper.format(LocalDateHelper.toLocalDateTime(DateUtil.getJavaDate(45428.941666666702))));
|
||||
// ;
|
||||
String value = "SY272.txt";
|
||||
System.out.println(value.replace(".txt", ""));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@ package cn.tsy.idsse.dsds.control;
|
|||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import cn.tsy.idsse.dsds.control.thread.DSDSReportThread;
|
||||
|
||||
public class DSDSInitializeLisener implements ServletContextListener {
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sc) {
|
||||
|
||||
new Thread(new DSDSReportThread()).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@ import cn.hme.framework.jdbc.provider.builder.DirectionEnum;
|
|||
import cn.hme.framework.jdbc.provider.builder.OrderBuilder;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictDataMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictData;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.dict.DictDataService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("dict/data")
|
||||
public class DictDataControl extends DSDSControl {
|
||||
public class DictDataControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private DictDataMapper mData;
|
||||
|
|
@ -39,12 +40,14 @@ public class DictDataControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(DictData data) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sData.editData(data);
|
||||
return new Ajax(data);
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sData.deleteData(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@ import cn.hme.framework.jdbc.provider.builder.DirectionEnum;
|
|||
import cn.hme.framework.jdbc.provider.builder.OrderBuilder;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictEquipmentMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictEquipment;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.dict.DictEquipmentService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("dict/equipment")
|
||||
public class DictEquipmentControl extends DSDSControl{
|
||||
public class DictEquipmentControl extends AjaxControl{
|
||||
|
||||
@Autowired
|
||||
private DictEquipmentMapper mEquipment;
|
||||
|
|
@ -38,12 +39,14 @@ public class DictEquipmentControl extends DSDSControl{
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(DictEquipment equipment) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sEquipment.editEquipment(equipment);
|
||||
return new Ajax(equipment);
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sEquipment.deleteEquipment(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@ import cn.hme.framework.jdbc.provider.builder.DirectionEnum;
|
|||
import cn.hme.framework.jdbc.provider.builder.OrderBuilder;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictPlatformMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictPlatform;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.dict.DictPlatformService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("dict/platform")
|
||||
public class DictPlatformControl extends DSDSControl {
|
||||
public class DictPlatformControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private DictPlatformMapper mPlatform;
|
||||
|
|
@ -39,12 +40,14 @@ public class DictPlatformControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(DictPlatform platform) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sPlatform.editPlatform(platform);
|
||||
return new Ajax(platform);
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sPlatform.deletePlatform(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictUnitSailMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictUnitSail;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.dict.DictUnitSailService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("dict/unit/sail")
|
||||
public class DictUnitSailControl extends DSDSControl{
|
||||
public class DictUnitSailControl extends AjaxControl{
|
||||
|
||||
@Autowired
|
||||
private DictUnitSailMapper mUnitSail;
|
||||
|
|
@ -31,12 +32,14 @@ public class DictUnitSailControl extends DSDSControl{
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(DictUnitSail sail) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sUnitSail.editUnitSail(sail);
|
||||
return new Ajax(sail);
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sUnitSail.deleteUnitSail(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictUnitShareMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictUnitShare;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.dict.DictUnitShareService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("dict/unit/share")
|
||||
public class DictUnitShareControl extends DSDSControl{
|
||||
public class DictUnitShareControl extends AjaxControl{
|
||||
|
||||
@Autowired
|
||||
private DictUnitShareMapper mUnitShare;
|
||||
|
|
@ -31,12 +32,14 @@ public class DictUnitShareControl extends DSDSControl{
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(DictUnitShare sail) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sUnitShare.editUnitShare(sail);
|
||||
return new Ajax(sail);
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sUnitShare.deleteUnitShare(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package cn.tsy.idsse.dsds.control.login;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.service.dict.FrameDictUtil;
|
||||
import cn.hme.framework.web.service.param.FrameParamUtil;
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
@RequestMapping("login")
|
||||
public class DSDSLoginControl extends AjaxControl {
|
||||
@RequestMapping("init.htm")
|
||||
public Ajax init() {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
// 字典信息
|
||||
map.put("FrameDictArray", FrameDictUtil.instance().getArrayDict());
|
||||
// 服务器时间
|
||||
map.put("FrameCurrentTime", LocalDateTime.now());
|
||||
// 系统所有参数
|
||||
map.put("FrameParamArray", FrameParamUtil.FrameParamArray);
|
||||
|
||||
|
||||
return new Ajax(map);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.tsy.idsse.dsds.control.param;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.hme.data.mapper.frame.param.FrameParamMapper;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("param")
|
||||
public class DSDSParamControl extends AjaxControl{
|
||||
|
||||
@Autowired
|
||||
private FrameParamMapper mParam;
|
||||
@RequestMapping("list.htm")
|
||||
public Ajax list() {
|
||||
return new Ajax(this.mParam.all());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package cn.tsy.idsse.dsds.control.report;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.idsse.dsds.control.thread.DSDSReportThread;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("report")
|
||||
public class DSDSReportControl extends AjaxControl{
|
||||
|
||||
@RequestMapping("main.htm")
|
||||
public Ajax list() {
|
||||
return new Ajax(DSDSReportThread.map);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,15 +12,17 @@ import cn.hme.framework.helper.excel.ExcelReaderHelper;
|
|||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleDataset;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleDatasetService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/dataset")
|
||||
public class SampleDatasetControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class SampleDatasetControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private SampleDatasetMapper mDataset;
|
||||
|
|
@ -45,16 +47,18 @@ public class SampleDatasetControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(SampleDataset dataset,Integer old_dataset_id) {
|
||||
return new Ajax(this.sDataset.editDataset(dataset, old_dataset_id,getFrameOptr()));
|
||||
return new Ajax(this.sDataset.editDataset(dataset, old_dataset_id,DSDSWebHelper.getFrameOptr(true)));
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(MultipartFile file) {
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file, 1, 35);
|
||||
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file, 1, 40);
|
||||
if (values.size() == 0)
|
||||
throw new BusinessException("导入的文件中无有效数据,请检查!");
|
||||
this.sDataset.uploadSample(values, getFrameOptr());
|
||||
this.sDataset.uploadSample(values, DSDSWebHelper.getFrameOptr(true));
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
|
|
@ -69,6 +73,8 @@ public class SampleDatasetControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sDataset.deleteDataset(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,18 +18,21 @@ import cn.hme.framework.jdbc.provider.builder.SqlBuilder;
|
|||
import cn.hme.framework.jdbc.provider.builder.SqlCondition;
|
||||
import cn.hme.framework.jdbc.provider.page.OrderBy;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.hme.framework.web.helper.WebHelper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleDataset;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleDatasetTrack;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSParamHelper;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleDatasetTrackService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/dataset/track")
|
||||
public class SampleDatasetTrackControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class SampleDatasetTrackControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private SampleDatasetMapper mData;
|
||||
|
|
@ -57,16 +60,19 @@ public class SampleDatasetTrackControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("list.htm")
|
||||
public Ajax list(int dataset_id) {
|
||||
return new Ajax(this.mTrack.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("track_time")));
|
||||
//return new Ajax(this.mTrack.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("track_time")));
|
||||
return new Ajax(this.mTrack.listTrack(dataset_id, DSDSParamHelper.DatasetNaviagtionTicketMinutes));
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(int dataset_id, MultipartFile file) {
|
||||
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
File f = FileHelper.fromUpload(file);
|
||||
List<String> array = FileHelper.readFileAsArray(f);
|
||||
f.delete();
|
||||
List<SampleDatasetTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename(), getFrameOptr());
|
||||
List<SampleDatasetTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
|
||||
if (list.size() == 0)
|
||||
throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)!");
|
||||
return new Ajax(file.getOriginalFilename());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package cn.tsy.idsse.dsds.control.sample;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import cn.hme.framework.helper.file.FileHelper;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetTrackMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleDataset;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleDatasetTrackService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/diving")
|
||||
@CrossOrigin
|
||||
public class SampleDivingControl extends AjaxControl {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SampleDatasetMapper mDataset;
|
||||
@Autowired
|
||||
private SampleDatasetTrackMapper mTrack;
|
||||
|
||||
@Autowired
|
||||
private SampleDatasetTrackService sTrack;
|
||||
|
||||
|
||||
|
||||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload( MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
File f = FileHelper.fromUpload(file);
|
||||
List<String> array = FileHelper.readFileAsArray(f);
|
||||
f.delete();
|
||||
List<SampleDataset> arrayDataset = this.mDataset.selectListByColumn("diving_sn", file.getOriginalFilename().replace(".txt", ""));
|
||||
|
||||
if(arrayDataset.size()==0)
|
||||
return new Ajax();
|
||||
this.sTrack.uploadTrack(arrayDataset.get(0).getTsy_id(), array, file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
|
||||
|
||||
return new Ajax(file.getOriginalFilename());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.tsy.idsse.dsds.control.sample;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -9,14 +10,16 @@ import cn.hme.framework.jdbc.provider.SqlBuilderHelper;
|
|||
import cn.hme.framework.jdbc.provider.page.OrderBy;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleLineMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleLine;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleLineService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/line")
|
||||
public class SampleLineControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class SampleLineControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private SampleLineMapper mLine;
|
||||
|
|
@ -26,7 +29,7 @@ public class SampleLineControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("page.htm")
|
||||
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
|
||||
order = StringHelper.hasValue(order) ? order : "create_time";
|
||||
order = StringHelper.hasValue(order) ? order : "sample_name";
|
||||
type = StringHelper.hasValue(type) ? type : "DESC";
|
||||
Pageable page = this.mLine.pageRecord(group,start, limit, SqlBuilderHelper.makePageSqlBuilder(query, order, type,
|
||||
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
|
||||
|
|
@ -42,7 +45,7 @@ public class SampleLineControl extends DSDSControl {
|
|||
@RequestMapping("list.htm")
|
||||
public Ajax list(int dataset_id,String order,String type) {
|
||||
if(StringHelper.isEmpty(order))
|
||||
order = "create_time";
|
||||
order = "sample_name";
|
||||
if(StringHelper.isEmpty(type))
|
||||
type = "DESC";
|
||||
return new Ajax(this.mLine.selectListByColumnAndSimpleOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
|
||||
|
|
@ -50,7 +53,7 @@ public class SampleLineControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(int dataset_id, SampleLine line) {
|
||||
this.sLine.editLine(dataset_id, line, getFrameOptr());
|
||||
this.sLine.editLine(dataset_id, line, DSDSWebHelper.getFrameOptr(true));
|
||||
return new Ajax(line);
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +65,7 @@ public class SampleLineControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sLine.deleteLine(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,16 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import cn.hme.framework.helper.file.FileHelper;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleLineTrack;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleLineTrackService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/line/track")
|
||||
public class SampleLineTrackControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class SampleLineTrackControl extends AjaxControl {
|
||||
|
||||
|
||||
@Autowired
|
||||
|
|
@ -29,10 +31,11 @@ public class SampleLineTrackControl extends DSDSControl {
|
|||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(int line_id, MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
File f = FileHelper.fromUpload(file);
|
||||
List<String> array = FileHelper.readFileAsArray(f);
|
||||
f.delete();
|
||||
List<SampleLineTrack> list = this.sTrack.uploadTrack(line_id, array,file.getOriginalFilename(), getFrameOptr());
|
||||
List<SampleLineTrack> list = this.sTrack.uploadTrack(line_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
|
||||
if (list.size() == 0)
|
||||
throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)!");
|
||||
return new Ajax(file.getOriginalFilename());
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import cn.hme.framework.helper.excel.ExcelReaderHelper;
|
|||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleLineMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleRegMapper;
|
||||
|
|
@ -19,12 +20,13 @@ import cn.tsy.data.idsse.dsds.mapper.sample.SampleStationMapper;
|
|||
import cn.tsy.data.idsse.dsds.model.sample.SampleLine;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleReg;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleStation;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleRegService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/reg")
|
||||
public class SampleRegControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class SampleRegControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private SampleRegMapper mSample;
|
||||
|
|
@ -47,7 +49,7 @@ public class SampleRegControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(SampleReg sample, SampleStation satation, SampleLine line) {
|
||||
this.sSample.editSample(sample, satation, line, getFrameOptr());
|
||||
this.sSample.editSample(sample, satation, line, DSDSWebHelper.getFrameOptr(true));
|
||||
return new Ajax(sample);
|
||||
}
|
||||
|
||||
|
|
@ -64,6 +66,7 @@ public class SampleRegControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sSample.deleteSample(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
@ -71,6 +74,7 @@ public class SampleRegControl extends DSDSControl {
|
|||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file, 2, 32);
|
||||
if (values.size() == 0)
|
||||
throw new BusinessException("导入的文件中无有效数据,请检查!");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.tsy.idsse.dsds.control.sample;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -12,10 +13,12 @@ import cn.hme.framework.web.control.Ajax;
|
|||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleStationMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleStation;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleStationService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/station")
|
||||
@CrossOrigin
|
||||
public class SampleStationControl extends DSDSControl {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -25,7 +28,7 @@ public class SampleStationControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("page.htm")
|
||||
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
|
||||
order = StringHelper.hasValue(order) ? order : "create_time";
|
||||
order = StringHelper.hasValue(order) ? order : "sample_name";
|
||||
type = StringHelper.hasValue(type) ? type : "DESC";
|
||||
Pageable page = this.mStation.pageRecord(group, start,limit, SqlBuilderHelper.makePageSqlBuilder(query, order, type,
|
||||
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
|
||||
|
|
@ -35,7 +38,7 @@ public class SampleStationControl extends DSDSControl {
|
|||
@RequestMapping("list.htm")
|
||||
public Ajax list(int dataset_id,String order,String type) {
|
||||
if(StringHelper.isEmpty(order))
|
||||
order = "create_time";
|
||||
order = "sample_name";
|
||||
if(StringHelper.isEmpty(type))
|
||||
type = "DESC";
|
||||
return new Ajax(this.mStation.selectListByColumnAndSimpleOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
|
||||
|
|
@ -55,6 +58,7 @@ public class SampleStationControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sStation.deleteStation(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import cn.tsy.idsse.dsds.service.sar.SarRegService;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("sar/file")
|
||||
@CrossOrigin
|
||||
public class SarFileControl extends DSDSControl {
|
||||
|
||||
@Autowired
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.tsy.idsse.dsds.control.sar;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ import cn.tsy.idsse.dsds.service.sar.SarRegService;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("sar/reg")
|
||||
@CrossOrigin
|
||||
public class SarRegControl extends DSDSControl{
|
||||
|
||||
@Autowired
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.tsy.idsse.dsds.control.search;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -11,6 +12,7 @@ import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("search")
|
||||
@CrossOrigin
|
||||
public class DSDSSearchControl extends AjaxControl {
|
||||
@Autowired
|
||||
private VoyageRegMapper mVoyage;
|
||||
|
|
@ -21,7 +23,7 @@ public class DSDSSearchControl extends AjaxControl {
|
|||
String where = "";
|
||||
if ("航次名称".equals(search_type)) {
|
||||
if (ids == null || ids.length < 1) {
|
||||
where = " and t.voyage_name like concat('%'," + search_value + ",'%') ";
|
||||
where = " and t.voyage_name like concat('%','" + search_value + "','%') ";
|
||||
} else {
|
||||
where = " and voyage_id in(" + CollectionHelper.join(ids, ",") + ") ";
|
||||
}
|
||||
|
|
@ -40,6 +42,8 @@ public class DSDSSearchControl extends AjaxControl {
|
|||
} else {
|
||||
where = " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") ";
|
||||
}
|
||||
} else if ("数据集名称".equals(search_type)) {
|
||||
where = " and (dataset_name like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("数据样品类型".equals(search_type)) {
|
||||
if (ids == null || ids.length < 1) {
|
||||
where = " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) ";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package cn.tsy.idsse.dsds.control.thread;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections4.map.HashedMap;
|
||||
|
||||
import cn.hme.framework.helper.spring.SpringHelper;
|
||||
import cn.hme.framework.helper.thread.ThreadHelper;
|
||||
import cn.hme.framework.jdbc.provider.builder.SqlQuery;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleLineMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleStationMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSParamHelper;
|
||||
|
||||
/**********************
|
||||
* 缓存首页的统计数字
|
||||
* @author TsySoft
|
||||
* @create 2024-09-02 11:13:42
|
||||
* @version 1.0.0
|
||||
* @email revisit@126.com
|
||||
*
|
||||
*/
|
||||
public class DSDSReportThread implements Runnable{
|
||||
|
||||
public static Map<String,Object> map = null;
|
||||
public DSDSReportThread() {
|
||||
map = new HashedMap<String, Object>();
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
while(true) {
|
||||
try {
|
||||
this.report();
|
||||
}catch(Exception e) {
|
||||
|
||||
}
|
||||
ThreadHelper.sleepSeconds(DSDSParamHelper.ReportMainTicketSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void report() {
|
||||
// 数据集
|
||||
map.put("DatasetTotal", SpringHelper.getBean(SampleDatasetMapper.class).selectCount(SqlQuery.create())) ;
|
||||
// 样品数量
|
||||
map.put("DataTotal", SpringHelper.getBean(SampleLineMapper.class).selectCount(SqlQuery.create()) + SpringHelper.getBean(SampleStationMapper.class).selectCount(SqlQuery.create()) ) ;
|
||||
|
||||
List<Map<String,Object>> array = SpringHelper.getBean(VoyageRegMapper.class).totalVoyage(null, null);
|
||||
if(array.size()>0) {
|
||||
// 航次个数
|
||||
map.put("VoyageTotal",array.get(0).get("voyage_total")) ;
|
||||
// 航线天数
|
||||
map.put("DayTotal",array.get(0).get("day_total"));
|
||||
// 航行里程
|
||||
map.put("MileageTotal",array.get(0).get("mileage_total"));
|
||||
}
|
||||
// 深海勇士
|
||||
map.put("ShenHaiTotal",SpringHelper.getBean(SampleDatasetMapper.class).selectCount(SqlQuery.create().eq("platform_name", "深海勇士")));
|
||||
// 奋斗者
|
||||
map.put("FenDouTotal",SpringHelper.getBean(SampleDatasetMapper.class).selectCount(SqlQuery.create().eq("platform_name", "奋斗者")));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -16,17 +16,19 @@ import cn.hme.framework.helper.lang.StringHelper;
|
|||
import cn.hme.framework.jdbc.provider.page.OrderBy;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageMemberMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageMember;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.voyage.VoyageMemberService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("voyage/member")
|
||||
public class VoyageMemberControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class VoyageMemberControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private VoyageRegMapper mReg;
|
||||
|
|
@ -45,12 +47,14 @@ public class VoyageMemberControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(VoyageMember member) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sMember.editMember(member);
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int member_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sMember.deleteMember(member_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
@ -64,8 +68,9 @@ public class VoyageMemberControl extends DSDSControl {
|
|||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(int voyage_id, MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file,1, 12);
|
||||
List<VoyageMember> list = this.sMember.uploadMember(voyage_id, values, getFrameOptr());
|
||||
List<VoyageMember> list = this.sMember.uploadMember(voyage_id, values, DSDSWebHelper.getFrameOptr(true));
|
||||
if (list.size() == 0)
|
||||
throw new BusinessException("未找到有效的参航人员记录!");
|
||||
return new Ajax();
|
||||
|
|
|
|||
|
|
@ -21,18 +21,22 @@ import cn.hme.framework.jdbc.provider.builder.SqlCondition;
|
|||
import cn.hme.framework.jdbc.provider.page.OrderBy;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.hme.framework.web.helper.WebHelper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageNavigationMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageNavigation;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSGeoCalculator;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSParamHelper;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.voyage.VoyageNavigationService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("voyage/navigation")
|
||||
public class VoyageNavigationControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class VoyageNavigationControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private VoyageRegMapper mReg;
|
||||
|
|
@ -51,8 +55,24 @@ public class VoyageNavigationControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("list.htm")
|
||||
public Ajax list(int voyage_id) {
|
||||
return new Ajax(this.mNavigation.selectListByColumnAndSimpleOrder("voyage_id", voyage_id, OrderBy.of("nav_time")));
|
||||
//return new Ajax(this.mNavigation.selectListByColumnAndSimpleOrder("voyage_id", voyage_id, OrderBy.of("nav_time")));
|
||||
return new Ajax(this.mNavigation.listNavigation(voyage_id, DSDSParamHelper.VaoyageNaviagtionTicketMinutes));
|
||||
}
|
||||
|
||||
@RequestMapping("mileage.htm")
|
||||
public Ajax mileage(int voyage_id) {
|
||||
Double value = DSDSGeoCalculator.calcuateVoyage(
|
||||
this.mNavigation.selectListByColumnAndSimpleOrder("voyage_id", voyage_id, OrderBy.of("nav_time")));
|
||||
if(value!=null && value>0) {
|
||||
VoyageReg voyage = new VoyageReg();
|
||||
voyage.setTsy_id(voyage_id);
|
||||
voyage.setVoyage_mileage(value.intValue()+"");
|
||||
this.mReg.update(voyage);
|
||||
|
||||
}
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
@RequestMapping("total.htm")
|
||||
public Ajax total(int voyage_id) {
|
||||
Map<String,Object> value = this.mNavigation.totalNavigation(voyage_id);
|
||||
|
|
@ -71,10 +91,11 @@ public class VoyageNavigationControl extends DSDSControl {
|
|||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(int voyage_id, MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
File f = FileHelper.fromUpload(file);
|
||||
List<String> array = FileHelper.readFileAsArray(f);
|
||||
f.delete();
|
||||
List<VoyageNavigation> list = this.sNav.uploadNavigation(voyage_id, array,file.getOriginalFilename(), getFrameOptr());
|
||||
List<VoyageNavigation> list = this.sNav.uploadNavigation(voyage_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
|
||||
if (list.size() == 0)
|
||||
throw new BusinessException("未找到有效的导航记录(已忽略相同的记录)!");
|
||||
return new Ajax(file.getOriginalFilename());
|
||||
|
|
|
|||
|
|
@ -1,25 +1,32 @@
|
|||
package cn.tsy.idsse.dsds.control.voyage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import cn.hme.framework.helper.excel.ExcelReaderHelper;
|
||||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.OrderBy;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageMemberMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.idsse.dsds.control.DSDSControl;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.voyage.VoyageRegService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("voyage/reg")
|
||||
public class VoyageRegControl extends DSDSControl {
|
||||
@CrossOrigin
|
||||
public class VoyageRegControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private VoyageRegMapper mVoyage;
|
||||
|
|
@ -39,9 +46,19 @@ public class VoyageRegControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(VoyageReg voyage) {
|
||||
this.sVoyage.editVoyage(voyage, getFrameOptr());
|
||||
this.sVoyage.editVoyage(voyage, DSDSWebHelper.getFrameOptr(true));
|
||||
return new Ajax(voyage);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(MultipartFile file) {
|
||||
// DSDSWebHelper.getFrameOptr(true);
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file, 1, 40);
|
||||
if (values.size() == 0)
|
||||
throw new BusinessException("导入的文件中无有效数据,请检查!");
|
||||
return new Ajax(this.sVoyage.uploadVoyage(values).size());
|
||||
}
|
||||
|
||||
@RequestMapping("info.htm")
|
||||
public Ajax info(String voyage_name) {
|
||||
|
|
@ -62,6 +79,7 @@ public class VoyageRegControl extends DSDSControl {
|
|||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sVoyage.deleteVoyage(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package cn.tsy.idsse.dsds.helper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageNavigation;
|
||||
|
||||
public class DSDSGeoCalculator {
|
||||
|
||||
// 地球半径,单位为海里
|
||||
private static final double EARTH_RADIUS = 3440;
|
||||
|
||||
/**
|
||||
* 计算两点之间的距离,结果以海里为单位
|
||||
*
|
||||
* @param lat1 第一个点的纬度
|
||||
* @param lon1 第一个点的经度
|
||||
* @param lat2 第二个点的纬度
|
||||
* @param lon2 第二个点的经度
|
||||
* @return 两点之间的距离,单位为海里
|
||||
*/
|
||||
public static double calculateDistanceInNauticalMiles(double lat1, double lon1, double lat2, double lon2) {
|
||||
double latDistance = Math.toRadians(lat2 - lat1);
|
||||
double lonDistance = Math.toRadians(lon2 - lon1);
|
||||
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
|
||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
double distance = EARTH_RADIUS * c;
|
||||
return distance;
|
||||
}
|
||||
|
||||
public static double calcuateVoyage(List<VoyageNavigation> list) {
|
||||
if (list.size() < 2)
|
||||
return 0d;
|
||||
double distance = 0;
|
||||
for (int i = 0; i < list.size()-1; i++) {
|
||||
distance += calculateDistanceInNauticalMiles(Double.parseDouble(list.get(i).getNav_lat()),
|
||||
Double.parseDouble(list.get(i).getNav_lon()),
|
||||
Double.parseDouble(list.get(i+1).getNav_lat()),
|
||||
Double.parseDouble(list.get(i+1).getNav_lon()));
|
||||
}
|
||||
return distance;
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// // 示例经纬度
|
||||
// double lat1 = 40.7128;
|
||||
// double lon1 = -74.0060;
|
||||
// double lat2 = 40.7829;
|
||||
// double lon2 = -73.9654;
|
||||
//
|
||||
// double distance = calculateDistanceInNauticalMiles(lat1, lon1, lat2, lon2);
|
||||
// System.out.println("Distance in nautical miles: " + distance);
|
||||
// }
|
||||
}
|
||||
|
|
@ -7,4 +7,18 @@ public class DSDSParamHelper {
|
|||
* 应急救援附件路径
|
||||
*/
|
||||
public static String SarFileRoot = "d:\\sar\\@{yyyy}}\\";
|
||||
|
||||
|
||||
/****************
|
||||
* 航次间隔时间(单位分钟)
|
||||
*/
|
||||
public static int VaoyageNaviagtionTicketMinutes = 5;
|
||||
/****************
|
||||
* 航次间隔时间(单位分钟)
|
||||
*/
|
||||
public static int DatasetNaviagtionTicketMinutes = 1;
|
||||
/****************
|
||||
* 首页统计时间间隔,单位秒
|
||||
*/
|
||||
public static int ReportMainTicketSeconds = 5 * 60;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package cn.tsy.idsse.dsds.helper;
|
||||
|
||||
import cn.hme.data.mapper.frame.optr.FrameOptrMapper;
|
||||
import cn.hme.data.model.frame.optr.FrameOptr;
|
||||
import cn.hme.framework.constant.FrameStatus;
|
||||
import cn.hme.framework.helper.spring.SpringHelper;
|
||||
import cn.hme.framework.web.exception.LoginTimeoutException;
|
||||
import cn.hme.framework.web.helper.FrameParamHelper;
|
||||
import cn.hme.framework.web.helper.WebHelper;
|
||||
|
||||
public class DSDSWebHelper {
|
||||
/*******************
|
||||
* 获取系统操作员,并根据参数选择是否进行判断
|
||||
*/
|
||||
public static FrameOptr getFrameOptr(boolean check) {
|
||||
FrameOptr optr = null;
|
||||
try {
|
||||
optr = (FrameOptr) WebHelper.getSession().getAttribute(FrameParamHelper.SessionName_FrameOptr);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (check && optr == null) {
|
||||
if (FrameStatus.Active.toString().equals(FrameParamHelper.AllowNologin)) {
|
||||
optr = SpringHelper.getBean(FrameOptrMapper.class).find(1);
|
||||
WebHelper.getSession().setAttribute(FrameParamHelper.SessionName_FrameOptr, optr);
|
||||
}
|
||||
else
|
||||
throw new LoginTimeoutException();
|
||||
}
|
||||
return optr;
|
||||
}
|
||||
}
|
||||
|
|
@ -184,8 +184,10 @@ public class SampleDatasetService {
|
|||
String end_lat = list.get(29);
|
||||
String start_time = list.get(30);
|
||||
String end_time = list.get(31);
|
||||
String remark = list.get(32);
|
||||
String data_role = list.get(33);
|
||||
String data_status = list.get(32);
|
||||
String remark = list.get(33);
|
||||
String data_role = list.get(34);
|
||||
String fouing_org = list.get(35);
|
||||
|
||||
SampleDataset sa = new SampleDataset();
|
||||
VoyageReg voyage = this.mVoyage.findWithColumn("voyage_name", voyage_name);
|
||||
|
|
@ -263,14 +265,18 @@ public class SampleDatasetService {
|
|||
if (ds == null) {
|
||||
sa.setCreate_time(LocalDateTime.now());
|
||||
this.mDataset.insert(sa);
|
||||
} else
|
||||
} else {
|
||||
sa.setTsy_id(ds.getTsy_id());
|
||||
this.mDataset.update(sa);
|
||||
}
|
||||
|
||||
SampleLine line = new SampleLine();
|
||||
SampleStation st = new SampleStation();
|
||||
if (StringHelper.isEmpty(job_type))
|
||||
throwError(i, "作业类型为空,请检查!");
|
||||
if (VoyageJobType.Line.equals(job_type)) {
|
||||
if(StringHelper.hasValue(fouing_org))
|
||||
line.setFunding_org(fouing_org);
|
||||
if (StringHelper.hasValue(line_sn))
|
||||
line.setLine_sn(line_sn);
|
||||
if (StringHelper.hasValue(start_lon))
|
||||
|
|
@ -285,6 +291,8 @@ public class SampleDatasetService {
|
|||
line.setStart_time(LocalDateHelper.parseDateTime(start_time));
|
||||
if (StringHelper.hasValue(end_time))
|
||||
line.setEnd_time(LocalDateHelper.parseDateTime(end_time));
|
||||
if(StringHelper.hasValue(data_status))
|
||||
line.setSample_status(data_status);
|
||||
line.setDataset_name(dataset_name);
|
||||
line.setDataset_id(sa.getTsy_id());
|
||||
if (StringHelper.isEmpty(line_sn)) {
|
||||
|
|
@ -314,10 +322,14 @@ public class SampleDatasetService {
|
|||
|
||||
line.setCreate_time(LocalDateTime.now());
|
||||
// 判断是否存在
|
||||
if (this.mLine.findWithColumn("sample_name", st.getSample_name()) != null)
|
||||
throwError(i, "测线作业[" + st.getSample_name() + "]已经存在!");
|
||||
if (this.mLine.findWithColumn("sample_name", line.getSample_name()) != null) {
|
||||
this.mLine.deleteByColumn("sample_name", line.getSample_name());
|
||||
// throwError(i, "测线作业[" + st.getSample_name() + "]已经存在!");
|
||||
}
|
||||
this.mLine.insert(line);
|
||||
} else if (VoyageJobType.Station.equals(job_type)) {
|
||||
if(StringHelper.hasValue(fouing_org))
|
||||
st.setFunding_org(fouing_org);
|
||||
if (StringHelper.hasValue(sampling_time))
|
||||
st.setSampling_time(LocalDateHelper.parseDateTime(sampling_time));
|
||||
if (StringHelper.hasValue(sampling_lat))
|
||||
|
|
@ -349,10 +361,11 @@ public class SampleDatasetService {
|
|||
if (StringHelper.hasValue(data_role))
|
||||
st.setPublish_rule(data_role);
|
||||
// 判断是否存在
|
||||
if (this.mStation.findWithColumn("sample_name", st.getSample_name()) != null)
|
||||
throwError(i, "站位作业[" + st.getSample_name() + "]已经存在!");
|
||||
if (this.mStation.findWithColumn("sample_name", st.getSample_name()) != null) {
|
||||
// throwError(i, "站位作业[" + st.getSample_name() + "]已经存在!");
|
||||
this.mStation.deleteByColumn("sample_name", st.getSample_name());
|
||||
}
|
||||
st.setCreate_time(LocalDateTime.now());
|
||||
|
||||
st.setDataset_name(dataset_name);
|
||||
st.setDataset_id(sa.getTsy_id());
|
||||
this.mStation.insert(st);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import org.springframework.stereotype.Service;
|
|||
import cn.hme.data.model.frame.optr.FrameOptr;
|
||||
import cn.hme.framework.helper.date.LocalDateHelper;
|
||||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.builder.SqlBuilder;
|
||||
import cn.hme.framework.jdbc.provider.builder.SqlCondition;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.hme.framework.web.helper.FrameAssertHelper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper;
|
||||
|
|
@ -77,11 +75,11 @@ public class SampleDatasetTrackService {
|
|||
nav.setTrack_time(curTime);
|
||||
nav.setDataset_id(dataset_id);
|
||||
// 判断时间是否重复了
|
||||
List<SampleDatasetTrack> vArray = this.mTrack.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("dataset_id", dataset_id)).addSqlCondition(SqlCondition.of("track_time", curTime)));
|
||||
if (vArray.size() == 0) {
|
||||
this.mTrack.insert(nav);
|
||||
navArray.add(nav);
|
||||
}
|
||||
// List<SampleDatasetTrack> vArray = this.mTrack.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("dataset_id", dataset_id)).addSqlCondition(SqlCondition.of("track_time", curTime)));
|
||||
// if (vArray.size() == 0) {
|
||||
this.mTrack.insert(nav);
|
||||
navArray.add(nav);
|
||||
// }
|
||||
}
|
||||
if (navArray.size() > 0) {
|
||||
SampleDataset ds = new SampleDataset();
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ public class SampleLineTrackService {
|
|||
nav.setTrack_time(curTime);
|
||||
nav.setLine_id(line_id);
|
||||
// 判断时间是否重复了
|
||||
List<SampleLineTrack> vArray = this.mTrack.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("line_id", line_id)).addSqlCondition(SqlCondition.of("track_time", curTime)));
|
||||
if (vArray.size() == 0) {
|
||||
// List<SampleLineTrack> vArray = this.mTrack.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("line_id", line_id)).addSqlCondition(SqlCondition.of("track_time", curTime)));
|
||||
// if (vArray.size() == 0) {
|
||||
this.mTrack.insert(nav);
|
||||
navArray.add(nav);
|
||||
}
|
||||
// }
|
||||
}
|
||||
if (navArray.size() > 0) {
|
||||
SampleLine ds = new SampleLine();
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import org.springframework.stereotype.Service;
|
|||
import cn.hme.data.model.frame.optr.FrameOptr;
|
||||
import cn.hme.framework.helper.date.LocalDateHelper;
|
||||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.builder.SqlBuilder;
|
||||
import cn.hme.framework.jdbc.provider.builder.SqlCondition;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.hme.framework.web.helper.FrameAssertHelper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageLogMapper;
|
||||
|
|
@ -20,6 +18,7 @@ import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
|||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageNavigation;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.idsse.dsds.constant.VoyageLogType;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSGeoCalculator;
|
||||
|
||||
@Service
|
||||
public class VoyageNavigationService {
|
||||
|
|
@ -33,6 +32,7 @@ public class VoyageNavigationService {
|
|||
public List<VoyageNavigation> uploadNavigation(int voyage_id, List<String> array,String file_name, FrameOptr optr) {
|
||||
FrameAssertHelper.hasValue(array, "航次导航文件为空,请检查!");
|
||||
List<VoyageNavigation> navArray = new ArrayList<>();
|
||||
this.mNav.deleteByColumn("voyage_id", voyage_id);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
if (array.get(i).trim().length() == 0)
|
||||
break;
|
||||
|
|
@ -78,17 +78,21 @@ public class VoyageNavigationService {
|
|||
nav.setNav_time(curTime);
|
||||
nav.setVoyage_id(voyage_id);
|
||||
// 判断时间是否重复了
|
||||
List<VoyageNavigation> vArray = this.mNav.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("voyage_id", voyage_id)).addSqlCondition(SqlCondition.of("nav_time", curTime)));
|
||||
if (vArray.size() == 0) {
|
||||
// List<VoyageNavigation> vArray = this.mNav.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("voyage_id", voyage_id)).addSqlCondition(SqlCondition.of("nav_time", curTime)));
|
||||
// if (vArray.size() == 0) {
|
||||
this.mNav.insert(nav);
|
||||
navArray.add(nav);
|
||||
}
|
||||
// }
|
||||
}
|
||||
if (navArray.size() > 0) {
|
||||
VoyageReg voyage = new VoyageReg();
|
||||
voyage.setTsy_id(voyage_id);
|
||||
voyage.setNavigation_file_name(file_name);
|
||||
// 计算海里数目
|
||||
Double dValue = DSDSGeoCalculator.calcuateVoyage(navArray);
|
||||
voyage.setVoyage_mileage(dValue.intValue()+"");
|
||||
this.mVoyage.update(voyage);
|
||||
|
||||
VoyageRegService.logVoyage(mLog, voyage_id, optr, VoyageLogType.UploadNavigation, "成功导入[" + navArray.size() + "]条导航记录");
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
package cn.tsy.idsse.dsds.service.voyage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hme.data.model.frame.optr.FrameOptr;
|
||||
import cn.hme.framework.constant.FrameStatus;
|
||||
import cn.hme.framework.helper.date.LocalDateHelper;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.hme.framework.web.helper.FrameAssertHelper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageLogMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageLog;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageMember;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageNavigation;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageMember;
|
||||
import cn.tsy.idsse.dsds.constant.VoyageLogType;
|
||||
import cn.tsy.idsse.dsds.constant.VoyageStatus;
|
||||
|
||||
|
|
@ -53,6 +56,51 @@ public class VoyageRegService {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
// 航次名称 科考船舶 涉密航次 航次任务简述 开始时间 结束时间 航次首席 航次资助机构 资助编号
|
||||
public List<VoyageReg> uploadVoyage(List<List<String>> values) {
|
||||
List<VoyageReg> array = new ArrayList<VoyageReg>();
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
List<String> list = values.get(i);
|
||||
if (list.get(0) == null || list.get(0).trim().length() == 0)
|
||||
break;
|
||||
String voyage_name = list.get(0);
|
||||
String ship_name = list.get(1);
|
||||
String secure_flag = list.get(2);
|
||||
String remark = list.get(3);
|
||||
String start_date = list.get(4);
|
||||
String end_date = list.get(5);
|
||||
String voyage_officer = list.get(6);
|
||||
String funding_org = list.get(7);
|
||||
String funding_code = list.get(8);
|
||||
List<VoyageReg> vArray = this.mReg.selectListByColumn("voyage_name", voyage_name);
|
||||
VoyageReg reg = null;
|
||||
|
||||
if(vArray.size()>0)
|
||||
reg = vArray.get(0);
|
||||
else
|
||||
reg = new VoyageReg();
|
||||
reg.setCreate_time(LocalDateTime.now());
|
||||
reg.setFunding_code(funding_code);
|
||||
reg.setFunding_org(funding_org);
|
||||
reg.setSerect_status("是".equals(secure_flag)?FrameStatus.Active.toString():FrameStatus.InActive.toString());
|
||||
reg.setShip_name(ship_name);
|
||||
reg.setVoyage_end_date(LocalDateHelper.parseDate(end_date));
|
||||
reg.setVoyage_start_date(LocalDateHelper.parseDate(start_date));
|
||||
reg.setVoyage_name(voyage_name);
|
||||
reg.setVoyage_officer(voyage_officer);
|
||||
reg.setVoyage_remark(remark);
|
||||
reg.setVoyage_status("Plan");
|
||||
reg.setVoyage_status_time(LocalDateTime.now());
|
||||
if(reg.getTsy_id()==null)
|
||||
this.mReg.insert(reg);
|
||||
else
|
||||
this.mReg.update(reg);
|
||||
array.add(reg);
|
||||
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
/****************
|
||||
* 删除航次信息
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue