From becc73840b291cb47b759193126a00e6934603dd Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Sun, 21 May 2023 22:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E6=97=B6=E9=97=B4=E8=A1=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 17 +- .../controller/SysLoginController.java | 16 -- .../TerminalScheduleRuleController.java | 5 +- .../controller/TestController.java | 2 + .../XymanagerAdminApplicationTests.java | 18 +- xymanager_common/pom.xml | 18 +- .../entity/RequestResults.java | 31 +++ ...ScheduleRule.java => ScheduleDetails.java} | 2 +- .../entity/TerminalScheduleDetails.java | 78 ++++++ ...duleMapper.java => TerminalSchedules.java} | 2 +- .../entity/TerminalSchedulesTemp.java | 28 ++ .../UserPasswordNotMatchException.java | 18 +- .../manager/factory/AsyncFactory.java | 152 +++++----- .../xymanager_common/security/LoginUser.java | 214 -------------- .../CustomAuthExceptionEntryPoint.java | 44 --- .../xymanager_common/util/SecurityUtils.java | 92 ------ .../xymanager_dao/dao/RequestResultsDao.java | 17 ++ .../xymanager_dao/dao/ScheduleDetailsDao.java | 26 ++ ...inalScheduleDao.java => SchedulesDao.java} | 2 +- .../dao/TerminalChannelsDao.java | 2 - .../dao/TerminalScheduleMapperDao.java | 28 -- .../dao/TerminalScheduleMapperTempDao.java | 17 -- .../dao/TerminalScheduleRuleDao.java | 26 -- .../dao/TerminalSchedulesDao.java | 28 ++ .../dao/TerminalSchedulesTempDao.java | 29 ++ .../shxy/xymanager_dao/dao/TerminalsDao.java | 3 + .../src/main/resources/generatorConfig.xml | 29 +- .../resources/mappers/RequestResultsDao.xml | 96 +++++++ ...duleRuleDao.xml => ScheduleDetailsDao.xml} | 12 +- .../main/resources/mappers/SchedulesDao.xml | 2 +- .../resources/mappers/TerminalChannelsDao.xml | 2 +- .../resources/mappers/TerminalPhotoDao.xml | 2 +- ...Dao.xml => TerminalScheduleDetailsDao.xml} | 93 ++++--- .../mappers/TerminalScheduleTempDao.xml | 151 ++++++++++ ...MapperDao.xml => TerminalSchedulesDao.xml} | 30 +- .../main/resources/mappers/TerminalsDao.xml | 37 +++ .../config}/CustomSecurityConfig.java | 13 +- .../interaction}/JwtInterceptor.java | 6 +- xymanager_service/pom.xml | 9 - .../impl/CustomPermissionServiceImpl.java | 44 --- .../impl/CustomUserDetailsServiceImpl.java | 51 ---- .../impl/LoginServiceImpl.java | 4 - .../impl/LogoutSuccessHandlerImpl.java | 35 --- .../impl/SysUserServiceImpl.java | 3 - .../impl/TerminalScheduleRuleServiceImpl.java | 263 +++++++++++++----- .../service/CustomPermissionService.java | 22 -- .../service/CustomUserDetailsService.java | 20 -- .../service/LoginService.java | 16 -- .../service/TerminalScheduleRuleService.java | 3 +- 49 files changed, 923 insertions(+), 935 deletions(-) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/entity/RequestResults.java rename xymanager_common/src/main/java/com/shxy/xymanager_common/entity/{TerminalScheduleRule.java => ScheduleDetails.java} (86%) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleDetails.java rename xymanager_common/src/main/java/com/shxy/xymanager_common/entity/{TerminalScheduleMapper.java => TerminalSchedules.java} (84%) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedulesTemp.java delete mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/security/LoginUser.java delete mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/security/componet/CustomAuthExceptionEntryPoint.java delete mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/util/SecurityUtils.java create mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java create mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/ScheduleDetailsDao.java rename xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/{TerminalScheduleDao.java => SchedulesDao.java} (95%) delete mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperDao.java delete mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperTempDao.java delete mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleRuleDao.java create mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java create mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java create mode 100644 xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml rename xymanager_dao/src/main/resources/mappers/{TerminalScheduleRuleDao.xml => ScheduleDetailsDao.xml} (94%) rename xymanager_dao/src/main/resources/mappers/{TerminalScheduleMapperTempDao.xml => TerminalScheduleDetailsDao.xml} (56%) create mode 100644 xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml rename xymanager_dao/src/main/resources/mappers/{TerminalScheduleMapperDao.xml => TerminalSchedulesDao.xml} (88%) rename {xymanager_service/src/main/java/com/shxy/xymanager_service/service/security => xymanager_framework/src/main/java/com/shxy/xymanager_framework/config}/CustomSecurityConfig.java (75%) rename {xymanager_service/src/main/java/com/shxy/xymanager_service/service/security => xymanager_framework/src/main/java/com/shxy/xymanager_framework/interaction}/JwtInterceptor.java (98%) delete mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/CustomPermissionServiceImpl.java delete mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/CustomUserDetailsServiceImpl.java delete mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LogoutSuccessHandlerImpl.java delete mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/CustomPermissionService.java delete mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/CustomUserDetailsService.java diff --git a/pom.xml b/pom.xml index 7d28eaa..ed9c4e3 100644 --- a/pom.xml +++ b/pom.xml @@ -75,11 +75,11 @@ ${swagger.version} - - io.jsonwebtoken - jjwt - ${jwt.version} - + + + + + @@ -108,13 +108,6 @@ ${fastjson.version} - - io.jsonwebtoken - jjwt - ${jwt.version} - - - diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SysLoginController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SysLoginController.java index 37a41bc..99edb82 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SysLoginController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SysLoginController.java @@ -1,15 +1,10 @@ package com.shxy.xymanager_admin.controller; -import com.shxy.xymanager_common.base.AjaxResult; import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.SysUser; -import com.shxy.xymanager_common.constant.Constants; -import com.shxy.xymanager_common.model.TerminalListModel; -import com.shxy.xymanager_common.security.LoginUser; -import com.shxy.xymanager_common.util.ServletUtils; import com.shxy.xymanager_common.vo.SysUserVo; import com.shxy.xymanager_service.service.LoginService; import com.shxy.xymanager_service.service.SysUserService; @@ -27,16 +22,12 @@ import org.springframework.web.bind.annotation.*; @Slf4j public class SysLoginController { - @Autowired private LoginService loginService; @Autowired SysUserService sysUserService; - - - /** * @Description 登录方法 * @@ -55,10 +46,6 @@ public class SysLoginController { } } - - - - /** * 新增用户 * @@ -78,7 +65,4 @@ public class SysLoginController { } } - - - } diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java index d020094..09db745 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java @@ -5,6 +5,7 @@ import com.shxy.xymanager_common.base.BaseController; import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceStatus; +import com.shxy.xymanager_common.model.GetModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel; @@ -99,8 +100,8 @@ public class TerminalScheduleRuleController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/relateSchelduleRule") @Log(title = "关联任务规则", type = "修改") - public ResponseReult relateSchelduleRule(@RequestBody @Validated RelateTerminalListRuleIdVo vo) { - ServiceBody serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo); + public ResponseReult relateSchelduleRule(@RequestBody @Validated RelateTerminalListRuleIdVo vo) { + ServiceBody serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TestController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TestController.java index 07b75fe..a52ecf2 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TestController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TestController.java @@ -8,7 +8,9 @@ import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; @Api(value = "测试接口", tags = "测试接口tags") diff --git a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java index f733432..1a2c3d2 100644 --- a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java +++ b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java @@ -1,34 +1,20 @@ package com.shxy.xymanager_admin; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateTime; -import com.shxy.xymanager_common.dto.ChannelAndTermDto; -import com.shxy.xymanager_common.dto.PhotoAndLineAndChannelDto; -import com.shxy.xymanager_common.dto.TermAndChannelLatestPhotoMapperDto; -import com.shxy.xymanager_common.entity.DyLevel; -import com.shxy.xymanager_common.enums.CommonStatus; -import com.shxy.xymanager_common.model.LineAndGtAndChannelListModel; -import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.SaltUtil; import com.shxy.xymanager_dao.dao.*; -import io.swagger.models.auth.In; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; - @SpringBootTest class XymanagerAdminApplicationTests { @Autowired TerminalsDao terminalsDao; @Autowired - TerminalScheduleRuleDao terminalScheduleRuleDao; + ScheduleDetailsDao scheduleDetailsDao; @Autowired - TerminalScheduleDao terminalScheduleDao; + SchedulesDao schedulesDao; @Autowired LinesDao linesDao; @Autowired diff --git a/xymanager_common/pom.xml b/xymanager_common/pom.xml index c68d91e..7c1b22a 100644 --- a/xymanager_common/pom.xml +++ b/xymanager_common/pom.xml @@ -51,11 +51,11 @@ knife4j-spring-boot-starter - - eu.bitwalker - UserAgentUtils - 1.21 - + + + + + @@ -131,10 +131,10 @@ - - org.springframework.boot - spring-boot-starter-security - + + + + diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/RequestResults.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/RequestResults.java new file mode 100644 index 0000000..b99e1e5 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/RequestResults.java @@ -0,0 +1,31 @@ +package com.shxy.xymanager_common.entity; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class RequestResults implements Serializable { + private Integer id; + + private Integer termId; + + private Integer requestType; + + private Integer frameNo; + + private Integer clientId; + + private Integer requestId; + + private Integer result; + + private Long requestTime; + + private Long createTime; + + private String data; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleRule.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/ScheduleDetails.java similarity index 86% rename from xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleRule.java rename to xymanager_common/src/main/java/com/shxy/xymanager_common/entity/ScheduleDetails.java index 3ba69fb..10020c6 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleRule.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/ScheduleDetails.java @@ -7,7 +7,7 @@ import java.sql.Time; import java.util.Date; @Data -public class TerminalScheduleRule implements Serializable { +public class ScheduleDetails implements Serializable { private Integer id; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleDetails.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleDetails.java new file mode 100644 index 0000000..31d4533 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleDetails.java @@ -0,0 +1,78 @@ +package com.shxy.xymanager_common.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TerminalScheduleDetails implements Serializable { + private Integer id; + + private Integer scheduleId; + + private Date startTime; + + private Date endTime; + + private Integer span; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getScheduleId() { + return scheduleId; + } + + public void setScheduleId(Integer scheduleId) { + this.scheduleId = scheduleId; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Integer getSpan() { + return span; + } + + public void setSpan(Integer span) { + this.span = span; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleMapper.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedules.java similarity index 84% rename from xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleMapper.java rename to xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedules.java index e7d80ab..108a961 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalScheduleMapper.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedules.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.Date; @Data -public class TerminalScheduleMapper implements Serializable { +public class TerminalSchedules implements Serializable { private Integer id; private Integer termId; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedulesTemp.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedulesTemp.java new file mode 100644 index 0000000..5fec758 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalSchedulesTemp.java @@ -0,0 +1,28 @@ +package com.shxy.xymanager_common.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class TerminalSchedulesTemp implements Serializable { + private Integer id; + + private Integer termId; + + private Integer channelId; + + private Integer scheduleId; + + private Integer requestId; + + private Integer status; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/exception/UserPasswordNotMatchException.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/exception/UserPasswordNotMatchException.java index 1966efc..c3da16f 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/exception/UserPasswordNotMatchException.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/exception/UserPasswordNotMatchException.java @@ -9,8 +9,7 @@ package com.shxy.xymanager_common.exception; * @Version V1.0 */ -public class UserPasswordNotMatchException extends RuntimeException -{ +public class UserPasswordNotMatchException extends RuntimeException { private static final long serialVersionUID = 1L; @@ -18,31 +17,26 @@ public class UserPasswordNotMatchException extends RuntimeException private String message; - public UserPasswordNotMatchException(String message) - { + public UserPasswordNotMatchException(String message) { this.message = message; } - public UserPasswordNotMatchException(String message, Integer code) - { + public UserPasswordNotMatchException(String message, Integer code) { this.message = message; this.code = code; } - public UserPasswordNotMatchException(String message, Throwable e) - { + public UserPasswordNotMatchException(String message, Throwable e) { super(message, e); this.message = message; } @Override - public String getMessage() - { + public String getMessage() { return message; } - public Integer getCode() - { + public Integer getCode() { return code; } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/manager/factory/AsyncFactory.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/manager/factory/AsyncFactory.java index 3429451..b725290 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/manager/factory/AsyncFactory.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/manager/factory/AsyncFactory.java @@ -1,76 +1,76 @@ -package com.shxy.xymanager_common.manager.factory; - -import com.shxy.xymanager_common.constant.Constants; -import com.shxy.xymanager_common.model.SysLoginLog; -import com.shxy.xymanager_common.util.LogUtils; -import com.shxy.xymanager_common.util.ServletUtils; -import com.shxy.xymanager_common.util.ip.AddressUtils; -import com.shxy.xymanager_common.util.ip.IpUtils; -import eu.bitwalker.useragentutils.UserAgent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.TimerTask; - - -/** - * @ClassName:AsyncFactory - * @Description: 异步工厂(产生任务用) - * @Author: Arno_Fu - * @CreatTime:12/20/2019 - 5:03 PM - * @Version V1.0 - */ - -public class AsyncFactory { - private static final Logger sys_user_logger = LoggerFactory.getLogger( "sys-user" ); - - /** - * 记录登陆信息 - * - * @param username 用户名 - * @param status 状态 - * @param message 消息 - * @param args 列表 - * @return 任务task - */ - public static TimerTask recordLoginLog(final String username, final String status, final String message, - final Object... args) { - final UserAgent userAgent = UserAgent.parseUserAgentString( ServletUtils.getRequest().getHeader( "User-Agent" ) ); - final String ip = IpUtils.getIpAddr( ServletUtils.getRequest() ); - return new TimerTask() { - @Override - public void run() { - String address = AddressUtils.getRealAddressByIP( ip ); - StringBuilder s = new StringBuilder(); - s.append( LogUtils.getBlock( ip ) ); - s.append( address ); - s.append( LogUtils.getBlock( username ) ); - s.append( LogUtils.getBlock( status ) ); - s.append( LogUtils.getBlock( message ) ); - // 打印信息到日志 - sys_user_logger.info( s.toString(), args ); - // 获取客户端操作系统 - String os = userAgent.getOperatingSystem().getName(); - // 获取客户端浏览器 - String browser = userAgent.getBrowser().getName(); - // 封装对象 - SysLoginLog logininfor = new SysLoginLog(); - logininfor.setUserName( username ); - logininfor.setIpaddr( ip ); - logininfor.setLoginLocation( address ); - logininfor.setBrowser( browser ); - logininfor.setOs( os ); - logininfor.setMsg( message ); - // 日志状态 - if (Constants.LOGIN_SUCCESS.equals( status ) || Constants.LOGOUT.equals( status )) { - logininfor.setStatus( Constants.SUCCESS ); - } else if (Constants.LOGIN_FAIL.equals( status )) { - logininfor.setStatus( Constants.FAIL ); - } - // 插入数据 -// SpringUtils.getBean( SysLoginLogService.class ).insertLoginLog( logininfor ); - } - }; - } - -} +//package com.shxy.xymanager_common.manager.factory; +// +//import com.shxy.xymanager_common.constant.Constants; +//import com.shxy.xymanager_common.model.SysLoginLog; +//import com.shxy.xymanager_common.util.LogUtils; +//import com.shxy.xymanager_common.util.ServletUtils; +//import com.shxy.xymanager_common.util.ip.IpUtils; +//import eu.bitwalker.useragentutils.UserAgent; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +// +//import java.util.TimerTask; +// +// +///** +// * @ClassName:AsyncFactory +// * @Description: 异步工厂(产生任务用) +// * @Author: Arno_Fu +// * @CreatTime:12/20/2019 - 5:03 PM +// * @Version V1.0 +// */ +// +//public class AsyncFactory { +// private static final Logger sys_user_logger = LoggerFactory.getLogger( "sys-user" ); +// +// /** +// * 记录登陆信息 +// * +// * @param username 用户名 +// * @param status 状态 +// * @param message 消息 +// * @param args 列表 +// * @return 任务task +// */ +// public static TimerTask recordLoginLog(final String username, final String status, final String message, +// final Object... args) { +// final UserAgent userAgent = UserAgent.parseUserAgentString( ServletUtils.getRequest().getHeader( "User-Agent" ) ); +// final String ip = IpUtils.getIpAddr( ServletUtils.getRequest() ); +// return new TimerTask() { +// @Override +// public void run() { +//// String address = AddressUtils.getRealAddressByIP( ip ); +// String address = ""; +// StringBuilder s = new StringBuilder(); +// s.append( LogUtils.getBlock( ip ) ); +// s.append( address ); +// s.append( LogUtils.getBlock( username ) ); +// s.append( LogUtils.getBlock( status ) ); +// s.append( LogUtils.getBlock( message ) ); +// // 打印信息到日志 +// sys_user_logger.info( s.toString(), args ); +// // 获取客户端操作系统 +// String os = userAgent.getOperatingSystem().getName(); +// // 获取客户端浏览器 +// String browser = userAgent.getBrowser().getName(); +// // 封装对象 +// SysLoginLog logininfor = new SysLoginLog(); +// logininfor.setUserName( username ); +// logininfor.setIpaddr( ip ); +// logininfor.setLoginLocation( address ); +// logininfor.setBrowser( browser ); +// logininfor.setOs( os ); +// logininfor.setMsg( message ); +// // 日志状态 +// if (Constants.LOGIN_SUCCESS.equals( status ) || Constants.LOGOUT.equals( status )) { +// logininfor.setStatus( Constants.SUCCESS ); +// } else if (Constants.LOGIN_FAIL.equals( status )) { +// logininfor.setStatus( Constants.FAIL ); +// } +// // 插入数据 +//// SpringUtils.getBean( SysLoginLogService.class ).insertLoginLog( logininfor ); +// } +// }; +// } +// +//} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/security/LoginUser.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/security/LoginUser.java deleted file mode 100644 index e4f4172..0000000 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/security/LoginUser.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.shxy.xymanager_common.security; - - - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.shxy.xymanager_common.bean.SysUser; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; - -import java.math.BigInteger; -import java.util.Collection; -import java.util.Set; - -/** - * @ClassName:LoginUser - * @Description: 登录用户身份权限 - * @Author: Arno_Fu - * @CreatTime:11/26/2019 - 6:47 PM - * @Version V1.0 - */ - -public class LoginUser implements UserDetails { - - private static final long serialVersionUID = 1L; - - - /** - * 用户信息 - */ - private SysUser user; - - /** - * 用户唯一标识 - */ - private String token; - - /** - * 登陆时间 - */ - private Long loginTime; - - /** - * 过期时间 - */ - private BigInteger expireTime; - - /** - * 登录IP地址 - */ - private String ipaddr; - - private String sessionId; - - /** - * 登录地点 - */ - private String loginLocation; - - /** - * 浏览器类型 - */ - private String browser; - - /** - * 操作系统 - */ - private String os; - - /** - * 操作系统 - */ - private String dept; - - - public LoginUser() - { - } - - public LoginUser(SysUser user) - { - this.user = user; - } - - @JsonIgnore - @Override - public String getPassword() - { - return user.getPassword(); - } - - @Override - public String getUsername() - { - return user.getUserName(); - } - - public String getDept() { - return dept; - } - - public void setDept(String dept) { - this.dept = dept; - } - - public SysUser getUser() { - return user; - } - - public void setUser(SysUser user) { - this.user = user; - } - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public Long getLoginTime() { - return loginTime; - } - - public void setLoginTime(Long loginTime) { - this.loginTime = loginTime; - } - - public BigInteger getExpireTime() { - return expireTime; - } - - public void setExpireTime(BigInteger expireTime) { - this.expireTime = expireTime; - } - - public String getIpaddr() { - return ipaddr; - } - - public void setIpaddr(String ipaddr) { - this.ipaddr = ipaddr; - } - - public String getLoginLocation() { - return loginLocation; - } - - public void setLoginLocation(String loginLocation) { - this.loginLocation = loginLocation; - } - - public String getBrowser() { - return browser; - } - - public void setBrowser(String browser) { - this.browser = browser; - } - - public String getOs() { - return os; - } - - public void setOs(String os) { - this.os = os; - } - - @Override - public Collection getAuthorities() { - return null; - } - - - /** - * 账户是否过期 - * @return - */ - @JsonIgnore - @Override - public boolean isAccountNonExpired() { - return true; - } - - /** - * 是否禁用 - * @return - */ - @JsonIgnore - @Override - public boolean isAccountNonLocked() { - return true; - } - - /** - * 密码是否过期 - * @return - */ - @JsonIgnore - @Override - public boolean isCredentialsNonExpired() { - return true; - } - - /** - * 是否启用 - * @return - */ - @JsonIgnore - @Override - public boolean isEnabled() { - return true; - } -} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/security/componet/CustomAuthExceptionEntryPoint.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/security/componet/CustomAuthExceptionEntryPoint.java deleted file mode 100644 index a5080b2..0000000 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/security/componet/CustomAuthExceptionEntryPoint.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.shxy.xymanager_common.security.componet; - - -import com.alibaba.fastjson.JSON; -import com.shxy.xymanager_common.base.AjaxResult; -import com.shxy.xymanager_common.constant.HttpStatusCode; -import com.shxy.xymanager_common.util.StringUtils; -import org.springframework.http.HttpStatus; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.stereotype.Component; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - - -/** - * @ClassName:CustomAuthExceptionEntryPoint - * @Description: 无效token异常类重写. - * @Author: Arno_Fu - * @CreatTime:11/26/2019 - 6:20 PM - * @Version V1.0 - */ - -@Component -public class CustomAuthExceptionEntryPoint implements AuthenticationEntryPoint -{ - - @Override - public void commence(HttpServletRequest request, HttpServletResponse response, - AuthenticationException authException) throws ServletException { - response.setStatus( HttpStatus.OK.value()); - response.setHeader("Content-Type", "application/json;charset=UTF-8"); - try { - String result = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); - String msg = JSON.toJSONString( AjaxResult.error( HttpStatusCode.UNAUTHORIZED , result ) ); - response.getWriter().write( msg ); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/util/SecurityUtils.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/util/SecurityUtils.java deleted file mode 100644 index 8812c28..0000000 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/util/SecurityUtils.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.shxy.xymanager_common.util; - - -import com.shxy.xymanager_common.security.LoginUser; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; - -/** - * @ClassName:SecurityUtils - * @Description: 安全服务工具类 - * @Author: Arno_Fu - * @CreatTime:12/19/2019 - 4:46 PM - * @Version V1.0 - */ - -public class SecurityUtils -{ - /** - * 获取用户账户 - **/ - public static String getUsername() - { - try - { - /* return getLoginUser().getUsername();*/ - } - catch (Exception e) - { - /* throw new CustomException("获取用户账户异常", HttpStatusCode.UNAUTHORIZED);*/ - } - return "!"; - } - - /** - * 获取用户 - **/ - public static LoginUser getLoginUser() throws Exception { - try - { - return (LoginUser) getAuthentication().getPrincipal(); - } - catch (Exception e) - { - throw new Exception("获取用户信息异常:",e.getCause()); - } - } - - /** - * 获取Authentication - */ - public static Authentication getAuthentication() - { - return SecurityContextHolder.getContext().getAuthentication(); - } - - /** - * 生成BCryptPasswordEncoder密码 - * - * @param password 密码 - * @return 加密字符串 - */ - public static String encryptPassword(String password) - { - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - return passwordEncoder.encode(password); - } - - /** - * 判断密码是否相同 - * - * @param rawPassword 真实密码 - * @param encodedPassword 加密后字符 - * @return 结果 - */ - public static boolean matchesPassword(String rawPassword, String encodedPassword) - { - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - return passwordEncoder.matches(rawPassword, encodedPassword); - } - - /** - * 是否为管理员 - * - * @param userId 用户ID - * @return 结果 - */ - public static boolean isAdmin(Long userId) - { - return userId != null && 1L == userId; - } -} diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java new file mode 100644 index 0000000..4fd6e29 --- /dev/null +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java @@ -0,0 +1,17 @@ +package com.shxy.xymanager_dao.dao; + +import com.shxy.xymanager_common.entity.RequestResults; +import org.apache.ibatis.annotations.Param; + +public interface RequestResultsDao { + + RequestResults selectByPrimaryKey(Integer id); + + RequestResults selectByRequestId(@Param("requestId") Integer id); + + int updateByPrimaryKeySelective(RequestResults record); + + int updateByPrimaryKeyWithBLOBs(RequestResults record); + + int updateByPrimaryKey(RequestResults record); +} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/ScheduleDetailsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/ScheduleDetailsDao.java new file mode 100644 index 0000000..53e01ff --- /dev/null +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/ScheduleDetailsDao.java @@ -0,0 +1,26 @@ +package com.shxy.xymanager_dao.dao; + +import com.shxy.xymanager_common.entity.ScheduleDetails; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface ScheduleDetailsDao { + + int insertSelective(ScheduleDetails record); + + int insertList(@Param("list") List record, @Param("createat") Date create, @Param("updateat") Date update); + + ScheduleDetails selectByPrimaryKey(Integer id); + + List selectAll(@Param("status") Integer status); + + + + int deleteById(@Param("scheduleid") Integer id); + + int updateByPrimaryKeySelective(@Param("data") ScheduleDetails record, @Param("updateat") Date update); + + int updateByPrimaryKey(ScheduleDetails record); +} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/SchedulesDao.java similarity index 95% rename from xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleDao.java rename to xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/SchedulesDao.java index 800a1ef..7bcdd1f 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/SchedulesDao.java @@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; -public interface TerminalScheduleDao { +public interface SchedulesDao { List selectAll(@Param("status") Integer status); diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java index 8d7d432..469d227 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java @@ -3,8 +3,6 @@ package com.shxy.xymanager_dao.dao; import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto; import com.shxy.xymanager_common.dto.TermChannelAndMapperDto; import com.shxy.xymanager_common.entity.TerminalChannels; -import com.shxy.xymanager_common.entity.TerminalScheduleMapper; -import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.vo.TerminalChannelVo; import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo; import org.apache.ibatis.annotations.Param; diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperDao.java deleted file mode 100644 index e89e30a..0000000 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.shxy.xymanager_dao.dao; - -import com.shxy.xymanager_common.entity.TerminalScheduleMapper; -import com.shxy.xymanager_common.vo.RelateTerminalListRuleIdVo; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -public interface TerminalScheduleMapperDao { - int deleteByChannelId(@Param("list") List list); - - int insert(TerminalScheduleMapper record); - - int insertSelective(TerminalScheduleMapper record); - - int insertList(@Param("list") List record, @Param("createat") Date create, @Param("updateat") Date update); - - TerminalScheduleMapper selectByPrimaryKey(Integer id); - - TerminalScheduleMapper selectByChannelId(@Param("channelid") Integer list, @Param("termid") Integer termid); - - List selectByTerminalBean(@Param("list") List list); - - int updateByPrimaryKeySelective(TerminalScheduleMapper record); - - int updateByPrimaryKey(TerminalScheduleMapper record); -} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperTempDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperTempDao.java deleted file mode 100644 index c1a8055..0000000 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleMapperTempDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.shxy.xymanager_dao.dao; - -import com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp; - -public interface TerminalScheduleMapperTempDao { - int deleteByPrimaryKey(Integer id); - - int insert(TerminalScheduleMapperTemp record); - - int insertSelective(TerminalScheduleMapperTemp record); - - TerminalScheduleMapperTemp selectByPrimaryKey(Integer id); - - int updateByPrimaryKeySelective(TerminalScheduleMapperTemp record); - - int updateByPrimaryKey(TerminalScheduleMapperTemp record); -} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleRuleDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleRuleDao.java deleted file mode 100644 index 61e342e..0000000 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalScheduleRuleDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.shxy.xymanager_dao.dao; - -import com.shxy.xymanager_common.entity.TerminalScheduleRule; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -public interface TerminalScheduleRuleDao { - - int insertSelective(TerminalScheduleRule record); - - int insertList(@Param("list") List record, @Param("createat") Date create, @Param("updateat") Date update); - - TerminalScheduleRule selectByPrimaryKey(Integer id); - - List selectAll(@Param("status") Integer status); - - - - int deleteById(@Param("scheduleid") Integer id); - - int updateByPrimaryKeySelective(@Param("data") TerminalScheduleRule record,@Param("updateat") Date update); - - int updateByPrimaryKey(TerminalScheduleRule record); -} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java new file mode 100644 index 0000000..ea1ab41 --- /dev/null +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java @@ -0,0 +1,28 @@ +package com.shxy.xymanager_dao.dao; + +import com.shxy.xymanager_common.entity.TerminalSchedules; +import com.shxy.xymanager_common.vo.RelateTerminalListRuleIdVo; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface TerminalSchedulesDao { + int deleteByChannelId(@Param("list") List list); + + int insert(TerminalSchedules record); + + int insertSelective(TerminalSchedules record); + + int insertList(@Param("list") List record, @Param("createat") Date create, @Param("updateat") Date update); + + TerminalSchedules selectByPrimaryKey(Integer id); + + TerminalSchedules selectByChannelId(@Param("channelid") Integer list, @Param("termid") Integer termid); + + List selectByTerminalBean(@Param("list") List list); + + int updateByPrimaryKeySelective(TerminalSchedules record); + + int updateByPrimaryKey(TerminalSchedules record); +} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java new file mode 100644 index 0000000..ed2659e --- /dev/null +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java @@ -0,0 +1,29 @@ +package com.shxy.xymanager_dao.dao; + +import com.shxy.xymanager_common.entity.TerminalSchedulesTemp; +import com.shxy.xymanager_common.vo.RelateTerminalListRuleIdVo; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface TerminalSchedulesTempDao { + + List selectByTermAndChannel(@Param("list") List list, @Param("status") Integer status); + + TerminalSchedulesTemp selectByRequestId(@Param("list") List id, @Param("status") Integer status); + + int deleteByPrimaryKey(Integer id); + + int insert(TerminalSchedulesTemp record); + + int insertList(@Param("list") List record, @Param("status") Integer status, @Param("createat") Date createat, @Param("updateat") Date updateat); + + int insertSelective(TerminalSchedulesTemp record); + + TerminalSchedulesTemp selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TerminalSchedulesTemp record); + + int updateByPrimaryKey(TerminalSchedulesTemp record); +} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java index 50d3643..a4732fe 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java @@ -4,6 +4,7 @@ import com.shxy.xymanager_common.dto.ChannelAndTermDto; import com.shxy.xymanager_common.dto.TerminalInfoDto; import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto; import com.shxy.xymanager_common.entity.Terminals; +import com.shxy.xymanager_common.vo.RelateTerminalListRuleIdVo; import com.shxy.xymanager_common.vo.TerminalIdUpdateVo; import org.apache.ibatis.annotations.Param; @@ -29,6 +30,8 @@ public interface TerminalsDao { Terminals selectByPrimaryKey(Integer id); + List selectByIdList(@Param("list") List list, @Param("status") Integer status); + int updateByPrimaryKeySelective(@Param("data") Terminals record, @Param("updateat") Date update); int updateByPrimaryKey(Terminals record); diff --git a/xymanager_dao/src/main/resources/generatorConfig.xml b/xymanager_dao/src/main/resources/generatorConfig.xml index 61e872e..8fc48fe 100644 --- a/xymanager_dao/src/main/resources/generatorConfig.xml +++ b/xymanager_dao/src/main/resources/generatorConfig.xml @@ -112,7 +112,7 @@ - + @@ -197,22 +197,29 @@ + + + + + + + + + + + + + + -
- - -
\ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml b/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml new file mode 100644 index 0000000..4896058 --- /dev/null +++ b/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + id, term_id, request_type, frame_no, client_id, request_id, result, data,request_time, + create_time + + + + + + + + + update request_results + + + term_id = #{termId,jdbcType=INTEGER}, + + + request_type = #{requestType,jdbcType=TINYINT}, + + + frame_no = #{frameNo,jdbcType=TINYINT}, + + + client_id = #{clientId,jdbcType=TINYINT}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + result = #{result,jdbcType=TINYINT}, + + + request_time = #{requestTime,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + data = #{data,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update request_results + set term_id = #{termId,jdbcType=INTEGER}, + request_type = #{requestType,jdbcType=TINYINT}, + frame_no = #{frameNo,jdbcType=TINYINT}, + client_id = #{clientId,jdbcType=TINYINT}, + request_id = #{requestId,jdbcType=INTEGER}, + result = #{result,jdbcType=TINYINT}, + request_time = #{requestTime,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT}, + data = #{data,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update request_results + set term_id = #{termId,jdbcType=INTEGER}, + request_type = #{requestType,jdbcType=TINYINT}, + frame_no = #{frameNo,jdbcType=TINYINT}, + client_id = #{clientId,jdbcType=TINYINT}, + request_id = #{requestId,jdbcType=INTEGER}, + result = #{result,jdbcType=TINYINT}, + request_time = #{requestTime,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleRuleDao.xml b/xymanager_dao/src/main/resources/mappers/ScheduleDetailsDao.xml similarity index 94% rename from xymanager_dao/src/main/resources/mappers/TerminalScheduleRuleDao.xml rename to xymanager_dao/src/main/resources/mappers/ScheduleDetailsDao.xml index 219f304..df0f9c9 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalScheduleRuleDao.xml +++ b/xymanager_dao/src/main/resources/mappers/ScheduleDetailsDao.xml @@ -1,7 +1,7 @@ - - + + @@ -26,7 +26,7 @@ from schedule_details where status = #{status} - + insert into schedule_details (id, name, start_time, end_time, span, remark, create_time, update_time) @@ -45,7 +45,7 @@ - + insert into schedule_details @@ -107,7 +107,7 @@ where schedule_id = #{scheduleid} - + update schedules @@ -122,7 +122,7 @@ where id = #{data.id,jdbcType=INTEGER} - + update schedule_details set name = #{name,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=TIME}, diff --git a/xymanager_dao/src/main/resources/mappers/SchedulesDao.xml b/xymanager_dao/src/main/resources/mappers/SchedulesDao.xml index 23eacaa..a1a922b 100644 --- a/xymanager_dao/src/main/resources/mappers/SchedulesDao.xml +++ b/xymanager_dao/src/main/resources/mappers/SchedulesDao.xml @@ -1,6 +1,6 @@ - + diff --git a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml index 279cc67..bd7550d 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml @@ -127,7 +127,7 @@ left JOIN terminals y ON x.id = y.line_id and y.status = #{status}) left JOIN terminal_channel_mapper j ON j.term_id = y.id) left JOIN terminal_channels k ON j.channel_id = k.id and k.status = #{status}) - left JOIN terminal_schedule_mapper l ON k.id = l.channel_id and l.term_id = y.id) + left JOIN terminal_schedules l ON k.id = l.channel_id and l.term_id = y.id) where y.id = #{termid} diff --git a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml index 34be4b2..c2fc389 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml @@ -148,7 +148,7 @@ tscr.start_time startTime, end_time endTime, span - from terminal_schedule_mapper tm left join schedule_details tscr on tm.schedule_id = tscr.schedule_id + from terminal_schedules tm left join schedule_details tscr on tm.schedule_id = tscr.schedule_id left join terminals t on tm.term_id=t.id where tm.term_id = #{termId} and tm.channel_id = #{channel} diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperTempDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalScheduleDetailsDao.xml similarity index 56% rename from xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperTempDao.xml rename to xymanager_dao/src/main/resources/mappers/TerminalScheduleDetailsDao.xml index d2fc9ca..58153eb 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperTempDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalScheduleDetailsDao.xml @@ -1,50 +1,54 @@ - - + + - - + + + - id, term_id, channel_id, schedule_id, create_time, update_time + id, schedule_id, start_time, end_time, span, create_time, update_time - delete from terminal_schedule_mapper_temp + delete from terminal_schedule_details where id = #{id,jdbcType=INTEGER} - - insert into terminal_schedule_mapper_temp (id, term_id, channel_id, - schedule_id, create_time, update_time - ) - values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER}, - #{scheduleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} - ) + + insert into terminal_schedule_details (id, schedule_id, start_time, + end_time, span, create_time, + update_time) + values (#{id,jdbcType=INTEGER}, #{scheduleId,jdbcType=INTEGER}, #{startTime,jdbcType=TIME}, + #{endTime,jdbcType=TIME}, #{span,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) - - insert into terminal_schedule_mapper_temp + + insert into terminal_schedule_details id, - - term_id, - - - channel_id, - schedule_id, + + start_time, + + + end_time, + + + span, + create_time, @@ -56,15 +60,18 @@ #{id,jdbcType=INTEGER}, - - #{termId,jdbcType=INTEGER}, - - - #{channelId,jdbcType=INTEGER}, - #{scheduleId,jdbcType=INTEGER}, + + #{startTime,jdbcType=TIME}, + + + #{endTime,jdbcType=TIME}, + + + #{span,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, @@ -73,18 +80,21 @@ - - update terminal_schedule_mapper_temp + + update terminal_schedule_details - - term_id = #{termId,jdbcType=INTEGER}, - - - channel_id = #{channelId,jdbcType=INTEGER}, - schedule_id = #{scheduleId,jdbcType=INTEGER}, + + start_time = #{startTime,jdbcType=TIME}, + + + end_time = #{endTime,jdbcType=TIME}, + + + span = #{span,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, @@ -94,11 +104,12 @@ where id = #{id,jdbcType=INTEGER} - - update terminal_schedule_mapper_temp - set term_id = #{termId,jdbcType=INTEGER}, - channel_id = #{channelId,jdbcType=INTEGER}, - schedule_id = #{scheduleId,jdbcType=INTEGER}, + + update terminal_schedule_details + set schedule_id = #{scheduleId,jdbcType=INTEGER}, + start_time = #{startTime,jdbcType=TIME}, + end_time = #{endTime,jdbcType=TIME}, + span = #{span,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=INTEGER} diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml new file mode 100644 index 0000000..cb084ab --- /dev/null +++ b/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + id, term_id, channel_id, schedule_id,request_id, status,create_time, update_time + + + + + + + + + delete from terminal_schedules_temp + where id = #{id,jdbcType=INTEGER} + + + insert into terminal_schedules_temp (id, term_id, channel_id, + schedule_id, create_time, update_time + ) + values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER}, + #{scheduleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} + ) + + + + insert into terminal_schedules_temp + (term_id, channel_id, + schedule_id, request_id,status,create_time, update_time) + values + + (#{item.termId},#{item.channelId},#{item.scheduleId},#{item.requestId},#{status},#{createat},#{updateat}) + + + + insert into terminal_schedules_temp + + + id, + + + term_id, + + + channel_id, + + + schedule_id, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{termId,jdbcType=INTEGER}, + + + #{channelId,jdbcType=INTEGER}, + + + #{scheduleId,jdbcType=INTEGER}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update terminal_schedules_temp + + + term_id = #{termId,jdbcType=INTEGER}, + + + channel_id = #{channelId,jdbcType=INTEGER}, + + + schedule_id = #{scheduleId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update terminal_schedules_temp + set term_id = #{termId,jdbcType=INTEGER}, + channel_id = #{channelId,jdbcType=INTEGER}, + schedule_id = #{scheduleId,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml similarity index 88% rename from xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperDao.xml rename to xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml index 605c56d..582e419 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalScheduleMapperDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml @@ -1,7 +1,7 @@ - - + + @@ -15,14 +15,14 @@ @@ -30,7 +30,7 @@ - delete from terminal_schedule_mapper + delete from terminal_schedules where term_id = #{item.termId} and channel_id = #{item.channelId} @@ -49,7 +49,7 @@ - insert into terminal_schedule_mapper + insert into terminal_schedules (term_id,channel_id,schedule_id,create_time,update_time) VALUES @@ -58,16 +58,16 @@ - - insert into terminal_schedule_mapper (id, term_id, channel_id, + + insert into terminal_schedules (id, term_id, channel_id, schedule_id, create_time, update_time ) values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=TINYINT}, #{scheduleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} ) - - insert into terminal_schedule_mapper + + insert into terminal_schedules id, @@ -109,8 +109,8 @@ - - update terminal_schedule_mapper + + update terminal_schedules term_id = #{termId,jdbcType=INTEGER}, @@ -130,8 +130,8 @@ where id = #{id,jdbcType=INTEGER} - - update terminal_schedule_mapper + + update terminal_schedules set term_id = #{termId,jdbcType=INTEGER}, channel_id = #{channelId,jdbcType=TINYINT}, schedule_id = #{scheduleId,jdbcType=INTEGER}, diff --git a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml index d088d12..0f23b42 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml @@ -68,6 +68,43 @@ where status = #{status} + +