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;
import com.mortals.framework.util.DataUtil;
import com.mortals.xhx.common.code.SourceEnum;
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.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
......@@ -126,7 +129,7 @@ public class MatterHtmlParseUtil {
log.info("error href ,title:" + title);
}
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl);
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
}
elements = dom.selectXpath(matterListLiExp);
......@@ -171,7 +174,7 @@ public class MatterHtmlParseUtil {
}
}
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl);
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
}
break;
......@@ -187,13 +190,23 @@ public class MatterHtmlParseUtil {
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);
String itemCode = builder.getQuery().get("itemCode").toString();
String taskType = builder.getQuery().get("taskType").toString();
String deptCode = builder.getQuery().get("deptCode").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.initAttrValue();
matterEntity.setTcode(itemCode);
......
......@@ -72,7 +72,7 @@ public class SyncGovMatterDetailThread implements Runnable {
@Override
public void run() {
log.info("同步站点事项开始.....");
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context);
deptService.syncDeptBySiteId(siteEntity, context);
//log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context);
//Rest<String> rest = Rest.ok();
......
......@@ -180,7 +180,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
}
//部署路径是否存在 如果不存在 创建目录,
//文件构成目录 /home/publish/app/common
String disPath = "/home/publish/app/common";
String disPath = "/home/publish/app";
//判断目标目录是否存在 如果存在 这删除
if (FileUtil.isDirectory(disPath)) {
......@@ -221,6 +221,21 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
appClone.setDistributeFilePath("");
appClone.setShelves(YesNoEnum.NO.getValue());
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();
if (!ObjectUtils.isEmpty(appDatasetList)) {
......@@ -288,7 +303,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
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);
if (!ObjectUtils.isEmpty(delIds)) {
appDatasetService.remove(delIds, context);
......@@ -375,10 +390,12 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
@Override
public AppEntity update(AppEntity entity, Context context) throws AppException {
this.updateBefore(entity, context);
AppEntity appEntity = this.get(entity.getId(), context);
String originFilePath = appEntity.getFilePath();
String filePath = entity.getFilePath();
String fileName = entity.getFileName();
entity.setFilePath(null);
entity.setFileName(null);
//entity.setFilePath(null);
//entity.setFileName(null);
//判断如果应用下架,通知自助服务终端
if (entity.getShelves() == YesNoEnum.NO.getValue()) {
......@@ -393,11 +410,42 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
entity.setFileName(fileName);
entity.setFilePath(filePath);
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;
}
}
}
/*
@Override
protected void updateAfter(AppEntity entity, Context context) throws AppException {
......@@ -430,7 +478,7 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
}
super.updateAfter(entity, context);
}
}*/
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
......
......@@ -201,7 +201,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}
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());
this.service.cloneAppsBySites(appEntityList, siteEntityList, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("自助服务应用部署", e);
......
......@@ -104,7 +104,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
if (appVersionEntity.getUsed() == YesNoEnum.YES.getValue()) {
throw new AppException("当前应用使用中!");
}
Rest<Void> usedRest = this.service.appUsed(appVersionEntity, getContext());
this.service.appUsed(appVersionEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
......
This diff is collapsed.
......@@ -97,7 +97,9 @@ public class UserModelCollectController extends BaseCRUDJsonBodyMappingControlle
}
List<ModelFeignVO> result = new ArrayList<>();
for(Long id:idList){
result.add(map.get(id));
if(map.containsKey(id)) {
result.add(map.get(id));
}
}
model.put("data", result);
}catch (Exception e){
......
......@@ -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% -Dbasedir=%BASEDIR%
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=
......
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