D10028Service.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package com.miniframe.bisiness.system;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import java.util.Map;
  5. import com.miniframe.core.ExecProcessFlow;
  6. import com.miniframe.core.ext.UtilTools;
  7. import com.miniframe.generate.business.system.model.D10028BaseModel;
  8. import com.miniframe.generate.comm.system.D_D10028_ROWS_RECODE;
  9. import com.miniframe.model.system.DThreshold;
  10. import com.miniframe.model.system.DThresholdSQLBuilder;
  11. import com.miniframe.model.system.dao.DThresholdMapper;
  12. /**
  13. * 基础系统,“报警设置查询”逻辑处理(重新生成不覆盖)。
  14. */
  15. public class D10028Service extends D10028BaseModel implements ExecProcessFlow {
  16. private static final long serialVersionUID = -7051358269847459502L;
  17. /**
  18. * 基础系统,“报警设置查询”业务核心处理
  19. */
  20. public void transExecute() throws Exception {
  21. String stype =this.getA_d10028().getStype();
  22. DThresholdMapper dTMapper = UtilTools.getBean(DThresholdMapper.class);
  23. DThresholdSQLBuilder sb = new DThresholdSQLBuilder();
  24. DThresholdSQLBuilder.Criteria sc = sb.createCriteria();
  25. sc.andStypeEqualTo(stype);
  26. sb.setOrderByClause("id ASC");
  27. List<DThreshold> dtList =dTMapper.selectByExample(sb);
  28. List<D_D10028_ROWS_RECODE> rows =new ArrayList<>();
  29. for (DThreshold dt :dtList
  30. ) {
  31. D_D10028_ROWS_RECODE row =new D_D10028_ROWS_RECODE();
  32. row.setId(dt.getId());
  33. row.setGrade(dt.getGrade());
  34. row.setCo2(dt.getCo2());
  35. row.setHeight(dt.getHeight());
  36. row.setSo2(dt.getSo2());
  37. row.setStype(dt.getStype());
  38. row.setCh4(dt.getCh4());
  39. row.setTemperature(dt.getTemperature());
  40. rows.add(row);
  41. }
  42. this.getD_d10028().setRows(rows);
  43. }
  44. /**
  45. * 基础系统,“报警设置查询”业务前处理
  46. */
  47. public void preTransFlow() throws Exception {
  48. this.validater();
  49. }
  50. /**
  51. * 基础系统,“报警设置查询”业务后处理
  52. */
  53. public void afterTransFlow() throws Exception {
  54. }
  55. /**
  56. * 基础系统,“报警设置查询”逻辑入口处理方法
  57. */
  58. @SuppressWarnings("rawtypes")
  59. @Override
  60. public Map execute(Map vars) throws Exception {
  61. this.setTransMap(vars);
  62. preTransFlow();// 执行业务开始的规则检查和校验
  63. transExecute();// 执行核心业务段
  64. afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
  65. return this.getTransMap();
  66. }
  67. }