Compare commits
2 Commits
27e24880b8
...
c9d8ab10f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9d8ab10f9 | ||
|
|
697e869621 |
|
|
@ -0,0 +1,12 @@
|
||||||
|
package org.jeecg.modules.base.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DoseFactor {
|
||||||
|
private String nuclideName;
|
||||||
|
private Double halfLife;
|
||||||
|
private Double cef;
|
||||||
|
private Double sef;
|
||||||
|
private Double rif;
|
||||||
|
}
|
||||||
|
|
@ -37,4 +37,6 @@ public class Engineering {
|
||||||
private Integer sceneType;
|
private Integer sceneType;
|
||||||
/**工程备注*/
|
/**工程备注*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
/**事故类型*/
|
||||||
|
private Integer eventType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package org.jeecg.modules.base.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故比例系数表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-11-14
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("stas_event_coefficient")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class EventCoefficient implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Integer id;
|
||||||
|
/**创建人*/
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
private String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
/**事故类型名称*/
|
||||||
|
@Excel(name = "事故类型名称", width = 15)
|
||||||
|
private String eventTypeName;
|
||||||
|
/**核素名称*/
|
||||||
|
@Excel(name = "核素名称", width = 15)
|
||||||
|
private String nuclideName;
|
||||||
|
/**核素系数*/
|
||||||
|
@Excel(name = "核素系数", width = 15)
|
||||||
|
private Double nuclideCoefficient;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.jeecg.modules.base.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故类型表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("stas_event_type")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class EventType implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Integer id;
|
||||||
|
/**创建人*/
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
/**事故名称*/
|
||||||
|
@Excel(name = "事故名称", width = 15)
|
||||||
|
private String eventName;
|
||||||
|
/**热功率(MW)*/
|
||||||
|
@Excel(name = "热功率(MW)", width = 15)
|
||||||
|
private Double power;
|
||||||
|
/**运行平衡时间(s)*/
|
||||||
|
@Excel(name = "运行平衡时间(s)", width = 15)
|
||||||
|
private Long runTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package org.jeecg.modules.base.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 核素种类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("stas_nuclide_type")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class NuclideType implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Integer id;
|
||||||
|
/**创建人*/
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
/**核素名称*/
|
||||||
|
@Excel(name = "核素名称", width = 15)
|
||||||
|
private String nuclideName;
|
||||||
|
/**半衰期*/
|
||||||
|
@Excel(name = "半衰期", width = 15)
|
||||||
|
private Double halfLife;
|
||||||
|
/**热谱*/
|
||||||
|
@Excel(name = "热谱", width = 15)
|
||||||
|
private Double heatSpectrum;
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,11 @@ package org.jeecg.modules.base.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.jeecg.modules.base.entity.DoseFactor;
|
||||||
import org.jeecg.modules.base.entity.Engineering;
|
import org.jeecg.modules.base.entity.Engineering;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: wrf
|
* @Description: wrf
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
|
|
@ -13,4 +16,6 @@ import org.jeecg.modules.base.entity.Engineering;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface EngineeringMapper extends BaseMapper<Engineering> {
|
public interface EngineeringMapper extends BaseMapper<Engineering> {
|
||||||
|
|
||||||
|
List<DoseFactor> getDoseFactor();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.base.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故比例系数表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-10-23
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface EventCoefficientMapper extends BaseMapper<EventCoefficient> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.base.mapper;
|
||||||
|
|
||||||
|
import org.jeecg.modules.base.entity.EventType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故类型表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface EventTypeMapper extends BaseMapper<EventType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.base.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.base.entity.NuclideType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 核素模块
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface NuclideTypeMapper extends BaseMapper<NuclideType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.base.mapper.EngineeringMapper">
|
||||||
|
|
||||||
|
<select id="getDoseFactor" resultType="org.jeecg.modules.base.entity.DoseFactor">
|
||||||
|
select * from stas_dose_factor
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -4,18 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.baseAPI.service.BaseAPIService;
|
import org.jeecg.baseAPI.service.BaseAPIService;
|
||||||
import org.jeecg.baseAPI.utils.DateTimeUtils;
|
|
||||||
import org.jeecg.common.constant.DiffusionPrefixConstants;
|
|
||||||
import org.jeecg.common.constant.EventConstants;
|
import org.jeecg.common.constant.EventConstants;
|
||||||
import org.jeecg.common.exception.JeecgBootException;
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.properties.EventServerProperties;
|
import org.jeecg.common.properties.EventServerProperties;
|
||||||
import org.jeecg.common.util.DateUtils;
|
|
||||||
import org.jeecg.common.util.NcUtil;
|
import org.jeecg.common.util.NcUtil;
|
||||||
import org.jeecg.diffusion.service.DiffusionDataService;
|
import org.jeecg.diffusion.service.DiffusionDataService;
|
||||||
import org.jeecg.diffusion.vo.DiffusionResultVO;
|
import org.jeecg.diffusion.vo.DiffusionResultVO;
|
||||||
import org.jeecg.modules.base.entity.Engineering;
|
import org.jeecg.modules.base.entity.Engineering;
|
||||||
import org.jeecg.modules.base.entity.Wrf;
|
import org.jeecg.modules.base.entity.Wrf;
|
||||||
import org.jeecg.modules.base.mapper.CmaqMapper;
|
|
||||||
import org.jeecg.modules.base.mapper.EngineeringMapper;
|
import org.jeecg.modules.base.mapper.EngineeringMapper;
|
||||||
import org.jeecg.modules.base.mapper.WrfMapper;
|
import org.jeecg.modules.base.mapper.WrfMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -23,10 +19,7 @@ import ucar.nc2.NetcdfFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package org.jeecg.engineering.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.modules.base.entity.DoseFactor;
|
||||||
import org.jeecg.modules.base.entity.Engineering;
|
import org.jeecg.modules.base.entity.Engineering;
|
||||||
import org.jeecg.runProcess.VO.RunProcessParamVO;
|
import org.jeecg.runProcess.VO.RunProcessParamVO;
|
||||||
|
|
||||||
|
|
@ -35,5 +36,8 @@ public interface EngineeringService extends IService<Engineering> {
|
||||||
*/
|
*/
|
||||||
void initDir(Engineering engineering);
|
void initDir(Engineering engineering);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取剂量转换因子
|
||||||
|
*/
|
||||||
|
List<DoseFactor> getDoseFactor();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import org.jeecg.runProcess.VO.RunProcessParamVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -74,5 +75,10 @@ public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engin
|
||||||
RemoteExecuteCommand.runRemoteLinuxCmd(ip, username, password, runCmd);
|
RemoteExecuteCommand.runRemoteLinuxCmd(ip, username, password, runCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DoseFactor> getDoseFactor(){
|
||||||
|
return this.baseMapper.getDoseFactor();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package org.jeecg.engineering.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DoseFactorVO {
|
||||||
|
private String nuclideName;
|
||||||
|
private Double halfLife;
|
||||||
|
private Double cef;
|
||||||
|
private Double sef;
|
||||||
|
private Double rif;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.eventCoefficient.VO;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EventCoefficientResultVO {
|
||||||
|
|
||||||
|
/** 核素名称集合 */
|
||||||
|
List<String> bizSourceItems;
|
||||||
|
/** 系数集合 */
|
||||||
|
List<Map<String,String>> resultMaps;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
package org.jeecg.eventCoefficient.controller;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.eventCoefficient.VO.EventCoefficientResultVO;
|
||||||
|
import org.jeecg.eventCoefficient.service.EventCoefficientService;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故比例系数表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-10-23
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/eventCoefficient")
|
||||||
|
@Slf4j
|
||||||
|
public class EventCoefficientController extends JeecgController<EventCoefficient, EventCoefficientService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EventCoefficientService eventCoefficientService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param eventCoefficient
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "事故比例系数表-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<EventCoefficient>> queryPageList(EventCoefficient eventCoefficient,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10000") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<EventCoefficient> queryWrapper = QueryGenerator.initQueryWrapper(eventCoefficient, req.getParameterMap());
|
||||||
|
Page<EventCoefficient> page = new Page<EventCoefficient>(pageNo, pageSize);
|
||||||
|
IPage<EventCoefficient> pageList = eventCoefficientService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param eventCoefficient
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故比例系数表-编辑")
|
||||||
|
@Operation(summary = "事故比例系数表-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody EventCoefficient eventCoefficient) {
|
||||||
|
eventCoefficientService.updateById(eventCoefficient);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故比例系数表-通过id删除")
|
||||||
|
@Operation(summary = "事故比例系数表-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
eventCoefficientService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故比例系数表-批量删除")
|
||||||
|
@Operation(summary = "事故比例系数表-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.eventCoefficientService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "事故比例系数表-通过id查询")
|
||||||
|
@Operation(summary = "事故比例系数表-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<EventCoefficient> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
EventCoefficient eventCoefficient = eventCoefficientService.getById(id);
|
||||||
|
if(eventCoefficient==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(eventCoefficient);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double calculateActivity(int power,int runTime,double halfLife,double heatSpectrum){
|
||||||
|
double activity;
|
||||||
|
if(halfLife < power){
|
||||||
|
activity = 310 * heatSpectrum * 100 * power * 1000000000000l;
|
||||||
|
}else{
|
||||||
|
activity = 210 * heatSpectrum * 100 * runTime * power * 1000000000000l / halfLife;
|
||||||
|
}
|
||||||
|
return activity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.eventCoefficient.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故比例系数表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-10-23
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface EventCoefficientService extends IService<EventCoefficient> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.eventCoefficient.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.base.mapper.EventCoefficientMapper;
|
||||||
|
import org.jeecg.eventCoefficient.service.EventCoefficientService;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故比例系数表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-10-23
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EventCoefficientServiceImpl extends ServiceImpl<EventCoefficientMapper, EventCoefficient> implements EventCoefficientService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
package org.jeecg.eventType.controller;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.eventType.vo.EventCoefficientVO;
|
||||||
|
import org.jeecg.eventType.vo.EventResultVO;
|
||||||
|
import org.jeecg.modules.base.entity.EventType;
|
||||||
|
import org.jeecg.eventType.service.EventTypeService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故类型表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/eventType")
|
||||||
|
@Slf4j
|
||||||
|
public class BizEventTypeController extends JeecgController<EventType, EventTypeService> {
|
||||||
|
@Autowired
|
||||||
|
private EventTypeService eventTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "事故类型表-分页列表查询")
|
||||||
|
@Operation(summary = "事故类型表-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<EventResultVO> queryPageList() {
|
||||||
|
return Result.OK(eventTypeService.queryCoefficients());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param eventType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故类型表-添加")
|
||||||
|
@Operation(summary = "事故类型表-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody EventType eventType) {
|
||||||
|
eventTypeService.addEventType(eventType);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param eventCoefficientVOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故类型表-编辑")
|
||||||
|
@Operation(summary = "事故类型表-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody List<EventCoefficientVO> eventCoefficientVOs) {
|
||||||
|
eventTypeService.editCoefficientType(eventCoefficientVOs);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "事故类型表-通过id删除")
|
||||||
|
@Operation(summary = "事故类型表-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) Integer id) {
|
||||||
|
eventTypeService.delEventType(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "事故类型表-通过id查询")
|
||||||
|
@Operation(summary = "事故类型表-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<EventType> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
EventType eventType = eventTypeService.getById(id);
|
||||||
|
if(eventType==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(eventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.jeecg.eventType.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.eventType.vo.EventCoefficientVO;
|
||||||
|
import org.jeecg.eventType.vo.EventResultVO;
|
||||||
|
import org.jeecg.modules.base.entity.EventType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故类型表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface EventTypeService extends IService<EventType> {
|
||||||
|
|
||||||
|
void addEventType(EventType eventType);
|
||||||
|
void delEventType(Integer id);
|
||||||
|
void editCoefficientType(List<EventCoefficientVO> eventCoefficientVOs);
|
||||||
|
EventResultVO queryCoefficients();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,226 @@
|
||||||
|
package org.jeecg.eventType.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
|
import org.jeecg.eventCoefficient.service.EventCoefficientService;
|
||||||
|
import org.jeecg.eventType.vo.EventCoefficientVO;
|
||||||
|
import org.jeecg.eventType.vo.EventResultVO;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
import org.jeecg.modules.base.entity.EventType;
|
||||||
|
import org.jeecg.modules.base.entity.NuclideType;
|
||||||
|
import org.jeecg.modules.base.mapper.EventCoefficientMapper;
|
||||||
|
import org.jeecg.modules.base.mapper.EventTypeMapper;
|
||||||
|
import org.jeecg.eventType.service.EventTypeService;
|
||||||
|
import org.jeecg.modules.base.mapper.NuclideTypeMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 事故类型表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EventTypeServiceImpl extends ServiceImpl<EventTypeMapper, EventType> implements EventTypeService {
|
||||||
|
|
||||||
|
public final EventCoefficientMapper eventCoefficientMapper;
|
||||||
|
public final NuclideTypeMapper nuclideTypeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void addEventType(EventType eventType) {
|
||||||
|
List<NuclideType> nuclideTypes = nuclideTypeMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<NuclideType>().orderByAsc(NuclideType::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(nuclideTypes)) {
|
||||||
|
throw new JeecgBootException("核素信息为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查事件名称是否已存在
|
||||||
|
Long eventCount = this.baseMapper.selectCount(
|
||||||
|
new LambdaQueryWrapper<EventType>().eq(EventType::getEventName, eventType.getEventName())
|
||||||
|
);
|
||||||
|
if (eventCount > 0) {
|
||||||
|
throw new JeecgBootException("事件名称已存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String eventName = eventType.getEventName();
|
||||||
|
List<EventCoefficient> values = new ArrayList<>();
|
||||||
|
for (NuclideType nuclideType : nuclideTypes) {
|
||||||
|
EventCoefficient eventCoefficient = new EventCoefficient();
|
||||||
|
eventCoefficient.setEventTypeName(eventName);
|
||||||
|
eventCoefficient.setNuclideName(nuclideType.getNuclideName());
|
||||||
|
eventCoefficient.setNuclideCoefficient(0d);
|
||||||
|
values.add(eventCoefficient);
|
||||||
|
}
|
||||||
|
eventCoefficientMapper.insert(values);
|
||||||
|
this.baseMapper.insert(eventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delEventType(Integer id){
|
||||||
|
EventType eventType = this.baseMapper.selectById(id);
|
||||||
|
this.baseMapper.deleteById(id);
|
||||||
|
eventCoefficientMapper.delete(new LambdaQueryWrapper<EventCoefficient>().eq(EventCoefficient::getEventTypeName,eventType.getEventName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void editCoefficientType(List<EventCoefficientVO> eventCoefficientVOs) {
|
||||||
|
if (CollectionUtils.isEmpty(eventCoefficientVOs)) {
|
||||||
|
throw new JeecgBootException("系数信息为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询核素信息(只查询所需字段)
|
||||||
|
List<NuclideType> nuclideTypes = nuclideTypeMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<NuclideType>()
|
||||||
|
.select(NuclideType::getNuclideName)
|
||||||
|
.orderByAsc(NuclideType::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(nuclideTypes)) {
|
||||||
|
throw new JeecgBootException("核素信息为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int nuclideCount = nuclideTypes.size();
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
this.baseMapper.delete(null);
|
||||||
|
eventCoefficientMapper.delete(null);
|
||||||
|
|
||||||
|
// 批量插入事件类型和系数
|
||||||
|
List<EventType> eventTypes = new ArrayList<>();
|
||||||
|
List<EventCoefficient> allEventCoefficients = new ArrayList<>();
|
||||||
|
|
||||||
|
for (EventCoefficientVO eventCoefficientVO : eventCoefficientVOs) {
|
||||||
|
String eventName = eventCoefficientVO.getEventName();
|
||||||
|
List<Double> coefficients = eventCoefficientVO.getCoefficients();
|
||||||
|
|
||||||
|
// 添加事件类型
|
||||||
|
EventType eventType = new EventType();
|
||||||
|
eventType.setEventName(eventName);
|
||||||
|
eventTypes.add(eventType);
|
||||||
|
|
||||||
|
// 构建系数列表,自动补全缺失的系数为0
|
||||||
|
for (int i = 0; i < nuclideCount; i++) {
|
||||||
|
EventCoefficient eventCoefficient = new EventCoefficient();
|
||||||
|
eventCoefficient.setEventTypeName(eventName);
|
||||||
|
eventCoefficient.setNuclideName(nuclideTypes.get(i).getNuclideName());
|
||||||
|
|
||||||
|
// 如果系数数量不足,后续核素的值设置为0
|
||||||
|
if (i < coefficients.size()) {
|
||||||
|
eventCoefficient.setNuclideCoefficient(coefficients.get(i));
|
||||||
|
} else {
|
||||||
|
eventCoefficient.setNuclideCoefficient(0.0);
|
||||||
|
}
|
||||||
|
allEventCoefficients.add(eventCoefficient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量插入
|
||||||
|
if (!eventTypes.isEmpty()) {
|
||||||
|
this.baseMapper.insert(eventTypes);
|
||||||
|
}
|
||||||
|
if (!allEventCoefficients.isEmpty()) {
|
||||||
|
eventCoefficientMapper.insert(allEventCoefficients);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EventResultVO queryCoefficients() {
|
||||||
|
EventResultVO resultVO = new EventResultVO();
|
||||||
|
|
||||||
|
// 1. 获取核素信息
|
||||||
|
List<NuclideType> nuclideTypes = nuclideTypeMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<NuclideType>().orderByAsc(NuclideType::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(nuclideTypes)) {
|
||||||
|
throw new JeecgBootException("核素信息为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取核素名称列表
|
||||||
|
List<String> nuclideNames = nuclideTypes.stream()
|
||||||
|
.map(NuclideType::getNuclideName)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
resultVO.setNuclideNames(nuclideNames);
|
||||||
|
|
||||||
|
// 2. 获取事件类型和系数数据
|
||||||
|
List<EventType> eventTypes = this.baseMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<EventType>().orderByAsc(EventType::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(eventTypes)) {
|
||||||
|
resultVO.setEventCoefficients(Collections.emptyList());
|
||||||
|
return resultVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<EventCoefficient> coefficients = eventCoefficientMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<EventCoefficient>().orderByAsc(EventCoefficient::getNuclideName)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 3. 按事件类型分组系数数据
|
||||||
|
Map<String, List<EventCoefficient>> groupedByEventType = coefficients.stream()
|
||||||
|
.collect(Collectors.groupingBy(EventCoefficient::getEventTypeName));
|
||||||
|
|
||||||
|
// 4. 构建事件系数VO列表
|
||||||
|
List<EventCoefficientVO> eventCoefficients = eventTypes.stream()
|
||||||
|
.map(eventType -> buildEventCoefficientVO(eventType, nuclideTypes, groupedByEventType))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
resultVO.setEventCoefficients(eventCoefficients);
|
||||||
|
return resultVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建事件系数VO对象
|
||||||
|
*/
|
||||||
|
private EventCoefficientVO buildEventCoefficientVO(EventType eventType,
|
||||||
|
List<NuclideType> nuclideTypes,
|
||||||
|
Map<String, List<EventCoefficient>> groupedByEventType) {
|
||||||
|
EventCoefficientVO vo = new EventCoefficientVO();
|
||||||
|
vo.setEventName(eventType.getEventName());
|
||||||
|
|
||||||
|
List<EventCoefficient> valueByEventType = groupedByEventType.get(eventType.getEventName());
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(valueByEventType)) {
|
||||||
|
// 如果该事件类型没有系数数据,则全部设为0
|
||||||
|
List<Double> zeroCoefficients = Collections.nCopies(nuclideTypes.size(), 0.0);
|
||||||
|
vo.setCoefficients(zeroCoefficients);
|
||||||
|
} else {
|
||||||
|
// 创建系数映射表提高查询效率
|
||||||
|
Map<String, Double> coefficientMap = valueByEventType.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
EventCoefficient::getNuclideName,
|
||||||
|
EventCoefficient::getNuclideCoefficient,
|
||||||
|
(v1, v2) -> v1
|
||||||
|
));
|
||||||
|
|
||||||
|
// 按照核素顺序构建系数列表
|
||||||
|
List<Double> coefficients = nuclideTypes.stream()
|
||||||
|
.map(nuclide -> coefficientMap.getOrDefault(nuclide.getNuclideName(), 0.0))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
vo.setCoefficients(coefficients);
|
||||||
|
}
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.jeecg.eventType.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.modules.base.entity.EventCoefficient;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EventCoefficientVO {
|
||||||
|
|
||||||
|
/** 事故名称 */
|
||||||
|
private String eventName;
|
||||||
|
/** 系数集合 */
|
||||||
|
private List<Double> coefficients;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.eventType.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EventResultVO {
|
||||||
|
|
||||||
|
/** 核素名称集合 */
|
||||||
|
private List<String> nuclideNames;
|
||||||
|
|
||||||
|
/** 系数集合 */
|
||||||
|
List<EventCoefficientVO> eventCoefficients;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package org.jeecg.nuclideType.controller;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.modules.base.entity.NuclideType;
|
||||||
|
import org.jeecg.nuclideType.service.NuclideTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 核素模块
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/nuclideType")
|
||||||
|
@Slf4j
|
||||||
|
public class NuclideController extends JeecgController<NuclideType, NuclideTypeService> {
|
||||||
|
@Autowired
|
||||||
|
private NuclideTypeService nuclideTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param nuclideType
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "核素模块-分页列表查询")
|
||||||
|
@Operation(summary = "核素模块-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<NuclideType>> queryPageList(NuclideType nuclideType,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10000") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<NuclideType> queryWrapper = QueryGenerator.initQueryWrapper(nuclideType, req.getParameterMap());
|
||||||
|
Page<NuclideType> page = new Page<NuclideType>(pageNo, pageSize);
|
||||||
|
IPage<NuclideType> pageList = nuclideTypeService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param nuclideType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "核素模块-添加")
|
||||||
|
@Operation(summary = "核素模块-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody NuclideType nuclideType) {
|
||||||
|
nuclideTypeService.save(nuclideType);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "核素模块-通过id删除")
|
||||||
|
@Operation(summary = "核素模块-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
nuclideTypeService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.nuclideType.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.base.entity.NuclideType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 核素模块
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface NuclideTypeService extends IService<NuclideType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.nuclideType.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.base.entity.NuclideType;
|
||||||
|
import org.jeecg.modules.base.mapper.NuclideTypeMapper;
|
||||||
|
import org.jeecg.nuclideType.service.NuclideTypeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 核素模块
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NuclideTypeServiceImpl extends ServiceImpl<NuclideTypeMapper, NuclideType> implements NuclideTypeService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ public class RunProcessParamVO {
|
||||||
private String enginId;
|
private String enginId;
|
||||||
private Integer weatherDataType;
|
private Integer weatherDataType;
|
||||||
private Integer sceneType;
|
private Integer sceneType;
|
||||||
|
private Integer eventType;
|
||||||
private String eventTime;
|
private String eventTime;
|
||||||
private Integer analogTime;
|
private Integer analogTime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,17 @@ import org.jeecg.cmaq.service.CmaqService;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.engineering.service.EngineeringService;
|
import org.jeecg.engineering.service.EngineeringService;
|
||||||
|
import org.jeecg.modules.base.entity.DoseFactor;
|
||||||
import org.jeecg.modules.base.entity.Engineering;
|
import org.jeecg.modules.base.entity.Engineering;
|
||||||
import org.jeecg.runProcess.VO.RunProcessParamVO;
|
import org.jeecg.runProcess.VO.RunProcessParamVO;
|
||||||
import org.jeecg.runProcess.service.RunProcessService;
|
import org.jeecg.runProcess.service.RunProcessService;
|
||||||
import org.jeecg.wrf.service.WrfService;
|
import org.jeecg.wrf.service.WrfService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,6 +57,7 @@ public class RunProcessController {
|
||||||
// return Result.error("程序正在运行中...");
|
// return Result.error("程序正在运行中...");
|
||||||
// }
|
// }
|
||||||
bizEngineering.setSceneType(sceneType);
|
bizEngineering.setSceneType(sceneType);
|
||||||
|
bizEngineering.setEventType(paramVO.getEventType());
|
||||||
bizEngineering.setEnginStatus(2);
|
bizEngineering.setEnginStatus(2);
|
||||||
engineeringService.updateById(bizEngineering);
|
engineeringService.updateById(bizEngineering);
|
||||||
|
|
||||||
|
|
@ -64,5 +70,41 @@ public class RunProcessController {
|
||||||
return Result.OK("运行成功!");
|
return Result.OK("运行成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行wrf所有程序
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/test")
|
||||||
|
public Result<?> test() {
|
||||||
|
List<DoseFactor> doseFactors = engineeringService.getDoseFactor();
|
||||||
|
try (BufferedWriter writer = new BufferedWriter(new FileWriter("D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\doseFactor.txt"))) {
|
||||||
|
for (DoseFactor factor : doseFactors) {
|
||||||
|
if (factor != null) { // 安全检查,避免 NullPointerException
|
||||||
|
// *** 关键修改点:使用 \t 分割,不控制格式 ***
|
||||||
|
writer.write(
|
||||||
|
valueOrEmpty(factor.getHalfLife()) + "\t" +
|
||||||
|
valueOrEmpty(factor.getCef()) + "\t" +
|
||||||
|
valueOrEmpty(factor.getSef()) + "\t" +
|
||||||
|
valueOrEmpty(factor.getRif())
|
||||||
|
);
|
||||||
|
writer.newLine(); // 写入换行符
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("文件DoseFactor已成功生成。");
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println("生成文件时出错: " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
System.err.println("处理数据时出现空指针异常: " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return Result.OK("运行成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String valueOrEmpty(Double value) {
|
||||||
|
return (value != null) ? value.toString() : " ";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,83 +10,83 @@ public class TestMain {
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// String[] cmd_dep = {
|
String[] cmd_dep = {
|
||||||
// "python",
|
"python",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\python\\sum_dry_wet_to_nc.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\sum_dry_wet_to_nc.py",
|
||||||
// "ASIJ",
|
"ASIJ",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\admin\\工程002",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
// "out_dep_20160701",
|
"out_dep_20160701",
|
||||||
// "20160701",
|
"20160701",
|
||||||
// "20160702"
|
"20160702"
|
||||||
// };
|
};
|
||||||
// ProcessBuilder depBuilder = new ProcessBuilder(cmd_dep);
|
ProcessBuilder depBuilder = new ProcessBuilder(cmd_dep);
|
||||||
// ExecutePyUtils.executePythonProcess(depBuilder, "dep");
|
ExecutePyUtils.executePythonProcess(depBuilder, "dep");
|
||||||
//
|
|
||||||
// String[] cmd_wrf = {
|
String[] cmd_wrf = {
|
||||||
// "python",
|
"python",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\python\\merge_results_to_nc.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\merge_results_to_nc.py",
|
||||||
// "XLAT,XLONG,HGT,U,V,W",
|
"XLAT,XLONG,HGT,U,V,W",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\admin\\工程002",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
// "out_wrf_20160701",
|
"out_wrf_20160701",
|
||||||
// "20160701",
|
"20160701",
|
||||||
// "20160702",
|
"20160702",
|
||||||
// "wrfout_d03_{YYYY-MM-DD}_00_00_00" // 使用占位符
|
"wrfout_d03_{YYYY-MM-DD}_00_00_00" // 使用占位符
|
||||||
// };
|
};
|
||||||
// ProcessBuilder wrfBuilder = new ProcessBuilder(cmd_wrf);
|
ProcessBuilder wrfBuilder = new ProcessBuilder(cmd_wrf);
|
||||||
// ExecutePyUtils.executePythonProcess(wrfBuilder, "wrf");
|
ExecutePyUtils.executePythonProcess(wrfBuilder, "wrf");
|
||||||
//
|
|
||||||
// String[] cmd_cmaq = {
|
String[] cmd_cmaq = {
|
||||||
// "python",
|
"python",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\python\\merge_results_to_nc.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\merge_results_to_nc.py",
|
||||||
// "CO,ASIJ",
|
"CO,ASIJ",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\admin\\工程002",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
// "out_conc_20160701",
|
"out_conc_20160701",
|
||||||
// "20160701",
|
"20160701",
|
||||||
// "20160702",
|
"20160702",
|
||||||
// "CCTM.CONC.d03.{YYYYMMDD}" // 使用占位符
|
"CCTM.CONC.d03.{YYYYMMDD}" // 使用占位符
|
||||||
// };
|
};
|
||||||
// ProcessBuilder concBuilder = new ProcessBuilder(cmd_cmaq);
|
ProcessBuilder concBuilder = new ProcessBuilder(cmd_cmaq);
|
||||||
// ExecutePyUtils.executePythonProcess(concBuilder, "conc");
|
ExecutePyUtils.executePythonProcess(concBuilder, "conc");
|
||||||
//
|
|
||||||
// String[] cmd_metcr03d = {
|
String[] cmd_metcr03d = {
|
||||||
// "python",
|
"python",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\python\\merge_results_to_nc.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\merge_results_to_nc.py",
|
||||||
// "TA,PRES",
|
"TA,PRES",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\admin\\工程002",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
// "out_metcr03d_20160701",
|
"out_metcr03d_20160701",
|
||||||
// "20160701",
|
"20160701",
|
||||||
// "20160702",
|
"20160702",
|
||||||
// "METCRO3D_d03_{YYYYMMDD}" // 使用占位符
|
"METCRO3D_d03_{YYYYMMDD}" // 使用占位符
|
||||||
// };
|
};
|
||||||
// ProcessBuilder metcr03dBuilder = new ProcessBuilder(cmd_metcr03d);
|
ProcessBuilder metcr03dBuilder = new ProcessBuilder(cmd_metcr03d);
|
||||||
// ExecutePyUtils.executePythonProcess(metcr03dBuilder, "metcr03d");
|
ExecutePyUtils.executePythonProcess(metcr03dBuilder, "metcr03d");
|
||||||
//
|
|
||||||
// String[] cmd_emis = {
|
String[] cmd_emis = {
|
||||||
// "python",
|
"python",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\python\\merge_results_to_nc.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\merge_results_to_nc.py",
|
||||||
// "CO,PSI",
|
"CO,PSI",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\admin\\工程002",
|
||||||
// "E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
// "out_emis_20160701",
|
"out_emis_20160701",
|
||||||
// "20160701",
|
"20160701",
|
||||||
// "20160702",
|
"20160702",
|
||||||
// "emis_{YYYYMMDD}" // 使用占位符
|
"emis_{YYYYMMDD}" // 使用占位符
|
||||||
// };
|
};
|
||||||
// ProcessBuilder emisBuilder = new ProcessBuilder(cmd_emis);
|
ProcessBuilder emisBuilder = new ProcessBuilder(cmd_emis);
|
||||||
// ExecutePyUtils.executePythonProcess(emisBuilder, "emis");
|
ExecutePyUtils.executePythonProcess(emisBuilder, "emis");
|
||||||
|
|
||||||
String[] cmd_dose = {
|
String[] cmd_dose = {
|
||||||
"python",
|
"python",
|
||||||
"E:\\runtimeEnv\\fileSystem\\event\\python\\convert_conc_to_dose.py",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\py\\convert_conc_to_dose.py",
|
||||||
"20160701",
|
"20160701",
|
||||||
"20160702",
|
"20160702",
|
||||||
"E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
"E:\\runtimeEnv\\fileSystem\\event\\admin\\002\\",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\工程002",
|
||||||
"E:\\runtimeEnv\\fileSystem\\event\\python\\data_48.xlsx",
|
"D:\\hky_word\\Projectlibrary\\resultFile\\dose\\data_48.xlsx",
|
||||||
"out_dep_20160701",
|
"out_dep_20160701",
|
||||||
"out_wrf_20160701",
|
"out_wrf_20160701",
|
||||||
"out_conc_20160701",
|
"out_conc_20160701",
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class RunProcessServiceImpl implements RunProcessService {
|
||||||
workDirPath + EventConstants.EMIS_DIR, resultFilePath,
|
workDirPath + EventConstants.EMIS_DIR, resultFilePath,
|
||||||
EventConstants.EMIS_OUT_PREFIX, EventConstants.EMIS_PATTERN, "合并EMIS结果数据");
|
EventConstants.EMIS_OUT_PREFIX, EventConstants.EMIS_PATTERN, "合并EMIS结果数据");
|
||||||
|
|
||||||
exeDosePy(sDate, eDate, resultFilePath, resultFilePath, scriptsPath,"合并EMIS结果数据");
|
exeDosePy(sDate, eDate, resultFilePath, resultFilePath, scriptsPath,"执行剂量转换");
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,6 @@ public class DownloadT1hJob {
|
||||||
* 获取基准时间
|
* 获取基准时间
|
||||||
*/
|
*/
|
||||||
private String getBaseTime() {
|
private String getBaseTime() {
|
||||||
return LocalDateTime.now().format(DATE_FORMATTER) + "00";
|
return LocalDateTime.now().minusDays(1).format(DATE_FORMATTER) + "00";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user