2025-09-08 add res...

This commit is contained in:
revisit 2025-09-08 00:37:17 +08:00
parent 9ac094d472
commit 0c79113476
25 changed files with 1252 additions and 228 deletions

View File

@ -2,5 +2,5 @@ AppDebug=true
AppParamHelper=cn.tsy.idsse.dsds.helper.DSDSParamHelper
AppDatabaseStdout=Active
AppListener=cn.tsy.idsse.dsds.control.DSDSInitializeLisener
AppName=DSDS2024Server
AppName=RescueServer
DatabaseWarnDelayTimes=10000

View File

@ -53,7 +53,7 @@
</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
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(ifnull(voyage_mileage,0)) mileage_total from voyage_reg where 1=1
<if test="start_date != null ">
and voyage_start_date &gt;= #{start_date}
</if>

View File

@ -2,5 +2,5 @@ AppDebug=true
AppParamHelper=cn.tsy.idsse.dsds.helper.DSDSParamHelper
AppDatabaseStdout=Active
AppListener=cn.tsy.idsse.dsds.control.DSDSInitializeLisener
AppName=DSDS2024Server
AppName=RescueServer
DatabaseWarnDelayTimes=10000

View File

@ -0,0 +1,23 @@
package cn.tsy.data.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.annotation.HmeMapper;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.hme.framework.jdbc.provider.page.Pageable;
import cn.tsy.data.idsse.dsds.model.dict.DictFunding;
@HmeMapper
public interface DictFundingMapper extends IHmeMapper<DictFunding> {
public Pageable fundingWithPage(
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
);
}

View File

