Commit 640150cf authored by “yiyousong”'s avatar “yiyousong”
parents c069c9ef 4afd764c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
-- ----------------------------
-- 数据授权权限表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_dimension`;
CREATE TABLE `mortals_xhx_dimension` (
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`dimension_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度编码',
`dimension_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度名称',
`dimension_value` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度值',
`dimension_type` tinyint(2) DEFAULT '1' COMMENT '维度类型(1.固定值,2.系统上下问变量)',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='授权维度';
-- ----------------------------
-- 角色资源授权规则表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_dimension_resource_rule`;
CREATE TABLE `mortals_xhx_dimension_resource_rule` (
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
`role_name` varchar(64) DEFAULT NULL COMMENT '角色名称',
`resource_id` bigint(20) DEFAULT NULL COMMENT '资源ID',
`resource_name` varchar(64) DEFAULT NULL COMMENT '资源名称',
`rule_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则编码',
`rule_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则名称',
`rule_condition` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'IN' COMMENT '规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)',
`rule_value` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则值,固定值或者系统变量',
`rule_type` tinyint(2) DEFAULT '1' COMMENT '规则值类型(1.固定值,2.系统上下问变量)',
`create_time` datetime COMMENT '创建时间',
`create_user_id` bigint(20) COMMENT '创建用户',
`update_user_id` bigint(20) COMMENT '更新用户',
`update_time` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色资源维度规则表';
...@@ -235,7 +235,12 @@ ...@@ -235,7 +235,12 @@
<groupId>com.mortals.framework</groupId> <groupId>com.mortals.framework</groupId>
<artifactId>mortals-framework-annotation</artifactId> <artifactId>mortals-framework-annotation</artifactId>
</dependency> </dependency>
<!-- 达梦数据库驱动-->
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.1.193</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
@Aspect @Aspect
@Slf4j @Slf4j
//@Component @Component
public class DataPermissionAspect { public class DataPermissionAspect {
@Autowired @Autowired
...@@ -57,7 +57,6 @@ public class DataPermissionAspect { ...@@ -57,7 +57,6 @@ public class DataPermissionAspect {
List<DimensionResourceRuleEntity> componentRules = dimensionResourceRuleService.getRoleComponentRule(loginUser.getId(), componentRoute); List<DimensionResourceRuleEntity> componentRules = dimensionResourceRuleService.getRoleComponentRule(loginUser.getId(), componentRoute);
if (!ObjectUtils.isEmpty(componentRules)) { if (!ObjectUtils.isEmpty(componentRules)) {
//在request添加属性 //在request添加属性
//todo 构建数据权限sql 并设置到request中。
String permissionSql = RuleQueryGenerator.getPermissionSql(componentRules, loginUser); String permissionSql = RuleQueryGenerator.getPermissionSql(componentRules, loginUser);
log.info("permissionSql:{}", permissionSql); log.info("permissionSql:{}", permissionSql);
......
package com.mortals.xhx.base.system.param.web; package com.mortals.xhx.base.system.param.web;
import cn.hutool.core.net.Ipv4Util;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.IpUtils;
import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.code.PageDisplayType; import com.mortals.framework.common.code.PageDisplayType;
...@@ -10,7 +12,10 @@ import com.mortals.framework.model.Context; ...@@ -10,7 +12,10 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.util.FileUtil; import com.mortals.framework.util.FileUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.model.ParamQuery;
import com.mortals.xhx.module.site.model.SiteQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
...@@ -24,6 +29,9 @@ import javax.servlet.http.HttpServletResponse; ...@@ -24,6 +29,9 @@ import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL;
/** /**
* 参数信息 * 参数信息
...@@ -36,7 +44,6 @@ import java.util.Map; ...@@ -36,7 +44,6 @@ import java.util.Map;
public class ParamController extends BaseCRUDJsonBodyMappingController<ParamService, ParamEntity, Long> { public class ParamController extends BaseCRUDJsonBodyMappingController<ParamService, ParamEntity, Long> {
public ParamController() { public ParamController() {
super.setFormClass(ParamForm.class);
super.setModuleDesc("参数信息"); super.setModuleDesc("参数信息");
} }
...@@ -102,6 +109,43 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -102,6 +109,43 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
} }
/**
* 更新终端访问服务器应用ip地址
*/
@GetMapping(value = "updateServerIp")
@UnAuth
public String updateServerip(String serverIp) {
JSONObject jsonObject = new JSONObject();
try {
//校验ip地址
boolean ipv4 = IpUtils.isIpv4(serverIp);
if (!ipv4) {
throw new AppException("请输入正确的ip地址");
}
ParamQuery paramQuery = new ParamQuery();
paramQuery.setParamKey(PARAM_SERVER_HTTP_URL);
ParamEntity paramEntity = this.service.selectOne(paramQuery);
if (!ObjectUtils.isEmpty(paramEntity)) {
//paramEntity.setParamValue(serverIp);
String value = "http://" + serverIp + ":11078";
paramEntity.setParamValue(value);
this.service.update(paramEntity);
}
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "更新终端访问服务端ip成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
private Map<String, Object> getPageDisplayType() { private Map<String, Object> getPageDisplayType() {
PageDisplayType[] pageDisplayTypes = PageDisplayType.values(); PageDisplayType[] pageDisplayTypes = PageDisplayType.values();
Map<String, Object> result = new HashMap<>(pageDisplayTypes.length); Map<String, Object> result = new HashMap<>(pageDisplayTypes.length);
...@@ -112,7 +156,10 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -112,7 +156,10 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
} }
public static void main(String[] args) { public static void main(String[] args) {
FileUtil.delete("E:\\pic\\1.png"); //FileUtil.delete("E:\\pic\\1.png");
System.out.println(IpUtils.isIpv4("10.102.252.13"));
} }
} }
\ No newline at end of file
/**
* 文件:ParamForm.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.param.web;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.web.BaseCRUDFormLong;
import com.mortals.xhx.base.system.param.model.ParamEntity;
import com.mortals.xhx.base.system.param.model.ParamQuery;
/**
* <p>Title: 参数信息</p>
* <p>Description: ParamForm </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public class ParamForm extends BaseCRUDFormLong<ParamEntity> {
private ParamEntity entity = new ParamEntity();
private ParamQuery query = new ParamQuery();
public ParamForm(){
}
@Override
public ParamEntity getEntity() {
return entity;
}
public void setEntity(ParamEntity entity) {
this.entity = entity;
}
@Override
public ParamQuery getQuery() {
return query;
}
public void setQuery(ParamQuery query) {
this.query = query;
}
public static void main(String[] args) {
ParamForm form = new ParamForm();
String entityName =form.getEntity().getClass().getSimpleName();
System.out.println(entityName);
if ((entityName = entityName.substring(0, 1).toLowerCase() + entityName.substring(1, entityName.length())).endsWith("Entity")) {
entityName = entityName.substring(0, entityName.length() - "Entity".length());
}
System.out.println(entityName);
System.out.println(JSON.toJSONString(form));
}
}
\ No newline at end of file
...@@ -479,8 +479,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -479,8 +479,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
//eba467f81fb265befdf1f6ab041d39ab 原始admin密码 //eba467f81fb265befdf1f6ab041d39ab 原始admin密码
System.out.println(SecurityUtil.md5DoubleEncoding("xhxADMIN8@a")); System.out.println(SecurityUtil.md5DoubleEncoding(" 123456 "));
// System.out.println(SecurityUtil.md5DoubleEncoding("123")); System.out.println(SecurityUtil.md5DoubleEncoding("123"));
// System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@")); // System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@"));
/* /*
......
...@@ -21,11 +21,11 @@ import com.mortals.xhx.module.dept.model.DeptQuery; ...@@ -21,11 +21,11 @@ import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; 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.module.matter.model.MatterQuery; import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterExtService;
import com.mortals.xhx.module.matter.service.MatterService; import com.mortals.xhx.module.matter.service.MatterService;
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.SiteThemeMatterService; import com.mortals.xhx.module.site.service.SiteThemeMatterService;
import com.mortals.xhx.module.site.service.SiteThemeService; import com.mortals.xhx.module.site.service.SiteThemeService;
import com.mortals.xhx.module.window.model.WindowEntity; import com.mortals.xhx.module.window.model.WindowEntity;
...@@ -47,10 +47,7 @@ import org.springframework.util.ObjectUtils; ...@@ -47,10 +47,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -82,6 +79,13 @@ public class DemoWebApiController { ...@@ -82,6 +79,13 @@ public class DemoWebApiController {
private AppDatasetService appDatasetService; private AppDatasetService appDatasetService;
@Autowired @Autowired
private AppInfoFieldService appInfoFieldService; private AppInfoFieldService appInfoFieldService;
@Autowired
private MatterExtService matterExtService;
@Autowired
private SiteService siteService;
@Autowired
private SiteThemeService siteThemeService;
@PostMapping(value = "testGov") @PostMapping(value = "testGov")
...@@ -322,6 +326,116 @@ public class DemoWebApiController { ...@@ -322,6 +326,116 @@ public class DemoWebApiController {
} }
@PostMapping(value = "saveSiteMatters")
@UnAuth
public Rest<String> saveSiteMatters(@RequestBody SiteQuery siteQuery) {
log.info("保存站点事项相关==");
//复制部门
Long copySiteId = siteQuery.getCopySiteId();
Long targetSiteId = siteQuery.getTargetSiteId();
List<DeptEntity> deptEntityList = deptService.find(new DeptQuery().siteId(copySiteId).source(SourceEnum.政务网.getValue()));
deptEntityList.stream().forEach(item -> {
item.setSiteId(targetSiteId);
item.setId(null);
item.setDeptNumber(item.getDeptNumber() + "_" + targetSiteId);
});
deptService.save(deptEntityList);
SiteEntity siteEntity = siteService.get(targetSiteId);
//保存站点事项
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteQuery.getAreaCode()).source(SourceEnum.政务网.getValue()));
List<SiteMatterEntity> targetSiteMatterEntities = new ArrayList<>();
for (MatterEntity matterEntity : matterList) {
DeptEntity deptEntity = deptService.getExtCache(matterEntity.getDeptCode());
SiteMatterEntity siteMatterEntity = new SiteMatterEntity();
siteMatterEntity.initAttrValue();
//SiteEntity siteEntity = siteService.get(siteId);
siteMatterEntity.setSiteId(siteEntity.getId());
siteMatterEntity.setSiteName(siteEntity.getSiteName());
siteMatterEntity.setMatterId(matterEntity.getId());
siteMatterEntity.setMatterCode(matterEntity.getMatterNo());
siteMatterEntity.setMatterName(matterEntity.getMatterName());
siteMatterEntity.setSource(matterEntity.getSource());
siteMatterEntity.setEventTypeShow(matterEntity.getEventTypeShow());
siteMatterEntity.setDeptName(deptEntity == null ? "" : deptEntity.getName());
siteMatterEntity.setDeptId(deptEntity == null ? -1L : deptEntity.getId());
siteMatterEntity.setDeptCode(deptEntity == null ? "" : deptEntity.getDeptNumber());
siteMatterEntity.setCreateUserId(1L);
siteMatterEntity.setCreateTime(new Date());
targetSiteMatterEntities.add(siteMatterEntity);
}
siteMatterService.save(targetSiteMatterEntities);
//同步主题
List<SiteThemeEntity> siteThemeEntities = siteThemeService.find(new SiteThemeQuery().siteId(copySiteId));
for (SiteThemeEntity siteThemeEntity : siteThemeEntities) {
siteThemeEntity.setId(null);
siteThemeEntity.setSiteId(targetSiteId);
}
siteThemeService.save(siteThemeEntities);
List<SiteThemeMatterEntity> siteThemeMatterEntities = siteThemeMatterService.find(new SiteThemeMatterQuery().siteId(copySiteId));
for (SiteThemeMatterEntity siteThemeMatterEntity : siteThemeMatterEntities) {
siteThemeMatterEntity.setId(null);
siteThemeMatterEntity.setSiteId(targetSiteId);
siteThemeMatterEntity.setSiteName(siteEntity.getSiteName());
}
siteThemeMatterService.save(siteThemeMatterEntities);
return Rest.ok();
}
@PostMapping(value = "saveSiteMattersTwo")
@UnAuth
public Rest<String> saveSiteMattersTwo(@RequestBody SiteQuery siteQuery) {
log.info("保存站点事项相关222==");
//复制部门
Long copySiteId = siteQuery.getCopySiteId();
Long targetSiteId = siteQuery.getTargetSiteId();
SiteEntity siteEntity = siteService.get(targetSiteId);
/* Long[] ids = siteMatterService.find(new SiteMatterQuery().siteId(targetSiteId)).stream().map(SiteMatterEntity::getId).toArray(Long[]::new);
siteMatterService.remove(ids,null);*/
Map<String, Long> targetDeptMap = deptService.find(new DeptQuery().siteId(targetSiteId)).stream().collect(Collectors.toMap(x -> x.getDeptNumber(), y -> y.getId(), (o, n) -> n));
SiteMatterQuery siteMatterQuery = new SiteMatterQuery();
siteMatterQuery.setSiteId(targetSiteId);
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(siteMatterQuery);
List<SiteMatterEntity> targetSiteMatterEntities = new ArrayList<>();
for (SiteMatterEntity siteMatterEntity : siteMatterEntities) {
siteMatterEntity.getDeptId();
String targetDeptCode= siteMatterEntity.getDeptCode()+ "_50";
Long targetDeptId = targetDeptMap.get(targetDeptCode);
if(!ObjectUtils.isEmpty(targetDeptId)){
siteMatterEntity.setDeptId(targetDeptId);
siteMatterEntity.setDeptCode(targetDeptCode);
targetSiteMatterEntities.add(siteMatterEntity);
}
}
if(!ObjectUtils.isEmpty(targetSiteMatterEntities)){
siteMatterService.update(targetSiteMatterEntities);
}
return Rest.ok();
}
@PostMapping(value = "limit") @PostMapping(value = "limit")
@UnAuth @UnAuth
//@TokenBucketLimit //@TokenBucketLimit
...@@ -354,7 +468,7 @@ public class DemoWebApiController { ...@@ -354,7 +468,7 @@ public class DemoWebApiController {
sb.append(String.format("INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, %s, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', '');", appDatasetEntity.getId())); sb.append(String.format("INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, %s, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', '');", appDatasetEntity.getId()));
sb.append("\n"); sb.append("\n");
} }
log.info("sql:{}",sb.toString()); log.info("sql:{}", sb.toString());
//INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, 755, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', ''); //INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, 755, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', '');
......
...@@ -122,18 +122,12 @@ public final class Constant { ...@@ -122,18 +122,12 @@ public final class Constant {
public static final String APP_BASE_DISTRIBUTE_PATH = "app_base_distribute_path"; public static final String APP_BASE_DISTRIBUTE_PATH = "app_base_distribute_path";
/**
* 版本前缀
*/
public static final String VERSION_PREFIX = "V";
/** /**
* 服务器http * 服务器http
*/ */
public final static String PARAM_SERVER_HTTP_URL = "server_http_url"; public final static String PARAM_SERVER_HTTP_URL = "server_http_url";
/** /**
* 服务器http * php服务器http
*/ */
public final static String PARAM_SERVER_PHP_HTTP_URL = "server_php_http_url"; public final static String PARAM_SERVER_PHP_HTTP_URL = "server_php_http_url";
......
...@@ -36,7 +36,7 @@ public class RedisKey { ...@@ -36,7 +36,7 @@ public class RedisKey {
/** /**
* 缓存过期时间(秒) * 缓存过期时间(秒)
*/ */
public static final Long KEY_SEARCH_TIMEOUTT_CACHE = 3600L; public static final Long KEY_SEARCH_TIMEOUTT_CACHE = 1800L;
/** /**
......
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
...@@ -61,14 +62,26 @@ public class StatSiteDeptMatterTaskImpl implements ITaskExcuteService { ...@@ -61,14 +62,26 @@ public class StatSiteDeptMatterTaskImpl implements ITaskExcuteService {
MatterQuery matterQuery = new MatterQuery(); MatterQuery matterQuery = new MatterQuery();
matterQuery.setEventTypeShowNotList(Arrays.asList("行政处罚")); matterQuery.setEventTypeShowNotList(Arrays.asList("行政处罚"));
int total = matterService.count(matterQuery.source(SourceEnum.政务网.getValue()).deptCode(deptEntity.getDeptNumber()), null); int total = 0;
if (StrUtil.contains(deptEntity.getDeptNumber(), "_")) {
String deptCode = StrUtil.subBefore(deptEntity.getDeptNumber(), "_", true);
total = matterService.count(matterQuery.source(SourceEnum.政务网.getValue()).deptCode(deptCode), null);
} else {
total = matterService.count(matterQuery.source(SourceEnum.政务网.getValue()).deptCode(deptEntity.getDeptNumber()), null);
}
DeptEntity deptQuery = new DeptEntity(); DeptEntity deptQuery = new DeptEntity();
deptQuery.setTotal(total); deptQuery.setTotal(total);
deptQuery.setUpdateTime(new Date()); deptQuery.setUpdateTime(new Date());
//统计入驻事项 //统计入驻事项
SiteMatterQuery siteMatterQuery = new SiteMatterQuery(); SiteMatterQuery siteMatterQuery = new SiteMatterQuery();
siteMatterQuery.setDeptCode(deptEntity.getDeptNumber()); //siteMatterQuery.setDeptCode(deptEntity.getDeptNumber());
siteMatterQuery.setDeptId(deptEntity.getId());
siteMatterQuery.setSource(SourceEnum.政务网.getValue()); siteMatterQuery.setSource(SourceEnum.政务网.getValue());
siteMatterQuery.setHallCheckIn(YesNoEnum.YES.getValue()); siteMatterQuery.setHallCheckIn(YesNoEnum.YES.getValue());
int incount = siteMatterService.count(siteMatterQuery, null); int incount = siteMatterService.count(siteMatterQuery, null);
...@@ -113,4 +126,12 @@ public class StatSiteDeptMatterTaskImpl implements ITaskExcuteService { ...@@ -113,4 +126,12 @@ public class StatSiteDeptMatterTaskImpl implements ITaskExcuteService {
public void stopTask(ITask task) throws AppException { public void stopTask(ITask task) throws AppException {
} }
public static void main(String[] args) {
String deptCode = StrUtil.subBefore("4166885406123696128_50", "_", true);
System.out.println(deptCode);
}
} }
...@@ -28,8 +28,6 @@ import java.util.List; ...@@ -28,8 +28,6 @@ import java.util.List;
@Service("appInfoTempleteFieldService") @Service("appInfoTempleteFieldService")
public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoTempleteFieldDao, AppInfoTempleteFieldEntity, Long> implements AppInfoTempleteFieldService { public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoTempleteFieldDao, AppInfoTempleteFieldEntity, Long> implements AppInfoTempleteFieldService {
@Autowired
private AppService appService;
@Autowired @Autowired
private AppDatasetService appDatasetService; private AppDatasetService appDatasetService;
@Autowired @Autowired
...@@ -46,7 +44,7 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App ...@@ -46,7 +44,7 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App
AppDatasetQuery appDatasetQuery = new AppDatasetQuery(); AppDatasetQuery appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setAppId(entity.getAppId()); appDatasetQuery.setAppId(entity.getAppId());
List<AppDatasetEntity> appDatasetEntities = appDatasetService.find(appDatasetQuery, context); List<AppDatasetEntity> appDatasetEntities = appDatasetService.find(appDatasetQuery, context);
// 判断该数据集 是否已经存在 没存在 再添加 // 判断该数据集 是否已经存在 没存在 再添加
ArrayList<AppInfoFieldEntity> fieldSaveList = new ArrayList<>(); ArrayList<AppInfoFieldEntity> fieldSaveList = new ArrayList<>();
for (AppDatasetEntity appDatasetEntity : appDatasetEntities) { for (AppDatasetEntity appDatasetEntity : appDatasetEntities) {
...@@ -65,7 +63,6 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App ...@@ -65,7 +63,6 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App
fieldSaveList.add(fieldEntity); fieldSaveList.add(fieldEntity);
} }
} }
if (!ObjectUtils.isEmpty(fieldSaveList)) { if (!ObjectUtils.isEmpty(fieldSaveList)) {
appInfoFieldService.save(fieldSaveList, context); appInfoFieldService.save(fieldSaveList, context);
} }
......
...@@ -296,12 +296,9 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -296,12 +296,9 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
public Rest<String> cloneAppBySameSite(AppEntity appEntity, Context context) { public Rest<String> cloneAppBySameSite(AppEntity appEntity, Context context) {
Long sourceAppId = appEntity.getSourceAppId(); Long sourceAppId = appEntity.getSourceAppId();
Long targetAppId = appEntity.getTargetAppId(); Long targetAppId = appEntity.getTargetAppId();
AppEntity sourceAppEntity = this.get(sourceAppId, context); AppEntity sourceAppEntity = this.get(sourceAppId, context);
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);
...@@ -394,9 +391,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -394,9 +391,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
String originFilePath = appEntity.getFilePath(); String originFilePath = appEntity.getFilePath();
String filePath = entity.getFilePath(); String filePath = entity.getFilePath();
String fileName = entity.getFileName(); String fileName = entity.getFileName();
//entity.setFilePath(null);
//entity.setFileName(null);
//判断如果应用下架,通知自助服务终端 //判断如果应用下架,通知自助服务终端
if (entity.getShelves() == YesNoEnum.NO.getValue()) { if (entity.getShelves() == YesNoEnum.NO.getValue()) {
AppPdu appPdu = new AppPdu(); AppPdu appPdu = new AppPdu();
...@@ -445,40 +439,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -445,40 +439,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
} }
/*
@Override
protected void updateAfter(AppEntity entity, Context context) throws AppException {
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);
}
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 {
...@@ -506,7 +466,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -506,7 +466,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
appInfoFieldService.remove(idList, context); appInfoFieldService.remove(idList, context);
} }
} }
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
......
...@@ -35,8 +35,6 @@ import static com.mortals.framework.ap.SysConstains.*; ...@@ -35,8 +35,6 @@ import static com.mortals.framework.ap.SysConstains.*;
@RequestMapping("app/category") @RequestMapping("app/category")
public class AppCategoryController extends BaseCRUDJsonBodyMappingController<AppCategoryService,AppCategoryEntity,Long> { public class AppCategoryController extends BaseCRUDJsonBodyMappingController<AppCategoryService,AppCategoryEntity,Long> {
@Autowired
private ParamService paramService;
public AppCategoryController(){ public AppCategoryController(){
super.setModuleDesc( "自助终端应用分类"); super.setModuleDesc( "自助终端应用分类");
......
...@@ -129,7 +129,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -129,7 +129,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
entity.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList())); entity.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
SiteEntity siteEntity = siteService.getCache(entity.getSiteId().toString()); SiteEntity siteEntity = siteService.getCache(entity.getSiteId().toString());
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"); String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
entity.setCustUrl(UrlBuilder.of(domainUrl) entity.setCustUrl(UrlBuilder.of(domainUrl)
.addPath(CUSTAPP_ROOT_PATH) .addPath(CUSTAPP_ROOT_PATH)
...@@ -244,8 +244,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -244,8 +244,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
public static void main(String[] args) { public static void main(String[] args) {
/* String homeUrl = "app/1/2"; /* String homeUrl = "app/1/2";
String domainUrl = "http://192.168.0.98:11078"; String domainUrl = "http://192.168.0.98:11078";
String s = UrlBuilder.of(domainUrl).addPath("app").addPath("1").addPath("2").toString(); String s = UrlBuilder.of(domainUrl).addPath("app").addPath("1").addPath("2").toString();
......
...@@ -119,8 +119,6 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD ...@@ -119,8 +119,6 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
appDatasetQuery.setFieldCode(query.getFieldCode()); appDatasetQuery.setFieldCode(query.getFieldCode());
appDatasetQuery.setFieldName(query.getFieldName()); appDatasetQuery.setFieldName(query.getFieldName());
appDatasetQuery.setAppId(query.getAppId()); appDatasetQuery.setAppId(query.getAppId());
// String fieldValue = StrUtil.addPrefixIfNot(query.getFieldValue(), "%");
// fieldValue = StrUtil.addSuffixIfNot(fieldValue, "%");
appDatasetQuery.setFieldValue(query.getFieldValue()); appDatasetQuery.setFieldValue(query.getFieldValue());
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context); Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context);
......
...@@ -80,7 +80,6 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV ...@@ -80,7 +80,6 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
List<OrderCol> orderColList = new ArrayList<>(); List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("version", OrderCol.DESCENDING)); orderColList.add(new OrderCol("version", OrderCol.DESCENDING));
query.setOrderColList(orderColList); query.setOrderColList(orderColList);
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
package com.mortals.xhx.module.area.service.impl; package com.mortals.xhx.module.area.service.impl;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.base.service.BaseAreaService;
import com.mortals.xhx.module.site.service.SiteService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.SatusEnum; import com.mortals.xhx.common.code.SatusEnum;
import com.mortals.xhx.module.area.dao.AreaDao; import com.mortals.xhx.module.area.dao.AreaDao;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -195,12 +194,12 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -195,12 +194,12 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
@Override @Override
public List<AreaTreeSelect> getListByParentId(String parentId, Context context) { public List<AreaTreeSelect> getListByParentId(String parentId, Context context) {
if (ObjectUtils.isEmpty(parentId)) { if (ObjectUtils.isEmpty(parentId)) {
parentId = "0"; parentId = "%0%";
} }
//只做一层 //只做一层
List<AreaTreeSelect> collect = this.find(new AreaQuery().pid(parentId), context).stream().map(item -> new AreaTreeSelect(item) List<AreaTreeSelect> collect = this.find(new AreaQuery().pid(parentId), context).stream().map(item -> new AreaTreeSelect(item)
).collect(Collectors.toList()); ).collect(Collectors.toList());
if ("0".equals(parentId)) { if ("%0%".equals(parentId)) {
return collect; return collect;
} }
// AreaEntity areaEntity = this.selectOne(new AreaQuery().iid(parentId)); // AreaEntity areaEntity = this.selectOne(new AreaQuery().iid(parentId));
......
...@@ -34,7 +34,7 @@ public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessM ...@@ -34,7 +34,7 @@ public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessM
super.saveBefore(entity, context); super.saveBefore(entity, context);
int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(entity.getSiteBusinessId()).matterId(entity.getMatterId())); int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(entity.getSiteBusinessId()).matterId(entity.getMatterId()));
if(count>0){ if(count>0){
throw new AppException("当前业务事项已存在,不能新增"); throw new AppException("当前业务事项已存在,不能新增!");
} }
} }
......
...@@ -85,11 +85,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -85,11 +85,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
@Override @Override
protected void updateAfter(BusinessEntity entity, Context context) throws AppException { protected void updateAfter(BusinessEntity entity, Context context) throws AppException {
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
/**
*
*/
@Override @Override
public void run() { public void run() {
//同步更新所有站点 //同步更新所有站点
...@@ -112,11 +108,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -112,11 +108,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
if( !ObjectUtils.isEmpty(windowBusinessEntityList)) { if( !ObjectUtils.isEmpty(windowBusinessEntityList)) {
windowBusinessService.update(windowBusinessEntityList, context); windowBusinessService.update(windowBusinessEntityList, context);
} }
} }
//通知第三方平台 //通知第三方平台
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/inter/device/baseDataSave"; phpUrl += "/inter/device/baseDataSave";
BussinessThirdPartyReq bussinessThirdPartyReq = new BussinessThirdPartyReq(); BussinessThirdPartyReq bussinessThirdPartyReq = new BussinessThirdPartyReq();
BeanUtils.copyProperties(entity, bussinessThirdPartyReq, BeanUtil.getNullPropertyNames(entity)); BeanUtils.copyProperties(entity, bussinessThirdPartyReq, BeanUtil.getNullPropertyNames(entity));
...@@ -126,11 +120,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -126,11 +120,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
apiThirdPartyReq.setStatus(ThirdPartyStatusEnum.修改.getValue()); apiThirdPartyReq.setStatus(ThirdPartyStatusEnum.修改.getValue());
apiThirdPartyReq.setData(bussinessThirdPartyReq); apiThirdPartyReq.setData(bussinessThirdPartyReq);
messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq)); messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq));
} }
}; };
ThreadPool.getInstance().execute(runnable); ThreadPool.getInstance().execute(runnable);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
...@@ -150,7 +142,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -150,7 +142,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
for (BusinessEntity child : childList) { for (BusinessEntity child : childList) {
if (!idSet.contains(child.getId())) { if (!idSet.contains(child.getId())) {
bool = true; bool = true;
break; continue;
} }
if (bool) { if (bool) {
throw new AppException("删除的父业务存在子业务,不能删除"); throw new AppException("删除的父业务存在子业务,不能删除");
...@@ -159,7 +151,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -159,7 +151,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
} }
} }
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/inter/device/baseDataSave"; phpUrl += "/inter/device/baseDataSave";
for (BusinessEntity entity : businessEntities) { for (BusinessEntity entity : businessEntities) {
BussinessThirdPartyReq bussinessThirdPartyReq = new BussinessThirdPartyReq(); BussinessThirdPartyReq bussinessThirdPartyReq = new BussinessThirdPartyReq();
...@@ -171,8 +163,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -171,8 +163,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
apiThirdPartyReq.setData(bussinessThirdPartyReq); apiThirdPartyReq.setData(bussinessThirdPartyReq);
messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq)); messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq));
} }
super.removeBefore(ids, context); super.removeBefore(ids, context);
} }
...@@ -233,8 +223,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -233,8 +223,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
private void updateOrSave(BusinessEntity item, Long siteId, Context context) { private void updateOrSave(BusinessEntity item, Long siteId, Context context) {
SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity(); SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity();
// BeanUtils.copyProperties(item, siteBusinessEntity, BeanUtil.getNullPropertyNames(item));
SiteEntity siteEntity = siteService.get(siteId); SiteEntity siteEntity = siteService.get(siteId);
if (ObjectUtils.isEmpty(siteEntity)) { if (ObjectUtils.isEmpty(siteEntity)) {
throw new AppException("未找到相应站点!"); throw new AppException("未找到相应站点!");
......
...@@ -142,7 +142,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -142,7 +142,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
for (Map.Entry<String, String> item : data.entrySet()) { for (Map.Entry<String, String> item : data.entrySet()) {
String deptCode = item.getKey(); String deptCode = item.getKey();
String deptName = item.getValue(); String deptName = item.getValue();
DeptEntity deptEntity = deptService.getExtCache(deptCode); DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptNumber(deptCode));
if (ObjectUtils.isEmpty(deptEntity)) { if (ObjectUtils.isEmpty(deptEntity)) {
deptEntity = new DeptEntity(); deptEntity = new DeptEntity();
deptEntity.initAttrValue(); deptEntity.initAttrValue();
...@@ -280,15 +280,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -280,15 +280,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
if (!ObjectUtils.isEmpty(siteMatterEntityList)) { if (!ObjectUtils.isEmpty(siteMatterEntityList)) {
siteMatterService.update(siteMatterEntityList, context); siteMatterService.update(siteMatterEntityList, context);
} }
} }
}; };
ThreadPool.getInstance().execute(runnable); ThreadPool.getInstance().execute(runnable);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.device.web; package com.mortals.xhx.module.device.web;
import com.mortals.framework.annotation.SlideWindowLimit;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
...@@ -38,4 +40,13 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -38,4 +40,13 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
} }
/**
* @param query
* @return
*/
@Override
@SlideWindowLimit
public Rest<Object> list(DeviceEntity query) {
return super.list(query);
}
} }
\ No newline at end of file
...@@ -197,33 +197,33 @@ public class SiteEntity extends SiteVo { ...@@ -197,33 +197,33 @@ public class SiteEntity extends SiteVo {
this.proCode = ""; this.proCode = "";
this.cityCode = ""; this.cityCode = "";
this.districtCode = ""; this.districtCode = "";
this.siteIp = ""; this.siteIp = "127.0.0.1";
this.sitePort = ""; this.sitePort = "80";
this.longitude = ""; this.longitude = "";
this.latitude = ""; this.latitude = "";
this.siteTel = ""; this.siteTel = "13808095770";
this.detailAddress = ""; this.detailAddress = "";
this.siteRemark = ""; this.siteRemark = "";
this.amWorkStartTime = null; this.amWorkStartTime = null;
this.amWorkEndTime = null; this.amWorkEndTime = null;
this.pmWorkStartTime = null; this.pmWorkStartTime = null;
this.pmWorkEndTime = null; this.pmWorkEndTime = null;
this.workday1 = 0; this.workday1 = 1;
this.workday2 = 0; this.workday2 = 1;
this.workday3 = 0; this.workday3 = 1;
this.workday4 = 0; this.workday4 = 1;
this.workday5 = 0; this.workday5 = 1;
this.workday6 = 0; this.workday6 = 0;
this.workday7 = 0; this.workday7 = 0;
this.onlineTake = 1; this.onlineTake = 1;
this.appointment = 1; this.appointment = 1;
this.gowMap = 1; this.gowMap = 1;
this.level = 0; this.level = 1;
this.building = 0; this.building = 1;
this.logoPath = ""; this.logoPath = "";
this.englishName = ""; this.englishName = "";
this.leadingOfficial = ""; this.leadingOfficial = "张三";
this.leadingOfficialTelephone = ""; this.leadingOfficialTelephone = "13808095770";
this.modelIds = ""; this.modelIds = "";
this.govAffairStyle = ""; this.govAffairStyle = "";
this.complaintHotline = ""; this.complaintHotline = "";
......
...@@ -34,4 +34,9 @@ public class SiteVo extends BaseEntityLong { ...@@ -34,4 +34,9 @@ public class SiteVo extends BaseEntityLong {
private List<String> modelData; private List<String> modelData;
private Long copySiteId;
private Long targetSiteId;
} }
\ No newline at end of file
...@@ -56,20 +56,23 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -56,20 +56,23 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
*/ */
@Override @Override
protected SiteBusinessEntity findBefore(SiteBusinessEntity params, PageInfo pageInfo, Context context) throws AppException { protected SiteBusinessEntity findBefore(SiteBusinessEntity params, PageInfo pageInfo, Context context) throws AppException {
if (!ObjectUtils.isEmpty(params.getIdNotList())) { if (!ObjectUtils.isEmpty(params.getBusinessIdNotList())) {
Set<Long> notIdSet = params.getIdNotList().stream().collect(Collectors.toSet()); Set<Long> notIdSet = params.getBusinessIdNotList().stream().collect(Collectors.toSet());
//排除掉了父级,但是子集存在,需要吧父id排除到notlist外 //排除掉了父级,但是子集存在,需要吧父id排除到notlist外
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery(); SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
siteBusinessQuery.setIdList(params.getIdNotList()); // siteBusinessQuery.setBusinessIdNotList(params.getBusinessIdNotList());
List<SiteBusinessEntity> rootSiteBusiness = this.find(siteBusinessQuery).stream().filter(f -> f.getIsBusiness() == IsBusinessEnum.一级业务.getValue()).collect(Collectors.toList()); siteBusinessQuery.setIsBusiness(IsBusinessEnum.一级业务.getValue());
List<SiteBusinessEntity> rootSiteBusiness = this.find(siteBusinessQuery).stream().collect(Collectors.toList());
for (SiteBusinessEntity root : rootSiteBusiness) { for (SiteBusinessEntity root : rootSiteBusiness) {
SiteBusinessQuery query = new SiteBusinessQuery(); SiteBusinessQuery query = new SiteBusinessQuery();
query.setParentId(root.getId()); query.setParentId(root.getBusinessId());
List<SiteBusinessEntity> childSiteBusiness = this.find(query, context); List<SiteBusinessEntity> childSiteBusiness = this.find(query, context);
//查询所有二级业务。如果二级业务不全部存在,则把一级业务排除掉
//判断排除的id是否包含所有 //判断排除的id是否包含所有
Boolean bool = false; Boolean bool = false;
for (SiteBusinessEntity child : childSiteBusiness) { for (SiteBusinessEntity child : childSiteBusiness) {
if (!notIdSet.contains(child.getId())) { if (!notIdSet.contains(child.getBusinessId())) {
bool = true; bool = true;
break; break;
} }
...@@ -79,7 +82,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -79,7 +82,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
notIdSet.remove(root.getId()); notIdSet.remove(root.getId());
} }
} }
params.setIdNotList(notIdSet.stream().collect(Collectors.toList())); params.setBusinessIdNotList(notIdSet.stream().collect(Collectors.toList()));
} }
...@@ -88,9 +91,9 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -88,9 +91,9 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override @Override
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException { protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
if (!ObjectUtils.isEmpty(params.getIdNotList())) { if (!ObjectUtils.isEmpty(params.getBusinessIdNotList())) {
//排除掉已经存在的ids //排除掉已经存在的ids
log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList())); log.info("idNotList:{}", JSON.toJSONString(params.getBusinessIdNotList()));
Iterator<SiteBusinessEntity> iterator = list.iterator(); Iterator<SiteBusinessEntity> iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery(); SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
...@@ -99,7 +102,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -99,7 +102,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
siteBusinessQuery.setParentId(item.getBusinessId()); siteBusinessQuery.setParentId(item.getBusinessId());
int count = this.count(siteBusinessQuery, context); int count = this.count(siteBusinessQuery, context);
if (count > 0) { if (count > 0) {
siteBusinessQuery.setIdNotList(params.getIdNotList()); siteBusinessQuery.setBusinessIdNotList(params.getBusinessIdNotList());
List<SiteBusinessEntity> childs = this.find(siteBusinessQuery); List<SiteBusinessEntity> childs = this.find(siteBusinessQuery);
if (ObjectUtils.isEmpty(childs)) { if (ObjectUtils.isEmpty(childs)) {
//子节点已经全部选中,删除父节点 //子节点已经全部选中,删除父节点
......
...@@ -371,6 +371,21 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -371,6 +371,21 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
// this.updateAllSiteTree(context); // this.updateAllSiteTree(context);
userService.refreshUser(); userService.refreshUser();
} }
//通知php系统更新
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
HashMap<String, String> paramsMap = new HashMap<>();
paramsMap.put("siteid", entity.getId().toString());
phpUrl += "/api/site/updateSite";
String resp = null;
try {
resp = HttpUtil.doGet(phpUrl, paramsMap);
log.info("thirdPartyUrl updateSite =>resp:{}", resp);
} catch (Exception e) {
log.error("异常:", e);
}
} }
......
package com.mortals.xhx.module.site.web; package com.mortals.xhx.module.site.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.SlideWindowLimit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -56,6 +57,7 @@ import java.util.stream.Collectors; ...@@ -56,6 +57,7 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("site") @RequestMapping("site")
@Slf4j @Slf4j
public class SiteController extends BaseCRUDJsonBodyMappingController<SiteService, SiteEntity, Long> { public class SiteController extends BaseCRUDJsonBodyMappingController<SiteService, SiteEntity, Long> {
@Autowired @Autowired
......
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
...@@ -165,25 +166,28 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -165,25 +166,28 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
*/ */
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
/* Arrays.asList(ids).forEach(id -> { Arrays.asList(ids).forEach(id -> {
WindowBusinessEntity windowBusinessEntity = this.get(id, context); WindowBusinessEntity windowBusinessEntity = this.get(id, context);
pushChangeMsg(windowBusinessEntity); //更新站点业务缓存 SiteBusinessId
});*/ updateWindowBusinessCacheResult(windowBusinessEntity, context);
// pushChangeMsg(windowBusinessEntity);
});
super.removeBefore(ids, context); super.removeBefore(ids, context);
} }
/* *//** /**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
*//* */
@Override @Override
protected void saveAfter(WindowBusinessEntity entity, Context context) throws AppException { protected void saveAfter(WindowBusinessEntity entity, Context context) throws AppException {
//通知php更新 //通知php更新
pushChangeMsg(entity); //更新站点业务缓存 SiteBusinessId
updateWindowBusinessCacheResult(entity, context);
super.saveAfter(entity, context); super.saveAfter(entity, context);
}*/ }
/* */ /* */
...@@ -192,14 +196,85 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -192,14 +196,85 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
*//* */
@Override @Override
protected void updateAfter(WindowBusinessEntity entity, Context context) throws AppException { protected void updateAfter(WindowBusinessEntity entity, Context context) throws AppException {
pushChangeMsg(entity); //pushChangeMsg(entity);
//更新站点业务缓存 SiteBusinessId
updateWindowBusinessCacheResult(entity, context);
super.updateAfter(entity, context); super.updateAfter(entity, context);
}*/ }
private void updateWindowBusinessCacheResult(WindowBusinessEntity entity, Context context) {
Long siteBusinessId = entity.getSiteBusinessId();
String cacheResult = cacheService.get(KEY_SEARCH_SITEBUSINESSID_CACHE + siteBusinessId, String.class);
//更新查询结果
//查询数据库
PageInfo pageInfo = new PageInfo();
pageInfo.setPrePageResult(-1);
Result<WindowBusinessEntity> result = this.dao.getList(new WindowBusinessQuery().siteBusinessId(siteBusinessId), pageInfo);
this.findAfter(entity, pageInfo, context, result.getList());
if (!ObjectUtils.isEmpty(result.getList())) {
cacheService.set(KEY_SEARCH_SITEBUSINESSID_CACHE + siteBusinessId, JSON.toJSONString(result), KEY_SEARCH_TIMEOUTT_CACHE);
}
Long windowId = entity.getWindowId();
cacheService.get(KEY_SEARCH_WINDOWID_CACHE + windowId, String.class);
//查询数据库
pageInfo = new PageInfo();
pageInfo.setPrePageResult(-1);
result = this.dao.getList(new WindowBusinessQuery().siteBusinessId(siteBusinessId), pageInfo);
this.findAfter(entity, pageInfo, context, result.getList());
//无查询结果的不做保存
if (!ObjectUtils.isEmpty(result.getList())) {
cacheService.set(KEY_SEARCH_WINDOWID_CACHE + windowId, JSON.toJSONString(result), KEY_SEARCH_TIMEOUTT_CACHE);
}
//窗口列表更新
Set<String> scanKeys = cacheService.scan(KEY_SEARCH_WINDOWID_LIST_CACHE);
for (String scanKey : scanKeys) {
//log.info("scanKey:{}", scanKey);
String winIds = StrUtil.removePrefixIgnoreCase(scanKey, KEY_SEARCH_WINDOWID_LIST_CACHE);
List<String> split = StrUtil.split(winIds, "#");
List<Long> windowIdlist = split.stream().map(m -> {
try {
return Long.parseLong(m);
} catch (Exception e) {
return -1L;
}
}).collect(Collectors.toList());
if (windowIdlist.contains(windowId)) {
//更新窗口列表缓存
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
windowBusinessQuery.setWindowIdList(windowIdlist);
//查询数据库
pageInfo = new PageInfo();
pageInfo.setPrePageResult(-1);
result = this.dao.getList(windowBusinessQuery, pageInfo);
this.findAfter(entity, pageInfo, context, result.getList());
if (!ObjectUtils.isEmpty(result.getList())) {
String windowIdlistStr = windowIdlist.stream().map(String::valueOf).collect(Collectors.joining("#"));
cacheService.set(KEY_SEARCH_WINDOWID_LIST_CACHE + windowIdlistStr, JSON.toJSONString(result), KEY_SEARCH_TIMEOUTT_CACHE);
} else {
}
}
}
}
private void pushChangeMsg(WindowBusinessEntity entity) { private void pushChangeMsg(WindowBusinessEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/api/window/winNameChange"; phpUrl += "/api/window/winNameChange";
HashMap<String, Object> paramsMap = new HashMap<>(); HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", entity.getWindowId()); paramsMap.put("windowid", entity.getWindowId());
......
...@@ -152,7 +152,7 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte ...@@ -152,7 +152,7 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte
} }
private void pushChangeMsg(WindowMatterEntity entity) { private void pushChangeMsg(WindowMatterEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/api/window/winNameChange"; phpUrl += "/api/window/winNameChange";
HashMap<String, Object> paramsMap = new HashMap<>(); HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", entity.getWindowId()); paramsMap.put("windowid", entity.getWindowId());
......
...@@ -63,7 +63,7 @@ public class WindowMatterController extends BaseCRUDJsonBodyMappingController<Wi ...@@ -63,7 +63,7 @@ public class WindowMatterController extends BaseCRUDJsonBodyMappingController<Wi
*/ */
@Override @Override
protected int saveAfter(WindowMatterEntity entity, Map<String, Object> model, Context context) throws AppException { protected int saveAfter(WindowMatterEntity entity, Map<String, Object> model, Context context) throws AppException {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
HashMap<String, Object> paramsMap = new HashMap<>(); HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", entity.getWindowId()); paramsMap.put("windowid", entity.getWindowId());
String resp = null; String resp = null;
......
...@@ -158,6 +158,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -158,6 +158,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
} catch (Exception e) { } catch (Exception e) {
throw new AppException("密码转换异常!", e); throw new AppException("密码转换异常!", e);
} }
sysUser.setUpdateTime(new Date());
dao.update(sysUser); dao.update(sysUser);
this.putCache(loginName, sysUser); this.putCache(loginName, sysUser);
...@@ -218,7 +219,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -218,7 +219,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
boolean bool = com.mortals.framework.util.FileUtil.write(filePath, FileUtil.readBytes(file), true, true); boolean bool = com.mortals.framework.util.FileUtil.write(filePath, FileUtil.readBytes(file), true, true);
if (bool) { if (bool) {
workmanEntity.setPhotoPath(newName); workmanEntity.setPhotoPath(newName);
workmanService.update(workmanEntity); workmanEntity.setUpdateTime(new Date());
workmanService.getDao().update(workmanEntity);
} }
} catch (IOException e) { } catch (IOException e) {
log.error("写入证照异常", e); log.error("写入证照异常", e);
...@@ -254,7 +256,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -254,7 +256,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
entity.setId(workmanEntity.getId()); entity.setId(workmanEntity.getId());
entity.setDeleted(YesNoEnum.NO.getValue()); entity.setDeleted(YesNoEnum.NO.getValue());
entity.setUpdateUserId(this.getContextUserId(context)); entity.setUpdateUserId(this.getContextUserId(context));
entity.setCreateTime(new Date()); entity.setUpdateTime(new Date());
WorkmanEntity update = this.update(entity, context); WorkmanEntity update = this.update(entity, context);
if (update != null) { if (update != null) {
successNum++; successNum++;
......
...@@ -111,10 +111,10 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -111,10 +111,10 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
WorkmanEntity workmanEntity = this.service.doLogin(query.getLoginName(), query.getLoginPwd(), ip); WorkmanEntity workmanEntity = this.service.doLogin(query.getLoginName(), query.getLoginPwd(), ip);
workmanEntity.setLastLoginAddress(ip); workmanEntity.setLastLoginAddress(ip);
workmanEntity.setLastLoginTime(new Date()); workmanEntity.setLastLoginTime(new Date());
if(query.getWindowId()!=null) { if (query.getWindowId() != null) {
workmanEntity.setWindowId(query.getWindowId()); workmanEntity.setWindowId(query.getWindowId());
WindowEntity windowEntity = windowService.get(query.getWindowId()); WindowEntity windowEntity = windowService.get(query.getWindowId());
if(windowEntity!=null){ if (windowEntity != null) {
workmanEntity.setWindowName(windowEntity.getName()); workmanEntity.setWindowName(windowEntity.getName());
} }
} }
...@@ -141,7 +141,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -141,7 +141,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
log.info("filePath:" + query.getFilePath()); log.info("filePath:" + query.getFilePath());
Rest<Void> rest = this.service.doImportPic(query.getFilePath()); this.service.doImportPic(query.getFilePath());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
recordSysLog(request, getCurUser(), "解析工作人员图片成功!"); recordSysLog(request, getCurUser(), "解析工作人员图片成功!");
return ret.toJSONString(); return ret.toJSONString();
...@@ -170,7 +170,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -170,7 +170,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
} else { } else {
throw new AppException("账户密码修改失败!"); throw new AppException("账户密码修改失败!");
} }
recordSysLog(request, getCurUser(), "工作人员更新密码成功! workman:"+query.getLoginName());
} catch (Exception e) { } catch (Exception e) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e)); ret.put(KEY_RESULT_MSG, super.convertException(e));
...@@ -245,7 +245,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -245,7 +245,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
} }
if (!ObjectUtils.isEmpty(workmanEntity.getDeptName())) { if (!ObjectUtils.isEmpty(workmanEntity.getDeptName())) {
DeptEntity dept = deptService.selectOne(new DeptQuery().name(workmanEntity.getDeptName()).siteId(siteEntity.getId())); DeptEntity dept = deptService.selectOne(new DeptQuery().name(workmanEntity.getDeptName()).siteId(siteEntity.getId()));
if(!ObjectUtils.isEmpty(dept)){ if (!ObjectUtils.isEmpty(dept)) {
workmanEntity.setDeptId(dept.getId()); workmanEntity.setDeptId(dept.getId());
workmanEntity.setDeptName(dept.getName()); workmanEntity.setDeptName(dept.getName());
} }
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
<property name="showSql" value="false" /> <property name="showSql" value="false" />
</plugin> </plugin>
<!-- <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor"> <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor">
<property name="showSql" value="false" />
</plugin>--> </plugin>
</plugins> </plugins>
</configuration> </configuration>
\ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
a.shortName as shortName, a.shortName as shortName,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))">
a.domain as domain, a.`domain` as `domain`,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status as status, a.status as status,
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
a.shortName=#{data.shortName}, a.shortName=#{data.shortName},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))"> <if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))">
a.domain=#{data.domain}, a.`domain`=#{data.domain},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))"> <if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status}, a.status=#{data.status},
...@@ -602,14 +602,14 @@ ...@@ -602,14 +602,14 @@
<if test="conditionParamRef.containsKey('domain')"> <if test="conditionParamRef.containsKey('domain')">
<if test="conditionParamRef.domain != null and conditionParamRef.domain != ''"> <if test="conditionParamRef.domain != null and conditionParamRef.domain != ''">
${_conditionType_} a.domain like #{${_conditionParam_}.domain} ${_conditionType_} a.`domain` like #{${_conditionParam_}.domain}
</if> </if>
<if test="conditionParamRef.domain == null"> <if test="conditionParamRef.domain == null">
${_conditionType_} a.domain is null ${_conditionType_} a.`domain` is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('domainList')"> <if test="conditionParamRef.containsKey('domainList')">
${_conditionType_} a.domain in ${_conditionType_} a.`domain` in
<foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -760,7 +760,7 @@ ...@@ -760,7 +760,7 @@
, ,
</if> </if>
<if test="orderCol.containsKey('domain')"> <if test="orderCol.containsKey('domain')">
a.domain a.`domain`
<if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if> <if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if>
, ,
</if> </if>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
a.shortName, a.shortName,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))">
a.domain, a.`domain`,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status, a.status,
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
a.shortName=#{data.shortName}, a.shortName=#{data.shortName},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))"> <if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))">
a.domain=#{data.domain}, a.`domain`=#{data.domain},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))"> <if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status}, a.status=#{data.status},
...@@ -613,14 +613,14 @@ ...@@ -613,14 +613,14 @@
<if test="conditionParamRef.containsKey('domain')"> <if test="conditionParamRef.containsKey('domain')">
<if test="conditionParamRef.domain != null and conditionParamRef.domain != ''"> <if test="conditionParamRef.domain != null and conditionParamRef.domain != ''">
${_conditionType_} a.domain like #{${_conditionParam_}.domain} ${_conditionType_} a.`domain` like #{${_conditionParam_}.domain}
</if> </if>
<if test="conditionParamRef.domain == null"> <if test="conditionParamRef.domain == null">
${_conditionType_} a.domain is null ${_conditionType_} a.`domain` is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('domainList')"> <if test="conditionParamRef.containsKey('domainList')">
${_conditionType_} a.domain in ${_conditionType_} a.`domain` in
<foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -771,7 +771,7 @@ ...@@ -771,7 +771,7 @@
, ,
</if> </if>
<if test="orderCol.containsKey('domain')"> <if test="orderCol.containsKey('domain')">
a.domain a.`domain`
<if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if> <if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if>
, ,
</if> </if>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
a.shortName, a.shortName,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('domain') or colPickMode == 1 and data.containsKey('domain')))">
a.domain, a.`domain`,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('iid') or colPickMode == 1 and data.containsKey('iid')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('iid') or colPickMode == 1 and data.containsKey('iid')))">
a.iid, a.iid,
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
a.shortName=#{data.shortName}, a.shortName=#{data.shortName},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))"> <if test="(colPickMode==0 and data.containsKey('domain')) or (colPickMode==1 and !data.containsKey('domain'))">
a.domain=#{data.domain}, a.`domain`=#{data.domain},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('iid')) or (colPickMode==1 and !data.containsKey('iid'))"> <if test="(colPickMode==0 and data.containsKey('iid')) or (colPickMode==1 and !data.containsKey('iid'))">
a.iid=#{data.iid}, a.iid=#{data.iid},
...@@ -437,14 +437,14 @@ ...@@ -437,14 +437,14 @@
<if test="conditionParamRef.containsKey('domain')"> <if test="conditionParamRef.containsKey('domain')">
<if test="conditionParamRef.domain != null and conditionParamRef.domain != ''"> <if test="conditionParamRef.domain != null and conditionParamRef.domain != ''">
${_conditionType_} a.domain like #{${_conditionParam_}.domain} ${_conditionType_} a.`domain` like #{${_conditionParam_}.domain}
</if> </if>
<if test="conditionParamRef.domain == null"> <if test="conditionParamRef.domain == null">
${_conditionType_} a.domain is null ${_conditionType_} a.`domain` is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('domainList')"> <if test="conditionParamRef.containsKey('domainList')">
${_conditionType_} a.domain in ${_conditionType_} a.`domain` in
<foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.domainList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -573,7 +573,7 @@ ...@@ -573,7 +573,7 @@
, ,
</if> </if>
<if test="orderCol.containsKey('domain')"> <if test="orderCol.containsKey('domain')">
a.domain a.`domain`
<if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if> <if test='orderCol.domain != null and "DESC".equalsIgnoreCase(orderCol.domain)'>DESC</if>
, ,
</if> </if>
......
...@@ -7,10 +7,10 @@ Content-Type: application/json ...@@ -7,10 +7,10 @@ Content-Type: application/json
###部门列表1 ###部门列表1
POST {{baseUrl}}/dept/list POST {{baseUrl}}/dept/interlist
Content-Type: application/json Content-Type: application/json
{"siteId":1,"page":"1","size":"3","idList":[422,420,413,412],"orderColList":[{"colName":"sort","sortKind":"asc"}]} {"siteId":11,"isWordGuide": 1,"filter": 1,"page":"1","size":"10","orderColList":[{"colName":"sort","sortKind":"asc"}]}
###部门更新与保存 ###部门更新与保存
POST {{baseUrl}}/dept/save POST {{baseUrl}}/dept/save
......
...@@ -16,12 +16,11 @@ Content-Type: application/json ...@@ -16,12 +16,11 @@ Content-Type: application/json
###基础事项列表 ###基础事项列表
POST {{baseUrl}}/site/matter/list POST {{baseUrl}}/site/matter/interlist
Content-Type: application/json Content-Type: application/json
{ {
"siteId": 1, "deptId": 987
"hallCheckIn":1
} }
......
...@@ -146,7 +146,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId ...@@ -146,7 +146,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
Content-Type: application/json Content-Type: application/json
{ {
"id":50 "id":6
} }
...@@ -170,3 +170,6 @@ POST {{baseUrl}}/site/getSitesGroupByAreaLevel ...@@ -170,3 +170,6 @@ POST {{baseUrl}}/site/getSitesGroupByAreaLevel
Content-Type: application/json Content-Type: application/json
{"areaLevel":3,"siteName": "%翠屏区%"} {"areaLevel":3,"siteName": "%翠屏区%"}
...@@ -271,3 +271,21 @@ Content-Type: application/json ...@@ -271,3 +271,21 @@ Content-Type: application/json
} }
###保存站点事项与主题事项
POST {{baseUrl}}/test/saveSiteMatters
Content-Type: application/json
{"copySiteId":11,"targetSiteId": 50,"areaCode": "511523000000"}
###保存站点事项与主题事项
POST {{baseUrl}}/test/saveSiteMattersTwo
Content-Type: application/json
{"copySiteId":11,"targetSiteId": 50}
###更新服务ip
GET {{baseUrl}}/param/updateServerIp?serverIp=192.168.0.98
Content-Type: application/json
...@@ -17,7 +17,7 @@ Content-Type: application/json ...@@ -17,7 +17,7 @@ Content-Type: application/json
POST {{baseUrl}}/window/business/interlist POST {{baseUrl}}/window/business/interlist
Content-Type: application/json Content-Type: application/json
{"siteBusinessId":212,"searchCache": 1} {"siteBusinessId":43,"searchCache": 1}
###窗口业务列表缓存2 ###窗口业务列表缓存2
POST {{baseUrl}}/window/business/interlist POST {{baseUrl}}/window/business/interlist
......
package com.mortals.xhx.feign.bill.smartoffice;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
/**
* 服务系统 Feign接口
*
* @author zxfei
* @date 2022-10-26
*/
@FeignClient(name = "bill-manager", path = "/bill", fallbackFactory = BillFeignFallbackFactory.class)
public interface IBillFeign extends IFeign {
/**
* 用户刷新通知
*
* @param
* @return
*/
@PostMapping(value = "/user/refreshUser")
Rest<Void> refreshUser();
}
@Slf4j
@Component
class BillFeignFallbackFactory implements FallbackFactory<IBillFeign> {
@Override
public IBillFeign create(Throwable t) {
return new IBillFeign() {
/**
* @return
*/
@Override
public Rest<Void> refreshUser() {
return Rest.fail("暂时无法通知设备,请稍后再试!");
}
};
}
}
...@@ -183,6 +183,12 @@ ...@@ -183,6 +183,12 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- 达梦数据库驱动-->
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.1.193</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.mortals.xhx.common.utils; package com.mortals.xhx.common.utils;
import com.mortals.xhx.feign.area.IApiAreaFeign; import com.mortals.xhx.feign.area.IApiAreaFeign;
import com.mortals.xhx.feign.bill.smartoffice.IBillFeign;
import com.mortals.xhx.feign.device.IDeviceFeign; import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.selfsystem.ISelfSystemFeign; import com.mortals.xhx.feign.selfsystem.ISelfSystemFeign;
import com.mortals.xhx.feign.skin.ISkinFillFeign; import com.mortals.xhx.feign.skin.ISkinFillFeign;
...@@ -26,6 +27,7 @@ public class SendSubSystemTask implements Runnable { ...@@ -26,6 +27,7 @@ public class SendSubSystemTask implements Runnable {
private ISkinFillFeign skinFillFeign; private ISkinFillFeign skinFillFeign;
private ISelfSystemFeign selfSystemFeign; private ISelfSystemFeign selfSystemFeign;
private ISmartSystemFeign smartSystemFeign; private ISmartSystemFeign smartSystemFeign;
private IBillFeign billFeign;
public SendSubSystemTask() { public SendSubSystemTask() {
apiAreaFeign = SpringUtils.getBean(IApiAreaFeign.class); apiAreaFeign = SpringUtils.getBean(IApiAreaFeign.class);
...@@ -34,11 +36,13 @@ public class SendSubSystemTask implements Runnable { ...@@ -34,11 +36,13 @@ public class SendSubSystemTask implements Runnable {
skinFillFeign = SpringUtils.getBean(ISkinFillFeign.class); skinFillFeign = SpringUtils.getBean(ISkinFillFeign.class);
selfSystemFeign = SpringUtils.getBean(ISelfSystemFeign.class); selfSystemFeign = SpringUtils.getBean(ISelfSystemFeign.class);
smartSystemFeign = SpringUtils.getBean(ISmartSystemFeign.class); smartSystemFeign = SpringUtils.getBean(ISmartSystemFeign.class);
billFeign = SpringUtils.getBean(IBillFeign.class);
} }
@Override @Override
public void run() { public void run() {
try { try {
log.info("开始通知子系统");
Thread.sleep(2000); Thread.sleep(2000);
apiAreaFeign.refreshUser(); apiAreaFeign.refreshUser();
Thread.sleep(2000); Thread.sleep(2000);
...@@ -51,6 +55,9 @@ public class SendSubSystemTask implements Runnable { ...@@ -51,6 +55,9 @@ public class SendSubSystemTask implements Runnable {
selfSystemFeign.refreshUser(); selfSystemFeign.refreshUser();
Thread.sleep(2000); Thread.sleep(2000);
smartSystemFeign.refreshUser(); smartSystemFeign.refreshUser();
Thread.sleep(2000);
billFeign.refreshUser();
log.info("子系统通知完成");
} catch (Exception e) { } catch (Exception e) {
log.error("通知异常:", e); log.error("通知异常:", e);
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<setting name="useColumnLabel" value="true" /> <setting name="useColumnLabel" value="true" />
<setting name="useGeneratedKeys" value="false" /> <setting name="useGeneratedKeys" value="false" />
<setting name="defaultExecutorType" value="REUSE" /> <setting name="defaultExecutorType" value="REUSE" />
</settings> </settings>
<plugins> <plugins>
<plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin"> <plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin">
...@@ -18,5 +19,8 @@ ...@@ -18,5 +19,8 @@
<property name="enableExecutorTime" value="true" /> <property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" /> <property name="showSql" value="false" />
</plugin> </plugin>
<plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor">
<property name="showSql" value="false" />
</plugin>
</plugins> </plugins>
</configuration> </configuration>
\ 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