D00009Service.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package com.miniframe.bisiness.system;
  2. import java.nio.file.Path;
  3. import java.util.Map;
  4. import com.miniframe.core.ExecProcessFlow;
  5. import com.miniframe.core.exception.BusinessException;
  6. import com.miniframe.core.ext.UtilTools;
  7. import com.miniframe.generate.business.system.model.D00009BaseModel;
  8. import com.miniframe.httpserver.HttpServerTransFile;
  9. import com.miniframe.model.system.SysFile;
  10. import com.miniframe.model.system.dao.SysFileMapper;
  11. import com.miniframe.template.TemplateGenerator;
  12. import com.miniframe.tools.XIFileUtils;
  13. import com.miniframe.utils.MFMimeTypeUtils;
  14. /**
  15. * 基础系统,“灾情文件获取”逻辑处理(重新生成不覆盖)。
  16. */
  17. public class D00009Service extends D00009BaseModel implements ExecProcessFlow {
  18. private static final long serialVersionUID = -7051358269847459502L;
  19. /**
  20. * 基础系统,“灾情文件获取”业务核心处理
  21. */
  22. public void transExecute() throws Exception {
  23. Integer aid= getA_d00009().getAid();
  24. Integer step =getA_d00009().getStep();
  25. String stype =getA_d00009().getStype();
  26. // String id = getA_b00022().getId();
  27. String outPath="";
  28. String fileName ="";
  29. if(stype.endsWith("Fire")){
  30. outPath=TemplateGenerator.BPATH+"/"+aid+"/fire/out";
  31. fileName ="POST"+step+"/.vtk";
  32. }
  33. if(stype.endsWith("Warter")){
  34. outPath=TemplateGenerator.BPATH+"/"+aid+"/warter/out";
  35. fileName ="Post"+step+"/.vtk";
  36. }
  37. Path path = XIFileUtils.getAbsolutePath(outPath+"/"+fileName);
  38. String mimeType = MFMimeTypeUtils.getMimeType(path);
  39. HttpServerTransFile transFile = new HttpServerTransFile(fileName, mimeType, path);
  40. UtilTools.setHttpServerTransFile(transFile);
  41. }
  42. /**
  43. * 基础系统,“灾情文件获取”业务前处理
  44. */
  45. public void preTransFlow() throws Exception {
  46. this.validater();
  47. }
  48. /**
  49. * 基础系统,“灾情文件获取”业务后处理
  50. */
  51. public void afterTransFlow() throws Exception {
  52. }
  53. /**
  54. * 基础系统,“灾情文件获取”逻辑入口处理方法
  55. */
  56. @SuppressWarnings("rawtypes")
  57. @Override
  58. public Map execute(Map vars) throws Exception {
  59. this.setTransMap(vars);
  60. preTransFlow();// 执行业务开始的规则检查和校验
  61. transExecute();// 执行核心业务段
  62. afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
  63. return this.getTransMap();
  64. }
  65. }