@ -0,0 +1,22 @@
<?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.dict.DictFundingMapper">
<!-- 分页查询 -->
<select id="fundingWithPage" resultType="map">
select * from dict_funding where 1=1
<if test="query != null and query != ''">
and (funding_name like concat('%',#{query},'%') or funding_eng like concat('%',#{query},'%') )
</if>
<if test="order != null and order != ''">
ORDER BY ${order}
</if>
<if test="type != null and (type == 'DESC')">
DESC
</if>
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package cn.tsy.data.idsse.dsds.mapper.rescue;
import cn.hme.framework.jdbc.annotation.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.idsse.dsds.model.rescue.RescueFile;
@HmeMapper
public interface RescueFileMapper extends IHmeMapper<RescueFile> {
}

View File

@ -0,0 +1,21 @@
package cn.tsy.data.idsse.dsds.mapper.rescue;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.annotation.HmeMapper;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.hme.framework.jdbc.provider.page.Pageable;
import cn.tsy.data.idsse.dsds.model.rescue.RescueReg;
@HmeMapper
public interface RescueRegMapper extends IHmeMapper<RescueReg> {
public Pageable rescueWithPage(
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
);
}

View File

@ -0,0 +1,21 @@
<?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.rescue.RescueRegMapper">
<!-- 分页查询 -->
<select id="rescueWithPage" resultType="map">
select * from rescue_reg
where 1=1
<if test="query != null and query != ''">
and (voyage_name like concat('%',#{query},'%') or rescue_code like concat('%',#{query},'%')
</if>
<if test="order != null and order != ''">
ORDER BY ${order}
</if>
<if test="type != null and (type == 'DESC')">
DESC
</if>
</select>
</mapper>

View File

@ -53,7 +53,7 @@
</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
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(ifnull(voyage_mileage,0)) mileage_total from voyage_reg where 1=1
<if test="start_date != null ">
and voyage_start_date &gt;= #{start_date}
</if>

View File

@ -0,0 +1,93 @@
package cn.tsy.data.idsse.dsds.model.dict;
import cn.hme.framework.bean.HmeBean;
import cn.hme.framework.jdbc.annotation.HmeTable;
import java.time.LocalDateTime;
/**********************************************
* 字典-资助机构
* @author: zxq
* @date: 2025-03-26 14:59:35
* @version: 1.0.0
* @email: revisit@126.com
* @Company: www.hmesoft.cn
*/
@HmeTable(name = "DICT_FUNDING", key="TSY_ID")
public class DictFunding extends HmeBean{
private static final long serialVersionUID = -8928297023064002412L;
private Integer tsy_id;
//平台类型名称
private String funding_name;
//平台分组
private String funding_eng;
//创建时间
private LocalDateTime create_time;
//排序信息
private Integer funding_order;
public Integer getTsy_id() {
return this.tsy_id;
}
public void setTsy_id(Integer tsy_id) {
this.tsy_id = tsy_id;
}
/****
* 平台类型名称
*/
public String getFunding_name() {
return this.funding_name;
}
/****
* 平台类型名称
*/
public void setFunding_name(String funding_name) {
this.funding_name = funding_name;
}
/****
* 平台分组
*/
public String getFunding_eng() {
return this.funding_eng;
}
/****
* 平台分组
*/
public void setFunding_eng(String funding_eng) {
this.funding_eng = funding_eng;
}
/****
* 创建时间
*/
public LocalDateTime getCreate_time() {
return this.create_time;
}
/****
* 创建时间
*/
public void setCreate_time(LocalDateTime create_time) {
this.create_time = create_time;
}
/****
* 排序信息
*/
public Integer getFunding_order() {
return this.funding_order;
}
/****
* 排序信息
*/
public void setFunding_order(Integer funding_order) {
this.funding_order = funding_order;
}
}

View File

@ -0,0 +1,124 @@
package cn.tsy.data.idsse.dsds.model.rescue;
import cn.hme.framework.bean.HmeBean;
import cn.hme.framework.jdbc.annotation.HmeTable;
/**********************************************
* 应急救援附件信息
*
* @author: zxq
* @date: 2025-08-18 16:24:11
* @version: 1.0.0
* @email: revisit@126.com
* @Company: www.hmesoft.cn
*/
@HmeTable(name = "RESCUE_FILE", key = "TSY_ID")
public class RescueFile extends HmeBean {
private static final long serialVersionUID = -6468597691895298664L;
private Integer tsy_id;
// 应急编号
private Integer rescue_id;
// 附件原始名称
private String file_org_name;
// 附件真实名称
private String file_real_name;
// 全路径
private String file_path;
// 文件大小
private String file_length;
// 备注信息
private String file_note;
public Integer getTsy_id() {
return this.tsy_id;
}
public void setTsy_id(Integer tsy_id) {
this.tsy_id = tsy_id;
}
/****
* 应急编号
*/
public Integer getRescue_id() {
return this.rescue_id;
}
/****
* 应急编号
*/
public void setRescue_id(Integer rescue_id) {
this.rescue_id = rescue_id;
}
/****
* 附件原始名称
*/
public String getFile_org_name() {
return this.file_org_name;
}
/****
* 附件原始名称
*/
public void setFile_org_name(String file_org_name) {
this.file_org_name = file_org_name;
}
/****
* 附件真实名称
*/
public String getFile_real_name() {
return this.file_real_name;
}
/****
* 附件真实名称
*/
public void setFile_real_name(String file_real_name) {
this.file_real_name = file_real_name;
}
/****
* 全路径
*/
public String getFile_path() {
return this.file_path;
}
/****
* 全路径
*/
public void setFile_path(String file_path) {
this.file_path = file_path;
}
/****
* 文件大小
*/
public String getFile_length() {
return this.file_length;
}
/****
* 文件大小
*/
public void setFile_length(String file_length) {
this.file_length = file_length;
}
/****
* 备注信息
*/
public String getFile_note() {
return this.file_note;
}
/****
* 备注信息
*/
public void setFile_note(String file_note) {
this.file_note = file_note;
}
}

View File

@ -0,0 +1,485 @@
package cn.tsy.data.idsse.dsds.model.rescue;
import java.time.LocalDateTime;
import cn.hme.framework.bean.HmeBean;
import cn.hme.framework.jdbc.annotation.HmeTable;
/**********************************************
* 应急搜救任务
*
* @author: zxq
* @date: 2025-08-18 16:22:12
* @version: 1.0.0
* @email: revisit@126.com
* @Company: www.hmesoft.cn
*/
@HmeTable(name = "RESCUE_REG", key = "TSY_ID")
public class RescueReg extends HmeBean {
private static final long serialVersionUID = 2627112161915134338L;
// rescue
private Integer tsy_id;
// 关联航次
private String voyage_name;
// 状态信息
private String rescue_status;
// 状态变更时间
private LocalDateTime rescue_status_time;
// 状态变更说明
private String rescue_status_note;
// 应急搜捞SAR 专项调查SI
private String rescue_type;
// 任务类型_目标类别_总序列号:SAR_Wreck_075
private String rescue_code;
// 如果未知可填写未知大型沉物Wreck锚系类目标Mooring非合作方目标NCT其他Other
private String rescue_target_type;
// 目标类别按字典管理分成四大类大型沉物锚系类目标非合作方目标其他具体目标名称手动录入
private String rescue_target_name;
// 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标经度
private String rescue_target_lon;
// 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标纬度
private String rescue_target_lat;
// 给定搜寻范围半径
private String rescue_target_radius;
// 宽度单位米
private String rescue_target_width;
// 长度单位米
private String rescue_target_length;
// 高度单位米
private String rescue_target_height;
// 搜寻处置目标重量空气中kg/
private String rescue_air_weight;
// 搜寻处置目标重量水中kg/
private String rescue_water_weight;
// 搜寻处置目标水深
private String rescue_water_depth;
// 搜寻处置目标预估价值
private String rescue_target_price;
// 快速响应等级
private String rescue_response_level;
// 是否涉密
private String rescue_secrecy;
// 搜捞目标的所属单位手动录入
private String rescue_unit;
// 快速响应时间要求,比如说最晚10天就要捞上来手动录入天数
private String rescue_response_day;
// 填报时间
private LocalDateTime fill_time;
// 联系人信息
private String fill_person;
// 填报电话
private String fill_tel;
// 备注
private String rescue_note;
// 填报说明
private String fill_note;
/****
* rescue
*/
public Integer getTsy_id() {
return this.tsy_id;
}
/****
* rescue
*/
public void setTsy_id(Integer tsy_id) {
this.tsy_id = tsy_id;
}
/****
* 关联航次
*/
public String getVoyage_name() {
return this.voyage_name;
}
/****
* 关联航次
*/
public void setVoyage_name(String voyage_name) {
this.voyage_name = voyage_name;
}
/****
* 状态信息
*/
public String getRescue_status() {
return this.rescue_status;
}
/****
* 状态信息
*/
public void setRescue_status(String rescue_status) {
this.rescue_status = rescue_status;
}
/****
* 状态变更时间
*/
public LocalDateTime getRescue_status_time() {
return this.rescue_status_time;
}
/****
* 状态变更时间
*/
public void setRescue_status_time(LocalDateTime rescue_status_time) {
this.rescue_status_time = rescue_status_time;
}
/****
* 状态变更说明
*/
public String getRescue_status_note() {
return this.rescue_status_note;
}
/****
* 状态变更说明
*/
public void setRescue_status_note(String rescue_status_note) {
this.rescue_status_note = rescue_status_note;
}
/****
* 应急搜捞SAR 专项调查SI
*/
public String getRescue_type() {
return this.rescue_type;
}
/****
* 应急搜捞SAR 专项调查SI
*/
public void setRescue_type(String rescue_type) {
this.rescue_type = rescue_type;
}
/****
* 任务类型_目标类别_总序列号
* :SAR_Wreck_075
*/
public String getRescue_code() {
return this.rescue_code;
}
/****
* 任务类型_目标类别_总序列号
* :SAR_Wreck_075
*/
public void setRescue_code(String rescue_code) {
this.rescue_code = rescue_code;
}
/****
* 如果未知可填写未知
* 大型沉物Wreck锚系类目标Mooring非合作方目标NCT其他Other
*/
public String getRescue_target_type() {
return this.rescue_target_type;
}
/****
* 如果未知可填写未知
* 大型沉物Wreck锚系类目标Mooring非合作方目标NCT其他Other
*/
public void setRescue_target_type(String rescue_target_type) {
this.rescue_target_type = rescue_target_type;
}
/****
* 目标类别按字典管理分成四大类大型沉物锚系类目标非合作方目标其他具体目标名称手动录入
*/
public String getRescue_target_name() {
return this.rescue_target_name;
}
/****
* 目标类别按字典管理分成四大类大型沉物锚系类目标非合作方目标其他具体目标名称手动录入
*/
public void setRescue_target_name(String rescue_target_name) {
this.rescue_target_name = rescue_target_name;
}
/****
* 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标
* 经度
*/
public String getRescue_target_lon() {
return this.rescue_target_lon;
}
/****
* 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标
* 经度
*/
public void setRescue_target_lon(String rescue_target_lon) {
this.rescue_target_lon = rescue_target_lon;
}
/****
* 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标
* 纬度
*/
public String getRescue_target_lat() {
return this.rescue_target_lat;
}
/****
* 给定点的经纬度位置若给定的是搜寻区域此处为中心点坐标
* 纬度
*/
public void setRescue_target_lat(String rescue_target_lat) {
this.rescue_target_lat = rescue_target_lat;
}
/****
* 给定搜寻范围半径
*/
public String getRescue_target_radius() {
return this.rescue_target_radius;
}
/****
* 给定搜寻范围半径
*/
public void setRescue_target_radius(String rescue_target_radius) {
this.rescue_target_radius = rescue_target_radius;
}
/****
* 宽度单位米
*/
public String getRescue_target_width() {
return this.rescue_target_width;
}
/****
* 宽度单位米
*/
public void setRescue_target_width(String rescue_target_width) {
this.rescue_target_width = rescue_target_width;
}
/****
* 长度单位米
*/
public String getRescue_target_length() {
return this.rescue_target_length;
}
/****
* 长度单位米
*/
public void setRescue_target_length(String rescue_target_length) {
this.rescue_target_length = rescue_target_length;
}
/****
* 高度单位米
*/
public String getRescue_target_height() {
return this.rescue_target_height;
}
/****
* 高度单位米
*/
public void setRescue_target_height(String rescue_target_height) {
this.rescue_target_height = rescue_target_height;
}
/****
* 搜寻处置目标重量空气中
* kg/
*/
public String getRescue_air_weight() {
return this.rescue_air_weight;
}
/****
* 搜寻处置目标重量空气中
* kg/
*/
public void setRescue_air_weight(String rescue_air_weight) {
this.rescue_air_weight = rescue_air_weight;
}
/****
* 搜寻处置目标重量水中
* kg/
*/
public String getRescue_water_weight() {
return this.rescue_water_weight;
}
/****
* 搜寻处置目标重量水中
* kg/
*/
public void setRescue_water_weight(String rescue_water_weight) {
this.rescue_water_weight = rescue_water_weight;
}
/****
* 搜寻处置目标水深
*
*/
public String getRescue_water_depth() {
return this.rescue_water_depth;
}
/****
* 搜寻处置目标水深
*
*/
public void setRescue_water_depth(String rescue_water_depth) {
this.rescue_water_depth = rescue_water_depth;
}
/****
* 搜寻处置目标预估价值
*/
public String getRescue_target_price() {
return this.rescue_target_price;
}
/****
* 搜寻处置目标预估价值
*/
public void setRescue_target_price(String rescue_target_price) {
this.rescue_target_price = rescue_target_price;
}
/****
* 快速响应等级
*/
public String getRescue_response_level() {
return this.rescue_response_level;
}
/****
* 快速响应等级
*/
public void setRescue_response_level(String rescue_response_level) {
this.rescue_response_level = rescue_response_level;
}
/****
* 是否涉密
*/
public String getRescue_secrecy() {
return this.rescue_secrecy;
}
/****
* 是否涉密
*/
public void setRescue_secrecy(String rescue_secrecy) {
this.rescue_secrecy = rescue_secrecy;
}
/****
* 搜捞目标的所属单位手动录入
*/
public String getRescue_unit() {
return this.rescue_unit;
}
/****
* 搜捞目标的所属单位手动录入
*/
public void setRescue_unit(String rescue_unit) {
this.rescue_unit = rescue_unit;
}
/****
* 快速响应时间要求
* ,比如说最晚10天就要捞上来手动录入天数
*/
public String getRescue_response_day() {
return this.rescue_response_day;
}
/****
* 快速响应时间要求
* ,比如说最晚10天就要捞上来手动录入天数
*/
public void setRescue_response_day(String rescue_response_day) {
this.rescue_response_day = rescue_response_day;
}
/****
* 填报时间
*/
public LocalDateTime getFill_time() {
return this.fill_time;
}
/****
* 填报时间
*/
public void setFill_time(LocalDateTime fill_time) {
this.fill_time = fill_time;
}
/****
* 联系人信息
*/
public String getFill_person() {
return this.fill_person;
}
/****
* 联系人信息
*/
public void setFill_person(String fill_person) {
this.fill_person = fill_person;
}
/****
* 填报电话
*/
public String getFill_tel() {
return this.fill_tel;
}
/****
* 填报电话
*/
public void setFill_tel(String fill_tel) {
this.fill_tel = fill_tel;
}
/****
* 备注
*/
public String getRescue_note() {
return this.rescue_note;
}
/****
* 备注
*/
public void setRescue_note(String rescue_note) {
this.rescue_note = rescue_note;
}
/****
* 填报说明
*/
public String getFill_note() {
return this.fill_note;
}
/****
* 填报说明
*/
public void setFill_note(String fill_note) {
this.fill_note = fill_note;
}
}

View File

@ -3,13 +3,18 @@ package cn.tsy.idsse.dsds.control;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import cn.hme.framework.core.AppParamerter;
import cn.hme.framework.helper.log.LogHelper;
import cn.tsy.idsse.dsds.control.thread.DSDSReportThread;
public class DSDSInitializeLisener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sc) {
LogHelper.info("["+AppParamerter.AppName+"]当前版本2025.08.30.001");
if (AppParamerter.AppName.equals("DSDS2024Server")) {
new Thread(new DSDSReportThread()).start();
}
}
@Override
public void contextDestroyed(ServletContextEvent sc) {

View File

@ -0,0 +1,57 @@
package cn.tsy.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hme.framework.helper.lang.StringHelper;
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.DictFundingMapper;
import cn.tsy.data.idsse.dsds.model.dict.DictFunding;
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.idsse.dsds.service.dict.DictFundingService;
@RestController
@RequestMapping("dict/funding")
public class DictFundingControl extends AjaxControl{
@Autowired
private DictFundingMapper mFunding;
@Autowired
private DictFundingService sFunding;
@RequestMapping("page.htm")
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = StringHelper.hasValue(order) ? order : "funding_order";
type = StringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mFunding.fundingWithPage(group, start, limit, query, order, type);
return new Ajax(page);
}
@RequestMapping("all.htm")
public Ajax all() {
return new Ajax(this.mFunding.allByOrder(OrderBuilder.create().addOrderBy("funding_order",DirectionEnum.DESC)));
}
@RequestMapping("edit.htm")
public Ajax edit(DictFunding funding) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.editFunding(funding);
return new Ajax(funding);
}
@RequestMapping("delete.htm")
public Ajax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.deleteFunding(tsy_id);
return new Ajax();
}
}

View File

@ -0,0 +1,119 @@
package cn.tsy.idsse.dsds.control.rescue;
import java.io.File;
import java.time.LocalDateTime;
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.date.LocalDateHelper;
import cn.hme.framework.helper.file.FileHelper;
import cn.hme.framework.helper.lang.GsonHelper;
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.helper.WebHelper;
import cn.tsy.data.idsse.dsds.mapper.rescue.RescueFileMapper;
import cn.tsy.data.idsse.dsds.mapper.rescue.RescueRegMapper;
import cn.tsy.data.idsse.dsds.model.rescue.RescueFile;
import cn.tsy.data.idsse.dsds.model.rescue.RescueReg;
import cn.tsy.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.idsse.dsds.service.rescue.RescueRegService;
@RestController
@RequestMapping("rescue/reg")
@CrossOrigin
public class RescueRegControl extends AjaxControl {
@Autowired
private RescueRegMapper mRescue;
@Autowired
private RescueFileMapper mFile;
@Autowired
private RescueRegService sRescue;
@CrossOrigin
@RequestMapping("page.htm")
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = StringHelper.hasValue(order) ? order : "tsy_id";
type = StringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mRescue.rescueWithPage(group, start, limit, query, order, type);
return new Ajax(page);
}
@CrossOrigin
@RequestMapping("edit.htm")
public Ajax edit(RescueReg rescue) {
this.sRescue.editRescue(rescue);
return new Ajax(rescue);
}
@CrossOrigin
@RequestMapping("find.htm")
public Ajax find(int rescue_id) {
return new Ajax(this.mRescue.find(rescue_id));
}
@CrossOrigin
@RequestMapping("file/upload.htm")
public Ajax upload(int rescue_id, MultipartFile file) {
new File(DSDSParamHelper.RescueFileRoot).mkdirs();
RescueReg reg = this.mRescue.find(rescue_id);
String file_name = reg.getRescue_code() +LocalDateHelper.formatNoSplit(LocalDateTime.now())+"."+FileHelper.getFileSuffix(file);
File f = new File(DSDSParamHelper.RescueFileRoot+File.separator+file_name);
FileHelper.fromUpload(file, f);
RescueFile rFile = new RescueFile();
rFile.setRescue_id(rescue_id);
rFile.setFile_length(f.length()+"");
rFile.setFile_org_name(file.getOriginalFilename());
rFile.setFile_path(f.getPath());
rFile.setFile_real_name(f.getName());
this.mFile.insert(rFile);
return new Ajax(rFile);
}
@CrossOrigin
@RequestMapping("file/view.htm")
public void view(int file_id) {
RescueFile f = this.mFile.find(file_id);
File file= new File(DSDSParamHelper.RescueFileRoot+File.separator+f.getFile_real_name());
if(file.exists())
WebHelper.viewImage(file, file.getName(), false);
}
@CrossOrigin
@RequestMapping("file/list.htm")
public Ajax list(int rescue_id) {
return new Ajax(this.mFile.selectListByColumn("rescue_id", rescue_id));
}
@CrossOrigin
@RequestMapping("file/download.htm")
public void download(int file_id) {
RescueFile f = this.mFile.find(file_id);
File file= new File(DSDSParamHelper.RescueFileRoot+File.separator+f.getFile_real_name());
if(file.exists())
WebHelper.downloadFile(file, file.getName());
}
@CrossOrigin
@RequestMapping("delete.htm")
public Ajax delete(int tsy_id) {
this.sRescue.deleteRescue(tsy_id);
return new Ajax();
}
@CrossOrigin
@RequestMapping("total")
public Ajax total(int tsy_id) {
this.sRescue.deleteRescue(tsy_id);
return new Ajax();
}
}

