123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- package com.miniframe.bisiness.mdo;
- import com.miniframe.core.ExecProcessFlow;
- import com.miniframe.core.exception.BusinessException;
- import com.miniframe.core.ext.UtilTools;
- import com.miniframe.generate.business.mdo.model.MDO0006BaseModel;
- import com.miniframe.model.mdo.MdoMod;
- import com.miniframe.model.mdo.dao.MdoModMapper;
- import com.miniframe.tools.XIDateTimeUtils;
- import tk.mybatis.mapper.util.StringUtil;
- import java.util.Date;
- import java.util.Map;
- /**
- * 西工大系统,“模版添加修改”逻辑处理(重新生成不覆盖)。
- */
- public class MDO0006Service extends MDO0006BaseModel implements ExecProcessFlow {
-
- private static final long serialVersionUID = -7051358269847459502L;
-
- /**
- * 西工大系统,“模版添加修改”业务核心处理
- */
- public void transExecute() throws Exception {
- String mid = this.getA_mdo0006().getMid();
- String name =this.getA_mdo0006().getName();
- String remark =this.getA_mdo0006().getRemark();
- String isshare =this.getA_mdo0006().getIsshare();
- String image =this.getA_mdo0006().getImage();
- String flow =this.getA_mdo0006().getFlow();
- String uid=this.getA_mdohead().getUserId();
- String image2 =this.getA_mdo0006().getImage2();
- Integer type =this.getA_mdo0006().getType();
- Date nowDate = XIDateTimeUtils.getNowDate();
- MdoModMapper modDao = UtilTools.getBean(MdoModMapper.class);
- if(StringUtil.isEmpty(mid)){//添加
- mid = UtilTools.getUUid();
- MdoMod mod =new MdoMod();
- mod.setId(mid);
- mod.setUid(uid);
- mod.setCreateTime(nowDate);
- mod.setUpdateTime(nowDate);
- mod.setFlow(flow);
- mod.setImage(image);
- mod.setIsshare(Short.valueOf(isshare));
- mod.setName(name);
- mod.setRemark(remark);
- mod.setType(type);
- mod.setImage2(image2);
- modDao.insert(mod);
- }else{//修改
- MdoMod mod = modDao.selectByPrimaryKey(mid);
- if(mod==null){
- throw new BusinessException("MDO000002");
- }
- mod.setId(mid);
- mod.setUid(uid);
- mod.setUpdateTime(nowDate);
- mod.setFlow(flow);
- mod.setImage(image);
- mod.setIsshare(Short.valueOf(isshare));
- mod.setName(name);
- mod.setRemark(remark);
- mod.setType(type);
- mod.setImage2(image2);
- modDao.updateByPrimaryKey(mod);
- }
- }
-
- /**
- * 西工大系统,“模版添加修改”业务前处理
- */
- 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();
- }
- }
|