Commit 000e65b3 authored by 赵啸非's avatar 赵啸非

站点树添加区域名称

parent f889ca8e
......@@ -9,6 +9,9 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.DxTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
......@@ -16,9 +19,12 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.model.vo.MatterInfo;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteEntity;
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.SiteThemeMatterService;
import com.mortals.xhx.module.site.service.SiteThemeService;
import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import com.mortals.xhx.module.window.service.WindowMatterService;
......@@ -69,6 +75,10 @@ public class DemoWebApiController {
private DeptService deptService;
@Autowired
private MatterService matterService;
@Autowired
private SiteThemeService siteThemeService;
@Autowired
private SiteThemeMatterService siteThemeMatterService;
@PostMapping(value = "testGov")
......@@ -111,9 +121,9 @@ public class DemoWebApiController {
public Rest<String> reEventShow() {
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(new SiteMatterQuery());
for (SiteMatterEntity siteMatterEntity : siteMatterEntities) {
if(ObjectUtils.isEmpty(siteMatterEntity.getEventTypeShow())){
if (ObjectUtils.isEmpty(siteMatterEntity.getEventTypeShow())) {
MatterEntity matterEntity = matterService.get(siteMatterEntity.getMatterId());
if(!ObjectUtils.isEmpty(matterEntity)&&!ObjectUtils.isEmpty(matterEntity.getEventTypeShow())){
if (!ObjectUtils.isEmpty(matterEntity) && !ObjectUtils.isEmpty(matterEntity.getEventTypeShow())) {
siteMatterEntity.setEventTypeShow(matterEntity.getEventTypeShow());
siteMatterService.update(siteMatterEntity);
}
......@@ -133,9 +143,9 @@ public class DemoWebApiController {
for (WindowEntity windowEntity : windowEntities) {
String deptName = windowEntity.getDeptName();
//根据部门名称查询部门
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(deptName+"%"));
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(deptName + "%"));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != windowEntity.getDeptId()&&deptEntity.getName().trim().equals(windowEntity.getDeptName().trim())) {
if (deptEntity.getId() != windowEntity.getDeptId() && deptEntity.getName().trim().equals(windowEntity.getDeptName().trim())) {
log.info("部门:{},更新部门id:orgin deptId:{} ,updateDeptId:{}", deptName, windowEntity.getDeptId(), deptEntity.getId());
WindowEntity temp = new WindowEntity();
temp.setId(windowEntity.getId());
......@@ -149,9 +159,9 @@ public class DemoWebApiController {
//更新窗口事项中的部门id
List<WindowMatterEntity> windowMatterEntities = windowMatterService.find(new WindowMatterQuery());
for (WindowMatterEntity windowMatterEntity : windowMatterEntities) {
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(windowMatterEntity.getDeptName()+"%"));
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(windowMatterEntity.getDeptName() + "%"));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != windowMatterEntity.getDeptId()&&windowMatterEntity.getDeptName().trim().equals(deptEntity.getName())) {
if (deptEntity.getId() != windowMatterEntity.getDeptId() && windowMatterEntity.getDeptName().trim().equals(deptEntity.getName())) {
WindowMatterEntity temp = new WindowMatterEntity();
temp.setId(windowMatterEntity.getId());
temp.setDeptId(deptEntity.getId());
......@@ -164,9 +174,9 @@ public class DemoWebApiController {
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(new SiteMatterQuery());
for (SiteMatterEntity siteMatterEntity : siteMatterEntities) {
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(siteMatterEntity.getDeptName()+"%"));
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(siteMatterEntity.getDeptName() + "%"));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != siteMatterEntity.getDeptId()&&siteMatterEntity.getDeptName().trim().equals(deptEntity.getName().trim())) {
if (deptEntity.getId() != siteMatterEntity.getDeptId() && siteMatterEntity.getDeptName().trim().equals(deptEntity.getName().trim())) {
SiteMatterEntity temp = new SiteMatterEntity();
temp.setId(siteMatterEntity.getId());
temp.setDeptId(deptEntity.getId());
......@@ -182,6 +192,20 @@ public class DemoWebApiController {
}
@PostMapping(value = "syncThemeMatter")
@UnAuth
public Rest<String> syncThemeMatter(@RequestBody SiteEntity siteEntity) {
siteThemeMatterService.deleteGovBySiteId(siteEntity.getId(), null);
Rest<String> grRest = siteThemeMatterService.syncThemeMatterBySiteId(siteEntity.getId(), "2", null);
log.info("同步站点主题个人事项:" + JSON.toJSONString(grRest));
log.info("同步站点法人主题事项开始.....");
Rest<String> frRest = siteThemeMatterService.syncThemeMatterBySiteId(siteEntity.getId(), "3", null);
log.info("同步站点主题法人事项:" + JSON.toJSONString(frRest));
return Rest.ok();
}
public static void main(String[] args) {
HttpClient http = null;
CookieStore httpCookieStore = new BasicCookieStore();
......
......@@ -204,7 +204,7 @@ public class MatterTypeHtmlParseUtil {
continue;
}
String onclick = element.firstElementChild().attr("onclick");
href = StrUtil.subBetween(onclick, "ywblurl('", "',");
href = StrUtil.subBetween(onclick, "ywblurl('", "'");
if (ObjectUtils.isEmpty(href)) {
continue;
}
......@@ -220,7 +220,7 @@ public class MatterTypeHtmlParseUtil {
String title = element.attr("title");
// String href = element.attr("href");
String onclick = element.attr("onclick");
String href = StrUtil.subBetween(onclick, "ywblurl('", "',");
String href = StrUtil.subBetween(onclick, "ywblurl('", "'");
if (ObjectUtils.isEmpty(href)) {
System.out.println("子项 href is empty!,dom:" + dom.html());
continue;
......@@ -251,7 +251,7 @@ public class MatterTypeHtmlParseUtil {
}
String title = element.attr("title");
String onclick = element.attr("onclick");
String href = StrUtil.subBetween(onclick, "ywblurl('", "',");
String href = StrUtil.subBetween(onclick, "ywblurl('", "'");
if (ObjectUtils.isEmpty(href)) {
continue;
}
......@@ -266,7 +266,7 @@ public class MatterTypeHtmlParseUtil {
}
String title = element.attr("title");
String onclick = element.attr("onclick");
String href = StrUtil.subBetween(onclick, "ywblurl('", "',");
String href = StrUtil.subBetween(onclick, "ywblurl('", "'");
if (ObjectUtils.isEmpty(href)) {
log.info("子项 href is empty!,dom:" + element.html());
continue;
......
......@@ -85,16 +85,13 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} else {
domainUrl = "";
}
}
for (AppEntity item : list) {
List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context);
item.setApplianceSiteScope(appEntityList.size());
item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
//构建访问地址
SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString());
if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html
if (!ObjectUtils.isEmpty(domainUrl)) {
......@@ -103,7 +100,6 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} else {
item.setCustUrl(CUSTAPP_ROOT_PATH + "/" + siteEntity.getSiteCode() + "/" + item.getAppCode() + "/" + item.getVersion() + "/");
}
} else {
item.setCustUrl("");
}
......
......@@ -46,11 +46,18 @@ public class SiteTreeSelect implements Serializable {
* 节点名称
*/
private String label;
/**
* 区域编码
*/
private String areaCode;
/**
* 区域名称
*
*/
private String areaName;
/**
* 为区域时 层级
*/
......@@ -115,6 +122,7 @@ public class SiteTreeSelect implements Serializable {
this.icon = "el-icon-wind-power";
this.detailAddress=collect.stream().map(item -> item.getDetailAddress()).collect(Collectors.joining(","));
this.areaCode=collect.stream().map(item -> item.getAreaCode()).collect(Collectors.joining(","));
this.areaName=collect.stream().map(item -> item.getAreaName()).collect(Collectors.joining(","));
this.longitude = collect.stream().map(item -> item.getLongitude()).collect(Collectors.joining(","));
this.latitude = collect.stream().map(item -> item.getLatitude()).collect(Collectors.joining(","));
} else {
......
......@@ -64,7 +64,7 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
params.put("type", "1");
params.put("theme", "");
//获取主题
//获取主题
Rest<Map<String, Integer>> themeMatterRest = MatterTypeHtmlParseUtil.getThemeMatterPage(params, url);
Integer totalTheme = themeMatterRest.getData().get("total");
Integer sum = 0;
......@@ -82,9 +82,9 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
for (int i = 1; i <= pageNum; i++) {
params.put("pageno", String.valueOf(i));
Rest<List<MatterEntity>> restList = null;
if (userType == "2") {
if ( "2".equals(userType)) {
restList = MatterTypeHtmlParseUtil.getGrThemeMatterList(params, url);
} else if (userType == "3") {
} else if ("3".equals(userType)) {
restList = MatterTypeHtmlParseUtil.getFrThemeMatterList(params, url);
}
......
......@@ -263,7 +263,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
}
public static void main(String[] args) throws Exception {
System.out.println(SecurityUtil.md5DoubleEncoding("123456"));
System.out.println(SecurityUtil.md5DoubleEncoding("adminADMIN123!@#"));
}
......
......@@ -3,7 +3,7 @@
POST {{baseUrl}}/dept/list
Content-Type: application/json
{"isBkb":1,"siteId":1,"page":"1","size":"10","orderColList":[{"colName":"sort","sortKind":"desc"}]}
{"siteId":1,"page":"1","size":"-1","orderColList":[{"colName":"sort","sortKind":"desc"}]}
###部门更新与保存
......
......@@ -106,6 +106,13 @@ Content-Type: application/json
{}
###testre
POST {{baseUrl}}/test/syncThemeMatter
Content-Type: application/json
{"id": 1}
###midsign
POST {{baseUrl}}/mid/sign
Content-Type: application/json
......
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