View File

@ -12,7 +12,6 @@ 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.service.sample.SampleLineTrackService;
@ -35,8 +34,8 @@ public class SampleLineTrackControl extends AjaxControl {
List<String> array = FileHelper.readFileAsArray(f);
f.delete();
List<SampleLineTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename());
if (list.size() == 0)
throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
// if (list.size() == 0)
// throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
return new Ajax(file.getOriginalFilename());
}

View File

@ -1,85 +0,0 @@
package cn.tsy.idsse.dsds.control.sar;
import java.io.File;
import java.time.LocalDateTime;
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.date.LocalDateHelper;
import cn.hme.framework.helper.file.FileHelper;
import cn.hme.framework.jdbc.provider.builder.DirectionEnum;
import cn.hme.framework.jdbc.provider.page.OrderBy;
import cn.hme.framework.web.control.Ajax;
import cn.hme.framework.web.helper.FrameAssertHelper;
import cn.hme.framework.web.helper.WebHelper;
import cn.tsy.data.idsse.dsds.mapper.sar.SarFileMapper;
import cn.tsy.data.idsse.dsds.mapper.sar.SarRegMapper;
import cn.tsy.data.idsse.dsds.model.sar.SarFile;
import cn.tsy.data.idsse.dsds.model.sar.SarReg;
import cn.tsy.idsse.dsds.control.DSDSControl;
import cn.tsy.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.idsse.dsds.service.sar.SarRegService;
@RestController
@RequestMapping("sar/file")
@CrossOrigin
public class SarFileControl extends DSDSControl {
@Autowired
private SarRegMapper mSar;
@Autowired
private SarFileMapper mFile;
@Autowired
private SarRegService sSar;
@RequestMapping("list.htm")
public Ajax list(int sar_id) {
return new Ajax(this.mFile.selectListByColumnAndSimpleOrder("sar_id", sar_id, OrderBy.of("upload_time", DirectionEnum.DESC)));
}
@RequestMapping("delete.htm")
public Ajax delete(int tsy_id) {
this.mFile.deleteByKey(tsy_id);
return new Ajax();
}
@RequestMapping("edit.htm")
public Ajax edit(int tsy_id,String file_remark) {
SarFile f =new SarFile();
f.setTsy_id(tsy_id);
f.setFile_remark(file_remark);
this.mFile.update(f);
return new Ajax();
}
@CrossOrigin
@RequestMapping("upload.htm")
public Ajax upload(int sar_id,String file_remark, MultipartFile file) {
SarReg sar = this.mSar.find(sar_id);
FrameAssertHelper.isNotNull(sar, "未找到指定的任务!");
String path = LocalDateHelper.replace(DSDSParamHelper.SarFileRoot + sar.getSar_name());
new File(path).mkdirs();
File f = new File(path + File.separator + sar.getSar_name() + "_" + LocalDateHelper.formatLongNoSplit(LocalDateTime.now()) + "_" + file.getOriginalFilename());
FileHelper.fromUpload(file, f);
this.sSar.updateFile(sar,file.getOriginalFilename(),file_remark, f, getFrameOptr());
return new Ajax();
}
@RequestMapping("download.htm")
public void download(int tsy_id) {
SarFile file = this.mFile.find(tsy_id);
File f = new File(file.getFile_path());
if(!f.exists()) {
WebHelper.writeAlert("文件已被清理,请联系管理人员!");
return ;
}
WebHelper.downloadFile(f, file.getFile_name());
}
}

