Commit a3109726 authored by 赵啸非's avatar 赵啸非

添加自主终端应用实现

parent 11f4238d
This diff is collapsed.
This diff is collapsed.
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 数据类型(number.数字,string.字符串)枚举类
*
* @author zxfei
*/
public enum DataTypeEnum {
number("number.数字", "number.数字"),
string("string.字符串", "string.字符串");
private String value;
private String desc;
DataTypeEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DataTypeEnum getByValue(String value) {
for (DataTypeEnum dataTypeEnum : DataTypeEnum.values()) {
if (dataTypeEnum.getValue() == value) {
return dataTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DataTypeEnum item : DataTypeEnum.values()) {
try {
boolean hasE = false;
for (String 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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否数据更新(0.否,1.是)枚举类
*
* @author zxfei
*/
public enum DateUpdateEnum {
(0, "否"),
(1, "是");
private Integer value;
private String desc;
DateUpdateEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DateUpdateEnum getByValue(Integer value) {
for (DateUpdateEnum dateUpdateEnum : DateUpdateEnum.values()) {
if (dateUpdateEnum.getValue() == value) {
return dateUpdateEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DateUpdateEnum item : DateUpdateEnum.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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否部署(0.否,1.是)枚举类
*
* @author zxfei
*/
public enum DistributeEnum {
(0, "否"),
(1, "是");
private Integer value;
private String desc;
DistributeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DistributeEnum getByValue(Integer value) {
for (DistributeEnum distributeEnum : DistributeEnum.values()) {
if (distributeEnum.getValue() == value) {
return distributeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DistributeEnum item : DistributeEnum.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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 事项来源 (0.政务网,1.自定义)枚举类
*
* @author zxfei
*/
public enum DxTypeEnum {
个人服务("2", "个人服务"),
法人服务("3", "法人服务"),
街道镇服务("54", "街道镇服务"),
乡村服务("56", "乡村服务"),
;
private String value;
private String desc;
DxTypeEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DxTypeEnum getByValue(String value) {
for (DxTypeEnum sourceEnum : DxTypeEnum.values()) {
if (sourceEnum.getValue() == value) {
return sourceEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DxTypeEnum item : DxTypeEnum.values()) {
try {
boolean hasE = false;
for (String 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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否允许为空,(0.否,1.是)枚举类
*
* @author zxfei
*/
public enum FieldNullEnum {
(0, "否"),
(1, "是");
private Integer value;
private String desc;
FieldNullEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static FieldNullEnum getByValue(Integer value) {
for (FieldNullEnum fieldNullEnum : FieldNullEnum.values()) {
if (fieldNullEnum.getValue() == value) {
return fieldNullEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (FieldNullEnum item : FieldNullEnum.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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 字段是否列表显示(0.否,1.是)枚举类
*
* @author zxfei
*/
public enum IsListEnum {
(0, "否"),
(1, "是");
private Integer value;
private String desc;
IsListEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static IsListEnum getByValue(Integer value) {
for (IsListEnum isListEnum : IsListEnum.values()) {
if (isListEnum.getValue() == value) {
return isListEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (IsListEnum item : IsListEnum.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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否上架(0.上架,1.下架)枚举类
*
* @author zxfei
*/
public enum ShelvesEnum {
上架(0, "上架"),
下架(1, "下架");
private Integer value;
private String desc;
ShelvesEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static ShelvesEnum getByValue(Integer value) {
for (ShelvesEnum shelvesEnum : ShelvesEnum.values()) {
if (shelvesEnum.getValue() == value) {
return shelvesEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (ShelvesEnum item : ShelvesEnum.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
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 服务类型(1.公共服务,2.个人服务,3.法人服务)枚举类
*
* @author zxfei
*/
public enum UserTypeEnum {
公共服务("1.公共服务", "1.公共服务"),
个人服务("2.个人服务", "2.个人服务"),
法人服务("3.法人服务", "3.法人服务");
private String value;
private String desc;
UserTypeEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static UserTypeEnum getByValue(String value) {
for (UserTypeEnum userTypeEnum : UserTypeEnum.values()) {
if (userTypeEnum.getValue() == value) {
return userTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (UserTypeEnum item : UserTypeEnum.values()) {
try {
boolean hasE = false;
for (String 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
......@@ -79,6 +79,21 @@ public final class Constant {
*/
public static final String GOV_DEPT_URL = "gov_dept_url";
/**
* 政务网个人服务地址
*/
public static final String GOV_GR_URL = "gov_gr_url";
/**
* 政务网法人服务地址
*/
public static final String GOV_FR_URL = "gov_fr_url";
/**
* 政务网公共服务地址
*/
public static final String GOV_PUB_URL = "gov_pub_url";
/**
* 政务网事项地址
*/
......@@ -89,4 +104,18 @@ public final class Constant {
*/
public static final String GOV_MATTER_PAGELIST_URL = "gov_matter_pagelist_url";
/**
* app不是基础地址
*/
public static final String APP_BASE_DISTRIBUTE_PATH = "app_base_distribute_path";
/**
* 版本前缀
*/
public static final String VERSION_PREFIX = "V";
}
......@@ -55,6 +55,7 @@ public class MatterHtmlParseUtil {
List<MatterEntity> matterEntityList = new ArrayList<>();
try {
Document dom = Jsoup.connect(url).data(params).get();
//System.out.println(dom.html());
Elements elements = dom.selectXpath(matterListExp);
for (int i = 0; i < elements.size(); i++) {
......
......@@ -7,6 +7,8 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.ManagerBaseApplication;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.service.AreaService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
......@@ -16,6 +18,9 @@ import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.module.site.service.SiteThemeMatterService;
import com.mortals.xhx.module.site.service.SiteThemeService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.CustomLog;
import lombok.extern.apachecommons.CommonsLog;
......@@ -25,8 +30,6 @@ import javax.xml.transform.Source;
import java.util.List;
import java.util.stream.Collectors;
@AllArgsConstructor
@CommonsLog
public class SyncGovMatterDetailThread implements Runnable {
......@@ -34,37 +37,57 @@ public class SyncGovMatterDetailThread implements Runnable {
private SiteService siteService;
private AreaService areaService;
private DeptService deptService;
private SiteMatterService siteMatterService;
private SiteThemeService siteThemeService;
private SiteThemeMatterService siteThemeMatterService;
private SiteEntity siteEntity;
private Context context;
public SyncGovMatterDetailThread(SiteEntity siteEntity, Context context) {
this.siteEntity = siteEntity;
this.context = context;
this.matterService = SpringUtils.getBean(MatterService.class);
this.siteService = SpringUtils.getBean(SiteService.class);
this.areaService = SpringUtils.getBean(AreaService.class);
this.deptService = SpringUtils.getBean(DeptService.class);
this.siteMatterService = SpringUtils.getBean(SiteMatterService.class);
this.siteThemeService = SpringUtils.getBean(SiteThemeService.class);
this.siteThemeMatterService = SpringUtils.getBean(SiteThemeMatterService.class);
}
@Override
public void run() {
log.info("同步站点事项开始.....");
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity.getId(), context);
log.info("同步站点部门:"+ JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity.getId(), context);
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context);
log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context);
log.info("同步事项列表:"+ JSON.toJSONString(rest));
if(rest.getCode()== YesNoEnum.YES.getValue()){
AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode());
log.info("同步事项列表:" + JSON.toJSONString(rest));
if (rest.getCode() == YesNoEnum.YES.getValue()) {
List<MatterEntity> matterEntityList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
List<MatterEntity> unSyncDetailMatterList = matterEntityList.stream().filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false")).collect(Collectors.toList());
log.info("同步站点事项到站点.....");
//查询站点事项相关
List<SiteEntity> siteEntities = siteService.find(new SiteQuery().areaCode(siteEntity.getAreaCode()));
//删除站点与政务事项相关项
for (SiteEntity site : siteEntities) {
siteMatterService.deleteBysiteIdAndSource(site.getId(),SourceEnum.政务网.getValue(), context);
siteMatterService.deleteBysiteIdAndSource(site.getId(), SourceEnum.政务网.getValue(), context);
}
//重新添加
for (SiteEntity site : siteEntities) {
List<SiteMatterEntity> siteMatterList = matterEntityList.stream().map(item -> {
return matterService.switchMatterToSiteMatterr(item, site.getId(), context).getData();
return matterService.switchMatterToSiteMatterr(item, site, context).getData();
}).filter(f -> f != null).collect(Collectors.toList());
List<List<SiteMatterEntity>> partition = ListUtil.partition(siteMatterList, 100);
......@@ -74,16 +97,33 @@ public class SyncGovMatterDetailThread implements Runnable {
}
log.info("同步站点事项到站点完成.....");
log.info("同步站点事项详细条数....."+unSyncDetailMatterList.size());
/* for (MatterEntity matterEntity : matterEntityList) {
matterService.buildMatterDetail(matterEntity, context);
matterService.update(matterEntity,context);
}*/
log.info("同步站点事项详细条数....." + unSyncDetailMatterList.size());
unSyncDetailMatterList.parallelStream().forEach(matterEntity -> {
matterService.buildMatterDetail(matterEntity, context);
matterService.update(matterEntity,context);
matterService.update(matterEntity, context);
});
}
log.info("同步站点主题事项开始.....");
//判断站点区域乡镇情况
if(areaEntity.getAreaLevel()<=3){
//省,市,区
Rest<String> themeRest = siteThemeService.syncThemeBySiteId(siteEntity, context);
log.info("同步站点主题:" + JSON.toJSONString(themeRest));
log.info("同步站点个人主题事项开始.....");
siteThemeMatterService.deleteGovBySiteId(siteEntity.getId(), context);
Rest<String> grRest = siteThemeMatterService.syncThemeMatterBySiteId(siteEntity.getId(), "2", context);
log.info("同步站点主题个人事项:" + JSON.toJSONString(grRest));
log.info("同步站点法人主题事项开始.....");
Rest<String> frRest = siteThemeMatterService.syncThemeMatterBySiteId(siteEntity.getId(), "3", context);
log.info("同步站点主题法人事项:" + JSON.toJSONString(frRest));
}else if(areaEntity.getAreaLevel()>3){
//街道,镇,乡
}
log.info("同步站点事项结束.....");
}
......
package com.mortals.xhx.common.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.*;
@Slf4j
public class ZipUtils {
public static void main(String[] args) throws Exception {
unzip(new File("F:\\1664176173348.zip"), "F:\\tmp");
// String path = "F:\\Users\\Isuzu\\Desktop\\test.zip";
// unzip(new File(path), "D:\\data");
}
public static void unzip(File zipFile, String descDir) {
try (ZipArchiveInputStream inputStream = getZipFile(zipFile)) {
File pathFile = new File(descDir);
if (!pathFile.exists()) {
pathFile.mkdirs();
}
ZipArchiveEntry entry = null;
while ((entry = inputStream.getNextZipEntry()) != null) {
if (entry.isDirectory()) {
File directory = new File(descDir, entry.getName());
directory.mkdirs();
} else {
OutputStream os = null;
try {
os = new BufferedOutputStream(new FileOutputStream(new File(descDir, entry.getName())));
//输出文件路径信息
log.info("解压文件的当前路径为:{}", descDir + entry.getName());
IOUtils.copy(inputStream, os);
} finally {
IOUtils.closeQuietly(os);
}
}
}
final File[] files = pathFile.listFiles();
if (files != null && files.length == 1 && files[0].isDirectory()) {
// 说明只有一个文件夹
FileUtils.copyDirectory(files[0], pathFile);
//免得删除错误, 删除的文件必须在/data/demand/目录下。
// boolean isValid = files[0].getPath().contains("/data/www/");
// if (isValid) {
// FileUtils.forceDelete(files[0]);
// }
}
log.info("******************解压完毕********************");
} catch (Exception e) {
log.error("[unzip] 解压zip文件出错", e);
}
}
private static ZipArchiveInputStream getZipFile(File zipFile) throws Exception {
return new ZipArchiveInputStream(new BufferedInputStream(new FileInputStream(zipFile)));
}
}
package com.mortals.xhx.module.app.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.app.model.AppEntity;
import java.util.List;
/**
* 自助终端应用Dao
* 自助终端应用 DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppDao extends ICRUDDao<AppEntity,Long>{
}
package com.mortals.xhx.module.app.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
import java.util.List;
/**
* 自助终端应用数据集Dao
* 自助终端应用数据集 DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppDatasetDao extends ICRUDDao<AppDatasetEntity,Long>{
}
package com.mortals.xhx.module.app.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
import java.util.List;
/**
* 自助终端应用信息字段Dao
* 自助终端应用信息字段 DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppInfoFieldDao extends ICRUDDao<AppInfoFieldEntity,Long>{
}
package com.mortals.xhx.module.app.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity;
import java.util.List;
/**
* 自助终端应用模板信息字段Dao
* 自助终端应用模板信息字段 DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppInfoTempleteFieldDao extends ICRUDDao<AppInfoTempleteFieldEntity,Long>{
}
package com.mortals.xhx.module.app.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import java.util.List;
/**
* 自助终端应用版本历史Dao
* 自助终端应用版本历史 DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppVersionDao extends ICRUDDao<AppVersionEntity,Long>{
}
package com.mortals.xhx.module.app.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.app.dao.AppDao;
import com.mortals.xhx.module.app.model.AppEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 自助终端应用DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
@Repository("appDao")
public class AppDaoImpl extends BaseCRUDDaoMybatis<AppEntity,Long> implements AppDao {
}
package com.mortals.xhx.module.app.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.app.dao.AppDatasetDao;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 自助终端应用数据集DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
@Repository("appDatasetDao")
public class AppDatasetDaoImpl extends BaseCRUDDaoMybatis<AppDatasetEntity,Long> implements AppDatasetDao {
}
package com.mortals.xhx.module.app.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.app.dao.AppInfoFieldDao;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 自助终端应用信息字段DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
@Repository("appInfoFieldDao")
public class AppInfoFieldDaoImpl extends BaseCRUDDaoMybatis<AppInfoFieldEntity,Long> implements AppInfoFieldDao {
}
package com.mortals.xhx.module.app.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.app.dao.AppInfoTempleteFieldDao;
import com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 自助终端应用模板信息字段DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
@Repository("appInfoTempleteFieldDao")
public class AppInfoTempleteFieldDaoImpl extends BaseCRUDDaoMybatis<AppInfoTempleteFieldEntity,Long> implements AppInfoTempleteFieldDao {
}
package com.mortals.xhx.module.app.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.app.dao.AppVersionDao;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 自助终端应用版本历史DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-28
*/
@Repository("appVersionDao")
public class AppVersionDaoImpl extends BaseCRUDDaoMybatis<AppVersionEntity,Long> implements AppVersionDao {
}
package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppDatasetVo;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
/**
* 自助终端应用数据集实体对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppDatasetEntity extends AppDatasetVo {
private static final long serialVersionUID = 1L;
/**
* appId
*/
private Long appId;
/**
* 自助终端应用信息字段信息
*/
private List<AppInfoFieldEntity> appInfoFieldList=new ArrayList<>();;
public AppDatasetEntity(){}
/**
* 获取 appId
* @return Long
*/
public Long getAppId(){
return appId;
}
/**
* 设置 appId
* @param appId
*/
public void setAppId(Long appId){
this.appId = appId;
}
public List<AppInfoFieldEntity> getAppInfoFieldList(){
return appInfoFieldList;
}
public void setAppInfoFieldList(List<AppInfoFieldEntity> appInfoFieldList){
this.appInfoFieldList = appInfoFieldList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppDatasetEntity) {
AppDatasetEntity tmp = (AppDatasetEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",appId:").append(getAppId());
return sb.toString();
}
public void initAttrValue(){
this.appId = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppVo;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
/**
* 自助终端应用实体对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppEntity extends AppVo {
private static final long serialVersionUID = 1L;
/**
* 站点Id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 应用编码
*/
private String appCode;
/**
* 应用名称
*/
private String appName;
/**
* 应用图标
*/
private String appIconPath;
/**
* 应用主题名称
*/
private String appThemeName;
/**
* 类型(1.终端应用,2.移动端应用)
*/
private Integer type;
/**
* 下发设备次数
*/
private Integer downDevCount;
/**
* 是否上架(0.上架,1.下架)
*/
private Integer shelves;
/**
* 文件相对路径地址
*/
private String filePath;
/**
* 文件部署路径地址
*/
private String distributeFilePath;
/**
* 当前版本
*/
private String version;
/**
* 简介
*/
private String summary;
/**
* 是否部署(0.否,1.是)
*/
private Integer distribute;
/**
* 是否数据更新(0.否,1.是)
*/
private Integer dateUpdate;
/**
* 自助终端应用数据集信息
*/
private List<AppDatasetEntity> appDatasetList=new ArrayList<>();;
public AppEntity(){}
/**
* 获取 站点Id
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 站点名称
* @return String
*/
public String getSiteName(){
return siteName;
}
/**
* 设置 站点名称
* @param siteName
*/
public void setSiteName(String siteName){
this.siteName = siteName;
}
/**
* 获取 应用编码
* @return String
*/
public String getAppCode(){
return appCode;
}
/**
* 设置 应用编码
* @param appCode
*/
public void setAppCode(String appCode){
this.appCode = appCode;
}
/**
* 获取 应用名称
* @return String
*/
public String getAppName(){
return appName;
}
/**
* 设置 应用名称
* @param appName
*/
public void setAppName(String appName){
this.appName = appName;
}
/**
* 获取 应用图标
* @return String
*/
public String getAppIconPath(){
return appIconPath;
}
/**
* 设置 应用图标
* @param appIconPath
*/
public void setAppIconPath(String appIconPath){
this.appIconPath = appIconPath;
}
/**
* 获取 应用主题名称
* @return String
*/
public String getAppThemeName(){
return appThemeName;
}
/**
* 设置 应用主题名称
* @param appThemeName
*/
public void setAppThemeName(String appThemeName){
this.appThemeName = appThemeName;
}
/**
* 获取 类型(1.终端应用,2.移动端应用)
* @return Integer
*/
public Integer getType(){
return type;
}
/**
* 设置 类型(1.终端应用,2.移动端应用)
* @param type
*/
public void setType(Integer type){
this.type = type;
}
/**
* 获取 下发设备次数
* @return Integer
*/
public Integer getDownDevCount(){
return downDevCount;
}
/**
* 设置 下发设备次数
* @param downDevCount
*/
public void setDownDevCount(Integer downDevCount){
this.downDevCount = downDevCount;
}
/**
* 获取 是否上架(0.上架,1.下架)
* @return Integer
*/
public Integer getShelves(){
return shelves;
}
/**
* 设置 是否上架(0.上架,1.下架)
* @param shelves
*/
public void setShelves(Integer shelves){
this.shelves = shelves;
}
/**
* 获取 文件相对路径地址
* @return String
*/
public String getFilePath(){
return filePath;
}
/**
* 设置 文件相对路径地址
* @param filePath
*/
public void setFilePath(String filePath){
this.filePath = filePath;
}
/**
* 获取 文件部署路径地址
* @return String
*/
public String getDistributeFilePath(){
return distributeFilePath;
}
/**
* 设置 文件部署路径地址
* @param distributeFilePath
*/
public void setDistributeFilePath(String distributeFilePath){
this.distributeFilePath = distributeFilePath;
}
/**
* 获取 当前版本
* @return String
*/
public String getVersion(){
return version;
}
/**
* 设置 当前版本
* @param version
*/
public void setVersion(String version){
this.version = version;
}
/**
* 获取 简介
* @return String
*/
public String getSummary(){
return summary;
}
/**
* 设置 简介
* @param summary
*/
public void setSummary(String summary){
this.summary = summary;
}
/**
* 获取 是否部署(0.否,1.是)
* @return Integer
*/
public Integer getDistribute(){
return distribute;
}
/**
* 设置 是否部署(0.否,1.是)
* @param distribute
*/
public void setDistribute(Integer distribute){
this.distribute = distribute;
}
/**
* 获取 是否数据更新(0.否,1.是)
* @return Integer
*/
public Integer getDateUpdate(){
return dateUpdate;
}
/**
* 设置 是否数据更新(0.否,1.是)
* @param dateUpdate
*/
public void setDateUpdate(Integer dateUpdate){
this.dateUpdate = dateUpdate;
}
public List<AppDatasetEntity> getAppDatasetList(){
return appDatasetList;
}
public void setAppDatasetList(List<AppDatasetEntity> appDatasetList){
this.appDatasetList = appDatasetList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppEntity) {
AppEntity tmp = (AppEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",siteName:").append(getSiteName());
sb.append(",appCode:").append(getAppCode());
sb.append(",appName:").append(getAppName());
sb.append(",appIconPath:").append(getAppIconPath());
sb.append(",appThemeName:").append(getAppThemeName());
sb.append(",type:").append(getType());
sb.append(",downDevCount:").append(getDownDevCount());
sb.append(",shelves:").append(getShelves());
sb.append(",filePath:").append(getFilePath());
sb.append(",distributeFilePath:").append(getDistributeFilePath());
sb.append(",version:").append(getVersion());
sb.append(",summary:").append(getSummary());
sb.append(",distribute:").append(getDistribute());
sb.append(",dateUpdate:").append(getDateUpdate());
return sb.toString();
}
public void initAttrValue(){
this.siteId = null;
this.siteName = null;
this.appCode = "";
this.appName = "";
this.appIconPath = "";
this.appThemeName = "";
this.type = 1;
this.downDevCount = 0;
this.shelves = 0;
this.filePath = null;
this.distributeFilePath = null;
this.version = null;
this.summary = null;
this.distribute = 0;
this.dateUpdate = 0;
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppInfoFieldVo;
/**
* 自助终端应用信息字段实体对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppInfoFieldEntity extends AppInfoFieldVo {
private static final long serialVersionUID = 1L;
/**
* 应用数据集id
*/
private Long datasetId;
/**
* 字段编码
*/
private String fieldCode;
/**
* 字段名称
*/
private String fieldName;
/**
* 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
*/
private String fieldType;
/**
* 数据类型(number.数字,string.字符串)
*/
private String dataType;
/**
* 字段值
*/
private String fieldValue;
/**
* 数据长度,默认128
*/
private Integer fieldLen;
/**
* 是否允许为空,(0.否,1.是)
*/
private Integer fieldNull;
/**
* 字段是否列表显示(0.否,1.是)
*/
private Integer isList;
/**
* 排序号
*/
private String fieldOrderNo;
/**
* 备注
*/
private String remark;
public AppInfoFieldEntity(){}
/**
* 获取 应用数据集id
* @return Long
*/
public Long getDatasetId(){
return datasetId;
}
/**
* 设置 应用数据集id
* @param datasetId
*/
public void setDatasetId(Long datasetId){
this.datasetId = datasetId;
}
/**
* 获取 字段编码
* @return String
*/
public String getFieldCode(){
return fieldCode;
}
/**
* 设置 字段编码
* @param fieldCode
*/
public void setFieldCode(String fieldCode){
this.fieldCode = fieldCode;
}
/**
* 获取 字段名称
* @return String
*/
public String getFieldName(){
return fieldName;
}
/**
* 设置 字段名称
* @param fieldName
*/
public void setFieldName(String fieldName){
this.fieldName = fieldName;
}
/**
* 获取 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
* @return String
*/
public String getFieldType(){
return fieldType;
}
/**
* 设置 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
* @param fieldType
*/
public void setFieldType(String fieldType){
this.fieldType = fieldType;
}
/**
* 获取 数据类型(number.数字,string.字符串)
* @return String
*/
public String getDataType(){
return dataType;
}
/**
* 设置 数据类型(number.数字,string.字符串)
* @param dataType
*/
public void setDataType(String dataType){
this.dataType = dataType;
}
/**
* 获取 字段值
* @return String
*/
public String getFieldValue(){
return fieldValue;
}
/**
* 设置 字段值
* @param fieldValue
*/
public void setFieldValue(String fieldValue){
this.fieldValue = fieldValue;
}
/**
* 获取 数据长度,默认128
* @return Integer
*/
public Integer getFieldLen(){
return fieldLen;
}
/**
* 设置 数据长度,默认128
* @param fieldLen
*/
public void setFieldLen(Integer fieldLen){
this.fieldLen = fieldLen;
}
/**
* 获取 是否允许为空,(0.否,1.是)
* @return Integer
*/
public Integer getFieldNull(){
return fieldNull;
}
/**
* 设置 是否允许为空,(0.否,1.是)
* @param fieldNull
*/
public void setFieldNull(Integer fieldNull){
this.fieldNull = fieldNull;
}
/**
* 获取 字段是否列表显示(0.否,1.是)
* @return Integer
*/
public Integer getIsList(){
return isList;
}
/**
* 设置 字段是否列表显示(0.否,1.是)
* @param isList
*/
public void setIsList(Integer isList){
this.isList = isList;
}
/**
* 获取 排序号
* @return String
*/
public String getFieldOrderNo(){
return fieldOrderNo;
}
/**
* 设置 排序号
* @param fieldOrderNo
*/
public void setFieldOrderNo(String fieldOrderNo){
this.fieldOrderNo = fieldOrderNo;
}
/**
* 获取 备注
* @return String
*/
public String getRemark(){
return remark;
}
/**
* 设置 备注
* @param remark
*/
public void setRemark(String remark){
this.remark = remark;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppInfoFieldEntity) {
AppInfoFieldEntity tmp = (AppInfoFieldEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",datasetId:").append(getDatasetId());
sb.append(",fieldCode:").append(getFieldCode());
sb.append(",fieldName:").append(getFieldName());
sb.append(",fieldType:").append(getFieldType());
sb.append(",dataType:").append(getDataType());
sb.append(",fieldValue:").append(getFieldValue());
sb.append(",fieldLen:").append(getFieldLen());
sb.append(",fieldNull:").append(getFieldNull());
sb.append(",isList:").append(getIsList());
sb.append(",fieldOrderNo:").append(getFieldOrderNo());
sb.append(",remark:").append(getRemark());
return sb.toString();
}
public void initAttrValue(){
this.datasetId = null;
this.fieldCode = null;
this.fieldName = null;
this.fieldType = null;
this.dataType = null;
this.fieldValue = null;
this.fieldLen = null;
this.fieldNull = 1;
this.isList = null;
this.fieldOrderNo = null;
this.remark = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppInfoTempleteFieldVo;
/**
* 自助终端应用模板信息字段实体对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppInfoTempleteFieldEntity extends AppInfoTempleteFieldVo {
private static final long serialVersionUID = 1L;
/**
* 应用id
*/
private Long appId;
/**
* 字段编码
*/
private String fieldCode;
/**
* 字段名称
*/
private String fieldName;
/**
* 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
*/
private String fieldType;
/**
* 数据类型(number.数字,string.字符串)
*/
private String dataType;
/**
* 字段值
*/
private String fieldValue;
/**
* 数据长度,默认128
*/
private Integer fieldLen;
/**
* 是否允许为空,(0.否,1.是)
*/
private Integer fieldNull;
/**
* 字段是否列表显示(0.否,1.是)
*/
private Integer isList;
/**
* 排序号
*/
private String fieldOrderNo;
/**
* 备注
*/
private String remark;
public AppInfoTempleteFieldEntity(){}
/**
* 获取 应用id
* @return Long
*/
public Long getAppId(){
return appId;
}
/**
* 设置 应用id
* @param appId
*/
public void setAppId(Long appId){
this.appId = appId;
}
/**
* 获取 字段编码
* @return String
*/
public String getFieldCode(){
return fieldCode;
}
/**
* 设置 字段编码
* @param fieldCode
*/
public void setFieldCode(String fieldCode){
this.fieldCode = fieldCode;
}
/**
* 获取 字段名称
* @return String
*/
public String getFieldName(){
return fieldName;
}
/**
* 设置 字段名称
* @param fieldName
*/
public void setFieldName(String fieldName){
this.fieldName = fieldName;
}
/**
* 获取 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
* @return String
*/
public String getFieldType(){
return fieldType;
}
/**
* 设置 字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
* @param fieldType
*/
public void setFieldType(String fieldType){
this.fieldType = fieldType;
}
/**
* 获取 数据类型(number.数字,string.字符串)
* @return String
*/
public String getDataType(){
return dataType;
}
/**
* 设置 数据类型(number.数字,string.字符串)
* @param dataType
*/
public void setDataType(String dataType){
this.dataType = dataType;
}
/**
* 获取 字段值
* @return String
*/
public String getFieldValue(){
return fieldValue;
}
/**
* 设置 字段值
* @param fieldValue
*/
public void setFieldValue(String fieldValue){
this.fieldValue = fieldValue;
}
/**
* 获取 数据长度,默认128
* @return Integer
*/
public Integer getFieldLen(){
return fieldLen;
}
/**
* 设置 数据长度,默认128
* @param fieldLen
*/
public void setFieldLen(Integer fieldLen){
this.fieldLen = fieldLen;
}
/**
* 获取 是否允许为空,(0.否,1.是)
* @return Integer
*/
public Integer getFieldNull(){
return fieldNull;
}
/**
* 设置 是否允许为空,(0.否,1.是)
* @param fieldNull
*/
public void setFieldNull(Integer fieldNull){
this.fieldNull = fieldNull;
}
/**
* 获取 字段是否列表显示(0.否,1.是)
* @return Integer
*/
public Integer getIsList(){
return isList;
}
/**
* 设置 字段是否列表显示(0.否,1.是)
* @param isList
*/
public void setIsList(Integer isList){
this.isList = isList;
}
/**
* 获取 排序号
* @return String
*/
public String getFieldOrderNo(){
return fieldOrderNo;
}
/**
* 设置 排序号
* @param fieldOrderNo
*/
public void setFieldOrderNo(String fieldOrderNo){
this.fieldOrderNo = fieldOrderNo;
}
/**
* 获取 备注
* @return String
*/
public String getRemark(){
return remark;
}
/**
* 设置 备注
* @param remark
*/
public void setRemark(String remark){
this.remark = remark;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppInfoTempleteFieldEntity) {
AppInfoTempleteFieldEntity tmp = (AppInfoTempleteFieldEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",appId:").append(getAppId());
sb.append(",fieldCode:").append(getFieldCode());
sb.append(",fieldName:").append(getFieldName());
sb.append(",fieldType:").append(getFieldType());
sb.append(",dataType:").append(getDataType());
sb.append(",fieldValue:").append(getFieldValue());
sb.append(",fieldLen:").append(getFieldLen());
sb.append(",fieldNull:").append(getFieldNull());
sb.append(",isList:").append(getIsList());
sb.append(",fieldOrderNo:").append(getFieldOrderNo());
sb.append(",remark:").append(getRemark());
return sb.toString();
}
public void initAttrValue(){
this.appId = null;
this.fieldCode = null;
this.fieldName = null;
this.fieldType = null;
this.dataType = null;
this.fieldValue = null;
this.fieldLen = null;
this.fieldNull = 1;
this.isList = null;
this.fieldOrderNo = null;
this.remark = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppVersionVo;
/**
* 自助终端应用版本历史实体对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppVersionEntity extends AppVersionVo {
private static final long serialVersionUID = 1L;
/**
* app应用Id
*/
private Long appId;
/**
* 应用名称
*/
private String appName;
/**
* 版本号
*/
private String version;
/**
* 更新说明
*/
private String notes;
public AppVersionEntity(){}
/**
* 获取 app应用Id
* @return Long
*/
public Long getAppId(){
return appId;
}
/**
* 设置 app应用Id
* @param appId
*/
public void setAppId(Long appId){
this.appId = appId;
}
/**
* 获取 应用名称
* @return String
*/
public String getAppName(){
return appName;
}
/**
* 设置 应用名称
* @param appName
*/
public void setAppName(String appName){
this.appName = appName;
}
/**
* 获取 版本号
* @return String
*/
public String getVersion(){
return version;
}
/**
* 设置 版本号
* @param version
*/
public void setVersion(String version){
this.version = version;
}
/**
* 获取 更新说明
* @return String
*/
public String getNotes(){
return notes;
}
/**
* 设置 更新说明
* @param notes
*/
public void setNotes(String notes){
this.notes = notes;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppVersionEntity) {
AppVersionEntity tmp = (AppVersionEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",appId:").append(getAppId());
sb.append(",appName:").append(getAppName());
sb.append(",version:").append(getVersion());
sb.append(",notes:").append(getNotes());
return sb.toString();
}
public void initAttrValue(){
this.appId = null;
this.appName = "";
this.version = "";
this.notes = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 自助终端应用数据集视图对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppDatasetVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.app.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 自助终端应用信息字段视图对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppInfoFieldVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.app.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 自助终端应用模板信息字段视图对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppInfoTempleteFieldVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.app.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 自助终端应用版本历史视图对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppVersionVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.app.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.AppEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 自助终端应用视图对象
*
* @author zxfei
* @date 2022-11-28
*/
public class AppVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.app.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
/**
* AppDatasetService
*
* 自助终端应用数据集 service接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppDatasetService extends ICRUDService<AppDatasetEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.app.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
/**
* AppInfoFieldService
*
* 自助终端应用信息字段 service接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppInfoFieldService extends ICRUDService<AppInfoFieldEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.app.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity;
/**
* AppInfoTempleteFieldService
*
* 自助终端应用模板信息字段 service接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppInfoTempleteFieldService extends ICRUDService<AppInfoTempleteFieldEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.app.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.site.model.SiteEntity;
import java.util.List;
/**
* AppService
* <p>
* 自助终端应用 service接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppService extends ICRUDService<AppEntity, Long> {
Rest<String> appDistribute(AppEntity appEntity, Context context);
Rest<String> cloneAppsBySites(List<AppEntity> appList, List<SiteEntity> siteList, Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.app.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.app.model.AppVersionEntity;
/**
* AppVersionService
*
* 自助终端应用版本历史 service接口
*
* @author zxfei
* @date 2022-11-28
*/
public interface AppVersionService extends ICRUDService<AppVersionEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.app.model.*;
import com.mortals.xhx.module.app.service.AppInfoFieldService;
import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.app.service.AppVersionService;
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.app.dao.AppDatasetDao;
import com.mortals.xhx.module.app.service.AppDatasetService;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* AppDatasetService
* 自助终端应用数据集 service实现
*
* @author zxfei
* @date 2022-11-28
*/
@Service("appDatasetService")
public class AppDatasetServiceImpl extends AbstractCRUDServiceImpl<AppDatasetDao, AppDatasetEntity, Long> implements AppDatasetService {
@Autowired
private AppInfoFieldService appInfoFieldService;
@Autowired
private AppService appService;
@Autowired
private AppVersionService appVersionService;
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<AppInfoFieldEntity> appInfoFieldlist = appInfoFieldService.find(new AppInfoFieldQuery().datasetIdList(Arrays.asList(ids)));
if(!ObjectUtils.isEmpty(appInfoFieldlist)){
appInfoFieldService.removeList(appInfoFieldlist, context);
}
super.removeAfter(ids, context, result);
}
@Override
protected void updateAfter(AppDatasetEntity entity, Context context) throws AppException {
AppEntity appEntity = appService.get(entity.getAppId(), context);
saveOrUpdateAppVersion(appEntity, context);
super.updateAfter(entity, context);
}
@Override
protected void saveAfter(AppDatasetEntity entity, Context context) throws AppException {
//更新版本号
AppEntity appEntity = appService.get(entity.getAppId(), context);
saveOrUpdateAppVersion(appEntity, context);
super.saveAfter(entity, context);
}
private void saveOrUpdateAppVersion( AppEntity appEntity, Context context) {
if(!ObjectUtils.isEmpty(appEntity)){
String version = appEntity.getVersion();
String versionNum = StrUtil.subAfter(version, Constant.VERSION_PREFIX, false);
String newVersionNum = NumberUtil.add(versionNum, "0.1").setScale(1).toString();
AppVersionEntity appVersionEntity = new AppVersionEntity();
appVersionEntity.initAttrValue();
AppVersionEntity versionEntity = new AppVersionEntity();
versionEntity.initAttrValue();
versionEntity.setVersion(Constant.VERSION_PREFIX+newVersionNum);
versionEntity.setNotes("应用数据更新!");
versionEntity.setCreateTime(new Date());
versionEntity.setCreateUserId(this.getContextUserId(context));
appVersionService.save(versionEntity, context);
appEntity.setVersion(versionEntity.getVersion());
appService.update(appEntity, context);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl;
import com.mortals.xhx.module.app.model.AppInfoFieldQuery;
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.app.dao.AppInfoFieldDao;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
import com.mortals.xhx.module.app.service.AppInfoFieldService;
import java.util.Arrays;
import java.util.List;
/**
* AppInfoFieldService
* 自助终端应用信息字段 service实现
*
* @author zxfei
* @date 2022-11-28
*/
@Service("appInfoFieldService")
public class AppInfoFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoFieldDao, AppInfoFieldEntity, Long> implements AppInfoFieldService {
}
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl;
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.app.dao.AppInfoTempleteFieldDao;
import com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity;
import com.mortals.xhx.module.app.service.AppInfoTempleteFieldService;
/**
* AppInfoTempleteFieldService
* 自助终端应用模板信息字段 service实现
*
* @author zxfei
* @date 2022-11-28
*/
@Service("appInfoTempleteFieldService")
public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoTempleteFieldDao, AppInfoTempleteFieldEntity, Long> implements AppInfoTempleteFieldService {
}
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl;
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.app.dao.AppVersionDao;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import com.mortals.xhx.module.app.service.AppVersionService;
/**
* AppVersionService
* 自助终端应用版本历史 service实现
*
* @author zxfei
* @date 2022-11-28
*/
@Service("appVersionService")
public class AppVersionServiceImpl extends AbstractCRUDServiceImpl<AppVersionDao, AppVersionEntity, Long> implements AppVersionService {
}
\ No newline at end of file
package com.mortals.xhx.module.app.web;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteService;
import org.apache.commons.lang3.ObjectUtils;
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.app.model.AppEntity;
import com.mortals.xhx.module.app.service.AppService;
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.*;
/**
* 自助终端应用
*
* @author zxfei
* @date 2022-11-28
*/
@RestController
@RequestMapping("app")
public class AppController extends BaseCRUDJsonBodyMappingController<AppService, AppEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private SiteService siteService;
public AppController() {
super.setModuleDesc("自助终端应用");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", paramService.getParamBySecondOrganize("App", "type"));
this.addDict(model, "shelves", paramService.getParamBySecondOrganize("App", "shelves"));
this.addDict(model, "distribute", paramService.getParamBySecondOrganize("App", "distribute"));
this.addDict(model, "dateUpdate", paramService.getParamBySecondOrganize("App", "dateUpdate"));
super.init(model, context);
}
/**
* app应用部署
*/
@PostMapping(value = "appDistribute")
public Rest<Void> appDistribute(@RequestBody AppEntity appEntity) {
String busiDesc = this.getModuleDesc() + "自助服务应用部署";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (ObjectUtils.isEmpty(appEntity.getId())) {
throw new AppException("应用Id不能为空!");
}
appEntity = this.service.get(appEntity.getId(), getContext());
if (ObjectUtils.isEmpty(appEntity)) {
throw new AppException("当前应用不存在!appId:" + appEntity.getId());
}
Rest<String> disRest = this.service.appDistribute(appEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("自助服务应用部署", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* app应用克隆给其它站点
*/
@PostMapping(value = "cloneAppsBySites")
public Rest<Void> cloneAppsBySites(@RequestBody AppQuery appQuery) {
String busiDesc = this.getModuleDesc() + "自助服务应用部署克隆";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (ObjectUtils.isEmpty(appQuery.getIdList())) {
throw new AppException("应用appId列表不能为空!");
}
if (ObjectUtils.isEmpty(appQuery.getSiteIdList())) {
throw new AppException("克隆站点Id列表不能为空!");
}
List<AppEntity> appEntityList = this.service.find(new AppQuery().idList(appQuery.getIdList()), getContext());
List<SiteEntity> siteEntityList = siteService.find(new SiteQuery().idList(appQuery.getSiteIdList()), getContext());
Rest<String> cloneRest = this.service.cloneAppsBySites(appEntityList, siteEntityList, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("自助服务应用部署", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
}
\ No newline at end of file
package com.mortals.xhx.module.app.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.app.model.AppDatasetEntity;
import com.mortals.xhx.module.app.service.AppDatasetService;
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.*;
/**
*
* 自助终端应用数据集
*
* @author zxfei
* @date 2022-11-28
*/
@RestController
@RequestMapping("app/dataset")
public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppDatasetService,AppDatasetEntity,Long> {
@Autowired
private ParamService paramService;
public AppDatasetController(){
super.setModuleDesc( "自助终端应用数据集");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.site.model.SiteEntity;
/**
* DeptService
*
......@@ -25,5 +27,8 @@ public interface DeptService extends ICRUDCacheService<DeptEntity,Long> {
* 同步政务网部门数据
* @param context
*/
Rest<String> syncDeptBySiteId(Long siteId, Context context);
Rest<String> syncDeptBySiteId(SiteEntity siteEntity, Context context);
void deleteGovBySiteId(Long siteId, Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.matter.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.matter.model.MatterExtEntity;
import java.util.List;
/**
* 事项扩展Dao
* 事项扩展 DAO接口
*
* @author zxfei
* @date 2022-11-23
*/
public interface MatterExtDao extends ICRUDDao<MatterExtEntity,Long>{
}
......@@ -73,7 +73,7 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
Rest<List<MatterEntity>> getMatterAllListByGOV(Map<String,String> params,Integer pageNum, Context context);
Rest<String> syncMatterBySiteId(Long siteId, Context context);
Rest<String> syncMatterBySiteId(SiteEntity siteEntity, Context context);
void deleteBysiteIdAndSource(Long siteId,Integer source, Context context);
}
\ No newline at end of file
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