diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 0d64935..1f85bb5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -9,7 +9,6 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; @@ -22,6 +21,7 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.opc.DeviceType; import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.service.ParamService; import org.nl.modules.wql.util.SpringContextHolder; import org.slf4j.MDC; import org.springframework.stereotype.Service; @@ -36,7 +36,7 @@ import java.util.Map; public class NDCAgvServiceImpl implements NDCAgvService { private final DeviceAppService deviceAppService; - private final AcsConfigService acsConfigService; + private final ParamService acsConfigService; private final AcsToWmsService acsToWmsService; private final DeviceExecuteLogService logServer; @@ -50,7 +50,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { public void deleteAgvInstToNDC(Instruction inst) throws Exception { try { MDC.put(log_file_type, log_type); - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { int index = Integer.parseInt(inst.getAgv_jobno()); byte indexhigh = (byte) IntToHexHigh(index); @@ -127,7 +127,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { public void sendAgvInstToNDC(Instruction inst) { try { MDC.put(log_file_type, log_type); - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { String instcode = inst.getInstruction_code(); int type = Integer.parseInt(inst.getInstruction_type()); int priority = Integer.parseInt(inst.getPriority()) + 128; @@ -243,7 +243,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte resulthigh = (byte) IntToHexHigh(result); byte resultlow = (byte) IntToHexLow(result); - int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); + int type = Integer.parseInt(acsConfigService.findByCode(AcsConfig.BUSINESSTYPE).getValue()); byte[] b = new byte[]{}; switch (type) { case 0: @@ -324,10 +324,10 @@ public class NDCAgvServiceImpl implements NDCAgvService { try { MDC.put(log_file_type, log_type); log.info("AGV查询自动门状态,参数:{}", device); - int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); + int type = Integer.parseInt(acsConfigService.findByCode(AcsConfig.BUSINESSTYPE).getValue()); switch (type) { case 4: - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASOTHERSYSTEM).toString(), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.HASOTHERSYSTEM).getValue(), "1")) { String result = acsToWmsService.queryDoorsStatus().body(); JSONArray ja = JSONArray.parseArray(result); log.info("AGV查询自动门状态,反馈:{}", ja.toString()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/config/rest/AcsConfigController.java b/acs/nladmin-system/src/main/java/org/nl/acs/config/rest/AcsConfigController.java index 5ac7c7c..1c9ed23 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/config/rest/AcsConfigController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/config/rest/AcsConfigController.java @@ -1,93 +1,93 @@ - -package org.nl.acs.config.rest; - - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.dto.AcsConfigDto; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.modules.logging.annotation.Log; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @date 2021-01-14 - **/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统参数管理") -@RequestMapping("/api/param") -@Slf4j -public class AcsConfigController { - - private final AcsConfigService acsConfigService; - - @GetMapping - @Log("查询系统参数") - @ApiOperation("查询系统参数") - //@PreAuthorize("@el.check('param:list')") - public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { - return new ResponseEntity<>(acsConfigService.queryAll(whereJson, page), HttpStatus.OK); - } - - @PostMapping - @Log("新增系统参数") - @ApiOperation("新增系统参数") - //@PreAuthorize("@el.check('param:add')") - public ResponseEntity create(@Validated @RequestBody AcsConfigDto dto) { - acsConfigService.create(dto); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PutMapping - @Log("修改系统参数") - @ApiOperation("修改系统参数") - //@PreAuthorize("@el.check('param:edit')") - public ResponseEntity update(@Validated @RequestBody AcsConfigDto dto) { - acsConfigService.update(dto); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除系统参数") - @ApiOperation("删除系统参数") - //@PreAuthorize("@el.check('param:del')") - @DeleteMapping - public ResponseEntity delete(@RequestBody String[] ids) { - acsConfigService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("导出系统参数") - @ApiOperation("导出系统参数") - @GetMapping(value = "/download") - //@PreAuthorize("@el.check('param:list')") - public void download(HttpServletResponse response, Map whereJson) throws IOException { - acsConfigService.download(acsConfigService.queryAll(whereJson), response); - } - - @Log("缓存查询系统参数") - @ApiOperation("缓存查询系统参数") - @PostMapping(value = "/findByCodeFromCache") - public ResponseEntity findConfigFromCache() { - return new ResponseEntity<>(acsConfigService.findConfigFromCache(), HttpStatus.OK); - } - - @PostMapping("/getStageCodeByCode") - @Log("根据编码获取舞台编码") - @ApiOperation("根据编码获取舞台编码") - public ResponseEntity getStageCodeByCode(@RequestBody String code) { - System.out.println(code); - return new ResponseEntity<>(acsConfigService.findByCode(code), HttpStatus.CREATED); - } - -} +// +//package org.nl.acs.config.rest; +// +// +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.nl.acs.config.dto.AcsConfigDto; +//import org.nl.acs.config.server.AcsConfigService; +//import org.nl.modules.logging.annotation.Log; +//import org.springframework.data.domain.Pageable; +//import org.springframework.http.HttpStatus; +//import org.springframework.http.ResponseEntity; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +//import javax.servlet.http.HttpServletResponse; +//import java.io.IOException; +//import java.util.Map; +// +///** +// * @author ldjun +// * @date 2021-01-14 +// **/ +//@RestController +//@RequiredArgsConstructor +//@Api(tags = "系统参数管理") +//@RequestMapping("/api/param") +//@Slf4j +//public class AcsConfigController { +// +// private final AcsConfigService acsConfigService; +// +// @GetMapping +// @Log("查询系统参数") +// @ApiOperation("查询系统参数") +// //@PreAuthorize("@el.check('param:list')") +// public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { +// return new ResponseEntity<>(acsConfigService.queryAll(whereJson, page), HttpStatus.OK); +// } +// +// @PostMapping +// @Log("新增系统参数") +// @ApiOperation("新增系统参数") +// //@PreAuthorize("@el.check('param:add')") +// public ResponseEntity create(@Validated @RequestBody AcsConfigDto dto) { +// acsConfigService.create(dto); +// return new ResponseEntity<>(HttpStatus.CREATED); +// } +// +// @PutMapping +// @Log("修改系统参数") +// @ApiOperation("修改系统参数") +// //@PreAuthorize("@el.check('param:edit')") +// public ResponseEntity update(@Validated @RequestBody AcsConfigDto dto) { +// acsConfigService.update(dto); +// return new ResponseEntity<>(HttpStatus.NO_CONTENT); +// } +// +// @Log("删除系统参数") +// @ApiOperation("删除系统参数") +// //@PreAuthorize("@el.check('param:del')") +// @DeleteMapping +// public ResponseEntity delete(@RequestBody String[] ids) { +// acsConfigService.deleteAll(ids); +// return new ResponseEntity<>(HttpStatus.OK); +// } +// +// @Log("导出系统参数") +// @ApiOperation("导出系统参数") +// @GetMapping(value = "/download") +// //@PreAuthorize("@el.check('param:list')") +// public void download(HttpServletResponse response, Map whereJson) throws IOException { +// acsConfigService.download(acsConfigService.queryAll(whereJson), response); +// } +// +// @Log("缓存查询系统参数") +// @ApiOperation("缓存查询系统参数") +// @PostMapping(value = "/findByCodeFromCache") +// public ResponseEntity findConfigFromCache() { +// return new ResponseEntity<>(acsConfigService.findConfigFromCache(), HttpStatus.OK); +// } +// +// @PostMapping("/getStageCodeByCode") +// @Log("根据编码获取舞台编码") +// @ApiOperation("根据编码获取舞台编码") +// public ResponseEntity getStageCodeByCode(@RequestBody String code) { +// System.out.println(code); +// return new ResponseEntity<>(acsConfigService.findByCode(code), HttpStatus.CREATED); +// } +// +//} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/config/server/AcsConfigService.java b/acs/nladmin-system/src/main/java/org/nl/acs/config/server/AcsConfigService.java index 27a484e..77df1a1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/config/server/AcsConfigService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/config/server/AcsConfigService.java @@ -1,86 +1,86 @@ - -package org.nl.acs.config.server; - -import org.nl.acs.config.dto.AcsConfigDto; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * @author ldjun - * @description 服务接口 - * @date 2021-03-16 - **/ -public interface AcsConfigService { - - /** - * 查询数据分页 - * - * @param whereJson 条件 - * @param page 分页参数 - * @return Map - */ - Map queryAll(Map whereJson, Pageable page); - - /** - * 查询所有数据不分页 - * - * @param whereJson 条件参数 - * @return List - */ - List queryAll(Map whereJson); - - /** - * 根据ID查询 - * - * @param id ID - * @return Param - */ - AcsConfigDto findById(String id); - - /** - * 根据编码查询 - * - * @param code code - * @return Param - */ - AcsConfigDto findByCode(String code); - - - /** - * 创建 - * - * @param dto / - */ - void create(AcsConfigDto dto); - - /** - * 编辑 - * - * @param dto / - */ - void update(AcsConfigDto dto); - - /** - * 多选删除 - * - * @param ids / - */ - void deleteAll(String[] ids); - - /** - * 导出数据 - * - * @param dtos 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List dtos, HttpServletResponse response) throws IOException; - - void load(); - - Map findConfigFromCache(); -} +// +//package org.nl.acs.config.server; +// +//import org.nl.acs.config.dto.AcsConfigDto; +//import org.springframework.data.domain.Pageable; +// +//import javax.servlet.http.HttpServletResponse; +//import java.io.IOException; +//import java.util.List; +//import java.util.Map; +// +///** +// * @author ldjun +// * @description 服务接口 +// * @date 2021-03-16 +// **/ +//public interface AcsConfigService { +// +// /** +// * 查询数据分页 +// * +// * @param whereJson 条件 +// * @param page 分页参数 +// * @return Map +// */ +// Map queryAll(Map whereJson, Pageable page); +// +// /** +// * 查询所有数据不分页 +// * +// * @param whereJson 条件参数 +// * @return List +// */ +// List queryAll(Map whereJson); +// +// /** +// * 根据ID查询 +// * +// * @param id ID +// * @return Param +// */ +// AcsConfigDto findById(String id); +// +// /** +// * 根据编码查询 +// * +// * @param code code +// * @return Param +// */ +// AcsConfigDto findByCode(String code); +// +// +// /** +// * 创建 +// * +// * @param dto / +// */ +// void create(AcsConfigDto dto); +// +// /** +// * 编辑 +// * +// * @param dto / +// */ +// void update(AcsConfigDto dto); +// +// /** +// * 多选删除 +// * +// * @param ids / +// */ +// void deleteAll(String[] ids); +// +// /** +// * 导出数据 +// * +// * @param dtos 待导出的数据 +// * @param response / +// * @throws IOException / +// */ +// void download(List dtos, HttpServletResponse response) throws IOException; +// +// void load(); +// +// Map findConfigFromCache(); +//} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/config/server/impl/AcsConfigServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/config/server/impl/AcsConfigServiceImpl.java index a3c7965..a5285e5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/config/server/impl/AcsConfigServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/config/server/impl/AcsConfigServiceImpl.java @@ -1,162 +1,162 @@ - -package org.nl.acs.config.server.impl; - - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.auto.initial.ApplicationAutoInitial; -import org.nl.acs.config.dto.AcsConfigDto; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.modules.common.exception.BadRequestException; -import org.nl.modules.common.utils.FileUtil; -import org.nl.modules.common.utils.SecurityUtils; -import org.nl.modules.wql.core.bean.ResultBean; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.WqlUtil; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * @author ldjun - * @description 服务实现 - * @date 2021-03-16 - **/ -@Service -@RequiredArgsConstructor -@Slf4j -public class AcsConfigServiceImpl implements AcsConfigService, ApplicationAutoInitial { - - Map acsconfigs = new HashMap<>(); - - @Override - public void load() { - Map map = new HashMap(); - List listacsconfigs = this.queryAll(map); - Iterator item = listacsconfigs.iterator(); - while (item.hasNext()) { - AcsConfigDto dto = (AcsConfigDto) item.next(); - acsconfigs.put(dto.getCode(), dto.getValue()); - } - - } - - @Override - public void autoInitial() throws Exception { - this.load(); - } - - @Override - public Map queryAll(Map whereJson, Pageable page) { - WQLObject wo = WQLObject.getWQLObject("sys_param"); - ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc"); - final JSONObject json = rb.pageResult(); - return json; - } - - @Override - public List queryAll(Map whereJson) { - WQLObject wo = WQLObject.getWQLObject("sys_param"); - JSONArray arr = wo.query().getResultJSONArray(0); - List list =arr.toJavaList(AcsConfigDto.class); - return list; - } - - @Override - public AcsConfigDto findById(String id) { - WQLObject wo = WQLObject.getWQLObject("sys_param"); - JSONObject json = wo.query("id ='" + id + "'").uniqueResult(0); - final AcsConfigDto obj = json.toJavaObject(AcsConfigDto.class); - return obj; - } - - @Override - public AcsConfigDto findByCode(String code) { - WQLObject wo = WQLObject.getWQLObject("sys_param"); - JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); - final AcsConfigDto obj = json.toJavaObject(AcsConfigDto.class); - return obj; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(AcsConfigDto dto) { - String currentUsername = SecurityUtils.getCurrentUsername(); - String now = DateUtil.now(); - - dto.setId(IdUtil.simpleUUID()); - dto.setCreate_by(currentUsername); - dto.setUpdate_by(currentUsername); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("sys_param"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - this.load(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(AcsConfigDto dto) { - AcsConfigDto entity = this.findById(dto.getId()); - if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); - - String currentUsername = SecurityUtils.getCurrentUsername(); - String now = DateUtil.now(); - dto.setUpdate_time(now); - dto.setUpdate_by(currentUsername); - - WQLObject wo = WQLObject.getWQLObject("sys_param"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - wo.update(json); - this.load(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteAll(String[] ids) { - WQLObject wo = WQLObject.getWQLObject("sys_param"); - for (String id : ids) { - wo.delete("id = '" + id + "'"); - } - this.load(); - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (AcsConfigDto param : all) { - Map map = new LinkedHashMap<>(); - map.put("编码", param.getCode()); - map.put("名称", param.getName()); - map.put("值", param.getValue()); - map.put("备注", param.getRemark()); - map.put("是否启用", param.getIs_active()); - map.put("是否删除", param.getIs_delete()); - map.put("创建者", param.getCreate_by()); - map.put("创建时间", param.getCreate_time()); - map.put("修改者", param.getUpdate_by()); - map.put("修改时间", param.getUpdate_time()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Map findConfigFromCache() { - Map demo = (Map) ObjectUtil.clone(this.acsconfigs); - return demo; - } -} +// +//package org.nl.acs.config.server.impl; +// +// +//import cn.hutool.core.date.DateUtil; +//import cn.hutool.core.util.IdUtil; +//import cn.hutool.core.util.ObjectUtil; +//import com.alibaba.fastjson.JSONArray; +//import com.alibaba.fastjson.JSONObject; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.nl.acs.auto.initial.ApplicationAutoInitial; +//import org.nl.acs.config.dto.AcsConfigDto; +//import org.nl.acs.config.server.AcsConfigService; +//import org.nl.modules.common.exception.BadRequestException; +//import org.nl.modules.common.utils.FileUtil; +//import org.nl.modules.common.utils.SecurityUtils; +//import org.nl.modules.wql.core.bean.ResultBean; +//import org.nl.modules.wql.core.bean.WQLObject; +//import org.nl.modules.wql.util.WqlUtil; +//import org.springframework.data.domain.Pageable; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +// +//import javax.servlet.http.HttpServletResponse; +//import java.io.IOException; +//import java.util.*; +// +///** +// * @author ldjun +// * @description 服务实现 +// * @date 2021-03-16 +// **/ +//@Service +//@RequiredArgsConstructor +//@Slf4j +//public class AcsConfigServiceImpl implements AcsConfigService, ApplicationAutoInitial { +// +// Map acsconfigs = new HashMap<>(); +// +// @Override +// public void load() { +// Map map = new HashMap(); +// List listacsconfigs = this.queryAll(map); +// Iterator item = listacsconfigs.iterator(); +// while (item.hasNext()) { +// AcsConfigDto dto = (AcsConfigDto) item.next(); +// acsconfigs.put(dto.getCode(), dto.getValue()); +// } +// +// } +// +// @Override +// public void autoInitial() throws Exception { +// this.load(); +// } +// +// @Override +// public Map queryAll(Map whereJson, Pageable page) { +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc"); +// final JSONObject json = rb.pageResult(); +// return json; +// } +// +// @Override +// public List queryAll(Map whereJson) { +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// JSONArray arr = wo.query().getResultJSONArray(0); +// List list =arr.toJavaList(AcsConfigDto.class); +// return list; +// } +// +// @Override +// public AcsConfigDto findById(String id) { +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// JSONObject json = wo.query("id ='" + id + "'").uniqueResult(0); +// final AcsConfigDto obj = json.toJavaObject(AcsConfigDto.class); +// return obj; +// } +// +// @Override +// public AcsConfigDto findByCode(String code) { +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); +// final AcsConfigDto obj = json.toJavaObject(AcsConfigDto.class); +// return obj; +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void create(AcsConfigDto dto) { +// String currentUsername = SecurityUtils.getCurrentUsername(); +// String now = DateUtil.now(); +// +// dto.setId(IdUtil.simpleUUID()); +// dto.setCreate_by(currentUsername); +// dto.setUpdate_by(currentUsername); +// dto.setUpdate_time(now); +// dto.setCreate_time(now); +// +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// JSONObject json = (JSONObject) JSONObject.toJSON(dto); +// +// wo.insert(json); +// this.load(); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void update(AcsConfigDto dto) { +// AcsConfigDto entity = this.findById(dto.getId()); +// if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); +// +// String currentUsername = SecurityUtils.getCurrentUsername(); +// String now = DateUtil.now(); +// dto.setUpdate_time(now); +// dto.setUpdate_by(currentUsername); +// +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// JSONObject json = (JSONObject) JSONObject.toJSON(dto); +// wo.update(json); +// this.load(); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void deleteAll(String[] ids) { +// WQLObject wo = WQLObject.getWQLObject("sys_param"); +// for (String id : ids) { +// wo.delete("id = '" + id + "'"); +// } +// this.load(); +// } +// +// @Override +// public void download(List all, HttpServletResponse response) throws IOException { +// List> list = new ArrayList<>(); +// for (AcsConfigDto param : all) { +// Map map = new LinkedHashMap<>(); +// map.put("编码", param.getCode()); +// map.put("名称", param.getName()); +// map.put("值", param.getValue()); +// map.put("备注", param.getRemark()); +// map.put("是否启用", param.getIs_active()); +// map.put("是否删除", param.getIs_delete()); +// map.put("创建者", param.getCreate_by()); +// map.put("创建时间", param.getCreate_time()); +// map.put("修改者", param.getUpdate_by()); +// map.put("修改时间", param.getUpdate_time()); +// list.add(map); +// } +// FileUtil.downloadExcel(list, response); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public Map findConfigFromCache() { +// Map demo = (Map) ObjectUtil.clone(this.acsconfigs); +// return demo; +// } +//} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls index 8aea8d0..427b90b 100644 Binary files a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls and b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls differ diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls index 7fe09b4..cc791b4 100644 Binary files a/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls and b/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls differ diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java index addd42d..92516fa 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java @@ -135,7 +135,7 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.standard_inspect_site.ItemProtocol.item_to_command; + + "." + ItemProtocol.item_to_command; String opcservcerid = this.getDevice().getOpc_server_id(); Server server = ReadUtil.getServer(opcservcerid); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java deleted file mode 100644 index 7d368cf..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.nl.acs.device_driver.standard_conveyor_control; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_move = "move"; - public static String item_action = "action"; - public static String item_ioaction = "ioaction"; - public static String item_height = "height"; - public static String item_error = "error"; - public static String item_direction = "direction"; - public static String item_operation_type = "operation_type"; - public static String item_task = "task"; - - public static String item_to_command = "to_command"; - public static String item_to_target = "to_target"; - public static String item_to_task = "to_task"; - public static String item_weight = "weight"; - - private StandardCoveyorControlDeviceDriver driver; - - public ItemProtocol(StandardCoveyorControlDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getMove() { - return this.getOpcIntegerValue(item_move); - } - - public int getAction() { - return this.getOpcIntegerValue(item_action); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getOperation_type() { - return this.getOpcIntegerValue(item_operation_type); - } - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - public int getToTarget() { - return this.getOpcIntegerValue(item_to_target); - } - - public int getToTask() { - return this.getOpcIntegerValue(item_to_task); - } - - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { - log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_move, "光电开关信号", "DB600.B2")); - list.add(new ItemDto(item_action, "取放信号", "DB600.B3")); - list.add(new ItemDto(item_ioaction, "进出类型", "DB600.B4")); - list.add(new ItemDto(item_height, "高度类型", "DB600.B5")); - list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); - list.add(new ItemDto(item_direction, "电机方向", "DB600.B7")); - list.add(new ItemDto(item_operation_type, "作业类型", "DB600.B8")); - list.add(new ItemDto(item_task, "任务号", "DB600.D22")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB601.W2", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_target, "目标站", "DB601.W4")); - list.add(new ItemDto(item_to_task, "任务号", "DB601.D8")); - return list; - } - -} - diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardConveyorControlDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardConveyorControlDefination.java deleted file mode 100644 index 2d9aa72..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardConveyorControlDefination.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.nl.acs.device_driver.standard_conveyor_control; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 检测站点驱动定义 - * 说明:该站点为普通带光电检测站点 - */ -@Service -public class StandardConveyorControlDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "standard_conveyor_control"; - } - - @Override - public String getDriverName() { - return "标准版-输送机-控制点"; - } - - @Override - public String getDriverDescription() { - return "标准版-输送机-控制点"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new StandardCoveyorControlDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return StandardCoveyorControlDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true))); - list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB600.B3")); - list.add(new ItemDto(ItemProtocol.item_ioaction, "进出类型", "DB600.B4")); - list.add(new ItemDto(ItemProtocol.item_height, "高度类型", "DB600.B5")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6")); - list.add(new ItemDto(ItemProtocol.item_direction, "电机方向", "DB600.B7")); - list.add(new ItemDto(ItemProtocol.item_operation_type, "作业类型", "DB600.B8")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D22")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java deleted file mode 100644 index 7611adf..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ /dev/null @@ -1,438 +0,0 @@ -package org.nl.acs.device_driver.standard_conveyor_control; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 输送机-控制点驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - @Autowired - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; - int error = 0; - int move = 0; - int task = 0; - //出入库模式 - int operation_type = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - private Date instruction_apply_time = new Date(); - private int instruction_require_time_out = 3000; - //请求成功标记 - Boolean requireSucess = false; - //申请指令成功标记 - Boolean applySucess = false; - String inst_message; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag = 0; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() throws Exception { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getMode(); - error = this.itemProtocol.getError(); - move = this.itemProtocol.getMove(); - task = this.itemProtocol.getTask(); - hasGoods = this.itemProtocol.getMove(); - operation_type = this.itemProtocol.getOperation_type(); - if (mode != last_mode) { - } - if (move != last_move) { - if (move == 0) { - thingToNothing(); - } - this.setRequireSucess(false); - - } - if (error != last_error) { - } - - if (mode == 2 && move != 0 && task > 0) { - //inst_message - inst = instructionService.findByCodeFromCache(String.valueOf(task)); - if (inst != null) { - inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); - if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { - finish_instruction(); - } - if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { - inst.setInstruction_status("1"); - instructionService.update(inst); - } - } - } - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - switch (mode) { - case 1: - log.debug("设备运转模式:等待工作"); - break; - case 2: - //申请任务 - if (!StrUtil.isEmpty(material) && !StrUtil.isEmpty(qty) && material.length() > 0 && qty.length() > 0 && !requireSucess) { - this.instruction_require(container); - } - break; - case 3: - - break; - case 4: - //叫料 - - break; - case 5: - //申请空盘 - if (move == 0 && !requireSucess) { - apply_OutEmpty(); - } - break; - case 6: - //申请入库 - if (move != 0 && !applySucess) { - instruction_apply(); - } - if (move != 0 && !requireSucess) { - apply_InEmpty(); - } - break; - } - - - switch (flag) { - //取货完成 - case 1: - writing(2); - break; - //放货完成 - case 2: - writing(3); - break; - - } - - } - last_mode = mode; - last_error = error; - last_move = move; - last_task = task; - } - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.setRequireSucess(false); - this.setApplySucess(false); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.setInst_message(null); - this.setContainer(null); - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_task; - if (appendMessage == null) { - appendMessage = ""; - } - if (instruction != null) { - instruction_num = Integer.parseInt(instruction.getInstruction_code()); - } - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, 1); - itemMap.put(to_task, instruction_num); - ReadUtil.write(itemMap, server); - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - - } - - public void writing(int command, int target, int task) { - - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - itemMap.put(to_target, target); - itemMap.put(to_task, task); - ReadUtil.write(itemMap, server); - } - - public void writing(int type, int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - if (type == 1) { - itemMap.put(to_command, command); - } else if (type == 2) { - itemMap.put(to_target, command); - - } else if (type == 3) { - itemMap.put(to_task, command); - } - ReadUtil.write(itemMap, server); - - } - - public boolean instruction_apply() throws Exception { - return false; - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - - public synchronized boolean finish_instruction() throws Exception { - instructionService.finish(inst); - return true; - } - - public void apply_OutEmpty() { - - } - - public synchronized boolean apply_InEmpty() throws Exception { - return false; - } -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/StandardEmptyPalletSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/StandardEmptyPalletSiteDeviceDriver.java index 7a6b264..099f7f1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/StandardEmptyPalletSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/StandardEmptyPalletSiteDeviceDriver.java @@ -9,15 +9,13 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.config.server.impl.AcsConfigServiceImpl; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -28,6 +26,8 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.util.SpringContextHolder; import org.openscada.opc.lib.da.Server; @@ -52,7 +52,7 @@ public class StandardEmptyPalletSiteDeviceDriver extends AbstractOpcDeviceDriver @Autowired TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); @Autowired - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); + ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class); @Autowired DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); @Autowired @@ -175,7 +175,7 @@ public class StandardEmptyPalletSiteDeviceDriver extends AbstractOpcDeviceDriver log.debug("设备运转模式:等待工作"); return; case 2: - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (number == max_emptypalletnum && !requireSucess && move > 0) { apply_InEmpty(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java deleted file mode 100644 index c280d3d..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.nl.acs.device_driver.standard_inspect_site; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Data -public class ItemProtocol { - - public static String item_heartbeat = "heartbeat"; - public static String item_mode = "mode"; - public static String item_move = "move"; - public static String item_ioaction = "ioaction"; - public static String item_error = "error"; - public static String item_task = "task"; - public static String item_to_command = "to_command"; - public static String item_to_target = "to_target"; - public static String item_to_task = "to_task"; - public static String item_weight = "weight"; - - private StandardInspectSiteDeviceDriver driver; - - public ItemProtocol(StandardInspectSiteDeviceDriver driver) { - this.driver = driver; - } - - public int getHeartbeat() { - return this.getOpcIntegerValue(item_heartbeat); - } - - public int getMode() { - return this.getOpcIntegerValue(item_mode); - } - - public int getMove() { - return this.getOpcIntegerValue(item_move); - } - - public int getIoaction() { - return this.getOpcIntegerValue(item_ioaction); - } - - public int getError() { - return this.getOpcIntegerValue(item_error); - } - - public int getTask() { - return this.getOpcIntegerValue(item_task); - } - - public int getToCommand() { - return this.getOpcIntegerValue(item_to_command); - } - - public int getToTarget() { - return this.getOpcIntegerValue(item_to_target); - } - - public int getToTask() { - return this.getOpcIntegerValue(item_to_task); - } - - //是否有货 - public int hasGoods(int move) { - return move; - } - - Boolean isonline; - - public int getOpcIntegerValue(String protocol) { - Integer value = this.driver.getIntegeregerValue(protocol); - if (value == null) { -// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); - setIsonline(false); - } else { - setIsonline(true); - return value; - } - return 0; - - } - - public static List getReadableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB2.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB2.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_move, "光电开关信号", "DB2.B2")); - list.add(new ItemDto(item_error, "报警信号", "DB2.B3")); - list.add(new ItemDto(item_task, "任务号", "DB2.D4")); - return list; - } - - public static List getWriteableItemDtos() { - ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB1.W0", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_target, "目标站", "DB1.W2")); - list.add(new ItemDto(item_to_task, "任务号", "DB1.D4")); - return list; - } - -} - diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java deleted file mode 100644 index 2b81d41..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.nl.acs.device_driver.standard_inspect_site; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * 检测站点驱动定义 - * 说明:该站点为普通带光电检测站点 - */ -@Service -public class StandardInspectSiteDefination implements OpcDeviceDriverDefination { - @Override - public String getDriverCode() { - return "standard_inspect_site"; - } - - @Override - public String getDriverName() { - return "标准版-检测站点"; - } - - @Override - public String getDriverDescription() { - return "标准版-检测站点"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new StandardInspectSiteDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return StandardInspectSiteDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } - - @Override - public List getReadableItemDtos() { - return getReadableItemDtos2(); - } - - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB2.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB2.B1", Boolean.valueOf(true))); - list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB2.B2")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB2.B3")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB2.D4")); - return list; - } - - @Override - public List getWriteableItemDtos() { - return ItemProtocol.getWriteableItemDtos(); - } - -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java deleted file mode 100644 index a54c1b9..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ /dev/null @@ -1,455 +0,0 @@ -package org.nl.acs.device_driver.standard_inspect_site; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.log.service.DeviceExecuteLogService; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.SpringContextHolder; -import org.openscada.opc.lib.da.Server; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 检测站点驱动 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - protected ItemProtocol itemProtocol = new ItemProtocol(this); - @Autowired - InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - @Autowired - DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - @Autowired - DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); - - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - //放货准备锁 - String putReadyLock = null; - //有货标记 - protected boolean has_goods_tag = false; - - int mode = 0; - int error = 0; - int move = 0; - int task = 0; - int last_mode = 0; - int last_error = 0; - int last_move = 0; - int last_task = 0; - Boolean isonline = true; - int hasGoods = 0; - String message = null; - Boolean iserror = false; - - - boolean hasVehicle = false; - boolean isReady = false; - protected int instruction_num = 0; - protected int instruction_num_truth = 0; - boolean isFold = false; - private String assemble_check_tag; - - protected String current_stage_instruction_message; - protected String last_stage_instruction_message; - Integer heartbeat_tag; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - boolean requireSucess = false; - - private int instruction_finished_time_out; - - int branchProtocol = 0; - //备注 - String remark; - //数量 - String qty; - //物料 - String material; - //批次 - String batch; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 - int flag; - - String device_code; - - @Override - public Device getDevice() { - return this.device; - } - - - @Override - public void execute() { - String message = null; - try { - device_code = this.getDeviceCode(); - mode = this.itemProtocol.getMode(); - error = this.itemProtocol.getError(); - move = this.itemProtocol.getMove(); - task = this.itemProtocol.getTask(); - hasGoods = this.itemProtocol.getMove(); - - if (mode != last_mode) { - this.setRequireSucess(false); - logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code,"","","信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error); - } - if (task != last_task) { - logServer.deviceItemValue(this.device_code,"task",String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code,"","","信号task:" + last_task + "->" + task); - } - - if (this.getApply_handling()) { - String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString(); - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); - Device link_device = appService.findDeviceByCode(link_device_code); - StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver; - if (link_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) link_device.getDeviceDriver(); -// if(standardInspectSiteDevicedriver.getMode() != 2){ -// log.debug("设备未待机"); -// return; -// } -// if(standardInspectSiteDevicedriver.getMove() != 0){ -// log.debug("设备不满足放货条件"); -// return; -// } - - //如果目标设备申请叫料 则允许生成任务 - if (standardInspectSiteDevicedriver.getApply_material()) { - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); -// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); -// String next_device_codecode = jo.getNext_device_code(); -// if(StrUtil.isEmpty(next_device_codecode)){ -// throw new RuntimeException("该设备未找到对应路由"); -// } - dto.setNext_point_code(this.getDeviceCode()); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - standardInspectSiteDevicedriver.setApply_material(false); - } - } - this.setApply_handling(false); - } - - } catch (Exception var17) { - return; - } - - if (!this.itemProtocol.getIsonline()) { - this.setIsonline(false); - this.setIserror(true); - message = "信号量同步异常"; - //未联机 - } else if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - switch (mode) { - case 1: - log.debug("设备运转模式:等待工作"); - return; - case 2: - //申请任务 -// if (this.getApply_handling()) { -// String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString(); -// DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); -// Device link_device = appService.findDeviceByCode(link_device_code); -// StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver; -// if(link_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { -// standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) link_device.getDeviceDriver(); -// if(standardInspectSiteDevicedriver.getMode() != 2){ -// log.debug("设备未待机"); -// return; -// } -// if(standardInspectSiteDevicedriver.getMove() != 0){ -// log.debug("设备不满足放货条件"); -// return; -// } -// -// //如果目标设备申请叫料 则允许生成任务 -// if(standardInspectSiteDevicedriver.getApply_material()){ -// TaskDto dto = new TaskDto(); -// String now = DateUtil.now(); -// dto.setTask_id(IdUtil.simpleUUID()); -// dto.setCreate_by(this.getDevice().getDevice_code()); -// dto.setUpdate_by(this.getDevice().getDevice_code()); -// dto.setStart_point_code(this.getDevice().getDevice_code()); -// -// String taskcode = CodeGenerateUtil.getNewCode("TASK_NO"); -// dto.setTask_code("-"+taskcode); -// dto.setTask_status("0"); -// dto.setPriority("101"); -// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); -// String next_device_codecode = jo.getNext_device_code(); -// if(StrUtil.isEmpty(next_device_codecode)){ -// throw new RuntimeException("该设备未找到对应路由"); -// } -// dto.setNext_point_code(next_device_codecode); -// dto.setUpdate_time(now); -// dto.setCreate_time(now); -// -// WQLObject wo = WQLObject.getWQLObject("acs_task"); -// JSONObject json = (JSONObject) JSONObject.toJSON(dto); - -// wo.insert(json); -// standardInspectSiteDevicedriver.setApply_material(false); -// } -// } -// this.setApply_handling(false); -// } - - if (material.length() > 0 && qty.length() > 0 && !requireSucess) { - this.instruction_require(container); - } - } - - switch (flag) { - //取货完成 - case 1: - writing(2); - return; - //放货完成 - case 2: - writing(3); - return; - - } - - } - last_mode = mode; - last_error = error; - last_move = move; - last_task = task; - - } - - - public boolean exe_error() { - if (this.error == 0) { - return true; - } else { - log.debug("设备报警"); - return false; - } - } - - protected void thingToNothing() { - log.debug("从有货到无货 清理数据"); - this.set_last_container(container, container_type_desc); - } - - public void set_last_container(String barcode, String type_desc) { - this.set_last_container(barcode); - this.set_last_container_type_desc(type_desc); - } - - public void set_last_container(String barcode) { - } - - public void set_last_container_type_desc(String type) { - } - - public boolean exe_business() { - return true; - } - - protected void executing(Instruction instruction) { - this.executing(1, instruction, ""); - } - - public void executing(int command, Instruction instruction, String appendMessage) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_task; - if (appendMessage == null) { - appendMessage = ""; - } - if (instruction != null) { - instruction_num = Integer.parseInt(instruction.getInstruction_code()); - } - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, 1); - itemMap.put(to_task, instruction_num); - ReadUtil.write(itemMap, server); - - } - - public void executing(Server server, Map itemMap) { - ReadUtil.write(itemMap, server); - } - - public void writing(int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - itemMap.put(to_command, command); - ReadUtil.write(itemMap, server); - - } - - public void writing(int type, int command) { - String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_command; - String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_target; - String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + ItemProtocol.item_to_task; - String opcservcerid = this.getDevice().getOpc_server_id(); - Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); - if (type == 1) { - itemMap.put(to_command, command); - } else if (type == 2) { - itemMap.put(to_target, command); - - } else if (type == 3) { - itemMap.put(to_task, command); - } - ReadUtil.write(itemMap, server); - - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - /** - * 请求指令 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); - - wo.insert(json); - requireSucess = false; - return true; - } - } - - -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDefination.java deleted file mode 100644 index cac8f65..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDefination.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.nl.acs.device_driver.standard_ordinary_site; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 普通站点定义 - */ -@Service -public class StandardOrdinarySiteDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "standard_ordinary_site"; - } - - @Override - public String getDriverName() { - return "标准版-无光电普通站点"; - } - - @Override - public String getDriverDescription() { - return "标准版-无光电普通站点"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new StandardOrdinarySiteDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return StandardOrdinarySiteDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.conveyor); - return types; - } -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java deleted file mode 100644 index 1bd2720..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ /dev/null @@ -1,376 +0,0 @@ -package org.nl.acs.device_driver.standard_ordinary_site; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; -import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.WcsConfig; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.route.service.dto.RouteLineDto; -import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.modules.system.util.CodeUtil; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.SpringContextHolder; -import org.springframework.beans.factory.annotation.Autowired; - -import java.math.BigDecimal; -import java.util.Date; - - -/** - * 普通站点 - */ -@Slf4j -@Data -@RequiredArgsConstructor -public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { - @Autowired - RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); - @Autowired - TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); - - Integer hasGoods = 0; - int error = 0; - Boolean iserror = false; - Boolean islock = false; - - int branchProtocol = 0; - int last_branchProtocol = 0; - //是否需要输入物料 - String input_material = "0"; - //备注 - String remark = ""; - //数量 - String qty = ""; - //批次 - String batch = ""; - //物料 - String material = ""; - //目标点位 - String purpose = ""; - //当前指令 - Instruction inst = null; - //上次指令 - Instruction last_inst = null; - - boolean requireSucess = false; - - //触摸屏手动触发任务 - private Boolean is_has_task = false; - - //申请搬运任务 - private Boolean apply_handling = false; - //申请物料 - private Boolean apply_material = false; - - // 1取货完成 2放货完成 3进入区域 4离开区域 - private int flag; - - //人工确认信号 默认0 agv到达后请求置1 等人工确认后变为2 反馈agv后继续为0 - private int manua_confirm = 0; - - String devicecode; - String container; - String container_type_desc; - String last_container_type_desc; - String last_container; - private Date instruction_require_time = new Date(); - private Date instruction_finished_time = new Date(); - - private int instruction_require_time_out; - - String message; - - int mode = 2; - - int move; - - @Override - public void execute() { - hasGoods = this.getDevice().getHas_goods(); - batch = this.getDevice().getBatch(); - devicecode = this.getDeviceCode(); - if (branchProtocol != last_branchProtocol) { - requireSucess = false; - } - switch (branchProtocol) { - case 1: - break; - //呼叫请求 - case 2: - if (material.length() > 0 && Integer.parseInt(this.getQty()) > 0 && !requireSucess) { - } - break; - //响应生成任务 - case 3: - if (material.length() > 0 && qty.length() > 0 && purpose.length() > 0 && !requireSucess) { - this.instruction_require(material, qty, this.getRemark(), purpose); - } - break; - //自动创建任务 叫料 - case 4: - if (!requireSucess) { - autoCreateTask(); - } - break; - //搬运空车、空托 - case 5: - if (!requireSucess) { - autoCreateEmptyPallet(); - } - break; - } - } - - public boolean instruction_require(String container_code) { - return instruction_require(container_code, WcsConfig.task_container_type_default_desc); - } - - - /** - * 自动创建任务 - * - * @return - */ - public synchronized boolean autoCreateTask() { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - String next_device_code = ""; - - String plan_uuid = WQLObject.getWQLObject("acs_route_plan").query("plan_code= '" + dto.getRoute_plan_code() + "'").uniqueResult(0).getString("plan_uuid"); - JSONArray ja = routelineserver.queryNextLine(this.getDevice().getDevice_code(), plan_uuid); - - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); - for (int i = 0; i < ja.size(); i++) { - JSONObject jo = (JSONObject) ja.get(i); - next_device_code = jo.get("next_device_code").toString(); - Device nextdevice = appService.findDeviceByCode(next_device_code); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) nextdevice.getDeviceDriver(); - String maxTaskNum = WQLObject.getWQLObject("sys_param").query("code= 'onePointMaxTask' and is_active='1' ").uniqueResult(0).getString("value"); - - if (taskserver.checkAllowCreate(next_device_code) >= Integer.parseInt(maxTaskNum)) { - continue; - } - if (standardOrdinarySiteDeviceDriver.getHasGoods() == 0) { - break; - } - } - } - if (StrUtil.isEmpty(next_device_code)) { - throw new RuntimeException("该设备未找到对应路由"); - } - - dto.setNext_point_code(next_device_code); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - try { - taskserver.create(dto); - } catch (Exception e) { - e.printStackTrace(); - } - this.setIslock(true); - requireSucess = false; - branchProtocol = 0; - return true; - } - - } - - /** - * 自动创建搬运空车任务 - * - * @return - */ - public synchronized boolean autoCreateEmptyPallet() { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - //存在空位才能执行 - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - String next_device_code = ""; - dto.setRoute_plan_code("one"); - String plan_uuid = WQLObject.getWQLObject("acs_route_plan").query("plan_code= '" + dto.getRoute_plan_code() + "'").uniqueResult(0).getString("plan_uuid"); - - JSONArray ja = routelineserver.queryNextLine(this.getDevice().getDevice_code(), plan_uuid); - - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); - for (int j = 0; j < ja.size(); j++) { - JSONObject jo = (JSONObject) ja.get(j); - next_device_code = jo.get("next_device_code").toString(); - Device nextdevice = appService.findDeviceByCode(next_device_code); - } - if (StrUtil.isEmpty(next_device_code)) { - throw new RuntimeException("该设备未找到对应路由"); - } - - dto.setNext_point_code(next_device_code); - dto.setUpdate_time(now); - dto.setCreate_time(now); - dto.setMaterial(material); - try { - taskserver.create(dto); - } catch (Exception e) { - e.printStackTrace(); - } - this.setIslock(true); - requireSucess = false; - branchProtocol = 0; - return true; - } - } - - /** - * 请求任务 - * - * @param container_code - * @param container_type - */ - public synchronized boolean instruction_require(String container_code, String container_type) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(container_code); - dto.setVehicle_type(container_type); - - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - dto.setNext_point_code(next_device_codecode); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - try { - taskserver.create(dto); - } catch (Exception e) { - e.printStackTrace(); - } - requireSucess = false; - branchProtocol = 0; - return true; - } - } - - /** - * 请求任务 - * - * @param - * @param - */ - public synchronized boolean instruction_require(String material, String qty, String remark, String purpose) { - Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); - return false; - } else { - this.instruction_require_time = date; - TaskDto dto = new TaskDto(); - String now = DateUtil.now(); - dto.setTask_id(IdUtil.simpleUUID()); - dto.setCreate_by(this.getDevice().getDevice_code()); - dto.setUpdate_by(this.getDevice().getDevice_code()); - dto.setStart_point_code(this.getDevice().getDevice_code()); - dto.setStart_device_code(this.getDevice().getDevice_code()); - dto.setVehicle_code(""); - dto.setVehicle_type(""); - dto.setRoute_plan_code("normal"); - String taskcode = CodeUtil.getNewCode("TASK_NO"); - dto.setTask_code("-" + taskcode); - dto.setTask_status("0"); - dto.setPriority("101"); - dto.setMaterial(this.getMaterial()); - dto.setQuantity(new BigDecimal(this.getQty())); - RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); - String next_device_codecode = jo.getNext_device_code(); - if (StrUtil.isEmpty(next_device_codecode)) { - throw new RuntimeException("该设备未找到对应路由"); - } - - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); - Device purposedevice = appService.findDeviceByCode(purpose); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver = null; - if (purposedevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) purposedevice.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setBranchProtocol(0); - standardOrdinarySiteDeviceDriver.setPurpose(null); - standardOrdinarySiteDeviceDriver.setRemark(null); - } - dto.setNext_point_code(purpose); - dto.setNext_device_code(purpose); - dto.setUpdate_time(now); - dto.setCreate_time(now); - dto.setRemark(getRemark()); - try { - taskserver.create(dto); - } catch (Exception e) { - e.printStackTrace(); - } - last_branchProtocol = 2; - this.setBranchProtocol(0); - this.setRemark(null); - this.setPurpose(null); - this.setRequireSucess(true); - return true; - } - } - -} - diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDefination.java deleted file mode 100644 index fa5b71d..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDefination.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.nl.acs.device_driver.standard_storage; - -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceType; -import org.springframework.stereotype.Service; - -import java.util.LinkedList; -import java.util.List; - -/** - * 货架 - */ -@Service -public class StandardStorageDefination implements DeviceDriverDefination { - @Override - public String getDriverCode() { - return "standard_storage"; - } - - @Override - public String getDriverName() { - return "标准版-货架"; - } - - @Override - public String getDriverDescription() { - return "标准版-货架"; - } - - @Override - public DeviceDriver getDriverInstance(Device device) { - return (new StandardStorageDeviceDriver()).setDevice(device).setDriverDefination(this); - - } - - @Override - public Class getDeviceDriverType() { - return StandardStorageDeviceDriver.class; - } - - @Override - public List getFitDeviceTypes() { - List types = new LinkedList(); - types.add(DeviceType.storage); - return types; - } -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDeviceDriver.java deleted file mode 100644 index 5765682..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_storage/StandardStorageDeviceDriver.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.nl.acs.device_driver.standard_storage; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.StorageDeviceDriver; -import org.nl.acs.device_driver.driver.AbstractDeviceDriver; - - -/** - * 标准版货架 - */ -@Slf4j -@Data -public class StandardStorageDeviceDriver extends AbstractDeviceDriver implements RouteableDeviceDriver, StorageDeviceDriver, DeviceDriver { - public StandardStorageDeviceDriver() { - - } - - public boolean isTakeReady() { - return true; - } - - public boolean isPutReady() { - return true; - } - - public boolean fixTypes(Integer type) { - return true; - } - - -} - diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 6d30ff1..4badbd1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.address.service.AddressService; import org.nl.acs.device.address.service.dto.AddressDto; import org.nl.acs.device.service.DeviceService; @@ -20,6 +19,7 @@ import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.util.DateUtil; import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.service.ParamService; import org.nl.modules.wql.core.bean.WQLObject; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; @@ -35,7 +35,7 @@ import java.util.Map; public class AcsToWmsServiceImpl implements AcsToWmsService { @Autowired - AcsConfigService acsConfigService; + ParamService acsConfigService; @Autowired DeviceService deviceService; @@ -49,7 +49,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Autowired DeviceExecuteLogService logServer; - @Value("${acsTowms.token}") +// @Value("${acsTowms.token}") public String token; private String log_file_type="log_file_type"; @@ -59,7 +59,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String applyTaskToWms(String device_code, String container_code, int height, int weight) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("applyTaskToWms"); String url = wmsurl + addressDto.getMethods_url(); @@ -108,7 +108,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse applyTaskManipulatorToWms(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("applyTaskManipulatorToWms"); String url = wmsurl + addressDto.getMethods_url(); @@ -148,7 +148,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse applyOuttoKiln(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("ispackage"); String url = wmsurl + addressDto.getMethods_url(); @@ -189,7 +189,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse applyIntoKiln(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("applyIntoKiln"); String url = wmsurl + addressDto.getMethods_url(); @@ -232,7 +232,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse applyBarcode(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getVehicleInfoBycode"); String url = wmsurl + addressDto.getMethods_url(); @@ -273,7 +273,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse lnshApplyTaskToWms(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("lnshApplyTaskToWms"); String url = wmsurl + addressDto.getMethods_url(); @@ -314,7 +314,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public JSONObject getVehicle(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getVehicle"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -348,7 +348,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public JSONObject getVehicleTokiln(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getVehicleTokiln"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -377,7 +377,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse inKiln(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("inKiln"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -406,7 +406,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse outKiln(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("outKiln"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -435,7 +435,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse enterOrder(JSONObject json) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("enterOrder"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -468,7 +468,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } finally { MDC.remove(log_file_type); } - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getVehicleCode"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -503,7 +503,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } finally { MDC.remove(log_file_type); } - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getVehiclePoint"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -535,7 +535,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } finally { MDC.remove(log_file_type); } - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); String task_code = ""; for (int i = 0; i < data.size(); i++) { @@ -580,7 +580,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { MDC.put(log_file_type, log_type); AddressDto addressDto = addressService.findByCode("feedbackPointStatusToWms"); String methods_url = addressDto.getMethods_url(); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); String url = wmsurl + methods_url; JSONObject json = new JSONObject(); @@ -617,7 +617,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public JSONArray getDeviceStatusToWms() { try { MDC.put(log_file_type,log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("getDeviceStatusToWms"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -642,7 +642,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse requestSignalInteraction(String device_code, String vehicle_code, String action) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject json = new JSONObject(); json.put("device_code", device_code); json.put("vehicle_code", vehicle_code); @@ -677,7 +677,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String requestTaskAgain(String address, String task_id, String vehicle_code) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); String device_code = deviceService.queryDeviceCodeByAddress(Integer.parseInt(address)); JSONObject jo = new JSONObject(); jo.put("device_code", device_code); @@ -716,7 +716,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { log.info("apply_InEmpty----空盘入库申请校验失败,{}{}", device_code, "设备条码为空"); throw new BadRequestException("地址对应设备未找到"); } - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject jo = new JSONObject(); jo.put("device_code", device_code); jo.put("type", type); @@ -753,7 +753,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public String apply_OutEmpty(String device_code) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject jo = new JSONObject(); jo.put("device_code", device_code); String result2 = ""; @@ -785,7 +785,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse feedbackAgvStatus(String device_code, String error, String error_message) { try { MDC.put(log_file_type, log_type); - String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsUrl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject json = new JSONObject(); json.put("device_code", device_code); @@ -820,7 +820,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse feedbackDeviceStatus(String device_code, String code, String value) { try { MDC.put(log_file_type, log_type); - String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsUrl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject json = new JSONObject(); json.put("device_code", device_code); @@ -859,7 +859,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse feedbackAgv(JSONArray from) { try { MDC.put(log_file_type, log_type); - String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsUrl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("feedbackAgv"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; @@ -888,7 +888,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse applyOpenOrCloseDoor(String device_code, String status) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); JSONObject jo = new JSONObject(); jo.put("device_code", device_code); jo.put("status", status); @@ -919,7 +919,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse queryDoorsStatus() { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); HttpResponse result = null; log.info("queryDoorStatus-----请求"); @@ -944,7 +944,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public HttpResponse feedbackActionStatusToWms(JSONArray data) { - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); String task_code = ""; for (int i = 0; i < data.size(); i++) { @@ -998,7 +998,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse reverseGroup(JSONObject param) { try { MDC.put(log_file_type, log_type); - String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue(); HttpResponse result = null; log.info("queryDoorStatus-----请求"); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 62fae17..38d088e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -7,8 +7,8 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_kiln_lane.LnshKilnLaneDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_labeling_machine.LnshLabelingMachineDeviceDriver; @@ -22,7 +22,6 @@ import org.nl.acs.device_driver.lnsh.lnsh_rgv.LnshRGVDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_split_manipulator.LnshSplitManipulatorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.WmsToAcsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; @@ -35,6 +34,8 @@ import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.exception.WDKException; import org.nl.modules.wql.util.SpringContextHolder; @@ -212,7 +213,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { try { MDC.put(log_file_type, log_type); JSONArray tasks = JSONArray.parseArray(param); - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); + ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); log.debug(tasks.toString()); log.info("cancelFromWms--------------:输入参数" + tasks.toString()); @@ -229,7 +230,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (StrUtil.isEmpty(task_code)) { throw new WDKException("任务号不能为空"); } - String cancelTaskCheck = acsConfigService.findConfigFromCache().get(AcsConfig.CANCELTASKCHECK); + String cancelTaskCheck = acsConfigService.findByCode(AcsConfig.CANCELTASKCHECK).getValue(); if (StrUtil.equals(cancelTaskCheck, "1")) { TaskService.cancel(task_uuid); } else if (StrUtil.equals(cancelTaskCheck, "0")) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 7609ed3..79a6d0b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -17,12 +17,11 @@ import org.nl.acs.agv.server.impl.NDCAgvServiceImpl; import org.nl.acs.agv.server.impl.XianGongAgvServiceImpl; import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; @@ -36,6 +35,7 @@ import org.nl.acs.task.service.dto.TaskDto; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.FileUtil; import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.service.ParamService; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; @@ -65,7 +65,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu private final DeviceAppService deviceAppService; - private final AcsConfigService acsConfigService; + private final ParamService acsConfigService; private final RouteLineService routeLineService; private final TaskService taskService; @@ -298,7 +298,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu try { // != 0 为agv任务 if (!StrUtil.equals(type, "0")) { - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")) { MagicAgvServiceImpl magicAgvService = SpringContextHolder.getBean(MagicAgvServiceImpl.class); HttpResponse result = magicAgvService.sendAgvInstToMagic(dto); if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) { @@ -306,12 +306,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } else { dto.setSend_status("1"); } - } else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "2")) { + } else if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) { NDCAgvServiceImpl ndcAgvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class); ndcAgvService.sendAgvInstToNDC(dto); dto.setSend_status("1"); - } else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3")) { + } else if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { if (StrUtil.equals(task.getRequest_again_success(), "1")) { XianGongAgvServiceImpl xianGongAgv = SpringContextHolder.getBean(XianGongAgvServiceImpl.class); //追加订单 @@ -735,13 +735,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String type = shortPathsList.get(0).getType(); // != 0 为agv任务 1=magic 2=NDC 3=XZ if (!StrUtil.equals(type, "0")) { - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "1") + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "1") && !StrUtil.equals(entity.getSend_status(), "2")) { MagicAgvServiceImpl magicAgvService = SpringContextHolder.getBean(MagicAgvServiceImpl.class); magicAgvService.deleteAgvInst(entity.getInstruction_code()); flag = true; - } else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "2")) { + } else if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) { //NDC agv指令不当场取消指令,需要等agv上报 if (!StrUtil.isEmpty(entity.getAgv_jobno())) { NDCAgvServiceImpl ndcAgv = SpringContextHolder.getBean(NDCAgvServiceImpl.class); @@ -749,7 +749,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } else { flag = true; } - } else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3") + } else if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3") && !StrUtil.equals(entity.getSend_status(), "2")) { XianGongAgvServiceImpl xianGongAgvService = SpringContextHolder.getBean(XianGongAgvServiceImpl.class); xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java index 78a3d1a..e8994a3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java @@ -5,13 +5,13 @@ package org.nl.acs.order.service.impl; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.FileUtil; import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.service.ParamService; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.WqlUtil; @@ -45,7 +45,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService { AcsToWmsService acsToWmsService; @Autowired - AcsConfigService acsConfigService; + ParamService acsConfigService; @Override public Map queryAll(Map whereJson, Pageable page) { @@ -170,7 +170,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService { this.update(dto); //判断是否为wms下发的排产单 - String hasWms = acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS); + String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (StrUtil.isNotEmpty(dto.getProduct_code()) && hasWms.equals("1")) { JSONObject json = new JSONObject(); json.put("producetask_code",dto.getOrder_code()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 2d6ac8d..484e4e5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -15,14 +15,13 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.server.impl.XianGongAgvServiceImpl; import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceAssignedService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.StorageCellService; import org.nl.acs.device.service.dto.DeviceAssignedDto; import org.nl.acs.device.service.impl.DeviceServiceImpl; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; @@ -39,6 +38,8 @@ import org.nl.acs.task.service.dto.TaskFeedbackDto; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.FileUtil; import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; @@ -77,7 +78,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { @Autowired private TaskFeedbackService taskFeedbackService; - private final AcsConfigService acsConfigService; + private final ParamService acsConfigService; private final RouteLineService routeLineService; @@ -326,7 +327,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { if (routelineserver.getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code).size() == 0) { throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!"); } - String createTaskCheck = acsConfigService.findConfigFromCache().get(AcsConfig.CREATETASKCHECK); + String createTaskCheck = acsConfigService.findByCode(AcsConfig.CREATETASKCHECK).getValue(); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device nextdevice = appService.findDeviceByCode(next_device_code); @@ -483,7 +484,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { tasks.add(dto); } //判断是否为WMS下发的任务,如果是反馈任务状态给WMS - String hasWms = acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS); + String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); JSONObject feed_jo = new JSONObject(); @@ -599,7 +600,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { wo.update(json); removeByCodeFromCache(entity.getTask_code()); //判断是否为WMS下发的任务,如果是反馈任务状态给WMS - String hasWms = acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS); + String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); JSONObject feed_jo = new JSONObject(); @@ -694,7 +695,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } //如果属于先知AGV,关闭运单序列 - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { try { XianGongAgvServiceImpl xianGongAgv = SpringContextHolder.getBean(XianGongAgvServiceImpl.class); xianGongAgv.markComplete(entity.getTask_code()); @@ -728,7 +729,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } } //判断是否为WMS下发的任务,如果是反馈任务状态给WMS - String hasWms = acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS); + String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { JSONObject feed_jo = new JSONObject(); feed_jo.put("ext_task_uuid", entity.getExt_task_uuid()); @@ -742,7 +743,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { String type = shortPathsList.get(0).getType(); // != 0 为agv任务 if (!StrUtil.equals(type, "0")) { - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { XianGongAgvServiceImpl xianGongAgv = SpringContextHolder.getBean(XianGongAgvServiceImpl.class); xianGongAgv.markComplete(entity.getTask_code()); } @@ -754,7 +755,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { public void createInst(String ids) throws Exception { TaskDto acsTask = this.findById(ids); if (acsTask == null) throw new BadRequestException("被删除或无权限,操作失败!"); - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); + ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl"); InstructionDto inst = instructionservice.findByTaskid(ids, "instruction_status < 2 "); @@ -772,7 +773,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { String compound_task = acsTask.getCompound_task(); String next_point_code = acsTask.getNext_point_code(); String next_device_code = acsTask.getNext_device_code(); - String maxInstnumber = acsConfigService.findConfigFromCache().get(AcsConfig.MAXINSTNUMBER); + String maxInstnumber = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER).getValue(); /** * 开始平均分解校验 diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java index eead619..51f5a04 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java @@ -8,6 +8,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_kiln_lane.LnshKilnLaneDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_labeling_machine.LnshLabelingMachineDeviceDriver; @@ -18,10 +21,7 @@ import org.nl.acs.device_driver.lnsh.lnsh_rgv.LnshRGVDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_split_manipulator.LnshSplitManipulatorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index b9f1500..1a40592 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -6,12 +6,11 @@ import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site.LnshFoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; @@ -21,6 +20,7 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.system.service.ParamService; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.stereotype.Component; @@ -41,7 +41,7 @@ public class AutoCreateInst { TaskService taskserver = SpringContextHolder.getBean(TaskService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class); + ParamService acsConfigService = SpringContextHolder.getBean(ParamService.class); List list = taskserver.queryByStauts("0"); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); for (int i = 0; i < list.size(); i++) { @@ -72,7 +72,7 @@ public class AutoCreateInst { continue; } List instructions = instructionService.queryAll("instruction_status < 2"); - String maxInstnumber = acsConfigService.findConfigFromCache().get(AcsConfig.MAXINSTNUMBER); + String maxInstnumber = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER).getValue(); if (ObjectUtils.isNotEmpty(maxInstnumber)) { if (instructions.size() >= Integer.parseInt(maxInstnumber)) { log.info("系统参数配置最大指令数为:" + maxInstnumber + "无法生成指令"); @@ -150,7 +150,7 @@ public class AutoCreateInst { LampThreecolorDeviceDriver lampThreecolorDeviceDriver; LnshFoldDiscSiteDeviceDriver lnshFoldDiscSiteDeviceDriver; - String createTaskCheck = acsConfigService.findConfigFromCache().get(AcsConfig.CREATETASKCHECK); + String createTaskCheck = acsConfigService.findByCode(AcsConfig.CREATETASKCHECK).getValue(); if (StrUtil.equals(createTaskCheck, "1")) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java index 25d0522..893a17c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java @@ -59,7 +59,7 @@ public class ParamServiceImpl implements ParamService { public ParamDto findById(String id) { WQLObject wo = WQLObject.getWQLObject("sys_param"); JSONObject json = wo.query("id ='" + id + "'").uniqueResult(0); - final ParamDto obj = json.toJavaObject(ParamDto.class);; + final ParamDto obj = json.toJavaObject(ParamDto.class); return obj; } @@ -67,7 +67,7 @@ public class ParamServiceImpl implements ParamService { public ParamDto findByCode(String code) { WQLObject wo = WQLObject.getWQLObject("sys_param"); JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); - final ParamDto obj = json.toJavaObject(ParamDto.class);; + final ParamDto obj = json.toJavaObject(ParamDto.class); return obj; } diff --git a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java index dd8c69d..07f0801 100644 --- a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java @@ -8,19 +8,17 @@ import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.auto.run.AbstractAutoRunnable; import org.nl.acs.auto.run.AutoRunService; import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.config.server.impl.AcsConfigServiceImpl; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator.LnshPalletizingManipulatorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator_site.LnshPalletizingManipulatorSiteDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; -import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; -import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -30,6 +28,8 @@ import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; +import org.nl.modules.system.service.ParamService; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -61,7 +61,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { boolean isReConnect = false; @Autowired - AcsConfigService acsConfigService; + ParamService acsConfigService; @Autowired AutoRunService autoRunService; @@ -81,15 +81,15 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { public void autoRun() { try { - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); + ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); NDCAgvService AgvService = SpringContextHolder.getBean(NDCAgvService.class); DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogServiceImpl.class); - ip = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); - port = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT)); + ip = acsConfigService.findByCode(AcsConfig.AGVURL).getValue(); + port = Integer.parseInt(acsConfigService.findByCode(AcsConfig.AGVPORT).getValue()); byte[] b = new byte[1028]; s = new Socket(ip, port); dos = new DataOutputStream(s.getOutputStream()); @@ -163,7 +163,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { LnshLaminatingMachineDeviceDriver lnshLaminatingMachineDeviceDriver; LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; LnshPalletizingManipulatorDeviceDriver lnshPalletizingManipulatorDeviceDriver; - int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE)); + int type = Integer.parseInt(acsConfigService.findByCode(AcsConfig.BUSINESSTYPE).getValue()); try { if (phase == 0x01) { @@ -233,7 +233,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { //普通站点 if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.IGNOREHASGOODS), "1")) { + if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.IGNOREHASGOODS).getValue(), "1")) { inst.setExecute_status("1"); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); diff --git a/acs/nladmin-system/src/main/resources/config/application-dev.yml b/acs/nladmin-system/src/main/resources/config/application-dev.yml index 5e6b6a9..88b1a59 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -6,10 +6,10 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lnsh_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} - password: ${DB_PWD:P@ssw0rd} + password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456} # 初始连接数 initial-size: 5 diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index 4edd8e5..b83da1b 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -84,7 +84,7 @@ https://juejin.cn/post/6844903775631572999 - + diff --git a/acs/nladmin-ui/src/api/acs/produceshiftorder/produceshiftorder.js b/acs/nladmin-ui/src/api/acs/produceshiftorder/produceshiftorder.js new file mode 100644 index 0000000..955d1ec --- /dev/null +++ b/acs/nladmin-ui/src/api/acs/produceshiftorder/produceshiftorder.js @@ -0,0 +1,35 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/produceshiftorder', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/produceshiftorder/', + method: 'delete', + data: ids + }) +} + +export function finish(order_id) { + return request({ + url: 'api/produceshiftorder/finish/' + order_id, + method: 'post', + data: order_id + }) +} + +export function edit(data) { + return request({ + url: 'api/produceshiftorder', + method: 'put', + data + }) +} + +export default { add, edit, del, finish } diff --git a/acs/nladmin-ui/src/views/acs/device/config.vue b/acs/nladmin-ui/src/views/acs/device/config.vue index c850948..7d79853 100644 --- a/acs/nladmin-ui/src/views/acs/device/config.vue +++ b/acs/nladmin-ui/src/views/acs/device/config.vue @@ -44,8 +44,8 @@ { get(this.device_code).then(data => { - debugger this.form = data.device // 默认是普通站点 // this.currentComponent = 'standard_ordinary_site' diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue new file mode 100644 index 0000000..8d7b59b --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue @@ -0,0 +1,494 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue new file mode 100644 index 0000000..054e017 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue new file mode 100644 index 0000000..dd2d8c5 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue @@ -0,0 +1,499 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue new file mode 100644 index 0000000..e7b5c82 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue new file mode 100644 index 0000000..4594ef6 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue new file mode 100644 index 0000000..1680294 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue @@ -0,0 +1,486 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue new file mode 100644 index 0000000..004e838 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue new file mode 100644 index 0000000..a9892cf --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue new file mode 100644 index 0000000..ac205be --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue new file mode 100644 index 0000000..e8184d5 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue new file mode 100644 index 0000000..8879abb --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue @@ -0,0 +1,474 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue new file mode 100644 index 0000000..7470359 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue new file mode 100644 index 0000000..7ac3c96 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue new file mode 100644 index 0000000..83f408f --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue new file mode 100644 index 0000000..93d47cc --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue @@ -0,0 +1,521 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue new file mode 100644 index 0000000..39a7c28 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue @@ -0,0 +1,589 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue new file mode 100644 index 0000000..f7d3193 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue @@ -0,0 +1,488 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue new file mode 100644 index 0000000..25a238a --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue @@ -0,0 +1,474 @@ + + + + + diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue index 7e82e25..960b244 100644 --- a/acs/nladmin-ui/src/views/acs/instruction/index.vue +++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue @@ -110,7 +110,6 @@ - @@ -127,9 +126,10 @@ 失败 - - - + + + +