D10023Service.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.exception.BusinessException;
  7. import com.miniframe.core.ext.UtilTools;
  8. import com.miniframe.generate.business.system.model.D10023BaseModel;
  9. import com.miniframe.generate.comm.system.D_D10023_ROWS_RECODE;
  10. import com.miniframe.model.system.DGas;
  11. import com.miniframe.model.system.DGasBlastArea;
  12. import com.miniframe.model.system.DGasBlastAreaSQLBuilder;
  13. import com.miniframe.model.system.dao.DGasBlastAreaMapper;
  14. import com.miniframe.model.system.dao.DGasMapper;
  15. import com.miniframe.tools.CommonUtils;
  16. /**
  17. * 基础系统,“瓦斯爆炸区查询”逻辑处理(重新生成不覆盖)。
  18. */
  19. public class D10023Service extends D10023BaseModel implements ExecProcessFlow {
  20. private static final long serialVersionUID = -7051358269847459502L;
  21. /**
  22. * 基础系统,“瓦斯爆炸区查询”业务核心处理
  23. */
  24. public void transExecute() throws Exception {
  25. Integer gid =this.getA_d10023().getGid();
  26. DGasMapper gasMapper = UtilTools.getBean(DGasMapper.class);
  27. DGas gas =gasMapper.selectByPrimaryKey(gid);
  28. if(gas ==null){
  29. throw new BusinessException("EB3100022");
  30. }
  31. DGasBlastAreaMapper blastAreaMapper =UtilTools.getBean(DGasBlastAreaMapper.class);
  32. DGasBlastAreaSQLBuilder sb =new DGasBlastAreaSQLBuilder();
  33. DGasBlastAreaSQLBuilder.Criteria sc = sb.createCriteria();
  34. sc.andGidEqualTo(gid);
  35. List<DGasBlastArea> blastAreas = blastAreaMapper.selectByExample(sb);
  36. List<D_D10023_ROWS_RECODE> rows =new ArrayList<>();
  37. for (DGasBlastArea gba:blastAreas) {
  38. D_D10023_ROWS_RECODE row =new D_D10023_ROWS_RECODE();
  39. row.setAid(gba.getAid());
  40. row.setEsite(CommonUtils.floatTodobule(gba.getEsite()));
  41. row.setSsite(CommonUtils.floatTodobule(gba.getSsite()));
  42. row.setGbid(gba.getId());
  43. row.setGid(gba.getGid());
  44. row.setPid(gba.getPid());
  45. row.setPname(gba.getPname());
  46. rows.add(row);
  47. }
  48. this.getD_d10023().setRows(rows);
  49. }
  50. /**
  51. * 基础系统,“瓦斯爆炸区查询”业务前处理
  52. */
  53. public void preTransFlow() throws Exception {
  54. this.validater();
  55. }
  56. /**
  57. * 基础系统,“瓦斯爆炸区查询”业务后处理
  58. */
  59. public void afterTransFlow() throws Exception {
  60. }
  61. /**
  62. * 基础系统,“瓦斯爆炸区查询”逻辑入口处理方法
  63. */
  64. @SuppressWarnings("rawtypes")
  65. @Override
  66. public Map execute(Map vars) throws Exception {
  67. this.setTransMap(vars);
  68. preTransFlow();// 执行业务开始的规则检查和校验
  69. transExecute();// 执行核心业务段
  70. afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
  71. return this.getTransMap();
  72. }
  73. }