拍照时间表管理修改

master
liuguijing 2 years ago
parent 4134ba9ef0
commit becc73840b

@ -75,11 +75,11 @@
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.jsonwebtoken</groupId>-->
<!-- <artifactId>jjwt</artifactId>-->
<!-- <version>${jwt.version}</version>-->
<!-- </dependency>-->
<!-- swagger ui-->
<dependency>
@ -108,13 +108,6 @@
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 文件上传工具类 -->
<dependency>

@ -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 {
}
}
}

@ -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<String> relateSchelduleRule(@RequestBody @Validated RelateTerminalListRuleIdVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo);
public ResponseReult<GetModel> relateSchelduleRule(@RequestBody @Validated RelateTerminalListRuleIdVo vo) {
ServiceBody<GetModel> serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -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")

@ -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

@ -51,11 +51,11 @@
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.21</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>eu.bitwalker</groupId>-->
<!-- <artifactId>UserAgentUtils</artifactId>-->
<!-- <version>1.21</version>-->
<!-- </dependency>-->
<!--指定swagger-models版本解决报错-->
<dependency>
@ -131,10 +131,10 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
</dependencies>

@ -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;
}

@ -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;

@ -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;
}
}

@ -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;

@ -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;
}

@ -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;
}
}

@ -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;
/**
* @ClassNameAsyncFactory
* @Description
* @Author Arno_Fu
* @CreatTime12/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;
//
//
///**
// * @ClassNameAsyncFactory
// * @Description 异步工厂(产生任务用)
// * @Author Arno_Fu
// * @CreatTime12/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 );
// }
// };
// }
//
//}

@ -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;
/**
* @ClassNameLoginUser
* @Description
* @Author Arno_Fu
* @CreatTime11/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<? extends GrantedAuthority> 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;
}
}

@ -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;
/**
* @ClassNameCustomAuthExceptionEntryPoint
* @Description token.
* @Author Arno_Fu
* @CreatTime11/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();
}
}
}

@ -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;
/**
* @ClassNameSecurityUtils
* @Description
* @Author Arno_Fu
* @CreatTime12/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;
}
}

@ -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);
}

@ -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<ScheduleDetails> record, @Param("createat") Date create, @Param("updateat") Date update);
ScheduleDetails selectByPrimaryKey(Integer id);
List<ScheduleDetails> 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);
}

@ -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<ScheduleAndRuleDto> selectAll(@Param("status") Integer status);

@ -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;

@ -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<TerminalScheduleMapper> list);
int insert(TerminalScheduleMapper record);
int insertSelective(TerminalScheduleMapper record);
int insertList(@Param("list") List<TerminalScheduleMapper> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalScheduleMapper selectByPrimaryKey(Integer id);
TerminalScheduleMapper selectByChannelId(@Param("channelid") Integer list, @Param("termid") Integer termid);
List<TerminalScheduleMapper> selectByTerminalBean(@Param("list") List<RelateTerminalListRuleIdVo.Items> list);
int updateByPrimaryKeySelective(TerminalScheduleMapper record);
int updateByPrimaryKey(TerminalScheduleMapper record);
}

@ -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);
}

@ -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<TerminalScheduleRule> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalScheduleRule selectByPrimaryKey(Integer id);
List<TerminalScheduleRule> 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);
}

@ -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<TerminalSchedules> list);
int insert(TerminalSchedules record);
int insertSelective(TerminalSchedules record);
int insertList(@Param("list") List<TerminalSchedules> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalSchedules selectByPrimaryKey(Integer id);
TerminalSchedules selectByChannelId(@Param("channelid") Integer list, @Param("termid") Integer termid);
List<TerminalSchedules> selectByTerminalBean(@Param("list") List<RelateTerminalListRuleIdVo.Items> list);
int updateByPrimaryKeySelective(TerminalSchedules record);
int updateByPrimaryKey(TerminalSchedules record);
}

@ -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<TerminalSchedulesTemp> selectByTermAndChannel(@Param("list") List<RelateTerminalListRuleIdVo.Items> list, @Param("status") Integer status);
TerminalSchedulesTemp selectByRequestId(@Param("list") List<Integer> id, @Param("status") Integer status);
int deleteByPrimaryKey(Integer id);
int insert(TerminalSchedulesTemp record);
int insertList(@Param("list") List<TerminalSchedulesTemp> 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);
}

@ -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<ChannelAndTermDto> selectByIdList(@Param("list") List<RelateTerminalListRuleIdVo.Items> list, @Param("status") Integer status);
int updateByPrimaryKeySelective(@Param("data") Terminals record, @Param("updateat") Date update);
int updateByPrimaryKey(Terminals record);

@ -112,7 +112,7 @@
<!-- </table>-->
<!-- <table tableName="terminal_schedule_mapper"-->
<!-- <table tableName="terminal_schedules"-->
<!-- domainObjectName="TerminalScheduleMapper"-->
<!-- mapperName="TerminalScheduleMapperDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
@ -197,22 +197,29 @@
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_schedules_temp"-->
<!-- domainObjectName="TerminalScheduleTemp"-->
<!-- mapperName="TerminalScheduleTempDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table> -->
<!-- <table tableName="terminal_schedule_details"-->
<!-- domainObjectName="TerminalScheduleDetails"-->
<!-- mapperName="TerminalScheduleDetailsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_schedule_mapper_temp"
domainObjectName="TerminalScheduleMapperTemp"
mapperName="TerminalScheduleMapperTempDao"
<table tableName="request_results"
domainObjectName="RequestResults"
mapperName="RequestResultsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_schedule_rule_temp"
domainObjectName="TerminalScheduleRuleTemp"
mapperName="TerminalScheduleRuleTempDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
</context>
</generatorConfiguration>

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.RequestResultsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.RequestResults">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="request_type" jdbcType="TINYINT" property="requestType"/>
<result column="frame_no" jdbcType="TINYINT" property="frameNo"/>
<result column="client_id" jdbcType="TINYINT" property="clientId"/>
<result column="request_id" jdbcType="INTEGER" property="requestId"/>
<result column="result" jdbcType="TINYINT" property="result"/>
<result column="request_time" jdbcType="BIGINT" property="requestTime"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="data" jdbcType="LONGVARCHAR" property="data"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, request_type, frame_no, client_id, request_id, result, data,request_time,
create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from request_results
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByRequestId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from request_results
where request_id = #{requestId}
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.RequestResults">
update request_results
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="requestType != null">
request_type = #{requestType,jdbcType=TINYINT},
</if>
<if test="frameNo != null">
frame_no = #{frameNo,jdbcType=TINYINT},
</if>
<if test="clientId != null">
client_id = #{clientId,jdbcType=TINYINT},
</if>
<if test="requestId != null">
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="result != null">
result = #{result,jdbcType=TINYINT},
</if>
<if test="requestTime != null">
request_time = #{requestTime,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="data != null">
data = #{data,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.shxy.xymanager_common.entity.RequestResults">
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>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.RequestResults">
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}
</update>
</mapper>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<mapper namespace="com.shxy.xymanager_dao.dao.ScheduleDetailsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.ScheduleDetails">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/>
@ -26,7 +26,7 @@
from schedule_details
where status = #{status}
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
insert into schedule_details (id, name, start_time,
end_time, span, remark,
create_time, update_time)
@ -45,7 +45,7 @@
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
insert into schedule_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -107,7 +107,7 @@
where schedule_id = #{scheduleid}
</delete>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
update schedules
<set>
<if test="data.name != null">
@ -122,7 +122,7 @@
</set>
where id = #{data.id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
update schedule_details
set name = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIME},

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleDao">
<mapper namespace="com.shxy.xymanager_dao.dao.SchedulesDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Schedules">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>

@ -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)
<if test="termid != null">
where y.id = #{termid}
</if>

@ -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}
</select>

@ -1,50 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleMapperTempDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleDetailsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="term_id" jdbcType="INTEGER" property="termId" />
<result column="channel_id" jdbcType="INTEGER" property="channelId" />
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId" />
<result column="start_time" jdbcType="TIME" property="startTime" />
<result column="end_time" jdbcType="TIME" property="endTime" />
<result column="span" jdbcType="INTEGER" property="span" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, schedule_id, create_time, update_time
id, schedule_id, start_time, end_time, span, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_schedule_mapper_temp
from terminal_schedule_details
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule_mapper_temp
delete from terminal_schedule_details
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp">
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 id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
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>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp">
insert into terminal_schedule_mapper_temp
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
insert into terminal_schedule_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="scheduleId != null">
schedule_id,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="span != null">
span,
</if>
<if test="createTime != null">
create_time,
</if>
@ -56,15 +60,18 @@
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
#{scheduleId,jdbcType=INTEGER},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIME},
</if>
<if test="span != null">
#{span,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
@ -73,18 +80,21 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp">
update terminal_schedule_mapper_temp
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
update terminal_schedule_details
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
schedule_id = #{scheduleId,jdbcType=INTEGER},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIME},
</if>
<if test="span != null">
span = #{span,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
@ -94,11 +104,12 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapperTemp">
update terminal_schedule_mapper_temp
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER},
schedule_id = #{scheduleId,jdbcType=INTEGER},
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
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}

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalSchedulesTempDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="request_id" jdbcType="INTEGER" property="requestId"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, schedule_id,request_id, status,create_time, update_time
</sql>
<select id="selectByTermAndChannel" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedules_temp
where status = #{status}
<if test="list != null and list.size>0">
and
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termid}
<if test="item.channelidlist != null and item.channelidlist.size>0">
and channel_id in
<foreach collection="item.channelidlist" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</foreach>
</if>
</select>
<select id="selectByRequestId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedules_temp
where status = #{status}
<if test="list != null and list.size>0">
and
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
request_id = #{item}
</foreach>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedules_temp
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedules_temp
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
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>
<insert id="insertList" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedules_temp
(term_id, channel_id,
schedule_id, request_id,status,create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.scheduleId},#{item.requestId},#{status},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedules_temp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="scheduleId != null">
schedule_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
#{scheduleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
update terminal_schedules_temp
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
schedule_id = #{scheduleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
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}
</update>
</mapper>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalSchedulesDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedules">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="TINYINT" property="channelId"/>
@ -15,14 +15,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_mapper
from terminal_schedules
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByChannelId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_mapper
from terminal_schedules
where channel_id = #{channelid}
and term_id = #{termid}
</select>
@ -30,7 +30,7 @@
<select id="selectByTerminalBean" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_mapper
from terminal_schedules
where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termid} and channel_id in
@ -41,7 +41,7 @@
</select>
<delete id="deleteByChannelId">
delete from terminal_schedule_mapper
delete from terminal_schedules
where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termId} and channel_id = #{item.channelId}
@ -49,7 +49,7 @@
</delete>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_schedule_mapper
insert into terminal_schedules
(term_id,channel_id,schedule_id,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
@ -58,16 +58,16 @@
</insert>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedule_mapper (id, term_id, channel_id,
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedules">
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>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedule_mapper
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedules">
insert into terminal_schedules
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
@ -109,8 +109,8 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedule_mapper
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedules">
update terminal_schedules
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
@ -130,8 +130,8 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedule_mapper
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedules">
update terminal_schedules
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT},
schedule_id = #{scheduleId,jdbcType=INTEGER},

@ -68,6 +68,43 @@
where status = #{status}
</select>
<select id="selectByIdList" resultMap="BaseResultMap">
select
a.id as term_id,
a.line_id as line_id,
a.cmdid as cmdid,
a.display_name as display_name,
b.channel_id as channel_id,
c.channel_name as channel_name
from ((terminals a left join
terminal_channel_mapper b on a.id = b.term_id) left join
terminal_channels c on b.channel_id = c.id)
where a.status = #{status}
<if test="list != null and list.size>0">
and
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
a.id = #{item.termid}
<if test="item.channelidlist != null and item.channelidlist.size>0">
and c.id in
<foreach collection="item.channelidlist" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</foreach>
</if>
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from terminals-->
<!-- where status = #{status}-->
<!-- <if test="list != null and list.size>0">-->
<!-- and id in-->
<!-- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </if>-->
</select>
<select id="selectChannelAndTermList" resultMap="ChannelAndTerm">
select
a.id as term_id,

@ -1,10 +1,8 @@
package com.shxy.xymanager_service.service.security;
package com.shxy.xymanager_framework.config;
import org.springframework.beans.factory.annotation.Autowired;
import com.shxy.xymanager_framework.interaction.JwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -21,18 +19,17 @@ public class CustomSecurityConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(this.jwtInterceptor).addPathPatterns("/getXcxMainInfo").addPathPatterns("/authorizeXcxLogin")
.addPathPatterns("/bindXcxDevice")
registry.addInterceptor(this.jwtInterceptor).addPathPatterns("/addUser")
.excludePathPatterns("/login")
.excludePathPatterns("/api/addUser")
.excludePathPatterns("/swagger-ui.html")
.excludePathPatterns("/doc.html")
.excludePathPatterns("/swagger-resources/**")
.excludePathPatterns("/*/api-docs")
.excludePathPatterns("/error")
.excludePathPatterns("/test/**")
.excludePathPatterns("/loginXcxuser")
.excludePathPatterns("/loginXcxuser")
.excludePathPatterns("/addUser");
.excludePathPatterns("/loginXcxuser");
}
@Override

