修改为false
This commit is contained in:
@@ -125,6 +125,12 @@ public class IndustryStepController extends BaseController
|
||||
{
|
||||
return AjaxResult.success(industryStepService.nextStep(industryStep));
|
||||
}
|
||||
//修改道次状态
|
||||
@GetMapping("/updateNextState")
|
||||
public AjaxResult nextState(IndustryStep industryStep)
|
||||
{
|
||||
return AjaxResult.success(industryStepService.updateNextState(industryStep));
|
||||
}
|
||||
/**
|
||||
* 下道次
|
||||
*/
|
||||
|
||||
@@ -6,14 +6,14 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://49.233.157.185:3306/industry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/industry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: WANGyu11!
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url: jdbc:mysql://49.233.157.185:3306/industry2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/industry2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: WANGyu11!
|
||||
# 初始连接数
|
||||
|
||||
@@ -19,7 +19,7 @@ mode: 1
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8081
|
||||
port: 8082
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -71,9 +71,9 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 49.233.157.185
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
port: 6380
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
@@ -92,9 +92,9 @@ spring:
|
||||
max-wait: -1
|
||||
redis2:
|
||||
# 地址
|
||||
host: 49.233.157.185
|
||||
host: localhost
|
||||
# 端口号
|
||||
port: 6379
|
||||
port: 6380
|
||||
# 密码
|
||||
password: WANGyu11!
|
||||
# 连接超时时间
|
||||
|
||||
@@ -110,4 +110,6 @@ public interface IIndustryStepService
|
||||
void errorCorrection();
|
||||
|
||||
void start(IndustryStep industryStep);
|
||||
|
||||
Boolean updateNextState(IndustryStep industryStep);
|
||||
}
|
||||
|
||||
@@ -601,4 +601,17 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
||||
industryStep.setOperation(1L);
|
||||
industryStepMapper.start(industryStep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateNextState(IndustryStep industryStep) {
|
||||
// TODO PLC
|
||||
// 将切换道次改为false
|
||||
s7PLC.writeBoolean("DB15.1.2", false);
|
||||
|
||||
// 判断当前切换是否转化过来成false 没有则再发
|
||||
while (s7PLC.readBoolean("DB15.1.2")) {
|
||||
Threads.sleep(500);
|
||||
}
|
||||
return !s7PLC.readBoolean("DB15.1.2");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user