本文主要是介绍利用低代码平台构建领域驱动设计(DDD)的解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前言
随着企业数字化转型的需求日益增长,低代码平台作为一种快速开发和部署业务应用的方法,正在获得更多关注。领域驱动设计(DDD)是一种软件架构风格,旨在更好地满足复杂业务需求。结合这两者可以创建灵活且可维护的应用程序。
在本应用中,我们将利用低代码平台的灵活性和DDD的架构优势来构建一个可持续的解决方案。
本文将以一个最常见的实例来展开分析。
一,模型构建
模型构建,主要是根据数据库表,将结构化数据关系(1:1,1:N,N:N)对应完成ormaping映射。实例中采用使用了一个单表模型做演示。同时将在资源库这一层抽象出的接口信息,通过注解完成在DDD领域模型中的注册,使得持久层的操作可见可用。具体的操作办法如下:
(1)进入资源库管理:
资源库是领域模型仓储库的一个具体事项方式,主要管理数据库资源以及已经完成映射的,DAO类库以及其相应的接口操作库。
(2)添加库表资源
完成数据连接导入后可以动态获取库表及业务视图,完成库表导入后由资源库完成相应的代码构建工作。
(3)开始构建
代码构建主要是基于已经建立的持久化模型,根据模版管理库构建对应的代码结构。
添加图片注释,不超过 140 字(可选)
(4)查看构建结果(代码)
完成构建后就可以在线查看生成代码了。
添加图片注释,不超过 140 字(可选)
(5)编译代码
完成代码构建后,可以自动或手工完成相关的代码编译工作,编译完成后相应类库信息会同步到领域模型库中,方便领域模型根据模版构建相应的聚合应用体系。
添加图片注释,不超过 140 字(可选)
(6)代码示例
相关代码示例如下:
贫血模型接口(I**Class)
package com.ds.test.repository.leaveapplication.module;import com.ds.enums.db.*;
import com.ds.enums.*;
import com.ds.esd.tool.ui.enums.*;
import java.util.*;
import com.ds.common.database.dao.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esb.config.*;
import com.ds.esb.config.formula.*;
import com.ds.common.*;
import com.ds.esd.custom.api.annotation.*;
import com.ds.esd.annotation.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.custom.api.enums.*;
import com.ds.esd.custom.titleblock.enums.*;
import com.ds.esd.custom.tree.enums.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.custom.nav.enums.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.custom.gallery.enums.*;
import com.ds.test.repository.leaveapplication.module.*;
import com.ds.test.repository.leaveapplication.service.*;@DBTable(configKey="fdt",cname="请假审批单表",primaryKey="uuid",tableName="leaveapplication")@RepositoryAnnotation@Entitypublic interface ILeaveapplication {@Uid@DBField(cnName="主键",length=36,dbFieldName="uuid")public String getUuid();public void setUuid(String uuid);@CustomAnnotation(caption="学号")@DBField(cnName="学号",length=10,dbFieldName="studentid")public String getStudentid();public void setStudentid(String studentid);@CustomAnnotation(caption="姓名")@DBField(cnName="姓名",length=50,dbFieldName="studentname")public String getStudentname();public void setStudentname(String studentname);@CustomAnnotation(caption="专业/方向")@DBField(cnName="专业/方向",length=50,dbFieldName="major")public String getMajor();public void setMajor(String major);@CustomAnnotation(caption="导师")@DBField(cnName="导师",length=50,dbFieldName="advisor")public String getAdvisor();public void setAdvisor(String advisor);@CustomAnnotation(caption="请假日期")@ComboInputAnnotation(inputType=ComboInputType.date)@FieldAnnotation(componentType=ComponentType.ComboInput)@DBField(cnName="请假日期",length=0,dbType=ColType.DATE,dbFieldName="leavedate")public Date getLeavedate();public void setLeavedate(Date leavedate);@CustomAnnotation(caption="请假时间")@ComboInputAnnotation(inputType=ComboInputType.time)@FieldAnnotation(componentType=ComponentType.ComboInput)@DBField(cnName="请假时间",length=0,dbType=ColType.TIME,dbFieldName="leavetime")public Date getLeavetime();public void setLeavetime(Date leavetime);@CustomAnnotation(caption="请假课程")@DBField(cnName="请假课程",length=50,dbFieldName="coursename")public String getCoursename();public void setCoursename(String coursename);@CustomAnnotation(caption="任课老师")@DBField(cnName="任课老师",length=50,dbFieldName="instructor")public String getInstructor();public void setInstructor(String instructor);@CustomAnnotation(caption="请假事由")@FieldAnnotation(componentType=ComponentType.MultiLines,colSpan=-1,manualHeight=200)@DBField(cnName="请假事由",length=0,dbType=ColType.TEXT,dbFieldName="reason")public String getReason();public void setReason(String reason);@CustomAnnotation(caption="审批状态")@DBField(cnName="审批状态",length=10,dbFieldName="approvalstatus")public String getApprovalstatus();public void setApprovalstatus(String approvalstatus);@CustomAnnotation(caption="审批人")@DBField(cnName="审批人",length=50,dbFieldName="approvalperson")public String getApprovalperson();public void setApprovalperson(String approvalperson);@CustomAnnotation(caption="审批单位")@DBField(cnName="审批单位",length=50,dbFieldName="approvalunit")public String getApprovalunit();public void setApprovalunit(String approvalunit);@CustomAnnotation(caption="activityHist")@DBField(cnName="activityHist",dbFieldName="activityhistoryid")public String getActivityhistoryid();public void setActivityhistoryid(String activityhistoryid);@CustomAnnotation(caption="activityInst")@DBField(cnName="activityInst",dbFieldName="activityinstid")public String getActivityinstid();public void setActivityinstid(String activityinstid);@CustomAnnotation(caption="userId")@DBField(cnName="userId",dbFieldName="userid")public String getUserid();public void setUserid(String userid);@CustomAnnotation(caption="processInstI")@DBField(cnName="processInstI",dbFieldName="processinstid")public String getProcessinstid();public void setProcessinstid(String processinstid);}
数据映射(实体Bean)
package com.ds.test.repository.leaveapplication.module;import com.ds.enums.db.*;
import com.ds.enums.*;
import com.ds.esd.tool.ui.enums.*;
import java.util.*;
import com.ds.common.database.dao.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esb.config.*;
import com.ds.esb.config.formula.*;
import com.ds.common.*;
import com.ds.esd.custom.api.annotation.*;
import com.ds.esd.annotation.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.custom.api.enums.*;
import com.ds.esd.custom.titleblock.enums.*;
import com.ds.esd.custom.tree.enums.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.custom.nav.enums.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.custom.gallery.enums.*;
import com.ds.test.repository.leaveapplication.module.*;
import com.ds.test.repository.leaveapplication.service.*;@DBTable(configKey="fdt",cname="请假审批单表",primaryKey="uuid",tableName="leaveapplication")@RepositoryAnnotation@Entity
public class Leaveapplication {@Uid@DBField(cnName="主键",length=36,dbFieldName="uuid")public String uuid; @CustomAnnotation(caption="学号")@DBField(cnName="学号",length=10,dbFieldName="studentid")public String studentid;@CustomAnnotation(caption="姓名")@DBField(cnName="姓名",length=50,dbFieldName="studentname")public String studentname;@CustomAnnotation(caption="专业/方向")@DBField(cnName="专业/方向",length=50,dbFieldName="major")public String major;@CustomAnnotation(caption="导师")@DBField(cnName="导师",length=50,dbFieldName="advisor")public String advisor;@CustomAnnotation(caption="请假日期")@ComboInputAnnotation(inputType=ComboInputType.date)@FieldAnnotation(componentType=ComponentType.ComboInput)@DBField(cnName="请假日期",length=0,dbType=ColType.DATE,dbFieldName="leavedate")public Date leavedate;@CustomAnnotation(caption="请假时间")@ComboInputAnnotation(inputType=ComboInputType.time)@FieldAnnotation(componentType=ComponentType.ComboInput)@DBField(cnName="请假时间",length=0,dbType=ColType.TIME,dbFieldName="leavetime")public Date leavetime;@CustomAnnotation(caption="请假课程")@DBField(cnName="请假课程",length=50,dbFieldName="coursename")public String coursename;@CustomAnnotation(caption="任课老师")@DBField(cnName="任课老师",length=50,dbFieldName="instructor")public String instructor;@CustomAnnotation(caption="请假事由")@FieldAnnotation(componentType=ComponentType.MultiLines,colSpan=-1,manualHeight=200)@DBField(cnName="请假事由",length=0,dbType=ColType.TEXT,dbFieldName="reason")public String reason;@CustomAnnotation(caption="审批状态")@DBField(cnName="审批状态",length=10,dbFieldName="approvalstatus")public String approvalstatus;@CustomAnnotation(caption="审批人")@DBField(cnName="审批人",length=50,dbFieldName="approvalperson")public String approvalperson;@CustomAnnotation(caption="审批单位")@DBField(cnName="审批单位",length=50,dbFieldName="approvalunit")public String approvalunit;@CustomAnnotation(caption="activityHist")@DBField(cnName="activityHist",dbFieldName="activityhistoryid")public String activityhistoryid;@CustomAnnotation(caption="activityInst")@DBField(cnName="activityInst",dbFieldName="activityinstid")public String activityinstid;@CustomAnnotation(caption="userId")@DBField(cnName="userId",dbFieldName="userid")public String userid;@CustomAnnotation(caption="processInstI")@DBField(cnName="processInstI",dbFieldName="processinstid")public String processinstid;public String getUuid(){return uuid; }public void setUuid(String uuid){this.uuid = uuid;}public String getStudentid(){return studentid; }public void setStudentid(String studentid){this.studentid = studentid;}public String getStudentname(){return studentname; }public void setStudentname(String studentname){this.studentname = studentname;}public String getMajor(){return major; }public void setMajor(String major){this.major = major;}public String getAdvisor(){return advisor; }public void setAdvisor(String advisor){this.advisor = advisor;}public Date getLeavedate(){return leavedate; }public void setLeavedate(Date leavedate){this.leavedate = leavedate;}public Date getLeavetime(){return leavetime; }public void setLeavetime(Date leavetime){this.leavetime = leavetime;}public String getCoursename(){return coursename; }public void setCoursename(String coursename){this.coursename = coursename;}public String getInstructor(){return instructor; }public void setInstructor(String instructor){this.instructor = instructor;}public String getReason(){return reason; }public void setReason(String reason){this.reason = reason;}public String getApprovalstatus(){return approvalstatus; }public void setApprovalstatus(String approvalstatus){this.approvalstatus = approvalstatus;}public String getApprovalperson(){return approvalperson; }public void setApprovalperson(String approvalperson){this.approvalperson = approvalperson;}public String getApprovalunit(){return approvalunit; }public void setApprovalunit(String approvalunit){this.approvalunit = approvalunit;}public String getActivityhistoryid(){return activityhistoryid; }public void setActivityhistoryid(String activityhistoryid){this.activityhistoryid = activityhistoryid;}public String getActivityinstid(){return activityinstid; }public void setActivityinstid(String activityinstid){this.activityinstid = activityinstid;}public String getUserid(){return userid; }public void setUserid(String userid){this.userid = userid;}public String getProcessinstid(){return processinstid; }public void setProcessinstid(String processinstid){this.processinstid = processinstid;}}
数据接口(定义)
package com.ds.test.repository.leaveapplication.service;import com.ds.enums.db.*;
import com.ds.enums.*;
import com.ds.esd.tool.ui.enums.*;
import java.util.*;
import com.ds.common.database.dao.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esb.config.*;
import com.ds.esb.config.formula.*;
import com.ds.common.*;
import com.ds.esd.custom.api.annotation.*;
import com.ds.esd.annotation.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.custom.api.enums.*;
import com.ds.esd.custom.titleblock.enums.*;
import com.ds.esd.custom.tree.enums.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.custom.nav.enums.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.custom.gallery.enums.*;
import com.ds.test.repository.leaveapplication.module.*;
import com.ds.test.repository.leaveapplication.service.*;
@Aggregation(type = AggregationType.aggregationEntity,entityClass=Leaveapplication.class,rootClass= LeaveapplicationService.class)
public interface LeaveapplicationService{@ModuleAnnotation(moduleViewType = ModuleViewType.GridConfig)@APIEventAnnotation(bindMenu = {CustomMenuItem.reload}, autoRun = true, customRequestData = RequestPathEnum.ctx)public List<Leaveapplication> findAll()throws JDSException;public List<Leaveapplication> findByWhere(String where)throws JDSException;@APIEventAnnotation(bindMenu = {CustomMenuItem.search})public List<Leaveapplication> find(Leaveapplication leaveapplication)throws JDSException;@ModuleAnnotation(moduleViewType = ModuleViewType.FormConfig)@APIEventAnnotation(bindFormEvent = CustomFormEvent.formLoad,bindGridEvent = {CustomGridEvent.editor}, autoRun = true,customRequestData = RequestPathEnum.ctx, customResponseData = ResponsePathEnum.form)public Leaveapplication getLeaveapplicationInfo(String uuid) throws JDSException;@APIEventAnnotation(bindMenu = {CustomMenuItem.save}, callback = {CustomCallBack.ReloadParent, CustomCallBack.Close})public Leaveapplication update( Leaveapplication leaveapplication) throws JDSException ;@APIEventAnnotation(bindMenu = {CustomMenuItem.delete}, callback = CustomCallBack.Reload)public Boolean delete(String uuid) throws JDSException ;}
数据接口(实现)
package com.ds.test.repository.leaveapplication.service;import com.ds.enums.db.*;
import com.ds.enums.*;
import com.ds.esd.tool.ui.enums.*;
import java.util.*;
import com.ds.common.database.dao.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esb.config.*;
import com.ds.esb.config.formula.*;
import com.ds.common.*;
import com.ds.esd.custom.api.annotation.*;
import com.ds.esd.annotation.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.custom.api.enums.*;
import com.ds.esd.custom.titleblock.enums.*;
import com.ds.esd.custom.tree.enums.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.custom.nav.enums.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.custom.gallery.enums.*;
import com.ds.test.repository.leaveapplication.module.*;
import com.ds.test.repository.leaveapplication.service.*;@EsbBeanAnnotation
public class LeaveapplicationServiceImpl implements LeaveapplicationService{public List<Leaveapplication> findAll()throws JDSException{List<Leaveapplication> leaveapplicationList = new ArrayList<>();DAO dao = null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();leaveapplicationList = dao.findAll();} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return leaveapplicationList;}public List<Leaveapplication> findByWhere(String where)throws JDSException{List<Leaveapplication> leaveapplicationList = new ArrayList<>();DAO dao =null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();leaveapplicationList = dao.find(where);} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return leaveapplicationList;}public List<Leaveapplication> find(Leaveapplication leaveapplication)throws JDSException{List<Leaveapplication> leaveapplicationList = new ArrayList<>();DAO dao = null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();leaveapplicationList = dao.find(leaveapplication);} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return leaveapplicationList;}public Leaveapplication getLeaveapplicationInfo(String uuid) throws JDSException {Leaveapplication leaveapplication = null;DAO<Leaveapplication> dao =null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();if (uuid==null||uuid.equals("")){leaveapplication= dao.createBean();}else{leaveapplication= dao.findByPrimaryKey(uuid);}} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return leaveapplication;}public Leaveapplication update( Leaveapplication leaveapplication) throws JDSException {DAO<Leaveapplication> dao = null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();dao.update(leaveapplication);} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return leaveapplication;}public Boolean delete(String uuid) throws JDSException {DAO<Leaveapplication> dao =null;try {DAOFactory factory = new DAOFactory(Leaveapplication.class);dao = factory.getDAO();if (uuid.indexOf(";") > -1) {for (String uid : uuid.split(";")) {dao.delete(uid);}} else {dao.delete(uuid);}} catch (Exception e) {e.printStackTrace();throw new JDSException(e);} finally {if (dao != null) {dao.close();}}return true;}}
二,应用聚合
聚合应用是领域模型建模中最为重要的一个环节,这个环节的重点是将,资源库相应的操作接口转换为领域模型应用,通过web聚合器输出位web 引用发布,同时将实体操作转换为领域事件供DDD内部完成调度处理。而聚合应用则是将视图与模型有机结合实现聚合实体以及聚合根应用。同时抽取相应的数据字典以及应用域作为上层的支撑。
(1)导入资源库接口转换为通用聚合实体
(2)查看调整聚合实体配置
(3)查看调整聚合实体代码结构
(4)聚合实体配置
(5)领域事件
(6)实现代码
package com.ds.test.domain.leaveapplication.api;import com.ds.esd.custom.module.annotation.*;
import org.springframework.web.bind.annotation.*;
import com.ds.esd.custom.api.annotation.*;
import com.ds.esd.custom.annotation.*;
import com.ds.test.repository.leaveapplication.service.*;
import com.ds.test.repository.leaveapplication.module.*;
import com.ds.esb.config.*;
import com.ds.esb.config.formula.*;
import java.util.*;
import com.ds.web.util.*;
import com.ds.jds.core.esb.*;
import com.ds.config.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.custom.api.enums.*;
import com.ds.esd.tool.ui.enums.*;
import com.ds.web.annotation.*;
import com.ds.enums.*;
import com.ds.esd.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.enums.db.*;
import org.springframework.stereotype.*;
import org.springframework.core.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.titleblock.enums.*;
import com.ds.esd.custom.tree.enums.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.custom.nav.enums.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.custom.gallery.enums.*;
import com.ds.esd.custom.annotation.toolbar.*;
import com.ds.test.domain.leaveapplication.*;
import com.ds.test.domain.leaveapplication.api.*;
import test.leaveapplication.*;@Aggregation(rootClass=LeaveapplicationService.class,entityClass=Leaveapplication.class,type=AggregationType.aggregationEntity)@RequestMapping(value="/test/leaveapplication")@Controller
public interface LeaveapplicationServiceAPI {@APIEventAnnotation(bindMenu=CustomMenuItem.reload,customRequestData=RequestPathEnum.ctx,autoRun=true)@ModuleAnnotation(moduleViewType=ModuleViewType.GridConfig)@GridViewAnnotation@CustomAnnotation@RequestMapping(value="FindAll")@ResponseBodypublic ListResultModel<List<FindAll>> findAll ();@APIEventAnnotation(bindFormEvent=CustomFormEvent.formLoad,customRequestData=RequestPathEnum.ctx,autoRun=true,bindGridEvent=CustomGridEvent.editor,customResponseData=ResponsePathEnum.form)@ModuleAnnotation(moduleViewType=ModuleViewType.FormConfig)@FormViewAnnotation@RequestMapping(value="LeaveapplicationInfo")@ResponseBodypublic ResultModel<LeaveapplicationInfo> getLeaveapplicationInfo (String uuid);@APIEventAnnotation(bindMenu=CustomMenuItem.save,callback={CustomCallBack.ReloadParent,CustomCallBack.Close})public ResultModel<Leaveapplication> update (@RequestBody Leaveapplication leaveapplication);@APIEventAnnotation(bindMenu=CustomMenuItem.search)public ListResultModel<List<Leaveapplication>> find (Leaveapplication leaveapplication);@APIEventAnnotation(bindMenu=CustomMenuItem.delete,callback=CustomCallBack.Reload)@RequestMapping(value="delete")@ResponseBodypublic ResultModel<Boolean> delete (String uuid);@RequestMapping(value="findByWhere")@ResponseBodypublic ListResultModel<List<Leaveapplication>> findByWhere (String where);}
三,视图修饰
(1)视图结构
视图域是在完成初步聚合实体建模后,根据具体的模型来构建视图体系,这些体系中根据实体的结构来构建视图的结构,最终通过,代码的方式展现处理。
视图模版种类:
视图模版具体化后工程结构:
(2)视图配置
(3)视图修饰
为列表增加菜单
为列表增加分页栏
为表单字段子域配置
配置 模块编译输出
(4)列表视图源码
package test.leaveapplication;import com.ds.config.*;
import java.util.*;
import com.ds.esd.custom.grid.annotation.*;
import com.ds.enums.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.tool.ui.enums.*;
import com.ds.enums.db.*;
import org.springframework.stereotype.*;
import org.springframework.core.annotation.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esd.custom.annotation.toolbar.*;
import org.springframework.web.bind.annotation.*;@PageBar@GridRowCmd@MenuBarMenu(domainId="test")@RowHead@GridAnnotation(uidColumn="uuid",customMenu={GridMenu.Delete,GridMenu.Reload,GridMenu.Add})public interface FindAll {@CustomAnnotation(caption="请假事由")@GridColItemAnnotation(width="8.0em")public String getReason();public void setReason(String reason);@CustomAnnotation(caption="专业/方向")@GridColItemAnnotation(width="8.0em")public String getMajor();public void setMajor(String major);@CustomAnnotation(caption="userId")@GridColItemAnnotation(width="8.0em")public String getUserid();public void setUserid(String userid);@CustomAnnotation(caption="学号")@GridColItemAnnotation(width="8.0em")public String getStudentid();public void setStudentid(String studentid);@CustomAnnotation(caption="姓名")@GridColItemAnnotation(width="8.0em")public String getStudentname();public void setStudentname(String studentname);@CustomAnnotation(caption="请假日期")@GridColItemAnnotation(width="8.0em",inputType=ComboInputType.date)public Date getLeavedate();public void setLeavedate(Date leavedate);@CustomAnnotation(caption="任课老师")@GridColItemAnnotation(width="8.0em")public String getInstructor();public void setInstructor(String instructor);@CustomAnnotation(caption="请假时间")@GridColItemAnnotation(width="8.0em",inputType=ComboInputType.time)public Date getLeavetime();public void setLeavetime(Date leavetime);@CustomAnnotation(caption="请假课程")@GridColItemAnnotation(width="8.0em")public String getCoursename();public void setCoursename(String coursename);@CustomAnnotation(caption="processInstI")@GridColItemAnnotation(width="8.0em")public String getProcessinstid();public void setProcessinstid(String processinstid);@CustomAnnotation(caption="导师")@GridColItemAnnotation(width="8.0em")public String getAdvisor();public void setAdvisor(String advisor);@CustomAnnotation(caption="审批单位")@GridColItemAnnotation(width="8.0em")public String getApprovalunit();public void setApprovalunit(String approvalunit);@CustomAnnotation(caption="审批状态")@GridColItemAnnotation(width="8.0em")public String getApprovalstatus();public void setApprovalstatus(String approvalstatus);@CustomAnnotation(caption="审批人")@GridColItemAnnotation(width="8.0em")public String getApprovalperson();public void setApprovalperson(String approvalperson);@CustomAnnotation(caption="activityInst")@GridColItemAnnotation(width="8.0em")public String getActivityinstid();public void setActivityinstid(String activityinstid);@CustomAnnotation(caption="activityHist")@GridColItemAnnotation(width="8.0em")public String getActivityhistoryid();public void setActivityhistoryid(String activityhistoryid);@CustomAnnotation(uid=true,hidden=true,index=1)@GridColItemAnnotation(width="8.0em")public String getUuid();public void setUuid(String uuid);@CustomAnnotation(index=17)@GridColItemAnnotation(width="8.0em",flexSize=true)public String getFormTitle();public void setFormTitle(String formTitle);}
(5)表单视图源码
package test.leaveapplication;import com.ds.config.*;
import java.util.*;
import com.ds.esd.custom.grid.annotation.*;
import com.ds.enums.*;
import com.ds.web.annotation.*;
import com.ds.esd.custom.grid.enums.*;
import com.ds.esd.tool.ui.enums.*;
import com.ds.enums.db.*;
import org.springframework.stereotype.*;
import org.springframework.core.annotation.*;
import com.ds.esd.custom.module.annotation.*;
import com.ds.esd.custom.action.module.*;
import com.ds.esd.custom.annotation.*;
import com.ds.esd.custom.bean.enums.*;
import com.ds.esd.custom.annotation.toolbar.*;
import org.springframework.web.bind.annotation.*;
import com.ds.esd.custom.form.action.*;
import com.ds.esd.custom.form.*;
import com.ds.esd.custom.form.annotation.*;
import com.ds.esd.tool.ui.component.form.formlayout.*;
import com.ds.esd.custom.toolbar.*;
import com.ds.esd.custom.form.enums.*;
import com.ds.esd.dsm.view.field.*;
import com.alibaba.fastjson.annotation.*;
import com.alibaba.fastjson.serializer.*;
import com.alibaba.fastjson.parser.*;
import com.ds.common.util.*;
import com.ds.esd.tool.ui.component.*;
import com.ds.esd.editor.extmenu.*;
import com.ds.esd.custom.bean.*;
import com.ds.esb.config.formula.*;
import com.ds.esd.tool.ui.module.*;
import com.ds.esd.custom.*;
import com.ds.esd.tool.ui.component.navigation.*;
import com.ds.esd.tool.ui.component.form.*;
import com.ds.web.*;
import com.ds.esd.custom.enums.*;
import com.ds.esd.dsm.aggregation.*;
import com.ds.esd.custom.field.*;
import com.ds.esd.custom.field.combo.*;@FormAnnotationpublic interface LeaveapplicationInfo {@FieldAnnotation(componentType=ComponentType.Label,colSpan=-1,manualHeight=60)@CustomAnnotation(index=30,caption="LeaveapplicationInfo")@LabelAnnotation(hAlign=HAlignType.center,fontSize="3em")public String getFormTitle();public void setFormTitle(String formTitle);@FieldAnnotation(componentType=ComponentType.ComboInput,colSpan=-1)@CustomAnnotation(index=1,caption="请假事由")public String getReason();public void setReason(String reason);@CustomAnnotation(index=2,caption="专业/方向")@InputAnnotationpublic String getMajor();public void setMajor(String major);@FieldAnnotation(componentType=ComponentType.ComboInput)@CustomAnnotation(index=3,caption="请假时间")@ComboDateAnnotationpublic Date getLeavetime();public void setLeavetime(Date leavetime);@CustomAnnotation(index=4,caption="导师")@InputAnnotationpublic String getAdvisor();public void setAdvisor(String advisor);@FieldAnnotation(componentType=ComponentType.ComboInput)@CustomAnnotation(index=5,caption="请假日期")@ComboDateAnnotationpublic Date getLeavedate();public void setLeavedate(Date leavedate);@FieldAnnotation(componentType=ComponentType.HiddenInput)@CustomAnnotation(index=6,caption="processInstI")@InputAnnotationpublic String getProcessinstid();public void setProcessinstid(String processinstid);@CustomAnnotation(index=7,caption="学号")@InputAnnotationpublic String getStudentid();public void setStudentid(String studentid);@CustomAnnotation(index=8,caption="姓名")@InputAnnotationpublic String getStudentname();public void setStudentname(String studentname);@CustomAnnotation(index=9,caption="审批单位")@InputAnnotationpublic String getApprovalunit();public void setApprovalunit(String approvalunit);@CustomAnnotation(index=10,caption="请假课程")@InputAnnotationpublic String getCoursename();public void setCoursename(String coursename);@CustomAnnotation(index=11,caption="任课老师")@InputAnnotationpublic String getInstructor();public void setInstructor(String instructor);@FieldAnnotation(componentType=ComponentType.HiddenInput)@CustomAnnotation(index=12,caption="userId")@InputAnnotationpublic String getUserid();public void setUserid(String userid);@FieldAnnotation(componentType=ComponentType.HiddenInput)@CustomAnnotation(index=13,caption="activityHist")@InputAnnotationpublic String getActivityhistoryid();public void setActivityhistoryid(String activityhistoryid);@CustomAnnotation(index=14,caption="审批状态")@InputAnnotationpublic String getApprovalstatus();public void setApprovalstatus(String approvalstatus);@CustomAnnotation(index=15,caption="审批人")@InputAnnotationpublic String getApprovalperson();public void setApprovalperson(String approvalperson);@FieldAnnotation(componentType=ComponentType.HiddenInput)@CustomAnnotation(index=16,caption="activityInst")@InputAnnotationpublic String getActivityinstid();public void setActivityinstid(String activityinstid);@FieldAnnotation(componentType=ComponentType.HiddenInput)@CustomAnnotation(uid=true,hidden=true,index=17)public String getUuid();public void setUuid(String uuid);}
四,路由关联
(1)事件绑定
(2)路由关联
这篇关于利用低代码平台构建领域驱动设计(DDD)的解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!