hky
This commit is contained in:
parent
0e9c9ea548
commit
b1a6e345ac
|
@ -0,0 +1,10 @@
|
|||
package org.jeecg.modules.constants;
|
||||
|
||||
public class EnginConstants {
|
||||
public static final int SCENE_NUCLEUS_NUMBER = 2; // 核爆程序数量
|
||||
public static final int SCENE_FACILITY_NUMBER = 2; // 核设施程序数量
|
||||
public static final int SCENE_CHEMISTRY_NUMBER = 2; // 化爆程序数量
|
||||
public static final int SCENE_LEAK_NUMBER = 2; // 泄露程序数量
|
||||
|
||||
|
||||
}
|
|
@ -141,7 +141,6 @@ public class BizCityAimController extends JeecgController<BizCityAim, IBizCityAi
|
|||
* @param request
|
||||
* @param bizCityAim
|
||||
*/
|
||||
@RequiresPermissions("bizCityAim:biz_city_aim:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizCityAim bizCityAim) {
|
||||
return super.exportXls(request, bizCityAim, BizCityAim.class, "城市目标表");
|
||||
|
@ -154,7 +153,6 @@ public class BizCityAimController extends JeecgController<BizCityAim, IBizCityAi
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizCityAim:biz_city_aim:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizCityAim.class);
|
||||
|
|
|
@ -3,12 +3,15 @@ package org.jeecg.modules.project.baseConfig.bizAim.bizFacilityAim.controller;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
|
@ -150,13 +153,45 @@ public class BizFacilityAimController extends JeecgController<BizFacilityAim, IB
|
|||
return Result.OK(bizFacilityAim);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有设施区域
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "设施目标表-查询所有设施区域")
|
||||
@ApiOperation(value="设施目标表-查询所有设施区域", notes="设施目标表-查询所有设施区域")
|
||||
@GetMapping(value = "/getFacilityAreas")
|
||||
public Result<Set<String>> getFacilityAreas() {
|
||||
List<BizFacilityAim> bizFacilityAims = bizFacilityAimService.list();
|
||||
if(bizFacilityAims == null || bizFacilityAims.isEmpty()) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
Set<String> facilityAreas = bizFacilityAims.stream().map(BizFacilityAim::getFacilityArea).collect(Collectors.toSet());
|
||||
return Result.OK(facilityAreas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据区域查询设施
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "设施目标表-根据区域查询设施")
|
||||
@ApiOperation(value="设施目标表-根据区域查询设施", notes="设施目标表-根据区域查询设施")
|
||||
@GetMapping(value = "/getFacilityAims")
|
||||
public Result<List<BizFacilityAim>> getFacilityAims(@RequestParam(name="facilityArea",required=true) String facilityArea ) {
|
||||
List<BizFacilityAim> bizFacilityAims = bizFacilityAimService.list(new LambdaQueryWrapper<BizFacilityAim>().eq(BizFacilityAim::getFacilityArea,facilityArea));
|
||||
if(bizFacilityAims == null || bizFacilityAims.isEmpty()) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(bizFacilityAims);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param bizFacilityAim
|
||||
*/
|
||||
@RequiresPermissions("bizFacilityAim:biz_facility_aim:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizFacilityAim bizFacilityAim) {
|
||||
return super.exportXls(request, bizFacilityAim, BizFacilityAim.class, "设施目标表");
|
||||
|
@ -169,7 +204,6 @@ public class BizFacilityAimController extends JeecgController<BizFacilityAim, IB
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizFacilityAim:biz_facility_aim:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizFacilityAim.class);
|
||||
|
|
|
@ -5,9 +5,11 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.RemoteExecuteCommand;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.entity.BizEngineering;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.service.IBizEngineeringService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizCmaq.entity.BizCmaq;
|
||||
|
@ -38,6 +40,14 @@ public class BizEngineeringController {
|
|||
|
||||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
@Value("${spring.Linux.ip}")
|
||||
private String ip;
|
||||
@Value("${spring.Linux.username}")
|
||||
private String username;
|
||||
@Value("${spring.Linux.password}")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 查询工程
|
||||
|
@ -63,9 +73,6 @@ public class BizEngineeringController {
|
|||
bizEngineeringService.save(bizEngineering);
|
||||
bizEngineerings.add(bizEngineering);
|
||||
}
|
||||
// for (BizEngineering bizEngineering : bizEngineerings) {
|
||||
// bizEngineering.setEngineeringPath(bizEngineering.getEngineeringPath() + "/" + bizEngineering.getEngineeringName());
|
||||
// }
|
||||
return Result.OK(bizEngineerings);
|
||||
}
|
||||
|
||||
|
@ -124,6 +131,24 @@ public class BizEngineeringController {
|
|||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "工程管理-通过id删除")
|
||||
@ApiOperation(value="工程管理-通过id删除", notes="工程管理-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
BizEngineering engineering = bizEngineeringService.getById(id);
|
||||
bizEngineeringService.deleteEngin(id);
|
||||
|
||||
String allRunPath = baseHome + engineering.getCreateBy() + "/" + engineering.getEngineeringName() + "/";
|
||||
RemoteExecuteCommand.runRemoteLinuxCmd(ip, username, password, "rm -rf " + allRunPath);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运行状态
|
||||
*
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.jeecg.modules.project.baseConfig.bizEngineering.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.entity.BizEngineering;
|
||||
|
||||
public interface IBizEngineeringService extends IService<BizEngineering> {
|
||||
BizEngineering getBizEngineeringByTime();
|
||||
void updateRunStatus(String engId,int status);
|
||||
void updateErrorStatus(String engId,int status);
|
||||
|
||||
void deleteEngin(String engId);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,31 @@ import org.jeecg.common.system.vo.LoginUser;
|
|||
import org.jeecg.modules.project.baseConfig.bizEngineering.entity.BizEngineering;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.mapper.BizEngineeringMapper;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.service.IBizEngineeringService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizCmaq.entity.BizCmaq;
|
||||
import org.jeecg.modules.project.calculateConfig.bizCmaq.mapper.BizCmaqMapper;
|
||||
import org.jeecg.modules.project.calculateConfig.bizCmaq.service.IBizCmaqService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigChemistry.entity.BizConfigChemistry;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigChemistry.service.IBizConfigChemistryService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigFacility.entity.BizConfigFacility;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigFacility.service.IBizConfigFacilityService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigLeak.entity.BizConfigLeak;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigLeak.service.IBizConfigLeakService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigNucleus.entity.BizConfigNucleus;
|
||||
import org.jeecg.modules.project.calculateConfig.bizConfigNucleus.service.IBizConfigNucleusService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizOpenfoam.entity.BizOpenfoam;
|
||||
import org.jeecg.modules.project.calculateConfig.bizOpenfoam.service.IBizOpenfoamService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.entity.BizWrf;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.mapper.BizWrfMapper;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.service.IBizWrfService;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDiffuse.entity.BizResultDiffuse;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDiffuse.service.IBizResultDiffuseService;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDosage.entity.BizResultDosage;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDosage.service.IBizResultDosageService;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultOptimize.entity.BizResultOptimize;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultOptimize.service.IBizResultOptimizeService;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultSourceItem.entity.BizResultSourceItem;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultSourceItem.service.IBizResultSourceItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
@ -21,6 +46,31 @@ public class BizEngineeringServiceImpl extends ServiceImpl<BizEngineeringMapper,
|
|||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BizWrfMapper bizWrfMapper;
|
||||
@Autowired
|
||||
private BizCmaqMapper bizCmaqMapper;
|
||||
@Autowired
|
||||
private IBizOpenfoamService bizOpenfoamService;
|
||||
|
||||
@Autowired
|
||||
private IBizConfigChemistryService bizConfigChemistryService;
|
||||
@Autowired
|
||||
private IBizConfigLeakService bizConfigLeakService;
|
||||
@Autowired
|
||||
private IBizConfigFacilityService bizConfigFacilityService;
|
||||
@Autowired
|
||||
private IBizConfigNucleusService bizConfigNucleusService;
|
||||
@Autowired
|
||||
private IBizResultDiffuseService bizResultDiffuseService;
|
||||
@Autowired
|
||||
private IBizResultDosageService bizResultDosageService;
|
||||
@Autowired
|
||||
private IBizResultOptimizeService bizResultOptimizeService;
|
||||
@Autowired
|
||||
private IBizResultSourceItemService bizResultSourceItemService;
|
||||
|
||||
@Override
|
||||
public BizEngineering getBizEngineeringByTime(){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
@ -56,4 +106,20 @@ public class BizEngineeringServiceImpl extends ServiceImpl<BizEngineeringMapper,
|
|||
bizEngineering.setRunStatus(status);
|
||||
this.baseMapper.updateById(bizEngineering);
|
||||
}
|
||||
@Override
|
||||
public void deleteEngin(String engId){
|
||||
this.baseMapper.deleteById(engId);
|
||||
bizWrfMapper.delete(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engId));
|
||||
bizCmaqMapper.delete(new LambdaQueryWrapper<BizCmaq>().eq(BizCmaq::getEngineeringId,engId));
|
||||
bizOpenfoamService.remove(new LambdaQueryWrapper<BizOpenfoam>().eq(BizOpenfoam::getEngineeringId,engId));
|
||||
|
||||
bizConfigChemistryService.remove(new LambdaQueryWrapper<BizConfigChemistry>().eq(BizConfigChemistry::getEngineeringId,engId));
|
||||
bizConfigLeakService.remove(new LambdaQueryWrapper<BizConfigLeak>().eq(BizConfigLeak::getEngineeringId,engId));
|
||||
bizConfigFacilityService.remove(new LambdaQueryWrapper<BizConfigFacility>().eq(BizConfigFacility::getEngineeringId,engId));
|
||||
bizConfigNucleusService.remove(new LambdaQueryWrapper<BizConfigNucleus>().eq(BizConfigNucleus::getEngineeringId,engId));
|
||||
bizResultDiffuseService.remove(new LambdaQueryWrapper<BizResultDiffuse>().eq(BizResultDiffuse::getEngineeringId,engId));
|
||||
bizResultDosageService.remove(new LambdaQueryWrapper<BizResultDosage>().eq(BizResultDosage::getEngineeringId,engId));
|
||||
bizResultOptimizeService.remove(new LambdaQueryWrapper<BizResultOptimize>().eq(BizResultOptimize::getEngineeringId,engId));
|
||||
bizResultSourceItemService.remove(new LambdaQueryWrapper<BizResultSourceItem>().eq(BizResultSourceItem::getEngineeringId,engId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizNuclideController extends JeecgController<BizNuclide, IBizNuclid
|
|||
* @param request
|
||||
* @param bizNuclide
|
||||
*/
|
||||
@RequiresPermissions("bizNuclide:biz_nuclide:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizNuclide bizNuclide) {
|
||||
return super.exportXls(request, bizNuclide, BizNuclide.class, "核素模块");
|
||||
|
@ -154,7 +153,6 @@ public class BizNuclideController extends JeecgController<BizNuclide, IBizNuclid
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizNuclide:biz_nuclide:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizNuclide.class);
|
||||
|
|
|
@ -172,7 +172,6 @@ public class BizRoleController extends JeecgController<BizRole, IBizRoleService>
|
|||
* @param request
|
||||
* @param bizRole
|
||||
*/
|
||||
@RequiresPermissions("bizRole:biz_role:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizRole bizRole) {
|
||||
return super.exportXls(request, bizRole, BizRole.class, "Gis和角色权限管理表");
|
||||
|
@ -185,7 +184,6 @@ public class BizRoleController extends JeecgController<BizRole, IBizRoleService>
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizRole:biz_role:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizRole.class);
|
||||
|
|
|
@ -156,7 +156,6 @@ public class BizSourceItemController extends JeecgController<BizSourceItem, IBiz
|
|||
* @param request
|
||||
* @param bizSourceItem
|
||||
*/
|
||||
@RequiresPermissions("bizSourceItem:biz_source_item:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizSourceItem bizSourceItem) {
|
||||
return super.exportXls(request, bizSourceItem, BizSourceItem.class, "源项参数");
|
||||
|
@ -169,7 +168,6 @@ public class BizSourceItemController extends JeecgController<BizSourceItem, IBiz
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizSourceItem:biz_source_item:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizSourceItem.class);
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizTopographyInfoController extends JeecgController<BizTopographyIn
|
|||
* @param request
|
||||
* @param bizTopographyInfo
|
||||
*/
|
||||
@RequiresPermissions("bizTopographyInfo:biz_topography_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizTopographyInfo bizTopographyInfo) {
|
||||
return super.exportXls(request, bizTopographyInfo, BizTopographyInfo.class, "地形信息管理表");
|
||||
|
@ -154,7 +153,6 @@ public class BizTopographyInfoController extends JeecgController<BizTopographyIn
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizTopographyInfo:biz_topography_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizTopographyInfo.class);
|
||||
|
|
|
@ -36,11 +36,6 @@ public class BizTopographyInfo implements Serializable {
|
|||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
@ -53,8 +48,14 @@ public class BizTopographyInfo implements Serializable {
|
|||
@Excel(name = "地形名称", width = 15)
|
||||
@ApiModelProperty(value = "地形名称")
|
||||
private String topographyName;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
@Excel(name = "上传时间", width = 15)
|
||||
private Date createTime;
|
||||
/**地形文件路径*/
|
||||
@Excel(name = "地形文件路径", width = 15)
|
||||
@Excel(name = "文件路径", width = 15)
|
||||
@ApiModelProperty(value = "地形文件路径")
|
||||
private String topographyPath;
|
||||
/**备注*/
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizWeaponController extends JeecgController<BizWeapon, IBizWeaponSe
|
|||
* @param request
|
||||
* @param bizWeapon
|
||||
*/
|
||||
@RequiresPermissions("bizWeapon:biz_weapon:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizWeapon bizWeapon) {
|
||||
return super.exportXls(request, bizWeapon, BizWeapon.class, "WQ类型数据管理表");
|
||||
|
@ -154,7 +153,6 @@ public class BizWeaponController extends JeecgController<BizWeapon, IBizWeaponSe
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizWeapon:biz_weapon:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizWeapon.class);
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizEquipmentMotorController extends JeecgController<BizEquipmentMot
|
|||
* @param request
|
||||
* @param bizEquipmentMotor
|
||||
*/
|
||||
@RequiresPermissions("bizEquipmentMotor:biz_equipment_motor:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizEquipmentMotor bizEquipmentMotor) {
|
||||
return super.exportXls(request, bizEquipmentMotor, BizEquipmentMotor.class, "机动装备表");
|
||||
|
@ -154,7 +153,6 @@ public class BizEquipmentMotorController extends JeecgController<BizEquipmentMot
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizEquipmentMotor:biz_equipment_motor:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizEquipmentMotor.class);
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizEquipmentProtectionController extends JeecgController<BizEquipme
|
|||
* @param request
|
||||
* @param bizEquipmentProtection
|
||||
*/
|
||||
@RequiresPermissions("bizEquipmentProtection:biz_equipment_protection:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizEquipmentProtection bizEquipmentProtection) {
|
||||
return super.exportXls(request, bizEquipmentProtection, BizEquipmentProtection.class, "防护装备表");
|
||||
|
@ -154,7 +153,6 @@ public class BizEquipmentProtectionController extends JeecgController<BizEquipme
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizEquipmentProtection:biz_equipment_protection:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizEquipmentProtection.class);
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizWeatherForecastController extends JeecgController<BizWeatherFore
|
|||
* @param request
|
||||
* @param bizWeatherForecast
|
||||
*/
|
||||
@RequiresPermissions("bizWeatherForecast:biz_weather_forecast:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizWeatherForecast bizWeatherForecast) {
|
||||
return super.exportXls(request, bizWeatherForecast, BizWeatherForecast.class, "气象预报表");
|
||||
|
@ -154,7 +153,6 @@ public class BizWeatherForecastController extends JeecgController<BizWeatherFore
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizWeatherForecast:biz_weather_forecast:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizWeatherForecast.class);
|
||||
|
|
|
@ -141,7 +141,6 @@ public class BizWeatherHistoryController extends JeecgController<BizWeatherHisto
|
|||
* @param request
|
||||
* @param bizWeatherHistory
|
||||
*/
|
||||
@RequiresPermissions("bizWeatherHistory:biz_weather_history:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizWeatherHistory bizWeatherHistory) {
|
||||
return super.exportXls(request, bizWeatherHistory, BizWeatherHistory.class, "历史气象表");
|
||||
|
@ -154,7 +153,6 @@ public class BizWeatherHistoryController extends JeecgController<BizWeatherHisto
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizWeatherHistory:biz_weather_history:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizWeatherHistory.class);
|
||||
|
|
|
@ -232,7 +232,6 @@ public class BizCmaqController extends JeecgController<BizCmaq, IBizCmaqService>
|
|||
* @param request
|
||||
* @param bizCmaq
|
||||
*/
|
||||
//@RequiresPermissions("bizCmaq:biz_cmaq:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizCmaq bizCmaq) {
|
||||
return super.exportXls(request, bizCmaq, BizCmaq.class, "CMAQ");
|
||||
|
@ -245,7 +244,6 @@ public class BizCmaqController extends JeecgController<BizCmaq, IBizCmaqService>
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
//@RequiresPermissions("bizCmaq:biz_cmaq:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizCmaq.class);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.project.calculateConfig.bizCmaq.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.project.calculateConfig.bizCmaq.entity.BizCmaq;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
|
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* @Date: 2022-12-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizCmaqMapper extends BaseMapper<BizCmaq> {
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.jeecg.modules.project.baseConfig.bizEngineering.entity.BizEngineering
|
|||
import org.jeecg.modules.project.baseConfig.bizEngineering.service.IBizEngineeringService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizOpenfoam.entity.BizOpenfoam;
|
||||
import org.jeecg.modules.project.calculateConfig.bizOpenfoam.service.IBizOpenfoamService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.service.IBizWrfService;
|
||||
import org.jeecg.modules.util.SFTPUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.entity.BizWrf;
|
||||
|
@ -55,8 +54,6 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
@Autowired
|
||||
private BizWrfMapper bizWrfMapper;
|
||||
@Autowired
|
||||
private IBizWrfService bizWrfService;
|
||||
@Autowired
|
||||
private IBizOpenfoamService bizOpenfoamService;
|
||||
@Autowired
|
||||
private IBizEngineeringService bizEngineeringService;
|
||||
|
@ -151,7 +148,9 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
String mcipFileName = genMcipsShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom(),cmaq.getColsN(),cmaq.getRowsN());
|
||||
// todo 执行mcip.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/mcip",mcipFileName);
|
||||
bizEngineeringService.updateRunStatus(engineeringId,6);
|
||||
} catch (Exception e) {
|
||||
bizEngineeringService.updateErrorStatus(engineeringId,6);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -169,7 +168,9 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
String iconFileName = genIconShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
// todo 执行icon.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/icon",iconFileName);
|
||||
bizEngineeringService.updateRunStatus(engineeringId,7);
|
||||
} catch (Exception e) {
|
||||
bizEngineeringService.updateErrorStatus(engineeringId,7);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -187,7 +188,9 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
String iconFileName = genBconShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
// todo 执行bcon.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/bcon",iconFileName);
|
||||
bizEngineeringService.updateRunStatus(engineeringId,8);
|
||||
} catch (Exception e) {
|
||||
bizEngineeringService.updateErrorStatus(engineeringId,8);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -254,13 +257,21 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
String cctmFileName = genCctmShell(allRunPath,targetFilePath + "CCTM/",newStartTime,newEndTime,cmaq.getSttime(), cmaq.getNsteps(), cmaq.getTstep());
|
||||
// todo 执行cctm.csh
|
||||
runCmd(allRunPath + "CMAQ/","CCTM",cctmFileName);
|
||||
String ncName = "CCTM_ACONC_v532_2016_12SE1_"+newStartTime.replace("-","")+".nc";
|
||||
String ncLocalName = "CCTM_ACONC_v532_2016_12SE1_"+DateUtil.format(new Date(startTimeSecs), ymdFormat).replace("-","")+".nc";
|
||||
bizEngineeringService.updateRunStatus(engineeringId,9);
|
||||
|
||||
//工程总运行小时数
|
||||
Integer sumHour = Integer.valueOf((endTime.getTime() - startTime.getTime()) / oneDaySecs * 24 + "");
|
||||
Integer sumDay = sumHour / 24 -1;
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
sftpUtil.download(allRunPath + "CMAQ/data/output/v532_2016_12SE1/",ncName,targetFilePath + ncLocalName);
|
||||
for (Integer i = 1; i <= sumDay; i++) {
|
||||
String ncName = "CCTM_ACONC_v532_2016_12SE1_"+DateUtil.format(new Date(startTimeSecs + oneDaySecs * i), ymdFormat).replace("-","")+".nc";
|
||||
// String ncLocalName = "CCTM_ACONC_v532_2016_12SE1_"+DateUtil.format(new Date(startTimeSecs), ymdFormat).replace("-","")+".nc";
|
||||
sftpUtil.download(allRunPath + "CMAQ/data/output/v532_2016_12SE1/",ncName,targetFilePath + ncName);
|
||||
}
|
||||
sftpUtil.logout();
|
||||
} catch (Exception e) {
|
||||
bizEngineeringService.updateErrorStatus(engineeringId,9);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -282,7 +293,7 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
// NetcdfFile ncfile = NetcdfDataset.open("C:\\Users\\13673\\Desktop\\某源\\Nuclear\\file\\CCTM_ACONC_v532_2016_12SE1_20160701.nc");
|
||||
String ncName = "CCTM_ACONC_v532_2016_12SE1_" + sdf.format(sdf.parse(bizCmaq.getStartDate())).replace("-", "") + ".nc";
|
||||
NetcdfFile ncfile = NetcdfDataset.open(targetFilePath + ncName);
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId, bizEngineering.getId()));
|
||||
BizWrf bizWrf = bizWrfMapper.selectOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId, bizEngineering.getId()));
|
||||
//正式环境需要修改
|
||||
// String ncNameWrf = "wrfout_d01_" + bizWrf.getStartTime();
|
||||
String ncNameWrf = "wrfout_d01_2016-07-01_00_00_00";
|
||||
|
@ -327,7 +338,7 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
List<String> variableNames = new ArrayList<>();
|
||||
BizEngineering bizEngineering = bizEngineeringService.getById(engineeringId);
|
||||
BizCmaq bizCmaq = this.baseMapper.selectOne(new LambdaQueryWrapper<BizCmaq>().eq(BizCmaq::getEngineeringId,bizEngineering.getId()));
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId, bizEngineering.getId()));
|
||||
BizWrf bizWrf = bizWrfMapper.selectOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId, bizEngineering.getId()));
|
||||
|
||||
String targetFilePath = localFilePrefix + bizCmaq.getCreateBy() + "/" + bizEngineering.getEngineeringName() + "/";
|
||||
|
||||
|
|
|
@ -156,7 +156,6 @@ public class BizConfigChemistryController extends JeecgController<BizConfigChemi
|
|||
* @param request
|
||||
* @param bizConfigChemistry
|
||||
*/
|
||||
@RequiresPermissions("bizConfigChemistry:biz_config_chemistry:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizConfigChemistry bizConfigChemistry) {
|
||||
return super.exportXls(request, bizConfigChemistry, BizConfigChemistry.class, "化爆配置表");
|
||||
|
@ -169,7 +168,6 @@ public class BizConfigChemistryController extends JeecgController<BizConfigChemi
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizConfigChemistry:biz_config_chemistry:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizConfigChemistry.class);
|
||||
|
|
|
@ -156,7 +156,6 @@ public class BizConfigFacilityController extends JeecgController<BizConfigFacili
|
|||
* @param request
|
||||
* @param bizConfigFacility
|
||||
*/
|
||||
@RequiresPermissions("bizConfigFacility:biz_config_facility:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizConfigFacility bizConfigFacility) {
|
||||
return super.exportXls(request, bizConfigFacility, BizConfigFacility.class, "核设施配置表");
|
||||
|
@ -169,7 +168,6 @@ public class BizConfigFacilityController extends JeecgController<BizConfigFacili
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizConfigFacility:biz_config_facility:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizConfigFacility.class);
|
||||
|
|
|
@ -156,7 +156,6 @@ public class BizConfigLeakController extends JeecgController<BizConfigLeak, IBiz
|
|||
* @param request
|
||||
* @param bizConfigLeak
|
||||
*/
|
||||
@RequiresPermissions("bizConfigLeak:biz_config_leak:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizConfigLeak bizConfigLeak) {
|
||||
return super.exportXls(request, bizConfigLeak, BizConfigLeak.class, "泄露配置表");
|
||||
|
@ -169,7 +168,6 @@ public class BizConfigLeakController extends JeecgController<BizConfigLeak, IBiz
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizConfigLeak:biz_config_leak:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizConfigLeak.class);
|
||||
|
|
|
@ -156,7 +156,6 @@ public class BizConfigNucleusController extends JeecgController<BizConfigNucleus
|
|||
* @param request
|
||||
* @param bizConfigNucleus
|
||||
*/
|
||||
@RequiresPermissions("bizConfigNucleus:biz_config_nucleus:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizConfigNucleus bizConfigNucleus) {
|
||||
return super.exportXls(request, bizConfigNucleus, BizConfigNucleus.class, "核爆配置表");
|
||||
|
@ -169,7 +168,6 @@ public class BizConfigNucleusController extends JeecgController<BizConfigNucleus
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizConfigNucleus:biz_config_nucleus:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizConfigNucleus.class);
|
||||
|
|
|
@ -362,13 +362,20 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
// String wrfLog = new String(readAllBytes(get(localFilePath + "wrf.log")));
|
||||
sftpUtil.download(allRunPath + "WRF/run","rsl.out.0000",localFilePath + "rsl.out.0000");
|
||||
String wrfLog = new String(readAllBytes(get(localFilePath + "rsl.out.0000")));
|
||||
if(wrfLog.indexOf("SUCCESS COMPLETE WRF") > 0){
|
||||
if(wrfLog.indexOf("SUCCESS COMPLETE WRF") >= 0){
|
||||
String format = "yyyy-MM-dd_HH:mm:ss";
|
||||
DateTime startTime = DateUtil.parse(bizWrf.getStartTime(), format);
|
||||
DateTime endTime = DateUtil.parse(bizWrf.getEndTime(), format);
|
||||
long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
//工程总运行小时数(WRF的时间)
|
||||
Integer sumHour = Integer.valueOf((endTime.getTime() - startTime.getTime()) / oneDaySecs * 24 + "");
|
||||
Integer sumDay = sumHour / 24 + 1;
|
||||
|
||||
for (Integer i = 1; i <= sumDay; i++) {
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs * i - oneDaySecs), format);
|
||||
String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
sftpUtil.download(allRunPath + "WRF/run/",ncNameWrf,localFilePath + ncNameWrf);
|
||||
}
|
||||
sftpUtil.logout();
|
||||
return Result.OK("SUCCESS COMPLETE WRF");
|
||||
}else{
|
||||
|
@ -694,7 +701,6 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
* @param request
|
||||
* @param bizWrf
|
||||
*/
|
||||
//@RequiresPermissions("bizWrf:biz_wrf:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizWrf bizWrf) {
|
||||
return super.exportXls(request, bizWrf, BizWrf.class, "wrf");
|
||||
|
@ -707,7 +713,6 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
//@RequiresPermissions("bizWrf:biz_wrf:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizWrf.class);
|
||||
|
@ -784,5 +789,9 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
// System.out.println(lonLatticeIndex+"-"+latLatticeIndex);
|
||||
// String wmhr = RemoteExecuteCommand.runRemoteLinuxCmd("192.168.115.128", "wmhr", "123456", "cd /home/wmhr/OpenFOAM-8/run/admin/工程001/;ls");
|
||||
// System.out.println(wmhr);
|
||||
|
||||
String wmhr = RemoteExecuteCommand.runRemoteLinuxCmd("192.168.115.128", "wmhr", "123456", "ps -ef | grep vmtoolsd");
|
||||
System.out.println(wmhr);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,10 @@ package org.jeecg.modules.project.calculateConfig.bizWrf.service;
|
|||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.entity.BizWrf;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import ucar.nc2.NetcdfFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: wrf
|
||||
|
@ -19,5 +21,6 @@ public interface IBizWrfService extends IService<BizWrf> {
|
|||
Result<String> runMetgrid(String allRunPath, String engineeringId)throws IOException;
|
||||
Result<String> runReal(String allRunPath, String engineeringId)throws IOException;
|
||||
Result<String> runWrf(String allRunPath, String engineeringId) throws IOException;
|
||||
List<List<List<Double>>> getNCByName(NetcdfFile ncfile, String name, int layer);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,9 +16,15 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import ucar.ma2.Array;
|
||||
import ucar.ma2.Index;
|
||||
import ucar.nc2.NetcdfFile;
|
||||
import ucar.nc2.Variable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static java.nio.file.Files.readAllBytes;
|
||||
import static java.nio.file.Paths.get;
|
||||
|
@ -172,5 +178,60 @@ public class BizWrfServiceImpl extends ServiceImpl<BizWrfMapper, BizWrf> impleme
|
|||
sftpUtil.logout();
|
||||
return Result.error(wrfLog);
|
||||
}
|
||||
@Override
|
||||
public List<List<List<Double>>> getNCByName(NetcdfFile ncfile, String name, int layer){
|
||||
Variable variable = ncfile.findVariable(name);
|
||||
List<List<List<Double>>> resultAll = new ArrayList<>();
|
||||
// 读取nc数据到数组
|
||||
Array data = null;
|
||||
try {
|
||||
data = variable.read();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 获取参数和索引,其中shape的前三个参数分别是时间、纬度、经度
|
||||
int[] shape = data.getShape();
|
||||
Index index = data.getIndex();
|
||||
|
||||
if(shape.length == 3){
|
||||
// 将三维数组降维,并用String数组提取数据
|
||||
// 按时间
|
||||
// 按维度
|
||||
for (int i = 0; i < shape[0]; i++) {
|
||||
List<List<Double>> resultPiece = new ArrayList<>();
|
||||
for (int j = 0; j < shape[1]; j++) {
|
||||
List<Double> strings = new ArrayList<>();
|
||||
// 按经度
|
||||
for (int k = 0; k < shape[2]; k++) {
|
||||
// 按照对应索引获取数据并转换为string类型添加到数组中
|
||||
Double dval = Math.round(data.getFloat(index.set(i, j, k)) * 1000) /1000d;
|
||||
strings.add(dval);
|
||||
}
|
||||
resultPiece.add(strings);
|
||||
}
|
||||
resultAll.add(resultPiece);
|
||||
}
|
||||
}else{
|
||||
// 将三维数组降维,并用String数组提取数据
|
||||
// 按时间
|
||||
// 按维度
|
||||
for (int i = 0; i < shape[0]; i++) {
|
||||
List<List<Double>> resultPiece = new ArrayList<>();
|
||||
for (int j = 0; j < shape[2]; j++) {
|
||||
List<Double> strings = new ArrayList<>();
|
||||
// 按经度
|
||||
for (int k = 0; k < shape[3]; k++) {
|
||||
// 按照对应索引获取数据并转换为string类型添加到数组中
|
||||
Double dval = Math.round(data.getFloat(index.set(i,layer, j, k)) * 1000) /1000d;
|
||||
strings.add(dval);
|
||||
}
|
||||
resultPiece.add(strings);
|
||||
}
|
||||
resultAll.add(resultPiece);
|
||||
}
|
||||
}
|
||||
return resultAll;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,309 +0,0 @@
|
|||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 查询区域-END -->
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('wrf')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<!-- 高级查询区域 -->
|
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
:scroll="{x:true}"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
class="j-table-force-nowrap"
|
||||
@change="handleTableChange">
|
||||
|
||||
<template slot="htmlSlot" slot-scope="text">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template slot="imgSlot" slot-scope="text,record">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||
</template>
|
||||
<template slot="fileSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button
|
||||
v-else
|
||||
:ghost="true"
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical" />
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<biz-wrf-modal ref="modalForm" @ok="modalFormOk"></biz-wrf-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import { mixinDevice } from '@/utils/mixin'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import BizWrfModal from './modules/BizWrfModal'
|
||||
|
||||
export default {
|
||||
name: 'BizWrfList',
|
||||
mixins:[JeecgListMixin, mixinDevice],
|
||||
components: {
|
||||
BizWrfModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: 'wrf管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:60,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title:'start_time',
|
||||
align:"center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title:'end_time',
|
||||
align:"center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title:'run_days',
|
||||
align:"center",
|
||||
dataIndex: 'runDays'
|
||||
},
|
||||
{
|
||||
title:'run_hours',
|
||||
align:"center",
|
||||
dataIndex: 'runHours'
|
||||
},
|
||||
{
|
||||
title:'run_minutes',
|
||||
align:"center",
|
||||
dataIndex: 'runMinutes'
|
||||
},
|
||||
{
|
||||
title:'run_seconds',
|
||||
align:"center",
|
||||
dataIndex: 'runSeconds'
|
||||
},
|
||||
{
|
||||
title:'interval_seconds',
|
||||
align:"center",
|
||||
dataIndex: 'intervalSeconds'
|
||||
},
|
||||
{
|
||||
title:'history_interval',
|
||||
align:"center",
|
||||
dataIndex: 'historyInterval'
|
||||
},
|
||||
{
|
||||
title:'frames_per_outfile',
|
||||
align:"center",
|
||||
dataIndex: 'framesPerOutfile'
|
||||
},
|
||||
{
|
||||
title:'time_step',
|
||||
align:"center",
|
||||
dataIndex: 'timeStep'
|
||||
},
|
||||
{
|
||||
title:'we',
|
||||
align:"center",
|
||||
dataIndex: 'we'
|
||||
},
|
||||
{
|
||||
title:'sn',
|
||||
align:"center",
|
||||
dataIndex: 'sn'
|
||||
},
|
||||
{
|
||||
title:'vert',
|
||||
align:"center",
|
||||
dataIndex: 'vert'
|
||||
},
|
||||
{
|
||||
title:'dx',
|
||||
align:"center",
|
||||
dataIndex: 'dx'
|
||||
},
|
||||
{
|
||||
title:'dy',
|
||||
align:"center",
|
||||
dataIndex: 'dy'
|
||||
},
|
||||
{
|
||||
title:'physics_suite',
|
||||
align:"center",
|
||||
dataIndex: 'physicsSuite'
|
||||
},
|
||||
{
|
||||
title:'start_data',
|
||||
align:"center",
|
||||
dataIndex: 'startData'
|
||||
},
|
||||
{
|
||||
title:'end_data',
|
||||
align:"center",
|
||||
dataIndex: 'endData'
|
||||
},
|
||||
{
|
||||
title:'map_proj',
|
||||
align:"center",
|
||||
dataIndex: 'mapProj'
|
||||
},
|
||||
{
|
||||
title:'ref_lat',
|
||||
align:"center",
|
||||
dataIndex: 'refLat'
|
||||
},
|
||||
{
|
||||
title:'ref_lon',
|
||||
align:"center",
|
||||
dataIndex: 'refLon'
|
||||
},
|
||||
{
|
||||
title:'truelat1',
|
||||
align:"center",
|
||||
dataIndex: 'truelat1'
|
||||
},
|
||||
{
|
||||
title:'truelat2',
|
||||
align:"center",
|
||||
dataIndex: 'truelat2'
|
||||
},
|
||||
{
|
||||
title:'stand_lon',
|
||||
align:"center",
|
||||
dataIndex: 'standLon'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
fixed:"right",
|
||||
width:147,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/bizWrf/bizWrf/list",
|
||||
delete: "/bizWrf/bizWrf/delete",
|
||||
deleteBatch: "/bizWrf/bizWrf/deleteBatch",
|
||||
exportXlsUrl: "/bizWrf/bizWrf/exportXls",
|
||||
importExcelUrl: "bizWrf/bizWrf/importExcel",
|
||||
|
||||
},
|
||||
dictOptions:{},
|
||||
superFieldList:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSuperFieldList();
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initDictConfig(){
|
||||
},
|
||||
getSuperFieldList(){
|
||||
let fieldList=[];
|
||||
fieldList.push({type:'string',value:'startTime',text:'start_time',dictCode:''})
|
||||
fieldList.push({type:'string',value:'endTime',text:'end_time',dictCode:''})
|
||||
fieldList.push({type:'string',value:'runDays',text:'run_days',dictCode:''})
|
||||
fieldList.push({type:'string',value:'runHours',text:'run_hours',dictCode:''})
|
||||
fieldList.push({type:'string',value:'runMinutes',text:'run_minutes',dictCode:''})
|
||||
fieldList.push({type:'string',value:'runSeconds',text:'run_seconds',dictCode:''})
|
||||
fieldList.push({type:'string',value:'intervalSeconds',text:'interval_seconds',dictCode:''})
|
||||
fieldList.push({type:'string',value:'historyInterval',text:'history_interval',dictCode:''})
|
||||
fieldList.push({type:'string',value:'framesPerOutfile',text:'frames_per_outfile',dictCode:''})
|
||||
fieldList.push({type:'string',value:'timeStep',text:'time_step',dictCode:''})
|
||||
fieldList.push({type:'string',value:'we',text:'we',dictCode:''})
|
||||
fieldList.push({type:'string',value:'sn',text:'sn',dictCode:''})
|
||||
fieldList.push({type:'string',value:'vert',text:'vert',dictCode:''})
|
||||
fieldList.push({type:'string',value:'dx',text:'dx',dictCode:''})
|
||||
fieldList.push({type:'string',value:'dy',text:'dy',dictCode:''})
|
||||
fieldList.push({type:'string',value:'physicsSuite',text:'physics_suite',dictCode:''})
|
||||
fieldList.push({type:'string',value:'startData',text:'start_data',dictCode:''})
|
||||
fieldList.push({type:'string',value:'endData',text:'end_data',dictCode:''})
|
||||
fieldList.push({type:'string',value:'mapProj',text:'map_proj',dictCode:''})
|
||||
fieldList.push({type:'string',value:'refLat',text:'ref_lat',dictCode:''})
|
||||
fieldList.push({type:'string',value:'refLon',text:'ref_lon',dictCode:''})
|
||||
fieldList.push({type:'string',value:'truelat1',text:'truelat1',dictCode:''})
|
||||
fieldList.push({type:'string',value:'truelat2',text:'truelat2',dictCode:''})
|
||||
fieldList.push({type:'string',value:'standLon',text:'stand_lon',dictCode:''})
|
||||
this.superFieldList = fieldList
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
|
@ -1,26 +0,0 @@
|
|||
-- 注意:该页面对应的前台目录为views/bizWrf文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2022121905425820350', NULL, 'wrf', '/bizWrf/bizWrfList', 'bizWrf/BizWrfList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820351', '2022121905425820350', '添加wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820352', '2022121905425820350', '编辑wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820353', '2022121905425820350', '删除wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820354', '2022121905425820350', '批量删除wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820355', '2022121905425820350', '导出excel_wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2022121905425820356', '2022121905425820350', '导入excel_wrf', NULL, NULL, 0, NULL, NULL, 2, 'bizWrf:biz_wrf:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-12-19 17:42:35', NULL, NULL, 0, 0, '1', 0);
|
|
@ -1,219 +0,0 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="start_time" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime">
|
||||
<a-input v-model="model.startTime" placeholder="请输入start_time" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="end_time" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endTime">
|
||||
<a-input v-model="model.endTime" placeholder="请输入end_time" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="run_days" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="runDays">
|
||||
<a-input v-model="model.runDays" placeholder="请输入run_days" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="run_hours" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="runHours">
|
||||
<a-input v-model="model.runHours" placeholder="请输入run_hours" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="run_minutes" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="runMinutes">
|
||||
<a-input v-model="model.runMinutes" placeholder="请输入run_minutes" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="run_seconds" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="runSeconds">
|
||||
<a-input v-model="model.runSeconds" placeholder="请输入run_seconds" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="interval_seconds" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="intervalSeconds">
|
||||
<a-input v-model="model.intervalSeconds" placeholder="请输入interval_seconds" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="history_interval" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="historyInterval">
|
||||
<a-input v-model="model.historyInterval" placeholder="请输入history_interval" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="frames_per_outfile" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="framesPerOutfile">
|
||||
<a-input v-model="model.framesPerOutfile" placeholder="请输入frames_per_outfile" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="time_step" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="timeStep">
|
||||
<a-input v-model="model.timeStep" placeholder="请输入time_step" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="we" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="we">
|
||||
<a-input v-model="model.we" placeholder="请输入we" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="sn" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sn">
|
||||
<a-input v-model="model.sn" placeholder="请输入sn" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="vert" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="vert">
|
||||
<a-input v-model="model.vert" placeholder="请输入vert" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="dx" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dx">
|
||||
<a-input v-model="model.dx" placeholder="请输入dx" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="dy" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dy">
|
||||
<a-input v-model="model.dy" placeholder="请输入dy" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="physics_suite" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="physicsSuite">
|
||||
<a-input v-model="model.physicsSuite" placeholder="请输入physics_suite" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="start_data" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startData">
|
||||
<a-input v-model="model.startData" placeholder="请输入start_data" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="end_data" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endData">
|
||||
<a-input v-model="model.endData" placeholder="请输入end_data" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="map_proj" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mapProj">
|
||||
<a-input v-model="model.mapProj" placeholder="请输入map_proj" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="ref_lat" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="refLat">
|
||||
<a-input v-model="model.refLat" placeholder="请输入ref_lat" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="ref_lon" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="refLon">
|
||||
<a-input v-model="model.refLon" placeholder="请输入ref_lon" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="truelat1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="truelat1">
|
||||
<a-input v-model="model.truelat1" placeholder="请输入truelat1" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="truelat2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="truelat2">
|
||||
<a-input v-model="model.truelat2" placeholder="请输入truelat2" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="stand_lon" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standLon">
|
||||
<a-input v-model="model.standLon" placeholder="请输入stand_lon" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</j-form-container>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction, getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
name: 'BizWrfForm',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
//表单禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
model:{
|
||||
},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules: {
|
||||
},
|
||||
url: {
|
||||
add: "/bizWrf/bizWrf/add",
|
||||
edit: "/bizWrf/bizWrf/edit",
|
||||
queryById: "/bizWrf/bizWrf/queryById"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formDisabled(){
|
||||
return this.disabled
|
||||
},
|
||||
},
|
||||
created () {
|
||||
//备份model原始值
|
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit(this.modelDefault);
|
||||
},
|
||||
edit (record) {
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
},
|
||||
submitForm () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
httpAction(httpurl,this.model,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,84 +0,0 @@
|
|||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
:width="width"
|
||||
placement="right"
|
||||
:closable="false"
|
||||
@close="close"
|
||||
destroyOnClose
|
||||
:visible="visible">
|
||||
<biz-wrf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></biz-wrf-form>
|
||||
<div class="drawer-footer">
|
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import BizWrfForm from './BizWrfForm'
|
||||
|
||||
export default {
|
||||
name: 'BizWrfModal',
|
||||
components: {
|
||||
BizWrfForm
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
width:800,
|
||||
visible: false,
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
},
|
||||
edit (record) {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.realForm.submitForm();
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** Button按钮间距 */
|
||||
.ant-btn {
|
||||
margin-left: 30px;
|
||||
margin-bottom: 30px;
|
||||
float: right;
|
||||
}
|
||||
.drawer-footer{
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
|
@ -1,60 +0,0 @@
|
|||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<biz-wrf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></biz-wrf-form>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import BizWrfForm from './BizWrfForm'
|
||||
export default {
|
||||
name: 'BizWrfModal',
|
||||
components: {
|
||||
BizWrfForm
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:'',
|
||||
width:800,
|
||||
visible: false,
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
},
|
||||
edit (record) {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.realForm.submitForm();
|
||||
},
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -176,7 +176,6 @@ public class BizResultDiffuseController extends JeecgController<BizResultDiffuse
|
|||
* @param request
|
||||
* @param bizResultDiffuse
|
||||
*/
|
||||
@RequiresPermissions("bizResultDiffuse:biz_result_diffuse:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizResultDiffuse bizResultDiffuse) {
|
||||
return super.exportXls(request, bizResultDiffuse, BizResultDiffuse.class, "扩散计算结果配置表");
|
||||
|
@ -189,7 +188,6 @@ public class BizResultDiffuseController extends JeecgController<BizResultDiffuse
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizResultDiffuse:biz_result_diffuse:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizResultDiffuse.class);
|
||||
|
|
|
@ -176,7 +176,6 @@ public class BizResultDosageController extends JeecgController<BizResultDosage,
|
|||
* @param request
|
||||
* @param bizResultDosage
|
||||
*/
|
||||
@RequiresPermissions("bizResultDosage:biz_result_dosage:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizResultDosage bizResultDosage) {
|
||||
return super.exportXls(request, bizResultDosage, BizResultDosage.class, "剂量计算结果配置表");
|
||||
|
@ -189,7 +188,6 @@ public class BizResultDosageController extends JeecgController<BizResultDosage,
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizResultDosage:biz_result_dosage:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizResultDosage.class);
|
||||
|
|
|
@ -176,7 +176,6 @@ public class BizResultOptimizeController extends JeecgController<BizResultOptimi
|
|||
* @param request
|
||||
* @param bizResultOptimize
|
||||
*/
|
||||
@RequiresPermissions("bizResultOptimize:biz_result_optimize:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizResultOptimize bizResultOptimize) {
|
||||
return super.exportXls(request, bizResultOptimize, BizResultOptimize.class, "路径优化计算结果配置表");
|
||||
|
@ -189,7 +188,6 @@ public class BizResultOptimizeController extends JeecgController<BizResultOptimi
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizResultOptimize:biz_result_optimize:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizResultOptimize.class);
|
||||
|
|
|
@ -176,7 +176,6 @@ public class BizResultSourceItemController extends JeecgController<BizResultSour
|
|||
* @param request
|
||||
* @param bizResultSourceItem
|
||||
*/
|
||||
@RequiresPermissions("bizResultSourceItem:biz_result_sourceitem:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizResultSourceItem bizResultSourceItem) {
|
||||
return super.exportXls(request, bizResultSourceItem, BizResultSourceItem.class, "源项计算结果配置表");
|
||||
|
@ -189,7 +188,6 @@ public class BizResultSourceItemController extends JeecgController<BizResultSour
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("bizResultSourceItem:biz_result_sourceitem:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizResultSourceItem.class);
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.project.calculateResult.runProcess.VO;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProgressVO {
|
||||
|
||||
private Integer runStatus;
|
||||
private List<Integer> progressList;
|
||||
private Integer nowProgress;
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package org.jeecg.modules.project.calculateResult.runProcess.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
@ -12,20 +14,38 @@ import org.jeecg.common.api.vo.Result;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.constants.EnginConstants;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.entity.BizEngineering;
|
||||
import org.jeecg.modules.project.baseConfig.bizEngineering.service.IBizEngineeringService;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.entity.BizWrf;
|
||||
import org.jeecg.modules.project.calculateConfig.bizWrf.service.IBizWrfService;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDiffuse.entity.BizResultDiffuse;
|
||||
import org.jeecg.modules.project.calculateResult.bizResultDiffuse.service.IBizResultDiffuseService;
|
||||
import org.jeecg.modules.project.calculateResult.runProcess.VO.ProgressVO;
|
||||
import org.jeecg.modules.util.SFTPUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import ucar.nc2.NetcdfFile;
|
||||
import ucar.nc2.dataset.NetcdfDataset;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.nio.file.Files.readAllBytes;
|
||||
import static java.nio.file.Paths.get;
|
||||
|
||||
/**
|
||||
* @Description: 运行过程
|
||||
|
@ -47,6 +67,17 @@ public class RunProcessController extends JeecgController<BizResultDiffuse, IBiz
|
|||
|
||||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
|
||||
@Value("${spring.Linux.ip}")
|
||||
private String ip;
|
||||
@Value("${spring.Linux.username}")
|
||||
private String username;
|
||||
@Value("${spring.Linux.password}")
|
||||
private String password;
|
||||
@Value("${spring.Linux.port}")
|
||||
private Integer port;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -68,4 +99,209 @@ public class RunProcessController extends JeecgController<BizResultDiffuse, IBiz
|
|||
bizWrfService.runWrf(allRunPath,engineeringId);
|
||||
return Result.OK("运行成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工程运行进度
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "运行过程-运行进度")
|
||||
@ApiOperation(value="运行过程-运行进度", notes="运行过程-运行进度")
|
||||
@GetMapping(value = "/runProgress")
|
||||
public Result<ProgressVO> runProgress(String engineeringId) throws IOException {
|
||||
BizEngineering engineering = bizEngineeringService.getById(engineeringId);
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineering.getId()));
|
||||
if(null == engineering){
|
||||
return Result.error("未查询到工程信息!",null);
|
||||
}
|
||||
|
||||
String format = "yyyy-MM-dd_hh:mm:ss";
|
||||
DateTime startTime = DateUtil.parse(bizWrf.getStartTime(), format);
|
||||
DateTime endTime = DateUtil.parse(bizWrf.getEndTime(), format);
|
||||
long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
//工程总运行小时数(WRF的时间)
|
||||
Integer sumHour = Integer.valueOf((endTime.getTime() - startTime.getTime()) / oneDaySecs * 24 + "");
|
||||
Integer sumDay = sumHour / 24 + 1;
|
||||
|
||||
String localFilePath = localFilePrefix + "/" + engineering.getCreateBy() + "/" + engineering.getEngineeringName() + "/";
|
||||
|
||||
//工程总共有几个进度
|
||||
Integer runNumber = EnginConstants.SCENE_FACILITY_NUMBER + 5;
|
||||
ProgressVO progressVO = new ProgressVO();
|
||||
//工程进度条填充初始值
|
||||
List<Integer> progressList = Stream.generate(() -> 0).limit(runNumber).collect(Collectors.toList());
|
||||
//工程当前进度条填充初始值
|
||||
Integer percent = 0;
|
||||
int nowDay = 0;
|
||||
//如果工程已经运行完成,所有进度条改为百分百进度并返回
|
||||
if(engineering.getRunStatus() == 99){
|
||||
return getProgressVOResult(runNumber, progressVO, progressList);
|
||||
}else if(engineering.getRunStatus() == 5){
|
||||
String ncNameWrf = "";
|
||||
for (int i = sumDay; i > 0; i--) {
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs * i - oneDaySecs), format);
|
||||
ncNameWrf = localFilePath + "wrfout_d01_" + newStartTime;
|
||||
|
||||
File cmaqFile = new File(ncNameWrf);
|
||||
if(cmaqFile.exists()){
|
||||
nowDay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
NetcdfFile ncfile = NetcdfDataset.open(localFilePath + ncNameWrf);
|
||||
List<List<List<Double>>> xlatAllList = bizWrfService.getNCByName(ncfile, "XLAT",0);
|
||||
percent = nowDay * 24 - 24 + xlatAllList.size() * 100 / sumHour;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
progressList.set(i,100);
|
||||
}
|
||||
progressList.set(4,percent);
|
||||
}else if(engineering.getRunStatus() == 9){
|
||||
int cmaqSumDay = sumHour / 24;
|
||||
String ncNameCmaq = "";
|
||||
for (int i = cmaqSumDay; i > 0; i--) {
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs * i - oneDaySecs), format);
|
||||
ncNameCmaq = localFilePath + "CCTM_ACONC_v532_2016_12SE1_" + newStartTime.replace("-","")+".nc";
|
||||
|
||||
File cmaqFile = new File(ncNameCmaq);
|
||||
if(cmaqFile.exists()){
|
||||
nowDay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
NetcdfFile ncfile = NetcdfDataset.open(localFilePath + ncNameCmaq);
|
||||
List<List<List<Double>>> xlatAllList = bizWrfService.getNCByName(ncfile, "CO",0);
|
||||
percent = nowDay * 24 - 24 + xlatAllList.size() * 100 / (sumHour -24);
|
||||
for (int i = 0; i < 9; i++) {
|
||||
progressList.set(i,100);
|
||||
}
|
||||
progressList.set(9,percent);
|
||||
}else{
|
||||
for (int i = 0; i < engineering.getRunStatus() - 1; i++) {
|
||||
progressList.set(i,100);
|
||||
}
|
||||
}
|
||||
progressVO.setProgressList(progressList);
|
||||
progressVO.setRunStatus(engineering.getRunStatus());
|
||||
progressVO.setNowProgress(percent);
|
||||
|
||||
return Result.OK(progressVO);
|
||||
}
|
||||
|
||||
/*private ProgressVO cmaqProgressVOResult(BizEngineering engineering, DateTime startTime, long oneDaySecs, Integer sumHour,List<Integer> progressList){
|
||||
//判断CMAQ运行进度
|
||||
String allRunPath = baseHome + engineering.getCreateBy() + "/" + engineering.getEngineeringName() + "/";
|
||||
String fileName = "CTM_LOG_000.v532_2016_12SE1_";
|
||||
String nowTimeYMD = "";
|
||||
Integer nowDay = 1;
|
||||
for (int i = 1; i <= sumDay - 1; i++) {
|
||||
nowTimeYMD = DateUtil.format(new Date(endTime.getTime() - i * oneDaySecs), "yyyyMMdd");
|
||||
File cmaqFile = new File(String.format("%sCMAQ/data/output/v532_2016_12SE1/LOGS/%s%s",allRunPath,fileName,nowTimeYMD));
|
||||
if(cmaqFile.exists()){
|
||||
nowDay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<String> cmaqValues = getRunLog(engineering,"CMAQ/data/output/v532_2016_12SE1/LOGS",fileName + nowTimeYMD);
|
||||
for (int i = cmaqValues.size() - 1; i >= cmaqValues.size() - 50; i--) {
|
||||
if(cmaqValues.get(i).indexOf("PROGRAM COMPLETED SUCCESSFULLY") >= 0 && nowDay == sumDay - 1){
|
||||
return getProgressVOResult(runNumber, progressVO, progressList);
|
||||
}else{
|
||||
for (int j = 0; j < runNumber - 1; j++) {
|
||||
progressList.set(j,100);
|
||||
}
|
||||
progressList.set(runNumber - 1,99);
|
||||
progressVO.setProgressList(progressList);
|
||||
progressVO.setRunStatus(runNumber - 1);
|
||||
progressVO.setNowProgress(99);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private ProgressVO wrfProgressVOResult(BizEngineering engineering, DateTime startTime, long oneDaySecs, Integer sumHour,List<Integer> progressList){
|
||||
ProgressVO progressVO = new ProgressVO();
|
||||
String formatYMDH = "yyyy-MM-dd_hh";
|
||||
List<String> wrfValues = getRunLog(engineering,"WRF/run/","rsl.out.0000");
|
||||
//如果WRF已经运行完成,WRF所有进度条改为百分百
|
||||
if(wrfValues.indexOf("wrf: SUCCESS COMPLETE WRF") >= 0){
|
||||
for (int i = 0; i < 5; i++) {
|
||||
progressList.set(i,100);
|
||||
}
|
||||
progressVO.setProgressList(progressList);
|
||||
progressVO.setRunStatus(engineering.getRunStatus());
|
||||
progressVO.setNowProgress(100);
|
||||
}else{
|
||||
if(wrfValues != null){
|
||||
String endValues = wrfValues.get(wrfValues.size()-1);
|
||||
String nowTimeString = null;
|
||||
//判断WRF日志文件最后一行是否包含关键信息
|
||||
if(endValues.indexOf("Timing for main: time ") >= 0){
|
||||
nowTimeString = endValues.substring(22,22 + 19);
|
||||
}else{
|
||||
//判断WRF日志文件倒数第二行是否包含关键信息
|
||||
endValues = wrfValues.get(wrfValues.size()-2);
|
||||
if(endValues.indexOf("Timing for main: time ") >= 0){
|
||||
nowTimeString = endValues.substring(22,22 + 19);
|
||||
}
|
||||
}
|
||||
//根据获取到的日期信息,换算当前进度百分比
|
||||
DateTime nowTime = DateUtil.parse(nowTimeString, formatYMDH);
|
||||
long nowHour = Integer.valueOf(nowTime.getTime() - startTime.getTime() + "") / oneDaySecs * 24;
|
||||
Integer percent = Integer.valueOf(nowHour * 100 / sumHour + "");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
progressList.set(i,100);
|
||||
}
|
||||
progressList.set(4,percent);
|
||||
progressVO.setProgressList(progressList);
|
||||
progressVO.setRunStatus(engineering.getRunStatus());
|
||||
progressVO.setNowProgress(percent);
|
||||
}
|
||||
}
|
||||
return progressVO;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Result<ProgressVO> getProgressVOResult(Integer runNumber, ProgressVO progressVO, List<Integer> progressList) {
|
||||
for (int j = 0; j < runNumber - 1; j++) {
|
||||
progressList.set(j,100);
|
||||
}
|
||||
progressVO.setProgressList(progressList);
|
||||
progressVO.setRunStatus(runNumber);
|
||||
progressVO.setNowProgress(100);
|
||||
return Result.OK(progressVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运行日志
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "运行过程-获取运行日志")
|
||||
// @ApiOperation(value="运行过程-获取运行日志", notes="运行过程-获取运行日志")
|
||||
// @GetMapping(value = "/getRunLog")
|
||||
public List<String> getRunLog(BizEngineering engineering ,String path,String fileName) {
|
||||
try {
|
||||
String allRunPath = baseHome + engineering.getCreateBy() + "/" + engineering.getEngineeringName() + "/";
|
||||
String localFilePath = localFilePrefix + engineering.getCreateBy() + "/" + engineering.getEngineeringName() + "/";
|
||||
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
sftpUtil.download(allRunPath + path,fileName,localFilePath + fileName);
|
||||
sftpUtil.logout();
|
||||
return Files.readAllLines(get(localFilePath + fileName));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String format = "yyyy-MM-dd_hh";
|
||||
// DateTime startTime = DateUtil.parse("2016-06-30_00:00:00", format);
|
||||
// DateTime endTime = DateUtil.parse("2016-07-02_06:23:00", format);
|
||||
// long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
// long sumDay = Integer.valueOf(endTime.getTime() - startTime.getTime() + "") / oneDaySecs * 24;
|
||||
// System.out.println(sumDay);
|
||||
System.out.println(1.0 / 3);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user