123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- package com.miniframe.bisiness.mdo;
- import java.util.List;
- import java.util.Map;
- import com.miniframe.core.ExecProcessFlow;
- import com.miniframe.core.ext.UtilTools;
- import com.miniframe.generate.appcode.ComType;
- import com.miniframe.generate.business.mdo.model.MDO0064BaseModel;
- import com.miniframe.generate.comm.mdo.D_MDO0063;
- import com.miniframe.model.mdo.MdoProInoutPara;
- import com.miniframe.model.mdo.MdoProInoutParaSQLBuilder;
- import com.miniframe.model.mdo.MdoProMathfunc;
- import com.miniframe.model.mdo.MdoProMathfuncSQLBuilder;
- import com.miniframe.model.mdo.dao.MdoProInoutParaMapper;
- import com.miniframe.model.mdo.dao.MdoProMathfuncMapper;
- /**
- * 西工大系统,“MatchFuc添加修改”逻辑处理(重新生成不覆盖)。
- */
- public class MDO0064Service extends MDO0064BaseModel implements ExecProcessFlow {
-
- private static final long serialVersionUID = -7051358269847459502L;
-
- /**
- * 西工大系统,“MatchFuc添加修改”业务核心处理
- */
- public void transExecute() throws Exception {
- String pid = this.getA_mdo0064().getPid();
- String equation =this.getA_mdo0064().getEquation();
- String wid = this.getA_mdo0064().getWid();
- String inParams=this.getA_mdo0064().getInParams();
- String outParams =this.getA_mdo0064().getOutParams();
- MdoProMathfuncMapper mfcdao = UtilTools.getBean(MdoProMathfuncMapper.class);
- MdoProMathfuncSQLBuilder mfcsb = new MdoProMathfuncSQLBuilder();
- MdoProMathfuncSQLBuilder.Criteria mfcsc = mfcsb.createCriteria();
- mfcsc.andPidEqualTo(pid);
- mfcsc.andWidEqualTo(wid);
- List<MdoProMathfunc> mList = mfcdao.selectByExample(mfcsb);
- MdoProMathfunc m;
- if(mList!=null&&!mList.isEmpty()){
- m = mList.get(0);
- m.setEquation(equation);
- mfcdao.updateByPrimaryKey(m);
- }else{
- m = new MdoProMathfunc();
- m.setId(UtilTools.getUUid());
- m.setEquation(equation);
- m.setWid(wid);
- m.setPid(pid);
- mfcdao.insert(m);
- }
- delParas(m.getId());
- insetInoutPara(inParams, m.getId(),1,pid);
- insetInoutPara(outParams, m.getId(),2,pid);
- this.getD_mdo0064().setMfcid(m.getId());
- }
- private void delParas(String adid) {
- MdoProInoutParaMapper xpDao = UtilTools.getBean(MdoProInoutParaMapper.class);
- MdoProInoutParaSQLBuilder xpsb = new MdoProInoutParaSQLBuilder();
- xpsb.createCriteria().andFatheridEqualTo(adid);
- xpDao.deleteByExample(xpsb);
- }
- private void insetInoutPara(String inParams, String adid,Integer type,String pid) {
- MdoProInoutParaMapper xpDao = UtilTools.getBean(MdoProInoutParaMapper.class);
- String[] inPs = inParams.split(";");
- for (String inP : inPs) {
- String[] ps = inP.split(",");
- MdoProInoutPara p = new MdoProInoutPara();
- p.setId(UtilTools.getUUid());
- p.setCode(ps[0]);
- p.setName(ps[1]);
- p.setValue(ps[2]);
- p.setFlag(Integer.valueOf(ps[3]));
- p.setComtype(Integer.valueOf(ComType.MathFunc.getIndex()));
- p.setType(type);
- p.setFatherid(adid);
- p.setPid(pid);
- xpDao.insert(p);
- }
- }
-
- /**
- * 西工大系统,“MatchFuc添加修改”业务前处理
- */
- public void preTransFlow() throws Exception {
- this.validater();
- }
-
- /**
- * 西工大系统,“MatchFuc添加修改”业务后处理
- */
- public void afterTransFlow() throws Exception {
-
- }
-
- /**
- * 西工大系统,“MatchFuc添加修改”逻辑入口处理方法
- */
- @SuppressWarnings("rawtypes")
- @Override
- public Map execute(Map vars) throws Exception {
- this.setTransMap(vars);
- preTransFlow();// 执行业务开始的规则检查和校验
- transExecute();// 执行核心业务段
- afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
- return this.getTransMap();
- }
- }
|