123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- package com.miniframe.bisiness.system;
- import java.nio.file.Path;
- import java.util.Map;
- import com.miniframe.core.ExecProcessFlow;
- import com.miniframe.core.exception.BusinessException;
- import com.miniframe.core.ext.UtilTools;
- import com.miniframe.generate.business.system.model.D00009BaseModel;
- import com.miniframe.httpserver.HttpServerTransFile;
- import com.miniframe.model.system.SysFile;
- import com.miniframe.model.system.dao.SysFileMapper;
- import com.miniframe.template.TemplateGenerator;
- import com.miniframe.tools.XIFileUtils;
- import com.miniframe.utils.MFMimeTypeUtils;
- /**
- * 基础系统,“灾情文件获取”逻辑处理(重新生成不覆盖)。
- */
- public class D00009Service extends D00009BaseModel implements ExecProcessFlow {
-
- private static final long serialVersionUID = -7051358269847459502L;
-
- /**
- * 基础系统,“灾情文件获取”业务核心处理
- */
- public void transExecute() throws Exception {
- Integer aid= getA_d00009().getAid();
- Integer step =getA_d00009().getStep();
- String stype =getA_d00009().getStype();
- // String id = getA_b00022().getId();
- String outPath="";
- String fileName ="";
- if(stype.endsWith("Fire")){
- outPath=TemplateGenerator.BPATH+"/"+aid+"/fire/out";
- fileName ="POST"+step+"/.vtk";
- }
- if(stype.endsWith("Warter")){
- outPath=TemplateGenerator.BPATH+"/"+aid+"/warter/out";
- fileName ="Post"+step+"/.vtk";
- }
- Path path = XIFileUtils.getAbsolutePath(outPath+"/"+fileName);
- String mimeType = MFMimeTypeUtils.getMimeType(path);
- HttpServerTransFile transFile = new HttpServerTransFile(fileName, mimeType, path);
- UtilTools.setHttpServerTransFile(transFile);
- }
-
- /**
- * 基础系统,“灾情文件获取”业务前处理
- */
- public void preTransFlow() throws Exception {
- this.validater();
- }
-
- /**
- * 基础系统,“灾情文件获取”业务后处理
- */
- public void afterTransFlow() throws Exception {
-
- }
-
- /**
- * 基础系统,“灾情文件获取”逻辑入口处理方法
- */
- @SuppressWarnings("rawtypes")
- @Override
- public Map execute(Map vars) throws Exception {
- this.setTransMap(vars);
- preTransFlow();// 执行业务开始的规则检查和校验
- transExecute();// 执行核心业务段
- afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
- return this.getTransMap();
- }
- }
|