ES0007Service.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.miniframe.bisiness.es;
  2. import java.util.Map;
  3. import com.miniframe.core.ExecProcessFlow;
  4. import com.miniframe.core.exception.BusinessException;
  5. import com.miniframe.core.ext.UtilTools;
  6. import com.miniframe.generate.business.es.model.ES0007BaseModel;
  7. import com.miniframe.model.es.EsProCom;
  8. import com.miniframe.model.es.EsProComCon;
  9. import com.miniframe.model.es.EsProComConSQLBuilder;
  10. import com.miniframe.model.es.EsProComSQLBuilder;
  11. import com.miniframe.model.es.dao.EsProComConMapper;
  12. import com.miniframe.model.es.dao.EsProComMapper;
  13. /**
  14. * 无锡发动机,“项目组件删除连线”逻辑处理(重新生成不覆盖)。
  15. */
  16. public class ES0007Service extends ES0007BaseModel implements ExecProcessFlow {
  17. private static final long serialVersionUID = -7051358269847459502L;
  18. /**
  19. * 无锡发动机,“项目组件删除连线”业务核心处理
  20. */
  21. public void transExecute() throws Exception {
  22. String npcId = this.getA_es0007().getNpcId();
  23. String pcId = this.getA_es0007().getPcId();
  24. Integer type = this.getA_es0007().getType();
  25. EsProComMapper cdao = UtilTools.getBean(EsProComMapper.class);
  26. EsProCom proCom= cdao.selectByPrimaryKey(pcId);
  27. EsProCom nProCom =cdao.selectByPrimaryKey(npcId);
  28. if(nProCom==null){
  29. throw new BusinessException("");
  30. }
  31. if(nProCom.getComId()!="3"){
  32. throw new BusinessException("");
  33. }
  34. if(proCom==null){
  35. throw new BusinessException("");
  36. }
  37. EsProComConMapper pccdao =UtilTools.getBean(EsProComConMapper.class);
  38. EsProComConSQLBuilder pccsb = new EsProComConSQLBuilder();
  39. EsProComConSQLBuilder.Criteria pccsc = pccsb.createCriteria();
  40. pccsc.andNpcIdEqualTo(npcId);
  41. pccsc.andPcIdEqualTo(pcId);
  42. pccsc.andTypeEqualTo(Short.valueOf(type.toString()));
  43. pccdao.deleteByExample(pccsb);
  44. }
  45. /**
  46. * 无锡发动机,“项目组件删除连线”业务前处理
  47. */
  48. public void preTransFlow() throws Exception {
  49. this.validater();
  50. }
  51. /**
  52. * 无锡发动机,“项目组件删除连线”业务后处理
  53. */
  54. public void afterTransFlow() throws Exception {
  55. }
  56. /**
  57. * 无锡发动机,“项目组件删除连线”逻辑入口处理方法
  58. */
  59. @SuppressWarnings("rawtypes")
  60. @Override
  61. public Map execute(Map vars) throws Exception {
  62. this.setTransMap(vars);
  63. preTransFlow();// 执行业务开始的规则检查和校验
  64. transExecute();// 执行核心业务段
  65. afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
  66. return this.getTransMap();
  67. }
  68. }