Commit 2845d85c authored by 赵啸非's avatar 赵啸非

Merge branch 'first' into second

# Conflicts:
#	fill-manager/db/add.sql
#	fill-manager/pom.xml
#	fill-manager/src/main/bin/start.sh
#	fill-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/common/code/ComponentEnum.java
#	fill-manager/src/main/java/com/mortals/xhx/common/code/FieldTypeEnum.java
#	fill-manager/src/main/java/com/mortals/xhx/common/formdesign/DesignComponent.java
#	fill-manager/src/main/java/com/mortals/xhx/common/utils/WordUtil.java
#	fill-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/dao/AppConfigDao.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/dao/ibatis/AppConfigDaoImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/model/AppConfigEntity.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/model/AppConfigQuery.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/model/vo/AppConfigVo.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/service/AppConfigService.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppConfigServiceImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/module/app/web/AppConfigController.java
#	fill-manager/src/main/java/com/mortals/xhx/module/datum/model/DatumInfoFieldEntity.java
#	fill-manager/src/main/java/com/mortals/xhx/module/datum/model/DatumInfoFieldQuery.java
#	fill-manager/src/main/java/com/mortals/xhx/module/datum/service/impl/DatumInfoFieldServiceImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/module/datum/web/DatumInfoFieldController.java
#	fill-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
#	fill-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
#	fill-manager/src/main/resources/bootstrap.yml
#	fill-manager/src/main/resources/sqlmap/module/datum/DatumInfoFieldMapper.xml
#	fill-manager/src/test/java/com/mortals/httpclient/http-client.env.json
parents 2d93e739 8fbe9ee4
...@@ -82,6 +82,11 @@ ...@@ -82,6 +82,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
......
...@@ -2,6 +2,8 @@ package com.mortals.xhx.common.pdu.device; ...@@ -2,6 +2,8 @@ package com.mortals.xhx.common.pdu.device;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* 设备Pdu对象 * 设备Pdu对象
* *
...@@ -79,6 +81,35 @@ public class DevicePdu extends BaseEntityLong { ...@@ -79,6 +81,35 @@ public class DevicePdu extends BaseEntityLong {
private String deviceRemark; private String deviceRemark;
/**
* 设备生产厂商ID
*/
private Long deviceFirmId;
/**
* 设备生产厂商名称
*/
private String deviceFirmname;
/**
* 设备访问ip
*/
private String ip;
/**
* 端口
*/
private String port;
/**
* 启用状态 (0.停止,1.启用)
*/
private Integer enabled;
/**
* 最近上线时间
*/
private Date onlineTime;
/**
* 最近离线时间
*/
private Date offlineTime;
public void initAttrValue(){ public void initAttrValue(){
this.deviceId = null; this.deviceId = null;
......
...@@ -4,6 +4,7 @@ import lombok.Data; ...@@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
...@@ -135,4 +136,7 @@ public class DeviceReq implements Serializable { ...@@ -135,4 +136,7 @@ public class DeviceReq implements Serializable {
*/ */
private String deviceVersion; private String deviceVersion;
private List<Long> siteIdList;
} }
package com.mortals.xhx.common.pdu.user;
import com.mortals.framework.exception.AppException;
import lombok.Data;
@Data
public class LoginPdu {
private String loginName;
private String password;
private String securityCode;
private String mark;
/** 加密方式 1不加密,2加密*/
private Integer type;
@Override
public String toString() {
return "loginName:" + this.loginName + " password:" + this.password;
}
public boolean validate() throws AppException {
if (loginName == null || loginName.trim().length() == 0) {
throw new AppException("帐号不能为空!");
}
if (password == null || password.trim().length() == 0) {
throw new AppException("密码不能为空!");
}
return true;
}
}
...@@ -78,7 +78,7 @@ public interface IDeviceFeign extends IFeign { ...@@ -78,7 +78,7 @@ public interface IDeviceFeign extends IFeign {
* @return * @return
*/ */
@PostMapping(value = "/api/receive") @PostMapping(value = "/api/receive")
Rest<String> deviceCall(@RequestBody DeviceReq deviceReq, @RequestHeader("Authorization") String authorization); Rest<String> deviceCall(@RequestBody DeviceReq deviceReq);
} }
...@@ -115,7 +115,7 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> { ...@@ -115,7 +115,7 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
} }
@Override @Override
public Rest<String> deviceCall(DeviceReq deviceReq, String authorization) { public Rest<String> deviceCall(DeviceReq deviceReq) {
return Rest.fail("暂时无法保存设备,请稍后再试!"); return Rest.fail("暂时无法保存设备,请稍后再试!");
} }
}; };
......
package com.mortals.xhx.feign.user; package com.mortals.xhx.feign.user;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.user.LoginPdu;
import com.mortals.xhx.common.pdu.user.UserPdu; import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.IFeign; import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
...@@ -38,7 +38,7 @@ public interface IUserFeign extends IFeign { ...@@ -38,7 +38,7 @@ public interface IUserFeign extends IFeign {
* @param id * @param id
* @return * @return
*/ */
@GetMapping(value = "/user/info") @GetMapping(value = "/user/interinfo")
Rest<UserPdu> info(@RequestParam(value = "id") Long id); Rest<UserPdu> info(@RequestParam(value = "id") Long id);
/** /**
...@@ -62,7 +62,7 @@ public interface IUserFeign extends IFeign { ...@@ -62,7 +62,7 @@ public interface IUserFeign extends IFeign {
@PostMapping(value = "/login/login") @PostMapping(value = "/login/login")
String portalLogin(@RequestBody UserPdu userPdu); String portalLogin(@RequestBody LoginPdu loginPdu);
/** /**
* 查询用户列表 * 查询用户列表
...@@ -114,8 +114,8 @@ class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> { ...@@ -114,8 +114,8 @@ class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> {
} }
@Override @Override
public String portalLogin(UserPdu userPdu) { public String portalLogin(LoginPdu loginPdu) {
return JSON.toJSONString(Rest.fail("登录失败!")); return null;
} }
@Override @Override
......
...@@ -11,13 +11,14 @@ ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `idCard` varchar(64) defau ...@@ -11,13 +11,14 @@ ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `idCard` varchar(64) defau
ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `idName` varchar(64) default '' COMMENT '身份证名称' AFTER idCard; ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `idName` varchar(64) default '' COMMENT '身份证名称' AFTER idCard;
ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `mobile` varchar(64) default '' COMMENT '手机号码' AFTER idName; ALTER TABLE mortals_xhx_matter_datum_print ADD COLUMN `mobile` varchar(64) default '' COMMENT '手机号码' AFTER idName;
-- ---------------------------- -- ----------------------------
2023-03-22 2023-03-22
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_xhx_task` (`id`, `name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('4', '同步设备', 'SyncSiteDeviceTask', '0', 'SyncSiteDeviceTask', NULL, NULL, '4', '120', '00:00', NULL, '127.0.1.1', '2023-02-26 22:15:59', '0', '2023-02-25 14:34:12', '1', NULL); INSERT INTO `mortals_xhx_task` (`id`, `name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('4', '同步设备', 'SyncSiteDeviceTask', '0', 'SyncSiteDeviceTask', NULL, NULL, '4', '120', '00:00', NULL, '127.0.1.1', '2023-02-26 22:15:59', '0', '2023-02-25 14:34:12', '1', NULL);
-- ---------------------------- -- ----------------------------
2023-06-21 2023-06-21
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_xhx_device ALTER TABLE mortals_xhx_device
...@@ -174,4 +175,163 @@ CREATE TABLE `mortals_xhx_datum_fill_qrcode` ( ...@@ -174,4 +175,163 @@ CREATE TABLE `mortals_xhx_datum_fill_qrcode` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `id` (`id`) USING BTREE, KEY `id` (`id`) USING BTREE,
KEY `datumId` (`datumId`) USING BTREE KEY `datumId` (`datumId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='材料填单二维码'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='材料填单二维码';
\ No newline at end of file
-- ----------------------------
-- 2025-02-11
-- ----------------------------
-- ----------------------------
-- 应用列表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_app_config`;
CREATE TABLE mortals_xhx_app_config(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键,自增长',
`siteId` bigint(20) COMMENT '站点ID',
`siteName` varchar(64) COMMENT '站点名称',
`siteCode` varchar(64) COMMENT '站点编号',
`appId` bigint(20) COMMENT '应用ID',
`appCode` varchar(64) COMMENT '应用编码',
`appName` varchar(64) COMMENT '应用名称',
`order` int(9) COMMENT '应用顺序',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='应用列';
-- ----------------------------
-- 角色权限改造 2025-04-23
-- ----------------------------
-- ----------------------------
-- 资源信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_resource`;
CREATE TABLE mortals_xhx_resource(
`id` bigint(20) AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) COMMENT '名称',
`groupName` varchar(255) COMMENT '分组名称',
`url` varchar(2000) COMMENT '连接地址,多个地址以逗号分隔',
`authType` tinyint(2) DEFAULT '3' COMMENT '权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`sourceType` tinyint(2) DEFAULT '0' COMMENT '资源类型,(0.系统资源,1.开放资源)',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `idx_name`(`name`) USING BTREE,
INDEX `idx_groupName`(`groupName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源信息业务';
-- ----------------------------
-- 角色信息业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role`;
CREATE TABLE mortals_xhx_role(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(50) COMMENT '角色名称',
`remark` varchar(200) COMMENT '备注',
`roleType` tinyint(2) DEFAULT '2' COMMENT '角色类型 (0.系统内置角色,1.默认系统角色.2.普通角色)',
`customerId` bigint(20) COMMENT '归属客户ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `idx_name`(`name`) USING BTREE,
INDEX `idx_roleType`(`roleType`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色信息业务';
-- ----------------------------
-- 角色资源权限业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_auth`;
CREATE TABLE mortals_xhx_role_auth(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) COMMENT '角色ID',
`menuId` bigint(20) COMMENT '菜单ID',
`resourceId` bigint(20) COMMENT '资源ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `idx_roleId`(`roleId`) USING BTREE,
INDEX `idx_menuId`(`menuId`) USING BTREE,
INDEX `resourceId` (`resourceId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色资源权限业务';
-- ----------------------------
-- 角色用户业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_role_user`;
CREATE TABLE mortals_xhx_role_user(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`roleId` bigint(20) COMMENT '角色ID',
`userId` bigint(20) COMMENT '用户ID',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `idx_roleId`(`roleId`) USING BTREE,
INDEX `idx_userId`(`userId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色用户业务';
DROP TABLE IF EXISTS `mortals_xhx_menu`;
CREATE TABLE mortals_xhx_menu(
`id` bigint(20) AUTO_INCREMENT COMMENT '菜单ID,主键,自增长',
`name` varchar(50) COMMENT '菜单名称',
`url` varchar(256) COMMENT '路由地址',
`ancestors` varchar(255) COMMENT '当前节点父id路径,“,”分割',
`parentId` bigint(20) COMMENT '父菜单ID,一级菜单的该字段值为-1',
`linkType` tinyint(2) DEFAULT '0' COMMENT '链接方式 (0.普通,1.弹出,2.脚本)',
`imgPath` varchar(128) COMMENT '主菜单图标,主菜单图标的css样式名',
`buttonImgPath` varchar(128) COMMENT '按钮图标,按钮图标的css样式名',
`imgCommPath` varchar(128) COMMENT '常用菜单图标,常用菜单图标的css样式名',
`commMenu` tinyint(2) DEFAULT '1' COMMENT '是否常用菜单 (0.非常用,1.常用)',
`component` varchar(128) COMMENT 'vue组件路径',
`menuType` tinyint(2) DEFAULT '0' COMMENT '菜单类型 (0.目录,1.菜单,2.按钮)',
`authType` tinyint(2) DEFAULT '3' COMMENT '权限类型 (0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)',
`visible` tinyint(2) DEFAULT '0' COMMENT '菜单显示状态 (0.显示,1.隐藏)',
`perms` varchar(128) COMMENT '权限标识,多个逗号分割',
`orderId` int(4) COMMENT '排序编号',
`status` tinyint(2) DEFAULT '1' COMMENT '菜单状态 (0.停用,1.启用)',
`cache` tinyint(2) DEFAULT '0' COMMENT '是否启用缓存 (0.否,1.是)',
`activeDir` varchar(128) COMMENT '激活目录',
`resourceUrl` varchar(512) COMMENT '资源访问路径,多个逗号分割',
`hideChildrenInMenu` tinyint(2) DEFAULT '0' COMMENT '是否隐藏(0.否,1.是)',
`remark` varchar(512) COMMENT '备注信息',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateUserName` varchar(50) COMMENT '创建用户名称',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `idx_name`(`name`) USING BTREE,
INDEX `idx_url`(`url`) USING BTREE,
INDEX `idx_parentId`(`parentId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单信息业务';
ALTER TABLE mortals_xhx_param ADD COLUMN `updateUserId` bigint(20) COMMENT '更新用户';
ALTER TABLE mortals_xhx_param ADD COLUMN `updateUserName` varchar(50) COMMENT '创建用户名称';
ALTER TABLE mortals_xhx_param ADD COLUMN `updateTime` datetime COMMENT '更新时间';
\ No newline at end of file
This diff is collapsed.
...@@ -15,9 +15,15 @@ ...@@ -15,9 +15,15 @@
<description>填单系统</description> <description>填单系统</description>
<properties> <properties>
<profiles.phpServer></profiles.phpServer> <!-- 默认值 -->
<profiles.wx.appId></profiles.wx.appId> <profiles.server.debug></profiles.server.debug>
<profiles.wx.appSecret></profiles.wx.appSecret> <profiles.server.port>19211</profiles.server.port>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
</properties> </properties>
<profiles> <profiles>
...@@ -28,51 +34,37 @@ ...@@ -28,51 +34,37 @@
</activation> </activation>
<properties> <properties>
<profiles.active>develop</profiles.active> <profiles.active>develop</profiles.active>
<profiles.server.port>17215</profiles.server.port> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>192.168.0.239:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>test</id> <id>test</id>
<properties> <properties>
<profiles.active>test</profiles.active> <profiles.active>test</profiles.active>
<profiles.server.port>19211</profiles.server.port> <profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5816</profiles.server.debug>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.phpServer>http://192.168.0.98:8090</profiles.phpServer>
<profiles.wx.appId>wxd3d6df0ebaf88f98</profiles.wx.appId>
<profiles.wx.appSecret>fe4c83e34f89956960aa0f1f9e8f38b1</profiles.wx.appSecret>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>product</id> <id>product</id>
<properties> <properties>
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.server.port>19211</profiles.server.port>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.publish.path>/home/publish</profiles.publish.path>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>yibin</id> <id>regtest</id>
<properties> <properties>
<profiles.active>yibin</profiles.active> <profiles.active>regtest</profiles.active>
<profiles.server.port>19211</profiles.server.port> <profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> </properties>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr> </profile>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profile>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <id>reg</id>
<profiles.phpServer>http://172.15.28.116:8090</profiles.phpServer> <properties>
<profiles.wx.appId>wx341ad2eafbc209f0</profiles.wx.appId> <profiles.active>reg</profiles.active>
<profiles.wx.appSecret>e2ec6077a40938a384c723b67b491af0</profiles.wx.appSecret> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
</properties> </properties>
</profile> </profile>
...@@ -80,11 +72,7 @@ ...@@ -80,11 +72,7 @@
<id>yanyuan</id> <id>yanyuan</id>
<properties> <properties>
<profiles.active>yanyuan</profiles.active> <profiles.active>yanyuan</profiles.active>
<profiles.server.port>19211</profiles.server.port> <profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
</properties> </properties>
</profile> </profile>
...@@ -92,23 +80,16 @@ ...@@ -92,23 +80,16 @@
<id>pengxi</id> <id>pengxi</id>
<properties> <properties>
<profiles.active>pengxi</profiles.active> <profiles.active>pengxi</profiles.active>
<profiles.server.port>19211</profiles.server.port>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.106.6:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>bzjkq</id> <id>qiling-test</id>
<properties> <properties>
<profiles.active>bzjkq</profiles.active> <profiles.active>qiling-test</profiles.active>
<profiles.server.port>19211</profiles.server.port> <profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5816</profiles.server.debug>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.nacos.server-addr>192.168.0.239:8848</profiles.nacos.server-addr>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
</properties> </properties>
</profile> </profile>
...@@ -212,12 +193,7 @@ ...@@ -212,12 +193,7 @@
<artifactId>pdfbox</artifactId> <artifactId>pdfbox</artifactId>
<version>2.0.27</version> <version>2.0.27</version>
</dependency> </dependency>
<!-- 达梦数据库驱动-->
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.1.193</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -35,11 +35,18 @@ clear_deploy() { ...@@ -35,11 +35,18 @@ clear_deploy() {
SERVICE=$1 SERVICE=$1
EXECPATH=$2 EXECPATH=$2
#清理后台自启服务 #清理后台自启服务
rm -rf ${SERVICE} rm -f ${SERVICE}
#清理执行文件目录 #清理执行文件目录
rm -rf ${EXECPATH} rm -rf ${EXECPATH}
} }
#清理ui
clear_ui_deploy() {
EXEC_UI_PATH=$1
rm -rf ${EXEC_UI_PATH}
mkdir -p ${EXEC_UI_PATH}
}
build_service() { build_service() {
SERVICE=$1 SERVICE=$1
EXECPATH=$2 EXECPATH=$2
...@@ -86,6 +93,14 @@ project_deploy() { ...@@ -86,6 +93,14 @@ project_deploy() {
writelog "${PROJECT_NAME}_deploy_finish" writelog "${PROJECT_NAME}_deploy_finish"
} }
#部署前台服务
project_ui_deploy() {
writelog "${PROJECT_NAME}_ui_deploy"
clear_ui_deploy ${PROJECT_UI_EXECPATH}
tar -zvxf ./${PROJECT_UI_FILENAME} -C ${PUBLISH_PATH}
writelog "${PROJECT_NAME}_ui_deploy_finish"
}
#主函数 #主函数
main() { main() {
......
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
#清理执行文件目录
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME}&&systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
#!/bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
DEBUG=@profiles.server.debug@
BASEDIR=`dirname $0`/.. BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log" GC_PATH=$LOG_PATH/$PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log" HS_ERR_PATH=$LOG_PATH/$PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/$PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
if [ ! -n "$PORT" ]; then if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}" echo $"Usage: $0 {port}"
exit $FAIL exit $FAIL
fi fi
if [ ! -d $LOG_PATH ]; if [ ! -d $LOG_PATH ];
then then
mkdir -p $LOG_PATH; mkdir -p $LOG_PATH;
fi fi
if [ ! -d $TEMP_PATH ]; if [ ! -d $TEMP_PATH ];
then then
mkdir -p $TEMP_PATH; mkdir -p $TEMP_PATH;
fi fi
if [ -z "$JAVACMD" ] ; then if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
...@@ -32,8 +33,9 @@ if [ -z "$JAVACMD" ] ; then ...@@ -32,8 +33,9 @@ if [ -z "$JAVACMD" ] ; then
JAVACMD="$JAVA_HOME/bin/java" JAVACMD="$JAVA_HOME/bin/java"
fi fi
else else
JAVACMD=`which java` JAVACMD=`which java > /dev/null 2>&1`
echo "Error: JAVA_HOME is $JAVACMD" echo "Error: JAVA_HOME is not defined correctly."
exit $ERR_NO_JAVA
fi fi
fi fi
...@@ -44,7 +46,7 @@ fi ...@@ -44,7 +46,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms1024M -Xmx2048M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms512M -Xmx2048M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
...@@ -55,11 +57,11 @@ cd "$BASEDIR/boot"; ...@@ -55,11 +57,11 @@ cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......" echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \ exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \ $EXTRA_JVM_ARGUMENTS \
$DEBUG \
-Dapp.name="$PROJECT_NAME" \ -Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \ -Dfile.encoding=utf-8 \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5816 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
package com.mortals.xhx.base.framework;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
/**
* 自定义Jackson反序列化日期类型时应用的类型转换器,一般用于@RequestBody接受参数时使用
*/
public class DateJacksonConverter extends JsonDeserializer {
private static String[] pattern = new String[]{"yyyy-MM-dd", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.S", "yyyy.MM.dd", "yyyy.MM.dd HH:mm", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm:ss.S", "yyyy/MM/dd", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss.S"};
@Override
public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
Date targetDate = null;
String originDate = p.getText();
if (StringUtils.isNotEmpty(originDate)) {
try {
long longDate = Long.valueOf(originDate.trim());
targetDate = new Date(longDate);
} catch (NumberFormatException e) {
try {
targetDate = DateUtils.parseDate(originDate, DateJacksonConverter.pattern);
} catch (ParseException pe) {
throw new IOException(String.format("'%s' can not convert to type 'java.util.Date',just support timestamp(type of long) and following date format(%s)",
originDate,
StringUtils.join(pattern, ",")));
}
}
}
return targetDate;
}
@Override
public Class handledType() {
return Date.class;
}
}
package com.mortals.xhx.base.framework.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.xhx.base.framework.DateJacksonConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
@Configuration
public class ConverterConfig {
@Bean
public DateJacksonConverter dateJacksonConverter() {
return new DateJacksonConverter();
}
@Bean
public Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean(DateJacksonConverter dateJacksonConverter) {
Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean = new Jackson2ObjectMapperFactoryBean();
jackson2ObjectMapperFactoryBean.setDeserializers(dateJacksonConverter);
return jackson2ObjectMapperFactoryBean;
}
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(ObjectMapper objectMapper) {
// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
return mappingJackson2HttpMessageConverter;
}
}
...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse;
* @date: 2022/6/6 15:05 * @date: 2022/6/6 15:05
* @description:添加跨域响应 * @description:添加跨域响应
**/ **/
@Component //@Component
public class CrossInterceptor extends HandlerInterceptorAdapter { public class CrossInterceptor extends HandlerInterceptorAdapter {
@Override @Override
......
package com.mortals.xhx.base.framework.exception; package com.mortals.xhx.base.framework.exception;
import org.slf4j.Logger; import cn.hutool.core.util.StrUtil;
import org.slf4j.LoggerFactory; import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject; import javax.servlet.http.HttpServletRequest;
import com.mortals.framework.exception.AppException; import javax.servlet.http.HttpServletResponse;
/** /**
* 统一异常处理 * 统一异常处理
*/ */
@ControllerAdvice @ControllerAdvice
@Slf4j
public class ExceptionHandle { public class ExceptionHandle {
private final static Logger log = LoggerFactory.getLogger(ExceptionHandle.class); @Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
public static final String KEY_RESULT_CODE = "code"; public static final String KEY_RESULT_CODE = "code";
public static final String KEY_RESULT_MSG = "msg"; public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data"; public static final String KEY_RESULT_DATA = "data";
public static final int VALUE_RESULT_FAILURE = -1; public static final int VALUE_RESULT_FAILURE = -1;
@ExceptionHandler(value = Exception.class) @ExceptionHandler(value = Exception.class)
@ResponseBody @ResponseBody
public String handle(Exception e) { public String handle(Exception e) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
if (e instanceof AppException) { if (e instanceof AppException) {
StackTraceElement stack = e.getStackTrace()[0]; StackTraceElement stack = e.getStackTrace()[0];
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(), log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName()); stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e; AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage()); ret.put(KEY_RESULT_MSG, ex.getMessage());
} else { }
log.error("[system error]", e); if (e instanceof HttpMessageNotReadableException) {
ret.put(KEY_RESULT_MSG, "unknown exception!"); log.error("[system error]", e);
} response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
return ret.toJSONString(); ret.put(KEY_RESULT_MSG, "参数错误,"+ StrUtil.subBefore(e.getMessage(), ";", false));
} } else {
log.error("[system error]", e);
response.setStatus(HttpStatus.HTTP_INTERNAL_ERROR);
ret.put(KEY_RESULT_MSG, "未知错误!" + e.getMessage());
}
return ret.toJSONString();
}
} }
...@@ -15,7 +15,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -15,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -88,11 +87,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -88,11 +87,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token); Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY); String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
// cacheService.select(portalDb); cacheService.select(portalDb);
// String userStr = cacheService.get(userKey); String userStr = cacheService.get(userKey);
// cacheService.select(db); cacheService.select(db);
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String userStr =redisTemplate.opsForValue().get(userKey);
if (StringUtils.isNotEmpty(userStr)) { if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class); UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token); userEntity.setToken(token);
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
*/ */
package com.mortals.xhx.base.system.area.dao.ibatis; package com.mortals.xhx.base.system.area.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.base.system.area.dao.AreaDao; import com.mortals.xhx.base.system.area.dao.AreaDao;
import com.mortals.xhx.base.system.area.model.AreaEntity; import com.mortals.xhx.base.system.area.model.AreaEntity;
import org.springframework.stereotype.Repository;
/** /**
* Title: 区域信息 <br/> * Title: 区域信息 <br/>
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
package com.mortals.xhx.base.system.area.model; package com.mortals.xhx.base.system.area.model;
import java.util.Date;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import java.util.Date;
/** /**
* <p>Title: 区域信息</p> * <p>Title: 区域信息</p>
* <p>Description: AreaEntity </p> * <p>Description: AreaEntity </p>
......
...@@ -9,12 +9,10 @@ ...@@ -9,12 +9,10 @@
package com.mortals.xhx.base.system.area.service.impl; package com.mortals.xhx.base.system.area.service.impl;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.area.dao.AreaDao; import com.mortals.xhx.base.system.area.dao.AreaDao;
import com.mortals.xhx.base.system.area.model.AreaEntity; import com.mortals.xhx.base.system.area.model.AreaEntity;
import com.mortals.xhx.base.system.area.service.AreaService; import com.mortals.xhx.base.system.area.service.AreaService;
import org.springframework.stereotype.Service;
/** /**
* <p>Title: 区域信息</p> * <p>Title: 区域信息</p>
......
...@@ -4,30 +4,28 @@ ...@@ -4,30 +4,28 @@
package com.mortals.xhx.base.system.area.web; package com.mortals.xhx.base.system.area.web;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.SysConstains; import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum; import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.YesNo; import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.system.area.model.AreaEntity; import com.mortals.xhx.base.system.area.model.AreaEntity;
import com.mortals.xhx.base.system.area.service.AreaService; import com.mortals.xhx.base.system.area.service.AreaService;
import com.mortals.xhx.common.code.AreaLevelEnum; import com.mortals.xhx.common.code.AreaLevelEnum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
......
...@@ -3,7 +3,6 @@ package com.mortals.xhx.base.system.idgenerator.dao.ibatis; ...@@ -3,7 +3,6 @@ package com.mortals.xhx.base.system.idgenerator.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.base.system.idgenerator.dao.IdgeneratorDao; import com.mortals.xhx.base.system.idgenerator.dao.IdgeneratorDao;
import com.mortals.xhx.base.system.idgenerator.model.IdgeneratorEntity; import com.mortals.xhx.base.system.idgenerator.model.IdgeneratorEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
......
package com.mortals.xhx.base.system.idgenerator.service; package com.mortals.xhx.base.system.idgenerator.service;
import java.util.List;
import com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl.IdGeneratorKey; import com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl.IdGeneratorKey;
import java.util.List;
/** /**
* <p>Title: id生成器</p> * <p>Title: id生成器</p>
* <p>Description: IdgeneratorService service接口 </p> * <p>Description: IdgeneratorService service接口 </p>
......
...@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON; ...@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.mortals.xhx.base.system.idgenerator.dao.IdgeneratorDao; import com.mortals.xhx.base.system.idgenerator.dao.IdgeneratorDao;
import com.mortals.xhx.base.system.idgenerator.model.IdgeneratorEntity; import com.mortals.xhx.base.system.idgenerator.model.IdgeneratorEntity;
import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService; import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService;
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.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -12,6 +12,8 @@ package com.mortals.xhx.base.system.menu.dao; ...@@ -12,6 +12,8 @@ package com.mortals.xhx.base.system.menu.dao;
import com.mortals.framework.dao.ICRUDDao; import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.base.system.menu.model.MenuEntity; import com.mortals.xhx.base.system.menu.model.MenuEntity;
import java.util.List;
/** /**
* <p>Title: 菜单信息</p> * <p>Title: 菜单信息</p>
* <p>Description: MenuDao DAO接口 </p> * <p>Description: MenuDao DAO接口 </p>
...@@ -22,5 +24,14 @@ import com.mortals.xhx.base.system.menu.model.MenuEntity; ...@@ -22,5 +24,14 @@ import com.mortals.xhx.base.system.menu.model.MenuEntity;
*/ */
public interface MenuDao extends ICRUDDao<MenuEntity,Long> { public interface MenuDao extends ICRUDDao<MenuEntity,Long> {
List<MenuEntity> getListByUserId(Long userId);
/**
* 查询子节点
*
* @param
* @return
*/
List<MenuEntity> selectChildrenMenuById(String menuId);
} }
\ No newline at end of file
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
package com.mortals.xhx.base.system.menu.dao.ibatis; package com.mortals.xhx.base.system.menu.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.base.system.menu.dao.MenuDao; import com.mortals.xhx.base.system.menu.dao.MenuDao;
import com.mortals.xhx.base.system.menu.model.MenuEntity; import com.mortals.xhx.base.system.menu.model.MenuEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p>Title: 菜单信息</p> * <p>Title: 菜单信息</p>
* <p>Description: MenuDaoImpl DAO接口 </p> * <p>Description: MenuDaoImpl DAO接口 </p>
...@@ -25,4 +27,16 @@ import org.springframework.stereotype.Repository; ...@@ -25,4 +27,16 @@ import org.springframework.stereotype.Repository;
@Repository("menuDao") @Repository("menuDao")
public class MenuDaoImpl extends BaseCRUDDaoMybatis<MenuEntity,Long> implements MenuDao { public class MenuDaoImpl extends BaseCRUDDaoMybatis<MenuEntity,Long> implements MenuDao {
@Override
public List<MenuEntity> selectChildrenMenuById(String menuId) {
return getSqlSession().selectList(getSqlId("selectChildrenMenuById"), menuId);
}
@Override
public List<MenuEntity> getListByUserId(Long userId) {
ParamDto param = new ParamDto();
param.getCondition().put("userId", userId);
return getSqlSession().selectList(getSqlId("getListByUserId"), param);
}
} }
\ No newline at end of file
package com.mortals.xhx.base.system.menu.model;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.JSONToken;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 菜单信息业务前端映射树结构实体类
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class MenuTreeSelect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private Long id;
/**
* 父节点ID
*/
private Long parentId;
/**
* 节点名称
*/
private String label;
/**
* 菜单类型 (0.目录,1.菜单,2.按钮)
*/
private Integer menuType;
/**
* 菜单显示状态 (0.显示,1.隐藏)
*/
private Integer visible;
/**
* 权限标识,多个逗号分割
*/
private String perms;
/**
* 权限标识,多个逗号分割
*/
private String resourceUrl;
/**
* 是否隐藏(0.否,1.是)
*/
private Integer hideChildrenInMenu;
/**
* 是否选中,0为未选中,1选中。默认0
*/
private Integer checked;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<MenuTreeSelect> children;
public MenuTreeSelect() {};
public MenuTreeSelect(MenuEntity entity) {
this.id = entity.getId();
this.parentId = entity.getParentId();
this.label = entity.getName();
this.menuType = entity.getMenuType();
this.visible = entity.getVisible();
this.perms = entity.getPerms();
this.resourceUrl=entity.getResourceUrl();
this.checked=entity.getChecked();
this.hideChildrenInMenu = entity.getHideChildrenInMenu();
if(!ObjectUtils.isEmpty(entity.getChildren())){
this.children = entity.getChildren().stream().map(MenuTreeSelect::new).collect(Collectors.toList());
}
}
// 反序列化器
public class Deserializer implements ObjectDeserializer {
@Override
public MenuTreeSelect deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
MenuTreeSelect node = new MenuTreeSelect();
JSONObject jsonObject = parser.parseObject();
node.setId(jsonObject.getLong("id"));
node.setLabel(jsonObject.getString("label"));
node.setMenuType(jsonObject.getInteger("menuType"));
node.setVisible(jsonObject.getInteger("visible"));
node.setPerms(jsonObject.getString("perms"));
node.setResourceUrl(jsonObject.getString("resourceUrl"));
node.setChecked(jsonObject.getInteger("checked"));
node.setHideChildrenInMenu(jsonObject.getInteger("hideChildrenInMenu"));
JSONArray jsonArray = jsonObject.getJSONArray("children");
List<MenuTreeSelect> children = new ArrayList<>();
if(!ObjectUtils.isEmpty(jsonArray)){
for (int i = 0; i < jsonArray.size(); i++) {
MenuTreeSelect child = JSON.parseObject(jsonArray.getJSONObject(i).toJSONString(), MenuTreeSelect.class);
children.add(child);
}
}
node.setChildren(children);
return node;
}
@Override
public int getFastMatchToken() {
return JSONToken.LBRACE;
}
}
}
\ No newline at end of file
...@@ -11,7 +11,6 @@ package com.mortals.xhx.base.system.oper.dao.ibatis; ...@@ -11,7 +11,6 @@ package com.mortals.xhx.base.system.oper.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.base.system.oper.dao.OperLogDao; import com.mortals.xhx.base.system.oper.dao.OperLogDao;
import com.mortals.xhx.base.system.oper.model.OperLogEntity; import com.mortals.xhx.base.system.oper.model.OperLogEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
package com.mortals.xhx.base.system.oper.model; package com.mortals.xhx.base.system.oper.model;
import java.util.Date;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import java.util.Date;
/** /**
* <p>Title: 操作日志</p> * <p>Title: 操作日志</p>
* <p>Description: OperLogEntity </p> * <p>Description: OperLogEntity </p>
......
...@@ -24,7 +24,6 @@ import java.util.List; ...@@ -24,7 +24,6 @@ import java.util.List;
*/ */
public interface ResourceDao extends ICRUDDao<ResourceEntity,Long> { public interface ResourceDao extends ICRUDDao<ResourceEntity,Long> {
public List<ResourceEntity> getListByUserId(Long userId); List<ResourceEntity> getListByUserId(Long userId);
List<ResourceEntity> getAll(int userType);
} }
\ 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