123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package com.miniframe.bisiness.system;
- import java.util.ArrayList;
- import java.util.List;
- 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.D10023BaseModel;
- import com.miniframe.generate.comm.system.D_D10023_ROWS_RECODE;
- import com.miniframe.model.system.DGas;
- import com.miniframe.model.system.DGasBlastArea;
- import com.miniframe.model.system.DGasBlastAreaSQLBuilder;
- import com.miniframe.model.system.dao.DGasBlastAreaMapper;
- import com.miniframe.model.system.dao.DGasMapper;
- import com.miniframe.tools.CommonUtils;
- /**
- * 基础系统,“瓦斯爆炸区查询”逻辑处理(重新生成不覆盖)。
- */
- public class D10023Service extends D10023BaseModel implements ExecProcessFlow {
-
- private static final long serialVersionUID = -7051358269847459502L;
-
- /**
- * 基础系统,“瓦斯爆炸区查询”业务核心处理
- */
- public void transExecute() throws Exception {
- Integer gid =this.getA_d10023().getGid();
- DGasMapper gasMapper = UtilTools.getBean(DGasMapper.class);
- DGas gas =gasMapper.selectByPrimaryKey(gid);
- if(gas ==null){
- throw new BusinessException("EB3100022");
- }
- DGasBlastAreaMapper blastAreaMapper =UtilTools.getBean(DGasBlastAreaMapper.class);
- DGasBlastAreaSQLBuilder sb =new DGasBlastAreaSQLBuilder();
- DGasBlastAreaSQLBuilder.Criteria sc = sb.createCriteria();
- sc.andGidEqualTo(gid);
- List<DGasBlastArea> blastAreas = blastAreaMapper.selectByExample(sb);
- List<D_D10023_ROWS_RECODE> rows =new ArrayList<>();
- for (DGasBlastArea gba:blastAreas) {
- D_D10023_ROWS_RECODE row =new D_D10023_ROWS_RECODE();
- row.setAid(gba.getAid());
- row.setEsite(CommonUtils.floatTodobule(gba.getEsite()));
- row.setSsite(CommonUtils.floatTodobule(gba.getSsite()));
- row.setGbid(gba.getId());
- row.setGid(gba.getGid());
- row.setPid(gba.getPid());
- row.setPname(gba.getPname());
- rows.add(row);
- }
- this.getD_d10023().setRows(rows);
- }
-
- /**
- * 基础系统,“瓦斯爆炸区查询”业务前处理
- */
- 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();
- }
- }
|