This commit is contained in:
@@ -0,0 +1,461 @@
|
||||
package com.yunhai.svchall.model.svc;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 办事大厅业务模型收口(管理端/用户面 DTO 与 VO;嵌套静态类收口减少文件数)。
|
||||
* oapi(供 CMS)模型另见 model/oapi/OapiModels。
|
||||
*/
|
||||
public final class SvcModels {
|
||||
|
||||
private SvcModels() {
|
||||
}
|
||||
|
||||
// ===== 通用 =====
|
||||
|
||||
/** 删除入参(siteCode 定位站点 + id) */
|
||||
@Data
|
||||
public static class DeleteRequest {
|
||||
@NotBlank(message = "siteCode 不得为空")
|
||||
private String siteCode;
|
||||
@NotNull(message = "id 不得为空")
|
||||
private Integer id;
|
||||
}
|
||||
|
||||
/** 排序项 */
|
||||
@Data
|
||||
public static class IdSortItem {
|
||||
@NotNull(message = "id 不得为空")
|
||||
private Integer id;
|
||||
@NotNull(message = "sortNo 不得为空")
|
||||
private Integer sortNo;
|
||||
}
|
||||
|
||||
/** 站点选项(CMS 站点目录代理,管理端站点选择器) */
|
||||
@Data
|
||||
public static class SiteOptionVo {
|
||||
private String siteCode;
|
||||
private String name;
|
||||
private Long schId;
|
||||
}
|
||||
|
||||
// ===== 字典 =====
|
||||
|
||||
@Data
|
||||
public static class SvcDictSaveRequest {
|
||||
private Integer id;
|
||||
@NotBlank(message = "siteCode 不得为空")
|
||||
private String siteCode;
|
||||
@NotBlank(message = "字典类型不得为空")
|
||||
private String dictType;
|
||||
@NotBlank(message = "字典键不得为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9_-]{1,64}$", message = "字典键仅限字母/数字/下划线/中划线")
|
||||
private String dictKey;
|
||||
@NotBlank(message = "字典名称不得为空")
|
||||
@Size(max = 128, message = "字典名称过长")
|
||||
private String dictName;
|
||||
private Integer sortNo;
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcDictVo {
|
||||
private Integer id;
|
||||
private String siteCode;
|
||||
private String dictType;
|
||||
private String dictKey;
|
||||
private String dictName;
|
||||
private Integer sortNo;
|
||||
private Integer status;
|
||||
private Long referenced;
|
||||
|
||||
public static SvcDictVo of(com.yunhai.svchall.entity.ServiceDict d, Long referenced) {
|
||||
SvcDictVo vo = new SvcDictVo();
|
||||
vo.setId(d.getId());
|
||||
vo.setSiteCode(d.getSiteCode());
|
||||
vo.setDictType(d.getDictType());
|
||||
vo.setDictKey(d.getDictKey());
|
||||
vo.setDictName(d.getDictName());
|
||||
vo.setSortNo(d.getSortNo());
|
||||
vo.setStatus(d.getStatus());
|
||||
vo.setReferenced(referenced == null ? 0L : referenced);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
/** 服务部门选项(UserBase 组树嵌套下发,承袭 CMS SvcDeptVo) */
|
||||
@Data
|
||||
public static class SvcDeptVo {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private List<SvcDeptVo> children = new ArrayList<>();
|
||||
|
||||
public SvcDeptVo() {
|
||||
}
|
||||
|
||||
public SvcDeptVo(Integer id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 事项 =====
|
||||
|
||||
@Data
|
||||
public static class SvcItemPageQuery {
|
||||
@NotBlank(message = "siteCode 不得为空")
|
||||
private String siteCode;
|
||||
private Integer status;
|
||||
private String keyword;
|
||||
private String objectKey;
|
||||
private String categoryKey;
|
||||
private Integer deptGroupId;
|
||||
private Integer page = 1;
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcItemSaveRequest {
|
||||
private Integer id;
|
||||
@NotBlank(message = "siteCode 不得为空")
|
||||
private String siteCode;
|
||||
@NotBlank(message = "事项编码不得为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9_-]{2,64}$", message = "事项编码仅限字母/数字/下划线/中划线,2~64 位")
|
||||
private String itemCode;
|
||||
@NotBlank(message = "事项名称不得为空")
|
||||
@Size(max = 200, message = "事项名称过长")
|
||||
private String title;
|
||||
@Size(max = 500, message = "简介过长")
|
||||
private String summary;
|
||||
@Size(max = 64)
|
||||
private String objectKey;
|
||||
@Size(max = 64)
|
||||
private String categoryKey;
|
||||
private Integer deptGroupId;
|
||||
private Integer handleMode;
|
||||
private Integer onlineFlag;
|
||||
@Size(max = 200)
|
||||
private String handlePlace;
|
||||
@Size(max = 64)
|
||||
private String handleTimeLimit;
|
||||
@Size(max = 64)
|
||||
private String promiseTimeLimit;
|
||||
@Size(max = 64)
|
||||
private String contactPhone;
|
||||
@Size(max = 64)
|
||||
private String supervisePhone;
|
||||
private String processHtml;
|
||||
private String materialHtml;
|
||||
private String noticeHtml;
|
||||
private Integer faqCategoryId;
|
||||
private Integer noticeCategoryId;
|
||||
private Integer ruleCategoryId;
|
||||
@Size(max = 500)
|
||||
private String coverImage;
|
||||
/** 绑定自定义表单 code(可空;发起无需表单) */
|
||||
@Size(max = 64)
|
||||
private String formCode;
|
||||
/** 绑定流程中心流程 flow_guid(可空;onlineFlag=1 时必填) */
|
||||
@Size(max = 32)
|
||||
private String flowGuid;
|
||||
@Size(max = 500)
|
||||
private String applyUrl;
|
||||
private Integer sortNo;
|
||||
/** 指南附件 id 列表(保存时全量重绑 topic_type=svc_item_guide) */
|
||||
private List<Integer> attachmentIds;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcItemEditVo {
|
||||
private Integer id;
|
||||
private String siteCode;
|
||||
private String itemCode;
|
||||
private String title;
|
||||
private String summary;
|
||||
private String objectKey;
|
||||
private String categoryKey;
|
||||
private Integer deptGroupId;
|
||||
private String deptName;
|
||||
private Integer handleMode;
|
||||
private Integer onlineFlag;
|
||||
private String handlePlace;
|
||||
private String handleTimeLimit;
|
||||
private String promiseTimeLimit;
|
||||
private String contactPhone;
|
||||
private String supervisePhone;
|
||||
private String processHtml;
|
||||
private String materialHtml;
|
||||
private String noticeHtml;
|
||||
private Integer faqCategoryId;
|
||||
private Integer noticeCategoryId;
|
||||
private Integer ruleCategoryId;
|
||||
private String coverImage;
|
||||
private String formCode;
|
||||
private String flowGuid;
|
||||
private String applyUrl;
|
||||
private Integer sortNo;
|
||||
private Integer status;
|
||||
private LocalDateTime publishTime;
|
||||
private LocalDateTime offlineTime;
|
||||
private Integer viewCount;
|
||||
|
||||
public static SvcItemEditVo of(com.yunhai.svchall.entity.ServiceItem item) {
|
||||
SvcItemEditVo vo = new SvcItemEditVo();
|
||||
vo.setId(item.getId());
|
||||
vo.setSiteCode(item.getSiteCode());
|
||||
vo.setItemCode(item.getItemCode());
|
||||
vo.setTitle(item.getTitle());
|
||||
vo.setSummary(item.getSummary());
|
||||
vo.setObjectKey(item.getObjectKey());
|
||||
vo.setCategoryKey(item.getCategoryKey());
|
||||
vo.setDeptGroupId(item.getDeptGroupId());
|
||||
vo.setDeptName(item.getDeptName());
|
||||
vo.setHandleMode(item.getHandleMode());
|
||||
vo.setOnlineFlag(item.getOnlineFlag());
|
||||
vo.setHandlePlace(item.getHandlePlace());
|
||||
vo.setHandleTimeLimit(item.getHandleTimeLimit());
|
||||
vo.setPromiseTimeLimit(item.getPromiseTimeLimit());
|
||||
vo.setContactPhone(item.getContactPhone());
|
||||
vo.setSupervisePhone(item.getSupervisePhone());
|
||||
vo.setProcessHtml(item.getProcessHtml());
|
||||
vo.setMaterialHtml(item.getMaterialHtml());
|
||||
vo.setNoticeHtml(item.getNoticeHtml());
|
||||
vo.setFaqCategoryId(item.getFaqCategoryId());
|
||||
vo.setNoticeCategoryId(item.getNoticeCategoryId());
|
||||
vo.setRuleCategoryId(item.getRuleCategoryId());
|
||||
vo.setCoverImage(item.getCoverImage());
|
||||
vo.setFormCode(item.getFormCode());
|
||||
vo.setFlowGuid(item.getFlowGuid());
|
||||
vo.setApplyUrl(item.getApplyUrl());
|
||||
vo.setSortNo(item.getSortNo());
|
||||
vo.setStatus(item.getStatus());
|
||||
vo.setPublishTime(item.getPublishTime());
|
||||
vo.setOfflineTime(item.getOfflineTime());
|
||||
vo.setViewCount(item.getViewCount());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcItemPageItem {
|
||||
private Integer id;
|
||||
private String siteCode;
|
||||
private String itemCode;
|
||||
private String title;
|
||||
private String summary;
|
||||
private String objectKey;
|
||||
private String objectName;
|
||||
private String categoryKey;
|
||||
private String categoryName;
|
||||
private Integer deptGroupId;
|
||||
private String deptName;
|
||||
private Integer handleMode;
|
||||
private Integer onlineFlag;
|
||||
private String formCode;
|
||||
private String flowGuid;
|
||||
private Integer status;
|
||||
private Integer sortNo;
|
||||
private LocalDateTime publishTime;
|
||||
private Integer viewCount;
|
||||
private LocalDateTime createTime;
|
||||
private String createBy;
|
||||
|
||||
public static SvcItemPageItem of(com.yunhai.svchall.entity.ServiceItem item, String objectName,
|
||||
String categoryName) {
|
||||
SvcItemPageItem vo = new SvcItemPageItem();
|
||||
vo.setId(item.getId());
|
||||
vo.setSiteCode(item.getSiteCode());
|
||||
vo.setItemCode(item.getItemCode());
|
||||
vo.setTitle(item.getTitle());
|
||||
vo.setSummary(item.getSummary());
|
||||
vo.setObjectKey(item.getObjectKey());
|
||||
vo.setObjectName(objectName);
|
||||
vo.setCategoryKey(item.getCategoryKey());
|
||||
vo.setCategoryName(categoryName);
|
||||
vo.setDeptGroupId(item.getDeptGroupId());
|
||||
vo.setDeptName(item.getDeptName());
|
||||
vo.setHandleMode(item.getHandleMode());
|
||||
vo.setOnlineFlag(item.getOnlineFlag());
|
||||
vo.setFormCode(item.getFormCode());
|
||||
vo.setFlowGuid(item.getFlowGuid());
|
||||
vo.setStatus(item.getStatus());
|
||||
vo.setSortNo(item.getSortNo());
|
||||
vo.setPublishTime(item.getPublishTime());
|
||||
vo.setViewCount(item.getViewCount());
|
||||
vo.setCreateTime(item.getCreateTime());
|
||||
vo.setCreateBy(item.getCreateBy());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcItemSimpleVo {
|
||||
private Integer id;
|
||||
private String itemCode;
|
||||
private String title;
|
||||
private Integer status;
|
||||
|
||||
public static SvcItemSimpleVo of(com.yunhai.svchall.entity.ServiceItem item) {
|
||||
SvcItemSimpleVo vo = new SvcItemSimpleVo();
|
||||
vo.setId(item.getId());
|
||||
vo.setItemCode(item.getItemCode());
|
||||
vo.setTitle(item.getTitle());
|
||||
vo.setStatus(item.getStatus());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcItemAttachmentVo {
|
||||
private Integer id;
|
||||
private String fileName;
|
||||
private String fileUrl;
|
||||
private Long fileSize;
|
||||
|
||||
public static SvcItemAttachmentVo of(com.yunhai.svchall.entity.ServiceAttachment a) {
|
||||
SvcItemAttachmentVo vo = new SvcItemAttachmentVo();
|
||||
vo.setId(a.getId());
|
||||
vo.setFileName(a.getFileName());
|
||||
vo.setFileUrl(com.yunhai.svchall.utils.FileUtil.buildUrl(a.getFileUrl()));
|
||||
vo.setFileSize(a.getFileSize());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 表单 =====
|
||||
|
||||
@Data
|
||||
public static class SvcFormSaveRequest {
|
||||
private Integer id;
|
||||
@NotBlank(message = "表单编码不得为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9_-]{2,64}$", message = "表单编码仅限字母/数字/下划线/中划线,2~64 位")
|
||||
private String code;
|
||||
@NotBlank(message = "表单名称不得为空")
|
||||
@Size(max = 128, message = "表单名称过长")
|
||||
private String name;
|
||||
@NotBlank(message = "表单结构不得为空")
|
||||
private String schemaJson;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SvcFormVo {
|
||||
private Integer id;
|
||||
private String code;
|
||||
private String name;
|
||||
private Integer version;
|
||||
private Integer status;
|
||||
private String schemaJson;
|
||||
private LocalDateTime publishTime;
|
||||
private Boolean referenced;
|
||||
|
||||
public static SvcFormVo of(com.yunhai.svchall.entity.ServiceForm form, Boolean referenced) {
|
||||
SvcFormVo vo = new SvcFormVo();
|
||||
vo.setId(form.getId());
|
||||
vo.setCode(form.getCode());
|
||||
vo.setName(form.getName());
|
||||
vo.setVersion(form.getVersion());
|
||||
vo.setStatus(form.getStatus());
|
||||
vo.setSchemaJson(form.getSchemaJson());
|
||||
vo.setPublishTime(form.getPublishTime());
|
||||
vo.setReferenced(referenced);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 办件 =====
|
||||
|
||||
/** 申请级材料项(无表单事项的附件;先经 /api/file/upload 上传,再携 attachmentId 绑定) */
|
||||
@Data
|
||||
public static class ApplyAttachmentItem {
|
||||
/** 表单/材料字段标识(可空) */
|
||||
private String fieldKey;
|
||||
/** 上传接口返回的附件行 id */
|
||||
@NotNull(message = "attachmentId 不得为空")
|
||||
private Integer attachmentId;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApplySubmitRequest {
|
||||
@NotBlank(message = "siteCode 不得为空")
|
||||
private String siteCode;
|
||||
@NotBlank(message = "itemCode 不得为空")
|
||||
private String itemCode;
|
||||
/** 表单数据 JSON 字符串({key:value};无表单事项传空) */
|
||||
private String formData;
|
||||
/** 申请级材料(可空) */
|
||||
private List<ApplyAttachmentItem> attachments;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApplyVo {
|
||||
private Integer id;
|
||||
private String siteCode;
|
||||
private Integer itemId;
|
||||
private String itemCode;
|
||||
private String itemTitle;
|
||||
private String itemSnapshotJson;
|
||||
private Integer formVersion;
|
||||
private String formDataJson;
|
||||
private String attachmentsJson;
|
||||
private Integer submitterId;
|
||||
private String submitterName;
|
||||
private String flowGuid;
|
||||
private Long flowInstanceId;
|
||||
private Integer flowStatus;
|
||||
private String flowResultJson;
|
||||
private LocalDateTime submitTime;
|
||||
private LocalDateTime finishTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
public static ApplyVo of(com.yunhai.svchall.entity.ServiceApply a) {
|
||||
ApplyVo vo = new ApplyVo();
|
||||
vo.setId(a.getId());
|
||||
vo.setSiteCode(a.getSiteCode());
|
||||
vo.setItemId(a.getItemId());
|
||||
vo.setItemCode(a.getItemCode());
|
||||
vo.setItemTitle(a.getItemTitle());
|
||||
vo.setItemSnapshotJson(a.getItemSnapshotJson());
|
||||
vo.setFormVersion(a.getFormVersion());
|
||||
vo.setFormDataJson(a.getFormDataJson());
|
||||
vo.setAttachmentsJson(a.getAttachmentsJson());
|
||||
vo.setSubmitterId(a.getSubmitterId());
|
||||
vo.setSubmitterName(a.getSubmitterName());
|
||||
vo.setFlowGuid(a.getFlowGuid());
|
||||
vo.setFlowInstanceId(a.getFlowInstanceId());
|
||||
vo.setFlowStatus(a.getFlowStatus());
|
||||
vo.setFlowResultJson(a.getFlowResultJson());
|
||||
vo.setSubmitTime(a.getSubmitTime());
|
||||
vo.setFinishTime(a.getFinishTime());
|
||||
vo.setCreateTime(a.getCreateTime());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApplyPageQuery {
|
||||
private String siteCode;
|
||||
private String itemCode;
|
||||
private Integer flowStatus;
|
||||
private String keyword;
|
||||
private Integer page = 1;
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
|
||||
// ===== 流程(管理端回显) =====
|
||||
|
||||
@Data
|
||||
public static class FlowSummaryVo {
|
||||
private String flowGuid;
|
||||
private String name;
|
||||
private Integer version;
|
||||
private String nodeSummary;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user