@ -1,4 +1,4 @@
package com.shxy.xymanager_service.service.security;
package com.shxy.xymanager_framework.interaction;
import cn.hutool.core.util.StrUtil;
@ -25,8 +25,6 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j
public class JwtInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 忽略带JwtIgnore注解的请求, 不做后续token认证校验
@ -50,8 +48,6 @@ public class JwtInterceptor implements HandlerInterceptor {
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
HandlerInterceptor.super.postHandle(request, response, handler, modelAndView);

@ -26,15 +26,6 @@
<groupId>com.shxy</groupId>
<artifactId>xymanager_dao</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
</dependencies>
<!-- <build>-->
<!-- <plugins>-->

@ -1,44 +0,0 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.SysUser;
import org.springframework.stereotype.Component;
import java.util.Set;
/**
* @ClassNameCustomPermissionService
* @Description .
* @Author Arno_Fu
* @CreatTime11/26/2019 - 8:30 PM
* @Version V1.0
*/
@Component
public class CustomPermissionServiceImpl {
/**
*
*
* @param user
* @return
*/
public Set<String> getRolePermission(SysUser user)
{
return null;
}
/**
*
*
* @param user
* @return
*/
public Set<String> getMenuPermission(SysUser user)
{
return null;
}
}

@ -1,51 +0,0 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.constant.UserStatus;
import com.shxy.xymanager_common.exception.base.BaseException;
import com.shxy.xymanager_common.security.LoginUser;
import com.shxy.xymanager_service.service.CustomPermissionService;
import com.shxy.xymanager_service.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.Set;
/**
* @ClassNameCustomUserDetailsService
* @Description .
* @Author CY
* @CreatTime11/26/2019 - 5:34 PM
* @Version V1.0
*/
@Slf4j
@Service
public class CustomUserDetailsServiceImpl implements UserDetailsService {
@Autowired
private SysUserService sysUserService;
@Override
public UserDetails loadUserByUsername(String userAccount) throws UsernameNotFoundException {
SysUser user = sysUserService.findByUserAccount( userAccount );
if (null == user) {
log.info( "登录用户:{} 不存在.", userAccount );
throw new UsernameNotFoundException( "登录用户:" + userAccount + " 不存在" );
} else if (UserStatus.DISABLE.getCode().equals( user.getStatus() )) {
log.info( "登录用户:{} 已被停用.", userAccount );
throw new BaseException( "对不起,您的账号:" + userAccount + " 已停用" );
}
return createLoginUser( user );
}
public UserDetails createLoginUser(SysUser user) {
return new LoginUser( user);
}
}

@ -4,14 +4,10 @@ import cn.hutool.core.date.DateTime;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.constant.HttpStatusCode;
import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.exception.UserPasswordNotMatchException;
import com.shxy.xymanager_common.manager.AsyncManager;
import com.shxy.xymanager_common.manager.factory.AsyncFactory;
import com.shxy.xymanager_common.security.LoginUser;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.RsaUtils;
import com.shxy.xymanager_common.util.StringUtils;

@ -1,35 +0,0 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.security.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 退
*
* @author ruoyi
*/
@Configuration
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
{
/**
* 退
*
* @return
*/
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
throws IOException, ServletException
{
/*ServletUtils.renderString(response, JSON.toJSONString( AjaxResult.error( HttpStatusCode.SUCCESS, "退出成功")));*/
}
}

@ -5,12 +5,9 @@ package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.constant.UuidUtils;
import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.util.Md5;
import com.shxy.xymanager_common.util.RsaUtils;
import com.shxy.xymanager_common.util.SecurityUtils;
import com.shxy.xymanager_common.vo.SysUserVo;
import com.shxy.xymanager_dao.dao.SysUserMapperDao;
import com.shxy.xymanager_service.service.SysUserService;

@ -8,22 +8,19 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.ChannelAndTermDto;
import com.shxy.xymanager_common.dto.ScheduleAndRuleDto;
import com.shxy.xymanager_common.dto.ScheduleRuleDto;
import com.shxy.xymanager_common.entity.Schedules;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.entity.TerminalScheduleRule;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalScheduleDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,13 +40,22 @@ import java.util.List;
public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleService {
@Autowired
TerminalScheduleDao terminalScheduleDao;
SchedulesDao schedulesDao;
@Autowired
TerminalScheduleRuleDao terminalScheduleRuleDao;
ScheduleDetailsDao scheduleDetailsDao;
@Autowired
TerminalScheduleMapperDao terminalScheduleMapperDao;
TerminalSchedulesDao terminalSchedulesDao;
@Autowired
TerminalSchedulesTempDao terminalSchedulesTempDao;
@Autowired
TerminalsDao terminalsDao;
@Autowired
RequestResultsDao requestResultsDao;
/**
*
@ -62,7 +68,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
List<ScheduleAndRuleDto> list = terminalScheduleDao.selectAll(CommonStatus.EFFECTIVE.value());
List<ScheduleAndRuleDto> list = schedulesDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
@ -91,7 +97,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
*/
@Override
public ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(ScheduleIdVo vo) {
ScheduleAndRuleDto bean = terminalScheduleDao.selectSingle(vo.getId(), CommonStatus.EFFECTIVE.value());
ScheduleAndRuleDto bean = schedulesDao.selectSingle(vo.getId(), CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(bean)) {
return Asserts.error("没有该对象");
} else {
@ -116,18 +122,18 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
schedules.setStatus(CommonStatus.EFFECTIVE.value());
schedules.setCreateTime(date);
schedules.setUpdateTime(date);
int i1 = terminalScheduleDao.insertSelective(schedules);
int i1 = schedulesDao.insertSelective(schedules);
if (i1 != 0) {
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
ArrayList<ScheduleDetails> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
ScheduleDetails rule = new ScheduleDetails();
rule.setScheduleId(schedules.getId());
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
int i = scheduleDetailsDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -148,7 +154,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Transactional
public ServiceBody<String> updateSchelduleRule(UpdateScheduleListVo vo) {
Integer scheduleid = vo.getId();
Schedules bean = terminalScheduleDao.selectByPrimaryKey(vo.getId());
Schedules bean = schedulesDao.selectByPrimaryKey(vo.getId());
if (BeanUtil.isEmpty(bean)) {
return Asserts.error("没有需要修改任务规则");
}
@ -158,20 +164,20 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
schedule.setName(vo.getName());
schedule.setRemark(vo.getRemark());
schedule.setUpdateTime(date);
terminalScheduleDao.updateByPrimaryKeySelective(schedule);
schedulesDao.updateByPrimaryKeySelective(schedule);
terminalScheduleRuleDao.deleteById(scheduleid);
scheduleDetailsDao.deleteById(scheduleid);
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
ArrayList<ScheduleDetails> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
ScheduleDetails rule = new ScheduleDetails();
rule.setScheduleId(scheduleid);
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
int i = scheduleDetailsDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("修改成功");
} else {
@ -189,7 +195,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Override
public ServiceBody<String> deleteSchelduleRule(ScheduleIdListVo vo) {
List<Schedules> list = BeanUtil.copyToList(vo.getList(), Schedules.class);
int i = terminalScheduleDao.updateStatusById(list, CommonStatus.DELETE.value(), new Date());
int i = schedulesDao.updateStatusById(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
@ -205,65 +211,178 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
*/
@Override
@Transactional
public ServiceBody<String> relateSchelduleRule(RelateTerminalListRuleIdVo vo) {
public ServiceBody<GetModel> relateSchelduleRule(RelateTerminalListRuleIdVo vo) {
ArrayList<TerminalScheduleMapper> list = new ArrayList<>();
List<RelateTerminalListRuleIdVo.Items> termBeanList = vo.getList();
Integer scheduleid = vo.getScheduleid();
GetModel model = new GetModel();
List<TerminalSchedulesTemp> list = terminalSchedulesTempDao.selectByTermAndChannel(vo.getList(), CommonStatus.DELETE.value());
if (CollectionUtil.isNotEmpty(list)) {
List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByTerminalBean(termBeanList);
boolean empty = CollectionUtil.isEmpty(mappers);
if (!empty) {
terminalScheduleMapperDao.deleteByChannelId(mappers);
return Asserts.error("有装置时间尚未下发成功");
}
for (RelateTerminalListRuleIdVo.Items item : termBeanList) {
for (Integer id : item.getChannelidlist()) {
TerminalScheduleMapper record = new TerminalScheduleMapper();
record.setChannelId(id);
record.setScheduleId(scheduleid);
record.setTermId(item.getTermid());
list.add(record);
List<RelateTerminalListRuleIdVo.Items> termlist = vo.getList();
Integer scheduleid = vo.getScheduleid();
List<TerminalSchedulesTemp> temps = new ArrayList<>();
List<Integer> termidlist = new ArrayList<>();
for (RelateTerminalListRuleIdVo.Items item : termlist) {
termidlist.add(item.getTermid());
List<Integer> channelidlist = item.getChannelidlist();
for (Integer it : channelidlist) {
TerminalSchedulesTemp temp = new TerminalSchedulesTemp();
temp.setTermId(item.getTermid());
temp.setScheduleId(scheduleid);
temp.setChannelId(it);
temps.add(temp);
}
}
Date date = new Date();
int i = terminalScheduleMapperDao.insertList(list, date, date);
int i = terminalSchedulesTempDao.insertList(temps, CommonStatus.EFFECTIVE.value(), date, date);
List<ChannelAndTermDto> terminalsList = terminalsDao.selectByIdList(vo.getList(), CommonStatus.EFFECTIVE.value());
if (CollectionUtil.isEmpty(termidlist)) {
return Asserts.error("没有该装置");
}
ScheduleAndRuleDto dto = schedulesDao.selectSingle(scheduleid, CommonStatus.EFFECTIVE.value());
List<ScheduleRuleDto> dtoList = dto.getList();
if (CollectionUtil.isEmpty(dtoList)) {
return Asserts.error("没有该拍照时间规则");
}
StringBuffer timestr = new StringBuffer();
for (int j = 0; j < dtoList.size(); j++) {
TerminalPhotosTimeModel.PhotosTimeBean bean = new TerminalPhotosTimeModel.PhotosTimeBean();
Integer span = dtoList.get(j).getSpan();
Date startTime = dtoList.get(j).getStartTime();
Short startHour = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[0]);
Short startMin = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[1]);
Date endTime = dtoList.get(j).getEndTime();
Short endTimeHour = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[0]);
Short endTimeMin = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[1]);
Integer span1 = -1;
Integer span2 = -1;
if (span / 60 > 0) {
span1 = (span / 60);
span2 = (span % 60);
} else if (span < 60) {
span1 = 0;
span2 = span;
}
String string = "--hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t"
+ "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255";
timestr.append(string);
}
for (int x = 0; x < terminalsList.size(); x++) {
ChannelAndTermDto channelAndTermDto = terminalsList.get(x);
String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + channelAndTermDto.getCmdid() + "\t" + "--channel=" + channelAndTermDto.getChannelid() + "\t" +
timestr.toString();
ProcessExecUtils.exec(cmd);
}
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1);
if (i != 0) {
return Asserts.success("关联成功");
return Asserts.success(model);
} else {
return Asserts.error("关联失败");
}
}
/**
*
*
* @param vo
* @return
*/
@Transactional
public ServiceBody<GetModel> checkScheldule(RelateTerminalListRuleIdVo vo) {
ArrayList<Integer> intlist = new ArrayList<>();
RequestResults results = requestResultsDao.selectByRequestId(1);
String data = results.getData();
Integer result = results.getResult();
if (result == 255) {
// terminalSchedulesTempDao.selectByRequestId(intlist);
}
GetModel model = new GetModel();
List<TerminalSchedulesTemp> list = terminalSchedulesTempDao.selectByTermAndChannel(vo.getList(), CommonStatus.DELETE.value());
if (CollectionUtil.isNotEmpty(list)) {
return Asserts.error("有装置时间尚未下发成功");
}
List<RelateTerminalListRuleIdVo.Items> termlist = vo.getList();
Integer scheduleid = vo.getScheduleid();
List<TerminalSchedulesTemp> temps = new ArrayList<>();
List<Integer> termidlist = new ArrayList<>();
for (RelateTerminalListRuleIdVo.Items item : termlist) {
termidlist.add(item.getTermid());
List<Integer> channelidlist = item.getChannelidlist();
for (Integer it : channelidlist) {
TerminalSchedulesTemp temp = new TerminalSchedulesTemp();
temp.setTermId(item.getTermid());
temp.setScheduleId(scheduleid);
temp.setChannelId(it);
temps.add(temp);
}
}
Date date = new Date();
int i = terminalSchedulesTempDao.insertList(temps, CommonStatus.EFFECTIVE.value(), date, date);
List<ChannelAndTermDto> terminalsList = terminalsDao.selectByIdList(vo.getList(), CommonStatus.EFFECTIVE.value());
if (CollectionUtil.isEmpty(termidlist)) {
return Asserts.error("没有该装置");
}
ScheduleAndRuleDto dto = schedulesDao.selectSingle(scheduleid, CommonStatus.EFFECTIVE.value());
List<ScheduleRuleDto> dtoList = dto.getList();
if (CollectionUtil.isEmpty(dtoList)) {
return Asserts.error("没有该拍照时间规则");
}
// List<TerminalPhotoScheduleDto> dtoList = terminalPhotoDao.selectPhotoSchedule(vo);
//
// for (int j = 0; j < dtoList.size(); j++) {
// TerminalPhotosTimeModel.PhotosTimeBean bean = new TerminalPhotosTimeModel.PhotosTimeBean();
// Short span = dtoList.get(j).getSpan();
// Date startTime = dtoList.get(j).getStartTime();
// Short startHour = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[0]);
// Short startMin = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[1]);
//
//
// Date endTime = dtoList.get(j).getEndTime();
// Short endTimeHour = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[0]);
// Short endTimeMin = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[1]);
//
// Short span1 = -1;
// Short span2 = -1;
// if (span / 60 > 0) {
// span1 = (short) (span / 60);
// span2 = (short) (span % 60);
// } else if (span < 60) {
// span1 = (short) 0;
// span2 = span;
// }
// String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t"
// + "--group=3 --hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t"
// + "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255";
// ProcessExecUtils.exec(cmd);
// }
StringBuffer timestr = new StringBuffer();
for (int j = 0; j < dtoList.size(); j++) {
TerminalPhotosTimeModel.PhotosTimeBean bean = new TerminalPhotosTimeModel.PhotosTimeBean();
Integer span = dtoList.get(j).getSpan();
Date startTime = dtoList.get(j).getStartTime();
Short startHour = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[0]);
Short startMin = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[1]);
Date endTime = dtoList.get(j).getEndTime();
Short endTimeHour = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[0]);
Short endTimeMin = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[1]);
Integer span1 = -1;
Integer span2 = -1;
if (span / 60 > 0) {
span1 = (span / 60);
span2 = (span % 60);
} else if (span < 60) {
span1 = 0;
span2 = span;
}
String string = "--hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t"
+ "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255";
timestr.append(string);
}
for (int x = 0; x < terminalsList.size(); x++) {
ChannelAndTermDto channelAndTermDto = terminalsList.get(x);
String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + channelAndTermDto.getCmdid() + "\t" + "--channel=" + channelAndTermDto.getChannelid() + "\t" +
timestr.toString();
ProcessExecUtils.exec(cmd);
}
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1);
if (i != 0) {
return Asserts.success(model);
} else {
return Asserts.error("关联失败");
}
}
/**
@ -275,12 +394,12 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Override
public ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo) {
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
TerminalScheduleMapper mapper = terminalScheduleMapperDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
TerminalSchedules mapper = terminalSchedulesDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
if (mapper == null) {
model.setList(new ArrayList<>());
} else {
Integer scheduleId = mapper.getScheduleId();
ScheduleAndRuleDto bean = terminalScheduleDao.selectSingle(scheduleId, CommonStatus.EFFECTIVE.value());
ScheduleAndRuleDto bean = schedulesDao.selectSingle(scheduleId, CommonStatus.EFFECTIVE.value());
List<ScheduleRuleDto> list = bean.getList();
ArrayList<String> timelist = new ArrayList<>();
for (ScheduleRuleDto item : list) {

@ -1,22 +0,0 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.SysUser;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Set;
/**
* 线
*
* @author
*/
public interface CustomPermissionService {
Set<String> getRolePermission(SysUser user);
Set<String> getMenuPermission(SysUser user);
}

@ -1,20 +0,0 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.SysUser;
import org.springframework.security.core.userdetails.UserDetails;
/**
* 线
*
* @author
*/
public interface CustomUserDetailsService {
UserDetails loadUserByUsername(String userAccount);
UserDetails createLoginUser(SysUser user);
}

@ -2,23 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.constant.HttpStatusCode;
import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.exception.UserPasswordNotMatchException;
import com.shxy.xymanager_common.manager.AsyncManager;
import com.shxy.xymanager_common.manager.factory.AsyncFactory;
import com.shxy.xymanager_common.security.LoginUser;
import com.shxy.xymanager_common.util.RsaUtils;
import com.shxy.xymanager_common.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import java.util.HashSet;
import java.util.Set;
/**
* @ClassNameLoginService

@ -1,6 +1,7 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
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;
@ -56,7 +57,7 @@ public interface TerminalScheduleRuleService {
* @param vo
* @return
*/
ServiceBody<String> relateSchelduleRule(RelateTerminalListRuleIdVo vo);
ServiceBody<GetModel> relateSchelduleRule(RelateTerminalListRuleIdVo vo);
/**
*

Loading…
Cancel
Save