Commit 29bc0b2a authored by 赵啸非's avatar 赵啸非

添加站点主题事项

parent bff21970
...@@ -9533,6 +9533,8 @@ data|object|数据对象 ...@@ -9533,6 +9533,8 @@ data|object|数据对象
  updateUserId|Long|更新用户   updateUserId|Long|更新用户
  updateTime|Date|更新时间   updateTime|Date|更新时间
  serviceApi|String|服务接口地址   serviceApi|String|服务接口地址
  custUrl|String|自主应用前端访问地址
  appIconUrl|String|自主应用前端图标地址
dict|object|字典对象 dict|object|字典对象
 type|object|字典属性对象,详见附录  type|object|字典属性对象,详见附录
 shelves|object|字典属性对象,详见附录  shelves|object|字典属性对象,详见附录
...@@ -9603,6 +9605,8 @@ data|object|数据对象 ...@@ -9603,6 +9605,8 @@ data|object|数据对象
 updateUserId|Long|更新用户  updateUserId|Long|更新用户
 updateTime|Date|更新时间  updateTime|Date|更新时间
 serviceApi|String|服务接口地址  serviceApi|String|服务接口地址
 custUrl|String|自主应用前端访问地址
 appIconUrl|String|自主应用前端图标地址
dict|object|字典对象 dict|object|字典对象
 type|object|字典属性对象,详见附录  type|object|字典属性对象,详见附录
 shelves|object|字典属性对象,详见附录  shelves|object|字典属性对象,详见附录
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
public enum JointInfoShowEnum {
公共服务部("公共服务部", "公共服务部"),
党政建设部("党政建设部", "党政建设部"),
网络理政部("网络理政部", "网络理政部");
private String value;
private String desc;
JointInfoShowEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static JointInfoShowEnum getByValue(String value) {
for (JointInfoShowEnum isLackEnum : JointInfoShowEnum.values()) {
if (isLackEnum.getValue() == value) {
return isLackEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (JointInfoShowEnum item : JointInfoShowEnum.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
...@@ -27,5 +27,9 @@ public class AppVo extends BaseEntityLong { ...@@ -27,5 +27,9 @@ public class AppVo extends BaseEntityLong {
* 自主应用访问地址 * 自主应用访问地址
*/ */
private String custUrl; private String custUrl;
/**
* 图标访问地址
*/
private String appIconUrl;
} }
\ No newline at end of file
...@@ -86,12 +86,11 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -86,12 +86,11 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context); List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context);
item.setApplianceSiteScope(appEntityList.size()); item.setApplianceSiteScope(appEntityList.size());
item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList())); item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
//构建访问地址 //构建访问地址
SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString()); SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString());
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
if (!ObjectUtils.isEmpty(siteEntity)) { if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html //请求地址 http://domian/app/siteCode/appcode/html
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
item.setCustUrl(UrlBuilder.of(domainUrl) item.setCustUrl(UrlBuilder.of(domainUrl)
.addPath(CUSTAPP_ROOT_PATH) .addPath(CUSTAPP_ROOT_PATH)
.addPath(siteEntity.getSiteCode()) .addPath(siteEntity.getSiteCode())
...@@ -101,10 +100,10 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -101,10 +100,10 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} else { } else {
item.setCustUrl(""); item.setCustUrl("");
} }
//构建图标地址
item.setAppIconUrl(UrlBuilder.of(domainUrl)
.addPath(item.getFilePath()).toString());
}); });
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
} }
......
...@@ -31,11 +31,11 @@ import com.mortals.xhx.module.matters.model.MattersEntity; ...@@ -31,11 +31,11 @@ import com.mortals.xhx.module.matters.model.MattersEntity;
import com.mortals.xhx.module.matters.model.MattersQuery; import com.mortals.xhx.module.matters.model.MattersQuery;
import com.mortals.xhx.module.matters.service.MattersDetailService; import com.mortals.xhx.module.matters.service.MattersDetailService;
import com.mortals.xhx.module.matters.service.MattersService; import com.mortals.xhx.module.matters.service.MattersService;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.*;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.service.SiteMatterService; import com.mortals.xhx.module.site.service.SiteMatterService;
import com.mortals.xhx.module.site.service.SiteService; 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 org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
...@@ -88,20 +88,52 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -88,20 +88,52 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
private DeptService deptService; private DeptService deptService;
@Autowired @Autowired
private MatterExtService matterExtService; private MatterExtService matterExtService;
@Autowired
private SiteThemeMatterService siteThemeMatterService;
@Autowired
private SiteThemeService siteThemeService;
@Override @Override
protected void saveBefore(MatterEntity entity, Context context) throws AppException { protected void saveBefore(MatterEntity entity, Context context) throws AppException {
//判断如果是自定义事项,需要更新区域编码 //判断如果是自定义事项,需要更新区域编码
if(SourceEnum.自定义.getValue().equals(entity.getSource())){ if (SourceEnum.自定义.getValue().equals(entity.getSource())) {
if(!ObjectUtils.isEmpty(entity.getSiteId())){ if (!ObjectUtils.isEmpty(entity.getSiteId())) {
SiteEntity siteEntity = siteService.get(entity.getSiteId(), context); SiteEntity siteEntity = siteService.get(entity.getSiteId(), context);
entity.setAreaCode(siteEntity.getAreaCode()); entity.setAreaCode(siteEntity.getAreaCode());
} }
} }
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void saveAfter(MatterEntity entity, Context context) throws AppException {
//主题添加自定义关联
if (!ObjectUtils.isEmpty(entity.getThemeCode())) {
SiteThemeEntity siteThemeEntity = siteThemeService.selectOne(new SiteThemeQuery().siteId(entity.getSiteId()).themeCode(entity.getThemeCode()));
SiteThemeMatterEntity siteThemeMatterEntity = new SiteThemeMatterEntity();
siteThemeMatterEntity.initAttrValue();
siteThemeMatterEntity.setThemeCode(entity.getThemeCode());
siteThemeMatterEntity.setSiteId(entity.getSiteId());
siteThemeMatterEntity.setSource(entity.getSource());
siteThemeMatterEntity.setMatterId(entity.getId());
siteThemeMatterEntity.setMatterCode(entity.getMatterNo());
siteThemeMatterEntity.setMatterName(entity.getMatterName());
siteThemeMatterEntity.setUserType(siteThemeEntity == null ? "2" : siteThemeEntity.getUserType());
siteThemeMatterEntity.setCreateTime(new Date());
siteThemeMatterEntity.setCreateUserId(this.getContextUserId(context));
siteThemeMatterService.save(siteThemeMatterEntity, context);
}
super.saveAfter(entity, context);
}
@Override @Override
protected void updateBefore(MatterEntity entity, Context context) throws AppException { protected void updateBefore(MatterEntity entity, Context context) throws AppException {
......
...@@ -12,8 +12,11 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; ...@@ -12,8 +12,11 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController; import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.framework.config.InterceptorConfig; import com.mortals.xhx.base.framework.config.InterceptorConfig;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.JointInfoShowEnum;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterService; import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteThemeQuery;
import com.mortals.xhx.module.site.service.SiteThemeService;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -44,6 +47,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -44,6 +47,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Autowired @Autowired
private InterceptorConfig interceptorConfig; private InterceptorConfig interceptorConfig;
private SiteThemeService siteThemeService;
public MatterController() { public MatterController() {
super.setFormClass(MatterForm.class); super.setFormClass(MatterForm.class);
super.setModuleDesc("基础事项"); super.setModuleDesc("基础事项");
...@@ -84,6 +89,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -84,6 +89,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
this.addDict(model, "parson", paramService.getParamBySecondOrganize("Matter", "parson")); this.addDict(model, "parson", paramService.getParamBySecondOrganize("Matter", "parson"));
this.addDict(model, "lengal", paramService.getParamBySecondOrganize("Matter", "lengal")); this.addDict(model, "lengal", paramService.getParamBySecondOrganize("Matter", "lengal"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("Matter", "source")); this.addDict(model, "source", paramService.getParamBySecondOrganize("Matter", "source"));
this.addDict(model, "jointInfoShow", JointInfoShowEnum.getEnumMap());
Setting baseInfoSetting = interceptorConfig.getBaseInfoSetting(); Setting baseInfoSetting = interceptorConfig.getBaseInfoSetting();
Map<String, String> baseInfoMap = new HashMap<>(); Map<String, String> baseInfoMap = new HashMap<>();
...@@ -102,7 +108,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -102,7 +108,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
} }
}); });
this.addDict(model, "sqclInfo", sqclInfoMap); this.addDict(model, "sqclInfo", sqclInfoMap);
//theme
Map<String, String> themeMap = siteThemeService.find(new SiteThemeQuery()).stream().collect(Collectors.toMap(x -> x.getThemeCode(), y -> y.getThemeName(), (o, n) -> n));
this.addDict(model, "theme", themeMap);
super.init(model, context); super.init(model, context);
} }
......
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