View File

@ -1,64 +0,0 @@
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;
import cn.hme.framework.helper.lang.StringHelper;
import cn.hme.framework.jdbc.provider.page.Pageable;
import cn.hme.framework.web.control.Ajax;
import cn.tsy.data.idsse.dsds.mapper.sar.SarRegMapper;
import cn.tsy.data.idsse.dsds.model.sar.SarReg;
import cn.tsy.idsse.dsds.control.DSDSControl;
import cn.tsy.idsse.dsds.service.sar.SarRegService;
@RestController
@RequestMapping("sar/reg")
@CrossOrigin
public class SarRegControl extends DSDSControl{
@Autowired
private SarRegMapper mSar;
@Autowired
private SarRegService sSar;
@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";
type = StringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mSar.sarWithPage(group, start, limit, query, order, type);
return new Ajax(page);
}
@RequestMapping("edit.htm")
public Ajax edit(SarReg sar) {
this.sSar.editSar(sar, getFrameOptr());
return new Ajax(sar);
}
@RequestMapping("delete.htm")
public Ajax delete(int tsy_id) {
this.sSar.deleteSar(tsy_id);
return new Ajax();
}
@RequestMapping("start.htm")
public Ajax start(int tsy_id) {
this.sSar.startSar(tsy_id,this.getFrameOptr());
return new Ajax();
}
@RequestMapping("complete.htm")
public Ajax complete(int tsy_id) {
this.sSar.completeSar(tsy_id,this.getFrameOptr());
return new Ajax();
}
@RequestMapping("cancel.htm")
public Ajax cancel(int tsy_id) {
this.sSar.cancelSar(tsy_id,this.getFrameOptr());
return new Ajax();
}
}

