Commit 63ed2c20 authored by 赵啸非's avatar 赵啸非

修改子证字段

parent e732db24
......@@ -6,90 +6,40 @@ CREATE TABLE `mortals_xhx_child_license` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`siteId` bigint(20) DEFAULT NULL COMMENT '站点Id',
`siteName` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '站点名称',
`catalogId` bigint(20) DEFAULT NULL COMMENT '目录id',
`catalogName` varchar(64) DEFAULT NULL COMMENT '目录名称',
`applyId` bigint(20) DEFAULT NULL COMMENT '申请Id',
`documentId` bigint(20) DEFAULT NULL COMMENT '子证配置Id',
`documentName` varchar(128) NOT NULL COMMENT '子证名称',
`deptId` bigint(20) NOT NULL COMMENT '部门id',
`deptName` varchar(128) NOT NULL COMMENT '部门名称',
`marketEntityName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '市场主体名称',
`licenseCode` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '许可证编号',
`legalPersonName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '法定代表人(负责人)',
`creditCode` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '统一社会信用代码',
`productLicenseTime` datetime(0) NULL DEFAULT NULL COMMENT '制证日期',
`productLicenseTime` datetime NULL DEFAULT NULL COMMENT '制证日期',
`certQRCode` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '证件二维码',
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址',
`certAuthority` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '制证机关',
`businessPlace` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '经营场所',
`licensedItems` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '许可项目',
`fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
`filePath` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件相对路径地址',
`originalFileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '正本文件名称',
`originalFilePath` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '正本文件相对路径地址',
`copyFileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '副本文件名称',
`copyFilePath` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '副本文件相对路径地址',
`summary` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介',
`formStyleContent` mediumtext COMMENT '动态表单样式',
`formContent` mediumtext COMMENT '提交的表单',
`processStatus` tinyint(2) DEFAULT '0' COMMENT '处理状态(0.未处理,1.已处理)',
`remark` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`updateUserId` bigint(20) DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
`updateTime` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `siteId` (`siteId`) USING BTREE,
KEY `catalogId` (`catalogId`) USING BTREE,
KEY `applyId` (`applyId`) USING BTREE,
KEY `documentId` (`documentId`) USING BTREE,
KEY `deptId` (`deptId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '行业许可子证' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `mortals_xhx_child_license_dataset`;
CREATE TABLE `mortals_xhx_child_license_dataset` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`subLicenseId` bigint(20) NULL DEFAULT NULL COMMENT '许可子证Id',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `subLicenseId` (`subLicenseId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '行业许可子证数据集' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `mortals_xhx_child_license_info_field`;
CREATE TABLE `mortals_xhx_child_license_info_field` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`datasetId` bigint(20) NOT NULL COMMENT '子证数据集Id',
`fieldCode` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段编码',
`fieldName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段名称',
`fieldType` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)',
`fieldTypeValue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字段类型值,当字段类型为多选,单选时候,预设复选值',
`dataType` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'string' COMMENT '数据类型(number.数字,string.字符串)',
`fieldValue` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '字段值',
`defaultValue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字段默认值',
`fieldLen` int(9) NULL DEFAULT '128' COMMENT '数据长度,默认128',
`fieldNull` tinyint(2) NULL DEFAULT '1' COMMENT '是否允许为空,(0.否,1.是)',
`isList` tinyint(2) NULL DEFAULT '0' COMMENT '字段是否列表显示(0.否,1.是)',
`fieldOrderNo` int(9) NULL DEFAULT '0' COMMENT '排序号',
`serviceApi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '事件服务接口请求地址',
`serviceApiParams` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '事件服务接口请求参数',
`remark` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`updateUserId` bigint(20) NULL DEFAULT NULL COMMENT '修改用户',
PRIMARY KEY (`id`) USING BTREE,
KEY `datasetId` (`datasetId`) USING BTREE,
KEY `fieldCode` (`fieldCode`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '行业许可子证信息字段' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `mortals_xhx_child_license_templete_field`;
CREATE TABLE `mortals_xhx_child_license_templete_field` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`subLicenseId` bigint(20) NULL DEFAULT NULL COMMENT '许可子证Id',
`fieldCode` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段编码',
`fieldName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段名称',
`fieldType` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框,editer.富文本)',
`fieldTypeValue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段类型值,当字段类型为多选,单选时候,预设复选值',
`dataType` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'string' COMMENT '数据类型(number.数字,string.字符串)',
`fieldValue` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段值',
`defaultValue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字段默认值',
`fieldLen` int(9) DEFAULT '128' COMMENT '数据长度,默认128',
`fieldNull` tinyint(2) DEFAULT '1' COMMENT '是否允许为空,(0.否,1.是)',
`isList` tinyint(2) DEFAULT '0' COMMENT '字段是否列表显示(0.否,1.是)',
`fieldOrderNo` int(9) DEFAULT '0' COMMENT '排序号',
`serviceApi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '事件服务接口请求地址',
`serviceApiParams` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '事件服务接口请求参数',
`remark` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注',
`createTime` datetime(0) NOT NULL COMMENT '创建时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`updateTime` datetime(0) DEFAULT NULL COMMENT '修改时间',
`updateUserId` bigint(20) DEFAULT NULL COMMENT '修改用户',
PRIMARY KEY (`id`) USING BTREE,
KEY `subLicenseId` (`subLicenseId`) USING BTREE,
KEY `fieldCode` (`fieldCode`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '行业许可子证模板信息字段' ROW_FORMAT = Dynamic;
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 处理状态(0.未处理,1.已处理)枚举类
*
* @author zxfei
*/
public enum ProcessStatusEnum {
未处理(0, "未处理"),
已处理(1, "已处理");
private Integer value;
private String desc;
ProcessStatusEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static ProcessStatusEnum getByValue(Integer value) {
for (ProcessStatusEnum processStatusEnum : ProcessStatusEnum.values()) {
if (processStatusEnum.getValue() == value) {
return processStatusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (ProcessStatusEnum item : ProcessStatusEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import java.util.List;
* 行业许可子证 DAO接口
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
public interface ChildLicenseDao extends ICRUDDao<ChildLicenseEntity,Long>{
......
package com.mortals.xhx.module.child.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import java.util.List;
/**
* 行业许可子证数据集Dao
* 行业许可子证数据集 DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseDatasetDao extends ICRUDDao<ChildLicenseDatasetEntity, Long> {
String SQLID_CUSTOM_LIST = "getCustomList";
String SQLID_CUSTOM_COUNT = "getCustomListCount";
Result<ChildLicenseInfoFieldEntity> getCustomList(ChildLicenseDatasetQuery appDatasetQuery, PageInfo pageInfo);
}
package com.mortals.xhx.module.child.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import java.util.List;
/**
* 行业许可子证信息字段Dao
* 行业许可子证信息字段 DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseInfoFieldDao extends ICRUDDao<ChildLicenseInfoFieldEntity,Long>{
}
package com.mortals.xhx.module.child.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.child.model.ChildLicenseTempleteFieldEntity;
import java.util.List;
/**
* 行业许可子证模板信息字段Dao
* 行业许可子证模板信息字段 DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseTempleteFieldDao extends ICRUDDao<ChildLicenseTempleteFieldEntity,Long>{
}
......@@ -11,7 +11,7 @@ import java.util.List;
* 行业许可子证DaoImpl DAO接口
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
@Repository("childLicenseDao")
public class ChildLicenseDaoImpl extends BaseCRUDDaoMybatis<ChildLicenseEntity,Long> implements ChildLicenseDao {
......
package com.mortals.xhx.module.child.dao.ibatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.child.dao.ChildLicenseDatasetDao;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import java.util.ArrayList;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 行业许可子证数据集DaoImpl DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
@Repository("childLicenseDatasetDao")
public class ChildLicenseDatasetDaoImpl extends BaseCRUDDaoMybatis<ChildLicenseDatasetEntity, Long> implements ChildLicenseDatasetDao {
@Override
public Result<ChildLicenseInfoFieldEntity> getCustomList(ChildLicenseDatasetQuery appDatasetQuery, PageInfo pageInfo) {
Result<ChildLicenseInfoFieldEntity> result = new Result();
ParamDto paramDto = this.getQueryParam(appDatasetQuery);
int count = this.getCustomCount(paramDto);
List list = null;
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
} else {
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList(list);
return result;
}
public int getCustomCount(ParamDto paramDto) {
return this.getSqlSession().selectOne(this.getSqlId(SQLID_CUSTOM_COUNT), this.cpyQueryParamDto(paramDto));
}
}
package com.mortals.xhx.module.child.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.child.dao.ChildLicenseInfoFieldDao;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 行业许可子证信息字段DaoImpl DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
@Repository("childLicenseInfoFieldDao")
public class ChildLicenseInfoFieldDaoImpl extends BaseCRUDDaoMybatis<ChildLicenseInfoFieldEntity,Long> implements ChildLicenseInfoFieldDao {
}
package com.mortals.xhx.module.child.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.child.dao.ChildLicenseTempleteFieldDao;
import com.mortals.xhx.module.child.model.ChildLicenseTempleteFieldEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 行业许可子证模板信息字段DaoImpl DAO接口
*
* @author zxfei
* @date 2024-07-27
*/
@Repository("childLicenseTempleteFieldDao")
public class ChildLicenseTempleteFieldDaoImpl extends BaseCRUDDaoMybatis<ChildLicenseTempleteFieldEntity,Long> implements ChildLicenseTempleteFieldDao {
}
package com.mortals.xhx.module.child.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.child.model.vo.ChildLicenseDatasetVo;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import lombok.Data;
/**
* 行业许可子证数据集实体对象
*
* @author zxfei
* @date 2024-07-27
*/
@Data
public class ChildLicenseDatasetEntity extends ChildLicenseDatasetVo {
private static final long serialVersionUID = 1L;
/**
* 许可子证Id
*/
private Long subLicenseId;
/**
* 行业许可子证信息字段信息
*/
private List<ChildLicenseInfoFieldEntity> childLicenseInfoFieldList=new ArrayList<>();;
public List<ChildLicenseInfoFieldEntity> getChildLicenseInfoFieldList(){
return childLicenseInfoFieldList;
}
public void setChildLicenseInfoFieldList(List<ChildLicenseInfoFieldEntity> childLicenseInfoFieldList){
this.childLicenseInfoFieldList = childLicenseInfoFieldList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ChildLicenseDatasetEntity) {
ChildLicenseDatasetEntity tmp = (ChildLicenseDatasetEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.subLicenseId = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.model;
import java.util.List;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
......@@ -10,96 +9,128 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.child.model.vo.ChildLicenseVo;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import lombok.Data;
/**
* 行业许可子证实体对象
*
* @author zxfei
* @date 2024-07-27
*/
* 行业许可子证实体对象
*
* @author zxfei
* @date 2024-07-28
*/
@Data
public class ChildLicenseEntity extends ChildLicenseVo {
private static final long serialVersionUID = 1L;
/**
* 市场主体名称
*/
* 站点Id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 目录id
*/
private Long catalogId;
/**
* 目录名称
*/
private String catalogName;
/**
* 申请Id
*/
private Long applyId;
/**
* 子证配置Id
*/
private Long documentId;
/**
* 子证名称
*/
private String documentName;
/**
* 部门id
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 市场主体名称
*/
private String marketEntityName;
/**
* 许可证编号
*/
* 许可证编号
*/
private String licenseCode;
/**
* 法定代表人(负责人)
*/
* 法定代表人(负责人)
*/
private String legalPersonName;
/**
* 统一社会信用代码
*/
* 统一社会信用代码
*/
private String creditCode;
/**
* 制证日期
*/
* 制证日期
*/
private Date productLicenseTime;
/**
* 证件二维码
*/
* 证件二维码
*/
private String certQRCode;
/**
* 链接地址
*/
private String url;
/**
* 制证机关
*/
* 制证机关
*/
private String certAuthority;
/**
* 经营场所
*/
* 经营场所
*/
private String businessPlace;
/**
* 许可项目
*/
* 许可项目
*/
private String licensedItems;
/**
* 文件名称
*/
private String fileName;
* 正本文件名称
*/
private String originalFileName;
/**
* 正本文件相对路径地址
*/
private String originalFilePath;
/**
* 文件相对路径地址
*/
private String filePath;
* 副本文件名称
*/
private String copyFileName;
/**
* 简介
*/
* 副本文件相对路径地址
*/
private String copyFilePath;
/**
* 简介
*/
private String summary;
/**
* 备注
*/
private String remark;
* 动态表单样式
*/
private String formStyleContent;
/**
* 站点Id
*/
private Long siteId;
* 提交的表单
*/
private String formContent;
/**
* 站点名称
*/
private String siteName;
* 处理状态(0.未处理,1.已处理)
*/
private Integer processStatus;
/**
* 行业许可子证数据集信息
*/
private List<ChildLicenseDatasetEntity> childLicenseDatasetList=new ArrayList<>();;
public List<ChildLicenseDatasetEntity> getChildLicenseDatasetList(){
return childLicenseDatasetList;
}
public void setChildLicenseDatasetList(List<ChildLicenseDatasetEntity> childLicenseDatasetList){
this.childLicenseDatasetList = childLicenseDatasetList;
}
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -107,28 +138,39 @@ public class ChildLicenseEntity extends ChildLicenseVo {
if (obj instanceof ChildLicenseEntity) {
ChildLicenseEntity tmp = (ChildLicenseEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public void initAttrValue(){
this.marketEntityName = "";
this.licenseCode = "";
this.legalPersonName = "";
this.creditCode = "";
this.productLicenseTime = null;
this.certQRCode = "";
this.url = "";
this.certAuthority = "";
this.businessPlace = "";
this.licensedItems = "";
this.fileName = "";
this.filePath = "";
this.summary = "";
this.remark = "";
this.siteId = null;
this.siteName = "";
this.siteId = null;
this.siteName = "";
this.catalogId = null;
this.catalogName = "";
this.applyId = null;
this.documentId = null;
this.documentName = "";
this.deptId = null;
this.deptName = "";
this.marketEntityName = "";
this.licenseCode = "";
this.legalPersonName = "";
this.creditCode = "";
this.productLicenseTime = null;
this.certQRCode = "";
this.certAuthority = "";
this.businessPlace = "";
this.licensedItems = "";
this.originalFileName = "";
this.originalFilePath = "";
this.copyFileName = "";
this.copyFilePath = "";
this.summary = "";
this.formStyleContent = "";
this.formContent = "";
this.processStatus = 0;
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.child.model.vo.ChildLicenseInfoFieldVo;
import lombok.Data;
/**
* 行业许可子证信息字段实体对象
*
* @author zxfei
* @date 2024-07-27
*/
@Data
public class ChildLicenseInfoFieldEntity extends ChildLicenseInfoFieldVo {
private static final long serialVersionUID = 1L;
/**
* 子证数据集Id
*/
private Long datasetId;
/**
* 字段编码
*/
private String fieldCode;
/**
* 字段名称
*/
private String fieldName;
/**
* 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
*/
private String fieldType;
/**
* 字段类型值,当字段类型为多选,单选时候,预设复选值
*/
private String fieldTypeValue;
/**
* 数据类型(number.数字,string.字符串)
*/
private String dataType;
/**
* 字段值
*/
private String fieldValue;
/**
* 字段默认值
*/
private String defaultValue;
/**
* 数据长度,默认128
*/
private Integer fieldLen;
/**
* 是否允许为空,(0.否,1.是)
*/
private Integer fieldNull;
/**
* 字段是否列表显示(0.否,1.是)
*/
private Integer isList;
/**
* 排序号
*/
private Integer fieldOrderNo;
/**
* 事件服务接口请求地址
*/
private String serviceApi;
/**
* 事件服务接口请求参数
*/
private String serviceApiParams;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ChildLicenseInfoFieldEntity) {
ChildLicenseInfoFieldEntity tmp = (ChildLicenseInfoFieldEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.datasetId = null;
this.fieldCode = "";
this.fieldName = "";
this.fieldType = "";
this.fieldTypeValue = "";
this.dataType = "string";
this.fieldValue = "";
this.defaultValue = "";
this.fieldLen = 128;
this.fieldNull = 1;
this.isList = 0;
this.fieldOrderNo = 0;
this.serviceApi = "";
this.serviceApiParams = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.child.model.vo.ChildLicenseTempleteFieldVo;
import lombok.Data;
/**
* 行业许可子证模板信息字段实体对象
*
* @author zxfei
* @date 2024-07-27
*/
@Data
public class ChildLicenseTempleteFieldEntity extends ChildLicenseTempleteFieldVo {
private static final long serialVersionUID = 1L;
/**
* 许可子证Id
*/
private Long subLicenseId;
/**
* 字段编码
*/
private String fieldCode;
/**
* 字段名称
*/
private String fieldName;
/**
* 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框,editer.富文本)
*/
private String fieldType;
/**
* 字段类型值,当字段类型为多选,单选时候,预设复选值
*/
private String fieldTypeValue;
/**
* 数据类型(number.数字,string.字符串)
*/
private String dataType;
/**
* 字段值
*/
private String fieldValue;
/**
* 字段默认值
*/
private String defaultValue;
/**
* 数据长度,默认128
*/
private Integer fieldLen;
/**
* 是否允许为空,(0.否,1.是)
*/
private Integer fieldNull;
/**
* 字段是否列表显示(0.否,1.是)
*/
private Integer isList;
/**
* 排序号
*/
private Integer fieldOrderNo;
/**
* 事件服务接口请求地址
*/
private String serviceApi;
/**
* 事件服务接口请求参数
*/
private String serviceApiParams;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ChildLicenseTempleteFieldEntity) {
ChildLicenseTempleteFieldEntity tmp = (ChildLicenseTempleteFieldEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.subLicenseId = null;
this.fieldCode = "";
this.fieldName = "";
this.fieldType = "";
this.fieldTypeValue = "";
this.dataType = "string";
this.fieldValue = "";
this.defaultValue = "";
this.fieldLen = 128;
this.fieldNull = 1;
this.isList = 0;
this.fieldOrderNo = 0;
this.serviceApi = "";
this.serviceApiParams = "";
this.remark = "";
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ import java.util.Date;
* 行业许可子证视图对象
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
@Data
public class ChildLicenseVo extends BaseEntityLong {
......@@ -19,8 +19,5 @@ public class ChildLicenseVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/**
* 站点列表
*/
private List<Long> siteIdList;
}
\ No newline at end of file
package com.mortals.xhx.module.child.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import com.mortals.xhx.module.child.dao.ChildLicenseDatasetDao;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
/**
* ChildLicenseDatasetService
*
* 行业许可子证数据集 service接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseDatasetService extends ICRUDService<ChildLicenseDatasetEntity,Long>{
ChildLicenseDatasetDao getDao();
Result<ChildLicenseInfoFieldEntity> findCustomList(ChildLicenseDatasetQuery appDatasetQuery, PageInfo pageInfo, Context context) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.child.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import com.mortals.xhx.module.child.dao.ChildLicenseInfoFieldDao;
/**
* ChildLicenseInfoFieldService
*
* 行业许可子证信息字段 service接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseInfoFieldService extends ICRUDService<ChildLicenseInfoFieldEntity,Long>{
ChildLicenseInfoFieldDao getDao();
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import com.mortals.xhx.module.child.dao.ChildLicenseDao;
* 行业许可子证 service接口
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
public interface ChildLicenseService extends ICRUDService<ChildLicenseEntity,Long>{
......
package com.mortals.xhx.module.child.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.child.model.ChildLicenseTempleteFieldEntity;
import com.mortals.xhx.module.child.dao.ChildLicenseTempleteFieldDao;
/**
* ChildLicenseTempleteFieldService
*
* 行业许可子证模板信息字段 service接口
*
* @author zxfei
* @date 2024-07-27
*/
public interface ChildLicenseTempleteFieldService extends ICRUDService<ChildLicenseTempleteFieldEntity,Long>{
ChildLicenseTempleteFieldDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.child.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import org.springframework.beans.BeanUtils;
import java.util.Map;
import java.util.function.Function;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.child.dao.ChildLicenseDatasetDao;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import com.mortals.xhx.module.child.service.ChildLicenseDatasetService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldQuery;
import com.mortals.xhx.module.child.service.ChildLicenseInfoFieldService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* ChildLicenseDatasetService
* 行业许可子证数据集 service实现
*
* @author zxfei
* @date 2024-07-27
*/
@Service("childLicenseDatasetService")
@Slf4j
public class ChildLicenseDatasetServiceImpl extends AbstractCRUDServiceImpl<ChildLicenseDatasetDao, ChildLicenseDatasetEntity, Long> implements ChildLicenseDatasetService {
@Autowired
private ChildLicenseInfoFieldService childLicenseInfoFieldService;
@Override
protected void findAfter(ChildLicenseDatasetEntity params,PageInfo pageInfo, Context context, List<ChildLicenseDatasetEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params,pageInfo, context, list);
}
@Override
protected void findAfter(ChildLicenseDatasetEntity params, Context context, List<ChildLicenseDatasetEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params, context, list);
}
private void fillSubData(List<ChildLicenseDatasetEntity> list) {
List<Long> idList = list.stream().map(i -> i.getId()).collect(Collectors.toList());
ChildLicenseInfoFieldQuery childLicenseInfoFieldQuery = new ChildLicenseInfoFieldQuery();
childLicenseInfoFieldQuery.setDatasetIdList(idList);
Map<Long, List<ChildLicenseInfoFieldEntity>> childLicenseInfoFieldListMap = childLicenseInfoFieldService.find(childLicenseInfoFieldQuery).stream().collect(Collectors.groupingBy(ChildLicenseInfoFieldEntity::getDatasetId));
list.forEach(item -> item.setChildLicenseInfoFieldList(childLicenseInfoFieldListMap.get(item.getId())));
}
@Override
protected void saveAfter(ChildLicenseDatasetEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getChildLicenseInfoFieldList())){
entity.getChildLicenseInfoFieldList().stream().peek(item->{
item.setDatasetId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
childLicenseInfoFieldService.save(entity.getChildLicenseInfoFieldList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(ChildLicenseDatasetEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getChildLicenseInfoFieldList())){
Long[] childLicenseInfoFieldIds = childLicenseInfoFieldService.find(new ChildLicenseInfoFieldQuery().datasetId(entity.getId())).stream().map(ChildLicenseInfoFieldEntity::getId).toArray(Long[]::new);
childLicenseInfoFieldService.remove(childLicenseInfoFieldIds,context);
entity.getChildLicenseInfoFieldList().stream().peek(item ->{
item.setDatasetId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
childLicenseInfoFieldService.save(entity.getChildLicenseInfoFieldList());
}
super.updateAfter(entity, context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<ChildLicenseInfoFieldEntity> childLicenseInfoFieldlist = childLicenseInfoFieldService.find(new ChildLicenseInfoFieldQuery().datasetIdList(Arrays.asList(ids)));
childLicenseInfoFieldService.removeList(childLicenseInfoFieldlist,context);
super.removeAfter(ids, context, result);
}
@Override
public Result<ChildLicenseInfoFieldEntity> findCustomList(ChildLicenseDatasetQuery appDatasetQuery, PageInfo pageInfo, Context context) throws AppException {
return this.dao.getCustomList(appDatasetQuery, pageInfo);
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.service.impl;
import org.springframework.beans.BeanUtils;
import java.util.function.Function;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.child.dao.ChildLicenseInfoFieldDao;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import com.mortals.xhx.module.child.service.ChildLicenseInfoFieldService;
import lombok.extern.slf4j.Slf4j;
/**
* ChildLicenseInfoFieldService
* 行业许可子证信息字段 service实现
*
* @author zxfei
* @date 2024-07-27
*/
@Service("childLicenseInfoFieldService")
@Slf4j
public class ChildLicenseInfoFieldServiceImpl extends AbstractCRUDServiceImpl<ChildLicenseInfoFieldDao, ChildLicenseInfoFieldEntity, Long> implements ChildLicenseInfoFieldService {
}
\ No newline at end of file
package com.mortals.xhx.module.child.service.impl;
import com.mortals.framework.model.PageInfo;
import org.springframework.beans.BeanUtils;
import java.util.Map;
import java.util.function.Function;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
......@@ -11,84 +8,16 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.child.dao.ChildLicenseDao;
import com.mortals.xhx.module.child.model.ChildLicenseEntity;
import com.mortals.xhx.module.child.service.ChildLicenseService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import com.mortals.xhx.module.child.service.ChildLicenseDatasetService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* ChildLicenseService
* 行业许可子证 service实现
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
@Service("childLicenseService")
@Slf4j
public class ChildLicenseServiceImpl extends AbstractCRUDServiceImpl<ChildLicenseDao, ChildLicenseEntity, Long> implements ChildLicenseService {
@Autowired
private ChildLicenseDatasetService childLicenseDatasetService;
@Override
protected void findAfter(ChildLicenseEntity params, PageInfo pageInfo, Context context, List<ChildLicenseEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params,pageInfo, context, list);
}
@Override
protected void findAfter(ChildLicenseEntity params, Context context, List<ChildLicenseEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params, context, list);
}
private void fillSubData(List<ChildLicenseEntity> list) {
List<Long> idList = list.stream().map(i -> i.getId()).collect(Collectors.toList());
ChildLicenseDatasetQuery childLicenseDatasetQuery = new ChildLicenseDatasetQuery();
childLicenseDatasetQuery.setSubLicenseIdList(idList);
Map<Long, List<ChildLicenseDatasetEntity>> childLicenseDatasetListMap = childLicenseDatasetService.find(childLicenseDatasetQuery).stream().collect(Collectors.groupingBy(ChildLicenseDatasetEntity::getSubLicenseId));
list.forEach(item -> item.setChildLicenseDatasetList(childLicenseDatasetListMap.get(item.getId())));
}
@Override
protected void saveAfter(ChildLicenseEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getChildLicenseDatasetList())){
entity.getChildLicenseDatasetList().stream().peek(item->{
item.setSubLicenseId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
childLicenseDatasetService.save(entity.getChildLicenseDatasetList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(ChildLicenseEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getChildLicenseDatasetList())){
Long[] childLicenseDatasetIds = childLicenseDatasetService.find(new ChildLicenseDatasetQuery().subLicenseId(entity.getId())).stream().map(ChildLicenseDatasetEntity::getId).toArray(Long[]::new);
childLicenseDatasetService.remove(childLicenseDatasetIds,context);
entity.getChildLicenseDatasetList().stream().peek(item ->{
item.setSubLicenseId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
childLicenseDatasetService.save(entity.getChildLicenseDatasetList());
}
super.updateAfter(entity, context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<ChildLicenseDatasetEntity> childLicenseDatasetlist = childLicenseDatasetService.find(new ChildLicenseDatasetQuery().subLicenseIdList(Arrays.asList(ids)));
childLicenseDatasetService.removeList(childLicenseDatasetlist,context);
super.removeAfter(ids, context, result);
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.service.impl;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.child.model.*;
import com.mortals.xhx.module.child.service.ChildLicenseDatasetService;
import com.mortals.xhx.module.child.service.ChildLicenseInfoFieldService;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.child.dao.ChildLicenseTempleteFieldDao;
import com.mortals.xhx.module.child.service.ChildLicenseTempleteFieldService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
/**
* ChildLicenseTempleteFieldService
* 行业许可子证模板信息字段 service实现
*
* @author zxfei
* @date 2024-07-27
*/
@Service("childLicenseTempleteFieldService")
@Slf4j
public class ChildLicenseTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<ChildLicenseTempleteFieldDao, ChildLicenseTempleteFieldEntity, Long> implements ChildLicenseTempleteFieldService {
@Autowired
private ChildLicenseDatasetService childLicenseDatasetService;
@Autowired
private ChildLicenseInfoFieldService childLicenseInfoFieldService;
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void saveAfter(ChildLicenseTempleteFieldEntity entity, Context context) throws AppException {
//同步添加已有模板数据
ChildLicenseDatasetQuery appDatasetQuery = new ChildLicenseDatasetQuery();
appDatasetQuery.setAppId(entity.getSubLicenseId());
List<ChildLicenseDatasetEntity> childLicenseDatasetEntities = childLicenseDatasetService.find(appDatasetQuery, context);
// 判断该数据集 是否已经存在 没存在 再添加
ArrayList<ChildLicenseInfoFieldEntity> fieldSaveList = new ArrayList<>();
for (ChildLicenseDatasetEntity childLicenseDatasetEntity : childLicenseDatasetEntities) {
ChildLicenseInfoFieldQuery appInfoFieldQuery = new ChildLicenseInfoFieldQuery();
appInfoFieldQuery.setDatasetId(childLicenseDatasetEntity.getId());
appInfoFieldQuery.setFieldCode(entity.getFieldCode());
appInfoFieldQuery.setFieldType(entity.getFieldType());
ChildLicenseInfoFieldEntity childLicenseInfoFieldEntity = childLicenseInfoFieldService.selectOne(appInfoFieldQuery, context);
if (ObjectUtils.isEmpty(childLicenseInfoFieldEntity)) {
ChildLicenseInfoFieldEntity fieldEntity = new ChildLicenseInfoFieldEntity();
fieldEntity.initAttrValue();
BeanUtils.copyProperties(entity, fieldEntity, BeanUtil.getNullPropertyNames(entity));
fieldEntity.setDatasetId(childLicenseDatasetEntity.getId());
fieldEntity.setId(null);
fieldSaveList.add(fieldEntity);
}
}
if (!ObjectUtils.isEmpty(fieldSaveList)) {
childLicenseInfoFieldService.save(fieldSaveList, context);
}
super.saveAfter(entity, context);
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ import com.mortals.xhx.common.code.*;
* 行业许可子证
*
* @author zxfei
* @date 2024-07-27
* @date 2024-07-28
*/
@RestController
@RequestMapping("child/license")
......@@ -44,6 +44,7 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "legalPersonName", LegalPersonNameEnum.getEnumMap());
this.addDict(model, "processStatus", ProcessStatusEnum.getEnumMap());
super.init(model, context);
}
......
package com.mortals.xhx.module.child.web;
import cn.hutool.core.collection.ListUtil;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetQuery;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.child.model.ChildLicenseDatasetEntity;
import com.mortals.xhx.module.child.service.ChildLicenseDatasetService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 行业许可子证数据集
*
* @author zxfei
* @date 2024-07-27
*/
@RestController
@RequestMapping("child/license/dataset")
public class ChildLicenseDatasetController extends BaseCRUDJsonBodyMappingController<ChildLicenseDatasetService,ChildLicenseDatasetEntity,Long> {
@Autowired
private ParamService paramService;
public ChildLicenseDatasetController(){
super.setModuleDesc( "行业许可子证数据集");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
@Override
protected void doListBefore(ChildLicenseDatasetEntity query, Map<String, Object> model, Context context) throws AppException {
if (!ObjectUtils.isEmpty(query.getOrConditionList()) || !ObjectUtils.isEmpty(query.getAndConditionList())) {
ChildLicenseDatasetQuery appDatasetQuery = new ChildLicenseDatasetQuery();
if (!ObjectUtils.isEmpty(query.getAndConditionList())) {
appDatasetQuery.setOrConditionList(query.getAndConditionList());
}
if (!ObjectUtils.isEmpty(query.getOrConditionList())) {
appDatasetQuery.setOrConditionList(query.getOrConditionList());
appDatasetQuery.setAppId(query.getAppId());
appDatasetQuery.setOrderCols(query.getOrderCols());
PageInfo pageInfo = this.buildPageInfo(query);
Result<ChildLicenseInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context);
//根据查询条件的数量去除数量不足的结果
int count = query.getOrConditionList().size();
List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
Map<Long, Long> collect = datasetIdList.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
List<Long> dataSets = collect.entrySet().stream().map(entrySet -> {
if (entrySet.getValue() == count) {
return entrySet.getKey();
} else {
return null;
}
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(dataSets)) {
//排序-
List<Long> orderList = new ArrayList<>();
for (Long dataId : datasetIdList) {
if(dataSets.contains(dataId)){
orderList.add(dataId);
}
}
query.setIdList(orderList);
} else {
query.setIdList(ListUtil.toList(0L));
}
query.setOrConditionList(null);
}
}
if (!ObjectUtils.isEmpty(query.getFieldCode()) || !ObjectUtils.isEmpty(query.getFieldName())) {
ChildLicenseDatasetQuery appDatasetQuery = new ChildLicenseDatasetQuery();
appDatasetQuery.setFieldCode(query.getFieldCode());
appDatasetQuery.setFieldName(query.getFieldName());
appDatasetQuery.setAppId(query.getAppId());
// String fieldValue = StrUtil.addPrefixIfNot(query.getFieldValue(), "%");
// fieldValue = StrUtil.addSuffixIfNot(fieldValue, "%");
appDatasetQuery.setFieldValue(query.getFieldValue());
PageInfo pageInfo = this.buildPageInfo(query);
Result<ChildLicenseInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context);
List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(datasetIdList)) {
query.setIdList(datasetIdList);
//query.setOrderColList();
} else {
query.setIdList(ListUtil.toList(0L));
}
}
super.doListBefore(query, model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.child.model.ChildLicenseInfoFieldEntity;
import com.mortals.xhx.module.child.service.ChildLicenseInfoFieldService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 行业许可子证信息字段
*
* @author zxfei
* @date 2024-07-27
*/
@RestController
@RequestMapping("child/license/info/field")
public class ChildLicenseInfoFieldController extends BaseCRUDJsonBodyMappingController<ChildLicenseInfoFieldService,ChildLicenseInfoFieldEntity,Long> {
@Autowired
private ParamService paramService;
public ChildLicenseInfoFieldController(){
super.setModuleDesc( "行业许可子证信息字段");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "fieldType", FieldTypeEnum.getEnumMap());
this.addDict(model, "dataType", DataTypeEnum.getEnumMap());
this.addDict(model, "fieldNull", FieldNullEnum.getEnumMap());
this.addDict(model, "isList", IsListEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.child.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.child.model.ChildLicenseTempleteFieldEntity;
import com.mortals.xhx.module.child.service.ChildLicenseTempleteFieldService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 行业许可子证模板信息字段
*
* @author zxfei
* @date 2024-07-27
*/
@RestController
@RequestMapping("child/license/templete/field")
public class ChildLicenseTempleteFieldController extends BaseCRUDJsonBodyMappingController<ChildLicenseTempleteFieldService,ChildLicenseTempleteFieldEntity,Long> {
@Autowired
private ParamService paramService;
public ChildLicenseTempleteFieldController(){
super.setModuleDesc( "行业许可子证模板信息字段");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "fieldType", FieldTypeEnum.getEnumMap());
this.addDict(model, "dataType", DataTypeEnum.getEnumMap());
this.addDict(model, "fieldNull", FieldNullEnum.getEnumMap());
this.addDict(model, "isList", IsListEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
......@@ -29,20 +29,33 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"marketEntityName":"ZbcZ7T",
"licenseCode":"irbirL",
"legalPersonName":"4ASRCT",
"creditCode":"wuIaG6",
"productLicenseTime":"1722009600000",
"certQRCode":"FTF9Ag",
"url":"Gpn8f2",
"certAuthority":"46b8GT",
"businessPlace":"4r6yUa",
"licensedItems":"QyMnf9",
"fileName":"6N668N",
"filePath":"sy75cb",
"summary":"Q2DQ3W",
"remark":"HCxjBi",
"siteId":342,
"siteName":"zxvwtr",
"catalogId":284,
"catalogName":"9t5kjy",
"applyId":651,
"documentId":528,
"documentName":"2mqg7c",
"deptId":191,
"deptName":"0jhsr0",
"marketEntityName":"nbv932",
"licenseCode":"qxdg5p",
"legalPersonName":"ho5mzp",
"creditCode":"ogkcju",
"productLicenseTime":"1722096000000",
"certQRCode":"9rrnms",
"certAuthority":"ygevko",
"businessPlace":"7ensa1",
"licensedItems":"jv99yw",
"originalFileName":"zsh081",
"originalFilePath":"7w8lpp",
"copyFileName":"gjptto",
"copyFilePath":"cut18d",
"summary":"0lxzwu",
"formStyleContent":"rreg7v",
"formContent":"vn42ra",
"processStatus":0,
"remark":"6lgxfh",
}
> {%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment