Commit 60a7673c authored by “yiyousong”'s avatar “yiyousong”
parents 1d98c710 ca51680e
This diff is collapsed.
...@@ -9,7 +9,10 @@ import com.mortals.framework.common.Rest; ...@@ -9,7 +9,10 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
...@@ -126,7 +129,7 @@ public class MatterHtmlParseUtil { ...@@ -126,7 +129,7 @@ public class MatterHtmlParseUtil {
log.info("error href ,title:" + title); log.info("error href ,title:" + title);
} }
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl); buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
} }
elements = dom.selectXpath(matterListLiExp); elements = dom.selectXpath(matterListLiExp);
...@@ -171,7 +174,7 @@ public class MatterHtmlParseUtil { ...@@ -171,7 +174,7 @@ public class MatterHtmlParseUtil {
} }
} }
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl); buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
} }
break; break;
...@@ -187,13 +190,23 @@ public class MatterHtmlParseUtil { ...@@ -187,13 +190,23 @@ public class MatterHtmlParseUtil {
return Rest.ok(matterEntityList); return Rest.ok(matterEntityList);
} }
private static void buildMatter(List<MatterEntity> matterEntityList, String title, String href, String evaluationUrl, String netApplyUrl) { private static void buildMatter(List<MatterEntity> matterEntityList, String title, String href, String evaluationUrl, String netApplyUrl,Map<String, String> params) {
UrlBuilder builder = UrlBuilder.ofHttp(href, CharsetUtil.CHARSET_UTF_8); UrlBuilder builder = UrlBuilder.ofHttp(href, CharsetUtil.CHARSET_UTF_8);
String itemCode = builder.getQuery().get("itemCode").toString(); String itemCode = builder.getQuery().get("itemCode").toString();
String taskType = builder.getQuery().get("taskType").toString(); String taskType = builder.getQuery().get("taskType").toString();
String deptCode = builder.getQuery().get("deptCode").toString(); String deptCode = builder.getQuery().get("deptCode").toString();
String areaCode = builder.getQuery().get("areaCode").toString(); String areaCode = builder.getQuery().get("areaCode").toString();
//todo 如果部门编码与初始编码不一致,切不在部门列表中,添加默认部门
String sourceDeptCode = params.getOrDefault("deptCode", "");
DeptService deptService = SpringUtils.getBean(DeptService.class);
DeptEntity cache = deptService.getCache(deptCode);
if(ObjectUtils.isEmpty(cache)){
//抓取事项的部门编码未找到 用初始的部门编码
deptCode=sourceDeptCode;
}
MatterEntity matterEntity = new MatterEntity(); MatterEntity matterEntity = new MatterEntity();
matterEntity.initAttrValue(); matterEntity.initAttrValue();
matterEntity.setTcode(itemCode); matterEntity.setTcode(itemCode);
......
...@@ -72,7 +72,7 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -72,7 +72,7 @@ public class SyncGovMatterDetailThread implements Runnable {
@Override @Override
public void run() { public void run() {
log.info("同步站点事项开始....."); log.info("同步站点事项开始.....");
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context); deptService.syncDeptBySiteId(siteEntity, context);
//log.info("同步站点部门:" + JSON.toJSONString(deptRest)); //log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context); Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context);
//Rest<String> rest = Rest.ok(); //Rest<String> rest = Rest.ok();
......
...@@ -180,7 +180,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -180,7 +180,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
} }
//部署路径是否存在 如果不存在 创建目录, //部署路径是否存在 如果不存在 创建目录,
//文件构成目录 /home/publish/app/common //文件构成目录 /home/publish/app/common
String disPath = "/home/publish/app/common"; String disPath = "/home/publish/app";
//判断目标目录是否存在 如果存在 这删除 //判断目标目录是否存在 如果存在 这删除
if (FileUtil.isDirectory(disPath)) { if (FileUtil.isDirectory(disPath)) {
...@@ -221,6 +221,21 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -221,6 +221,21 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
appClone.setDistributeFilePath(""); appClone.setDistributeFilePath("");
appClone.setShelves(YesNoEnum.NO.getValue()); appClone.setShelves(YesNoEnum.NO.getValue());
appClone = this.save(appClone, context); appClone = this.save(appClone, context);
//克隆应用版本
AppVersionEntity appVersionCloneEntity = new AppVersionEntity();
appVersionCloneEntity.initAttrValue();
AppVersionQuery appVersionQuery = new AppVersionQuery();
appVersionQuery.setUsed(YesNoEnum.YES.getValue());
appVersionQuery.setAppId(appEntity.getId());
AppVersionEntity appVersionOriEntity = appVersionService.selectOne(appVersionQuery);
BeanUtils.copyProperties(appVersionOriEntity, appVersionCloneEntity, BeanUtil.getNullPropertyNames(appVersionOriEntity));
appVersionCloneEntity.setAppId(appClone.getId());
appVersionCloneEntity.setDistributeFilePath("");
appVersionCloneEntity.setUsed(YesNoEnum.NO.getValue());
appVersionCloneEntity.setId(null);
appVersionService.save(appVersionCloneEntity, context);
//保存数据集 //保存数据集
List<AppDatasetEntity> appDatasetList = appClone.getAppDatasetList(); List<AppDatasetEntity> appDatasetList = appClone.getAppDatasetList();
if (!ObjectUtils.isEmpty(appDatasetList)) { if (!ObjectUtils.isEmpty(appDatasetList)) {
...@@ -288,7 +303,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -288,7 +303,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
AppEntity targetAppEntity = this.get(targetAppId, context); AppEntity targetAppEntity = this.get(targetAppId, context);
//删除应用的数据集 //删除应用的数据集
if(!ObjectUtils.isEmpty(appEntity.getTargetDelete())&&YesNoEnum.YES.getValue()==appEntity.getTargetDelete()) { if (!ObjectUtils.isEmpty(appEntity.getTargetDelete()) && YesNoEnum.YES.getValue() == appEntity.getTargetDelete()) {
Long[] delIds = targetAppEntity.getAppDatasetList().stream().map(i -> i.getId()).toArray(Long[]::new); Long[] delIds = targetAppEntity.getAppDatasetList().stream().map(i -> i.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(delIds)) { if (!ObjectUtils.isEmpty(delIds)) {
appDatasetService.remove(delIds, context); appDatasetService.remove(delIds, context);
...@@ -375,10 +390,12 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -375,10 +390,12 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
@Override @Override
public AppEntity update(AppEntity entity, Context context) throws AppException { public AppEntity update(AppEntity entity, Context context) throws AppException {
this.updateBefore(entity, context); this.updateBefore(entity, context);
AppEntity appEntity = this.get(entity.getId(), context);
String originFilePath = appEntity.getFilePath();
String filePath = entity.getFilePath(); String filePath = entity.getFilePath();
String fileName = entity.getFileName(); String fileName = entity.getFileName();
entity.setFilePath(null); //entity.setFilePath(null);
entity.setFileName(null); //entity.setFileName(null);
//判断如果应用下架,通知自助服务终端 //判断如果应用下架,通知自助服务终端
if (entity.getShelves() == YesNoEnum.NO.getValue()) { if (entity.getShelves() == YesNoEnum.NO.getValue()) {
...@@ -393,11 +410,42 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -393,11 +410,42 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
entity.setFileName(fileName); entity.setFileName(fileName);
entity.setFilePath(filePath); entity.setFilePath(filePath);
this.updateAfter(entity, context); this.updateAfter(entity, context);
//判断只有附件地址不等时候,才更新版本
if (!ObjectUtils.isEmpty(filePath) && !filePath.equals(originFilePath)) {
AppVersionQuery appVersionQuery = new AppVersionQuery();
appVersionQuery.setAppId(entity.getId());
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("version", OrderCol.DESCENDING));
appVersionQuery.setOrderColList(orderColList);
List<AppVersionEntity> appVersionEntities = appVersionService.find(appVersionQuery, context);
//获取最大版本号
if (!ObjectUtils.isEmpty(appVersionEntities)) {
AppVersionEntity curAppVersionEntity = appVersionEntities.get(0);
// String versionNum = StrUtil.subAfter(curAppVersionEntity.getVersion(), Constant.VERSION_PREFIX, false);
Integer versionNum = curAppVersionEntity.getVersion();
Integer newVersionNum = ++versionNum;
AppVersionEntity appVersionEntity = new AppVersionEntity();
appVersionEntity.initAttrValue();
AppVersionEntity versionEntity = new AppVersionEntity();
versionEntity.initAttrValue();
versionEntity.setAppId(entity.getId());
versionEntity.setAppName(entity.getAppName());
versionEntity.setVersion(newVersionNum);
versionEntity.setNotes(entity.getNotes());
versionEntity.setFileName(entity.getFileName());
versionEntity.setFilePath(entity.getFilePath());
versionEntity.setDistributeFilePath(entity.getDistributeFilePath());
versionEntity.setCreateTime(new Date());
versionEntity.setCreateUserId(this.getContextUserId(context));
appVersionService.save(versionEntity, context);
}
}
return entity; return entity;
} }
}
}
/*
@Override @Override
protected void updateAfter(AppEntity entity, Context context) throws AppException { protected void updateAfter(AppEntity entity, Context context) throws AppException {
...@@ -430,7 +478,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -430,7 +478,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
} }
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }*/
@Override @Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
......
...@@ -201,7 +201,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -201,7 +201,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
} }
List<AppEntity> appEntityList = this.service.find(new AppQuery().idList(appQuery.getIdList()), getContext()); List<AppEntity> appEntityList = this.service.find(new AppQuery().idList(appQuery.getIdList()), getContext());
List<SiteEntity> siteEntityList = siteService.find(new SiteQuery().idList(appQuery.getSiteIdList()), getContext()); List<SiteEntity> siteEntityList = siteService.find(new SiteQuery().idList(appQuery.getSiteIdList()), getContext());
Rest<String> cloneRest = this.service.cloneAppsBySites(appEntityList, siteEntityList, getContext()); this.service.cloneAppsBySites(appEntityList, siteEntityList, getContext());
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error("自助服务应用部署", e); log.error("自助服务应用部署", e);
......
...@@ -104,7 +104,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV ...@@ -104,7 +104,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
if (appVersionEntity.getUsed() == YesNoEnum.YES.getValue()) { if (appVersionEntity.getUsed() == YesNoEnum.YES.getValue()) {
throw new AppException("当前应用使用中!"); throw new AppException("当前应用使用中!");
} }
Rest<Void> usedRest = this.service.appUsed(appVersionEntity, getContext()); this.service.appUsed(appVersionEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
......
This diff is collapsed.
...@@ -97,8 +97,10 @@ public class UserModelCollectController extends BaseCRUDJsonBodyMappingControlle ...@@ -97,8 +97,10 @@ public class UserModelCollectController extends BaseCRUDJsonBodyMappingControlle
} }
List<ModelFeignVO> result = new ArrayList<>(); List<ModelFeignVO> result = new ArrayList<>();
for(Long id:idList){ for(Long id:idList){
if(map.containsKey(id)) {
result.add(map.get(id)); result.add(map.get(id));
} }
}
model.put("data", result); model.put("data", result);
}catch (Exception e){ }catch (Exception e){
model.put("data", apiResp.getData().get("data")); model.put("data", apiResp.getData().get("data"));
......
...@@ -28,6 +28,7 @@ set JVM_CONFIG=%JVM_CONFIG% -Dapp.port=%PORT% ...@@ -28,6 +28,7 @@ set JVM_CONFIG=%JVM_CONFIG% -Dapp.port=%PORT%
set JVM_CONFIG=%JVM_CONFIG% -Djava.io.tmpdir=%TEMP_PATH% set JVM_CONFIG=%JVM_CONFIG% -Djava.io.tmpdir=%TEMP_PATH%
set JVM_CONFIG=%JVM_CONFIG% -Dbasedir=%BASEDIR% set JVM_CONFIG=%JVM_CONFIG% -Dbasedir=%BASEDIR%
set JVM_CONFIG=%JVM_CONFIG% -Dloader.path=file://%BASEDIR%/conf,file://%BASEDIR%/lib set JVM_CONFIG=%JVM_CONFIG% -Dloader.path=file://%BASEDIR%/conf,file://%BASEDIR%/lib
set JVM_CONFIG=%JVM_CONFIG% -Dfile.encoding=utf-8
set DEBUG_OPTS= set DEBUG_OPTS=
......
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