View File

@ -36,6 +36,7 @@ public class VoyageRegControl extends AjaxControl {
@Autowired
private VoyageMemberMapper mMember;
@CrossOrigin
@RequestMapping("page.htm")
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = StringHelper.hasValue(order) ? order : "voyage_end_date";
@ -50,6 +51,12 @@ public class VoyageRegControl extends AjaxControl {
return new Ajax(voyage);
}
@CrossOrigin
@RequestMapping("list.htm")
public Ajax list() {
return new Ajax(this.mVoyage.all());
}
@RequestMapping("upload.htm")
public Ajax upload(MultipartFile file) {

View File

@ -6,7 +6,7 @@ public class DSDSParamHelper {
/****************
* 应急救援附件路径
*/
public static String SarFileRoot = "d:\\sar\\@{yyyy}}\\";
public static String RescueFileRoot = "/opt/rescue/";
/****************

View File

@ -0,0 +1,47 @@
package cn.tsy.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.web.exception.BusinessException;
import cn.hme.framework.web.helper.FrameAssertHelper;
import cn.tsy.data.idsse.dsds.mapper.dict.DictFundingMapper;
import cn.tsy.data.idsse.dsds.model.dict.DictFunding;
@Service
public class DictFundingService {
@Autowired
private DictFundingMapper mFunding;
/***********************
* 增加或者修改
*/
public void editFunding(DictFunding funding) {
FrameAssertHelper.isNotEmpty(funding.getFunding_name(), "资助机构名称不允许为空!");
// 判断类型是否存在
List<DictFunding> list = this.mFunding.selectListByColumn("funding_name", funding.getFunding_name());
if (funding.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - funding.getTsy_id() != 0)
throw new BusinessException("资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
this.mFunding.update(funding);
} else {
FrameAssertHelper.isEmpty(list, "资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
funding.setCreate_time(LocalDateTime.now());
this.mFunding.insert(funding);
}
}
/*****************************
* 删除
*/
public void deleteFunding(int funding_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mFunding.deleteByKey(funding_id);
}
}

View File

@ -0,0 +1,57 @@
package cn.tsy.idsse.dsds.service.rescue;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.helper.lang.StringHelper;
import cn.hme.framework.web.helper.FrameAssertHelper;
import cn.tsy.data.idsse.dsds.mapper.rescue.RescueFileMapper;
import cn.tsy.data.idsse.dsds.mapper.rescue.RescueRegMapper;
import cn.tsy.data.idsse.dsds.model.rescue.RescueReg;
import cn.tsy.data.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.idsse.dsds.model.voyage.VoyageNavigation;
@Service
public class RescueRegService {
@Autowired
private RescueRegMapper mReg;
@Autowired
private RescueFileMapper mFile;
public void editRescue(RescueReg rescue) {
// rescue_type
FrameAssertHelper.isNotEmpty(rescue.getRescue_type(), "应急搜捞类型不能为空!");
FrameAssertHelper.isNotEmpty(rescue.getRescue_target_type(), "目标类型不能为空!");
if (rescue.getTsy_id() == null) {
// 新增自动生成rescue_code
// 获取上一个序号
String sql = "select * from rescue_reg order by tsy_id desc limit 0,1";
List<RescueReg> regArray = this.mReg.selectListBySql(sql);
String rescue_code = rescue.getRescue_type() + "_" + rescue.getRescue_target_type() + "_";
if (regArray.size() == 0) {
rescue_code = rescue_code + "001";
} else {
int seq = Integer.parseInt(regArray.get(0).getRescue_code().split("_")[2])+1;
rescue_code = rescue_code + StringHelper.leftPadding(seq + "", 3, '0');
}
rescue.setRescue_code(rescue_code);
rescue.setFill_time(LocalDateTime.now());
rescue.setRescue_status_time(LocalDateTime.now());
this.mReg.insert(rescue);
} else {
this.mReg.update(rescue);
}
}
public void deleteRescue(int rescue_id) {
this.mFile.deleteByColumn("rescue_id", rescue_id);
this.mReg.deleteByKey(rescue_id);
}
}

View File

@ -46,30 +46,30 @@ public class SampleDatasetTrackService {
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = LocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
LocalDateTime curTime = LocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过

View File

@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import cn.hme.framework.helper.date.LocalDateHelper;
import cn.hme.framework.helper.lang.StringHelper;
import cn.hme.framework.helper.log.LogHelper;
import cn.hme.framework.jdbc.provider.builder.SqlBuilder;
import cn.hme.framework.jdbc.provider.builder.SqlCondition;
import cn.hme.framework.web.exception.BusinessException;
@ -16,9 +17,11 @@ import cn.hme.framework.web.helper.FrameAssertHelper;
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.SampleLineTrackMapper;
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
import cn.tsy.data.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.idsse.dsds.model.sample.SampleLine;
import cn.tsy.data.idsse.dsds.model.sample.SampleLineTrack;
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
@Service
public class SampleLineTrackService {
@ -27,22 +30,90 @@ public class SampleLineTrackService {
@Autowired
private SampleLineMapper mLine;
@Autowired
private VoyageRegMapper mVoyage;
@Autowired
private SampleDatasetMapper mDataset;
public List<SampleLineTrack> uploadTrack(int dataset_id, List<String> array, String file_name) {
FrameAssertHelper.hasValue(array, "测线轨迹文件为空,请检查!");
// SampleDataset ds = this.mDataset.find(dataset_id);
// FrameAssertHelper.isNotNull(ds, "未找到指定数据集,请检查!");
if (file_name.toLowerCase().endsWith("m.txt")) {
SampleDataset ds = this.mDataset.find(dataset_id);
if (ds == null) {
throw new BusinessException("未找到对应的数据集信息!");
}
VoyageReg voyage = this.mVoyage.find(ds.getVoyage_id());
String heigth = file_name.replace(".txt", "").replaceAll("m", "").split("_")[1];
// 判断是否已经输入了
this.mLine.deleteByColumn("dataset_id", dataset_id);
int index = 1;
SampleLine line = new SampleLine();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
break;
}
String[] values = StringHelper.splitWithSpace(array.get(i));
if (values[0].equals(">>")) {
this.createLine(voyage,ds, line, heigth, index);
line = new SampleLine();
LogHelper.info("dataset_index:"+index);
index++;
continue;
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
// this.mTrack.deleteByColumn("dataset_id", dataset_id);
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = LocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
if (line.getStart_lat() == null)
line.setStart_lat(lat);
if (line.getStart_lon() == null)
line.setStart_lon(lon);
if (line.getStart_time() == null)
line.setStart_time(curTime);
line.setEnd_lat(lat);
line.setEnd_lon(lon);
line.setEnd_time(curTime);
}
this.createLine(voyage,ds, line, heigth, index);
} else {
// 找出所有航线
String dv_sn = file_name.replace(".txt", "").replace("_Clean", "");
List<SampleDataset> sdArray = this.mDataset.selectListByColumn("diving_sn", dv_sn);
if (sdArray.size() == 0)
if (sdArray.size() == 0) {
throw new BusinessException("未找到潜次[" + dv_sn + "]对应的数据集!");
} else {
for (SampleDataset ds : sdArray) {
int index = 1;
List<SampleLineTrack> navArray = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
@ -93,21 +164,33 @@ public class SampleLineTrackService {
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
// 判断时间是否重复了
// 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) {
SampleLineTrack nav = new SampleLineTrack();
nav.setTrack_lat(lat);
nav.setTrack_lon(lon);
nav.setTrack_time(curTime);
navArray.add(nav);
// }
}
}
}
}
return new ArrayList<>();
}
public void createLine(VoyageReg voyage,SampleDataset ds, SampleLine line, String heigth, int index) {
line.setCreate_time(LocalDateTime.now());
line.setDataset_id(ds.getTsy_id());
line.setFunding_org(voyage.getFunding_org());
line.setDataset_name(ds.getDataset_name());
line.setLine_deep(heigth);
line.setPublish_rule("不公开");
line.setSample_status("原始数据");
line.setSample_seq(StringHelper.leftPadding(index + "", 2, '0'));
line.setLine_sn(line.getSample_seq());
line.setSample_name(ds.getDataset_name() + "_" + line.getSample_seq());
this.mLine.insert(line);
}
public void update(String file_name, SampleDataset ds, int index, List<SampleLineTrack> navArray) {
if (navArray.size() == 0)
return;

View File

@ -45,30 +45,30 @@ public class VoyageNavigationService {
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = LocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
LocalDateTime curTime = LocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过