add:质检基础数据
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
package org.nl.common.handler;
|
|
||||||
|
|
||||||
@FunctionalInterface
|
|
||||||
public
|
|
||||||
interface LockProcess {
|
|
||||||
void process();
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package org.nl.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.enums.AcsTaskEnum;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.common.DataTypeEnum;
|
||||||
|
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
||||||
|
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||||
|
import org.nl.wms.sch.tasks.WashMachineryTask;
|
||||||
|
import org.nl.wms.sch.tasks.callMaterial.WrapCallMaterialTask;
|
||||||
|
import org.nl.wms.sch.tasks.sendEmpty.WrapSendEmptyTask;
|
||||||
|
import org.nl.wms.sch.tasks.sendMaterial.PlotterSendMaterialTask;
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.system.ApplicationPid;
|
||||||
|
import org.springframework.context.SmartLifecycle;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class ConventConfig implements SmartLifecycle {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() {
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_FULL, SpringContextHolder.getBean(SpeMachineryTask.class));
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_EMP, SpringContextHolder.getBean(SpeMachineryTask.class));
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_WASH_EMP, SpringContextHolder.getBean(WashMachineryTask.class));
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_PLOTTER_SEND_FULL, SpringContextHolder.getBean(PlotterSendMaterialTask.class));
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_WARP_CALL_FULL, SpringContextHolder.getBean(WrapCallMaterialTask.class));
|
||||||
|
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_WARP_SEND_EMP, SpringContextHolder.getBean(WrapSendEmptyTask.class));
|
||||||
|
System.out.println("初始化Task_Collent完成"+AcsToWmsServiceImpl.Task_Collent.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRunning() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package org.nl.config;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.wms.common.DataTypeEnum;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
|
|
||||||
//@Configuration
|
|
||||||
@Slf4j
|
|
||||||
public class DataBaseConfig {
|
|
||||||
|
|
||||||
@Primary
|
|
||||||
@Bean(name = "dataSource")
|
|
||||||
@ConfigurationProperties(prefix = "spring.datasource.druid")
|
|
||||||
public DataSource dataSource() {
|
|
||||||
return new DruidDataSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -52,7 +52,7 @@ import java.util.function.Supplier;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class AcsToWmsServiceImpl implements AcsToWmsService{
|
public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||||
|
|
||||||
private static Map<AcsTaskEnum, AbstractAcsTask> Task_Factory = new HashMap<>();
|
public static Map<AcsTaskEnum, AbstractAcsTask> Task_Collent = new HashMap<>();
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -69,11 +69,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
|||||||
AcsTaskEnum taskEnum = AcsTaskEnum.getType(param.getString("type"), "REQUEST_");
|
AcsTaskEnum taskEnum = AcsTaskEnum.getType(param.getString("type"), "REQUEST_");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RedissonUtils.lock(() -> {
|
|
||||||
},"ddd",3);
|
|
||||||
RedissonUtils.lock(()->{
|
RedissonUtils.lock(()->{
|
||||||
//业务处理
|
//业务处理
|
||||||
Task_Factory.get(taskEnum).createTask(param);
|
Task_Collent.get(taskEnum).createTask(param);
|
||||||
|
|
||||||
},param.getString("type"),5);
|
},param.getString("type"),5);
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
@@ -318,13 +316,4 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
|||||||
wo.update(MapOf.of("real_qty",real_qty),"workorder_id = '"+workorder_id+"'");
|
wo.update(MapOf.of("real_qty",real_qty),"workorder_id = '"+workorder_id+"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_CALLTYPE_FULL, SpringContextHolder.getBean(SpeMachineryTask.class));
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_CALLTYPE_EMP, SpringContextHolder.getBean(SpeMachineryTask.class));
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_WASH_EMP, SpringContextHolder.getBean(WashMachineryTask.class));
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_PLOTTER_SEND_FULL, SpringContextHolder.getBean(PlotterSendMaterialTask.class));
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_WARP_CALL_FULL, SpringContextHolder.getBean(WrapCallMaterialTask.class));
|
|
||||||
Task_Factory.put(AcsTaskEnum.REQUEST_WARP_SEND_EMP, SpringContextHolder.getBean(WrapSendEmptyTask.class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user